skill-development by anthropics/claude-plugins-official
npx skills add https://github.com/anthropics/claude-plugins-official --skill skill-development本技能为创建有效的 Claude 代码插件技能提供指导。
技能是模块化、自包含的软件包,通过提供专业知识、工作流程和工具来扩展 Claude 的能力。可以将其视为针对特定领域或任务的“入门指南”——它们将 Claude 从一个通用智能体转变为配备了任何模型都无法完全掌握的流程知识的专业智能体。
每个技能都包含一个必需的 SKILL.md 文件和可选的捆绑资源:
skill-name/
├── SKILL.md (必需)
│ ├── YAML 前置元数据 (必需)
│ │ ├── name: (必需)
│ │ └── description: (必需)
│ └── Markdown 说明 (必需)
└── 捆绑资源 (可选)
├── scripts/ - 可执行代码 (Python/Bash 等)
├── references/ - 旨在根据需要加载到上下文中的文档
└── assets/ - 在输出中使用的文件 (模板、图标、字体等)
元数据质量: YAML 前置元数据中的 name 和 description 决定了 Claude 何时会使用该技能。请具体说明技能的作用以及何时使用它。使用第三人称(例如,“此技能应在...时使用”,而不是“在...时使用此技能”)。
scripts/)广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
用于需要确定性可靠性或需要重复重写的任务的可执行代码(Python/Bash 等)。
scripts/rotate_pdf.pyreferences/)旨在根据需要加载到上下文中,以指导 Claude 的流程和思考的文档和参考资料。
references/finance.md,用于公司 NDA 模板的 references/mnda.md,用于公司政策的 references/policies.md,用于 API 规范的 references/api_docs.mdassets/)不打算加载到上下文中,而是在 Claude 生成的输出中使用的文件。
assets/logo.png,用于 PowerPoint 模板的 assets/slides.pptx,用于 HTML/React 样板代码的 assets/frontend-template/,用于字体的 assets/font.ttf技能使用三级加载系统来高效管理上下文:
*无限是因为脚本可以在不读入上下文窗口的情况下执行。
要创建技能,请按顺序遵循“技能创建流程”,只有在有明确理由不适用时才跳过步骤。
仅当技能的使用模式已经明确理解时才跳过此步骤。即使在处理现有技能时,它仍然有价值。
要创建有效的技能,请清楚地理解技能将如何使用的具体示例。这种理解可以来自直接的用户示例,也可以来自经过用户反馈验证的生成示例。
例如,在构建图像编辑器技能时,相关的问题包括:
为了避免让用户不知所措,避免在单个消息中问太多问题。从最重要的问题开始,并根据需要进行跟进以获得更好的效果。
当对技能应支持的功能有清晰的认识时,结束此步骤。
要将具体示例转化为有效的技能,请通过以下方式分析每个示例:
示例:在构建处理“帮我旋转这个 PDF”等查询的 pdf-editor 技能时,分析显示:
scripts/rotate_pdf.py 脚本会很有帮助示例:在设计用于处理“为我构建一个待办事项应用”或“为我构建一个跟踪步数的仪表板”等查询的 frontend-webapp-builder 技能时,分析显示:
assets/hello-world/ 模板会很有帮助示例:在构建处理“今天有多少用户登录?”等查询的 big-query 技能时,分析显示:
references/schema.md 文件会很有帮助对于 Claude 代码插件: 在构建钩子技能时,分析显示:
scripts/validate-hook-schema.sh 和 scripts/test-hook.sh 实用程序会很有帮助references/patterns.md 用于详细的钩子模式,以避免 SKILL.md 臃肿要建立技能的内容,请分析每个具体示例,以创建要包含的可重用资源列表:脚本、参考资料和资产。
对于 Claude 代码插件,创建技能目录结构:
mkdir -p plugin-name/skills/skill-name/{references,examples,scripts}
touch plugin-name/skills/skill-name/SKILL.md
注意: 与使用 init_skill.py 的通用技能创建器不同,插件技能是直接在插件的 skills/ 目录中创建的,结构更简单,是手动创建的。
在编辑(新创建的或现有的)技能时,请记住,该技能是为另一个 Claude 实例使用而创建的。专注于包含对 Claude 有益且非显而易见的信息。考虑哪些流程知识、领域特定细节或可重用资产将帮助另一个 Claude 实例更有效地执行这些任务。
要开始实施,请从上面确定的可重用资源开始:scripts/、references/ 和 assets/ 文件。请注意,此步骤可能需要用户输入。例如,在实施 brand-guidelines 技能时,用户可能需要提供品牌资产或模板以存储在 assets/ 中,或提供文档以存储在 references/ 中。
此外,删除技能不需要的任何示例文件和目录。仅创建实际需要的目录(references/、examples/、scripts/)。
写作风格: 使用祈使句/不定式形式(动词优先的指令)编写整个技能,而不是第二人称。使用客观的、指导性的语言(例如,“要完成 X,请执行 Y”,而不是“你应该执行 X”或“如果你需要执行 X”)。这为 AI 使用保持了一致性和清晰度。
描述(前置元数据): 使用带有特定触发短语的第三人称格式:
---
name: 技能名称
description: 当用户要求“特定短语 1”、“特定短语 2”、“特定短语 3”时,应使用此技能。包含用户会说并应触发此技能的确切短语。要具体明确。
version: 0.1.0
---
好的描述示例:
description: 当用户要求“创建钩子”、“添加 PreToolUse 钩子”、“验证工具使用”、“实现基于提示的钩子”或提及钩子事件(PreToolUse、PostToolUse、Stop)时,应使用此技能。
坏的描述示例:
description: 在处理钩子时使用此技能。 # 错误的人称,模糊
description: 当用户需要钩子帮助时加载。 # 不是第三人称
description: 提供钩子指导。 # 没有触发短语
要完成 SKILL.md 正文,请回答以下问题:
保持 SKILL.md 简洁: 正文目标为 1,500-2,000 词。将详细内容移到 references/:
references/patterns.mdreferences/advanced.mdreferences/migration.mdreferences/api-reference.md在 SKILL.md 中引用资源:
## 附加资源
### 参考文件
有关详细模式和技巧,请查阅:
- **`references/patterns.md`** - 常见模式
- **`references/advanced.md`** - 高级用例
### 示例文件
`examples/` 中的工作示例:
- **`example-script.sh`** - 工作示例
对于插件技能,验证与通用技能不同:
plugin-name/skills/skill-name/ 中使用技能审查代理:
询问:“审查我的技能并检查它是否遵循最佳实践”
技能审查代理将检查描述质量、内容组织和渐进式披露。
测试技能后,用户可能会请求改进。这通常发生在使用技能后不久,对技能表现如何有新的了解。
迭代工作流程:
常见改进:
插件技能位于插件的 skills/ 目录中:
my-plugin/
├── .claude-plugin/
│ └── plugin.json
├── commands/
├── agents/
└── skills/
└── my-skill/
├── SKILL.md
├── references/
├── examples/
└── scripts/
Claude Code 自动发现技能:
skills/ 目录SKILL.md 的子目录插件技能作为插件的一部分分发,而不是作为单独的 ZIP 文件。用户在安装插件时获得技能。
通过本地安装插件来测试技能:
# 使用 --plugin-dir 测试
cc --plugin-dir /path/to/plugin
# 询问应触发技能的问题
# 验证技能是否正确加载
研究此插件中的技能作为最佳实践示例:
hook-development 技能:
agent-development 技能:
plugin-settings 技能:
每个都展示了渐进式披露和强大的触发机制。
包含(技能触发时始终加载):
保持在 3,000 词以下,理想情况下 1,500-2,000 词
移到 references/(根据需要加载):
每个参考资料文件可以很大(2,000-5,000+ 词)
工作代码示例:
用户可以直接复制和改编这些内容
实用脚本:
应可执行且有文档说明
使用动词优先的指令编写,而不是第二人称:
正确(祈使句):
To create a hook, define the event type.
Configure the MCP server with authentication.
Validate settings before use.
错误(第二人称):
You should create a hook by defining the event type.
You need to configure the MCP server.
You must validate settings before use.
前置元数据描述必须使用第三人称:
正确:
description: This skill should be used when the user asks to "create X", "configure Y"...
错误:
description: Use this skill when you want to create X...
description: Load this skill when user asks...
专注于要做什么,而不是谁应该做:
正确:
Parse the frontmatter using sed.
Extract fields with grep.
Validate values before use.
错误:
You can parse the frontmatter...
Claude should extract fields...
The user might validate values...
在最终确定技能之前:
结构:
name 和 description 字段描述质量:
内容质量:
渐进式披露:
测试:
❌ 差:
description: Provides guidance for working with hooks.
为什么差: 模糊,没有特定触发短语,不是第三人称
✅ 好:
description: This skill should be used when the user asks to "create a hook", "add a PreToolUse hook", "validate tool use", or mentions hook events. Provides comprehensive hooks API guidance.
为什么好: 第三人称,特定短语,具体场景
❌ 差:
skill-name/
└── SKILL.md (8,000 words - everything in one file)
为什么差: 技能加载时使上下文臃肿,详细内容始终加载
✅ 好:
skill-name/
├── SKILL.md (1,800 words - core essentials)
└── references/
├── patterns.md (2,500 words)
└── advanced.md (3,700 words)
为什么好: 渐进式披露,详细内容仅在需要时加载
❌ 差:
You should start by reading the configuration file.
You need to validate the input.
You can use the grep tool to search.
为什么差: 第二人称,不是祈使句形式
✅ 好:
Start by reading the configuration file.
Validate the input before processing.
Use the grep tool to search for patterns.
为什么好: 祈使句形式,直接指令
❌ 差:
# SKILL.md
[Core content]
[No mention of references/ or examples/]
为什么差: Claude 不知道参考资料存在
✅ 好:
# SKILL.md
[Core content]
## Additional Resources
### Reference Files
- **`references/patterns.md`** - Detailed patterns
- **`references/advanced.md`** - Advanced techniques
### Examples
- **`examples/script.sh`** - Working example
为什么好: Claude 知道在哪里可以找到附加信息
skill-name/
└── SKILL.md
适用于:简单知识,不需要复杂资源
skill-name/
├── SKILL.md
├── references/
│ └── detailed-guide.md
└── examples/
└── working-example.sh
适用于:大多数具有详细文档的插件技能
skill-name/
├── SKILL.md
├── references/
│ ├── patterns.md
│ └── advanced.md
├── examples/
│ ├── example1.sh
│ └── example2.json
└── scripts/
└── validate.sh
适用于:具有验证实用程序的复杂领域
✅ 应该做:
❌ 不要做:
Plugin-dev 的技能展示了最佳实践:
../hook-development/ - 渐进式披露,实用程序../agent-development/ - AI 辅助创建,参考资料../mcp-integration/ - 全面的参考资料../plugin-settings/ - 真实世界示例../command-development/ - 清晰的核心概念../plugin-structure/ - 良好的组织有关完整的技能创建器方法论:
references/skill-creator-original.md - 完整的原始技能创建器内容为您的插件创建技能:
mkdir -p skills/skill-name/{references,examples,scripts}专注于强大的触发描述、渐进式披露和祈使句写作风格,以创建在需要时加载并提供针对性指导的有效技能。
每周安装数
366
仓库
GitHub 星标数
9.7K
首次出现
2026年2月5日
安全审计
安装于
opencode320
codex317
gemini-cli314
github-copilot308
amp294
claude-code279
This skill provides guidance for creating effective skills for Claude Code plugins.
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.
Every skill consists of a required SKILL.md file and optional bundled resources:
skill-name/
├── SKILL.md (required)
│ ├── YAML frontmatter metadata (required)
│ │ ├── name: (required)
│ │ └── description: (required)
│ └── Markdown instructions (required)
└── Bundled Resources (optional)
├── scripts/ - Executable code (Python/Bash/etc.)
├── references/ - Documentation intended to be loaded into context as needed
└── assets/ - Files used in output (templates, icons, fonts, etc.)
Metadata Quality: The name and description 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...").
scripts/)Executable code (Python/Bash/etc.) for tasks that require deterministic reliability or are repeatedly rewritten.
scripts/rotate_pdf.py for PDF rotation tasksreferences/)Documentation and reference material intended to be loaded as needed into context to inform Claude's process and thinking.
references/finance.md for financial schemas, references/mnda.md for company NDA template, references/policies.md for company policies, references/api_docs.md for API specificationsassets/)Files not intended to be loaded into context, but rather used within the output Claude produces.
assets/logo.png for brand assets, assets/slides.pptx for PowerPoint templates, assets/frontend-template/ for HTML/React boilerplate, assets/font.ttf for typographySkills use a three-level loading system to manage context efficiently:
*Unlimited because scripts can be executed without reading into context window.
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.
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:
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.
To turn concrete examples into an effective skill, analyze each example by:
Example: When building a pdf-editor skill to handle queries like "Help me rotate this PDF," the analysis shows:
scripts/rotate_pdf.py script would be helpful to store in the skillExample: When designing a frontend-webapp-builder skill for queries like "Build me a todo app" or "Build me a dashboard to track my steps," the analysis shows:
assets/hello-world/ template containing the boilerplate HTML/React project files would be helpful to store in the skillExample: When building a big-query skill to handle queries like "How many users have logged in today?" the analysis shows:
references/schema.md file documenting the table schemas would be helpful to store in the skillFor Claude Code plugins: When building a hooks skill, the analysis shows:
scripts/validate-hook-schema.sh and scripts/test-hook.sh utilities would be helpfulreferences/patterns.md for detailed hook patterns to avoid bloating SKILL.mdTo establish the skill's contents, analyze each concrete example to create a list of the reusable resources to include: scripts, references, and assets.
For Claude Code plugins, create the skill directory structure:
mkdir -p plugin-name/skills/skill-name/{references,examples,scripts}
touch plugin-name/skills/skill-name/SKILL.md
Note: Unlike the generic skill-creator which uses init_skill.py, plugin skills are created directly in the plugin's skills/ directory with a simpler manual structure.
When editing the (newly-created 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.
To begin implementation, start with the reusable resources identified above: scripts/, references/, and assets/ files. Note that this step may require user input. For example, when implementing a brand-guidelines skill, the user may need to provide brand assets or templates to store in assets/, or documentation to store in references/.
Also, delete any example files and directories not needed for the skill. Create only the directories you actually need (references/, examples/, scripts/).
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.
Description (Frontmatter): Use third-person format with specific trigger phrases:
---
name: Skill Name
description: This skill should be used when the user asks to "specific phrase 1", "specific phrase 2", "specific phrase 3". Include exact phrases users would say that should trigger this skill. Be concrete and specific.
version: 0.1.0
---
Good description examples:
description: This skill should be used when the user asks to "create a hook", "add a PreToolUse hook", "validate tool use", "implement prompt-based hooks", or mentions hook events (PreToolUse, PostToolUse, Stop).
Bad description examples:
description: Use this skill when working with hooks. # Wrong person, vague
description: Load when user needs hook help. # Not third person
description: Provides hook guidance. # No trigger phrases
To complete SKILL.md body, answer the following questions:
Keep SKILL.md lean: Target 1,500-2,000 words for the body. Move detailed content to references/:
references/patterns.mdreferences/advanced.mdreferences/migration.mdreferences/api-reference.mdReference resources in SKILL.md:
## Additional Resources
### Reference Files
For detailed patterns and techniques, consult:
- **`references/patterns.md`** - Common patterns
- **`references/advanced.md`** - Advanced use cases
### Example Files
Working examples in `examples/`:
- **`example-script.sh`** - Working example
For plugin skills, validation is different from generic skills:
plugin-name/skills/skill-name/Use the skill-reviewer agent:
Ask: "Review my skill and check if it follows best practices"
The skill-reviewer agent will check description quality, content organization, and progressive disclosure.
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:
Common improvements:
Plugin skills live in the plugin's skills/ directory:
my-plugin/
├── .claude-plugin/
│ └── plugin.json
├── commands/
├── agents/
└── skills/
└── my-skill/
├── SKILL.md
├── references/
├── examples/
└── scripts/
Claude Code automatically discovers skills:
skills/ directorySKILL.mdPlugin skills are distributed as part of the plugin, not as separate ZIP files. Users get skills when they install the plugin.
Test skills by installing plugin locally:
# Test with --plugin-dir
cc --plugin-dir /path/to/plugin
# Ask questions that should trigger the skill
# Verify skill loads correctly
Study the skills in this plugin as examples of best practices:
hook-development skill:
agent-development skill:
plugin-settings skill:
Each demonstrates progressive disclosure and strong triggering.
Include (always loaded when skill triggers):
Keep under 3,000 words, ideally 1,500-2,000 words
Move to references/ (loaded as needed):
Each reference file can be large (2,000-5,000+ words)
Working code examples:
Users can copy and adapt these directly
Utility scripts:
Should be executable and documented
Write using verb-first instructions, not second person:
Correct (imperative):
To create a hook, define the event type.
Configure the MCP server with authentication.
Validate settings before use.
Incorrect (second person):
You should create a hook by defining the event type.
You need to configure the MCP server.
You must validate settings before use.
The frontmatter description must use third person:
Correct:
description: This skill should be used when the user asks to "create X", "configure Y"...
Incorrect:
description: Use this skill when you want to create X...
description: Load this skill when user asks...
Focus on what to do, not who should do it:
Correct:
Parse the frontmatter using sed.
Extract fields with grep.
Validate values before use.
Incorrect:
You can parse the frontmatter...
Claude should extract fields...
The user might validate values...
Before finalizing a skill:
Structure:
name and description fieldsDescription Quality:
Content Quality:
Progressive Disclosure:
Testing:
❌ Bad:
description: Provides guidance for working with hooks.
Why bad: Vague, no specific trigger phrases, not third person
✅ Good:
description: This skill should be used when the user asks to "create a hook", "add a PreToolUse hook", "validate tool use", or mentions hook events. Provides comprehensive hooks API guidance.
Why good: Third person, specific phrases, concrete scenarios
❌ Bad:
skill-name/
└── SKILL.md (8,000 words - everything in one file)
Why bad: Bloats context when skill loads, detailed content always loaded
✅ Good:
skill-name/
├── SKILL.md (1,800 words - core essentials)
└── references/
├── patterns.md (2,500 words)
└── advanced.md (3,700 words)
Why good: Progressive disclosure, detailed content loaded only when needed
❌ Bad:
You should start by reading the configuration file.
You need to validate the input.
You can use the grep tool to search.
Why bad: Second person, not imperative form
✅ Good:
Start by reading the configuration file.
Validate the input before processing.
Use the grep tool to search for patterns.
Why good: Imperative form, direct instructions
❌ Bad:
# SKILL.md
[Core content]
[No mention of references/ or examples/]
Why bad: Claude doesn't know references exist
✅ Good:
# SKILL.md
[Core content]
## Additional Resources
### Reference Files
- **`references/patterns.md`** - Detailed patterns
- **`references/advanced.md`** - Advanced techniques
### Examples
- **`examples/script.sh`** - Working example
Why good: Claude knows where to find additional information
skill-name/
└── SKILL.md
Good for: Simple knowledge, no complex resources needed
skill-name/
├── SKILL.md
├── references/
│ └── detailed-guide.md
└── examples/
└── working-example.sh
Good for: Most plugin skills with detailed documentation
skill-name/
├── SKILL.md
├── references/
│ ├── patterns.md
│ └── advanced.md
├── examples/
│ ├── example1.sh
│ └── example2.json
└── scripts/
└── validate.sh
Good for: Complex domains with validation utilities
✅ DO:
❌ DON'T:
Plugin-dev's skills demonstrate best practices:
../hook-development/ - Progressive disclosure, utilities../agent-development/ - AI-assisted creation, references../mcp-integration/ - Comprehensive references../plugin-settings/ - Real-world examples../command-development/ - Clear critical concepts../plugin-structure/ - Good organizationFor complete skill-creator methodology:
references/skill-creator-original.md - Full original skill-creator contentTo create a skill for your plugin:
mkdir -p skills/skill-name/{references,examples,scripts}Focus on strong trigger descriptions, progressive disclosure, and imperative writing style for effective skills that load when needed and provide targeted guidance.
Weekly Installs
366
Repository
GitHub Stars
9.7K
First Seen
Feb 5, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode320
codex317
gemini-cli314
github-copilot308
amp294
claude-code279
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
136,300 周安装