Loading...
Loading...
Use when entering an unfamiliar codebase, onboarding to a new project, or wanting to assess codebase health before reading code — analyzes git history to reveal hotspots, risk areas, team structure, and development momentum
npx skill4agent add yujiachen-y/codebase-recon-skill codebase-reconecho "COMMITS=$(git rev-list --count HEAD)" && \
echo "FIRST_COMMIT=$(git log --reverse --format='%ad' --date=short | head -1)" && \
echo "LATEST_COMMIT=$(git log --format='%ad' --date=short | head -1)" && \
echo "BRANCHES=$(git branch -a | wc -l | tr -d ' ')"| Repo Size | Commits | | |
|---|---|---|---|
| Small | <500 | (omit --since) | 10 |
| Medium | 500-10k | | 20 |
| Large | >10k | | 30 |
Repo Vitals: Age: [FIRST_COMMIT to LATEST_COMMIT] | Commits: [COMMITS] | Branches: [BRANCHES] | Analysis window: [WINDOW or "all time"]WINDOWN--sincegit log --format=format: --name-only --since="WINDOW" | sort | uniq -c | sort -nr | head -Ngit shortlog -sn --no-mergesgit log -i -E --grep="fix|bug|broken" --name-only --format='' --since="WINDOW" | sort | uniq -c | sort -nr | head -Ngit log --format='%ad' --date=format:'%Y-%m' | sort | uniq -cgit log --oneline --since="WINDOW" | grep -iE 'revert|hotfix|emergency|rollback'git log --diff-filter=A --since="WINDOW" --name-only --format='' | sort | uniq -c | sort -nr | head -Ngit shortlog -sn --no-merges --since="3 months ago" | wc -lgit shortlog -sn -- <file>═══ Codebase Recon Report ═══
Repo Vitals
Age: [first commit] to [latest commit] | Commits: N | Branches: N | Analysis window: WINDOW
1. Code Hotspots (most-changed files)
[ranked list: count filepath]
2. Bug Magnets (files with fix/bug/broken commits)
[ranked list: count filepath]
3. High-Risk Files (appear in BOTH hotspots AND bug magnets)
[list with: filepath — hotspot rank #X, bug magnet rank #Y, primary owner: NAME]
If none overlap, state: "No files appear in both lists — good sign."
4. Bus Factor
[top 10 contributors: count name]
Active (last 3 months): X of Y total contributors
[If active < 30% of total: "Warning: low active contributor ratio — knowledge concentration risk"]
5. Team Momentum
[monthly commit counts, most recent 12 months or all if fewer]
Trend: [rising / stable / declining / erratic]
6. Firefighting Frequency
[list of revert/hotfix/emergency commits, or "None found"]
Rate: N emergency commits out of M total in window (X%)
7. Recently Added Files
[ranked list: count filepath]
8. Recommendations
- Start reading: [top 3 high-risk files, or top 3 hotspots if no high-risk files]
- Talk to: [primary owner of the #1 high-risk or hotspot file]
- Watch out: [any trend warnings — declining momentum, low bus factor, high firefighting rate]"Want me to save this report to a markdown file? (e.g.,)"docs/codebase-recon-report.md