网淘吧来吧,欢迎您!

返回首页 微信
微信
手机版
手机版

Writing Plans

2026-03-29 新闻来源:网淘吧 围观:13
电脑广告
手机广告

撰写计划

概述

编写全面的实施计划,假设工程师对我们的代码库毫无了解且品味存疑。记录他们需要知道的一切:每项任务需要修改哪些文件、代码、可能需要查阅的测试和文档、如何进行测试。将整个计划分解成易于执行的小任务。遵循DRY(不要重复自己)原则。遵循YAGNI(你不会需要它)原则。采用TDD(测试驱动开发)方法。频繁提交。

假设他们是一名熟练的开发人员,但几乎不了解我们的工具集或问题领域。假设他们不太擅长良好的测试设计。

在开始时声明:“我正在使用撰写计划技能来创建实施计划。”

上下文:此操作应在由头脑风暴技能创建的专用工作树中运行。

将计划保存至: docs/plans/YYYY-MM-DD-<功能名称>.md

易于执行的任务粒度

每个步骤对应一个操作(2-5分钟):

  • “编写失败的测试” - 步骤
  • “运行测试以确保其失败” - 步骤
  • “实现使测试通过的最简代码” - 步骤
  • “运行测试并确保其通过” - 步骤
  • "提交" - 步骤

计划文档标题

每个计划都必须以此标题开始:

# [Feature Name] Implementation Plan

> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.

**Goal:** [One sentence describing what this builds]

**Architecture:** [2-3 sentences about approach]

**Tech Stack:** [Key technologies/libraries]

---

任务结构

### Task N: [Component Name]

**Files:**
- Create: `exact/path/to/file.py`
- Modify: `exact/path/to/existing.py:123-145`
- Test: `tests/exact/path/to/test.py`

**Step 1: Write the failing test**

```python
def test_specific_behavior():
    result = function(input)
    assert result == expected

步骤2:运行测试以验证其失败

运行:pytest tests/path/test.py::test_name -v预期:失败,并显示"函数未定义"

步骤3:编写最小实现

def function(input):
    return expected

步骤4:运行测试以验证其通过

运行:pytest tests/path/test.py::test_name -v预期:通过

步骤5:提交

git add tests/path/test.py src/path/file.py
git commit -m "feat: add specific feature"

## 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
免责申明
部分文章来自各大搜索引擎,如有侵权,请与我联系删除。
打赏
文章底部电脑广告
手机广告位-内容正文底部
上一篇:Writer 下一篇:Institutional Flow Tracker

相关文章

您是本站第305499名访客 今日有220篇新文章/评论