How to install write-a-skill
npx skills add https://github.com/vinvcn/mattpocock-skills-zh-cn --skill write-a-skillFull instructions (SKILL.md)
Source of truth, from vinvcn/mattpocock-skills-zh-cn.
name: write-a-skill description: 创建结构正确、支持 progressive disclosure 并带 bundled resources 的新 agent skills。Use when user wants to create, write, or build a new skill.
Writing Skills
Process
-
Gather requirements — 询问用户:
- skill 覆盖什么 task/domain?
- 应处理哪些具体 use cases?
- 需要 executable scripts,还是只需要 instructions?
- 是否有 reference materials 要包含?
-
Draft the skill — 创建:
- 带 concise instructions 的 SKILL.md
- 如果内容超过 500 行,创建 additional reference files
- 如果需要 deterministic operations,创建 utility scripts
-
Review with user — 展示 draft 并询问:
- 是否覆盖你的 use cases?
- 是否缺失或不清楚?
- 是否有 section 应更详细或更简短?
Skill Structure
skill-name/
├── SKILL.md # Main instructions (required)
├── REFERENCE.md # Detailed docs (if needed)
├── EXAMPLES.md # Usage examples (if needed)
└── scripts/ # Utility scripts (if needed)
└── helper.js
SKILL.md Template
---
name: skill-name
description: Brief description of capability. Use when [specific triggers].
---
# Skill Name
## Quick start
[Minimal working example]
## Workflows
[Step-by-step processes with checklists for complex tasks]
## Advanced features
[Link to separate files: See [REFERENCE.md](REFERENCE.md)]
Description Requirements
description 是 agent 决定是否加载 skill 时唯一看到的内容。它会和其他 installed skills 一起出现在 system prompt 中。agent 会读取这些 descriptions,并根据用户请求选择相关 skill。
Goal:给 agent 足够信息,让它知道:
- 这个 skill 提供什么 capability
- 何时/为什么触发它(specific keywords、contexts、file types)
Format:
- 最多 1024 chars
- 使用 third person
- 第一句说明它做什么
- 第二句:"Use when [specific triggers]"
Good example:
Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when user mentions PDFs, forms, or document extraction.
Bad example:
Helps with documents.
坏例子无法让 agent 区分它和其他 document skills。
When to Add Scripts
以下情况添加 utility scripts:
- Operation 是 deterministic(validation、formatting)
- 同一段 code 会被反复生成
- Errors 需要明确 handling
相比 generated code,scripts 节省 tokens 并提升 reliability。
When to Split Files
以下情况拆分为独立文件:
- SKILL.md 超过 100 行
- 内容有不同 domains(finance vs sales schemas)
- Advanced features 很少需要
Review Checklist
draft 完成后验证:
- Description 包含 triggers("Use when...")
- SKILL.md 低于 100 行
- 没有 time-sensitive info
- Terminology 一致
- 包含 concrete examples
- References 只深入一层
Related skills
More from vinvcn/mattpocock-skills-zh-cn and the wider catalog.
grill-me
围绕 plan 或 design 持续 interview user,直到达成 shared understanding,并逐一解决 decision tree 的每个分支。Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".
grill-with-docs
Grilling session that challenges your plan against the existing domain model, sharpens terminology, and updates documentation (CONTEXT.md, ADRs) inline as decisions crystallise. Use when user wants to stress-test a plan against their project's language and documented decisions.
setup-matt-pocock-skills
Sets up an `## Agent skills` block in AGENTS.md/CLAUDE.md and `docs/agents/` so the engineering skills know this repo's issue tracker (GitHub or local markdown), triage label vocabulary, and domain doc layout. Run before first use of `to-issues`, `to-prd`, `triage`, `diagnose`, `tdd`, `improve-codebase-architecture`, or `zoom-out` — or if those skills appear to be missing context about the issue tracker, triage labels, or domain docs.
tdd
使用 red-green-refactor loop 做 test-driven development。Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development.
diagnose
面向棘手 bug 和性能回退的纪律化 diagnosis loop。Reproduce → minimise → hypothesise → instrument → fix → regression-test. Use when user says "diagnose this" / "debug this", reports a bug, says something is broken/throwing/failing, or describes a performance regression.
improve-codebase-architecture
根据 CONTEXT.md 中的 domain language 和 docs/adr/ 中的 decisions,寻找 codebase 的 deepening opportunities。Use when the user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more testable and AI-navigable.