AGENT SKILL

writing-plans

Use when an approved specification or settled requirements need to become an executable multi-step implementation plan.

License 许可
MIT
最近更新
2026-10-08
Stars
★ 0
Forks
0

01 前言 Front Matter

name
writing-plans
license
MIT
metadata
{ "owner": "Harley Bartles", "status": "active", "use_when": [ "an approved spec exists for a multi-step task.", "the goal fits a single tight implementation plan.", "implementation code has not yet been changed." ], "source-id": "writing-plans", "source-path": "skills/writing-plans/SKILL.md", "related_skills": [ "brainstorming", "handoff-gates", "executing-plans", "subagent-driven-development", "writing-roadmaps" ], "do_not_use_when": [ "the spec covers multiple independent subsystems; invoke writing-roadmaps to create a roadmap before writing plans.", "implementation has already started.", "a substitute for brainstorming." ], "provenance-name": "Writing Plans first-party skill", "source-category": "first_party" }
description
Use when an approved specification or settled requirements need to become an executable multi-step implementation plan.

02 资源文件 5

03 SKILL.md 正文

Provenance

This marketplace-maintained derivative is based on obra/superpowers v6.4.1 commit 5bf4e78011075bcfc0dc295f0724994cd123ee71 under the MIT License. Upstream source is not vendored; this directory contains the maintained Superpowers+ implementation.

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."

First step: If you were not already routed here by using-superpowers-plus, invoke using-superpowers-plus first. Then read this skill's baseline (references/planning-baseline.md) and consult repository-resident planning guidance when the repository declares it, following its own entrypoints and paths. If no applicable local guidance exists, continue with the portable baseline.

Context: If working in an isolated worktree, it should have been created via the using-git-worktrees skill at execution time.

Save plans to: the repository-declared in-flight plan home. Use .agents/plans/ only when the repository adopts it or declares no other home.

  • (User preferences for plan location override this default)

Scope Check

If the spec covers multiple independent subsystems, invoke writing-roadmaps to create a sequenced roadmap before writing any plan. If brainstorming already produced a roadmap, write Plan 1 from the roadmap and leave remaining subsystems as pending future plans. Each plan should produce working, testable software on its own.

When to stop and ask

Before drafting a task, decide what to do when a plan item is missing scope or detail. Use this decision table:

Situation Use
Plan item has no acceptance criteria and the answer is not in durable source or the spec asking-clarifying-questions
The whole shape of the solution is unknown brainstorming to update the spec first
Plan item has acceptance criteria but is large Write the plan as a high-level draft and iterate
Scope is in the spec but not yet broken into tasks Write the plan, then review

If a single missing fact blocks the next step, invoke asking-clarifying-questions before guessing.

Plan Lifecycle

Plans are committed, in-flight execution artifacts. The active plan governs the work across sessions, but it is not durable repository truth.

  • In-flight home: the repository-declared plan location, preserving its conventions for ordinary and epic plans. If no location is declared, use .agents/plans/. Off-repo scratch is for transient session artifacts only; the plan itself lives in the in-flight plan home.
  • Commit before handoff: A plan must exist and be committed before it can be handed to executing-plans or subagent-driven-development. Execution skills read the saved, committed file, not unsaved editor state.
  • Completion: Follow the repository's planning-artifact policy. When it adopts completed-artifact-custody, resolve the immutable subscription revision and read its definition and local certification before using completing-planning-artifacts. Follow that version's retirement timing and status-recording requirements; the standard ID alone does not upgrade an older subscription. If a human requests the lifecycle without a subscription, apply the current definition only to that request. Under the current semantic definition, promote enduring decisions, retain governing artifacts through the completing PR, and retire eligible artifacts from the current base in the first substantive commit of the next slice; a marker is not required for discovery or retirement. Otherwise, follow local policy; ambient skill availability is not adoption.
  • Completion boundary: Checklist items describe work the executing agent can finish in the current slice. Human-owned post-handoff actions such as final approval, changing a PR from Draft to Ready, or merge must not remain as unchecked plan items. When the requested handoff is a fully reviewable Draft PR, complete the agent-owned publication and verification items and close the plan; record later human actions in the handoff or PR state instead. A Draft may keep a plan open only when the work is explicitly declared incomplete.
  • Roadmap and index links: Under the adopted custody standard, preserve live parent roadmaps while assessing completed child plans against their own scope. Do not create a permanent completed-artifact index solely for this lifecycle unless repository policy requires one. Non-adopters follow their local policy.

File Structure

Before defining tasks, map out which files will be created or modified and what each one is responsible for. This is where decomposition decisions get locked in.

  • Design units with clear boundaries and well-defined interfaces. Each file should have one clear responsibility.
  • You reason best about code you can hold in context at once, and your edits are more reliable when files are focused. Prefer smaller, focused files over large ones that do too much.
  • Files that change together should live together. Split by responsibility, not by technical layer.
  • In existing codebases, follow established patterns. If the codebase uses large files, don't unilaterally restructure - but if a file you're modifying has grown unwieldy, including a split in the plan is reasonable.

This structure informs the task decomposition. Each task should produce self-contained changes that make sense independently.

Task Right-Sizing

A task is the smallest unit that carries its own test cycle and is worth a fresh reviewer's gate. When drawing task boundaries: fold setup, configuration, scaffolding, and documentation steps into the task whose deliverable needs them; split only where a reviewer could meaningfully reject one task while approving its neighbor. Each task ends with an independently testable deliverable.

Right-Sizing and Escape Hatches

If you think "this is a lot" or "the plan is huge" while writing, you are at a scope sizing decision point. MUST READ: references/plan-scope-sizing.md and follow one of the three escape hatches before continuing.

A long plan with well-sliced, independently testable tasks is not a problem. The subagent-driven-development execution lane is designed for that shape. A plan is too big only when it crosses independent concerns or one of its tasks cannot fit in one review cycle.

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

Recipient-relative planning

Write each plan for the executor and stage that will receive it. Always make the observable goal, exclusions, seams, invariants, interfaces, authority, acceptance evidence, and task exits explicit. For Luna or lower-capability executors, pre-resolve consequential alternatives, name exact evidence homes and commands when known, and use finite decision tables where a choice would otherwise be rediscovered during execution. Exact implementation code is optional unless the code shape itself is the contract; specify behavior, interfaces, and evidence rather than pretending pseudocode is a guarantee.

Plan Document Header

Every plan MUST start with this header:

# [Feature Name] Implementation Plan

> **For agentic workers:** REQUIRED SUB-SKILL: Use `subagent-driven-development` (recommended) or `executing-plans` to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.

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

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

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

**Spec:** [path to the spec/design doc this plan implements — the plan
argues from the spec, so the spec travels with it; executors read both]

**Execution Strategy:** `subagent-driven-development` (default for independent tasks) — `executing-plans` (for tightly coupled/sequential tasks), `dispatching-parallel-agents` (for 2+ independent parallel tracks), or `manual` (for human-driven work). The planner picks the recommended lane.

## Global Constraints

[The spec's project-wide requirements — version floors, dependency limits,
naming and copy rules, platform requirements — one line each, with exact
values copied verbatim from the spec. Every task's requirements implicitly
include this section.]

## Review Focus

[Up to five input classes or failure modes the spec implies but the draft
tasks do not yet exercise, most likely first. Name the condition and the
behavior a reasonable user would expect. For every line, add the covering
test to the task that owns the code; this section is the index, not a
substitute for tests in the owning task. An empty section means the review
found no uncovered case.]

---

Task Structure

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

**Interfaces:**
- Consumes: [what this task uses from earlier tasks — exact signatures]
- Produces: [what later tasks rely on — exact function names, parameter
  and return types. A task's implementer sees only their own task; this
  block is how they learn the names and types neighboring tasks use.]

- [ ] **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**

```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"
```

No Placeholders

Every step must contain the actual content an engineer needs. These are plan failures — never write them:

  • "TBD", "TODO", "implement later", "fill in details"
  • "Add appropriate error handling" / "add validation" / "handle edge cases"
  • "Write tests for the above" (without actual test code)
  • "Similar to Task N" (repeat the code — the engineer may be reading tasks out of order)
  • Steps that describe what to do without showing how (code blocks required for code steps)
  • References to types, functions, or methods not defined in any task

Self-review & plan-readiness gate

After writing the complete plan, look at the spec with fresh eyes and check the plan against it. Then use handoff-gates plan-readiness lane as the plan-readiness gate. These are the same step: the self-review produces the plan, and the readiness gate rates it.

1. Spec coverage: Skim each section/requirement in the spec. Can you point to a task that implements it? List any gaps.

2. Placeholder scan: Search your plan for red flags — any of the patterns from the "No Placeholders" section above. Fix them.

3. Type consistency: Do the types, method signatures, and property names you used in later tasks match what you defined in earlier tasks? A function called clearLayers() in Task 3 but clearFullLayers() in Task 7 is a bug.

4. Review Focus: With the spec in front of you, identify up to five untested input classes or failure modes most likely to bite a reasonable user. Put them in Review Focus, then add each covering test to the owning task.

5. Plan Size and Lane Check: Did you think the plan was too large while writing? If yes, did you apply one of the escape hatches in references/plan-scope-sizing.md? Is the Execution Strategy field filled with an allowed value and a clear rationale? Treat the template's subagent-driven-development (recommended) parenthetical as a candidate, not proof. After the full task structure is visible, ask which lane you actually recommend and compare it with the nearest credible alternative using the evidence required by handoff-gates plan-readiness. Do not use plan length or task count alone. After the gate, rewrite the saved Execution Strategy field to match its selected lane and add a concise plan-specific reason. The gate result is authoritative for the saved field. Keep the required subskill header unchanged.

6. Plan-readiness rating: Use the handoff-gates plan-readiness lane. Rate the plan for execution confidence (8/10 floor, 9/10 target), report the rating in the current handoff, and do not persist it or execute below 8/10.

If you find issues during the self-review, fix them inline and re-run the plan-readiness gate. If you find a spec requirement with no task, add the task.

Execution Handoff

After the saved plan meets the readiness floor and its Execution Strategy field matches the gate's plan-specific recommendation, link the saved plan for human review before implementation. If the human already explicitly supplied an execution method, preserve it: ask them to review the saved plan and confirm that it captures what they want, without reopening lane selection. Otherwise, report the lane selected by the gate, its nearest alternative, the plan evidence and trade-off, and the execution cost:

"Plan complete and saved to <declared plan path>. Plan-readiness selected <strategy> over <alternative> because <plan-specific evidence and trade-off>. The plan-readiness rating is <X>/10. Do you want to proceed with the selected strategy, or switch to another lane?"

Describe the choice accurately: subagent-driven-development buys a fresh implementer and reviewer per task plus whole-branch review; Native executing-plans keeps implementation inline and buys one fresh whole-branch review. Recommend from task coupling, consequence, and verification burden—not from a blanket preference for either lane.

If the user chooses a different lane, note it in the handoff and let the executing skill handle the override. Do not re-derive the whole plan from scratch.

04 同仓库更多 Skills