Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add DuanZGit/D-Hub --skill code-archaeologygit clone --depth 1 https://github.com/DuanZGit/D-HubWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/duanzgit/d-hub/code-archaeology)<a href="https://agentmods.dev/skills/duanzgit/d-hub/code-archaeology"><img src="https://agentmods.dev/badge/skills/duanzgit/d-hub/code-archaeology/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/duanzgit/d-hub/code-archaeology"><img src="https://agentmods.dev/badge/skills/duanzgit/d-hub/code-archaeology.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00142 | $0.00965 |
| Opus 5.5 | $0.00057 | $0.00386 |
| Sonnet 5.5 | $0.00028 | $0.00193 |
| Haiku 4.5 | $0.00014 | $0.00097 |
Grade A, and why
code-archaeology scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
code-archaeology
三件事,按需取用,不必全做。核心纪律:考古结论要有 commit 佐证,不许凭代码形状猜意图。
1. Git 历史考古——分清三类代码
改动前先跑(路径换成目标文件):
git log --follow --oneline -- <file> | head -30 # 文件级历史
git log -L <start>,<end>:<file> --oneline # 函数级历史
git blame -L <start>,<end> -- <file> # 行级归属
对可疑代码段,找它诞生的 commit 读当时的 commit message 和关联 issue/PR:
- 有意设计:有明确 commit message 说明取舍、关联 issue/PR、或后继 commit 反复围绕它演进 → 保留,改动前先理解约束("为什么"比"是什么"重要)。
- 历史遗留:早期写的、后来没人动、无 message 说明、与现状脱节 → 标记候选清理项,报告给用户,不擅自删。
- 失效问题:当初为修 bug/绕限制打的补丁,前提条件后来已消失 → 提出移除方案,注明依赖它的隐藏耦合,让用户拍板。
完成判据:每个"能不能动"的判断都有一句 commit 佐证(hash + 当时为什么写它)。
2. 新工程师视角——评认知成本
假设接手的是一个很强的新工程师,第一周要上手这段代码:
- 通读主流程,标出让他皱眉的点:命名与行为不符、抽象过度(跳三层才到逻辑)、 职责不清(一个函数干三件事)、重复模式没收敛、魔法数字/隐式约定。
- 每个痛点给出具体简化方案(改成什么、删什么),按「认知成本 ÷ 改动风险」排序, 高成本低风险的排前面。
- 只提方案不动手,除非用户明确要求重构。
3. 近期 PR 复盘——找最慢环节
用户要"分析最近的 PR / 为什么迭代慢"时:
git log --since="30 days ago" --merges --oneline | head -20 # 时间窗自己调
gh pr list --state merged --limit 30 --json number,title,createdAt,mergedAt
- 用 createdAt→mergedAt 算各 PR 停留时长,排出最慢的 3-5 个。
- 逐个看卡在哪:review 等待轮次、CI 失败重跑、改动面太大拆不动、返工重做。
- 输出:最慢环节排序 + 每项一个可执行改进(如"改小 PR 粒度""CI 分层快慢道"), 不写泛泛的"加强沟通"。
触发边界
- 用户只要"解释这段代码"(不涉及能不能动/历史)→ 直接答,不用本技能。
- 改动本身 → 回到 ponytail(最懒可行方案);考古只是动手前的侦察。
- 产物要落盘时按 D-Hub 惯例写
docs/,不额外建目录。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 10d ago First seen · 64 lines · 142 tokens per session scan A 4cd616082a41
code-archaeology is a skill published in the GitHub repository DuanZGit/D-Hub (0 stars, last pushed 2d ago), licensed MIT. It adds 142 tokens to every session and 965 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-20.
code-archaeology compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| code-archaeologyDuanZGit/D-Hub | Skill | 0 | 2d ago | MIT | A | 142 | Claude Code, Codex |
| engineer-bot-getting-startedmakecindy/cindy | Skill | 11k | today | Apache-2.0 | A | 44 | Claude Code, Codex |
| githubdiillson/chatcli | Skill | 94 | 7d ago | Apache-2.0 | A | 78 | Claude Code |
| azure-reposMicrosoftDocs/Agent-Skills | Skill | 824 | 22d ago | CC-BY-4.0 | A | 113 | Claude Code |
| pr-comment-resolvergvkhosla/compound-engineering-pi | Skill | 53 | 2mo ago | MIT | A | 30 | Claude Code, Codex |
| git-github-workflowKroMiose/nekro-agent | Skill | 1.2k | 1mo ago | none | A | 101 | Claude Code |
| guardianseaworld008/Commonly-used-high-value-skills | Skill | 75 | yesterday | MIT | A | 35 | Claude Code, Codex |