skill-optimizer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSkill Creator
Skill 创建指南
This skill provides guidance for creating effective skills.
本Skill为创建高效技能提供指导。
About Skills
Skill 介绍
Skills are modular, self-contained packages that extend Claude's capabilities by providing specialized knowledge, workflows, and tools. Think of them as "onboarding guides" for specific domains or tasks—they transform Claude from a general-purpose agent into a specialized agent equipped with procedural knowledge that no model can fully possess.
Skills follow the Agent Skills open standard, with Claude Code extensions for invocation control, subagent execution, and dynamic context injection.
Skill是模块化、独立的包,通过提供专业知识、工作流和工具来扩展Claude的能力。可以将其视为特定领域或任务的“入门指南”——它们将Claude从通用型Agent转变为具备过程知识的专业Agent,而这类知识是任何模型都无法完全拥有的。
Skill遵循Agent Skills开放标准,并针对Claude Code扩展了调用控制、子Agent执行和动态上下文注入功能。
What Skills Provide
Skill 提供的能力
- Specialized workflows - Multi-step procedures for specific domains
- Tool integrations - Instructions for working with specific file formats or APIs
- Domain expertise - Company-specific knowledge, schemas, business logic
- Bundled resources - Scripts, references, and assets for complex and repetitive tasks
- 专业工作流 - 特定领域的多步骤流程
- 工具集成 - 处理特定文件格式或API的操作说明
- 领域专业知识 - 公司特定的知识、架构、业务逻辑
- 捆绑资源 - 用于复杂重复任务的脚本、参考资料和资产
Anatomy of a Skill
Skill 的结构
Every skill consists of a required SKILL.md file and optional bundled resources:
skill-name/
├── SKILL.md (required)
│ ├── YAML frontmatter metadata
│ └── Markdown instructions
└── Bundled Resources (optional)
├── scripts/ - Executable code (Python/Bash/etc.)
├── references/ - Documentation loaded into context as needed
└── assets/ - Files used in output (templates, icons, fonts)每个Skill都包含一个必填的SKILL.md文件和可选的捆绑资源:
skill-name/
├── SKILL.md (required)
│ ├── YAML frontmatter metadata
│ └── Markdown instructions
└── Bundled Resources (optional)
├── scripts/ - Executable code (Python/Bash/etc.)
├── references/ - Documentation loaded into context as needed
└── assets/ - Files used in output (templates, icons, fonts)SKILL.md (required)
SKILL.md(必填)
Metadata Quality: The and in YAML frontmatter determine when Claude will use the skill. Be specific about what the skill does and when to use it. Use the third-person (e.g. "This skill should be used when..." instead of "Use this skill when...").
namedescriptionFrontmatter Fields:
| Field | Required | Description |
|---|---|---|
| No | Display name (max 64 chars, lowercase + hyphens). Defaults to directory name. |
| Recommended | What the skill does and when to use it (max 1024 chars). |
| No | Hint shown during autocomplete (e.g., |
| No | |
| No | |
| No | Restrict tools when skill is active (e.g., |
| No | Model override when skill is active. |
| No | |
| No | Subagent type: |
| No | Scoped hooks for skill lifecycle. See Hooks docs. |
Example with all fields:
yaml
---
name: deploy-production
description: Deploy the application to production. Use after all tests pass.
argument-hint: [environment]
disable-model-invocation: true
allowed-tools: Bash(deploy:*), Read
context: fork
agent: general-purpose
---元数据质量: YAML前置元数据中的和决定了Claude何时使用该Skill。请明确说明Skill的功能和适用场景。使用第三人称表述(例如:“当...时应使用本Skill”而非“当...时使用本Skill”)。
namedescription前置元数据字段:
| 字段 | 是否必填 | 描述 |
|---|---|---|
| 否 | 显示名称(最多64个字符,小写+连字符)。默认值为目录名称。 |
| 推荐 | Skill的功能和适用场景(最多1024个字符)。 |
| 否 | 自动补全时显示的提示(例如: |
| 否 | |
| 否 | |
| 否 | 限制Skill激活时可使用的工具(例如: |
| 否 | Skill激活时的模型覆盖设置。 |
| 否 | |
| 否 | 子Agent类型: |
| 否 | Skill生命周期的作用域钩子。参见Hooks文档。 |
包含所有字段的示例:
yaml
---
name: deploy-production
description: Deploy the application to production. Use after all tests pass.
argument-hint: [environment]
disable-model-invocation: true
allowed-tools: Bash(deploy:*), Read
context: fork
agent: general-purpose
---String Substitutions
字符串替换
Skills support dynamic value substitution in the markdown content:
| Variable | Description |
|---|---|
| All arguments passed when invoking (e.g., |
| Current session ID for logging or session-specific files |
If is not present in content, arguments are appended as .
$ARGUMENTSARGUMENTS: <value>Example:
markdown
---
name: fix-issue
description: Fix a GitHub issue
disable-model-invocation: true
---
Fix GitHub issue $ARGUMENTS following our coding standards.
Log progress to logs/${CLAUDE_SESSION_ID}.logSkill支持在Markdown内容中进行动态值替换:
| 变量 | 描述 |
|---|---|
| 调用时传递的所有参数(例如: |
| 当前会话ID,用于日志或会话特定文件 |
如果内容中未包含,参数将以的形式追加到内容末尾。
$ARGUMENTSARGUMENTS: <value>示例:
markdown
---
name: fix-issue
description: Fix a GitHub issue
disable-model-invocation: true
---
Fix GitHub issue $ARGUMENTS following our coding standards.
Log progress to logs/${CLAUDE_SESSION_ID}.logDynamic Context Injection
动态上下文注入
The exclamation-backtick syntax runs shell commands before skill content reaches Claude. The command output replaces the placeholder.
Syntax: exclamation mark followed by backtick-wrapped command: +
EXCLAIMBACKTICK command BACKTICKExample skill content:
undefined感叹号+反引号语法会在Skill内容传递给Claude之前执行Shell命令,命令输出将替换占位符。
语法: 感叹号后跟反引号包裹的命令: +
!`command`Skill内容示例:
undefinedPR Context
PR 上下文
- Diff: EXCLAIM-BACKTICK gh pr diff BACKTICK
- Comments: EXCLAIM-BACKTICK gh pr view --comments BACKTICK
- Changed files: EXCLAIM-BACKTICK gh pr diff --name-only BACKTICK
Summarize this pull request...
(Replace EXCLAIM with the exclamation mark character and BACKTICK with the backtick character in real skills)
When this skill runs:
1. Each exclamation-backtick command executes immediately (before Claude sees anything)
2. The output replaces the placeholder in the skill content
3. Claude receives the fully-rendered prompt with actual data
This is preprocessing, not something Claude executes. Claude only sees the final result.- 差异:!
gh pr diff - 评论:!
gh pr view --comments - 修改文件:!
gh pr diff --name-only
总结本次拉取请求...
(在实际Skill中,将EXCLAIM替换为感叹号字符,BACKTICK替换为反引号字符)
当该Skill运行时:
1. 每个感叹号+反引号命令会立即执行(在Claude看到任何内容之前)
2. 输出会替换Skill内容中的占位符
3. Claude会收到包含实际数据的完整渲染提示
这是预处理步骤,并非由Claude执行。Claude仅能看到最终结果。Invocation Control
调用控制
By default, both users and Claude can invoke any skill. Two frontmatter fields control this:
| Frontmatter | User can invoke | Claude can invoke | In context |
|---|---|---|---|
| (default) | Yes | Yes | Description always visible |
| Yes | No | Description hidden from Claude |
| No | Yes | Description always visible |
When to use each:
- : For workflows with side effects (deploy, commit, send-message). Prevents Claude from triggering automatically.
disable-model-invocation: true - : For background knowledge that isn't a meaningful command (e.g.,
user-invocable: false). Claude should know this when relevant, butlegacy-system-contextisn't useful for users./legacy-system-context
默认情况下,用户和Claude都可以调用任何Skill。两个前置元数据字段可控制这一权限:
| 前置元数据 | 用户可调用 | Claude可调用 | 上下文可见性 |
|---|---|---|---|
| 默认 | 是 | 是 | 描述始终可见 |
| 是 | 否 | 描述对Claude隐藏 |
| 否 | 是 | 描述始终可见 |
适用场景:
- :适用于有副作用的工作流(部署、提交、发送消息)。防止Claude自动触发。
disable-model-invocation: true - :适用于非命令型的背景知识(例如:
user-invocable: false)。Claude在相关场景下需要知晓,但legacy-system-context对用户无实际用途。/legacy-system-context
Subagent Integration
子Agent集成
Add to run skills in isolation. The skill content becomes the subagent's prompt (no conversation history access).
context: forkyaml
---
name: deep-research
description: Research a topic thoroughly
context: fork
agent: Explore
---
Research $ARGUMENTS thoroughly:
1. Find relevant files using Glob and Grep
2. Read and analyze the code
3. Summarize findings with specific file referencesAgent options:
| Agent | Description |
|---|---|
| Read-only codebase exploration (Glob, Grep, Read) |
| Architecture planning and design |
| Full capabilities (default) |
| Custom | Any agent from |
Note: only makes sense for skills with explicit instructions. Guidelines-only skills (e.g., "use these API conventions") receive no actionable prompt and return without meaningful output.
context: fork添加可在独立环境中运行Skill。Skill内容将作为子Agent的提示(无法访问对话历史)。
context: forkyaml
---
name: deep-research
description: Research a topic thoroughly
context: fork
agent: Explore
---
Research $ARGUMENTS thoroughly:
1. Find relevant files using Glob and Grep
2. Read and analyze the code
3. Summarize findings with specific file referencesAgent选项:
| Agent | 描述 |
|---|---|
| 只读代码库探索(Glob、Grep、Read) |
| 架构规划与设计 |
| 完整能力(默认) |
| Custom | |
注意: 仅适用于包含明确指令的Skill。仅含指南的Skill(例如:“使用这些API约定”)因无可行提示,将无意义输出并返回。
context: forkSkill Locations
Skill 存储位置
Where a skill is stored determines who can use it:
| Location | Path | Applies to | Priority |
|---|---|---|---|
| Enterprise | Managed settings | All org users | Highest |
| Personal | | All your projects | High |
| Project | | This project only | Medium |
| Plugin | | Where plugin enabled | Namespaced |
When skills share the same name, higher-priority locations win. Plugin skills use namespace, so they cannot conflict.
plugin-name:skill-nameNested discovery: When editing files in subdirectories (e.g., ), Claude Code also discovers skills from nested directories. This supports monorepos where packages have their own skills.
packages/frontend/.claude/skills/Legacy commands: Files in still work with the same frontmatter. Skills are recommended since they support additional features like supporting files.
.claude/commands/Skill以目录形式存在于本地文件系统中,Claude通过Bash命令和文件操作与之交互。
Claude访问Skill内容的方式:
- 读取指令: 当Skill被触发时,Claude通过Bash从文件系统读取SKILL.md,将其指令带入上下文
- 加载参考资料: 如果指令引用了其他文件(如或数据库架构),Claude会通过额外的Bash命令读取这些文件
references/api_docs.md - 执行脚本: 当指令提到可执行脚本时,Claude通过Bash运行它们。仅脚本输出会进入上下文,代码本身不会
这带来的能力:
- 按需文件访问: Claude仅读取每个任务所需的文件。一个Skill可以包含数十个参考文件,但如果您的任务仅需要一个架构,Claude只会加载该文件。其余文件不会消耗任何令牌
- 高效脚本执行: 当Claude运行时,仅输出会消耗令牌,而非200行的脚本。这使得脚本比Claude实时生成等效代码高效得多
validate_form.py - 捆绑内容无实际限制: 因为文件在被访问前不会消耗上下文,所以Skill可以包含全面的文档、数据集、示例或参考资料,而不会产生上下文开销
工作流示例:
1. 用户:“处理此PDF并提取表格”
2. Claude:bash: read pdf-skill/SKILL.md
3. SKILL.md提到scripts/extract_tables.py
4. Claude:bash: python scripts/extract_tables.py input.pdf
5. 脚本输出:“提取了3个表格:[表格数据...]”
6. Claude使用提取的数据继续处理(脚本代码从未进入上下文)Bundled Resources (optional)
Skill 创建流程
Scripts (scripts/
)
scripts/—
Content Type: Code - Executable code (Python/Bash/etc.) for tasks that require deterministic reliability or are repeatedly rewritten.
- When to include: When the same code is being rewritten repeatedly or deterministic reliability is needed
- Example: for PDF rotation tasks
scripts/rotate_pdf.py - Benefits: Token efficient, deterministic, script code never enters context - only output does
- Key advantage: A 200-line script only costs ~20 tokens (the output), not 2000+ tokens (the code)
- Note: Scripts may still need to be read by Claude for patching or environment-specific adjustments
要创建Skill,请按“Skill创建流程”顺序执行步骤,仅在明确某步骤不适用时才可跳过。
References (references/
)
references/步骤1:通过具体示例理解Skill
Content Type: Instructions - Documentation and reference material intended to be loaded as needed into context to inform Claude's process and thinking.
- When to include: For documentation that Claude should reference while working
- Examples: for financial schemas,
references/finance.mdfor company NDA template,references/mnda.mdfor company policies,references/policies.mdfor API specificationsreferences/api_docs.md - Use cases: Database schemas, API documentation, domain knowledge, company policies, detailed workflow guides
- Benefits: Keeps SKILL.md lean, loaded only when Claude determines it's needed
- Best practice: If files are large (>10k words), include grep search patterns in SKILL.md
- Avoid duplication: Information should live in either SKILL.md or references files, not both. Prefer references files for detailed information unless it's truly core to the skill—this keeps SKILL.md lean while making information discoverable without hogging the context window. Keep only essential procedural instructions and workflow guidance in SKILL.md; move detailed reference material, schemas, and examples to references files.
仅当Skill的使用模式已清晰理解时,才可跳过此步骤。即使处理现有Skill,此步骤仍有价值。
要创建有效的Skill,需清晰理解Skill的具体使用示例。这种理解可来自直接的用户示例,或经用户反馈验证的生成示例。
例如,在构建图像编辑器Skill时,相关问题包括:
- “图像编辑器Skill应支持哪些功能?编辑、旋转,或其他功能?”
- “能否提供一些该Skill的使用示例?”
- “我可以想象用户会要求‘去除这张图片的红眼’或‘旋转这张图片’。您认为用户还会以哪些方式使用该Skill?”
- “用户说什么话时应该触发该Skill?”
为避免使用户不知所措,请勿在一条消息中提出过多问题。从最重要的问题开始,根据需要跟进以提高效率。
当明确Skill应支持的功能时,即可结束此步骤。
Assets (assets/
)
assets/步骤2:规划可复用的Skill内容
Content Type: Resources - Files not intended to be loaded into context, but rather used within the output Claude produces.
- When to include: When the skill needs files that will be used in the final output
- Examples: for brand assets,
assets/logo.pngfor PowerPoint templates,assets/slides.pptxfor HTML/React boilerplate,assets/frontend-template/for typographyassets/font.ttf - Use cases: Templates, images, icons, boilerplate code, fonts, sample documents that get copied or modified
- Benefits: Separates output resources from documentation, enables Claude to use files without loading them into context
要将具体示例转化为有效的Skill,请通过以下方式分析每个示例:
- 考虑如何从头开始执行该示例
- 确定在重复执行这些工作流时,哪些脚本、参考资料和资源文件会有帮助
示例:当构建Skill以处理“帮我旋转此PDF”等查询时,分析结果如下:
pdf-editor- 旋转PDF需要重复编写相同的代码
- 在Skill中存储脚本会很有帮助
scripts/rotate_pdf.py
示例:当设计Skill以处理“帮我构建一个待办事项应用”或“帮我构建一个步骤跟踪仪表板”等查询时,分析结果如下:
frontend-webapp-builder- 构建前端Web应用需要重复编写相同的HTML/React样板代码
- 在Skill中存储包含HTML/React项目样板代码的模板会很有帮助
assets/hello-world/
示例:当构建Skill以处理“今天有多少用户登录?”等查询时,分析结果如下:
big-query- 查询BigQuery需要重复发现表架构和关系
- 在Skill中存储记录表架构的文件会很有帮助
references/schema.md
要确定Skill的内容,请分析每个具体示例,创建要包含的可复用资源列表:脚本、参考资料和资源文件。
Progressive Disclosure Design Principle
步骤3:初始化Skill
Skills use a three-level loading system to manage context efficiently:
| Level | When Loaded | Token Cost | Content |
|---|---|---|---|
| Level 1: Metadata | Always (at startup) | ~100 tokens per Skill | |
| Level 2: Instructions | When Skill is triggered | Under 5k tokens | SKILL.md body with instructions and guidance |
| Level 3+: Resources | As needed | Effectively unlimited* | Bundled files executed via bash without loading into context |
*Scripts are executed without loading code into context (only output enters context). Reference files and assets are loaded only when Claude explicitly accesses them via bash commands.
Key insight: You can install dozens of Skills with minimal context penalty. Claude only knows each Skill exists and when to use it until one is triggered.
Context budget: Skill descriptions are loaded into context so Claude knows what's available. If you have many skills, they may exceed the character budget (default 15,000 characters). Run to check for excluded skills. To increase the limit, set environment variable.
/contextSLASH_COMMAND_TOOL_CHAR_BUDGET此时,应实际创建Skill。
仅当正在开发的Skill已存在,且需要迭代或打包时,才可跳过此步骤。在这种情况下,继续执行下一步。
从头开始创建新Skill时,请始终运行脚本。该脚本会方便地生成一个新的模板Skill目录,自动包含Skill所需的所有内容,使Skill创建过程更加高效和可靠。
init_skill.py使用方法:
bash
scripts/init_skill.py <skill-name> --path <output-directory>该脚本会:
- 在指定路径创建Skill目录
- 生成包含正确前置元数据和TODO占位符的SKILL.md模板
- 创建示例资源目录:、
scripts/和references/assets/ - 在每个目录中添加可自定义或删除的示例文件
初始化完成后,根据需要自定义或删除生成的SKILL.md和示例文件。
The Skills Filesystem Architecture
步骤4:编辑Skill
Skills exist as directories on the local filesystem, and Claude interacts with them using bash commands and file operations.
How Claude accesses Skill content:
- Reading instructions: When a Skill is triggered, Claude reads SKILL.md from the filesystem via bash, bringing its instructions into context
- Loading references: If instructions reference other files (like or database schemas), Claude reads those files using additional bash commands
references/api_docs.md - Executing scripts: When instructions mention executable scripts, Claude runs them via bash. Only the script output enters context, not the code itself
What this enables:
- On-demand file access: Claude reads only the files needed for each task. A Skill can include dozens of reference files, but if your task only needs one schema, Claude loads just that file. The rest consume zero tokens
- Efficient script execution: When Claude runs , only the output consumes tokens, not the 200-line script. This makes scripts far more efficient than having Claude generate equivalent code on the fly
validate_form.py - No practical limit on bundled content: Because files don't consume context until accessed, Skills can include comprehensive documentation, datasets, examples, or reference materials without context penalty
Example workflow:
1. User: "Process this PDF and extract tables"
2. Claude: bash: read pdf-skill/SKILL.md
3. SKILL.md mentions scripts/extract_tables.py
4. Claude: bash: python scripts/extract_tables.py input.pdf
5. Script output: "Extracted 3 tables: [table data...]"
6. Claude proceeds using the extracted data (script code never entered context)编辑(新生成或现有)Skill时,请记住该Skill是为另一个Claude实例创建的。重点包含对Claude有益且非显而易见的信息。考虑哪些过程知识、领域特定细节或可复用资源能帮助另一个Claude实例更有效地执行这些任务。
Skill Creation Process
从可复用Skill内容开始
To create a skill, follow the "Skill Creation Process" in order, skipping steps only if there is a clear reason why they are not applicable.
要开始实现,请从上述确定的可复用资源开始:、和文件。请注意,此步骤可能需要用户输入。例如,在实现Skill时,用户可能需要提供品牌资产或模板以存储在中,或提供文档以存储在中。
scripts/references/assets/brand-guidelinesassets/references/此外,删除Skill不需要的任何示例文件和目录。初始化脚本会在、和中创建示例文件以展示结构,但大多数Skill不需要所有这些文件。
scripts/references/assets/Step 1: Understanding the Skill with Concrete Examples
从文档填充参考资料(可选)
Skip this step only when the skill's usage patterns are already clearly understood. It remains valuable even when working with an existing skill.
To create an effective skill, clearly understand concrete examples of how the skill will be used. This understanding can come from either direct user examples or generated examples that are validated with user feedback.
For example, when building an image-editor skill, relevant questions include:
- "What functionality should the image-editor skill support? Editing, rotating, anything else?"
- "Can you give some examples of how this skill would be used?"
- "I can imagine users asking for things like 'Remove the red-eye from this image' or 'Rotate this image'. Are there other ways you imagine this skill being used?"
- "What would a user say that should trigger this skill?"
To avoid overwhelming users, avoid asking too many questions in a single message. Start with the most important questions and follow up as needed for better effectiveness.
Conclude this step when there is a clear sense of the functionality the skill should support.
对于基于现有框架、库或工具且具备在线文档的Skill,可使用Skill_Seekers(v2.0.0+)自动抓取并整理文档到目录。Skill_Seekers现在支持统一多源抓取,将文档网站、GitHub仓库和PDF文件合并为全面的参考资料。
references/适用场景:
- 为具备全面在线文档的框架构建Skill(React、Django、FastAPI等)
- 为游戏引擎创建Skill(Godot、Unity)
- 为API或库编写具备Web文档的Skill
- 直接从GitHub源代码提取API参考
- 合并多个来源(文档+代码+PDF)以创建全面的Skill
- 检测文档与实际实现之间的差异
快速开始:
bash
undefinedStep 2: Planning the Reusable Skill Contents
一次性设置
To turn concrete examples into an effective skill, analyze each example by:
- Considering how to execute on the example from scratch
- Identifying what scripts, references, and assets would be helpful when executing these workflows repeatedly
Example: When building a skill to handle queries like "Help me rotate this PDF," the analysis shows:
pdf-editor- Rotating a PDF requires re-writing the same code each time
- A script would be helpful to store in the skill
scripts/rotate_pdf.py
Example: When designing a skill for queries like "Build me a todo app" or "Build me a dashboard to track my steps," the analysis shows:
frontend-webapp-builder- Writing a frontend webapp requires the same boilerplate HTML/React each time
- An template containing the boilerplate HTML/React project files would be helpful to store in the skill
assets/hello-world/
Example: When building a skill to handle queries like "How many users have logged in today?" the analysis shows:
big-query- Querying BigQuery requires re-discovering the table schemas and relationships each time
- A file documenting the table schemas would be helpful to store in the skill
references/schema.md
To establish the skill's contents, analyze each concrete example to create a list of the reusable resources to include: scripts, references, and assets.
git clone https://github.com/yusufkaraaslan/Skill_Seekers.git ~/Skill_Seekers
cd ~/Skill_Seekers
pip install requests beautifulsoup4
Step 3: Initializing the Skill
选项1:仅文档抓取(经典方法)
At this point, it is time to actually create the skill.
Skip this step only if the skill being developed already exists, and iteration or packaging is needed. In this case, continue to the next step.
When creating a new skill from scratch, always run the script. The script conveniently generates a new template skill directory that automatically includes everything a skill requires, making the skill creation process much more efficient and reliable.
init_skill.pyUsage:
bash
scripts/init_skill.py <skill-name> --path <output-directory>The script:
- Creates the skill directory at the specified path
- Generates a SKILL.md template with proper frontmatter and TODO placeholders
- Creates example resource directories: ,
scripts/, andreferences/assets/ - Adds example files in each directory that can be customized or deleted
After initialization, customize or remove the generated SKILL.md and example files as needed.
python3 cli/doc_scraper.py --config configs/react.json
cp -r output/react/references/* /path/to/your-skill/references/
Step 4: Edit the Skill
选项2:仅GitHub抓取(从源代码提取API)
When editing the (newly-generated or existing) skill, remember that the skill is being created for another instance of Claude to use. Focus on including information that would be beneficial and non-obvious to Claude. Consider what procedural knowledge, domain-specific details, or reusable assets would help another Claude instance execute these tasks more effectively.
python3 cli/github_scraper.py --repo facebook/react --extract-api
cp -r output/react_github/references/* /path/to/your-skill/references/
Start with Reusable Skill Contents
选项3:统一多源抓取(推荐)
—
将文档+GitHub代码+PDF合并为一个全面的Skill
To begin implementation, start with the reusable resources identified above: , , and files. Note that this step may require user input. For example, when implementing a skill, the user may need to provide brand assets or templates to store in , or documentation to store in .
scripts/references/assets/brand-guidelinesassets/references/Also, delete any example files and directories not needed for the skill. The initialization script creates example files in , , and to demonstrate structure, but most skills won't need all of them.
scripts/references/assets/python3 cli/unified_scraper.py --config configs/react_unified.json
cp -r output/react_complete/references/* /path/to/your-skill/references/
Populating References from Documentation (Optional)
选项4:自定义统一配置
For skills based on existing frameworks, libraries, or tools with online documentation, use Skill_Seekers (v2.0.0+) to automatically scrape and organize documentation into the directory. Skill_Seekers now supports unified multi-source scraping, combining documentation websites, GitHub repositories, and PDF files into comprehensive reference materials.
references/When to use this approach:
- Building skills for frameworks with comprehensive online docs (React, Django, FastAPI, etc.)
- Creating skills for game engines (Godot, Unity)
- Documenting APIs or libraries with web-based documentation
- Extracting API references directly from GitHub source code
- Combining multiple sources (docs + code + PDFs) for comprehensive skills
- Detecting discrepancies between documentation and actual implementation
Quick Start:
bash
undefinedpython3 cli/config_validator.py configs/myframework_unified.json
python3 cli/unified_scraper.py --config configs/myframework_unified.json
**替代方案:** 对于简单需求或非Web文档,手动在`references/`目录中创建参考文件。
有关Skill_Seekers的详细文档,请参见`references/documentation-scraping.md`。One-time setup
更新SKILL.md
git clone https://github.com/yusufkaraaslan/Skill_Seekers.git ~/Skill_Seekers
cd ~/Skill_Seekers
pip install requests beautifulsoup4
写作风格: 使用祈使/不定式形式(动词开头的指令)编写整个Skill,而非第二人称。使用客观的说明性语言(例如:“要完成X,请执行Y”而非“您应该做X”或“如果您需要做X”)。这保持了AI消费的一致性和清晰度。避免使用全大写字母强调——改用粗体Markdown或章节标题。避免使用CRITICAL/MANDATORY/MUST等限定词;直接的祈使句对Claude 4.6已足够。
要完成SKILL.md,请回答以下问题:
- Skill的用途是什么?用几句话说明。
- 何时应使用该Skill?
- 实际上,Claude应如何使用该Skill?应引用上述开发的所有可复用Skill内容,以便Claude了解如何使用它们。
Option 1: Documentation-only scraping (classic approach)
Claude 4.6 提示对齐
python3 cli/doc_scraper.py --config configs/react.json
cp -r output/react/references/* /path/to/your-skill/references/
编写或审核Skill指令时,请遵循以下模式:
语言校准:
- 使用直接的祈使句,无需全大写强调。例如“使用Firecrawl进行网页抓取”而非“始终使用Firecrawl”或“您必须使用Firecrawl”。
- 用普通标题替换CRITICAL/MANDATORY/MUST标记。Claude 4.6会遵循结构清晰的指令,无需强制框架。
- 说明指令背后的原因。例如“使用--only-main-content以减少令牌消耗”而非“始终使用--only-main-content”。Claude从解释中泛化能力更强。
移除反懒惰提示:
- 请勿包含“彻底完成”、“仔细思考”、“不要偷懒”或激励性框架。Claude 4.6本身已具备主动性——这些提示会将其放大为过度规划或写了又改的循环。
子Agent指导(针对编排Skill):
- 包含明确的指导,说明何时不应生成Agent。Claude 4.6即使在直接方法更快的情况下,也倾向于使用子Agent。
- 例如:“当任务可并行运行或需要隔离上下文时使用Agent。对于顺序任务、单文件编辑或可在5分钟内完成的工作,直接处理即可。”
防止过度积极:
- 包含关于最小化解决方案的指导。事实质量标准(“遵循现有约定”)优于激励性框架(“对抗熵增”)。
Option 2: GitHub-only scraping (extract API from source code)
步骤5:打包Skill
python3 cli/github_scraper.py --repo facebook/react --extract-api
cp -r output/react_github/references/* /path/to/your-skill/references/
Skill准备就绪后,应将其打包为可分发的ZIP文件,与用户共享。打包过程会先自动验证Skill,确保其符合所有要求:
bash
scripts/package_skill.py <path/to/skill-folder>可选的输出目录指定:
bash
scripts/package_skill.py <path/to/skill-folder> ./dist打包脚本会:
-
自动验证Skill,检查:
- YAML前置元数据格式和必填字段
- Skill命名约定和目录结构
- 描述的完整性和质量
- 文件组织和资源引用
-
打包Skill(如果验证通过),创建以Skill命名的ZIP文件(例如:),包含所有文件并保持正确的目录结构以便分发。
my-skill.zip
如果验证失败,脚本会报告错误并退出,不会创建包。修复所有验证错误后,重新运行打包命令。
Option 3: Unified multi-source scraping (RECOMMENDED)
步骤6:迭代
Combines documentation + GitHub code + PDFs into one comprehensive skill
—
python3 cli/unified_scraper.py --config configs/react_unified.json
cp -r output/react_complete/references/* /path/to/your-skill/references/
测试Skill后,用户可能会要求改进。通常这会在使用Skill后立即发生,此时用户对Skill的表现有清晰的上下文。
迭代工作流:
- 在实际任务中使用Skill
- 注意遇到的困难或低效之处
- 确定应如何更新SKILL.md或捆绑资源
- 实施更改并再次测试
Option 4: Custom unified config
共享Skill
python3 cli/config_validator.py configs/myframework_unified.json
python3 cli/unified_scraper.py --config configs/myframework_unified.json
**Alternative:** For simpler needs or when documentation is not web-based, manually create reference files in the `references/` directory.
For detailed Skill_Seekers documentation, see `references/documentation-scraping.md`.Update SKILL.md
故障排除
—
Skill未触发
Writing Style: Write the entire skill using imperative/infinitive form (verb-first instructions), not second person. Use objective, instructional language (e.g., "To accomplish X, do Y" rather than "You should do X" or "If you need to do X"). This maintains consistency and clarity for AI consumption. Avoid ALL CAPS for emphasis — use bold markdown or section headings instead. Avoid CRITICAL/MANDATORY/MUST qualifiers; direct imperatives are sufficient for Claude 4.6.
To complete SKILL.md, answer the following questions:
- What is the purpose of the skill, in a few sentences?
- When should the skill be used?
- In practice, how should Claude use the skill? All reusable skill contents developed above should be referenced so that Claude knows how to use them.
如果Claude未在预期时使用Skill:
- 检查描述是否包含用户自然会使用的关键词
- 验证Skill在响应“What skills are available?”时是否显示
- 尝试重新表述请求,使其更匹配描述
- 如果Skill允许用户调用,直接使用调用
/skill-name
Claude 4.6 Prompting Alignment
Skill触发过于频繁
When writing or reviewing skill instructions, follow these patterns:
Language calibration:
- Use direct imperatives without ALL CAPS emphasis. "Use Firecrawl for web scraping" not "ALWAYS use Firecrawl" or "You MUST use Firecrawl."
- Replace CRITICAL/MANDATORY/MUST markers with plain headings. Claude 4.6 follows well-structured instructions without coercive framing.
- Explain WHY behind directives. "Use --only-main-content to reduce token consumption" not "ALWAYS use --only-main-content." Claude generalizes better from explanations.
Remove anti-laziness prompts:
- Do not include "be thorough," "think carefully," "do not be lazy," or motivational framing. Claude 4.6 is already proactive — these amplify it into over-planning or write-then-rewrite loops.
Subagent guidance (for orchestration skills):
- Include explicit guidance on when NOT to spawn agents. Claude 4.6 tends to reach for subagents even when a direct approach is faster.
- "Use agents when tasks can run in parallel or require isolated context. For sequential tasks, single-file edits, or work completable in under 5 minutes, work directly."
Overeagerness prevention:
- Include guidance about minimal solutions. Factual quality criteria ("maintain existing conventions") outperform motivational framing ("fight entropy").
如果Claude在不需要时使用Skill:
- 使描述更具体
- 如果仅需要手动调用,添加
disable-model-invocation: true
Step 5: Packaging a Skill
Claude无法看到所有Skill
Once the skill is ready, it should be packaged into a distributable zip file that gets shared with the user. The packaging process automatically validates the skill first to ensure it meets all requirements:
bash
scripts/package_skill.py <path/to/skill-folder>Optional output directory specification:
bash
scripts/package_skill.py <path/to/skill-folder> ./distThe packaging script will:
-
Validate the skill automatically, checking:
- YAML frontmatter format and required fields
- Skill naming conventions and directory structure
- Description completeness and quality
- File organization and resource references
-
Package the skill if validation passes, creating a zip file named after the skill (e.g.,) that includes all files and maintains the proper directory structure for distribution.
my-skill.zip
If validation fails, the script will report the errors and exit without creating a package. Fix any validation errors and run the packaging command again.
Skill描述会加载到上下文中。如果有多个Skill,它们可能会超出字符预算(默认15000字符)。运行命令检查是否有关于排除Skill的警告。
/context要提高限制,设置环境变量。
SLASH_COMMAND_TOOL_CHAR_BUDGETStep 6: Iterate
相关资源
After testing the skill, users may request improvements. Often this happens right after using the skill, with fresh context of how the skill performed.
Iteration workflow:
- Use the skill on real tasks
- Notice struggles or inefficiencies
- Identify how SKILL.md or bundled resources should be updated
- Implement changes and test again
Sharing Skills
—
Skills can be distributed at different scopes:
- Project skills: Commit to version control
.claude/skills/ - Plugins: Create a directory in your plugin
skills/ - Managed: Deploy organization-wide through managed settings
—
Troubleshooting
—
Skill not triggering
—
If Claude doesn't use a skill when expected:
- Check the description includes keywords users would naturally say
- Verify the skill appears in response to "What skills are available?"
- Try rephrasing the request to match the description more closely
- Invoke it directly with if the skill is user-invocable
/skill-name
—
Skill triggers too often
—
If Claude uses a skill when not wanted:
- Make the description more specific
- Add if only manual invocation is wanted
disable-model-invocation: true
—
Claude doesn't see all skills
—
Skill descriptions are loaded into context. If there are many skills, they may exceed the character budget (default 15,000 characters). Run to check for a warning about excluded skills.
/contextTo increase the limit, set the environment variable.
SLASH_COMMAND_TOOL_CHAR_BUDGET—
Related Resources
—
- Subagents: Delegate tasks to specialized agents
- Plugins: Package and distribute skills with other extensions
- Hooks: Automate workflows around tool events
- Memory: Manage CLAUDE.md files for persistent context
- Permissions: Control tool and skill access
—