Skill: Codebase Archaeology
Analyze repository history to understand architecture, hotspots, ownership, and risk before major changes.
When to use
- •New contributor onboarding.
- •Pre-migration planning.
- •Before large refactors.
Workflow
- •Identify hotspots.
bash
git log --pretty=format: --name-only | sort | uniq -c | sort -rn | head -30
- •Identify ownership and bus factor.
bash
git shortlog -sn git shortlog -sn -- path/to/file
- •Trace subsystem evolution.
bash
git log --follow --oneline -- path/to/file git log --oneline --grep='refactor\|rewrite\|migration\|deprecat'
- •Map recurring bug zones.
bash
git log --oneline --grep='fix\|bug\|incident\|hotfix' --all | head -80 rg -n 'TODO|FIXME|HACK|XXX' .
Required artifacts
- •
docs/research/codebase-archaeology-report.mdwith hotspots and risk map. - •ADR candidates list for major turning points.
- •Migration risk notes referenced by ticket IDs.