Git 提交历史溯源分析
commit-archaeologist
从本地 git 历史还原代码存在的原因,包括引入该代码的提交、后续更改、当前作者、反复出现的伴随文件以及可能的意图。当用户询问“这段代码为什么存在”、“谁写了这个函数以及为什么”,或在重写、重构或高风险编辑前要求“解释这个函数的历史”时使用。完全在本地运行。
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-14
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- commit-archaeologist
- license
- Apache-2.0
- metadata
- { "author": "Matt Van Horn", "source": "https://github.com/Shubhamsaboo/awesome-llm-apps", "version": "1.0.0" }
- description
- Reconstructs why code exists from local git history, including the introducing commit, later changes, current authors, repeated companion files, and likely intent. Use when the user asks "why does this code exist", "who wrote this function and why", or to "explain the history of this function" before a rewrite, refactor, or risky edit. Runs entirely locally.
02 资源文件 3
- 参考文档README.md2.3 KB
- 参考文档references/reading-git-history.md3.5 KB
- 脚本scripts/archaeologist.py12.9 KB
03 SKILL.md 正文
Commit Archaeologist
git blame names the last person to touch a line. This skill reconstructs the
reason the line exists. It traces a file or current line range through local git
history, identifies its origin and later edits, finds files that repeatedly
changed beside it, and extracts intent clues from commit messages.
Everything runs locally. No network calls, API keys, or repository writes.
When to use
- The user asks why a block, function, or file exists
- The user wants to know who introduced code and what changed afterward
- A rewrite or refactor needs historical constraints and change risks
- A workaround, temporary branch, or surprising design choice needs context
When not to use
- The user only wants raw blame output or a commit list
- The task is to squash, delete, or rewrite git history
- The repository is remote and has not been cloned locally
- The question is about project-wide architecture rather than one file or region
Gather the target
Get the repository path and tracked file path. Use a line range when the user names a current block or function. If either path is missing, ask only for the missing value. Do not scan sibling repositories.
Paths should be relative to the repository and use forward slashes. Line ranges
use inclusive current line numbers such as 40-72.
Run the dig
From this skill directory:
python3 scripts/archaeologist.py /path/to/repo src/cache.py --lines 40-72 --json
For the complete history of a file, omit --lines:
python3 scripts/archaeologist.py /path/to/repo src/cache.py --json
The script is read-only. With a range it uses git line-log; without one it uses file history with rename following. It also reads current authorship with blame. If it rejects a path or range, report that error and ask for a corrected target.
Before interpreting the JSON, read
references/reading-git-history.md. Its confidence rules prevent blame
ownership, correlation, and commit-message hints from becoming false certainty.
Read the JSON
region: normalized repository, current and historical paths, mode, range, and co-change thresholdintroduced_by: oldest commit in the selected historytimeline: commits ordered oldest to newest, with category, changed files, and detected renamesco_changed: files present beside the target in enough selected commitsauthors: current blamed lines and historical commit counts, kept separateintent_signals: issue references, reverts, workarounds, temporary markers, and unfinished-work markers found in commit messages
An empty signal list means the messages do not say why. It does not mean the change had no reason.
Write the report
Turn the JSON into a short "why this code exists" report:
- Bottom line. One or two sentences with the most likely explanation and a confidence label: high, medium, or low.
- Origin. Introducing hash, date, author, subject, and the neighboring files that make the initial purpose clearer.
- Timeline. Oldest to newest. Group mechanical edits when they do not change the story, but preserve reverts, fixes, and workarounds.
- Companion files. Explain repeated co-changes as a coupling clue. Do not
treat a one-off file in
changed_filesas a dependency. - Intent evidence. Quote short commit subjects or signal words. Label any conclusion beyond those facts as an inference.
- Change risk. Name the constraints, companion files, and unresolved temporary choices worth checking before an edit.
Keep hashes short in prose, but preserve enough characters to identify them. Do not dump the full JSON unless the user asks.
Evidence rules
- Current blame ownership is not proof of original authorship.
- The oldest selected commit is the region's introduction, not always the file's first commit.
- Repeated co-change suggests coupling; it does not prove a dependency.
- Commit categories are message heuristics, not verified issue types.
- "Temporary" and "workaround" are strong intent clues, but only the message author or linked discussion can confirm whether the constraint still applies.
- If the history is thin or messages are vague, say "the history shows" and "likely" instead of inventing a design rationale.
Follow-ups
End by offering one relevant follow-up, such as:
- "Want me to assess whether this looks deliberate or accidental?"
- "Want me to map what could break if this region changes?"
For a deliberate-choice question, weigh repeated edits, issue references, reverts, and explicit constraint words. For a change-risk question, inspect the repeated co-change files and the last behavior-changing commits before proposing edits. Do not modify code until the user asks.
Files
scripts/archaeologist.py: offline git history walker and JSON report builderreferences/reading-git-history.md: interpretation and confidence guide
04 同仓库更多 Skills
TypeSafe类型安全AI开发
typesafe-ai
使用 TypeSafe 构建 AI 驱动的软件:可像编程原语一样使用的微型 AI 智能单元。其 System One 模型(包括 Jev)将自然语言和应用状态转化为代码可组合的类型化判断与概率。当某个功能需要可编程的常识、在头脑风暴 AI 能在应用中实现什么,或某个 LLM 提示-解析步骤可转化为结构化决策时使用。应用场景包括路由、排序、抽取、验证和交互体验;这些只是起点,并非上限。阅读实时文档和范例集以找到有用的模式并发现新的组合。
意识流倾诉整理与需求澄清
thinking-out-loud
一份关于智能体在收到冗长、混乱、意识流式倾诉(通常为语音口述)时该如何行动的契约:在回声简报(echo brief)获得批准前不采取任何行动。该回声会审计整段传递内容、任务、已锁定的决策与约束、未决问题、立场翻转与搁置的题外话,并将模型的推断和猜测与用户自己的措辞隔离存放,以便用户核实模型所相信的内容,而不仅仅是它所怀疑的内容。当用户说“让我理清思路”或想在动手构建前先倾诉一番、当消息以语音转文字的开场白开头(如“切换到语音,抱歉有错别字”)、当输入是标点薄弱且带有重启和中途反转的长篇内容(“其实不,等等,完全抛弃那个想法”)、或当用户要求就一个模糊的半成品想法接受访谈时使用。包含用于跨多条消息倾诉的可选捕获模式,以及可选的有针对性访谈。
代码变更范围蔓延检测
scope-creep-detector
根据声明的意图分析 git diff,以检测范围蔓延、无关文件、过大的拉取请求(PR)、超出修复范围的变更、依赖添加、公共 API 重命名、配置或 CI 修改、超大 hunk(代码差异块)以及仅格式化文件。当用户询问某项变更是否超出修复范围、PR 是否过大、或触及了哪些无关内容,并希望获得保留、拆分或说明理由的指导时使用。在本地离线运行。
废弃项目挖掘与复活
project-graveyard
扫描开发者的机器以查找已废弃的副项目,从每个项目的 git 历史中对其进行“尸检”(死在支付墙前、被更新的项目取代、已完成但从未发布),揭示其个人的“死亡模式”,并挑选出最值得复活的“遗骸” —— 然后帮助将其发布。当用户提到被放弃、未完成或陈旧的副项目,询问“我该完成什么”,想要复活或重启某个项目,说“运行墓地”,疑惑为何自己总是有始无终,或正要开始一个听起来像是自己已经做过的新项目时使用。完全在本地运行。
依赖清单问题诊断
dependency-doctor
检查 requirements.txt、pyproject.toml 和 package.json 依赖清单中的表层直接依赖隐患:标准库遮蔽(shadowing)式版本锁定、废弃的 backport、未固定的依赖,以及明显的清单内冲突,外加可选的 PyPI yanked(撤回)版本检查。当用户要求检查清单中的依赖问题、询问依赖为何无法安装或依赖是否有问题、想要进行依赖"尸检",或怀疑依赖清单腐化时使用。默认以本地工具形式离线运行,用于用户自己的项目,而非仓库 CI。
多模型编排与任务拆分
advisor-orchestrator-worker
当任务规模过大、单个模型一次处理无法完成,需要跨多个子任务并行研究或生成(例如同时研究十几个竞争对手),或用户要求编排多个模型、在模型团队间拆分工作、运行顾问-工作者循环、让更强的模型审查计划而由低成本工作模型执行,或用户说“对单个模型来说太大”或“把它分散开”时使用。不适用于单文件编辑或单个模型一次即可完成的任务。