commit-archaeologist

Reconstructs why code exists from local git history.

135k|19.9k|Updated Apr 29, 2024
One-click install
npx skills add https://github.com/Shubhamsaboo/awesome-llm-apps --skill commit-archaeologist
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: commit-archaeologist
Source: https://github.com/Shubhamsaboo/awesome-llm-apps/tree/main/agent_skills/commit-archaeologist
Command: npx skills add https://github.com/Shubhamsaboo/awesome-llm-apps --skill commit-archaeologist

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Developers often need to understand the historical context of a file or function before refactoring or rewriting it. Standard tools like git blame only show who last touched a line, leaving the original intent and constraints hidden. This Skill reconstructs the full history of a code region to reveal why it was introduced and what risks exist before editing.

Core Features & Use Cases

  • Historical Reconstruction: Identifies the introducing commit, timeline of modifications, and current authors for any tracked file or line range.
  • Intent Detection: Extracts signals from commit messages including issue references, reverts, workarounds, temporary markers, and TODOs.
  • Coupling Analysis: Detects files that repeatedly changed alongside the target, revealing hidden dependencies and constraints.
  • Use Case: Before refactoring a complex caching function, use this Skill to discover that it was introduced as a workaround for a specific performance issue, identify which test files must be updated together, and flag any unresolved temporary choices.

Quick Start

Ask your coding agent why the function in src/cache.py lines 40-72 exists and what risks exist before changing it.

Frequently Asked Questions about commit-archaeologist

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find why a specific function was added to a codebase?

Run the archaeologist script with the file path and line range to trace the introducing commit and later modifications. The script uses git line-log to follow the selected lines backward through history and extracts intent signals from commit messages.

What is the difference between git blame and commit archaeology?

Git blame shows who last modified each line and when. Commit archaeology reconstructs the full history including the introducing commit, timeline of changes, co-changed files, and intent clues from commit messages to explain why the code exists.

Does this work on remote repositories without cloning?

No, the script requires a local git repository because it uses git log, blame, and diff-tree commands. Clone the repository first, then run the script with the local path and tracked file path.

Why does line-log sometimes miss the true origin of code?

Line-log follows patches backward and can break on large rewrites, copied code blocks, or certain rename operations. When the origin looks suspiciously recent, compare with file mode history and note that earlier ancestry is uncertain.

Can I use this to rewrite or delete git history?

No, this skill is strictly read-only and makes no network calls or repository writes. It only analyzes existing history to produce reports. For history rewriting, use dedicated tools like git filter-branch or git-filter-repo.