skill-authoring
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSkill Authoring Guide
技能编写指南
This skill provides guidance for writing Agent Skills that comply with the agentskills.io specification.
本技能提供符合agentskills.io规范的Agent Skills编写指导。
When to Use
适用场景
- Creating a new skill for this repository
- Reviewing a skill PR for compliance
- Checking if an existing skill follows best practices
- Understanding token budgets and progressive disclosure
- 为当前仓库创建新技能
- 审核技能PR的合规性
- 检查现有技能是否遵循最佳实践
- 了解令牌预算与渐进式披露机制
Constraints
约束条件
- : 1-64 chars, lowercase + hyphens, match directory
name - : 1-1024 chars, explain WHAT and WHEN
description - SKILL.md: <500 tokens (soft), <5000 (hard)
- references/*.md: <1000 tokens each
- :1-64字符,仅小写字母和连字符,需与目录名匹配
name - :1-1024字符,说明技能的用途与适用场景
description - SKILL.md:令牌数建议不超过500(软限制),绝对不超过5000(硬限制)
- references/*.md:每个文件令牌数不超过1000
Structure
结构组成
- (required) - Instructions
SKILL.md - (optional) - Detailed docs
references/ - (optional) - Executable code
scripts/
Frontmatter: (lowercase-hyphens), (WHAT + WHEN)
namedescription- (必填)- 操作说明
SKILL.md - (可选)- 详细文档
references/ - (可选)- 可执行代码
scripts/
前置元数据:(小写字母+连字符)、(用途+适用场景)
namedescriptionProgressive Disclosure
渐进式披露
Metadata (~100 tokens) loads at startup. SKILL.md (<5000 tokens) loads on activation. References load only when explicitly linked (not on activation). Keep SKILL.md lean.
元数据(约100令牌)在启动时加载。SKILL.md(最多5000令牌)在技能激活时加载。参考文档仅在显式链接时加载(不会在激活时自动加载)。请保持SKILL.md内容简洁。
Reference Loading
参考文档加载机制
References are JIT (just-in-time) loaded:
- Only files explicitly linked via load
[text](references/file.md) - Each file loads in full (not sections)
- No caching between requests - write self-contained files
- Use recipes/services patterns for multi-option skills
See REFERENCE-LOADING.md for details.
参考文档采用即时(JIT)加载方式:
- 仅加载通过显式链接的文件
[文本](references/file.md) - 每个文件会被完整加载(而非分段加载)
- 请求之间无缓存 - 请确保文件内容独立完整
- 多选项技能请使用配方/服务模式
详情请查看REFERENCE-LOADING.md。
Validation
验证方法
bash
undefinedbash
undefinedRun from the scripts directory
Run from the scripts directory
cd scripts
npm run tokens -- check plugin/skills/my-skill/SKILL.md
undefinedcd scripts
npm run tokens -- check plugin/skills/my-skill/SKILL.md
undefinedReference Documentation
参考文档
- GUIDELINES.md - Detailed writing guidelines
- REFERENCE-LOADING.md - How references load and token efficiency
- CHECKLIST.md - Pre-submission checklist
- agentskills.io/specification - Official spec
- GUIDELINES.md - 详细编写指南
- REFERENCE-LOADING.md - 参考文档加载机制与令牌效率
- CHECKLIST.md - 提交前检查清单
- agentskills.io/specification - 官方规范