skill-creator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Skill Creator

技能创建器

This skill provides guidance for creating effective skills.
本Skill为创建高效的Skill提供指导。

About Skills

关于Skills

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

What Skills Provide

Skills提供的能力

  1. Specialized workflows - Multi-step procedures for specific domains
  2. Tool integrations - Instructions for working with specific file formats or APIs
  3. Domain expertise - Company-specific knowledge, schemas, business logic
  4. Bundled resources - Scripts, references, and assets for complex and repetitive tasks
  1. 专业工作流:面向特定领域的多步骤操作流程
  2. 工具集成:对接特定文件格式或API的操作说明
  3. 领域专业知识:企业专属知识、数据 schema、业务逻辑
  4. 绑定资源:用于处理复杂重复任务的脚本、参考资料、资产文件

Core Principles

核心原则

Concise is Key

简洁至上

The context window is a public good. Skills share the context window with everything else Codex needs: system prompt, conversation history, other Skills' metadata, and the actual user request.
Default assumption: Codex is already very smart. Only add context Codex doesn't already have. Challenge each piece of information: "Does Codex really need this explanation?" and "Does this paragraph justify its token cost?"
Prefer concise examples over verbose explanations.
上下文窗口是公共资源。Skills需要和Codex所需的所有其他内容共享上下文窗口:系统提示词、对话历史、其他Skills的元数据,以及实际的用户请求。
默认前提:Codex本身已经非常智能。 仅添加Codex尚未掌握的上下文。你需要对每一条信息提出质疑:「Codex真的需要这段解释吗?」以及「这段内容占用的token成本是值得的吗?」
优先使用简洁的示例,而非冗长的说明。

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 Codex as exploring a path: a narrow bridge with cliffs needs specific guardrails (low freedom), while an open field allows many routes (high freedom).
根据任务的容错性和可变程度匹配说明的具体程度:
高自由度(基于文本的指令):适用于存在多种有效方案、决策依赖上下文、或需要靠启发式方法指导操作的场景。
中等自由度(带参数的伪代码或脚本):适用于存在首选实现模式、允许一定程度的变化、或配置会影响行为的场景。
低自由度(参数极少的特定脚本):适用于操作脆弱易出错、一致性至关重要、或必须遵循特定操作顺序的场景。
你可以把Codex的操作想象成探路:悬崖边的窄桥需要明确的护栏(低自由度),而开阔的原野则允许选择多种路线(高自由度)。

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 (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都包含一个必备的SKILL.md文件,以及可选的绑定资源:
skill-name/
├── SKILL.md (必填)
│   ├── YAML前置元数据 (必填)
│   │   ├── name: (必填)
│   │   └── description: (必填)
│   └── Markdown操作说明 (必填)
└── 绑定资源 (可选)
    ├── scripts/          - 可执行代码(Python/Bash等)
    ├── references/       - 按需加载到上下文的文档资料
    └── assets/           - 输出时使用的文件(模板、图标、字体等)

SKILL.md (required)

SKILL.md(必填)

Every SKILL.md consists of:
  • Frontmatter (YAML): Contains
    name
    and
    description
    fields. These are the only fields that Codex 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).
每个SKILL.md都包含以下部分:
  • 前置元数据(YAML格式):包含
    name
    description
    字段。Codex仅通过这两个字段判断何时调用该Skill,因此清晰全面地描述Skill的功能和适用场景非常重要。
  • 正文(Markdown格式):使用该Skill的操作说明和指引。仅在Skill被触发后才会加载(也可能不会加载)。

Bundled Resources (optional)

绑定资源(可选)

Scripts (
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 Codex for patching or environment-specific adjustments
用于需要确定性可靠性,或是会被反复编写的任务的可执行代码(Python/Bash等)。
  • 何时包含:当相同代码会被反复编写,或是需要确定性可靠性时
  • 示例: 用于PDF旋转任务的
    scripts/rotate_pdf.py
  • 优势: 节省token、结果确定、无需加载到上下文即可执行
  • 注意: Codex可能仍需要读取脚本内容来进行补丁修复,或是做环境适配调整
References (
references/
)
参考资料(
references/
Documentation and reference material intended to be loaded as needed into context to inform Codex's process and thinking.
  • When to include: For documentation that Codex 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 Codex 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.
按需加载到上下文的文档和参考材料,用于为Codex的处理流程和决策提供信息。
  • 何时包含:Codex工作时需要参考的文档
  • 示例: 记录财务schema的
    references/finance.md
    、公司NDA模板
    references/mnda.md
    、公司政策
    references/policies.md
    、API规范
    references/api_docs.md
  • 适用场景: 数据库schema、API文档、领域知识、公司政策、详细工作流指南
  • 优势: 保持SKILL.md精简,仅在Codex判定需要时才加载
  • 最佳实践: 如果文件体积较大(超过1万字),请在SKILL.md中添加grep搜索规则
  • 避免重复: 信息要么放在SKILL.md中,要么放在参考文件中,不要同时存在。除非是Skill的核心内容,否则优先放在参考文件中——这样既可以保持SKILL.md精简,又能让信息可被检索,同时不会占用上下文窗口。仅将核心的操作说明和工作流指引保留在SKILL.md中;将详细的参考材料、schema、示例移动到参考文件中。
Assets (
assets/
)
资产(
assets/
Files not intended to be loaded into context, but rather used within the output Codex 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 Codex to use files without loading them into context
不会被加载到上下文,而是会被Codex用于生成输出的文件。
  • 何时包含:Skill需要将这类文件用于最终输出时
  • 示例: 品牌资产
    assets/logo.png
    、PowerPoint模板
    assets/slides.pptx
    、HTML/React样板代码
    assets/frontend-template/
    、字体文件
    assets/font.ttf
  • 适用场景: 模板、图片、图标、样板代码、字体、会被复制或修改的示例文档
  • 优势: 将输出资源和文档分离,让Codex无需加载到上下文即可使用这些文件

What to Not Include in a Skill

不应包含在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 auxiliary 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.
Skill仅应包含直接支撑其功能的必要文件。不要创建无关的文档或辅助文件,包括:
  • README.md
  • INSTALLATION_GUIDE.md
  • QUICK_REFERENCE.md
  • CHANGELOG.md
  • 其他类似文件
Skill仅应包含AI Agent完成当前工作所需的信息。不应包含创建过程的相关背景、设置和测试流程、面向用户的文档等内容。创建额外的文档文件只会增加冗余和混乱。

Progressive Disclosure Design Principle

渐进式披露设计原则

Skills use a three-level loading system to manage context efficiently:
  1. Metadata (name + description) - Always in context (~100 words)
  2. SKILL.md body - When skill triggers (<5k words)
  3. Bundled resources - As needed by Codex (Unlimited because scripts can be executed without reading into context window)
Skills采用三级加载系统来高效管理上下文:
  1. 元数据(名称+描述):始终保留在上下文中(约100字)
  2. SKILL.md正文:Skill触发时加载(少于5000字)
  3. 绑定资源:Codex按需加载(无上限,因为脚本无需读取到上下文窗口即可执行)

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
markdown
undefined
将SKILL.md正文内容控制在500行以内的核心信息,以尽可能减少上下文膨胀。接近这个上限时将内容拆分到独立文件中。将内容拆分到其他文件时,必须在SKILL.md中引用这些文件,并清晰说明何时需要读取它们,确保Skill的使用者知道这些文件的存在和适用场景。
核心原则: 当一个Skill支持多种变体、框架或选项时,仅将核心工作流和选型指引保留在SKILL.md中。将变体专属的细节(模式、示例、配置)移动到独立的参考文件中。
模式1:带参考资料的高阶指南
markdown
undefined

PDF Processing

PDF Processing

Quick start

快速开始

Extract text with pdfplumber: [code example]
使用pdfplumber提取文本: [代码示例]

Advanced features

高级功能

  • Form filling: See FORMS.md for complete guide
  • API reference: See REFERENCE.md for all methods
  • Examples: See EXAMPLES.md for common patterns

Codex 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, Codex 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, Codex only reads aws.md.

**Pattern 3: Conditional details**

Show basic content, link to advanced content:

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

Codex仅在需要时才会加载FORMS.md、REFERENCE.md或EXAMPLES.md。

**模式2:按领域划分的组织方式**

对于覆盖多个领域的Skills,按领域组织内容以避免加载无关上下文:
bigquery-skill/ ├── SKILL.md (概览和导航) └── reference/ ├── finance.md (营收、账单指标) ├── sales.md (商机、销售管道) ├── product.md (API用量、功能) └── marketing.md (营销活动、归因)

当用户询问销售相关指标时,Codex仅读取sales.md。

同理,支持多个框架或变体的Skill可以按变体组织:
cloud-deploy/ ├── SKILL.md (工作流+云厂商选型) └── references/ ├── aws.md (AWS部署模式) ├── gcp.md (GCP部署模式) └── azure.md (Azure部署模式)

当用户选择AWS时,Codex仅读取aws.md。

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

展示基础内容,链接到高级内容:

```markdown

DOCX Processing

DOCX Processing

Creating documents

创建文档

Use docx-js for new documents. See DOCX-JS.md.
新文档使用docx-js创建。参见 DOCX-JS.md

Editing documents

编辑文档

For simple edits, modify the XML directly.
For tracked changes: See REDLINING.md For OOXML details: See OOXML.md

Codex 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 Codex can see the full scope when previewing.
简单编辑可以直接修改XML。
修订痕迹相关操作:参见 REDLINING.md OOXML细节相关:参见 OOXML.md

Codex仅在用户需要对应功能时才会读取REDLINING.md或OOXML.md。

**重要指引:**

- **避免深层嵌套的引用**:参考资料和SKILL.md的层级差保持在一级以内。所有参考文件都应该直接从SKILL.md链接。
- **长参考文件需要结构化**:超过100行的文件需要在顶部添加目录,方便Codex预览时了解完整内容范围。

Skill Creation Process

Skill创建流程

Skill creation involves these steps:
  1. Understand the skill with concrete examples
  2. Plan reusable skill contents (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 real usage
Follow these steps in order, skipping only if there is a clear reason why they are not applicable.
Skill创建包含以下步骤:
  1. 通过具体示例理解Skill的需求
  2. 规划可复用的Skill内容(脚本、参考资料、资产)
  3. 初始化Skill(运行init_skill.py)
  4. 编辑Skill(实现资源并编写SKILL.md)
  5. 打包Skill(运行package_skill.py)
  6. 基于实际使用迭代优化
请按顺序执行这些步骤,仅在有明确不适用的理由时才可以跳过对应步骤。

Skill Naming

Skill命名规则

  • Use lowercase letters, digits, and hyphens only; normalize user-provided titles to hyphen-case (e.g., "Plan Mode" ->
    plan-mode
    ).
  • When generating names, generate a name under 64 characters (letters, digits, hyphens).
  • Prefer short, verb-led phrases that describe the action.
  • Namespace by tool when it improves clarity or triggering (e.g.,
    gh-address-comments
    ,
    linear-address-issue
    ).
  • Name the skill folder exactly after the skill name.
  • 仅使用小写字母、数字和连字符;将用户提供的名称统一转换为短横线命名法(例如:"Plan Mode" 转换为
    plan-mode
    )。
  • 生成名称时长度控制在64字符以内(仅包含字母、数字、连字符)。
  • 优先使用简短的、动词开头的短语描述操作。
  • 如果能提升清晰度或触发准确性,可以按工具加命名空间(例如:
    gh-address-comments
    linear-address-issue
    )。
  • Skill文件夹名称必须和Skill名称完全一致。

Step 1: Understanding the Skill with Concrete Examples

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

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,本步骤仍然有价值。
要创建高效的Skill,需要清晰理解Skill使用场景的具体示例。你可以从用户直接提供的示例,或是经用户反馈验证的生成示例中获取这类信息。
例如,构建图片编辑器Skill时,相关问题包括:
  • 「图片编辑器Skill需要支持哪些功能?编辑、旋转,还有其他吗?」
  • 「你能举几个这个Skill的使用场景示例吗?」
  • 「我能想到用户可能会提出的需求比如『把这张图的红眼去掉』或者『旋转这张图』。你还能想到其他的使用场景吗?」
  • 「用户说什么内容的时候应该触发这个Skill?」
为了避免给用户造成负担,不要在单条消息中问太多问题。先从最重要的问题开始,根据需要后续跟进,这样效率更高。
当你明确了Skill需要支持的功能范围时,本阶段就可以结束了。

Step 2: Planning the Reusable Skill Contents

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

To turn concrete examples into an effective skill, analyze each example by:
  1. Considering how to execute on the example from scratch
  2. 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:
  1. Rotating a PDF requires re-writing the same code each time
  2. 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:
  1. Writing a frontend webapp requires the same boilerplate HTML/React each time
  2. 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:
  1. Querying BigQuery requires re-discovering the table schemas and relationships each time
  2. 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.
要将具体示例转化为高效的Skill,你需要对每个示例做如下分析:
  1. 思考如何从零开始完成示例中的任务
  2. 识别反复执行这些工作流时会用到的脚本、参考资料和资产
示例:构建
pdf-editor
Skill处理「帮我旋转这个PDF」这类需求时,分析结果如下:
  1. 旋转PDF每次都需要重复编写相同的代码
  2. 可以在Skill中存储
    scripts/rotate_pdf.py
    脚本,会很有帮助
示例:设计
frontend-webapp-builder
Skill处理「帮我做一个待办应用」或者「帮我做一个步数统计仪表盘」这类需求时,分析结果如下:
  1. 编写前端web应用每次都需要用到相同的HTML/React样板代码
  2. 可以在Skill中存储包含样板HTML/React项目文件的
    assets/hello-world/
    模板,会很有帮助
示例:构建
big-query
Skill处理「今天有多少用户登录了?」这类需求时,分析结果如下:
  1. 查询BigQuery每次都需要重新了解表结构和关系
  2. 可以在Skill中存储记录表结构的
    references/schema.md
    文件,会很有帮助
要确定Skill的内容,你需要分析每个具体示例,列出需要包含的可复用资源:脚本、参考资料和资产。

Step 3: Initializing the Skill

步骤3:初始化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:
bash
scripts/init_skill.py <skill-name> --path <output-directory> [--resources scripts,references,assets] [--examples]
Examples:
bash
scripts/init_skill.py my-skill --path skills/public
scripts/init_skill.py my-skill --path skills/public --resources scripts,references
scripts/init_skill.py my-skill --path skills/public --resources scripts --examples
The script:
  • Creates the skill directory at the specified path
  • Generates a SKILL.md template with proper frontmatter and TODO placeholders
  • Optionally creates resource directories based on
    --resources
  • Optionally adds example files when
    --examples
    is set
After initialization, customize the SKILL.md and add resources as needed. If you used
--examples
, replace or delete placeholder files.
到这一步就可以正式创建Skill了。
仅当你开发的Skill已经存在,只需要迭代或打包时才可以跳过本步骤。这种情况下直接进入下一步。
从零创建新Skill时,请务必运行
init_skill.py
脚本。该脚本会方便地生成新的Skill目录模板,自动包含Skill所需的所有内容,大幅提升Skill创建流程的效率和可靠性。
用法:
bash
scripts/init_skill.py <skill-name> --path <output-directory> [--resources scripts,references,assets] [--examples]
示例:
bash
scripts/init_skill.py my-skill --path skills/public
scripts/init_skill.py my-skill --path skills/public --resources scripts,references
scripts/init_skill.py my-skill --path skills/public --resources scripts --examples
该脚本会:
  • 在指定路径创建Skill目录
  • 生成带有正确前置元数据和TODO占位符的SKILL.md模板
  • 根据
    --resources
    参数可选创建资源目录
  • 设置
    --examples
    参数时可选添加示例文件
初始化完成后,根据需要自定义SKILL.md并添加资源。如果你使用了
--examples
参数,请替换或删除占位符文件。

Step 4: Edit the Skill

步骤4:编辑Skill

When editing the (newly-generated or existing) skill, remember that the skill is being created for another instance of Codex to use. Include information that would be beneficial and non-obvious to Codex. Consider what procedural knowledge, domain-specific details, or reusable assets would help another Codex instance execute these tasks more effectively.
编辑(新生成或现有)Skill时,请记住你创建的Skill是给其他Codex实例使用的。请添加对Codex有用且不显而易见的信息。思考哪些程序知识、领域专属细节或可复用资产能帮助其他Codex实例更高效地完成这些任务。

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.
根据你的Skill需求参考以下实用指南:
  • 多步骤流程:顺序工作流和条件逻辑请参考references/workflows.md
  • 特定输出格式或质量标准:模板和示例模式请参考references/output-patterns.md
这些文件包含了高效Skill设计的成熟最佳实践。

Start with Reusable Skill Contents

从可复用Skill内容开始

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.
If you used
--examples
, delete any placeholder files that are not needed for the skill. Only create resource directories that are actually required.
实现时,请从你之前识别的可复用资源开始:
scripts/
references/
assets/
文件。注意本步骤可能需要用户输入。例如,实现
brand-guidelines
Skill时,用户可能需要提供品牌资产或模板存放到
assets/
,或是提供文档存放到
references/
添加的脚本必须实际运行测试,确保没有bug,输出符合预期。如果有很多类似的脚本,仅需要测试代表性样本即可,在确保可用性的同时平衡完成时间。
如果你使用了
--examples
参数,请删除所有Skill不需要的占位符文件。仅创建实际需要的资源目录。

Update SKILL.md

更新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 Codex 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 Codex.
    • 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 Codex 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.
编写包含
name
description
的YAML前置元数据:
  • name
    :Skill名称
  • description
    :这是Skill的主要触发机制,帮助Codex理解何时使用该Skill。
    • 同时包含Skill的功能,以及使用它的具体触发场景/上下文。
    • 所有「使用时机」信息都放在这里——不要放在正文中。正文仅在触发后才会加载,因此正文里的「本Skill使用时机」板块对Codex没有用。
    • docx
      Skill的description示例:「全面的文档创建、编辑和分析能力,支持修订痕迹、评论、格式保留和文本提取。当Codex需要处理专业文档(.docx文件)时使用,场景包括:(1) 创建新文档,(2) 修改或编辑内容,(3) 处理修订痕迹,(4) 添加评论,或其他任何文档相关任务」
YAML前置元数据中不要包含其他字段。
Body
正文
Write instructions for using the skill and its bundled resources.
编写使用该Skill及其绑定资源的操作说明。

Step 5: Packaging a Skill

步骤5:打包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:
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. 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
  2. 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.
    Security restriction: symlinks are rejected and packaging fails when any symlink is present.
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文件分享给用户。打包流程会先自动验证Skill是否符合所有要求:
bash
scripts/package_skill.py <path/to/skill-folder>
可选指定输出目录:
bash
scripts/package_skill.py <path/to/skill-folder> ./dist
打包脚本会:
  1. 自动验证Skill,检查项包括:
    • YAML前置元数据格式和必填字段
    • Skill命名规范和目录结构
    • 描述的完整性和质量
    • 文件组织和资源引用
  2. 验证通过后打包Skill,生成和Skill同名的.skill文件(例如
    my-skill.skill
    ),包含所有文件并保留正确的目录结构用于分发。.skill文件是扩展名为.skill的zip文件。
    安全限制:存在符号链接时打包会失败。
如果验证失败,脚本会报错并退出,不会生成包。修复所有验证错误后重新运行打包命令即可。

Step 6: Iterate

步骤6:迭代优化

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:
  1. Use the skill on real tasks
  2. Notice struggles or inefficiencies
  3. Identify how SKILL.md or bundled resources should be updated
  4. Implement changes and test again
测试Skill后,用户可能会提出优化需求。这类需求通常出现在使用完Skill之后,此时用户对Skill的表现有最新的体验。
迭代工作流:
  1. 在真实任务中使用Skill
  2. 发现使用难点或低效点
  3. 确定SKILL.md或绑定资源需要更新的地方
  4. 实现变更并重新测试