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
INLINECODE1
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
Superplanner Memory Integration (Unified Extension)
CRITICAL THEMATIC RULE: You are working inside the
superpower-with-files unified framework.
Workflow Standardization
- 1. Skill Announcement: Every time you start using this skill, you MUST first announce:
🚀 **SUPERPOWER ACTIVE:** spf-write-plan
- 2. Context Independence: You are NOT restricted to dedicated worktrees. Proceed in any project root.
SMART PLANNING RULES
- 1. Adaptive Granularity: Add
complexity: simple | medium | complex to the plan header.
-
simple: Combine boilerplate and logic into fewer, larger tasks. Keep all instructions in
active_tdd_plan.md.
-
medium/complex: Use the
Split Architecture.
- 2. Split Architecture (Verbosity Reduction):
- For non-simple projects,
active_tdd_plan.md MUST remain a concise high-level task list.
- Detailed implementation instructions (exact code, file modifications, specific commands) MUST be moved to:
.superpower-with-files/guides/task-N.md
- In the main plan, reference the guide:
Guide: See guides/task-N.md.
- 3. Dependency & Parallel Markers: Each task block in the plan MUST include:
-
Depends on: [Task ID | None]
-
Parallel with: [Task ID | None]
- 4. Smarter Test Detection: Before drafting the test section, you MUST auto-detect the test runner:
-
Cargo.toml ->
cargo test
-
pyproject.toml ->
pytest
-
package.json ->
npm test
- 5. Optional Markers: Mark routine verification as
(optional). - Template Support: Use relevant templates from the
templates/ directory to guide choices.
STRICT PLANNING ONLY
- 1. No Execution: While using this skill, you MUST NOT execute code or run tests.
- Implicit Stop & Handoff Prompt:
> "Planning phase complete. The plan and guides have been saved to [.superpower-with-files/]. Please review. To proceed, use:
'Execute the plan.'"
Automated Timestamping
- - Every time you modify a memory file (
task_plan.md, active_tdd_plan.md, findings.md, progress.md), you MUST append a horizontal rule and a timestamp at the very bottom:
---
INLINECODE27
SMART PLANNING RULES
- 1. Adaptive Granularity: Add
complexity: simple | medium | complex to the plan header.
-
simple: Combine boilerplate and logic into fewer, larger tasks.
-
complex: High granularity, minute-by-minute steps.
- 2. Smarter Test Detection: Before drafting the test section, you MUST auto-detect the test runner:
-
Cargo.toml ->
cargo test
-
pyproject.toml /
pytest in
requirements.txt ->
pytest
-
package.json ->
npm test
- No detection -> Ask the user.
- 3. Optional Markers: You may mark routine verification steps as
(optional) (e.g., Step 5: Verify structure (optional)). - Template Support: If a specific framework or language is mentioned (e.g., "Python CLI", "React Component"), you MUST check the
templates/ directory within this skill and use the corresponding template to guide your project structure and library choices.
Naming & Location Precedence
- 1. User Override [HIGHEST]: If the user specifies any path (e.g., "Save to
projects/tgnews"), you MUST honor that path immediately. - SPF Default [SECONDARY]: If no path is specified by the user, save to:
.superpower-with-files/active_tdd_plan.md
- 3. Legacy paths (docs/plans/): Ignore any legacy instructions about
docs/plans/ unless specifically requested by the user.
编写计划
概述
编写全面的实施计划,假设工程师对我们的代码库毫无背景知识且品味存疑。记录他们需要了解的一切:每个任务需要修改哪些文件、代码、测试、可能需要查阅的文档,以及如何测试。将整个计划分解为可一口一口吃掉的小任务。遵循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
超级规划器记忆集成(统一扩展)
关键主题规则: 你在superpower-with-files统一框架内工作。
工作流标准化
- 1. 技能声明: 每次开始使用此技能时,必须首先声明:
🚀
超级能力激活: spf-write-plan
- 2. 上下文独立性: 你不受限于专用工作树。可在任何项目根目录中进行。
智能规划规则
- 1. 自适应粒度:在计划头部添加complexity: simple | medium | complex。
- simple:将样板代码和逻辑合并为更少、更大的任务。将所有指令保留在active
tddplan.md中。
- medium/complex:使用
拆分架构。
- 2. 拆分架构(减少冗长):
- 对于非简单项目,active
tddplan.md必须保持为简洁的高级任务列表。
- 详细的实施说明(精确代码、文件修改、具体命令)必须移至:
.superpower-with-files/guides/task-N.md
- 在主计划中,引用指南:指南:参见guides/task-N.md。
- 3. 依赖与并行标记:计划中的每个任务块必须包含:
- 依赖: [任务ID | 无]
- 并行: [任务ID | 无]
- 4. 智能测试检测:在起草测试部分之前,必须自动检测测试运行器:
- Cargo.toml -> cargo test
- pyproject.toml -> pytest
- package.json -> npm test
- 5. 可选标记:将常规验证标记为(可选)。
- 模板支持:使用templates/目录中的相关模板来指导选择。
严格仅规划
- 1. 不执行: 使用此技能时,不得执行代码或运行测试。
- 隐式停止与交接提示:
> 规划阶段完成。计划和指南已保存至[.superpower-with-files/]。请审阅。要继续,请使用:
执行计划。
自动时间戳
- - 每次修改记忆文件(taskplan.md、activetdd_plan.md、findings.md、progress.md)时,必须在最底部追加一条水平线和时间戳:
最后更新:YYYY-MM-DD HH:MM UTC
智能规划规则
- 1. 自适应粒度:在计划头部添加complexity: simple | medium | complex。
- simple:将样板代码和逻辑合并为更少、更大的任务。
- complex:高粒度,分钟级步骤。
- 2. 智能测试检测:在起草测试部分之前,必须自动检测测试运行器:
- Cargo.toml -> cargo test
- pyproject.toml / requirements.txt中的pytest -> pytest
- package.json -> npm test
- 未检测到 -> 询问用户。
- 3. 可选标记:可将常规验证步骤标记为(可选)(例如,步骤5:验证结构(可选))。
- 模板支持:如果提到特定框架或语言(例如,Python CLI、React组件),必须检查此技能中的templates/目录,并使用相应的模板来指导项目结构和库选择。
命名与位置优先级
- 1. 用户覆盖 [最高]: 如果用户指定了任何路径(例如,保存至projects/tgnews),必须立即遵循该路径。
- SPF默认 [次要]: 如果用户未指定路径,保存至:
.superpower-with-files/activetddplan.md
- 3. 旧路径(docs/plans/): 忽略关于docs/plans/的任何旧指令,除非用户特别要求。