From rune
Full codebase health assessment. Analyzes complexity, dependencies, dead code, tech debt, and git hotspots. Produces a health score and rescue plan.
How this skill is triggered — by the user, by Claude, or both
Slash command
/rune:autopsyThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Full codebase health assessment for legacy projects. Autopsy analyzes complexity, dependency coupling, dead code, tech debt, and git hotspots to produce a health score per module and a prioritized rescue plan. Uses opus for deep analysis quality.
Full codebase health assessment for legacy projects. Autopsy analyzes complexity, dependency coupling, dead code, tech debt, and git hotspots to produce a health score per module and a prioritized rescue plan. Uses opus for deep analysis quality.
rescue (L1): Phase 0 RECON — assess damage before refactoringonboard (L2): when project appears messy during onboardingaudit (L2): Phase 3 code quality and complexity assessmentincident (L2): root cause analysis after containmentscout (L2): deep structural scan — files, LOC, entry points, importsresearch (L3): identify if tech stack is outdatedtrend-scout (L3): compare against current best practicesjournal (L3): record health assessment findingsCall rune:scout with a request for a full project map. Ask scout to return:
For each major module identified by scout, use Read to open the file and assess:
Record findings per module in a working table.
Score each module 0-100 across six dimensions:
| Dimension | Weight | Scoring criteria |
|---|---|---|
| Complexity | 20% | Cyclomatic < 5 = 100, 5-10 = 70, 10-20 = 40, > 20 = 0 |
| Test coverage | 25% | > 80% = 100, 50-80% = 60, 20-50% = 30, < 20% = 0 |
| Documentation | 15% | README + inline comments = 100, partial = 50, none = 0 |
| Dependencies | 20% | Low coupling = 100, medium = 60, high/circular = 0 |
| Code smells | 10% | No god files, no deep nesting = 100, each violation -20 |
| Maintenance | 10% | Regular commits = 100, stale > 6 months = 50, untouched > 1yr = 0 |
Compute weighted score per module. Assign risk tier:
Use Bash to gather git archaeology data:
# Most changed files (hotspots)
git log --format=format: --name-only | sort | uniq -c | sort -rg | head -20
# Files not touched in over a year
git log --before="1 year ago" --format="%H" | head -1 | xargs -I{} git diff --name-only {}..HEAD
# Authors per file (high author count = high churn risk)
git log --format="%an" -- <file> | sort -u | wc -l
Identify:
Use Write to save RESCUE-REPORT.md at the project root with this structure:
# Rescue Report: [Project Name]
Generated: [date]
## Overall Health: [score]/100
## Module Health
| Module | Score | Complexity | Coverage | Coupling | Risk | Priority |
|--------|-------|-----------|----------|----------|------|----------|
| [name] | [n] | [low/med/high] | [%] | [low/med/high] | [tier] | [1-N] |
## Dependency Graph
[Mermaid diagram of module coupling]
## Surgery Queue (Priority Order)
1. [module] — Score: [n] — [primary reason] — Suggested pattern: [pattern]
2. ...
## Git Archaeology
- Hotspot files: [list with change frequency]
- Stale files: [list with age]
- Dead code candidates: [list]
## Immediate Actions (Before Surgery)
- [action 1]
- [action 2]
Call rune:journal to record that autopsy ran, the overall health score, and the surgery queue.
Output a summary of the findings:
rune:safeguard on the top-priority moduleCODE QUALITY — cyclomatic complexity, nesting depth, function length
DEPENDENCIES — coupling, circular deps, outdated packages
TEST COVERAGE — line coverage, branch coverage, test quality
DOCUMENTATION — inline comments, README, API docs
MAINTENANCE — git hotspots, commit frequency, author count
DEAD CODE — unused exports, unreachable branches
## Autopsy Report: [Project Name]
### Overall Health: [score]/100 — [tier: healthy | watch | at-risk | critical]
### Module Summary
| Module | Score | Risk | Priority |
|--------|-------|------|----------|
| [name] | [n] | [tier] | [1-N] |
### Top Issues
1. [module] — [primary finding] — Recommended pattern: [pattern]
### Next Step
Run rune:safeguard on [top-priority module] before any refactoring.
Known failure modes for this skill. Check these before declaring done.
| Failure Mode | Severity | Mitigation |
|---|---|---|
| Health scores estimated without reading actual code metrics | CRITICAL | Constraint 1: scan actual code — open files, count LOC, assess nesting depth |
| Recommending refactoring everything without prioritization | HIGH | Constraint 4: rank by severity — worst health score modules first, max top-5 |
| Missing git archaeology (no hotspot/stale file analysis) | MEDIUM | Step 4 bash commands are mandatory — git log data is part of the health picture |
| Skipping RESCUE-REPORT.md write (only verbal summary) | HIGH | Step 5 write is mandatory — persistence is the point of autopsy |
| Health score not backed by all 6 dimensions scored | MEDIUM | All 6 dimensions (complexity, test coverage, docs, deps, smells, maintenance) required |
| Artifact | Format | Location |
|---|---|---|
| Health score per module | Scored table (0-100) | inline |
| RESCUE-REPORT.md | Markdown + Mermaid | project root |
| Surgery queue (priority order) | Ordered list | RESCUE-REPORT.md |
| Git archaeology findings | Bash output + summary | inline |
| Journal entry | Text | via journal L3 |
~5000-10000 tokens input, ~2000-4000 tokens output. Opus for deep analysis. Most expensive L2 skill but runs once per rescue.
Scope guardrail: autopsy assesses — it does not refactor. All surgery is delegated to surgeon after the report is complete.
When invoked as /rune autopsy --executive, generate a board-ready HTML health assessment. Requires Business tier.
.rune/org/org.md for team structure and governance levelreport-templates/autopsy-executive.html from Business pack and populate all {{placeholder}} fields:
score / 100 * 440)EXECUTIVE-HEALTH.html at project rootEXECUTIVE-HEALTH.html — Board-ready HTML report
RESCUE-REPORT.md — Detailed technical report (standard autopsy)
.rune/retros/{date}.json — Health metrics for trend tracking
| Score Range | Color | Tier |
|---|---|---|
| 80-100 | var(--success) #10b981 | Healthy |
| 60-79 | var(--warning) #f59e0b | Watch |
| 40-59 | #f97316 (orange) | At-risk |
| 0-39 | var(--danger) #ef4444 | Critical |
.rune/org/org.md missing: skip team mapping, show modules without domain ownershipnpx claudepluginhub tquoc229/runeGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Enforces test-driven development: write failing test first, then minimal code to pass. Use when implementing features or bugfixes.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.
2plugins reuse this skill
First indexed Jul 13, 2026