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/xiaobei930/cc-best/codemapgit clone --depth 1 https://github.com/xiaobei930/cc-bestWhat 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.00019 | $0.00963 |
| Opus 5 | $0.00010 | $0.00481 |
| Sonnet 5 | $0.00004 | $0.00193 |
| Haiku 4.5 | $0.00002 | $0.00096 |
Grade A, and why
codemap 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 2d 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.
How it starts
The opening of the file, as written. The whole thing — 103 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/codemap - 代码架构文档
自动扫描项目结构,生成 token 优化的架构文档。
用法
/cc-best:codemap # 生成完整 codemap
/cc-best:codemap --update # 仅更新变化部分
/cc-best:codemap --scope backend # 仅后端
工作流程
Step 1: 项目扫描
- 扫描项目目录结构(排除 node_modules、.git、dist 等)
- 识别框架和技术栈(package.json、go.mod、requirements.txt、pom.xml 等)
- 按区域分类:frontend / backend / database / integrations / workers
Step 2: 架构提取
对每个区域提取关键信息:
| 提取项 | 说明 | 示例 |
|---|---|---|
| 路由/API 端点 | URL → Handler 映射 | GET /api/users → UserController |
| 组件/模块层级 | 目录结构 → 职责划分 | src/auth/ → 认证模块 |
| 关键文件 | 文件名 + 职责 + 行数 | auth.ts (认证中间件, 120L) |
| 依赖关系 | 模块间导入/调用关系 | auth → database → cache |
Step 3: 文档生成
输出到 docs/CODEMAPS/ 目录:
docs/CODEMAPS/
├── overview.md # 项目总览(技术栈、目录结构、模块划分)
├── frontend.md # 前端架构(如有)
├── backend.md # 后端架构(如有)
└── _meta.json # 生成元数据(时间、范围、文件数、hash)
文档格式要求:
- Token 优化:避免冗余注释,使用紧凑表格
- 元数据头:生成时间、扫描范围、文件数
- 每个文件说明限 1 行(文件名 + 职责 + 行数)
Step 4: 变化检测(--update 模式)
读取上次 _meta.json → 对比当前文件 hash
│
├─ 变化 ≤ 30% → 自动增量更新
└─ 变化 > 30% → 提示用户确认全量重建
输出格式示例
# Project Codemap
Generated: 2026-02-24 | Files: 127 | Scope: all
## Tech Stack
- Runtime: Node.js 20 + TypeScript 5.3
- Framework: Express + React 18
- Database: PostgreSQL + Redis
## Module Map
| Module | Path | Files | Purpose |
| ---------- | ----------- | ----- | ------------- |
| auth | src/auth/ | 8 | 认证与授权 |
| api | src/api/ | 15 | REST API 端点 |
| models | src/models/ | 12 | 数据模型 |
| components | src/ui/ | 34 | React 组件 |
## Key Files
| File | Lines | Purpose |
| ----------------- | ----- | ------------ |
| src/auth/jwt.ts | 120 | JWT 令牌管理 |
| src/api/routes.ts | 85 | 路由注册 |
| src/db/migrate.ts | 200 | 数据库迁移 |
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.
- 2d ago First seen · 103 lines · 19 tokens per session scan A 58e276dda817
codemap is a command published in the GitHub repository xiaobei930/cc-best (50 stars, last pushed 2mo ago), licensed MIT. It adds 19 tokens to every session and 963 once invoked, about $0.0001 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-08-30.
Other commands, from other repositories
al
Run AgentLint diagnostic across all projects. Use when: user says /al, 'check all projects', 'agent lint', or '体检'.
tldr
Re-apply TLDR rules for this turn (verdict first, no filler).
moyu-lite
Invoke the moyu:moyu-lite skill and follow it exactly.
audit-plugin
Audit plugin skills, commands, and agents for structure, size, and naming issues.
lfe-dep-audit
Inspector sub-skill. Reviews dependency manifest files (package.json, requirements.txt, go.mod, Cargo.toml, pom.xml) changed in the current diff for risky version patterns and stale majors. Emits a human-run audit instruction rather than executing tools. Writes .plans/checks/depfindings.md. Called by lfe-inspector…
lfe-plan-critique
Run a 5-lens pre-build critique of the approved active plan before the Builder starts. Acts as the Architect persona, read-only on src/. Writes .plans/plancritique.md. Use immediately after Brain approves activeplan.md.