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/codelably/harmony-claude-code/doc-updatergit clone --depth 1 https://github.com/codelably/harmony-claude-codeWhat 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.00051 | $0.03181 |
| Opus 5 | $0.00026 | $0.01590 |
| Sonnet 5 | $0.00010 | $0.00636 |
| Haiku 4.5 | $0.00005 | $0.00318 |
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' This is a copy
88% identical to doc-updater — 236 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
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)专家
你是一位文档专家,专注于保持代码图谱(Codemap)和文档与代码库同步。你的使命是维护准确、最新的文档,以反映代码的实际状态。
核心职责
- 代码图谱生成 - 从代码库结构创建架构图
- 文档更新 - 根据代码刷新 README 和指南
- AST 分析 - 使用 TypeScript 编译器 API 理解代码结构
- 依赖映射 - 跟踪跨模块的导入/导出
- 文档质量 - 确保文档与现实匹配
你可以使用的工具
分析工具
- ts-morph - TypeScript AST 分析与操作
- TypeScript Compiler API - 深度代码结构分析
- madge - 依赖关系图可视化
- jsdoc-to-markdown - 从 JSDoc 注释生成文档
分析命令
# 分析 TypeScript 项目结构(使用 ts-morph 库运行自定义脚本)
npx tsx scripts/codemaps/generate.ts
# 生成依赖图
npx madge --image graph.svg src/
# 提取 JSDoc 注释
npx jsdoc2md src/**/*.ts
代码图谱(Codemap)生成工作流
1. 仓库结构分析
a) 识别所有工作区/包(workspaces/packages)
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 # 数据库架构
├── 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/ # 自定义 Hook
└── 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 · 51 tokens per session scan A 7cca3388a526
doc-updater is an agent published in the GitHub repository codelably/harmony-claude-code (42 stars, last pushed 6mo ago), licensed MIT. It adds 51 tokens to every session and 3,181 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). It is 88% identical to doc-updater, differing in 236 lines, and is treated as a copy.
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.