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 agentmods add commands/hmj1026/dhpk/update-codemapsgit clone --depth 1 https://github.com/hmj1026/dhpkWrote 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/commands/hmj1026/dhpk/update-codemaps)<a href="https://agentmods.dev/commands/hmj1026/dhpk/update-codemaps"><img src="https://agentmods.dev/badge/commands/hmj1026/dhpk/update-codemaps.svg" alt="Measured on agentmods" 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 | $0.00034 | $0.01374 |
| Opus 5 | $0.00017 | $0.00687 |
| Sonnet 5 | $0.00007 | $0.00275 |
| Haiku 4.5 | $0.00003 | $0.00137 |
Grade A, and why
update-codemaps 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 today.
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.
How it starts
The opening of the file, as written. The whole thing — 112 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Update Codemaps
Contract
Use after a structural change or for an explicit codemap refresh; not for rewriting application source. See the command contract. Stop when scanning or generation fails; completion reports changed codemap paths, diff percentage, and any confirmation still required.
Analyze the codebase structure and generate token-lean architecture documentation.
Proactive orchestration: after structural changes (new module / renamed dir / new public service) the
doc-updateragent runs this command (and/update-docs) — see the back-stop in${CLAUDE_PLUGIN_ROOT}/rules/execution-policy.md. Invoke/update-codemapsdirectly for a one-off manual refresh.
Step 1: Scan Project Structure
- 偵測專案架構(框架、是否分層、是否單體 / monorepo)。常見模式:
- 單體 MVC(Yii / Laravel / Rails / Django 等)
- 分層 DDD(Domain / Application / Infrastructure)
- Modular monolith / monorepo(每個模組獨立目錄)
- Frontend SPA + Backend API
- 掃描主要目錄。下列為典型框架/分層慣例路徑,依專案實際結構增刪:
<controllers-dir>— Controller 層(HTTP 入口)<models-dir>— Domain Model / ORM Entity<views-dir>— View / Template<commands-dir>— Console / Worker 命令<services-dir>— Application / Domain Service<repositories-dir>— Repository / Data Access<frontend-dir>— 前端 JS/CSS(含或不含 build step)
- 標示進入點:例如
index.php、public/index.php、src/main.ts、manage.py、config/application.rb等專案實際的入口檔。
Step 2: Generate Codemaps
若 docs/CODEMAPS/ 不存在,先建立目錄(mkdir -p docs/CODEMAPS)。
在 docs/CODEMAPS/ 建立或更新以下文件:
| 文件 | 內容 |
|---|---|
architecture.md |
高階系統圖、分層結構、Controller → Service → Repository(或專案實際呼叫鏈)路徑 |
backend.md |
Controller actions、Service 方法、Repository 對應、Console / Worker commands |
frontend.md |
前端目錄結構、全域 API / namespace、View 與 JS 的關聯 |
data.md |
主要資料表、ORM model 對應、關聯(relations / associations) |
dependencies.md |
外部 API 整合、第三方服務、framework extensions、套件管理檔依賴 |
Codemap Format
每份 codemap 應精簡 — 針對 AI context 消耗最佳化:
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.
- today First seen · 112 lines · 34 tokens per session scan A 6298254c85a4
update-codemaps is a command published in the GitHub repository hmj1026/dhpk (2 stars, last pushed today), licensed MIT. It adds 34 tokens to every session and 1,374 once invoked, about $0.0002 per session on Opus 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-09-05.
Other commands, from other repositories
done
Finish a task - document, create PR or merge, close.
paper-trail-cascade
Acquire PDFs via the 8-source cascade (11 with opt-in extended sources) for a single ref by slug, or a batch filtered by state. Validates page 1 anti-homonymy on each download.
ocr
Run OCR on existing book page captures (Vision + agent re-reading).
report
Render the latest audit as a deliverable report in Markdown / HTML / PDF / JSON / PNG.
Capture book from PDF file, OCR, and generate structured Markdown.
harness-lint
이 프로젝트의 생성된 하네스를 계약에 대고 검사한다. 결정적 검사 9종.