Writing Plans
Overview
Write comprehensive implementation plans assuming the engineer has zero context for our codebase and questionable taste. Document everything they need to know: which files to touch for each task, code, testing, docs they might need to check, how to test it. Give them the whole plan as bite-sized tasks. DRY. YAGNI. TDD. Frequent commits.
Assume they are a skilled developer, but know almost nothing about our toolset or problem domain. Assume they don't know good test design very well.
Announce at start: "I'm using the writing-plans skill to create the implementation plan."
Context: This should be run in a dedicated worktree (created by brainstorming skill).
Save plans to: INLINECODE0
Bite-Sized Task Granularity
Each step is one action (2-5 minutes):
- - "Write the failing test" - step
- "Run it to make sure it fails" - step
- "Implement the minimal code to make the test pass" - step
- "Run the tests and make sure they pass" - step
- "Commit" - step
Plan Document Header
Every plan MUST start with this header:
CODEBLOCK0
Task Structure
CODEBLOCK1 python
def testspecificbehavior():
result = function(input)
assert result == expected
**Step 2: Run test to verify it fails**
Run: `pytest tests/path/test.py::test_name -v`
Expected: FAIL with "function not defined"
**Step 3: Write minimal implementation**
python
def function(input):
return expected
**Step 4: Run test to verify it passes**
Run: `pytest tests/path/test.py::test_name -v`
Expected: PASS
**Step 5: Commit**
bash
git add tests/path/test.py src/path/file.py
git commit -m "feat: add specific feature"
CODEBLOCK4
Remember
- - Exact file paths always
- Complete code in plan (not "add validation")
- Exact commands with expected output
- Reference relevant skills with @ syntax
- DRY, YAGNI, TDD, frequent commits
Execution Handoff
After saving the plan, offer execution choice:
"Plan complete and saved to docs/plans/<filename>.md. Two execution options:
1. Subagent-Driven (this session) - I dispatch fresh subagent per task, review between tasks, fast iteration
2. Parallel Session (separate) - Open new session with executing-plans, batch execution with checkpoints
Which approach?"
If Subagent-Driven chosen:
- - REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development
- Stay in this session
- Fresh subagent per task + code review
If Parallel Session chosen:
- - Guide them to open new session in worktree
- REQUIRED SUB-SKILL: New session uses superpowers:executing-plans
编写计划
概述
编写全面的实施计划,假设工程师对我们的代码库零背景知识且品味存疑。记录他们需要了解的一切:每个任务需要修改的文件、代码、测试、可能需要查阅的文档,以及如何测试。将整个计划分解为可一口吃下的任务。遵循DRY、YAGNI、TDD原则,频繁提交。
假设他们是熟练的开发者,但对我们的工具集或问题领域几乎一无所知。假设他们不太擅长良好的测试设计。
开始时声明: 我正在使用编写计划技能来创建实施计划。
上下文: 这应在专用工作树中运行(由头脑风暴技能创建)。
保存计划至: docs/plans/YYYY-MM-DD-<功能名称>.md
一口吃下的任务粒度
每个步骤是一个操作(2-5分钟):
- - 编写失败的测试 - 步骤
- 运行测试确保其失败 - 步骤
- 实现最小化代码使测试通过 - 步骤
- 运行测试确保其通过 - 步骤
- 提交 - 步骤
计划文档头部
每个计划必须以以下头部开头:
markdown
[功能名称] 实施计划
针对Claude: 必需的子技能:使用superpowers:executing-plans按任务逐项实施此计划。
目标: [一句话描述此构建内容]
架构: [2-3句话描述方法]
技术栈: [关键技术/库]
任务结构
markdown
任务N:[组件名称]
文件:
- - 创建:exact/path/to/file.py
- 修改:exact/path/to/existing.py:123-145
- 测试:tests/exact/path/to/test.py
步骤1:编写失败的测试
python
def testspecificbehavior():
result = function(input)
assert result == expected
步骤2:运行测试验证其失败
运行:pytest tests/path/test.py::test_name -v
预期:失败,提示function not defined
步骤3:编写最小化实现
python
def function(input):
return expected
步骤4:运行测试验证其通过
运行:pytest tests/path/test.py::test_name -v
预期:通过
步骤5:提交
bash
git add tests/path/test.py src/path/file.py
git commit -m feat: add specific feature
记住
- - 始终使用精确文件路径
- 计划中包含完整代码(而非添加验证)
- 精确命令及预期输出
- 使用@语法引用相关技能
- 遵循DRY、YAGNI、TDD原则,频繁提交
执行交接
保存计划后,提供执行选项:
计划已完成并保存至 docs/plans/<文件名>.md。两种执行选项:
1. 子代理驱动(当前会话) - 我为每个任务分派新的子代理,在任务间进行审查,快速迭代
2. 并行会话(独立) - 使用executing-plans打开新会话,批量执行并设置检查点
选择哪种方式?
如果选择子代理驱动:
- - 必需的子技能: 使用superpowers:subagent-driven-development
- 保持在此会话中
- 每个任务使用新的子代理 + 代码审查
如果选择并行会话:
- - 引导他们在工作树中打开新会话
- 必需的子技能: 新会话使用superpowers:executing-plans