Skill health

From ayutaz/piper-plus · View interactive version

Skill health is an AI agent skill from the GitHub repository ayutaz/piper-plus. `.claude/skills/*/SKILL.md` の frontmatter / referenced script 実在 / trigger 衝突 / `.claude/hooks/*.sh` の executable+shebang を検査する meta-skill。 メタワークフロー監査で「hook script rot が最高リスク」と判明したため、 commit 前または skill 編集後に呼んで health check を行う。

How to use this skill

Skill file

Skill / Hook Health Check

このプロジェクトの自動化資産 (skills / tracked hook scripts / .pre-commit-config.yaml の hook 定義) を実体から数えて meta-level で健全性検証する。

memory feedback_conservative_changes.md に従い、 read-only、 検査結果を report として返すのみ。 修正は別 skill / 手動で。

カバー範囲

| 検証対象 | 内容 |

|---------|------|

| SKILL.md frontmatter | name / description / allowed-tools の必須 key、 description 長 |

| name ↔ directory 一致 | .claude/skills/foo/SKILL.md の name: foo であること |

| scripts/*.py 参照 | SKILL.md 内で参照されるスクリプトが repo 内に実在 |

| trigger 衝突 | 複数 skill の description で同じ 「...」 が使われていないか |

| hook 実行可能性 | .claude/hooks/*.sh の executable bit + shebang |

実行ステップ

1. 検査スクリプト実行

uv run python scripts/check_skill_health.py --verbose

期待出力例:

inspected <N> skills, <M> hooks
OK skill-health: <N> skill(s), <M> hook(s) inspected

2. 失敗時の対応

| エラー種別 | 修正案 |

|----------|------|

| frontmatter not parseable | YAML 構文エラー。 --- 行 + key: value を見直す |

| missing frontmatter key: name | SKILL.md 冒頭に name 追加 |

| name does not match directory | ディレクトリ名と SKILL.md の name を揃える |

| references <path> but file does not exist | 参照されるスクリプトを作るか SKILL.md から消す |

| trigger fragment used by: [...] | 複数 skill で同じ trigger 文言 → どちらかを書き換えて曖昧性除去 |

| not executable | chmod +x .claude/hooks/*.sh |

| no shebang on line 1 | #!/usr/bin/env bash を 1 行目に追加 |

3. CI 連携

このチェック自体は CI gate にする選択もあるが、 false positive (trigger 衝突警告は意図的なケースもある) のため pre-commit には入れずに skill 経由で呼ぶ。

将来、 false positive を減らせた段階で pre-commit hook 化を検討。

注意

使用例

# 全 skill / hook の health check
/skill-health

# verbose で全 skill / hook を一覧
/skill-health verbose

期待効果

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.