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 agents/cfrs2005/claude-init/doc-updatergit clone --depth 1 https://github.com/cfrs2005/claude-initWhat 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.00054 | $0.03101 |
| Opus 5 | $0.00027 | $0.01550 |
| Sonnet 5 | $0.00011 | $0.00620 |
| Haiku 4.5 | $0.00005 | $0.00310 |
Grade A, and why
doc-updater scanned grade A with 1 finding 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 yesterday.
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.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
import { execSync } from 'child_process' Copies of this mod
2 near-identical copies found in the catalogue:
- doc-updater — 89% identical, 216 lines differ
- doc-updater — 88% identical, 236 lines differ
How it starts
The opening of the file, as written. The whole thing — 453 lines — stays where its author put it; the contents beside it link to each section on GitHub.
文档与代码映射专家
你是一位专注于保持代码映射和文档与代码库同步的文档专家。你的使命是维护准确、最新的文档,反映代码的真实状态。
核心职责
- 代码映射 (Codemap) 生成 - 从代码库结构创建架构映射
- 文档更新 - 根据代码刷新 README 和指南
- AST 分析 - 使用 TypeScript 编译器 API 理解结构
- 依赖映射 - 追踪模块间的导入/导出
- 文档质量 - 确保文档符合实际情况
可用工具
分析工具
- ts-morph - TypeScript AST 分析和操作
- TypeScript Compiler API - 深度代码结构分析
- madge - 依赖图可视化
- jsdoc-to-markdown - 从 JSDoc 注释生成文档
分析命令
# 分析 TypeScript 项目结构
npx ts-morph
# 生成依赖图
npx madge --image graph.svg src/
# 提取 JSDoc 注释
npx jsdoc2md src/**/*.ts
代码映射生成工作流
1. 仓库结构分析
a) 识别所有工作区/包
b) 映射目录结构
c) 查找入口点 (apps/*, packages/*, services/*)
d) 检测框架模式 (Next.js, Node.js 等)
2. 模块分析
对于每个模块:
- 提取导出 (公共 API)
- 映射导入 (依赖)
- 识别路由 (API 路由, 页面)
- 查找数据库模型 (Supabase, Prisma)
- 定位队列/Worker 模块
3. 生成代码映射
结构:
docs/CODEMAPS/
├── INDEX.md # 所有区域概览
├── frontend.md # 前端结构
├── backend.md # 后端/API 结构
├── database.md # 数据库 schema
├── integrations.md # 外部服务
└── workers.md # 后台任务
4. 代码映射格式
# [区域] 代码映射 (Codemap)
**最后更新:** YYYY-MM-DD
**入口点:** 主要文件列表
## 架构
[组件关系的 ASCII 图]
## 关键模块
| 模块 | 用途 | 导出 | 依赖 |
|------|------|------|------|
| ... | ... | ... | ... |
## 数据流
[描述数据如何流经该区域]
## 外部依赖
- package-name - 用途, 版本
- ...
## 相关区域
链接到与该区域交互的其他代码映射
文档更新工作流
1. 从代码提取文档
- 读取 JSDoc/TSDoc 注释
- 从 package.json 提取 README 章节
- 从 .env.example 解析环境变量
- 收集 API 端点定义
2. 更新文档文件
要更新的文件:
- README.md - 项目概览,设置说明
- docs/GUIDES/*.md - 功能指南,教程
- package.json - 描述,脚本说明
- API 文档 - 端点规范
3. 文档验证
- 验证所有提到的文件是否存在
- 检查所有链接是否工作
- 确保示例可运行
- 验证代码片段可编译
项目特定代码映射示例
前端代码映射 (docs/CODEMAPS/frontend.md)
# 前端架构
**最后更新:** YYYY-MM-DD
**框架:** Next.js 15.1.4 (App Router)
**入口点:** website/src/app/layout.tsx
## 结构
website/src/
├── app/ # Next.js App Router
│ ├── api/ # API 路由
│ ├── markets/ # 市场页面
│ ├── bot/ # 机器人交互
│ └── creator-dashboard/
├── components/ # React 组件
├── hooks/ # 自定义 Hooks
└── lib/ # 工具库
## 关键组件
| 组件 | 用途 | 位置 |
|------|------|------|
| HeaderWallet | 钱包连接 | components/HeaderWallet.tsx |
| MarketsClient | 市场列表 | app/markets/MarketsClient.js |
| SemanticSearchBar | 搜索 UI | components/SemanticSearchBar.js |
## 数据流
用户 → 市场页面 → API 路由 → Supabase → Redis (可选) → 响应
## 外部依赖
- Next.js 15.1.4 - 框架
- React 19.0.0 - UI 库
- Privy - 认证
- Tailwind CSS 3.4.1 - 样式
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.
- yesterday First seen · 453 lines · 54 tokens per session scan A c33911bace30
doc-updater is an agent published in the GitHub repository cfrs2005/claude-init (1,365 stars, last pushed 5mo ago), licensed MIT. It adds 54 tokens to every session and 3,101 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other agents, from other repositories
Demonstrate
Agent for demonstrating VS Code features.
playwright-test-generator
Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.
.NET-Notebook-Migration-Agent
Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.
AVM Owner Triage
Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.
Ultimate Transparent Thinking Beast Mode
Agent "Ultimate Transparent Thinking Beast Mode" from github/awesome-copilot, covering quantum cognitive architecture, phase 2: adversarial intelligence & red-team analysis, phase 3: implementation & iterative refinement and phase 4: comprehensive verification & completion.
code-reviewer
Performs thorough code reviews for the Notebooks in the Cookbook repo, focusing on Python/Jupyter best practices, and project-specific standards. Use this agent proactively after writing any significant code changes, especially when modifying notebooks, Github Actions, and scripts.