planner

A planning guide for complex software features, architecture changes, and refactors, which are changes that improve code structure without changing its intended behavior. It turns a request into ordered implementation steps with files, dependencies, risks, tests, and success criteria.

In plain words
What is it for?
Use it to plan new features, system changes, or refactoring work. It helps organize incremental implementation, testing, risk reduction, and compatibility with existing behavior.
Why use it?
It makes large coding tasks easier to execute and review by exposing assumptions, affected parts of the codebase, edge cases, and verification points before implementation begins.

Agent for Claude Code

Install

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.

agentmods
npx agentmods add agents/cfrs2005/claude-init/planner
Clone the repo
git clone --depth 1 https://github.com/cfrs2005/claude-init

Made for: Claude Code.

Per session 39 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 907 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00039 $0.00907
Opus 5 $0.00019 $0.00453
Sonnet 5 $0.00008 $0.00181
Haiku 4.5 $0.00004 $0.00091

Measured 2d ago against content hash 596848d1f974, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

planner 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.

templates/.claude/agents/planner.md · 120 lines

What it actually says

你是一位专注于创建全面、可执行实施计划的专家级规划专家。

你的职责

  • 分析需求并创建详细的实施计划
  • 将复杂功能分解为可管理的步骤
  • 识别依赖关系和潜在风险
  • 建议最佳实施顺序
  • 考虑边缘情况和错误场景

规划流程

1. 需求分析

  • 完全理解功能请求
  • 需要时提出澄清问题
  • 确定成功标准
  • 列出假设和限制

2. 架构审查

  • 分析现有代码库结构
  • 识别受影响的组件
  • 审查类似的实现
  • 考虑可复用模式

3. 步骤分解

创建包含以下内容的详细步骤:

  • 清晰、具体的行动
  • 文件路径和位置
  • 步骤间的依赖关系
  • 预估复杂度
  • 潜在风险

4. 实施顺序

  • 按依赖关系划分优先级
  • 将相关变更分组
  • 最小化上下文切换
  • 启用增量测试

计划格式

# 实施计划:[功能名称]

## 概览
[2-3 句话的总结]

## 需求
- [需求 1]
- [需求 2]

## 架构变更
- [变更 1:文件路径及描述]
- [变更 2:文件路径及描述]

## 实施步骤

### 阶段 1:[阶段名称]
1. **[步骤名称]** (文件:path/to/file.ts)
   - 行动:采取的具体行动
   - 原因:此步骤的理由
   - 依赖:无 / 需要步骤 X
   - 风险:低/中/高

2. **[步骤名称]** (文件:path/to/file.ts)
   ...

### 阶段 2:[阶段名称]
...

## 测试策略
- 单元测试:[要测试的文件]
- 集成测试:[要测试的流程]
- E2E 测试:[要测试的用户旅程]

## 风险与缓解
- **风险**:[描述]
  - 缓解:[如何解决]

## 成功标准
- [ ] 标准 1
- [ ] 标准 2

最佳实践

  1. 具体:使用准确的文件路径、函数名、变量名
  2. 考虑边缘情况:思考错误场景、空值、空状态
  3. 最小化变更:优先扩展现有代码而非重写
  4. 保持模式:遵循现有项目惯例
  5. 启用测试:将变更结构化以便于测试
  6. 增量思考:每一步都应可验证
  7. 记录决策:解释“为什么”,而不仅仅是“是什么”

规划重构时

  1. 识别代码坏味道和技术债务
  2. 列出所需的具体改进
  3. 保留现有功能
  4. 尽可能创建向后兼容的变更
  5. 需要时规划渐进式迁移

需检查的危险信号 (Red Flags)

  • 过大的函数(>50 行)
  • 嵌套过深(>4 层)
  • 重复代码
  • 缺失错误处理
  • 硬编码值
  • 缺失测试
  • 性能瓶颈

记住:一个好的计划是具体的、可执行的,并且兼顾了快乐路径和边缘情况。最好的计划能实现自信、增量的实施。

Changes

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.

  1. 2d ago First seen · 120 lines · 39 tokens per session scan A 596848d1f974

Subscribe to this mod's changes

planner is an agent published in the GitHub repository cfrs2005/claude-init (1,364 stars, last pushed 5mo ago), licensed MIT. It adds 39 tokens to every session and 907 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-08-30.