git-detective
Skill0 starsChanged 49 days agoMITView on GitHub
Investigate git history to understand why code exists, who changed it, and when. Use for git archaeology: blame, log, bisect, finding commits by message/content, tracing file renames. Trigger on 'why is this code like this?', 'who changed this?', 'when was this introduced?', 'find the commit that broke X'.
In this repository20 other files it gives its agents.
- examples/CLAUDE.mdCLAUDE.md
- Anti-Hallucination VerificationSkill
- backup-snapshotSkill
- Multi-Agent BrainstormSkill
- Browser UATSkill
- ci-cd-builderSkill
- Code Patterns ReferenceSkill
- Conventional Commits WorkflowSkill
- Context Curator AdministrationSkill
- email-composerSkill
- imap-emailSkill
- ollama-model-managerSkill
- Ollama Code VerificationSkill
- project-bootstrapperSkill
- prompt-engineerSkill
- refactor-analyzerSkill
- release-managerSkill
- scheduleSkill
- skill-creatorSkill
- Work LogSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
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 14
Who changed it: commit authors, review history
- Distinctive: line 65
Timeline: When was code added, modified, removed?
- Distinctive: line 67
Rationale: Commit messages, PR context, issue references
- Distinctive: line 69
Regression pattern: If bisect reveals breakage, what changed?
- Distinctive: line 86
Use output to contextualize findings in the narrative
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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 Detective Skill
Overview
Deep-dive into git history to understand code provenance, trace changes, and answer "why?" questions about the codebase.
Phase 1: ASSESS
Understand what the user wants to know:
- Why code exists: rationale, original author intent
- Who changed it: commit authors, review history
- When it was introduced: timeline, release context
- What broke: bisect, regression identification
- File/feature history: lineage, renames, deletions
Clarify scope: single file, function, feature, time range, or branch.
Phase 2: INVESTIGATE
Git commands toolkit:
Commit Search
git log --all --grep="keyword"— find commits by message substringgit log --all --grep="keyword" -i— case-insensitive searchgit log --all --author="name"— commits by author
Content Search (Pickaxe)
git log -S "code_string" --all— find when string added/removedgit log -S "code_string" -p --all— with diffsgit log -G "regex_pattern" --all— find commits where regex matched diff
Line Attribution
git blame -L start,end file— annotate lines with commitsgit blame -L start,end -C file— detect copy/movegit blame --show-stats file— summary of blame
File History & Renames
git log --follow -- file— history including renamesgit log --diff-filter=D -- "*/filename"— find deleted filesgit show <hash>:path/to/file— content at specific commitgit log -p -- file— full diff history of file
Binary Search (Bisect)
git bisect start— begin bisectgit bisect bad HEAD— mark current as brokengit bisect good <hash>— mark known-good commitgit bisect bad/good— iterategit bisect log— view historygit bisect reset— exit bisect
Statistics & Patterns
git shortlog -sn -- path/— contribution stats by authorgit log --oneline --graph --all— full history graphgit log --date=short --format='%h %ad %an %s' -- file— timeline
Complex Queries
git log --all --since="2024-01-01" --until="2024-12-31"— date rangegit log --all -S "code" -- path/to/file— content in specific pathgit log --all --grep="^feat:" --grep="^fix:"— conventional commits
Phase 3: ANALYZE
Connect findings and explain the story:
- Timeline: When was code added, modified, removed?
- Authorship: Who wrote original code? Who modified it? Why?
- Rationale: Commit messages, PR context, issue references
- Impact: What depended on this change? What downstream effects?
- Regression pattern: If bisect reveals breakage, what changed?
Phase 4: REPORT
Narrative report with:
- Question restated — What we're investigating
- Key findings — Timeline of relevant commits with hashes, authors, dates
- Commit details — Full messages, diffs for top 3-5 commits
- Root cause — Why the code is as it is
- Affected areas — Related files, features, deployments
- Recommendations — Next steps if needed
Format as markdown with commit hashes as [abc1234](link) if in GitHub.
Local-First: Ollama Integration
For large diffs or complex code changes:
- Extract the diff or code snippet from git
- Feed to
ollama run qwen3-coder "Analyze this diff and explain the intent: [CODE]" - Use output to contextualize findings in the narrative
- Summarize complex changes without cloud API calls
This keeps sensitive code history local while leveraging fast local analysis.
Example Workflows
"Who broke the login?"
git bisect start
git bisect bad HEAD
git bisect good <known-good-commit>
# ... iterate until found
git show <bad-commit>"When was this feature added?"
git log --all -S "feature_flag_name" -- src/
git show <hash>"Why does this class look like this?"
git blame -L1,100 src/MyClass.ts
git log --follow -- src/MyClass.ts
# Then for each major refactor:
git show <hash> | head -50"Find all references to a deleted module"
git log --all --diff-filter=D -- "src/old-module/**"
git show <deletion-commit>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.

