skills-create

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Skills Create — the meta-skill

Skills Create — 元Skill

A skill that authors and refactors skills. Two jobs:
  • Create a new skill from scratch (or from an existing prompt/command).
  • Refactor a fat skill — split detail into
    references/
    , move output shapes into
    templates/
    , trim
    SKILL.md
    down to a lean spine of pointers.
It's built the way it teaches: a lean body that defers detail to
references/
. That's progressive disclosure, and this skill is its own worked example. It's all composable markdown: a skill is a
SKILL.md
plus optional files the agent loads only when it reaches for them.
这是一个用于编写和重构Skill的Skill,承担两项工作:
  • 创建:从零开始(或基于现有提示词/命令)创建新Skill。
  • 重构:优化臃肿的Skill——将细节拆分至
    references/
    目录,将输出格式移至
    templates/
    目录,把
    SKILL.md
    精简为仅包含指向资源的核心框架。
它的构建方式与它所教授的一致:主体简洁,细节全部委托给
references/
目录。这是渐进式披露的设计,而本Skill本身就是一个实践范例。所有内容均为可组合的Markdown:一个Skill由
SKILL.md
文件加上可选的资源文件组成,Agent仅在需要时才会加载这些资源文件。

Prescribe the craft, not the content

规范工艺,而非内容

Be strict on how a skill is built and agnostic on what any given skill — or its output — should contain.
  • Prescribe (firm, universal): progressive disclosure · a third-person, trigger-rich
    description
    · an imperative, lean body · no duplication · every bundled file wired · deliberate invocation control · validation that fits the skill type. (See
    references/skill-standards.md
    .)
  • Do NOT prescribe (the author's call): the sections a plan/PRD/report should have, the domain vocabulary, the output shape, which phases exist. There is no canonical output — guide the author to a good decision, never hand them a fixed one.
Strict on the craft so the author stays free on the content. (Guide, don't prescribe — and take-vs-build: you build a skill when you own the process and want it to follow YOUR way.)
严格规范Skill的构建方式,但不对具体Skill的内容或输出做强制要求
  • 强制规范(通用且严格):渐进式披露 · 第三人称、触发词丰富的
    description
    · 命令式、简洁的主体内容 · 无重复内容 · 所有关联文件均已关联 · 可控的调用逻辑 · 适配Skill类型的验证机制。(详见
    references/skill-standards.md
  • 不做强制要求(由作者决定):计划/PRD/报告应包含的章节、领域术语、输出格式、流程阶段等。不存在标准输出——引导作者做出合理决策,而非直接给出固定方案。
严格规范工艺是为了让作者在内容创作上拥有更大自由。(引导而非强制——另外,采用“自建”而非“取用”的场景:当你掌控流程,希望Agent遵循你的方式执行时,就需要自建Skill。)

Classify the skill first

先对Skill进行分类

Pin the type before applying the craft — the guidance is proportional, not one-size-fits-all:
TypeWhat it isApply
Workflowa multi-step procedure (plan, review, ship)the full lens incl. verifiable validation gates
Artifact-generatorproduces a document/outputContext-is-King + a suggested (never mandated) output shape
Knowledge / referencefacts the agent consultsContext-is-King + information-dense; no phases, no validation loop
Tool-wrapperdrives a script / CLI / APIa deterministic script + sharp triggers; validation = the tool's own exit code
A skill can blend types — apply the union of what fits. Never force a workflow's machinery (phases, loops, output skeletons) onto a knowledge skill. Full detail:
references/skill-standards.md
→ Skill types.
在应用规范之前,先确定Skill的类型——指导方案需匹配类型,而非一概而论:
类型定义适用规范
Workflow(工作流)多步骤流程(规划、评审、交付)完整规范,包括可验证的验证节点
Artifact-generator(产物生成器)生成文档/输出内容以上下文为核心 + 建议性(非强制性)的输出格式
Knowledge / reference(知识/参考)Agent可查阅的事实内容以上下文为核心 + 信息密集;流程阶段,验证循环
Tool-wrapper(工具封装)驱动脚本/CLI/API确定性脚本 + 明确触发词;验证机制=工具自身的退出码
一个Skill可以混合多种类型——应用所有适配的规范。切勿将工作流的机制(阶段、循环、输出框架)强加于知识类Skill。详细内容见
references/skill-standards.md
→ Skill类型章节。

Step 0 — pick the mode (from
$ARGUMENTS
)

步骤0 — 选择模式(从
$ARGUMENTS
中获取)

Parse
$ARGUMENTS
to pick the mode and the target:
  • Starts with
    create [<name>]
    (or is clearly a new-skill ask) → create mode; use
    <name>
    as the skill name if one was given → follow
    references/creating-skills.md
    .
  • Starts with
    refactor <path/to/SKILL.md>
    (or points at an existing skill) → refactor mode on that path → follow
    references/refactoring-skills.md
    .
  • Blank or unclear → ask which mode and what the skill/target is. Don't guess.
Both modes obey the same craft rules → read
references/skill-standards.md
first.
解析**
$ARGUMENTS
**来选择模式和目标:
  • 以**
    create [<name>]
    **开头(或明确是创建新Skill的请求)→ 创建模式;如果提供了
    <name>
    ,则将其作为Skill名称 → 遵循
    references/creating-skills.md
    的指导。
  • 以**
    refactor <path/to/SKILL.md>
    开头(或指向现有Skill)→ 对指定路径的Skill执行重构**模式 → 遵循
    references/refactoring-skills.md
    的指导。
  • 空白或不明确 → 询问用户选择哪种模式,以及Skill/目标是什么。切勿猜测。
两种模式均遵循相同的工艺规则 → 请先阅读
references/skill-standards.md

Create — quick spine (full detail:
references/creating-skills.md
)

创建 — 快速框架(详细内容:
references/creating-skills.md

  1. Gather context — the literal phrases that should trigger it, the task start-to-finish, the gotchas, the patterns to mirror. Ask the user; don't write yet.
  2. Plan the resources — what repeats →
    scripts/
    ; what informs the work →
    references/
    ; what shapes the output →
    templates/
    ; what you don't own / changes upstream → cite a path/URL; what only exists at runtime → gather it (ask the user, read git/codebase).
  3. Scaffold — copy
    templates/SKILL.template.md
    to
    .claude/skills/<name>/SKILL.md
    ; add
    references/
    /
    templates/
    only as the plan needs.
  4. Write the spine first — third-person trigger-rich
    description
    ; imperative, lean body; push detail to references. Get it triggering before you write the references.
  5. Validate & iterate
    references/validation.md
    (checklist → trigger test → run it for real).
  1. 收集上下文——触发该Skill的具体短语、完整任务流程、注意事项、需遵循的模式。向用户询问这些信息,暂不开始编写。
  2. 规划资源——重复内容→放入
    scripts/
    目录;指导工作的参考内容→放入
    references/
    目录;定义输出格式的内容→放入
    templates/
    目录;非你维护/上游会变动的内容→引用路径/URL;仅在运行时存在的内容→收集(询问用户、读取git/代码库)。
  3. 搭建脚手架——将
    templates/SKILL.template.md
    复制到
    .claude/skills/<name>/SKILL.md
    ;仅根据规划需求添加
    references/
    /
    templates/
    目录。
  4. 先编写核心框架——第三人称、触发词丰富的
    description
    ;命令式、简洁的主体内容;将细节移至参考文件。先确保Skill能被正确触发,再编写参考内容。
  5. 验证与迭代——遵循
    references/validation.md
    (检查清单→触发测试→实际运行)。

Refactor — quick spine (full detail:
references/refactoring-skills.md
)

重构 — 快速框架(详细内容:
references/refactoring-skills.md

  1. Inventory the SKILL.md — mark each block spine (keep) vs extractable (output templates, schemas, long examples, exhaustive pattern/edge-case lists).
  2. Extract verbatim into the target skill's
    references/
    (or
    templates/
    for output shapes) — don't reword anything that affects behavior.
  3. Replace with a pointer — for always-needed content, a mandatory-read line ("Before producing output, read
    templates/<x>.md
    "); for sometimes-needed content, a lazy pointer.
  4. Behavior-preservation check — same process, same output as before. Nothing lost, nothing duplicated.
  5. Validate
    references/validation.md
    .
The #1 refactor risk: moving an always-needed output format into a lazily-loaded reference, so the agent forgets to read it and the output silently changes. Always pair such an extraction with a mandatory-read line.
  1. 盘点SKILL.md——标记每个内容块是核心框架(保留)还是可提取内容(输出模板、 schema、长示例、详尽的模式/边缘情况列表)。
  2. 原封不动提取——将可提取内容移至目标Skill的
    references/
    目录(输出格式则移至
    templates/
    目录)——不要修改任何影响行为的内容。
  3. 替换为指向链接——对于必须阅读的内容,添加强制阅读行(“生成输出前,请阅读
    templates/<x>.md
    ”);对于按需阅读的内容,添加懒加载链接。
  4. 行为一致性检查——确保流程和输出与重构前一致。无内容丢失,无重复内容。
  5. 验证——遵循
    references/validation.md
重构的头号风险:将必须阅读的输出格式移至懒加载的参考文件,导致Agent忘记读取,进而使输出内容悄无声息地发生变化。对于此类提取操作,务必添加强制阅读行。

When to build a skill at all

何时需要自建Skill

Build one when you own a process and want the agent to follow your way of it, repeatedly — the take-vs-build rule. A rough threshold: you've prompted the same thing ~3 times (the Rule of Three) → bank it as a skill. Don't build a skill for a one-off, or for a tool whose owner already ships a good one.
当你掌控某个流程,希望Agent反复遵循你的方式执行时,就需要自建Skill——这就是“取用vs自建”的规则。大致阈值:当你重复三次使用相同的提示词时(三次原则)→ 将其保存为Skill。不要为一次性任务或已有官方优质Skill的工具自建Skill。

Resources

资源

  • references/skill-standards.md
    — the craft rules: skill types, anatomy, context sources, frontmatter spec, progressive disclosure, writing voice, no-duplication, "structure implies a maintainer", wiring, portability.
  • references/creating-skills.md
    — the full create runbook (incl. porting an existing prompt/command).
  • references/refactoring-skills.md
    — the full split-and-trim runbook, with a before/after.
  • references/validation.md
    — the validation gates (structure · description · body · disclosure · behavior · trigger test).
  • templates/SKILL.template.md
    — the lean SKILL.md skeleton to scaffold from.
  • references/skill-standards.md
    ——工艺规则:Skill类型、结构、上下文来源、前置规范、渐进式披露、写作风格、无重复原则、“结构暗示维护者”、关联机制、可移植性。
  • references/creating-skills.md
    ——完整的创建手册(包括将现有提示词/命令转化为Skill)。
  • references/refactoring-skills.md
    ——完整的拆分与精简手册,包含前后对比示例。
  • references/validation.md
    ——验证节点(结构·描述·主体·披露·行为·触发测试)。
  • templates/SKILL.template.md
    ——用于搭建脚手架的简洁SKILL.md框架。