stale-skill-audit
Audit an existing SKILL.md for stale content and produce a safe-subset cleanup PR — drop dead Provenance footers, swap drifted canonical names (bd→br), normalize header dates, never rewrite content. Use when the user says 'cleanup this skill', 'this skill is bloated', names a specific skill that drifted, or a scheduled `agent-agent-mistakes` review flagged a file. Triggers: 'cleanup this skill', 'prune this skill', 'this skill is bloated', 'audit stale skill content', 'normalize dates in SKILL.md', 'swap bd to br', 'safe subset cleanup'.
- License 许可
- MIT
- 最近更新
- 2026-11-11
- Stars
- ★ 6
- Forks
- 0
01 前言 Front Matter
- name
- stale-skill-audit
- author
- Hermes Agent
- license
- MIT
- version
- 1.0.0
- metadata
- { "hermes": { "tags": [ "skills", "audit", "cleanup", "maintenance", "staleness", "sediment" ], "related_skills": [ "hermes-agent-skill-authoring", "skillify", "simplify-code", "session-learn-distill", "harness-postmortem" ] } }
- platforms
- [ "linux", "macos", "windows" ]
- description
- Audit an existing SKILL.md for stale content and produce a safe-subset cleanup PR — drop dead Provenance footers, swap drifted canonical names (bd→br), normalize header dates, never rewrite content. Use when the user says 'cleanup this skill', 'this skill is bloated', names a specific skill that drifted, or a scheduled `agent-agent-mistakes` review flagged a file. Triggers: 'cleanup this skill', 'prune this skill', 'this skill is bloated', 'audit stale skill content', 'normalize dates in SKILL.md', 'swap bd to br', 'safe subset cleanup'.
02 资源文件 1
- 参考文档references/staleness-audit.md11.0 KB
03 SKILL.md 正文
Stale-Skill Audit — Safe-Subset Cleanup for an Existing SKILL.md
Skills accumulate sediment: dead Provenance footers, drifted CLI names, header dates that pin to a specific moment in time, WIP-forward language, and content-meaning edits that no longer pull their weight. This skill is the recipe for a single PR that removes the sediment without rewriting the skill.
Default philosophy: safe subset only. No paragraph removal, no rule reordering, no content-meaning edits. Drop dead audit data, swap drifted names, normalize header dates. Stop there unless the user explicitly escalates.
When to Use
- User says "cleanup this skill" / "prune this skill" / "this skill is bloated" / "audit stale skill content".
- User names a specific SKILL.md that drifted from current org conventions.
- A scheduled
agent-agent-mistakesormeta-autonomy-violation-handlerreview flagged a file. - The org changed canonical CLIs, paths, or defaults and a skill still references the old ones (e.g.
bd→br). - The skill's description is approaching 1024 chars (validator forces a rewrite — may as well clean the body too).
Do NOT use this for:
- Proactive "this looks old" cleanup without a signal. Unsolicited cleanup PRs don't merge.
- Creating a new skill (use
skillify). - Simplifying code (use
simplify-code— that one is for code, not docs). - Promoting local user-scope additions to the repo (separate "promote to repo" PR, not a cleanup PR).
Quick Start
- Find the canonical file. Check both
~/.claude/skills/<name>/SKILL.md(user-scope local) and the repo's.claude/skills/<name>/SKILL.md(remote canonical). They often drift. - Run the indicator greps (see
references/staleness-audit.md). Each hit is a candidate edit. - Classify each hit:
- Header/frame (description, lead-in, table title): normalize or drop.
- Incident-anchored (mid-rule, with a specific defect class or example): keep verbatim — it's load-bearing evidence.
- Provenance/audit footer: drop the whole section.
- Apply minimal patches with
patch(orskill_manageaction='patch' for in-repo skills).replace_all=trueonly when every occurrence is unambiguously the same edit (e.g.bd→br). - Edit local first (
~/.claude/skills/<name>/SKILL.md) — user's local sessions read it. - Propagate to remote via
github-pr-workflow(branch fromorigin/main, commit, push,gh pr create). Do NOT include user-scope local additions — those are content additions, not cleanups. - Verify:
gh pr view N --json headRefOid --jq .headRefOidmatches local SHA; indicator greps on the remote head return 0 hits forbd,Provenanceheader, and unnormalized2026-07-06header dates.
The full recipe (exact grep commands, classification rules, foreign-checkout pitfall, and the safe-subset edge cases) is in references/staleness-audit.md.
The Safe-Subset Contract
| Edit | In safe subset? | Why |
|---|---|---|
Drop ## Provenance footer (dead runIds, bead IDs, SHA, PR URL) |
✓ | LLM has no way to resolve dead audit data |
bd → br when org migrated |
✓ | Drift fix; org-canonical CLI |
Header date 2026-07-06 → 2026-07 (description, lead-in, table cells) |
✓ | Header dates are pinpoints, not evidence |
| Incident-anchored date inside a rule body | ✗ keep verbatim | The date is evidence the rule is battle-tested |
| Typo that changes meaning ("province" → "provenance") | ✓ | Mechanical fix |
| WIP-forward language ("in progress as of ...", "TODO: ", "TBD") | ✓ | Ages badly; replace with current-state wording or drop |
| Removing a paragraph | ✗ escalate | Content-meaning edit — ask user first |
| Reordering rules | ✗ escalate | Content-meaning edit |
| Promoting a user-scope local addition to the repo | ✗ separate PR | That's a content-addition PR, not a cleanup PR |
Pitfalls
- "Medium cleanup" is not the default. When the user says "let's cleanup", assume safe subset unless they explicitly escalate. Offer 2-3 scope options at most — don't make them pick from 4. If they pull back mid-conversation, narrow immediately, don't re-confirm.
- Header dates ≠ incident dates. Stripping
2026-07-07from a rule that says "Hit twice on 2026-07-07:pr-retro-gapfill(15/15 verify agents died, ...)" removes the evidence the rule is battle-tested. That date is load-bearing. Header/frame dates are safe to normalize. bd→bris not always safe. Confirm against~/.claude/CLAUDE.mdandprojects/AGENTS.mdbefore sweeping. Some projects genuinely still usebd.- Don't edit a foreign repo's live checkout in place. It may be on someone else's branch with dirty work. Clone into
~/.hermes/state/worktrees/<repo>and work from there; no approval phrase is required to change directories. - Don't conflate local and remote. The user-scope file at
~/.claude/skills/<name>/SKILL.mdmay have more recent additions than the remote (Domain-general paragraphs, new rules added locally). Treat the remote as canonical for the cleanup PR; flag the local additions in the PR description under "Out of scope" so the user can promote them separately. git rev-parse origin/<branch>lies after a fresh push. The local ref-cache doesn't update immediately. Verify withgh pr view N --json headRefOidinstead, orgit fetch origin <branch>first.- Don't auto-run a sweep of every skill. The user knows what's stale to them. A single targeted cleanup PR is welcome; a "I cleaned 14 skills at once" PR is not.
Verification Checklist
- [ ] Local user-scope file (
~/.claude/skills/<name>/SKILL.md) edited first - [ ] Each
references/staleness-audit.mdindicator grep run against both local and remote files - [ ] Each hit classified as header-frame / incident-anchored / provenance-audit / typo
- [ ] No content-meaning edits in the PR (paragraph removal, rule reordering, content additions)
- [ ] Local additions flagged in PR description under "Out of scope" if they exist
- [ ] Branch created from
origin/main(perpr-branch-from-main.mdc) - [ ] PR created via
gh pr createwith full description (What changed, why, out of scope, stats) - [ ]
gh pr view N --json headRefOidmatches local HEAD SHA - [ ] Indicator greps on the remote head return 0 hits for
bd,Provenanceheader, and unnormalized2026-07-06header dates - [ ] CodeRabbit / CI pre-checks all pass
Related
hermes-agent-skill-authoring— peer skill on authoring conventions; this skill is its maintenance counterpart.skillify— the 11-item completeness contract for creating new skills. Use when adding a new skill; use this one when pruning an old one.simplify-code— parallel 3-agent cleanup of recent code changes. Code, not skills.session-learn-distill— post-session /learn extraction. Run after a cleanup PR merges to capture what was learned.harness-postmortem— slash/metafor agent behavior failures. Different scope (the harness, not the skills).
Support files
references/staleness-audit.md— the full 5-phase recipe with exact grep commands, the 8 indicator patterns, the safe-subset classification table, the worked 2026-07-06 example, and edge cases (multi-skill PRs, skill-vs-repo-only, SOUL.md cross-references). Load this before any cleanup that touches more than one indicator hit.
04 同仓库更多 Skills
instinct
Use when the user invokes /instinct or /in, or asks to "message Instinct", "ask Instinct", "tell Instinct", "check Instinct", or read replies from the configured peer assistant. iMessage first, WhatsApp Web as fallback.
hr
Compatibility alias for history-resume; produce the same fresh-state, provenance-aware resume briefing.
history-resume
Resume briefing for the current repository branch or worktree using fresh state and admitted history sources.
grok
Alias for the canonical grokbot browser conversation workflow; /grok talks to the Grok bot the same way /dot talks to Dot.
codexa-bench
Compare `codexa` and normal `codex` on a fair split of comparable work by default; use `--strict` for duplicate runs of the exact same task.
frontend-design
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.