commit-archaeologist
Skill này làm gì
Skill này xem lịch sử git cục bộ của dự án để giải thích lý do đằng sau một đoạn code. Skill dành cho những ai cần hiểu bối cảnh trước khi thay đổi code mà họ không tự viết.
Khi nào nên dùng
- ✓Khi bạn hỏi vì sao một hàm hoặc một đoạn code tồn tại.
- ✓Khi bạn muốn biết ai đã viết một đoạn code và điều gì thay đổi sau đó.
- ✓Khi bạn lên kế hoạch viết lại và cần lịch sử của code trước.
Liên kết skill
https://github.com/Shubhamsaboo/awesome-llm-apps/blob/main/agent_skills/commit-archaeologist/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Vì sao hàm này tồn tại? Hãy đào sâu lịch sử git và giải thích trước khi tôi thay đổi nó.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill theo dõi file hoặc các dòng qua các commit cục bộ, tìm commit đã đưa chúng vào và các chỉnh sửa sau đó, rồi đọc thông điệp commit để tìm manh mối về ý định. Mọi thứ đều chạy trên máy tính của bạn.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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 delibe
Câu hỏi thường gặp
Nó có gửi code của tôi đi đâu không?
Không. Nó chạy hoàn toàn cục bộ, không có lệnh gọi mạng, và không ghi vào kho mã.
Nó cần gì từ tôi?
Vị trí kho mã, đường dẫn file, và tùy chọn một khoảng dòng cho đoạn code đang xét.
Nó có viết lại hoặc xóa lịch sử git không?
Không. Viết lại hoặc xóa lịch sử nằm ngoài phạm vi của skill này.
Chi tiết
Mô tả gốc của tác giả
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.
Độ phổ biến
- Sao GitHub
- 144k
- Vị trí xếp hạng
- #674
- Giấy phép
- Apache-2.0
- Cập nhật
- 22/10/2026
Bình luận
- …
Thêm skill từ kho mã này
advisor-orchestrator-worker
144kGiúp agent của bạn chia một tác vụ rất lớn cho nhóm model AI, model mạnh lập kế hoạch và kiểm tra, còn model rẻ hơn làm phần việc.
dependency-doctor
144kGiúp agent của bạn kiểm tra file requirements.txt, pyproject.toml hoặc package.json để tìm lỗi phụ thuộc thường gặp và gợi ý sửa nhỏ.
first-reader
144kGiúp agent của bạn kiểm thử bản nháp bằng cách mô phỏng cách độc giả thật trải nghiệm nó, chỉ ra chỗ họ có thể mất hứng thú và điều họ ghi nhớ.
project-graveyard
144kGiúp agent của bạn quét máy tính để tìm các dự án phụ chưa hoàn thiện, giải thích vì sao từng dự án dừng lại và chọn dự án đáng hoàn thiện nhất.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.