skill-creator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Skill Creator

Skill Creator

This skill provides guidance for creating effective, agent-agnostic skills.
本Skill为创建高效、与Agent无关的技能提供指导。

About Skills

关于Skills

Skills are modular, self-contained packages that extend AI agent capabilities by providing specialized knowledge, workflows, and tools. Think of them as "onboarding guides" for specific domains or tasks—they transform a general-purpose agent into a specialized agent equipped with procedural knowledge.
Skills是模块化、独立的包,通过提供专业知识、工作流和工具来扩展AI Agent的能力。可以将它们视为特定领域或任务的“入门指南”——它们能将通用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. 领域专业知识 - 公司专属知识、架构、业务逻辑
  4. 捆绑资源 - 用于复杂和重复任务的脚本、参考资料及资产

Core Principles

核心原则

Concise is Key

简洁为要

The context window is a public good. Skills share context with everything else the agent needs.
Default assumption: The agent is already very smart. Only add context it doesn't already have. Challenge each piece of information: "Does the agent really need this?" and "Does this paragraph justify its token cost?"
Prefer concise examples over verbose explanations.
上下文窗口是公共资源。Skills会与Agent所需的其他所有内容共享上下文。
默认假设:Agent已经非常智能。 只添加它不具备的上下文内容。对每一条信息都要提出质疑:“Agent真的需要这个吗?”以及“这段内容的令牌成本是否值得?”
优先选择简洁的示例而非冗长的解释。

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 loaded into context as needed
    └── assets/           - Files used in output (templates, icons, fonts, etc.)
每个Skill都包含一个必填的SKILL.md文件和可选的捆绑资源:
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 loaded into context as needed
    └── assets/           - Files used in output (templates, icons, fonts, etc.)

SKILL.md (required)

SKILL.md(必填)

Every SKILL.md consists of:
  • Frontmatter (YAML): Contains
    name
    and
    description
    fields. These are the only fields read to determine when the skill gets used—be clear and comprehensive.
  • Body (Markdown): Instructions and guidance for using the skill. Only loaded AFTER the skill triggers.
每个SKILL.md都包含:
  • Frontmatter(YAML格式):包含
    name
    description
    字段。这两个字段是决定Skill何时被使用的唯一依据——内容需清晰全面。
  • 正文(Markdown格式):使用Skill的说明和指南。仅在Skill被触发后才会加载。

Bundled Resources (optional)

捆绑资源(可选)

Scripts (
scripts/
)
脚本(
scripts/
Executable code for tasks that require deterministic reliability or are repeatedly rewritten.
  • When to include: When the same code is being rewritten repeatedly
  • Example:
    scripts/rotate_pdf.py
    for PDF rotation tasks
  • Benefits: Token efficient, deterministic
用于需要确定性可靠性或需重复编写的任务的可执行代码。
  • 何时包含:当相同代码需要重复编写时
  • 示例:用于PDF旋转任务的
    scripts/rotate_pdf.py
  • 优势:令牌效率高,结果确定
References (
references/
)
参考资料(
references/
Documentation and reference material loaded as needed into context.
  • When to include: For documentation the agent should reference while working
  • Examples:
    references/schema.md
    for database schemas,
    references/api_docs.md
    for API specifications
  • Benefits: Keeps SKILL.md lean, loaded only when needed
根据需要加载到上下文中的文档和参考资料。
  • 何时包含:当Agent在工作中需要参考文档时
  • 示例:用于数据库架构的
    references/schema.md
    ,用于API规范的
    references/api_docs.md
  • 优势:保持SKILL.md简洁,仅在需要时加载
Assets (
assets/
)
资产(
assets/
Files not intended to be loaded into context, but used within output.
  • When to include: When the skill needs files for final output
  • Examples:
    assets/logo.png
    for brand assets,
    assets/template.html
    for HTML boilerplate
不用于加载到上下文,但会在输出中使用的文件。
  • 何时包含:当Skill需要文件用于最终输出时
  • 示例:用于品牌资产的
    assets/logo.png
    ,用于HTML模板的
    assets/template.html

Progressive Disclosure

渐进式披露

Skills use a three-level loading system:
  1. Metadata (name + description) - Always in context (~100 words)
  2. SKILL.md body - When skill triggers (<5k words)
  3. Bundled resources - As needed (unlimited)
Keep SKILL.md body under 500 lines. Split content into separate files when approaching this limit.
Skills采用三级加载系统:
  1. 元数据(名称+描述) - 始终在上下文中(约100词)
  2. SKILL.md正文 - 当Skill被触发时加载(<5000词)
  3. 捆绑资源 - 根据需要加载(无限制)
保持SKILL.md正文少于500行。当接近此限制时,将内容拆分到单独文件中。

Skill Creation Process

Skill创建流程

Step 1: Understand the Skill

步骤1:明确Skill定位

Clarify with concrete examples:
  • "What functionality should this skill support?"
  • "Can you give examples of how this skill would be used?"
  • "What would trigger this skill?"
通过具体示例明确:
  • “此Skill应支持哪些功能?”
  • “你能举例说明如何使用此Skill吗?”
  • “什么会触发此Skill?”

Step 2: Plan Reusable Contents

步骤2:规划可复用内容

Analyze each example:
  1. Consider how to execute from scratch
  2. Identify helpful scripts, references, and assets
分析每个示例:
  1. 考虑如何从头开始执行
  2. 确定有用的脚本、参考资料和资产

Step 3: Create the Skill

步骤3:创建Skill目录

Create the skill directory:
skill-name/
├── SKILL.md
├── scripts/     (if needed)
├── references/  (if needed)
└── assets/      (if needed)
创建如下Skill目录:
skill-name/
├── SKILL.md
├── scripts/     (if needed)
├── references/  (if needed)
└── assets/      (if needed)

Step 4: Write SKILL.md

步骤4:编写SKILL.md

Frontmatter

Frontmatter

yaml
---
name: skill-name
description: What the skill does and when to use it. Include specific triggers and contexts. Max 1024 characters.
---
Description guidelines:
  • Include both what the skill does AND when to use it
  • Include trigger phrases
  • Max 1024 characters, no XML tags
  • Write in third person
yaml
---
name: skill-name
description: What the skill does and when to use it. Include specific triggers and contexts. Max 1024 characters.
---
描述指南:
  • 同时包含Skill的功能和使用场景
  • 包含触发短语
  • 最多1024字符,无XML标签
  • 使用第三人称撰写

Body

正文

Write instructions for using the skill. Include:
  • Quick start guide
  • Step-by-step workflow
  • Links to reference files when needed
编写使用Skill的说明,包括:
  • 快速入门指南
  • 分步工作流
  • 必要时添加参考文件的链接

Step 5: Test and Iterate

步骤5:测试与迭代

  1. Use the skill on real tasks
  2. Notice struggles or inefficiencies
  3. Update SKILL.md or resources accordingly
  4. Test again
  1. 在实际任务中使用Skill
  2. 注意遇到的问题或低效之处
  3. 相应更新SKILL.md或资源
  4. 再次测试

Quality Checklist

质量检查清单

Before finalizing:
  • Description is specific about when to use (max 1024 chars)
  • Folder name uses kebab-case
  • Instructions are actionable and unambiguous
  • Scope is focused (one responsibility)
  • SKILL.md body < 500 lines
  • References are one level deep from SKILL.md
最终确定前需检查:
  • 描述明确说明了使用场景(最多1024字符)
  • 文件夹名称使用kebab-case格式
  • 说明可操作且无歧义
  • 范围聚焦(单一职责)
  • SKILL.md正文少于500行
  • 参考资料与SKILL.md处于同一层级

Output Messages

输出消息

When creating a skill, inform the user:
✅ Skill created successfully!

📁 Location: .agent/skills/[name]/SKILL.md
🎯 Purpose: [brief description]
🔧 How to test: [example prompt that should trigger the skill]

💡 Tip: The agent will use this skill automatically when it detects [context].
创建Skill时,告知用户:
✅ Skill created successfully!

📁 Location: .agent/skills/[name]/SKILL.md
🎯 Purpose: [brief description]
🔧 How to test: [example prompt that should trigger the skill]

💡 Tip: The agent will use this skill automatically when it detects [context].