template-skill-cn
Skill 模板(中文增强版):演示如何编写自定义 Skill(YAML frontmatter + SKILL.md 主体 + scripts/reference 资源),用于学习 Progressive Disclosure 的工作方式。
When & Why to Use This Skill
This Claude skill serves as a foundational template and educational guide for developers to build custom Claude Agent skills. It demonstrates the optimal directory structure—including YAML frontmatter, core SKILL.md logic, and the implementation of 'Progressive Disclosure'—to optimize context window usage and improve agent reliability through structured instructions and modular resources.
Use Cases
- Boilerplate for New Skills: Quickly initialize a custom skill with the correct directory structure (SKILL.md, reference/, scripts/) to ensure seamless agent discovery and integration.
- Workflow Standardization: Transform complex team SOPs or project-specific workflows into reusable, structured instructions that the agent can reliably execute as a modular skill.
- Context Optimization: Master the 'Progressive Disclosure' technique by separating extensive documentation into reference files, preventing context overflow while maintaining accessibility for the agent.
- Automation Integration: Learn how to bridge high-level instructions with executable scripts (e.g., TypeScript or Bash) for deterministic tasks like code formatting, validation, or data processing.
| name | template-skill-cn |
|---|---|
| description | Skill 模板(中文增强版):演示如何编写自定义 Skill(YAML frontmatter + SKILL.md 主体 + scripts/reference 资源),用于学习 Progressive Disclosure 的工作方式。 |
Skill 模板(template-skill)
这个 Skill 不是为了“解决业务问题”,而是为了教学:让你快速理解 Skill 的目录结构、写法,以及 Agent 什么时候会加载它。
什么时候使用这个 Skill?
- 你要创建一个新的 Skill
- 你希望把某个团队/项目的“固定流程”沉淀为可复用的指令
- 你希望 Skill 带上脚本/参考文档,并且按需读取(渐进式加载)
Skill 基本结构
template-skill/
├── SKILL.md
├── reference/
│ └── guide.md
└── scripts/
└── demo.ts
建议写法(强烈建议)
- frontmatter 必须写好:
name和description决定“模型是否会想到用这个 Skill” - SKILL.md 主体写流程:以“步骤/检查清单”的形式写,便于模型执行
- 把长内容放到 reference/:例如 API 文档、规范、FAQ;需要时再让模型 read_file
- 把确定性操作放到 scripts/:例如代码生成、格式化、校验;需要时再让模型 bash 执行脚本
参考资料(按需读取)
阅读 Guide 了解更详细的写作建议与示例。
可执行脚本(按需执行)
当你需要演示“Skill 引用脚本 + Agent 运行脚本”的链路时,运行:
node scripts/demo.ts