skill-improve
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSkill Improve
Skill 改进
Runs an improvement loop on a single skill:
test → fix → retest → keep or revert.
对单个Skill运行改进循环:测试 → 修复 → 重测 → 保留或回退。
Phase 1: Parse Argument
阶段1:解析参数
Read the skill name from the first argument. If missing, output usage and stop:
Usage: /skill-improve [skill-name]
Example: /skill-improve tech-debtVerify exists. If not, stop with:
"Skill '[name]' not found."
.claude/skills/[name]/SKILL.md从第一个参数中读取Skill名称。如果参数缺失,输出使用说明并停止:
Usage: /skill-improve [skill-name]
Example: /skill-improve tech-debt验证文件是否存在。如果不存在,停止并提示:
"Skill '[name]' 未找到。"
.claude/skills/[name]/SKILL.mdPhase 2: Baseline Test
阶段2:基准测试
Run and record the baseline score:
/skill-test static [name]- Count of FAILs
- Count of WARNs
- Which specific checks failed (Check 1–7)
Display to the user:
Static baseline: [N] failures, [M] warnings
Failing: Check 4 (no ask-before-write), Check 5 (no handoff)If baseline is 0 FAILs and 0 WARNs, note it and proceed to Phase 2b.
运行并记录基准分数:
/skill-test static [name]- FAIL(失败)的数量
- WARN(警告)的数量
- 具体哪些检查未通过(检查1–7)
向用户展示:
Static baseline: [N] failures, [M] warnings
Failing: Check 4 (no ask-before-write), Check 5 (no handoff)如果基准测试结果为0个FAIL和0个WARN,记录该情况并进入阶段2b。
Phase 2b: Category Baseline
阶段2b:分类基准测试
Look up the skill's field in .
category:CCGS Skill Testing Framework/catalog.yamlIf no field is found, display:
"Category: not yet assigned — skipping category checks."
and skip to Phase 3.
category:If category is found, run and record the category baseline:
/skill-test category [name]- Count of FAILs
- Count of WARNs
- Which specific category rubric metrics failed
Display to the user:
Category baseline: [N] failures, [M] warnings ([category] rubric)If BOTH static and category baselines are 0 FAILs and 0 WARNs, stop:
"This skill already passes all static and category checks. No improvements needed."
在中查找该Skill的字段。
CCGS Skill Testing Framework/catalog.yamlcategory:如果未找到字段,展示:
"Category: 尚未分配 — 跳过分类检查。"
并直接进入阶段3。
category:如果找到分类,运行并记录分类基准分数:
/skill-test category [name]- FAIL的数量
- WARN的数量
- 具体哪些分类评估指标未通过
向用户展示:
Category baseline: [N] failures, [M] warnings ([category] rubric)如果静态检查和分类检查的基准测试结果均为0个FAIL和0个WARN,停止并提示:
"该Skill已通过所有静态检查和分类检查,无需改进。"
Phase 3: Diagnose
阶段3:诊断
Read the full skill file at .
.claude/skills/[name]/SKILL.mdFor each failing or warning static check, identify the exact gap:
- Check 1 fail → which frontmatter field is missing
- Check 2 fail → how many phases found vs. minimum required
- Check 3 fail → no verdict keywords anywhere in the skill body
- Check 4 fail → Write or Edit in allowed-tools but no ask-before-write language
- Check 5 warn → no follow-up or next-step section at the end
- Check 6 warn → set but fewer than 5 phases found
context: fork - Check 7 warn → argument-hint is empty or doesn't match documented modes
For each failing or warning category check (if category was assigned in Phase 2b),
identify the exact gap in the skill's text. For example:
- If G2 fails (gate mode, full directors not spawned): skill body never references all 4 PHASE-GATE director prompts
- If A2 fails (authoring, no per-section May-I-write): skill asks once at the end, not before each section write
- If T3 fails (team, BLOCKED not surfaced): skill doesn't halt dependent work on blocked agent
Show the full combined diagnosis to the user before proposing any changes.
读取完整Skill文件。
.claude/skills/[name]/SKILL.md针对每一项未通过或警告的静态检查,明确指出具体问题:
- 检查1未通过 → 缺少哪个前置元数据字段
- 检查2未通过 → 已发现的阶段数量与最低要求的差距
- 检查3未通过 → Skill正文中未出现任何结论关键词
- 检查4未通过 → allowed-tools中包含Write或Edit,但未添加ask-before-write相关说明
- 检查5警告 → 末尾未包含跟进或下一步章节
- 检查6警告 → 设置了但发现的阶段数量少于5个
context: fork - 检查7警告 → argument-hint为空或与文档记录的模式不匹配
针对每一项未通过或警告的分类检查(如果阶段2b中已分配分类),明确指出Skill文本中的具体问题。例如:
- 如果G2未通过(网关模式,未生成完整的负责人提示):Skill正文中从未提及全部4个PHASE-GATE负责人提示
- 如果A2未通过(创作模式,未按章节询问May-I-write):Skill仅在末尾询问一次,而非在每个章节编写前询问
- 如果T3未通过(团队模式,未上报BLOCKED状态):Skill在Agent被阻塞时未暂停依赖工作
在提出任何修改建议前,向用户展示完整的综合诊断结果。
Phase 4: Propose Fix
阶段4:提出修复方案
Write a targeted fix for each failure and warning. Show the proposed changes
as clearly marked before/after blocks. Only change what is failing — do not
rewrite sections that are passing.
Ask: "May I write this improved version to ?"
.claude/skills/[name]/SKILL.mdIf the user says no, stop here.
针对每一项失败和警告编写针对性修复方案。使用清晰标记的前后对比块展示拟议的修改。仅修改未通过检查的部分——不要重写已通过检查的章节。
询问用户:"是否允许我将改进后的版本写入?"
.claude/skills/[name]/SKILL.md如果用户拒绝,在此处停止流程。
Phase 5: Write and Retest
阶段5:写入并重测
Record the current content of the skill file (for revert if needed).
Write the improved skill to .
.claude/skills/[name]/SKILL.mdRe-run and record the new static score.
If a category was assigned, also re-run and record the new category score.
/skill-test static [name]/skill-test category [name]Display the comparison:
Static: Before [N] failures, [M] warnings → After [N'] failures, [M'] warnings
Category: Before [N] failures, [M] warnings → After [N'] failures, [M'] warnings (if applicable)
Combined change: improved / no change / worse记录当前Skill文件的内容(以便必要时回退)。
将改进后的Skill写入。
.claude/skills/[name]/SKILL.md重新运行并记录新的静态分数。如果已分配分类,同时重新运行并记录新的分类分数。
/skill-test static [name]/skill-test category [name]向用户展示对比结果:
Static: Before [N] failures, [M] warnings → After [N'] failures, [M'] warnings
Category: Before [N] failures, [M] warnings → After [N'] failures, [M'] warnings (如适用)
综合变化:提升/无变化/下降Phase 6: Verdict
阶段6:结论
Count the combined failure total: static FAILs + category FAILs + static WARNs + category WARNs.
If combined score improved (combined failure count is lower than baseline):
Report: "Score improved. Changes kept."
Show a summary of what was fixed in each dimension.
If combined score is the same or worse:
Report: "Combined score did not improve."
Show what changed and why it may not have helped.
Ask: "May I revert using git checkout?"
If yes: run
.claude/skills/[name]/SKILL.mdgit checkout -- .claude/skills/[name]/SKILL.md计算综合失败总数:静态FAIL数 + 分类FAIL数 + 静态WARN数 + 分类WARN数。
如果综合分数提升(综合失败数低于基准值):
报告:"分数已提升,修改已保留。"
展示各维度修复内容的总结。
如果综合分数无变化或下降:
报告:"综合分数未提升。"
展示修改内容及可能无效的原因。
询问用户:"是否允许我使用git checkout回退?"
如果用户同意:运行
.claude/skills/[name]/SKILL.mdgit checkout -- .claude/skills/[name]/SKILL.mdPhase 7: Next Steps
阶段7:下一步操作
- Run to find the next skill with failures.
/skill-test static all - Run to continue the loop on another skill.
/skill-improve [next-name] - Run to see overall coverage progress.
/skill-test audit
- 运行查找下一个存在失败的Skill。
/skill-test static all - 运行继续对其他Skill执行循环改进。
/skill-improve [next-name] - 运行查看整体覆盖进度。
/skill-test audit