git-forensics
Skill3 starsChanged 3 months agoMITView on GitHub
Use this skill to diagnose codebase health, identify risk areas, and perform code archaeology via git history. Trigger this when onboarding to a new project, assessing technical debt, searching for lost code or deleted files, tracing function evolution, or analyzing team dependency ("bus factor"). This provides deep insights beyond basic git commands.
In this repository86 other files it gives its agents.
- AGENTS.mdAGENTS.md
- adrSkill
- adzic-bddSkill
- agent-md-refactorSkill
- agent-muxSkill
- agent-role-impersonatorSkill
- agilquest-reservationsSkill
- ai-text-humanizerSkill
- architecture-decision-recordsSkill
- ast-grepSkill
- atacSkill
- aws-cliSkill
- bart-adversarial-reviewerSkill
- bddSkill
- branch-doctorSkill
- c4-architectureSkill
- c4Skill
- claude-sub-agentSkill
- codemap-config-setupSkill
- codemap-exploreSkill
- codemap-handoffSkill
- codemap-hub-safetySkill
- codemapSkill
- commitSkill
- copilot-sub-agentSkill
- daily-standupSkill
- daily-statusSkill
- debugSkill
- design-thinkingSkill
- doctorSkill
- docx-word-processorSkill
- farley-tddSkill
- forensicsSkill
- gemini-sub-agentSkill
- git-commit-formatterSkill
- github-actions-permissionsSkill
- github-cliSkill
- git-repo-discoverySkill
- git-safety-guardrailsSkill
- harness-idpSkill
- humanizeSkill
- iteration-plannerSkill
- jira-issue-managerSkill
- justfile-assistantSkill
- kiro-sub-agentSkill
- lessons-learnedSkill
- lessonsSkill
- lisa-planning-agentSkill
- lovejoy-release-agentSkill
- lsp-code-analysisSkill
- macro-to-microSkill
- marge-product-agentSkill
- meeting-notesSkill
- mermaid-diagram-generatorSkill
- modern-cli-overridesSkill
- native-web-searchSkill
- obsidian-notetakerSkill
- outlook-headlessSkill
- pdf-document-processorSkill
- pi-sub-agentSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Use these commands for a high-level view of project health and stability.
- Distinctive: line 27
Use these commands to dig into the history of specific code blocks or find lost context, treating the codebase as a crime scene.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Git Forensics
Analyze git history to identify health patterns (codebase drag, organizational risk) and perform deep code archaeology (finding lost code, tracing lines).
1. Codebase Health Assessment
Use these commands for a high-level view of project health and stability.
| Command | Description | Risk Indicated |
uv run scripts/forensics.py report | Run full health report | - |
uv run scripts/forensics.py churn | Top 20 most frequently changed files | High Churn ("Codebase drag") |
uv run scripts/forensics.py bus | Contributor commit distribution | Low Bus Factor (Knowledge silos) |
uv run scripts/forensics.py bugs | Files most associated with "fix/bug" | Bug Hotspots |
uv run scripts/forensics.py velocity | Commit counts by month | Declining velocity (Tech debt) |
uv run scripts/forensics.py fire | "hotfix", "revert", "rollback" commits | Deployment/testing instability |
Interpretation: Files appearing in BOTH "churn" and "bugs" are the highest risk components in the system and prime candidates for refactoring.
2. Code Archaeology
Use these commands to dig into the history of specific code blocks or find lost context, treating the codebase as a crime scene.
The Pickaxe (Find Lost Code)
Find exactly when a specific string, function name, or variable was added or deleted anywhere in the repository's history (across all branches).
uv run scripts/forensics.py pickaxe "my_deprecated_key"
uv run scripts/forensics.py pickaxe "^def legacy_.*" --regexX-Ray Blame
Standard git blame is noisy. This ignores whitespace changes (-w) and detects if the code was moved/copied from elsewhere (-M -C), pointing you to the true original author.
uv run scripts/forensics.py xblame path/to/file.pyTrace Function Evolution
See every diff that modified a specific function or class. (Opens in a pager; press q to exit).
uv run scripts/forensics.py trace "my_function" path/to/file.pyFind Stale Code
List the oldest, untouched files in the repository. High churn is bad, but code that hasn't been touched in 5 years might be dead weight or forgotten legacy systems.
uv run scripts/forensics.py staleFind Deleted Files
List recently deleted files across the repository to resurrect lost modules.
uv run scripts/forensics.py deletedCredits
Based on concepts from Adam Tornhill's Your Code as a Crime Scene and recommendations by Ally Piechowski.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

