skill-creator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Skill 创建器

Skill Creator

本 Skill 提供创建有效 Skill 的指导。
This Skill provides guidance for creating effective Skills.

关于 Skill

About Skills

Skill 是模块化、自包含的包,通过提供专业知识、工作流程和工具来扩展 Claude 的能力。可以将它们视为特定领域或任务的"入职指南"——它们将 Claude 从通用 Agent 转变为配备程序性知识的专业 Agent,而这些知识是任何模型都无法完全具备的。
Skills are modular, self-contained packages that extend Claude's capabilities by providing professional knowledge, workflows and tools. You can think of them as "onboarding guides" for specific domains or tasks — they transform Claude from a general Agent into a specialized Agent equipped with procedural knowledge that no model can fully possess innately.

Skill 提供什么

What Skills Provide

  1. 专业工作流程 - 特定领域的多步骤流程
  2. 工具集成 - 处理特定文件格式或 API 的说明
  3. 领域专业知识 - 公司特定知识、模式、业务逻辑
  4. 捆绑资源 - 用于复杂和重复任务的脚本、参考资料和资产
  1. Professional workflows - Multi-step processes for specific domains
  2. Tool integration - Instructions for handling specific file formats or APIs
  3. Domain expertise - Company-specific knowledge, patterns, business logic
  4. Bundled resources - Scripts, references and assets for complex and repetitive tasks

核心原则

Core Principles

简洁是关键

Conciseness is Key

上下文窗口是公共资源。Skill 与 Claude 需要的所有其他内容共享上下文窗口:系统提示、对话历史、其他 Skill 的元数据以及实际用户请求。
默认假设:Claude 已经非常智能。 只添加 Claude 尚未具备的上下文。对每条信息提出质疑:"Claude 真的需要这个解释吗?"以及"这段内容值得消耗这些 token 吗?"
优先使用简洁的示例而非冗长的解释。
The context window is a shared resource. Skills share the context window with all other content Claude needs: system prompts, conversation history, metadata of other Skills, and the actual user request.
Default assumption: Claude is already very intelligent. Only add context that Claude does not already have. Question every piece of information: "Does Claude really need this explanation?" and "Is this content worth consuming these tokens?"
Prioritize concise examples over lengthy explanations.

设置适当的自由度

Set Appropriate Levels of Freedom

根据任务的脆弱性和可变性匹配具体程度:
高自由度(基于文本的说明):当多种方法都有效、决策取决于上下文或启发式方法指导方法时使用。
中等自由度(伪代码或带参数的脚本):当存在首选模式、可接受一定变化或配置影响行为时使用。
低自由度(特定脚本,少量参数):当操作脆弱且容易出错、一致性至关重要或必须遵循特定顺序时使用。
将 Claude 想象为探索路径:悬崖边的窄桥需要特定护栏(低自由度),而开阔的田野允许多条路线(高自由度)。
Match the level of specificity to the fragility and variability of the task:
High freedom (text-based instructions): Used when multiple approaches are valid, decisions depend on context, or heuristics guide the approach.
Medium freedom (pseudocode or scripts with parameters): Used when there is a preferred pattern, certain variation is acceptable, or configuration affects behavior.
Low freedom (specific scripts, minimal parameters): Used when operations are fragile and error-prone, consistency is critical, or a specific sequence must be followed.
Think of Claude as exploring paths: a narrow bridge on the edge of a cliff requires specific guardrails (low freedom), while an open field allows multiple routes (high freedom).

Skill 的结构

Skill Structure

每个 Skill 由必需的 SKILL.md 文件和可选的捆绑资源组成:
skill-name/
├── SKILL.md(必需)
│   ├── YAML frontmatter 元数据(必需)
│   │   ├── name:(必需)
│   │   └── description:(必需)
│   └── Markdown 说明(必需)
└── 捆绑资源(可选)
    ├── scripts/          - 可执行代码(Python/Bash 等)
    ├── references/       - 需要时加载到上下文的文档
    └── assets/           - 用于输出的文件(模板、图标、字体等)
Each Skill consists of a required SKILL.md file and optional bundled resources:
skill-name/
├── SKILL.md(必需)
│   ├── YAML frontmatter 元数据(必需)
│   │   ├── name:(必需)
│   │   └── description:(必需)
│   └── Markdown 说明(必需)
└── 捆绑资源(可选)
    ├── scripts/          - 可执行代码(Python/Bash 等)
    ├── references/       - 需要时加载到上下文的文档
    └── assets/           - 用于输出的文件(模板、图标、字体等)

SKILL.md(必需)

SKILL.md (Required)

每个 SKILL.md 包含:
  • Frontmatter(YAML):包含
    name
    description
    字段。这是 Claude 用来确定何时使用该 Skill 的唯一字段,因此清晰全面地描述 Skill 是什么以及何时应该使用它非常重要。
  • 正文(Markdown):使用 Skill 的说明和指导。仅在 Skill 触发后(如果触发)才加载。
Each SKILL.md contains:
  • Frontmatter (YAML): Contains
    name
    and
    description
    fields. This is the only field Claude uses to determine when to use the Skill, so it is very important to clearly and comprehensively describe what the Skill is and when it should be used.
  • Body (Markdown): Instructions and guidance for using the Skill. It is only loaded after the Skill is triggered (if it is triggered).

捆绑资源(可选)

Bundled Resources (Optional)

脚本(
scripts/
Scripts (
scripts/
)
用于需要确定性可靠性或重复编写的任务的可执行代码(Python/Bash 等)。
  • 何时包含:当相同代码被重复编写或需要确定性可靠性时
  • 示例:用于 PDF 旋转任务的
    scripts/rotate_pdf.py
  • 优点:节省 token、确定性、可以在不加载到上下文的情况下执行
  • 注意:脚本可能仍需要被 Claude 读取以进行修补或环境特定调整
Executable code (Python/Bash, etc.) for tasks that require deterministic reliability or are written repeatedly.
  • When to include: When the same code is written repeatedly or deterministic reliability is required
  • Example:
    scripts/rotate_pdf.py
    for PDF rotation tasks
  • Advantages: Saves tokens, deterministic, can be executed without being loaded into context
  • Note: Scripts may still need to be read by Claude for patching or environment-specific adjustments
参考资料(
references/
References (
references/
)
旨在根据需要加载到上下文中以指导 Claude 流程和思考的文档和参考材料。
  • 何时包含:用于 Claude 在工作时应参考的文档
  • 示例:用于财务模式的
    references/finance.md
    、用于公司 NDA 模板的
    references/mnda.md
    、用于公司政策的
    references/policies.md
    、用于 API 规范的
    references/api_docs.md
  • 用例:数据库模式、API 文档、领域知识、公司政策、详细工作流程指南
  • 优点:保持 SKILL.md 精简,仅在 Claude 确定需要时加载
  • 最佳实践:如果文件较大(>10k 字),在 SKILL.md 中包含 grep 搜索模式
  • 避免重复:信息应该存在于 SKILL.md 或参考文件中,而不是两者都有。除非信息确实是 Skill 的核心,否则优先使用参考文件存放详细信息——这样可以保持 SKILL.md 精简,同时使信息可发现而不占用上下文窗口。仅在 SKILL.md 中保留基本的程序性说明和工作流程指导;将详细的参考材料、模式和示例移至参考文件。
Documents and reference materials intended to be loaded into context as needed to guide Claude's processes and thinking.
  • When to include: For documents Claude should refer to when working
  • Examples:
    references/finance.md
    for financial models,
    references/mnda.md
    for company NDA templates,
    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
  • Advantages: Keeps SKILL.md lean, only loaded when Claude determines it is needed
  • Best practice: If the file is large (>10k words), include grep search patterns in SKILL.md
  • Avoid duplication: Information should exist in either SKILL.md or reference files, not both. Unless the information is truly core to the Skill, prioritize storing detailed information in reference files — this keeps SKILL.md lean while making information discoverable without occupying the context window. Only keep basic procedural instructions and workflow guidance in SKILL.md; move detailed reference materials, patterns and examples to reference files.
资产(
assets/
Assets (
assets/
)
不打算加载到上下文中,而是在 Claude 生成的输出中使用的文件。
  • 何时包含:当 Skill 需要在最终输出中使用的文件时
  • 示例:用于品牌资产的
    assets/logo.png
    、用于 PowerPoint 模板的
    assets/slides.pptx
    、用于 HTML/React 样板的
    assets/frontend-template/
    、用于排版的
    assets/font.ttf
  • 用例:模板、图片、图标、样板代码、字体、被复制或修改的示例文档
  • 优点:将输出资源与文档分开,使 Claude 能够使用文件而无需将其加载到上下文中
Files that are not intended to be loaded into context, but are used in outputs generated by Claude.
  • When to include: When the Skill requires files to be used in final outputs
  • 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 are copied or modified
  • Advantages: Separates output resources from documentation, allows Claude to use files without loading them into context

Skill 中不应包含的内容

Content That Should Not Be Included in Skills

Skill 应该只包含直接支持其功能的必要文件。不要创建无关的文档或辅助文件,包括:
  • README.md
  • INSTALLATION_GUIDE.md
  • QUICK_REFERENCE.md
  • CHANGELOG.md
  • 等等
Skill 应该只包含 AI Agent 完成手头工作所需的信息。它不应包含关于创建过程、设置和测试程序、面向用户的文档等辅助上下文。创建额外的文档文件只会增加混乱和困惑。
Skills should only contain necessary files that directly support their functionality. Do not create irrelevant documentation or auxiliary files, including:
  • README.md
  • INSTALLATION_GUIDE.md
  • QUICK_REFERENCE.md
  • CHANGELOG.md
  • Etc.
Skills should only contain information required by the AI Agent to complete the task at hand. It should not include auxiliary context about the creation process, setup and testing procedures, user-facing documentation, etc. Creating additional documentation files only increases clutter and confusion.

渐进式披露设计原则

Progressive Disclosure Design Principle

Skill 使用三级加载系统来高效管理上下文:
  1. 元数据(name + description) - 始终在上下文中(约 100 字)
  2. SKILL.md 正文 - 当 Skill 触发时(<5k 字)
  3. 捆绑资源 - 根据 Claude 需要(无限制,因为脚本可以在不读入上下文窗口的情况下执行)
Skills use a three-level loading system to efficiently manage context:
  1. Metadata (name + description) - Always in context (approx. 100 words)
  2. SKILL.md body - When the Skill is triggered (<5k words)
  3. Bundled resources - As needed by Claude (unlimited, as scripts can be executed without being read into the context window)

渐进式披露模式

Progressive Disclosure Patterns

保持 SKILL.md 正文精简,控制在 500 行以内以最小化上下文膨胀。接近此限制时将内容拆分到单独的文件中。拆分内容到其他文件时,务必从 SKILL.md 引用它们并清楚描述何时读取它们,以确保 Skill 的读者知道它们的存在以及何时使用它们。
关键原则:当 Skill 支持多种变体、框架或选项时,仅在 SKILL.md 中保留核心工作流程和选择指导。将特定变体的详细信息(模式、示例、配置)移至单独的参考文件。
模式 1:带参考的高级指南
markdown
undefined
Keep the SKILL.md body lean, controlled within 500 lines to minimize context bloat. Split content into separate files when approaching this limit. When splitting content into other files, be sure to reference them from SKILL.md and clearly describe when to read them, to ensure readers of the Skill know they exist and when to use them.
Key principle: When a Skill supports multiple variants, frameworks or options, only keep the core workflow and selection guidance in SKILL.md. Move variant-specific details (patterns, examples, configurations) to separate reference files.
Pattern 1: High-level guide with references
markdown
undefined

PDF 处理

PDF 处理

快速开始

快速开始

使用 pdfplumber 提取文本: [代码示例]
使用 pdfplumber 提取文本: [代码示例]

高级功能

高级功能

  • 表单填写:完整指南见 FORMS.md
  • API 参考:所有方法见 REFERENCE.md
  • 示例:常见模式见 EXAMPLES.md

Claude 仅在需要时加载 FORMS.md、REFERENCE.md 或 EXAMPLES.md。

**模式 2:按领域组织**

对于具有多个领域的 Skill,按领域组织内容以避免加载无关上下文:
bigquery-skill/ ├── SKILL.md(概述和导航) └── reference/ ├── finance.md(收入、计费指标) ├── sales.md(机会、管道) ├── product.md(API 使用、功能) └── marketing.md(活动、归因)

当用户询问销售指标时,Claude 只读取 sales.md。

类似地,对于支持多个框架或变体的 Skill,按变体组织:
cloud-deploy/ ├── SKILL.md(工作流程 + 提供商选择) └── references/ ├── aws.md(AWS 部署模式) ├── gcp.md(GCP 部署模式) └── azure.md(Azure 部署模式)

当用户选择 AWS 时,Claude 只读取 aws.md。

**模式 3:条件详情**

显示基本内容,链接到高级内容:

```markdown
  • 表单填写:完整指南见 FORMS.md
  • API 参考:所有方法见 REFERENCE.md
  • 示例:常见模式见 EXAMPLES.md

Claude only loads FORMS.md, REFERENCE.md or EXAMPLES.md when needed.

**Pattern 2: Organized by domain**

For Skills with multiple domains, organize content by domain to avoid loading irrelevant context:
bigquery-skill/ ├── SKILL.md(概述和导航) └── reference/ ├── finance.md(收入、计费指标) ├── sales.md(机会、管道) ├── product.md(API 使用、功能) └── marketing.md(活动、归因)

When a user asks about sales metrics, Claude only reads sales.md.

Similarly, for Skills that support multiple frameworks or variants, organize by variant:
cloud-deploy/ ├── SKILL.md(工作流程 + 提供商选择) └── references/ ├── aws.md(AWS 部署模式) ├── gcp.md(GCP 部署模式) └── azure.md(Azure 部署模式)

When the user selects AWS, Claude only reads aws.md.

**Pattern 3: Conditional details**

Display basic content, link to advanced content:

```markdown

DOCX 处理

DOCX 处理

创建文档

创建文档

使用 docx-js 创建新文档。见 DOCX-JS.md
使用 docx-js 创建新文档。见 DOCX-JS.md

编辑文档

编辑文档

对于简单编辑,直接修改 XML。
对于修订跟踪:见 REDLINING.md 对于 OOXML 详情:见 OOXML.md

Claude 仅在用户需要这些功能时读取 REDLINING.md 或 OOXML.md。

**重要指南**:

- **避免深层嵌套引用** - 保持引用从 SKILL.md 只有一层深度。所有参考文件应直接从 SKILL.md 链接。
- **结构化较长的参考文件** - 对于超过 100 行的文件,在顶部包含目录,以便 Claude 在预览时可以看到完整范围。
对于简单编辑,直接修改 XML。
对于修订跟踪:见 REDLINING.md 对于 OOXML 详情:见 OOXML.md

Claude only reads REDLINING.md or OOXML.md when the user needs these features.

**Important guidelines**:

- **Avoid deeply nested references** - Keep references only one level deep from SKILL.md. All reference files should be linked directly from SKILL.md.
- **Structure longer reference files** - For files over 100 lines, include a table of contents at the top so Claude can see the full scope when previewing.

Skill 创建流程

Skill Creation Process

Skill 创建涉及以下步骤:
  1. 通过具体示例理解 Skill
  2. 规划可重用的 Skill 内容(脚本、参考资料、资产)
  3. 初始化 Skill(运行 init_skill.py)
  4. 编辑 Skill(实现资源并编写 SKILL.md)
  5. 打包 Skill(运行 package_skill.py)
  6. 基于实际使用迭代
按顺序执行这些步骤,仅在有明确理由说明不适用时才跳过。
Skill creation involves the following steps:
  1. Understand the Skill through concrete examples
  2. Plan reusable Skill content (scripts, references, assets)
  3. Initialize the Skill (run init_skill.py)
  4. Edit the Skill (implement resources and write SKILL.md)
  5. Package the Skill (run package_skill.py)
  6. Iterate based on actual usage
Execute these steps in order, skipping only when there is a clear reason why they do not apply.

步骤 1:通过具体示例理解 Skill

Step 1: Understand the Skill through concrete examples

仅当 Skill 的使用模式已经清楚理解时才跳过此步骤。即使在处理现有 Skill 时,此步骤仍然有价值。
要创建有效的 Skill,需要清楚理解 Skill 将如何使用的具体示例。这种理解可以来自直接的用户示例或经过用户反馈验证的生成示例。
例如,在构建图像编辑器 Skill 时,相关问题包括:
  • "图像编辑器 Skill 应该支持什么功能?编辑、旋转,还有其他吗?"
  • "你能给一些这个 Skill 将如何使用的示例吗?"
  • "我可以想象用户会要求'去除这张图片的红眼'或'旋转这张图片'。还有其他你想象的使用方式吗?"
  • "用户说什么应该触发这个 Skill?"
为避免让用户不堪重负,避免在单条消息中问太多问题。从最重要的问题开始,根据需要跟进以获得更好的效果。
当对 Skill 应支持的功能有清晰认识时,结束此步骤。
Skip this step only if the usage patterns of the Skill are already clearly understood. This step is still valuable even when working on existing Skills.
To create an effective Skill, you need a clear understanding of concrete examples of how the Skill will be used. This understanding can come from direct user examples or generated examples validated by user feedback.
For example, when building an image editor Skill, relevant questions include:
  • "What features should the image editor Skill support? Editing, rotation, what else?"
  • "Can you give some examples of how this Skill will be used?"
  • "I can imagine users asking 'remove red-eye from this image' or 'rotate this image'. Are there other use cases you envision?"
  • "What should a user say to 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 results.
End this step when you have a clear understanding of the features the Skill should support.

步骤 2:规划可重用的 Skill 内容

Step 2: Plan reusable Skill content

要将具体示例转化为有效的 Skill,通过以下方式分析每个示例:
  1. 考虑如何从头执行该示例
  2. 识别在重复执行这些工作流程时哪些脚本、参考资料和资产会有帮助
示例:在构建
pdf-editor
Skill 以处理"帮我旋转这个 PDF"等查询时,分析显示:
  1. 旋转 PDF 每次都需要重写相同的代码
  2. 在 Skill 中存储
    scripts/rotate_pdf.py
    脚本会有帮助
示例:在设计
frontend-webapp-builder
Skill 以处理"给我构建一个待办应用"或"给我构建一个跟踪步数的仪表板"等查询时,分析显示:
  1. 编写前端 webapp 每次都需要相同的样板 HTML/React
  2. 在 Skill 中存储包含样板 HTML/React 项目文件的
    assets/hello-world/
    模板会有帮助
示例:在构建
big-query
Skill 以处理"今天有多少用户登录?"等查询时,分析显示:
  1. 查询 BigQuery 每次都需要重新发现表模式和关系
  2. 在 Skill 中存储记录表模式的
    references/schema.md
    文件会有帮助
要确定 Skill 的内容,分析每个具体示例以创建要包含的可重用资源列表:脚本、参考资料和资产。
To translate concrete examples into an effective Skill, analyze each example by:
  1. Considering how to execute the example from scratch
  2. Identifying which scripts, references and assets would be helpful when repeating these workflows
Example: When building the
pdf-editor
Skill to handle queries such as "help me rotate this PDF", analysis shows:
  1. Rotating PDFs requires rewriting the same code every time
  2. Storing the
    scripts/rotate_pdf.py
    script in the Skill would be helpful
Example: When designing the
frontend-webapp-builder
Skill to handle queries such as "build me a to-do app" or "build me a dashboard to track step count", analysis shows:
  1. Writing frontend webapps requires the same boilerplate HTML/React every time
  2. Storing the
    assets/hello-world/
    template containing boilerplate HTML/React project files in the Skill would be helpful
Example: When building the
big-query
Skill to handle queries such as "how many users logged in today?", analysis shows:
  1. Querying BigQuery requires rediscovering table schemas and relationships every time
  2. Storing the
    references/schema.md
    file documenting table schemas in the Skill would be helpful
To determine the content of the Skill, analyze each concrete example to create a list of reusable resources to include: scripts, references and assets.

步骤 3:初始化 Skill

Step 3: Initialize the Skill

此时,是时候实际创建 Skill 了。
仅当正在开发的 Skill 已经存在且需要迭代或打包时才跳过此步骤。在这种情况下,继续下一步。
从头创建新 Skill 时,始终运行
init_skill.py
脚本。该脚本方便地生成一个新的模板 Skill 目录,自动包含 Skill 所需的一切,使 Skill 创建过程更加高效和可靠。
用法:
bash
scripts/init_skill.py <skill-name> --path <output-directory>
该脚本:
  • 在指定路径创建 Skill 目录
  • 生成带有正确 frontmatter 和 TODO 占位符的 SKILL.md 模板
  • 创建示例资源目录:
    scripts/
    references/
    assets/
  • 在每个目录中添加可以自定义或删除的示例文件
初始化后,根据需要自定义或删除生成的 SKILL.md 和示例文件。
At this point, it is time to actually create the Skill.
Skip this step only if the Skill being developed already exists and needs iteration or packaging. In this case, proceed to the next step.
When creating a new Skill from scratch, always run the
init_skill.py
script. This script conveniently generates a new template Skill directory that automatically includes everything required for a Skill, making the Skill creation process more efficient and reliable.
Usage:
bash
scripts/init_skill.py <skill-name> --path <output-directory>
This script:
  • Creates the Skill directory at the specified path
  • Generates a SKILL.md template with correct frontmatter and TODO placeholders
  • Creates sample resource directories:
    scripts/
    ,
    references/
    and
    assets/
  • Adds sample files in each directory that can be customized or deleted
After initialization, customize or delete the generated SKILL.md and sample files as needed.

步骤 4:编辑 Skill

Step 4: Edit the Skill

编辑(新生成或现有的)Skill 时,请记住该 Skill 是为另一个 Claude 实例使用而创建的。包含对 Claude 有益且非显而易见的信息。考虑什么程序性知识、领域特定细节或可重用资产可以帮助另一个 Claude 实例更有效地执行这些任务。
When editing a (newly generated or existing) Skill, remember that the Skill is created for use by another Claude instance. Include information that is beneficial and non-obvious to Claude. Consider what procedural knowledge, domain-specific details or reusable assets can help another Claude instance perform these tasks more effectively.

学习经过验证的设计模式

Learn proven design patterns

根据 Skill 的需求查阅这些有用的指南:
  • 多步骤流程:见 references/workflows.md 了解顺序工作流程和条件逻辑
  • 特定输出格式或质量标准:见 references/output-patterns.md 了解模板和示例模式
这些文件包含有效 Skill 设计的既定最佳实践。
Refer to these helpful guides based on the Skill's requirements:
  • 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 templates and example patterns
These files contain established best practices for effective Skill design.

从可重用的 Skill 内容开始

Start with reusable Skill content

要开始实现,从上面确定的可重用资源开始:
scripts/
references/
assets/
文件。注意此步骤可能需要用户输入。例如,在实现
brand-guidelines
Skill 时,用户可能需要提供品牌资产或模板存储在
assets/
中,或文档存储在
references/
中。
添加的脚本必须通过实际运行来测试,以确保没有错误且输出符合预期。如果有许多类似的脚本,只需测试代表性样本以确保它们都能工作,同时平衡完成时间。
任何 Skill 不需要的示例文件和目录都应删除。初始化脚本在
scripts/
references/
assets/
中创建示例文件以演示结构,但大多数 Skill 不需要所有这些。
To start implementation, begin with the reusable resources identified above:
scripts/
,
references/
and
assets/
files. Note that this step may require user input. For example, when implementing the
brand-guidelines
Skill, the user may need to provide brand assets or templates to store in
assets/
, or documents to store in
references/
.
Added scripts must be tested by actually running them to ensure there are no errors and the output meets expectations. If there are many similar scripts, only test a representative sample to ensure they all work, while balancing completion time.
Any sample files and directories not required by the Skill should be deleted. The initialization script creates sample files in
scripts/
,
references/
and
assets/
to demonstrate the structure, but most Skills do not need all of them.

更新 SKILL.md

Update SKILL.md

编写指南:始终使用祈使句/不定式形式。
Writing guideline: Always use imperative/infinitive form.
Frontmatter
Frontmatter
编写带有
name
description
的 YAML frontmatter:
  • name
    :Skill 名称
  • description
    :这是 Skill 的主要触发机制,帮助 Claude 理解何时使用该 Skill。
    • 包括 Skill 做什么以及何时使用它的具体触发器/上下文。
    • 在此处包含所有"何时使用"信息 - 不要放在正文中。正文仅在触发后加载,因此正文中的"何时使用此 Skill"部分对 Claude 没有帮助。
    • docx
      Skill 的示例描述:"全面的文档创建、编辑和分析,支持修订跟踪、评论、格式保留和文本提取。当 Claude 需要处理专业文档(.docx 文件)时使用:(1) 创建新文档,(2) 修改或编辑内容,(3) 处理修订跟踪,(4) 添加评论,或任何其他文档任务"
不要在 YAML frontmatter 中包含任何其他字段。
Write YAML frontmatter with
name
and
description
:
  • name
    : Skill name
  • description
    : This is the main trigger mechanism for the Skill, helping Claude understand when to use the Skill.
    • Include what the Skill does and specific triggers/context for when to use it.
    • Include all "when to use" information here - do not put it in the body. The body is only loaded after triggering, so a "when to use this Skill" section in the body is not helpful for Claude.
    • Example description for the
      docx
      Skill: "Comprehensive document creation, editing and analysis with support for revision tracking, comments, format preservation and text extraction. Used when Claude needs to process professional documents (.docx files): (1) create new documents, (2) modify or edit content, (3) handle revision tracking, (4) add comments, or any other document tasks"
Do not include any other fields in the YAML frontmatter.
正文
Body
编写使用 Skill 及其捆绑资源的说明。
Write instructions for using the Skill and its bundled resources.

步骤 4.5:评估是否需要 .claude/rules/ 摘要

Step 4.5: Evaluate the need for .claude/rules/ summary

如果 Skill 包含应全局遵守的规范(如编码规范、架构约定),需要在
.claude/rules/
下创建摘要文件,确保这些规范在每次会话中自动加载。
判断标准
条件需要 rules 摘要不需要
包含编码规范✅ 如命名约定、架构约定❌ 纯工作流程
包含全局约束✅ 如禁止操作、必须遵守的规则❌ 仅限特定场景
每次会话都需要✅ 如代码风格、提交规范❌ 按需触发即可
如果需要
  1. .claude/rules/
    下创建对应的
    .md
    文件
  2. 文件名格式:
    {skill-name}-rules.md
  3. 内容:仅包含规范摘要(不超过 20 行),引用 Skill 获取详情
摘要文件示例
markdown
undefined
If the Skill contains specifications that should be followed globally (such as coding standards, architecture conventions), you need to create a summary file under
.claude/rules/
to ensure these specifications are automatically loaded in each session.
Judgment criteria:
ConditionRequires rules summaryNot required
Includes coding specifications✅ e.g. naming conventions, architecture conventions❌ Pure workflow
Includes global constraints✅ e.g. prohibited operations, mandatory rules❌ Limited to specific scenarios
Required for every session✅ e.g. code style, commit specifications❌ Can be triggered on demand
If required:
  1. Create a corresponding
    .md
    file under
    .claude/rules/
  2. File name format:
    {skill-name}-rules.md
  3. Content: Only include specification summaries (no more than 20 lines), reference the Skill for details
Summary file example:
markdown
undefined

spec-writer 规范摘要

spec-writer 规范摘要

  • Spec 必须放入 01-05 分类目录
  • 文件夹命名:YYYYMMDD-HHMM-中文任务描述
  • 文件名固定为 plan.md
  • 详细规范见 spec-writer Skill

**如果不需要**:跳过此步骤,Skill 仅通过触发机制按需加载。
  • Spec 必须放入 01-05 分类目录
  • 文件夹命名:YYYYMMDD-HHMM-中文任务描述
  • 文件名固定为 plan.md
  • 详细规范见 spec-writer Skill

**If not required**: Skip this step, the Skill is only loaded on demand through the trigger mechanism.

步骤 5:打包 Skill

Step 5: Package the Skill

Skill 开发完成后,必须将其打包成可分发的 .skill 文件与用户共享。打包过程会自动先验证 Skill 以确保它满足所有要求:
bash
scripts/package_skill.py <path/to/skill-folder>
可选的输出目录指定:
bash
scripts/package_skill.py <path/to/skill-folder> ./dist
打包脚本将:
  1. 自动验证 Skill,检查:
    • YAML frontmatter 格式和必需字段
    • Skill 命名约定和目录结构
    • 描述的完整性和质量
    • 文件组织和资源引用
  2. 如果验证通过则打包 Skill,创建以 Skill 命名的 .skill 文件(例如
    my-skill.skill
    ),包含所有文件并保持正确的目录结构以供分发。.skill 文件是带有 .skill 扩展名的 zip 文件。
如果验证失败,脚本将报告错误并退出而不创建包。修复任何验证错误并再次运行打包命令。
After Skill development is complete, it must be packaged into a distributable .skill file to share with users. The packaging process automatically verifies 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> ./dist
The packaging script will:
  1. Automatically verify the Skill, checking:
    • YAML frontmatter format and required fields
    • Skill naming conventions and directory structure
    • Completeness and quality of the description
    • File organization and resource references
  2. Package the Skill if verification passes, creating a .skill file named after the Skill (e.g.
    my-skill.skill
    ) containing all files and maintaining the correct directory structure for distribution. .skill files are zip files with the .skill extension.
If verification fails, the script will report an error and exit without creating the package. Fix any verification errors and run the packaging command again.

步骤 6:迭代

Step 6: Iterate

测试 Skill 后,用户可能会请求改进。这通常发生在使用 Skill 后不久,对 Skill 表现有新鲜的上下文。
迭代工作流程
  1. 在实际任务中使用 Skill
  2. 注意困难或低效之处
  3. 确定应如何更新 SKILL.md 或捆绑资源
  4. 实施更改并再次测试

After testing the Skill, users may request improvements. This usually happens shortly after using the Skill, when there is fresh context about the Skill's performance.
Iteration workflow:
  1. Use the Skill in actual tasks
  2. Note difficulties or inefficiencies
  3. Determine how SKILL.md or bundled resources should be updated
  4. Implement changes and test again

后续动作(工具记忆)

Follow-up Actions (Tool Memory)

完成 Skill 创建/编辑后,你应该:
After completing Skill creation/editing, you should:

验证步骤

Verification Steps

  1. 检查 SKILL.md 的 frontmatter 是否完整(name、description 必填)
  2. 确认 description 包含"何时使用"的触发条件
  3. 验证所有引用的资源文件(scripts/、references/、assets/)都存在
  4. 如有脚本,运行测试确保无错误
  5. 如果 Skill 包含全局规范,检查
    .claude/rules/
    下是否有对应摘要文件
  6. 如有摘要文件,确认摘要内容与 Skill 正文一致(避免信息不同步)
  1. Check that the frontmatter of SKILL.md is complete (name, description are required)
  2. Confirm that the description includes trigger conditions for "when to use"
  3. Verify that all referenced resource files (scripts/, references/, assets/) exist
  4. If there are scripts, run tests to ensure no errors
  5. If the Skill contains global specifications, check that there is a corresponding summary file under
    .claude/rules/
  6. If there is a summary file, confirm that the summary content is consistent with the Skill body (avoid information desynchronization)

质量检查

Quality Checks

  1. SKILL.md 正文是否控制在 500 行以内?
  2. 是否避免了与 references/ 文件的内容重复?
  3. 是否删除了不需要的示例文件和目录?
  4. 较长的参考文件是否有目录?
  1. Is the SKILL.md body controlled within 500 lines?
  2. Is content duplication with references/ files avoided?
  3. Are unnecessary sample files and directories deleted?
  4. Do longer reference files have a table of contents?

打包与分发

Packaging and Distribution

  1. 运行
    scripts/package_skill.py <skill-folder>
    打包
  2. 如验证失败,根据错误信息修复后重新打包
  3. 将生成的
    .skill
    文件分享给用户
  1. Run
    scripts/package_skill.py <skill-folder>
    to package
  2. If verification fails, fix according to the error message and repackage
  3. Share the generated
    .skill
    file with the user

常见陷阱

Common Pitfalls

  • description 中遗漏触发条件,导致 Skill 不会被自动调用
  • 在正文中写"何时使用此 Skill"(应写在 description 中)
  • 创建了 README.md 等不必要的辅助文件
  • 脚本未经测试就打包分发
  • Missing trigger conditions in the description, causing the Skill not to be called automatically
  • Writing "when to use this Skill" in the body (should be written in the description)
  • Creating unnecessary auxiliary files such as README.md
  • Packaging and distributing scripts without testing