/codebase-intel:codebase-healthfrom codebase-intel
Use when onboarding to an unfamiliar codebase, before major refactors, during periodic health checks, or when diagnosing why code keeps breaking. Also use when assessing bus factor, churn hotspots, or development velocity on any git repository.
Ships in codebase-intel. 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.
Read when SKILL.md points to them.
Diagnose where a codebase hurts using git history — before reading a single file. Based on 5 Git Commands Before Reading Code.
--help — Print use cases and flag reference instead of running diagnostic.
--since <period> — Lookback window (default: 1 year ago). Accepts any git log --since format.
--top <N> — Number of results per category (default: 20).
When invoked with --help, display the following and stop:
codebase-health — Git archaeology for codebase diagnosis
USAGE
/codebase-health Run full diagnostic on current repo
/codebase-health --help Show this help
/codebase-health --since "6 months ago" --top 10
USE CASES
Onboarding You just joined a project. Before reading code, find
where the pain is: what files churn most, who knows
what, and where bugs cluster.
Pre-Refactor Before touching a module, check if it's a hotspot
(high churn + bugs) or stable code you'll destabilize.
Health Check Periodic audit: is velocity trending down? Are hotfixes
increasing? Is bus factor getting worse?
Incident Review After an outage, check firefighting patterns — how
often do reverts/hotfixes happen in the affected area?
Architecture Before proposing structural changes, find the real
coupling points (files that always change together).
Team Planning Identify knowledge silos before someone leaves.
Redistribute ownership of high-risk files.
WHAT YOU GET
1. Churn Hotspots — Most-modified files (high churn = high risk)
2. Bus Factor — Knowledge concentration across contributors
3. Bug Clusters — Files with most fix/bug commits
4. Velocity Trend — Monthly commit counts over time
5. Firefighting Index — Reverts, hotfixes, emergency commits
6. Cross-Reference — Files appearing in BOTH churn AND bugs (priority targets)
FLAGS
--since <period> Lookback window (default: "1 year ago")
--top <N> Results per category (default: 20)
Parse --since (default "1 year ago") and --top (default 20) from args. Run all 5 commands in parallel via Bash, then cross-reference.
git log --format=format: --name-only --since="$SINCE" | sort | uniq -c | sort -nr | head -$TOP
High-churn files signal code the team keeps revisiting — either actively developed or poorly factored.
git log --format='%aN' --since="$SINCE" | sort | uniq -c | sort -nr | head -$TOP
Note: git shortlog -sn can fail silently in non-TTY shells (e.g., Claude Code). The git log variant is more reliable.
If top 1-2 contributors own >60% of commits, flag as bus factor risk.
git log -i -E --grep="fix|bug|broken|patch|regression" --name-only --format='' --since="$SINCE" | sort | uniq -c | sort -nr | head -$TOP
Files with concentrated bug-fix commits. Extended regex includes patch and regression beyond the original article.
git log --format='%ad' --date=format:'%Y-%m' --since="$SINCE" | sort | uniq -c
Monthly commit counts. Look for: sustained drops (attrition?), spikes before deadlines, seasonal patterns.
git log --oneline --since="$SINCE" | grep -ciE 'revert|hotfix|emergency|rollback|urgent'
Also get total commits for the ratio:
git log --oneline --since="$SINCE" | wc -l
Report as: "X of Y commits (Z%) are firefighting."
After collecting churn and bug data, find files appearing in both lists. These are priority targets — code that changes constantly AND attracts bugs.
Present results as a structured report:
## Codebase Health Report — [repo name]
Period: [since] to now | Top: [N] per category
### Priority Targets (churn + bugs)
Files appearing in both hotspot lists. These hurt the most.
### Churn Hotspots
[top N with counts]
### Bug Clusters
[top N with counts]
### Bus Factor
[contributor breakdown with ownership %]
Risk: LOW/MEDIUM/HIGH (based on top-2 concentration)
### Velocity Trend
[monthly counts, note any significant changes]
### Firefighting Index
X of Y commits (Z%) — LOW (<2%) / MODERATE (2-5%) / HIGH (>5%)
| Signal | What It Means | Action |
|---|---|---|
| File in churn AND bugs | Highest-risk code | Refactor or add tests first |
| Top 2 own >60% commits | Bus factor risk | Pair program, spread ownership |
| Firefighting >5% | Deploy confidence low | Improve CI/CD, add integration tests |
| Velocity dropping 3+ months | Team health issue | Not a code problem — escalate |
| Config files in churn top 5 | Environment instability | Standardize configs |
| Test files in bug clusters | Test suite is the problem | Fix test infrastructure |
*.lock, *.generated.*, database.ts etc. from churn if they dominate.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub stylusnexus/agent-plugins --plugin codebase-intel5 skills in this plugin
/codebase-architecture-scannerScans codebase to generate comprehensive high-level and detailed architectural documentation/grill-with-docsGrilling session that challenges your plan against the existing domain model, sharpens terminology, and updates documentation (CONTEXT.md, ADRs) inline as decisions crystallise. Use when user wants to stress-test a plan against their project's language and documented decisions./read-the-damn-docsUse when implementing, integrating, upgrading, debugging, or answering anything involving third-party APIs, libraries, frameworks, CLIs, cloud services, model/provider SDKs, fast-moving product behavior, user requests for latest/current/official behavior, unfamiliar repo docs/specs, errors that may indicate API drift, or high-stakes auth, security, billing, data, migration, deployment, compliance, or privacy behavior. Forces Codex to web-search for current official docs and read primary docs before assuming from memory.Other plugins' skills for the same job