跳到正文
cccskills
免费在 GitHub 公开

commit-archaeologist

Investigate why a file or function exists using local Git history. Trace its introduction, later edits, authorship, and files often changed alongside it, then summarize likely intent and change risks while distinguishing evidence from inference.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

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.

查看安装方法

适用场景

  • Understanding why an unfamiliar function exists
  • Reviewing historical constraints before a refactor
  • Tracing the background of a workaround
  • Finding files repeatedly changed alongside the target

包含的文件(4)

  • SKILL.md5.4 KB
  • README.md2.3 KB
  • references/reading-git-history.md3.5 KB
  • scripts/archaeologist.py12.8 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

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 threshold
  • introduced_by: oldest commit in the selected history
  • timeline: commits ordered oldest to newest, with category, changed files, and detected renames
  • co_changed: files present beside the target in enough selected commits
  • authors: current blamed lines and historical commit counts, kept separate
  • intent_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:

  1. Bottom line. One or two sentences with the most likely explanation and a confidence label: high, medium, or low.
  2. Origin. Introducing hash, date, author, subject, and the neighboring files that make the initial purpose clearer.
  3. Timeline. Oldest to newest. Group mechanical edits when they do not change the story, but preserve reverts, fixes, and workarounds.
  4. Companion files. Explain repeated co-changes as a coupling clue. Do not treat a one-off file in changed_files as a dependency.
  5. Intent evidence. Quote short commit subjects or signal words. Label any conclusion beyond those facts as an inference.
  6. 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 builder
  • references/reading-git-history.md: interpretation and confidence guide

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Coordinate large research or generation tasks across a model team. An orchestrator plans and checks the work, workers execute subtasks in parallel, and an advisor reviews the plan and draft before the results are combined.

中文简介正在准备中。当前显示英语简介。

  • Research multiple competitors in parallel
  • Split a large generation task across multiple models
  • Have an advisor review plans and drafts
Shubhamsaboo/awesome-llm-apps14.2万2026年10月19日 更新

Develop ChatGPT apps with interactive React widgets using mcp-use and OpenAI Apps SDK. Guidance covers app scope, server tools, shared state, and display settings. This skill is deprecated and points users to mcp-app-builder.

中文简介正在准备中。当前显示英语简介。

  • Define the scope of a ChatGPT app
  • Build React widgets connected to server tools
  • Share widget state with ChatGPT
Shubhamsaboo/awesome-llm-apps14.2万2026年10月19日 更新

Inspect Python and JavaScript dependency files for missing version constraints, duplicate entries, conflicting exact versions, and outdated Python compatibility packages. Get plain-language explanations and focused repair suggestions, with offline checks by default.

中文简介正在准备中。当前显示英语简介。

  • Check dependency files before investigating installation failures
  • Find outdated Python compatibility packages
  • Review duplicate entries and conflicting exact versions
Shubhamsaboo/awesome-llm-apps14.2万2026年10月19日 更新

Simulate readers encountering a draft for the first time to see whether they open it, where their attention fades, and what they remember. Receive reader comments alongside the text without rewrites or suggested fixes.

中文简介正在准备中。当前显示英语简介。

  • Check whether a post earns a full read
  • Find where readers lose interest
  • Compare reader reactions after revisions
Shubhamsaboo/awesome-llm-apps14.2万2026年10月19日 更新

Build MCP servers that let AI access actions and data using mcp-use. The guide covers project setup, reusable prompts, interactive React interfaces, authentication, error handling, and deployment, with reference files for each area.

中文简介正在准备中。当前显示英语简介。

  • Create a new MCP server with mcp-use
  • Add actions, data resources, or reusable prompts
  • Build interactive React interfaces for browsing and selection
Shubhamsaboo/awesome-llm-apps14.2万2026年10月19日 更新

A deprecated guide to building MCP servers with mcp-use, covering callable actions, data resources, reusable prompts, and interactive widgets. It includes design references and code examples, and directs users to the replacement skill, mcp-app-builder.

中文简介正在准备中。当前显示英语简介。

  • Review the structure of an existing mcp-use server
  • Consult examples of tools, resources, and prompts
  • Explore interactive widget design
Shubhamsaboo/awesome-llm-apps14.2万2026年10月19日 更新

查看 Shubhamsaboo 的全部技能

报告此技能的问题