Manually-triggered comprehensive codebase health audit covering security, architecture, documentation drift, dead code, and test coverage gaps. Produces a ranked markdown report, files prioritized GitHub issues, and proposes (but never autonomously opens) auto-fix PRs for trivial safe changes. Use when the user wants to audit, scan, review the health of, do a security check on, find dead code in, check doc drift in, or get a backlog of improvement issues for a repository — e.g. "/health-audit", "audit this repo", "do a full health check", "scan for issues to file", "check what's rotting in here". Scoped to a whole repository: not for ad-hoc bug hunts on a single file (use feature-dev:code-reviewer), and not for scoring an individual skill's quality (use skill-benchmark).
Ships in dev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Run a five-dimension health audit on the current repository, rank findings by risk × effort, file GitHub issues for actionable items, and propose safe auto-fixes for the user to approve. This skill is read-mostly: it never opens PRs autonomously and never edits source code without explicit approval. Issues are filed via gh-issue; the report lands as a markdown file in audits/.
Before any scanning:
git status --porcelain. If dirty, ask the user how to proceed (stash / commit / abort) — do not silently mix audit findings with in-progress work.package.json, pyproject.toml, Cargo.toml, go.mod, Makefile to identify: package manager, test runner, lint command, typecheck command, and dependency-audit command (pnpm audit, npm audit, pip-audit, cargo audit, govulncheck, etc.).Dispatch the four read-only audit dimensions in parallel using the Agent tool with subagent_type: "general-purpose". Each agent returns a structured finding list. Use a single message with multiple Agent tool calls so they run concurrently.
Common return-format every agent must follow. Restate this verbatim inside each agent's prompt — do not assume the agent will infer the shape:
Return ONLY a JSON array of findings. Each finding:
{
"severity": "high" | "medium" | "low",
"file": "<repo-relative path>",
"line": <number or null>,
"summary": "<one sentence>",
"suggested_fix": "<one or two sentences>"
}
Cap your output at 25 findings, ranked highest-severity first.
If you have more, append a final element:
{"severity": "info", "file": null, "line": null, "summary": "N additional <severity> findings truncated", "suggested_fix": null}
If a tool you need is not installed, return one finding with severity "info" and summary "DEGRADED: <tool> not available, used <fallback>" — do not abort.
The 25-finding cap and truncation marker prevent main context from blowing up on large repos.
Brief: scan for secrets in tracked files (API keys, tokens, private keys), unsafe deserialization (pickle.loads, eval, Function(), YAML load without SafeLoader), missing auth checks on routes/handlers, SQL injection risks (string-concatenated queries, unparameterized inputs), and outdated dependencies with known CVEs.
Tools: git ls-files, rg for patterns, the project's dep-audit command from Phase 0.
Restate the common return-format block above in the agent prompt.
Brief: run graphify on the repo to build a dependency graph, then identify circular dependencies, god modules (high fan-in + fan-out), and critical paths with low test coverage.
If graphify is unavailable, fall back by language:
| Language | Fallback |
|---|---|
| JavaScript / TypeScript | madge --circular |
| Python | pydeps or pyan |
| Go | go mod graph + go list -deps |
| Rust | cargo modules |
| Other | rg-based import-graph heuristic |
Pick the fallback that matches the languages identified in Phase 0 — do not run madge on a Python project. Note the degraded mode via the "DEGRADED" info finding in the return format.
Restate the common return-format block above in the agent prompt.
Brief: diff CLAUDE.md and README against the current code. Flag:
process.env.*, os.environ[...], .env.example not mentioned in README/CLAUDE.md)package.json scripts / Makefile targets)Restate the common return-format block above in the agent prompt.
Brief: find unreferenced exports (ts-prune, vulture, or grep-based fallback), orphaned files (no inbound imports), unused dependencies (depcheck, pip-extra-reqs), and critical business-logic paths with no test coverage. "Critical" = code in payment, auth, data persistence, or anything in a path the user has flagged as load-bearing.
Tool selection should match the language detected in Phase 0 — do not invoke ts-prune on a Python project.
Restate the common return-format block above in the agent prompt.
After all four agents return:
Aggregate findings from all four agents. Score each finding on:
Ensure the report directory exists before writing:
mkdir -p audits
Write audits/<YYYY-MM-DD>-health-audit.md with:
# Health Audit — <date>
## Summary
<short prose: how many findings per dimension, top 3 risks>
## Findings (ranked)
| # | Dim | Severity | File | Summary | Risk | Effort | Score |
|---|-----|----------|------|---------|------|--------|-------|
| 1 | sec | high | src/auth.ts:42 | unparameterized query | 5 | 2 | 2.5 |
...
## Detailed findings
### [SEC-1] Unparameterized query in src/auth.ts:42
**Severity:** high
**Reproduction:** ...
**Suggested fix:** ...
(repeat per finding)
## Architectural facts discovered
<bullet list of new facts that should be added to CLAUDE.md, e.g. "uses
GeoLite2 for IP-to-country lookups", "auth middleware lives in lib/auth/">
The report is the single source of truth for the rest of the workflow.
The markdown report is usually enough. But when the audit returns many findings across multiple dimensions — roughly more than 8 findings, or 3+ dimensions with high/medium hits — a flat markdown table forces the user to scroll and re-sort in their head to see where the risk clusters, and that reconstruction is the review cost (output is cheap; human curation is the bottleneck). In that case, offer to also render a single self-contained audits/<YYYY-MM-DD>-health-audit.html (no build, no framework, inline CSS, a little vanilla JS) that makes the ranked findings scannable: the findings table with severity color-coding, sortable columns (Score, Severity, Dimension), and dimension filter chips so the user can isolate one dimension at a time. Open it with open (macOS) / xdg-open.
This is a review interface, not a deliverable — keep it to one static file, mirror the markdown report's data exactly (do not introduce findings the report lacks), and skip it entirely for small audits (a handful of findings reads fine as text — decision-ladder: don't build an interface the decision doesn't need). The markdown report remains the single source of truth; the HTML is a generated view of it.
Show the user the ranked table and ask: which findings should become GitHub issues? Default suggestion: everything with Severity ≥ medium. The user may:
Dedupe before filing. Run gh issue list --state open --label audit:* --limit 200 --json number,title and compare titles against the findings selected for filing. For any near-match (same dimension + same file:line + similar summary), do not refile — instead, link the existing issue number in the report and tell the user it was skipped as duplicate.
For each chosen finding, invoke the gh-issue skill with:
severity:high, severity:medium, severity:low) — create the labels if they do not existaudit:security, audit:architecture, audit:doc-drift, audit:dead-code)Never file all issues silently. Always show the list and pause.
Identify findings that qualify as trivial safe fixes:
.env.examplePresent this list to the user. Do not open any PRs unless the user explicitly says so — this respects the global Git/PR Workflow Rules in ~/.claude/CLAUDE.md.
If approved, for each cluster of safe fixes:
superpowers:using-git-worktrees skill to create an isolated worktreegh-pr skill to open the PR with audit:auto-fix labelCluster fixes by file or theme to avoid 20 single-line PRs.
If Phase 1's doc-drift dimension surfaced new architectural facts (newly-introduced modules, env vars, or conventions absent from the current CLAUDE.md), present them and ask whether to append. If approved, edit CLAUDE.md directly — this is not a PR-worthy change unless the project's CLAUDE.md says otherwise.
audits/ report unless the user asks — leave it untracked or staged depending on user preference.graphify exists. Detect, fall back, and note degraded mode.If any scan agent fails:
Do not block the entire audit on one failed dimension. Partial reports are still useful.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
/dev:health-auditfrom dev
npx claudepluginhub chienchuanw/chuan-skills --plugin dev7 skills in this plugin
/apply-coding-rulesStamp a managed coding-discipline rules block into a project's CLAUDE.md (or AGENTS.md / GEMINI.md) — the four rules: think before coding, simplicity first, surgical changes, goal-driven execution, plus a guard on irreversible/git-history actions. This skill is the single source of truth for those rules; running it writes or updates the rules between managed markers, idempotently, leaving the rest of the file untouched. Use when the user wants to add, update, sync, or propagate the shared coding rules / coding standards into a repository — "apply the coding rules", "add the four rules to this project's CLAUDE.md", "sync our coding standards here", "stamp the coding discipline block" — even if they don't name the skill./auto-integrateUse when you want an agent to autonomously take a finished feature branch through review, self-fix, and merge into an integration branch (`dev`) without a human reading the PR — the agent runs an objective code review, fixes or refactors what it can, gates on a hard green light (tests pass AND no blocking findings), then does a clean rebase-merge and logs a one-line revert entry. Fires on "auto-integrate this branch", "review-fix-and-merge to dev", "run the autonomous merge loop", "自主整合這個分支", "跑自動 merge 迴圈". Manual-only (`disable-model-invocation`) because it merges code. It NEVER touches `main`/production (release stays manual). Not a PR-review reporter (that is `/code-review`) and not the full issue→PR delivery flow (that is `feature`)./featureEnd-to-end feature delivery workflow that orchestrates issue creation, branch setup, strict TDD implementation, PR opening, review-feedback handling, and session archival. Use when the user wants to ship a feature from start to finish with one command — e.g. "/feature 42", "/feature add RSS feed", "build this end-to-end", "deliver issue 17", "take this from issue to merged PR". Bundles the plan → TDD → PR → review-fix → archive arc that would otherwise require invoking 5+ separate skills.
/handoff-promptCompanion to the `handoff` skill: after `/handoff` has written a handoff document, run this in the SAME (ending) session to emit a copy-paste English prompt the user pastes into a FRESH session so a new agent resumes the work seamlessly. Use when a session is wrapping up and the next session needs a clean bootstrap — ESPECIALLY right after a spec or plan is finalized/locked, when the context window is filling up or approaching its limit, or just before a `/clear` to continue the work elsewhere. Triggers: "give me the handoff prompt", "what do I paste into the new session", "產生接手 prompt", "handoff-prompt", "下一輪要貼什麼", "context 快滿了", "spec 定稿了幫我接棒", "要 /clear 了". Manual-only (`disable-model-invocation`). It does NOT write the handoff doc (that is `/handoff`) and does NOT launch a background agent (that is `claude-handoff`)./model-advisorUse when you're about to start a task and want to pick the right Claude model and effort/thinking level for it, instead of defaulting one model + one effort to everything. Fires on "which model should I use", "what model and effort for this", "model advice", "model-advisor", "用哪個模型", "這個任務該用什麼模型/effort". Manual-only (`disable-model-invocation`). This is the CANONICAL model/effort rubric for the repo — `handoff-prompt` reuses the same table for its suggested-model line. Not a handoff tool (that is `handoff-prompt`); this just recommends a model + effort for the task in front of you./ui-visual-gateUse when starting or integrating work on a UI/visual project — anything that renders a screen, component, page, or layout a human looks at. Enforces a visual-first gate: for a UI project you confirm the look (a signed-off Figma frame or a throwaway preview page) BEFORE writing implementation code, and any UI change must carry a visual comparison (screenshot / preview URL / Figma frame) before it can merge. Fires when a project is flagged `ui_project: true` or the diff touches front-end files (.tsx/.jsx/.vue/.svelte/.css), and on "is the design signed off", "visual gate", "UI 專案要先確認畫面", "這個要附截圖對照嗎". Figma is the source of truth — this skill reuses the existing figma skills for design↔code sync rather than reimplementing them. The `auto-integrate` skill calls this as an extra green-light condition for UI projects.