本技能提供创建有效技能的指导。
关于技能
技能是模块化、自包含的包,通过提供专业知识、工作流和工具来扩展 Claude 的能力。将它们视为特定领域或任务的"入职指南"——它们将 Claude 从通用代理转变为配备程序性知识的专用代理,这些知识是任何模型都无法完全拥有的。
技能提供什么
- 专业化工作流 - 特定领域的多步骤流程
- 工具集成 - 使用特定文件格式或 API 的指令
- 领域专业知识 - 公司特定知识、模式、业务逻辑
- 捆绑资源 - 复杂和重复任务的脚本、参考和资产
核心原则
简洁是关键
上下文窗口是公共资源。技能与 Claude 需要的其他内容共享上下文窗口:系统提示、对话历史、其他技能的元数据以及实际用户请求。
默认假设:Claude 已经很聪明了。 只添加 Claude 还没有的上下文。质疑每条信息:"Claude 真的需要这个解释吗?"和"这段话值得它的 token 成本吗?"
优先使用简洁示例而非冗长解释。
设置适当的自由度
将具体程度与任务的脆弱性和可变性匹配:
高自由度(基于文本的指令):当多种方法有效、决策取决于上下文或启发式方法指导方法时使用。
中等自由度(伪代码或带参数的脚本):当存在首选模式、可接受一些变化或配置影响行为时使用。
低自由度(特定脚本、少量参数):当操作脆弱且容易出错、一致性关键或必须遵循特定序列时使用。
将 Claude 想象为探索路径:悬崖边的窄桥需要具体护栏(低自由度),而开阔场地允许多条路线(高自由度)。
技能结构
每个技能由必需的 SKILL.md 文件和可选的捆绑资源组成:
skill-name/
├── SKILL.md(必需)
│ ├── YAML frontmatter 元数据(必需)
│ │ ├── name:(必需)
│ │ └── description:(必需)
│ └── Markdown 指令(必需)
└── 捆绑资源(可选)
├── scripts/ - 可执行代码(Python/Bash 等)
├── references/ - 按需加载到上下文的文档
└── assets/ - 用于输出的文件(模板、图标、字体等)
SKILL.md(必需)
每个 SKILL.md 由以下部分组成:
- Frontmatter(YAML):包含
name 和 description 字段。这些是 Claude 读取以确定技能何时被使用的唯一字段,因此清晰全面地描述技能是什么以及何时应使用它非常重要。
- 正文(Markdown):使用技能的指令和指导。仅在技能触发后加载(如果有的话)。
捆绑资源(可选)
##### 脚本(scripts/)
需要确定性可靠性的任务或反复重写的代码的可执行代码(Python/Bash 等)。
- 何时包含:当相同代码被反复重写或需要确定性可靠性时
- 示例:
scripts/rotate_pdf.py 用于 PDF 旋转任务
- 优势:节省 token、确定性、可不加载到上下文中执行
- 注意:脚本可能仍需被 Claude 读取以进行修补或环境特定调整
##### 参考文档(references/)
按需加载到上下文中以指导 Claude 过程和思考的文档和参考材料。
- 何时包含:当有 Claude 在工作时应参考的文档时
- 示例:
references/finance.md 用于金融模式、references/mnda.md 用于公司 NDA 模板、references/policies.md 用于公司政策、references/api_docs.md 用于 API 规范
- 用例:数据库模式、API 文档、领域知识、公司政策、详细工作流指南
- 优势:保持 SKILL.md 精简,仅在 Claude 判断需要时加载
- 最佳实践:如果文件较大(>10k 词),在 SKILL.md 中包含 grep 搜索模式
- 避免重复:信息应存在于 SKILL.md 或参考文件中,而非两者都有。优先将详细信息放在参考文件中,除非它确实是技能的核心——这保持 SKILL.md 精简,同时使信息可发现而不占用上下文窗口。仅在 SKILL.md 中保留必要的程序性指令和工作流指导;将详细参考材料、模式和示例移到参考文件中。
##### 资产(assets/)
不打算加载到上下文中,而是在 Claude 生成的输出中使用的文件。
- 何时包含:当技能需要在最终输出中使用的文件时
- 示例:
assets/logo.png 用于品牌资产、assets/slides.pptx 用于 PowerPoint 模板、assets/frontend-template/ 用于 HTML/React 样板、assets/font.ttf 用于字体
- 用例:模板、图片、图标、样板代码、字体、被复制或修改的示例文档
- 优势:将输出资源与文档分离,使 Claude 能在不加载到上下文的情况下使用文件
技能中不应包含的内容
技能应只包含直接支持其功能的必要文件。不要创建多余的文档或辅助文件,包括:
- README.md
- INSTALLATION_GUIDE.md
- QUICK_REFERENCE.md
- CHANGELOG.md
- 等等
技能应只包含 AI 代理完成手头工作所需的信息。不应包含关于创建过程的辅助上下文、设置和测试程序、面向用户的文档等。创建额外的文档文件只会增加混乱。
渐进式披露设计原则
技能使用三级加载系统来高效管理上下文:
- 元数据(name + description) - 始终在上下文中(约 100 词)
- SKILL.md 正文 - 技能触发时(<5k 词)
- 捆绑资源 - Claude 按需使用(无限制,因为脚本可以不读入上下文窗口而执行)
渐进式披露模式
保持 SKILL.md 正文为必要内容且在 500 行以内,以最小化上下文膨胀。当接近此限制时将内容拆分到单独文件。将内容拆分到其他文件时,从 SKILL.md 引用它们并清楚描述何时读取非常重要,以确保技能的读者知道它们的存在和使用时机。
关键原则: 当技能支持多种变体、框架或选项时,仅在工作流和选择指导中保留核心内容。将变体特定细节(模式、示例、配置)移到单独的参考文件中。
模式 1:带参考的高级指南
# PDF 处理快速开始
使用 pdfplumber 提取文本:
[代码示例]
高级功能
Claude 仅在需要时加载 FORMS.md、REFERENCE.md 或 EXAMPLES.md。
模式 2:按领域组织
对于多领域技能,按领域组织内容以避免加载不相关的上下文:
bigquery-skill/
├── SKILL.md(概览和导航)
└── reference/
├── finance.md(收入、账单指标)
├── sales.md(机会、管道)
├── product.md(API 使用、功能)
└── marketing.md(活动、归因)
当用户询问销售指标时,Claude 只读取 sales.md。
类似地,对于支持多框架或变体的技能,按变体组织:
cloud-deploy/
├── SKILL.md(工作流 + 供应商选择)
└── references/
├── aws.md(AWS 部署模式)
├── gcp.md(GCP 部署模式)
└── azure.md(Azure 部署模式)
当用户选择 AWS 时,Claude 只读取 aws.md。
模式 3:条件细节
显示基本内容,链接到高级内容:
# DOCX 处理创建文档
使用 docx-js 创建新文档。参见 DOCX-JS.md。
编辑文档
对于简单编辑,直接修改 XML。
修订追踪:参见 REDLINING.md
OOXML 详情:参见 OOXML.md
Claude 仅在用户需要这些功能时读取 REDLINING.md 或 OOXML.md。
重要指南:
- 避免深度嵌套引用 - 保持引用从 SKILL.md 一层深。所有参考文件应直接从 SKILL.md 链接。
- 结构化较长的参考文件 - 对于超过 100 行的文件,在顶部包含目录,以便 Claude 预览时能看到完整范围。
技能创建流程
技能创建涉及以下步骤:
- 通过具体示例理解技能
- 规划可复用的技能内容(脚本、参考、资产)
- 初始化技能(运行 init_skill.py)
- 编辑技能(实现资源和编写 SKILL.md)
- 打包技能(运行 package_skill.py)
- 基于实际使用迭代
按顺序执行这些步骤,仅在有明确原因不适用时跳过。
步骤 1:通过具体示例理解技能
仅当技能的使用模式已经清楚理解时跳过此步骤。即使处理现有技能,此步骤仍有价值。
要创建有效的技能,需要清楚理解技能将如何使用的具体示例。这种理解可以来自直接的用户示例或经用户反馈验证的生成示例。
例如,构建图像编辑器技能时,相关问题包括:
- "图像编辑器技能应支持什么功能?编辑、旋转,还有其他吗?"
- "你能举一些这个技能如何使用的例子吗?"
- "我可以想象用户会要求'去除这张图片的红眼'或'旋转这张图片'。你还想象这个技能的其他使用方式吗?"
- "用户说什么应该触发这个技能?"
为避免让用户不知所措,避免在单条消息中问太多问题。从最重要的问题开始,根据需要跟进以提高效果。
当对技能应支持的功能有清晰认识时,结束此步骤。
步骤 2:规划可复用的技能内容
要将具体示例转化为有效技能,分析每个示例:
- 考虑如何从头执行该示例
- 识别在反复执行这些工作流时哪些脚本、参考和资产会有帮助
示例:构建 pdf-editor 技能来处理"帮我旋转这个 PDF"等查询时,分析显示:
- 旋转 PDF 每次都需要重写相同的代码
scripts/rotate_pdf.py 脚本存储在技能中会有帮助
示例:设计 frontend-webapp-builder 技能来处理"给我构建一个待办应用"或"给我构建一个追踪步数的仪表板"等查询时,分析显示:
- 编写前端 Web 应用每次都需要相同的 HTML/React 样板
assets/hello-world/ 模板包含样板 HTML/React 项目文件存储在技能中会有帮助
示例:构建 big-query 技能来处理"今天有多少用户登录?"等查询时,分析显示:
- 查询 BigQuery 每次都需要重新发现表模式和关系
references/schema.md 文件记录表模式存储在技能中会有帮助
要确定技能内容,分析每个具体示例以创建要包含的可复用资源列表:脚本、参考和资产。
步骤 3:初始化技能
此时,是实际创建技能的时候了。
仅当正在开发的技能已存在且需要迭代或打包时跳过此步骤。在这种情况下,继续下一步。
从头创建新技能时,始终运行 init_skill.py 脚本。该脚本方便地生成新的模板技能目录,自动包含技能所需的一切,使技能创建过程更高效可靠。
用法:
scripts/init_skill.py --path
该脚本:
- 在指定路径创建技能目录
- 生成带有正确 frontmatter 和 TODO 占位符的 SKILL.md 模板
- 创建示例资源目录:
scripts/、references/ 和 assets/
- 在每个目录中添加可自定义或删除的示例文件
初始化后,根据需要自定义或删除生成的 SKILL.md 和示例文件。
步骤 4:编辑技能
编辑(新生成或现有的)技能时,记住技能是为另一个 Claude 实例创建的。包含对 Claude 有益且非显而易见的信息。考虑什么程序性知识、领域特定细节或可复用资产能帮助另一个 Claude 实例更有效地执行这些任务。
学习经过验证的设计模式
根据技能需要查阅这些有用的指南:
- 多步骤流程:参见 references/workflows.md 了解顺序工作流和条件逻辑
- 特定输出格式或质量标准:参见 references/output-patterns.md 了解模板和示例模式
这些文件包含有效技能设计的既定最佳实践。
从可复用技能内容开始
要开始实现,从上面识别的可复用资源开始:scripts/、references/ 和 assets/ 文件。注意此步骤可能需要用户输入。例如,实现 brand-guidelines 技能时,用户可能需要提供品牌资产或模板存储在 assets/ 中,或文档存储在 references/ 中。
添加的脚本必须通过实际运行测试以确保没有错误且输出符合预期。如果有许多类似脚本,只需测试代表性样本以确保它们都能工作,同时平衡完成时间。
任何技能不需要的示例文件和目录都应删除。初始化脚本在 scripts/、references/ 和 assets/ 中创建示例文件以演示结构,但大多数技能不需要所有这些。
更新 SKILL.md
写作指南: 始终使用祈使/不定式形式。
##### Frontmatter
编写包含 name 和 description 的 YAML frontmatter:
name:技能名称
description:这是技能的主要触发机制,帮助 Claude 理解何时使用技能。
- 包含技能做什么以及何时使用的特定触发器/上下文。
- 在此处包含所有"何时使用"信息——而非正文中。正文仅在触发后加载,因此正文中的"何时使用此技能"部分对 Claude 没有帮助。
-
docx 技能的描述示例:"全面的文档创建、编辑和分析,支持修订追踪、批注、格式保留和文本提取。当 Claude 需要处理专业文档(.docx 文件)时使用:(1) 创建新文档,(2) 修改或编辑内容,(3) 处理修订追踪,(4) 添加批注,或任何其他文档任务"
不要在 YAML frontmatter 中包含任何其他字段。
##### 正文
编写使用技能及其捆绑资源的指令。
步骤 5:打包技能
技能开发完成后,必须打包为可分发的 .skill 文件与用户共享。打包过程会先自动验证技能以确保满足所有要求:
scripts/package_skill.py
可选输出目录指定:
scripts/package_skill.py ./dist
打包脚本将:
- YAML frontmatter 格式和必需字段
- 技能命名约定和目录结构
- 描述的完整性和质量
- 文件组织和资源引用
- 如果验证通过则打包技能,创建以技能命名的 .skill 文件(如
my-skill.skill),包含所有文件并维护正确的目录结构以便分发。.skill 文件是扩展名为 .skill 的 zip 文件。
如果验证失败,脚本将报告错误并退出而不创建包。修复任何验证错误后再次运行打包命令。
步骤 6:迭代
测试技能后,用户可能请求改进。这通常在使用技能后立即发生,此时对技能表现的上下文还很新鲜。
迭代工作流:
- 在真实任务上使用技能
- 注意困难或低效之处
- 识别 SKILL.md 或捆绑资源应如何更新
- 实施更改并再次测试
This skill provides guidance for creating effective skills.
About Skills
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.
What Skills Provide
- 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
Core Principles
Concise is Key
The context window is a public good. Skills share the context window with everything else Claude needs: system prompt, conversation history, other Skills' metadata, and the actual user request.
Default assumption: Claude is already very smart. Only add context Claude doesn't already have. Challenge each piece of information: "Does Claude really need this explanation?" and "Does this paragraph justify its token cost?"
Prefer concise examples over verbose explanations.
Set Appropriate Degrees of Freedom
Match the level of specificity to the task's fragility and variability:
High freedom (text-based instructions): Use when multiple approaches are valid, decisions depend on context, or heuristics guide the approach.
Medium freedom (pseudocode or scripts with parameters): Use when a preferred pattern exists, some variation is acceptable, or configuration affects behavior.
Low freedom (specific scripts, few parameters): Use when operations are fragile and error-prone, consistency is critical, or a specific sequence must be followed.
Think of Claude as exploring a path: a narrow bridge with cliffs needs specific guardrails (low freedom), while an open field allows many routes (high freedom).
Anatomy of a Skill
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.)
SKILL.md (required)
Every SKILL.md consists of:
- Frontmatter (YAML): Contains
name and description fields. These are the only fields that Claude reads to determine when the skill gets used, thus it is very important to be clear and comprehensive in describing what the skill is, and when it should be used.
- Body (Markdown): Instructions and guidance for using the skill. Only loaded AFTER the skill triggers (if at all).
Bundled Resources (optional)
##### Scripts (scripts/)
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:
scripts/rotate_pdf.py for PDF rotation tasks
- Benefits: Token efficient, deterministic, may be executed without loading into context
- Note: Scripts may still need to be read by Claude for patching or environment-specific adjustments
##### References (references/)
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:
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 specifications
- 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.
##### Assets (assets/)
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:
assets/logo.png for brand assets, assets/slides.pptx for PowerPoint templates, assets/frontend-template/ for HTML/React boilerplate, assets/font.ttf for typography
- 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
What to Not Include in a Skill
A skill should only contain essential files that directly support its functionality. Do NOT create extraneous documentation or auxiliary files, including:
- README.md
- INSTALLATION_GUIDE.md
- QUICK_REFERENCE.md
- CHANGELOG.md
- etc.
The skill should only contain the information needed for an AI agent to do the job at hand. It should not contain auxilary context about the process that went into creating it, setup and testing procedures, user-facing documentation, etc. Creating additional documentation files just adds clutter and confusion.
Progressive Disclosure Design Principle
Skills use a three-level loading system to manage context efficiently:
- Metadata (name + description) - Always in context (~100 words)
- SKILL.md body - When skill triggers (<5k words)
- Bundled resources - As needed by Claude (Unlimited because scripts can be executed without reading into context window)
Progressive Disclosure Patterns
Keep SKILL.md body to the essentials and under 500 lines to minimize context bloat. Split content into separate files when approaching this limit. When splitting out content into other files, it is very important to reference them from SKILL.md and describe clearly when to read them, to ensure the reader of the skill knows they exist and when to use them.
Key principle: When a skill supports multiple variations, frameworks, or options, keep only the core workflow and selection guidance in SKILL.md. Move variant-specific details (patterns, examples, configuration) into separate reference files.
Pattern 1: High-level guide with references
# PDF ProcessingQuick start
Extract text with pdfplumber:
[code example]
Advanced features
Claude loads FORMS.md, REFERENCE.md, or EXAMPLES.md only when needed.
Pattern 2: Domain-specific organization
For Skills with multiple domains, organize content by domain to avoid loading irrelevant context:
bigquery-skill/
├── SKILL.md (overview and navigation)
└── reference/
├── finance.md (revenue, billing metrics)
├── sales.md (opportunities, pipeline)
├── product.md (API usage, features)
└── marketing.md (campaigns, attribution)
When a user asks about sales metrics, Claude only reads sales.md.
Similarly, for skills supporting multiple frameworks or variants, organize by variant:
cloud-deploy/
├── SKILL.md (workflow + provider selection)
└── references/
├── aws.md (AWS deployment patterns)
├── gcp.md (GCP deployment patterns)
└── azure.md (Azure deployment patterns)
When the user chooses AWS, Claude only reads aws.md.
Pattern 3: Conditional details
Show basic content, link to advanced content:
# DOCX ProcessingCreating documents
Use docx-js for new documents. See DOCX-JS.md.
Editing documents
For simple edits, modify the XML directly.
For tracked changes: See REDLINING.md
For OOXML details: See OOXML.md
Claude reads REDLINING.md or OOXML.md only when the user needs those features.
Important guidelines:
- Avoid deeply nested references - Keep references one level deep from SKILL.md. All reference files should link directly from SKILL.md.
- Structure longer reference files - For files longer than 100 lines, include a table of contents at the top so Claude can see the full scope when previewing.
Skill Creation Process
Skill creation involves these steps:
- Understand the skill with concrete examples
- Plan reusable skill contents (scripts, references, assets)
- Initialize the skill (run init_skill.py)
- Edit the skill (implement resources and write SKILL.md)
- Package the skill (run package_skill.py)
- Iterate based on real usage
Follow these steps in order, skipping only if there is a clear reason why they are not applicable.
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.
Step 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 pdf-editor skill to handle queries like "Help me rotate this PDF," the analysis shows:
- Rotating a PDF requires re-writing the same code each time
- A
scripts/rotate_pdf.py script would be helpful to store in the skill
Example: 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:
- Writing a frontend webapp requires the same boilerplate HTML/React each time
- An
assets/hello-world/ template containing the boilerplate HTML/React project files would be helpful to store in the skill
Example: When building a big-query skill to handle queries like "How many users have logged in today?" the analysis shows:
- Querying BigQuery requires re-discovering the table schemas and relationships each time
- A
references/schema.md file documenting the table schemas would be helpful to store in the skill
To establish the skill's contents, analyze each concrete example to create a list of the reusable resources to include: scripts, references, and assets.
Step 3: Initializing the Skill
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 init_skill.py 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.
Usage:
scripts/init_skill.py --path
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/, references/, and 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.
Step 4: Edit the Skill
When editing the (newly-generated or existing) skill, remember that the skill is being created for another instance of Claude to use. Include 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.
Learn Proven Design Patterns
Consult these helpful guides based on your skill's needs:
- Multi-step processes: See references/workflows.md for sequential workflows and conditional logic
- Specific output formats or quality standards: See references/output-patterns.md for template and example patterns
These files contain established best practices for effective skill design.
Start with Reusable Skill Contents
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/.
Added scripts must be tested by actually running them to ensure there are no bugs and that the output matches what is expected. If there are many similar scripts, only a representative sample needs to be tested to ensure confidence that they all work while balancing time to completion.
Any example files and directories not needed for the skill should be deleted. The initialization script creates example files in scripts/, references/, and assets/ to demonstrate structure, but most skills won't need all of them.
Update SKILL.md
Writing Guidelines: Always use imperative/infinitive form.
##### Frontmatter
Write the YAML frontmatter with name and description:
name: The skill name
description: This is the primary triggering mechanism for your skill, and helps Claude understand when to use the skill.
- Include both what the Skill does and specific triggers/contexts for when to use it.
- Include all "when to use" information here - Not in the body. The body is only loaded after triggering, so "When to Use This Skill" sections in the body are not helpful to Claude.
- Example description for a
docx skill: "Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. Use when Claude needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks"
Do not include any other fields in YAML frontmatter.
##### Body
Write instructions for using the skill and its bundled resources.
Step 5: Packaging a Skill
Once development of the skill is complete, it must be packaged into a distributable .skill file that gets shared with the user. The packaging process automatically validates the skill first to ensure it meets all requirements:
scripts/package_skill.py
Optional output directory specification:
scripts/package_skill.py ./dist
The 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 .skill file named after the skill (e.g.,
my-skill.skill) that includes all files and maintains the proper directory structure for distribution. The .skill file is a zip file with a .skill extension.
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.
Step 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