Agent Skillsnubjs/nub › git-archaeology

git-archaeology

GitHub

提供Git历史追溯的快速命令集,用于定位代码、文件、字符串或配置的添加、移除、重命名及变更时间。涵盖Pickaxe、正则匹配、删除检测、重名追踪、行级历史及Blame等场景,帮助开发者快速回答“何时/为何”发生变动的问题。

.claude/skills/git-archaeology/SKILL.md nubjs/nub

Trigger Scenarios

查询特定字符串或符号在Git历史中首次引入或最后修改的时间 查找被删除的文件及其对应的提交记录 追踪文件重命名后的完整历史路径 分析特定代码行或函数块的变更历史与作者 排查配置项、功能标志(flag)或API的变更原因

Install

npx skills add nubjs/nub --skill git-archaeology -g -y
More Options

Non-standard path

npx skills add https://github.com/nubjs/nub/tree/main/.claude/skills/git-archaeology -g -y

Use without installing

npx skills use nubjs/nub@git-archaeology

指定 Agent (Claude Code)

npx skills add nubjs/nub --skill git-archaeology -a claude-code -g -y

安装 repo 全部 skill

npx skills add nubjs/nub --all -g -y

预览 repo 内 skill

npx skills add nubjs/nub --list

SKILL.md

Frontmatter
{
    "name": "git-archaeology",
    "description": "Fast recipes for answering when\/what\/why a feature, flag, API, file, or string was added, removed, unflagged, or renamed in git history."
}

git-archaeology

Instant playbook for "when did X land / leave / change?" questions. The goal: skip the meander, get the answer in one command.


Recipes

1. Pickaxe — when a string/symbol entered or left history

# All commits that changed the COUNT of <string> in a path:
git log --oneline -S'<string>' -- <path>

# First introduction (oldest commit):
git log --oneline --reverse -S'<string>' -- <path> | head -1

# Most recent change:
git log --oneline -S'<string>' -- <path> | head -1

# Include all branches:
git log --oneline --all -S'<string>' -- <path>

Use when: finding the commit that added or removed an exact symbol, flag string, function name, or config key. -S counts occurrences — it fires when the count changes.


2. Pickaxe by regex / diff content

git log --oneline -G'<regex>' -- <path>

Use when: -S misses a change because the string appears in both old and new (count unchanged), or when you want to match a pattern across added/removed lines (e.g. -G'--experimental-shadow-realm' to find every commit that touched that flag in any form).


3. When a file was DELETED

# Find the commit that deleted a specific path:
git log --oneline --diff-filter=D -- <path>

# Find deletion of any file matching a name glob (across all branches):
git log --oneline --diff-filter=D --all -- '**/<name>'

# Cross-check the surrounding context:
git show <sha> -- <path>

Use when: a file exists in memory or docs but is absent from the tree — find when it was dropped and what the commit message says.


4. Follow renames

git log --follow --oneline -- <path>

Use when: a file was renamed and git log -- <path> shows a short history that obviously predates the file's true age.


5. Line-range history

# History of lines matching a pattern (N lines from match):
git log -L'/<pattern>/',+<N>:<file>

# History of a fixed line range:
git log -L<start>,<end>:<file>

Use when: tracing exactly when a specific function body, feature flag block, or config stanza was introduced or changed — avoids reading the whole file log.


6. What a specific commit changed (scoped)

# Full diff scoped to a path:
git show <sha> -- <path>

# Summary of what the commit touched:
git show --stat <sha>

Use when: you have a SHA from a pickaxe result and need to see the exact diff.


7. Who/when a line came in (blame)

# Blame a line range:
git blame -L<start>,<end> <file>

# Blame + full patch context (expensive but thorough):
git log -p -L<start>,<end>:<file>

Use when: you need the author + date for specific lines, or want the full patch history for a code block.


8. Date and subject of a commit

git log -1 --format='%h %cs %s' <sha>

Use when: a pickaxe returned a SHA and you need the short date (%cs = YYYY-MM-DD) and subject without extra noise.


Combo: "when did X land in code vs site?"

# In implementation code (crates/, runtime/):
git log --oneline --reverse -S'<string>' -- crates/ | head -1

# In marketing/docs (site/, README):
git log --oneline --reverse -S'<string>' -- site/ README.md | head -1

A gap between these two dates = the feature was advertised before (or after) it shipped. The code date is the authoritative answer to "when did it land."


Methodology — lessons that cost time

Pickaxe the implementation, not the marketing surface

site/, README.md, and docs may list a feature aspirationally from the initial commit. Searching there answers "when was it promised," not "when did it ship." To answer "is X implemented / when did it land?", pickaxe:

  • crates/ — Rust implementation
  • crates/nub-core/src/node/flags.rs and spawn.rs — flag injection (the authoritative source for "is a Node experimental flag active by default")
  • the feature matrix or capability table in code, not in docs

Concrete burn: most homepage API names traced to "Initial commit" — all misleading, answered intent not state.

A feature on a marketing surface may have been removed later

A positive pickaxe hit on site/ does not mean the feature ships today. Always run the delete check and a grep for "deferred"/"removed"/"dropped" before concluding it's live:

git log --oneline --diff-filter=D -- '<feature-file>'
git log --oneline --all --grep='deferred\|removed\|dropped' -- '<area>'

Concrete burn: connect() appeared on the homepage but runtime/connect-sockets.mjs was deleted 2026-05-26 and the feature deferred.

For "what was recently unflagged?" — target the flag-injection layer

# Find all commits that touched experimental-flag injection:
git log --oneline -G'--experimental-' -- crates/nub-core/src/node/flags.rs crates/nub-core/src/node/spawn.rs

# Pickaxe a specific flag:
git log --oneline -S'--experimental-shadow-realm' -- crates/

Cross-reference .fray/*-unflag.md / audit threads for the decision record. This makes "what was recently unflagged?" instant rather than a multi-file meander.

Concrete answer this should make instant: shadow-realm + wasm-modules were unflagged together in PR #31.

Distinguish three states — they are not the same

State How to verify
On the homepage / in docs Pickaxe site/, README
Implemented (code exists) Pickaxe crates/, runtime/
Unflagged / default-on Pickaxe flags.rs, spawn.rs for the flag string

Always check which state is actually being asked about before searching.

Always consider --all for deleted or branch-resident content

Deleted files and features that were developed on a branch and later dropped may only appear in non-main history. Add --all to any pickaxe or --diff-filter=D search when the expected result isn't turning up on main.

History rewrites change SHAs but not content — pickaxe by string still works after a force-push because it searches diff content, not commit identity.

Version History

  • 44d0dd0 Current 2026-07-05 11:02

Same Skill Collection

.claude/skills/audit-thread/SKILL.md
.claude/skills/download-stats/SKILL.md
.claude/skills/md-toc/SKILL.md
.claude/skills/plan-thread/SKILL.md
.claude/skills/todo/SKILL.md
skills/nub/SKILL.md
.agents/skills/agent-browser/SKILL.md
.claude/skills/ad-hoc-test/SKILL.md
.claude/skills/address-issue/SKILL.md
.claude/skills/aube-sync/SKILL.md
.claude/skills/ci-adhoc-test/SKILL.md
.claude/skills/ci-watch/SKILL.md
.claude/skills/dev-loop/SKILL.md
.claude/skills/impact-analysis/SKILL.md
.claude/skills/implementation-thread/SKILL.md
.claude/skills/prose-writing/SKILL.md
.claude/skills/release/SKILL.md
.claude/skills/rust-build/SKILL.md
.claude/skills/visual-review/SKILL.md
.claude/skills/worktree/SKILL.md

Metadata

Files
0
Version
ab079b4
Hash
b2a05b9f
Indexed
2026-07-05 11:02

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-13 17:02
浙ICP备14020137号-1 $mapa de visitantes$