Loading...
Loading...
Compare original and translation side by side
/heal-skill → Full library scan (all skills)
/heal-skill <name> → Single skill diagnosis
/heal-skill --fix → Apply all auto-fixes (with confirmation)
/heal-skill --fix <name> → Fix single skill (with confirmation)<objective><quick_start><success_criteria>/heal-skill heal-skill/heal-skill → 全技能库扫描(所有Skill)
/heal-skill <name> → 单个Skill诊断
/heal-skill --fix → 应用所有自动修复(需确认)
/heal-skill --fix <name> → 修复单个Skill(需确认)<objective><quick_start><success_criteria>/heal-skill heal-skillLayer 1: STRUCTURAL (CRITICAL) → Files exist, YAML parses, required fields present
Layer 2: CONTENT (HIGH) → XML sections, line count, naming conventions
Layer 3: INTEGRATION (MEDIUM) → config.json schema, duplicate triggers, cross-refsLayer 1: STRUCTURAL (CRITICAL) → 文件存在、YAML可解析、必填字段齐全
Layer 2: CONTENT (HIGH) → XML章节、行数、命名规范
Layer 3: INTEGRATION (MEDIUM) → config.json schema、重复触发条件、交叉引用| ID | Check | Rule | Auto-fix |
|---|---|---|---|
| S1 | YAML frontmatter exists | SKILL.md starts with | No |
| S2 | | Required, non-empty string | No |
| S3 | | | Yes — slugify |
| S4 | | Required, non-empty string | No |
| S5 | | Max 1024 chars | Yes — truncate |
| S6 | | No | Yes — strip tags |
| S7 | | Not YAML array/object | Yes — join if array |
| S8 | SKILL.md exists | Must exist in skill directory | No |
| S9 | config.json exists | Must exist in skill directory | Yes — generate from SKILL.md |
| S10 | config.json is valid JSON | Must parse without error | No |
---name:^[a-z0-9-]+$length <= 64<[a-z_]+>| ID | 检查项 | 规则 | 自动修复 |
|---|---|---|---|
| S1 | YAML前置元数据存在 | SKILL.md以 | 否 |
| S2 | 存在 | 必填,非空字符串 | 否 |
| S3 | | 符合 | 是 — 转换为slug格式 |
| S4 | 存在 | 必填,非空字符串 | 否 |
| S5 | | 最长1024字符 | 是 — 截断 |
| S6 | | 值中不含 | 是 — 移除标签 |
| S7 | | 不是YAML数组/对象 | 是 — 若为数组则拼接 |
| S8 | SKILL.md存在 | 必须在Skill目录中 | 否 |
| S9 | config.json存在 | 必须在Skill目录中 | 是 — 从SKILL.md生成 |
| S10 | config.json是有效JSON | 可正常解析无错误 | 否 |
---name:^[a-z0-9-]+$length <= 64<[a-z_]+>| ID | Check | Rule | Auto-fix |
|---|---|---|---|
| C1 | | Must be present in SKILL.md body | Yes — add stub |
| C2 | | Must be present in SKILL.md body | Yes — add stub |
| C3 | | Must be present in SKILL.md body | Yes — add stub |
| C4 | Line count | Body ≤ 500 lines (warning only) | Warning |
| C5 | Dead reference links | Internal | Yes — remove dead |
| C6 | Naming convention | Directory ends with | Warning |
<objective><quick_start><success_criteria>wc -l SKILL.md[text](reference/...)-skill| ID | 检查项 | 规则 | 自动修复 |
|---|---|---|---|
| C1 | 存在 | 必须在SKILL.md正文中 | 是 — 添加占位符 |
| C2 | 存在 | 必须在SKILL.md正文中 | 是 — 添加占位符 |
| C3 | 存在 | 必须在SKILL.md正文中 | 是 — 添加占位符 |
| C4 | 行数 | 正文≤500行(仅警告) | 警告 |
| C5 | 无效引用链接 | 内部 | 是 — 移除无效链接 |
| C6 | 命名规范 | 目录以 | 警告 |
<objective><quick_start><success_criteria>wc -l SKILL.md[text](reference/...)-skill| ID | Check | Rule | Auto-fix |
|---|---|---|---|
| I1 | config.json has standard keys | Must have | Yes — add missing |
| I2 | Uses | Not | Yes — rename key |
| I3 | Uses | Not | Yes — rename key |
| I4 | Has | Must have | Yes — add "1.0.0" |
| I5 | No duplicate activation triggers | No trigger collisions across skills | Warning |
triggersactivation_triggersdependenciesdepends_on| ID | 检查项 | 规则 | 自动修复 |
|---|---|---|---|
| I1 | config.json包含标准键 | 必须包含 | 是 — 添加缺失的键 |
| I2 | 使用 | 不使用旧版名称 | 是 — 重命名键 |
| I3 | 使用 | 不使用旧版名称 | 是 — 重命名键 |
| I4 | 包含 | 必须有 | 是 — 添加"1.0.0" |
| I5 | 无重复激活触发条件 | 不同Skill之间无触发条件冲突 | 警告 |
triggersactivation_triggersdependenciesdepends_on1. DISCOVER
- Scan active/ and stable/ directories
- Build skill inventory (name, path, has SKILL.md, has config.json)
2. LAYER 1 — STRUCTURAL
- For each skill: parse YAML frontmatter, validate fields
- STOP on critical failures (no SKILL.md = skip remaining checks)
3. LAYER 2 — CONTENT
- For each skill: search for XML sections, check line count
- Check naming convention
4. LAYER 3 — INTEGRATION
- For each skill: validate config.json schema
- Cross-skill: check for duplicate triggers
5. REPORT
- Generate health report grouped by severity
- Calculate health score
- List available auto-fixes1. 发现
- 扫描active/和stable/目录
- 构建Skill清单(名称、路径、是否有SKILL.md、是否有config.json)
2. 第一层 — 结构
- 对每个Skill:解析YAML前置元数据,验证字段
- 若出现严重失败则停止(无SKILL.md则跳过后续检查)
3. 第二层 — 内容
- 对每个Skill:搜索XML章节,检查行数
- 检查命名规范
4. 第三层 — 集成
- 对每个Skill:验证config.json schema
- 跨Skill:检查是否有重复触发条件
5. 报告
- 按严重程度分组生成健康报告
- 计算健康评分
- 列出可用的自动修复选项SKILL HEALTH REPORT
════════════════════════════════════════════════
Scanned: X skills | Health Score: Y/Z (N%)
CRITICAL (n):
✗ skill-name: Description of issue [CHECK-ID]
HIGH (n):
⚠ skill-name: Description of issue [CHECK-ID]
MEDIUM (n):
ℹ skill-name: Description of issue [CHECK-ID]
WARNINGS (n):
~ skill-name: Description of advisory [CHECK-ID]
════════════════════════════════════════════════
AUTO-FIX AVAILABLE: N issues can be auto-fixed
Run /heal-skill --fix to preview and applySKILL HEALTH REPORT
════════════════════════════════════════════════
已扫描:X个Skill | 健康评分:Y/Z(N%)
严重问题(n):
✗ skill-name: 问题描述 [检查项ID]
高优先级问题(n):
⚠ skill-name: 问题描述 [检查项ID]
中优先级问题(n):
ℹ skill-name: 问题描述 [检查项ID]
警告(n):
~ skill-name: 建议说明 [检查项ID]
════════════════════════════════════════════════
可自动修复:N个问题可自动修复
运行 /heal-skill --fix 预览并应用修复--fix1. PREVIEW
- Show each proposed change as a diff:
```
FIX: skill-name — [CHECK-ID] Description
--- before
+++ after
@@ change description @@
-old content
+new content
```
2. CONFIRM
- Ask user: "Apply N fixes? (yes/no/select)"
- "select" lets user pick individual fixes
3. APPLY
- Make changes to files
- Re-run affected checks to verify fix worked
4. RE-VALIDATE
- Run full scan on fixed skills
- Report new health score| Check | Fix Strategy |
|---|---|
| S3 | Slugify: lowercase, replace spaces/special chars with hyphens |
| S5 | Truncate to 1024 chars at last sentence boundary |
| S6 | Strip XML tags with regex: |
| S7 | If array: join elements with ". ". If object: use first value |
| S9 | Generate minimal config.json from SKILL.md frontmatter |
| C1 | Add |
| C2 | Add |
| C3 | Add |
| C5 | Remove dead |
| I1 | Add missing keys with defaults from SKILL.md frontmatter |
| I2 | Rename |
| I3 | Rename |
| I4 | Add |
--fix1. 预览
- 以差异形式展示每个拟议更改:
```
修复:skill-name — [检查项ID] 描述
--- 修复前
+++ 修复后
@@ 更改描述 @@
-旧内容
+新内容
```
2. 确认
- 询问用户:“是否应用N个修复?(是/否/选择)”
- “选择”选项允许用户挑选单个修复项
3. 应用
- 修改文件
- 重新运行受影响的检查以验证修复效果
4. 重新验证
- 对已修复的Skill运行完整扫描
- 报告新的健康评分| 检查项 | 修复策略 |
|---|---|
| S3 | 转换为slug格式:小写,将空格/特殊字符替换为连字符 |
| S5 | 在最后一个句子边界处截断至1024字符 |
| S6 | 使用正则移除XML标签: |
| S7 | 若为数组:用“. ”拼接元素。若为对象:使用第一个值 |
| S9 | 从SKILL.md前置元数据生成最简config.json |
| C1 | 在前置元数据后添加 |
| C2 | 在目标章节后添加 |
| C3 | 在快速开始章节后添加 |
| C5 | 移除无效的 |
| I1 | 从SKILL.md前置元数据添加缺失的键及默认值 |
| I2 | 在config.json中将 |
| I3 | 在config.json中将 |
| I4 | 在config.json中添加 |
| Source | Pattern | Check |
|---|---|---|
| GitHub #9817 | Whitespace before | S1 |
| GitHub #11322 | Prettier reformats description to multi-line | S7 |
| GitHub #17604 | YAML array in description crashes slash commands | S7 |
| GitHub #6377 | Missing | S2 |
| GitHub #14882 | Skills consume full tokens (no progressive disclosure) | C4 |
| GitHub #14577 | | S1, S2 |
| Library audit | 8 skills missing XML sections | C1-C3 |
| Library audit | 9 skills using legacy config.json keys | I2, I3 |
| Library audit | 1 skill missing | C6 |
| 来源 | 模式 | 检查项 |
|---|---|---|
| GitHub #9817 | | S1 |
| GitHub #11322 | Prettier将description格式化为多行 | S7 |
| GitHub #17604 | description中的YAML数组导致斜杠命令崩溃 | S7 |
| GitHub #6377 | 尽管YAML结构有效,但缺失 | S2 |
| GitHub #14882 | Skill占用全部令牌(无渐进式披露) | C4 |
| GitHub #14577 | | S1, S2 |
| 技能库审计 | 8个Skill缺失XML章节 | C1-C3 |
| 技能库审计 | 9个Skill使用旧版config.json键 | I2, I3 |
| 技能库审计 | 1个Skill缺失 | C6 |
| Mistake | Fix |
|---|---|
Running | Always preview first. The protocol requires confirmation. |
| Ignoring WARNINGS | Warnings are advisory but indicate tech debt. Track them. |
| Fixing only CRITICAL issues | HIGH and MEDIUM issues affect discoverability and tooling. Fix all layers. |
| Adding XML stubs without filling them in | Stubs are placeholders. Schedule time to write real content. |
| Running heal on a single skill when library-wide issues exist | Run full scan first to see the big picture. |
| 错误 | 修复方案 |
|---|---|
未查看差异就运行 | 始终先预览。协议要求必须确认。 |
| 忽略警告 | 警告虽为建议,但表明存在技术债务。需跟踪处理。 |
| 仅修复严重问题 | 高优先级和中优先级问题会影响可发现性和工具使用。需修复所有层级的问题。 |
| 添加XML占位符但未填充内容 | 占位符仅为临时方案。需安排时间编写真实内容。 |
| 当存在全库问题时仅诊断单个Skill | 先运行全扫描以了解整体情况。 |