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/clxzl/claude-code-best-practice-cn/implementgit clone --depth 1 https://github.com/clxzl/claude-code-best-practice-cnWhat 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.00009 | $0.04257 |
| Opus 5 | $0.00005 | $0.02129 |
| Sonnet 5 | $0.00002 | $0.00851 |
| Haiku 4.5 | $0.00001 | $0.00426 |
Grade A, and why
implement 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 3d 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 — 635 lines — stays where its author put it; the contents beside it link to each section on GitHub.
用户输入
$ARGUMENTS
你必须解析用户输入以提取特性标识(rpi/ 中的文件夹名称)。
用途
此命令基于规划文档执行特性的分阶段实现。它协调专业代理,强制执行验证门控,并在整个实现过程中确保合规性。
前提条件:
- 特性文件夹存在于
rpi/{feature-slug}/ - 规划已完成(
rpi/{feature-slug}/plan/PLAN.md存在)
输出位置:rpi/{feature-slug}/implement/
这是 RPI 工作流的第 4 步(最后一步 - 实际实现)。
标志
--phase N:执行特定阶段编号(1-8),如果省略则从阶段 1 开始--validate-only:仅验证当前阶段,不进行实现--skip-validation:跳过验证门控并继续(请谨慎使用)
可用代理
所有代理使用 Opus 模型 以获得最高质量。
实现代理
| 代理 | 类型 | 使用场景 |
|---|---|---|
senior-software-engineer |
自定义 | 所有实现任务 |
支持代理
| 代理 | 类型 | 用途 |
|---|---|---|
Explore |
内置 | 实现前的代码探索 |
code-reviewer |
自定义 | 代码审查和质量验证 |
constitutional-validator |
自定义 | 针对项目规范进行验证 |
documentation-analyst-writer |
内置 | 文档生成 |
代理路由
所有实现任务由 senior-software-engineer 代理处理。
阶段 0:加载上下文和规则
前提条件:已从用户输入中解析特性标识
流程:
0.1 加载项目规范
- 检查仓库中是否存在规范或原则文档
- 如果存在,提取:
- 技术约束(类型安全、测试、组件隔离)
- 业务原则(质量标准、工作流)
- 架构边界
- 存储约束以在实现过程中强制执行
0.2 加载领域特定指南
根据要修改的文件,加载相关的项目指南:
- 检查组件特定的 README 文件
- 检查编码风格指南
- 检查测试要求文档
0.3 分析实现范围
- 读取
rpi/{feature-slug}/plan/PLAN.md - 识别所有需要修改的文件
- 将文件映射到实现代理
输出:
- 规范上下文摘要
- 已加载的领域规则
- 文件到代理的映射
- 阶段执行计划
验证:
- 已加载规范(如果存在)
- 已为受影响的文件加载领域规则
- 所有文件已映射到代理
- 已理解执行计划
分阶段实现工作流
阶段实现循环
对 PLAN.md 中的每个阶段:
┌─────────────────────────────────────────────────────────────────┐
│ 阶段 N: [阶段名称] │
├─────────────────────────────────────────────────────────────────┤
│ │
│ 1. 代码发现(探索代理) │
│ └─→ 在修改前理解现有代码 │
│ │
│ 2. 实现(senior-software-engineer) │
│ └─→ 实现阶段交付物 │
│ │
│ 3. 自我验证 │
│ └─→ 工程师根据阶段清单进行验证 │
│ │
│ 4. 代码审查(code-reviewer 代理) │
│ └─→ 安全性、正确性、可维护性 │
│ │
│ 5. 用户验证门控 │
│ └─→ 停止并请求用户批准 │
│ ├─→ 通过:进入下一阶段 │
│ ├─→ 有条件通过:记录问题,继续 │
│ └─→ 失败:修复问题,重新验证 │
│ │
│ 6. 文档更新 │
│ └─→ 更新 PLAN.md 中的阶段状态 │
│ │
└─────────────────────────────────────────────────────────────────┘
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.
- 3d ago First seen · 635 lines · 9 tokens per session scan A c2eb6d0fb258
implement is a command published in the GitHub repository clxzl/claude-code-best-practice-cn (127 stars, last pushed 3mo ago), licensed MIT. It adds 9 tokens to every session and 4,257 once invoked, about $0.0000 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
git
Git operations with intelligent commit messages and workflow optimization.
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.