重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
npx skills add https://github.com/existential-birds/beagle --skill docs-style在撰写或审阅文档时应用这些原则,以确保对人类读者和大型语言模型都清晰、一致且易于理解。
直接称呼读者为"你",而不是"用户"或"开发者"。
<!-- 推荐 -->
你可以通过设置环境变量来配置 API。
<!-- 避免 -->
用户可以通过设置环境变量来配置 API。
开发者应通过设置环境变量来配置 API。
使用主语执行动作的句子。主动语态更清晰、更直接。
<!-- 推荐 -->
在根目录中创建配置文件。
该函数返回一个用户对象数组。
<!-- 避免 -->
应在根目录中创建配置文件。
用户对象数组由该函数返回。
删除不必要的词语。每个词都应该有其存在的价值。
<!-- 推荐 -->
运行安装命令。
<!-- 避免 -->
为了继续,你需要运行安装命令。
<!-- 推荐 -->
此端点返回用户数据。
<!-- 避免 -->
此端点用于返回用户数据的目的。
常见短语简化建议:
| 避免使用 | 建议使用 |
|---|---|
| in order to | to |
| for the purpose of | to, for |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| in the event that |
| if |
| at this point in time | now |
| due to the fact that | because |
| it is necessary to | you must |
| is able to | can |
| make use of | use |
标题应准确告诉读者该部分包含什么内容。避免使用巧妙或模糊的标题。
<!-- 推荐 -->
## 安装 CLI
## 配置身份验证
## 处理速率限制
<!-- 避免 -->
## 入门指南(模糊)
## 有趣的部分(巧妙)
## 杂项(信息不足)
假设读者可能通过搜索直接访问任何页面。每个页面应:
解释功能/概念是什么
明确说明先决条件
为主题提供完整的上下文
<!-- 推荐:自包含 -->Webhooks 让你在账户中发生事件时接收实时通知。
...
为内容类型选择合适的格式:
标题:遵循正确的层级结构(h1 > h2 > h3,不要跳过层级)
列表:用于多个相关项目
表格:用于具有一致属性的结构化数据
代码块:用于任何代码、命令或文件路径
<!-- 推荐:用于结构化数据的表格 -->| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
| api_key | string | 是 | 你的 API 密钥 |
| timeout | integer | 否 | 请求超时时间(秒) |
要进行身份验证,你可以:
将密集的段落分解为易于理解的部分:
段落最多保持 3-4 句话
使用项目符号列出项目
为长章节添加子标题
将关键信息放在前面(倒金字塔结构)
<!-- 推荐:易于浏览 -->API 返回标准的 HTTP 状态码。
对于 429 错误,使用从 1 秒开始的指数退避策略。
选择一个术语并始终如一地使用。切换术语会混淆读者。
<!-- 推荐:一致的术语 -->
在仪表板中生成 API 密钥。在 Authorization 请求头中使用你的 API 密钥。
<!-- 避免:不一致的术语 -->
在仪表板中生成 API 密钥。在 Authorization 请求头中使用你的 API 令牌。
记录你的术语选择:
| 概念 | 使用 | 避免使用 |
|---|---|---|
| 身份验证凭证 | API 密钥 | API 令牌、密钥、访问密钥 |
| 配置文件 | config file | settings file、preferences file |
| 命令行 | CLI | terminal、command prompt、shell |
对相似的内容类型使用相同的格式:
npm install)/etc/config.yaml)YOUR_API_KEY 或 <api-key>)列出用户开始前需要的内容。这有助于人类和 LLM 理解上下文。
## 先决条件
开始之前,请确保你有:
- 已安装 Node.js 18 或更高版本
- 具有管理员权限的有效账户
- 你的 API 密钥(在**设置 > API**中查找)
在页面上首次出现缩写词时拼写完整。
<!-- 推荐 -->
CLI(命令行界面)提供了管理资源的工具。
后续使用可以直接说"CLI"。
<!-- 避免 -->
CLI 提供了管理资源的工具。
代码示例在复制后应该能够工作。包括:
所有必要的导入
现实的占位符值
预期输出(如有帮助)
<!-- 推荐:完整示例 -->import requests
API_KEY = "your-api-key"
BASE_URL = "https://api.example.com/v1"
response = requests.get(
f"{BASE_URL}/users",
headers={"Authorization": f"Bearer {API_KEY}"}
)
print(response.json())
# Output: {"users": [{"id": 1, "name": "Alice"}, ...]}
response = requests.get(url, headers=headers)
### 撰写描述性的标题和元描述
页面标题和描述有助于搜索和 LLM 理解。
```markdown
---
title: "身份验证 - API 参考"
description: "了解如何使用 API 密钥、OAuth 2.0 或服务账户对 API 请求进行身份验证。"
---
围绕用户目标而不是产品功能来组织文档。
<!-- 推荐:以用户目标为导向 -->
# 发送电子邮件
向你的用户发送交易电子邮件,并提供投递跟踪。
<!-- 避免:以产品为中心 -->
# 电子邮件服务
我们强大的电子邮件服务提供企业级的投递能力。
不要记录自解释的 UI 操作。
<!-- 推荐:有意义的说明 -->
输入你的 webhook URL。URL 必须使用 HTTPS 并可公开访问。
<!-- 避免:显而易见的说明 -->
点击文本框。输入你的 webhook URL。点击保存按钮。
口语化表达会影响清晰度和本地化。
<!-- 推荐 -->
这种方法显著提高了性能。
<!-- 避免 -->
这种方法对性能来说是游戏规则的改变者。
这会让你大吃一惊。
让我们深入探讨!
撰写文档时,请验证:
在以下情况下使用这些原则:
每周安装次数
60
代码仓库
GitHub 星标数
41
首次出现
2026年1月24日
安全审计
已安装于
codex47
claude-code46
gemini-cli45
opencode45
cursor40
github-copilot40
Apply these principles when writing or reviewing documentation to ensure clarity, consistency, and accessibility for both human readers and LLMs.
Address the reader directly as "you" rather than "the user" or "developers."
<!-- Good -->
You can configure the API by setting environment variables.
<!-- Avoid -->
The user can configure the API by setting environment variables.
Developers should configure the API by setting environment variables.
Write sentences where the subject performs the action. Active voice is clearer and more direct.
<!-- Good -->
Create a configuration file in the root directory.
The function returns an array of user objects.
<!-- Avoid -->
A configuration file should be created in the root directory.
An array of user objects is returned by the function.
Cut unnecessary words. Every word should earn its place.
<!-- Good -->
Run the install command.
<!-- Avoid -->
In order to proceed, you will need to run the install command.
<!-- Good -->
This endpoint returns user data.
<!-- Avoid -->
This endpoint is used for the purpose of returning user data.
Common phrases to simplify:
| Instead of | Use |
|---|---|
| in order to | to |
| for the purpose of | to, for |
| in the event that | if |
| at this point in time | now |
| due to the fact that | because |
| it is necessary to | you must |
| is able to | can |
| make use of | use |
Headings should tell readers exactly what the section contains. Avoid clever or vague titles.
<!-- Good -->
## Install the CLI
## Configure Authentication
## Handle Rate Limits
<!-- Avoid -->
## Getting Started (vague)
## The Fun Part (clever)
## Misc (uninformative)
Assume readers may land on any page directly from search. Each page should:
Explain what the feature/concept is
State prerequisites clearly
Provide complete context for the topic
<!-- Good: Self-contained -->Webhooks let you receive real-time notifications when events occur in your account.
...
Choose the right format for the content type:
Headings : Follow proper hierarchy (h1 > h2 > h3, never skip levels)
Lists : Use for multiple related items
Tables : Use for structured data with consistent attributes
Code blocks : Use for any code, commands, or file paths
<!-- Good: Table for structured data -->| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | string | Yes | Your API key |
| timeout | integer | No | Request timeout in seconds |
To authenticate, you can:
Break dense paragraphs into digestible chunks:
Keep paragraphs to 3-4 sentences maximum
Use bullet points for lists of items
Add subheadings to long sections
Put key information first (inverted pyramid)
<!-- Good: Skimmable -->The API returns standard HTTP status codes.
For 429 errors, use exponential backoff starting at 1 second.
Pick a term and use it consistently. Switching terms confuses readers.
<!-- Good: Consistent terminology -->
Generate an API key in the dashboard. Use your API key in the Authorization header.
<!-- Avoid: Inconsistent terminology -->
Generate an API key in the dashboard. Use your API token in the Authorization header.
Document your terminology choices:
| Concept | Use | Don't use |
|---|---|---|
| Authentication credential | API key | API token, secret key, access key |
| Configuration file | config file | settings file, preferences file |
| Command line | CLI | terminal, command prompt, shell |
Use the same formatting for similar content types:
npm install)/etc/config.yaml)YOUR_API_KEY or <api-key>)List what users need before starting. This helps both humans and LLMs understand context.
## Prerequisites
Before you begin, ensure you have:
- Node.js 18 or later installed
- An active account with admin permissions
- Your API key (find it in **Settings > API**)
Spell out acronyms the first time they appear on a page.
<!-- Good -->
The CLI (Command Line Interface) provides tools for managing your resources.
Subsequent uses can just say "CLI."
<!-- Avoid -->
The CLI provides tools for managing your resources.
Code examples should work when copied. Include:
All necessary imports
Realistic placeholder values
Expected output (when helpful)
<!-- Good: Complete example -->import requests
API_KEY = "your-api-key"
BASE_URL = "https://api.example.com/v1"
response = requests.get(
f"{BASE_URL}/users",
headers={"Authorization": f"Bearer {API_KEY}"}
)
print(response.json())
# Output: {"users": [{"id": 1, "name": "Alice"}, ...]}
response = requests.get(url, headers=headers)
### Write Descriptive Titles and Meta Descriptions
Page titles and descriptions help with search and LLM understanding.
```markdown
---
title: "Authentication - API Reference"
description: "Learn how to authenticate API requests using API keys, OAuth 2.0, or service accounts."
---
Orient documentation around user goals, not product features.
<!-- Good: User-goal oriented -->
# Send Emails
Send transactional emails to your users with delivery tracking.
<!-- Avoid: Product-centric -->
# Email Service
Our powerful email service provides enterprise-grade delivery.
Don't document self-explanatory UI actions.
<!-- Good: Meaningful instruction -->
Enter your webhook URL. The URL must use HTTPS and be publicly accessible.
<!-- Avoid: Obvious instruction -->
Click in the text field. Type your webhook URL. Click the Save button.
Colloquialisms hurt clarity and localization.
<!-- Good -->
This approach significantly improves performance.
<!-- Avoid -->
This approach is a game-changer for performance.
This will blow your mind.
Let's dive in!
When writing documentation, verify:
Use these principles when:
Weekly Installs
60
Repository
GitHub Stars
41
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex47
claude-code46
gemini-cli45
opencode45
cursor40
github-copilot40
API文档生成与管理指南:OpenAPI规范、Swagger使用教程与团队协作
11,700 周安装