Loading...
Loading...
Use when skills fail to activate, produce errors, need structural validation, or the library needs a health audit. Diagnose YAML frontmatter, XML sections, config.json schema, file structure, and cross-skill dependencies.
npx skill4agent add scientiacapital/skills heal-skill/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-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-refs| 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 | 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 | 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_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-fixesSKILL 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 apply--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 |
| 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 |
| 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. |