Agent Skillsnubjs/nub › git-archaeology

git-archaeology

GitHub

提供Git历史考古的快捷命令配方,用于快速查询代码、文件或字符串的添加、删除、重命名及变更时间。

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

触发场景

查询代码变更历史 查找文件删除或重命名记录 追踪特定字符串或函数的引入时间

安装

npx skills add nubjs/nub --skill git-archaeology -g -y
更多选项

非标准路径

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

不安装直接使用

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",
    "metadata": {
        "internal": true
    },
    "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

Playbook for "when did X land / leave / change?" — 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>

For an exact symbol, flag string, function name, or config key. -S fires when the occurrence count changes.

2. Pickaxe by regex / diff content

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

When -S misses because the string appears in both old and new (count unchanged), or to match a pattern across added/removed lines.

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>

4. Follow renames

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

Use when git log -- <path> shows a 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>

Traces when a specific function body, flag block, or config stanza changed without reading the whole 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>

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>

8. Date and subject of a commit

git log -1 --format='%h %cs %s' <sha>      # %cs = YYYY-MM-DD

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 the two dates = the feature was advertised before (or after) it shipped. The code date is the authoritative answer to "when did it land."

Methodology

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." For "when did it ship," pickaxe crates/, crates/nub-core/src/node/flags.rs and spawn.rs (the authoritative source for "is a Node experimental flag active by default"), and the capability tables in code.

A feature on a marketing surface may have been removed later. A positive hit on site/ does not mean it ships today — run the delete check before concluding it's live:

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

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.

Distinguish three states — decide which one is being asked about before searching:

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

Add --all when the expected result isn't on main — deleted files and dropped branch-resident features may only appear in non-main history. History rewrites change SHAs but not content, so pickaxe still works after a force-push.

版本历史

  • 46280a5 当前 2026-08-03 01:43
  • 4fd083f 2026-07-19 12:03
  • 44d0dd0 2026-07-05 11:02

同 Skill 集合

.agents/skills/linux-vm-test/SKILL.md
.agents/skills/windows-vm-test/SKILL.md
.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/pm-perf-tracing/SKILL.md
.claude/skills/soak/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-bump/SKILL.md
.claude/skills/aube-sync/SKILL.md
.claude/skills/ci-adhoc-test/SKILL.md
.claude/skills/ci-watch/SKILL.md
.claude/skills/cpu-reduction/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/remote-build/SKILL.md
.claude/skills/rust-build-hygiene/SKILL.md
.claude/skills/rust-build/SKILL.md
.claude/skills/visual-review/SKILL.md
.claude/skills/worktree/SKILL.md

元信息

文件数
0
版本
46280a5
Hash
61679c71
收录时间
2026-07-05 11:02

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-03 13:03
浙ICP备14020137号-1 $访客地图$