SuperAPI AI 工具集

writing-plans

编程与开发

查看项目

更新于 10-15 18:31

技能介绍

用途

writing-plans 用于在已有规格或需求、但尚未开始写代码时,编写一份完整的实施计划。它的核心假设是:执行计划的工程师虽然技术熟练,但对当前代码库、工具链和问题领域几乎一无所知,并且对测试设计不够熟悉。因此计划需要记录执行者需要知道的一切内容。

主要能力

  • 为每个任务说明需要改动哪些文件、涉及哪些代码、可能需要查阅的测试与文档,以及如何测试。
  • 将整个计划拆解为“一口大小”的任务步骤,每一步只包含一个动作,耗时约 2-5 分钟。
  • 遵循 DRY、YAGNI、TDD 和频繁提交的原则。
  • 计划文档带有固定头部,包含目标、架构、技术栈,并注明执行时需使用 superpowers:executing-plans 子技能。
  • 每个任务包含文件清单(创建、修改、测试)以及分步骤的测试与实现流程。

使用方式

开始时应声明:“I'm using the writing-plans skill to create the implementation plan.”

该技能应在专门的工作树(worktree)中运行,该工作树由 brainstorming 技能创建。

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

计划文档头部格式:

[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

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"

步骤粒度示例:

  • “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

编写要点:始终使用精确文件路径;计划中包含完整代码(而不是“add validation”这类描述);给出精确命令与预期输出;用 @ 语法引用相关技能;遵循 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?”

如果选择 Subagent-Driven:必需子技能为 superpowers:subagent-driven-development;留在当前会话;每个任务使用全新子代理并进行代码审查。

如果选择 Parallel Session:引导用户在工作树中打开新会话;新会话必需使用 superpowers:executing-plans。

适用场景

适用于已有规格或需求、需要为多步骤任务编写实施计划的场景,尤其是在动手写代码之前。

限制

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