SuperAPI AI 工具集

Writing Plans

编程与开发

查看项目

更新于 10-14 23:40

技能介绍

用途

Writing Plans 用于编写全面的实施计划,其核心假设是:执行计划的工程师虽然技术熟练,但对当前代码库、工具链和问题领域几乎一无所知,并且不太懂良好的测试设计。因此计划必须记录执行者需要知道的一切:每个任务要改动哪些文件、具体代码、测试、可能需要查阅的文档,以及如何测试。

该技能应在由 brainstorming 技能创建的专用 worktree 中运行。开始时需声明:“I'm using the Writing Plans skill to create the implementation plan.”

计划保存路径为:docs/plans/YYYY-MM-DD-<feature-name>.md。

主要能力

  • 将实施过程拆解为“小步任务”(bite-sized tasks),每个步骤是一个动作,耗时约 2-5 分钟。
  • 典型步骤序列:写失败测试 → 运行确认失败 → 写最小实现使测试通过 → 运行确认通过 → 提交。
  • 为每个任务指定确切文件路径,包括创建、修改(可含行号范围)和测试文件。
  • 在计划中给出完整代码,而不是“添加校验”这类模糊描述。
  • 给出确切命令及预期输出。
  • 使用 @ 语法引用相关技能。
  • 遵循 DRY、YAGNI、TDD 和频繁提交原则。

使用方式

计划文档必须以固定头部开头,包含:

  • 标题:# [Feature Name] Implementation Plan
  • 给 Claude 的提示:使用 ${SUPERPOWERS_SKILLS_ROOT}/skills/collaboration/executing-plans/SKILL.md 逐任务实施该计划。
  • Goal:一句话描述要构建什么。
  • Architecture:2-3 句话说明方法。
  • Tech Stack:关键技术/库。

任务结构示例:

### 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

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

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

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


计划中需记住的要点:始终使用确切文件路径;计划中包含完整代码;给出确切命令与预期输出;用 @ 语法引用相关技能;遵循 DRY、YAGNI、TDD、频繁提交。

## 执行交接

保存计划后,需提供执行方式选择:

“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?”

若选择子代理驱动:使用 `skills/collaboration/subagent-driven-development`,留在当前会话,每个任务派发新子代理并进行代码审查。

若选择并行会话:引导用户在工作树中打开新会话,新会话使用 `skills/collaboration/executing-plans`。

## 适用场景

适用于需要把功能实现拆解为可逐步执行、可测试、可提交的详细计划的开发协作场景,尤其适合执行者对代码库缺乏上下文的情况。

## 限制

资料未提供关于收费、价格、平台支持范围或效果保证的信息。