writing-plans
obra/superpowers
仕様書や要件に基づき、タスクの分解、ファイル構成、テスト駆動開発の手順などを盛り込んだ、詳細かつ段階的な実装計画を作成します。
...すべて拡張します執筆計画
概要
エンジニアが当社のコードベースについて全く知識がなく、センスも疑わしいという前提で、包括的な実装計画を策定します。エンジニアが知る必要があるすべての情報を文書化してください。具体的には、各タスクでどのファイルを修正すべきか、確認すべきコード・テスト・ドキュメント、そしてテストの方法などです。 計画全体を、消化しやすい小さなタスクに分けて提示する。DRY。YAGNI。TDD。頻繁なコミット。
そのエンジニアは熟練した開発者であると仮定するが、当社のツールセットや問題領域についてはほとんど何も知らない。また、適切なテスト設計についてもあまり詳しくないと仮定する。
開始時に次のように告知してください:「実装計画を作成するために、『writing-plans 』スキルを使用しています。」
背景:隔離されたワークツリーで作業する場合、実行時に「superpowers:using-git-worktrees」スキルを使用して作成されている必要があります。
計画の保存先: docs/superpowers/plans/YYYY-MM-DD-
- (計画の保存場所に関するユーザー設定は、このデフォルト設定に優先します)
スコープの確認
仕様が複数の独立したサブシステムを網羅している場合、ブレインストーミングの段階でサブプロジェクトごとの仕様に分割されている必要があります。そうでない場合は、これをサブシステムごとに個別の計画に分割するよう提案してください。各計画は、それ単体で動作し、テスト可能なソフトウェアを生成できるものでなければなりません。
ファイル構造
タスクを定義する前に、どのファイルが作成または変更されるか、また各ファイルがどのような役割を担うかを明確にします。ここで、分解に関する決定が確定します。
- 境界が明確で、インターフェースが明確に定義された設計単位を作成してください。各ファイルは、1つの明確な役割を持つべきです。
- 一度に文脈を把握できるコードについてこそ、最も的確に判断でき、ファイルの役割が明確であればあるほど、編集の信頼性も高まります。多くの役割を担う大きなファイルよりも、小さく、焦点を絞ったファイルを選びましょう。
- 一緒に変更されるファイルは、同じ場所にまとめるべきです。技術的なレイヤーではなく、責任範囲に基づいて分割してください。
- 既存のコードベースでは、確立されたパターンに従ってください。コードベースで大規模なファイルが使用されている場合、一方的に再構成してはいけません。ただし、修正しようとしているファイルが扱いにくくなるほど肥大化している場合は、分割を計画に含めることは合理的です。
この構造はタスクの分解の指針となります。各タスクは、単独でも意味をなす、自己完結型の変更を生み出すべきです。
タスクの適正化
タスクとは、独自のテストサイクルを持ち、 新規のレビュー担当者のゲートを通過する価値がある最小の単位です。タスクの境界線を引く際は、セットアップ、 設定、骨組み、およびドキュメント作成の手順を、それらを必要とする成果物を持つタスクに 組み込みます。分割を行うのは、レビュー担当者があるタスクを合理的に 却下しつつ、隣接するタスクを承認できる場合に限ります。 各タスクは、 独立してテスト可能な成果物で終わる。
一口サイズのタスク粒度
各ステップは1つのアクション(2~5分)です:
- 「失敗するテストを書く」 - ステップ
- 「実行して失敗することを確認する」 - ステップ
- 「テストがパスするように最小限のコードを実装する」 - ステップ
- 「テストを実行し、パスすることを確認する」 - ステップ
- 「コミットする」 - ステップ
計画書のヘッダー
すべての計画は、必ずこのヘッダーから始めなければなりません:
# [機能名] 実装計画
> **エージェント型ワーカー向け:** 必須サブスキル:この計画をタスクごとに実装するには、superpowers:subagent-driven-development(推奨)または superpowers:executing-plans を使用してください。 各ステップは、追跡のためにチェックボックス(`- [ ]`)の構文を使用します。
**目標:** [これが何を構築するかを説明する一文]
**アーキテクチャ:** [アプローチに関する2~3文]
**技術スタック:** [主要な技術/ライブラリ]
## 全体的な制約
[仕様書に記載されたプロジェクト全体の要件 — バージョンの下限、依存関係の制限、
命名規則および記述規則、プラットフォーム要件 — それぞれ1行ずつ、正確な
値を仕様書からそのまま転記してください。すべてのタスクの要件には、暗黙的に
このセクションが含まれます。]
---
タスクの構成
### タスク N: [コンポーネント名]
**ファイル:**
- 作成: `ファイルへの正確なパス/file.py`
- 変更: `既存のファイルへの正確なパス:123-145`
- テスト: `tests/テストファイルへの正確なパス.py`
**インターフェース:**
- 消費対象: [このタスクが先行タスクから使用するもの — 正確なシグネチャ]
- 生成物: [後続のタスクが依存するもの — 正確な関数名、パラメータ
および戻り値の型。タスクの実装者は自身のタスクしか見ることができません。この
ブロックは、隣接するタスクが使用する名前や型を知るためのものです。]
- [ ] **ステップ 1: 失敗するテストを書く**
```python
def test_specific_behavior():
result = function(input)
assert result == expected
```
- [ ] **ステップ 2: テストを実行して失敗することを確認する**
実行: `pytest tests/path/test.py::test_name -v`
期待される結果: 「function not defined」というエラーで FAIL
- [ ] **ステップ 3: 最小限の実装を書く**
```python
def function(input):
return expected
```
- [ ] **ステップ 4: テストを実行して、パスすることを確認する**
実行: `pytest tests/path/test.py::test_name -v`
期待される結果: PASS
- [ ] **ステップ 5: コミット**
```bash
git add tests/path/test.py src/path/file.py
git commit -m "feat: 特定の機能を追加"
```
プレースホルダーは使用しない
各ステップには、エンジニアが実際に必要とする内容を含める必要があります。以下は計画上の失敗例です。決して記述しないでください:
- 「TBD」、「TODO」、「後で実装」、「詳細を記入」
- 「適切なエラー処理を追加する」/「バリデーションを追加する」/「エッジケースを処理する」
- 「上記に対するテストを書く」(実際のテストコードがない場合)
- 「タスクNと同様」(コードの繰り返し — エンジニアはタスクを順番通りに読んでいない可能性がある)
- 何をすべきかを記述しているだけで、その方法を示していない手順(コード手順にはコードブロックが必要です)
- どのタスクでも定義されていない型、関数、またはメソッドへの参照
覚えておいてください
- ファイルパスは常に正確に記述すること
- すべてのステップでコードを完成させる — ステップでコードが変更される場合は、そのコードを表示する
- 正確なコマンドと期待される出力
- DRY、YAGNI、TDD、頻繁なコミット
自己レビュー
完全な計画を作成した後、新鮮な視点で仕様書を見直し、計画と照らし合わせて確認する。これは自分で実行するチェックリストであり、サブエージェントへの割り当てではない。
1. 仕様書の網羅性:仕様書の各セクション/要件をざっと目を通します。それを実装するタスクを特定できますか? 不足している箇所があればリストアップしてください。
2. プレースホルダーの確認:計画書の中から危険信号(上記の「プレースホルダー禁止」のセクションに記載されたパターン)を探します。それらを修正してください。
3. 型の整合性:後続のタスクで使用した型、メソッドのシグネチャ、プロパティ名は、先行するタスクで定義したものと一致していますか?タスク3でclearLayers()という関数が使われているのに、タスク7でclearFullLayers()となっている場合はバグです。
問題が見つかった場合は、その場で修正してください。再レビューの必要はありません。修正して次に進んでください。タスクに対応する仕様要件が見つからない場合は、タスクを追加してください。
実行の引き継ぎ
プランを保存した後、実行の選択肢を提示します:
「計画が完了し、docs/superpowers/plans/ に保存されました。実行オプションは2つあります:
1. サブエージェント駆動型(推奨)- タスクごとに新しいサブエージェントを起動し、タスク間でレビューを行い、迅速な反復開発を実現します
2. インライン実行— executing-plans を使用してこのセッション内でタスクを実行し、チェックポイントを用いたバッチ実行
どちらのアプローチを選択しますか?」
「サブエージェント駆動型」が選択された場合:
- 必須のサブスキル:superpowers:subagent-driven-developmentを使用する
- タスクごとに新しいサブエージェント + 2段階のレビュー
「インライン実行」を選択した場合:
- 必須サブスキル:超能力の使用:計画の実行
- レビュー用のチェックポイントを設けたバッチ実行
---
name: writing-plans
description: Creates detailed, step-by-step implementation plans from specs or requirements, with task decomposition, file structure, and test-driven development instructions.
---
# 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:** If working in an isolated worktree, it should have been created via the `superpowers:using-git-worktrees` skill at execution time.
**Save plans to:** `docs/superpowers/plans/YYYY-MM-DD-<feature-name>.md`
- (User preferences for plan location override this default)
## Scope Check
If the spec covers multiple independent subsystems, it should have been broken into sub-project specs during brainstorming. If it wasn't, suggest breaking this into separate plans — one per subsystem. Each plan should produce working, testable software on its own.
## 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.
## 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:**
```markdown
# [Feature Name] Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers: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]
## 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.]
---
```
## Task Structure
````markdown
### 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
## Remember
- Exact file paths always
- Complete code in every step — if a step changes code, show the code
- Exact commands with expected output
- DRY, YAGNI, TDD, frequent commits
## Self-Review
After writing the complete plan, look at the spec with fresh eyes and check the plan against it. This is a checklist you run yourself — not a subagent dispatch.
**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.
If you find issues, fix them inline. No need to re-review — just fix and move on. If you find a spec requirement with no task, add the task.
## Execution Handoff
After saving the plan, offer execution choice:
**"Plan complete and saved to `docs/superpowers/plans/<filename>.md`. Two execution options:**
**1. Subagent-Driven (recommended)** - I dispatch a fresh subagent per task, review between tasks, fast iteration
**2. Inline Execution** - Execute tasks in this session using executing-plans, batch execution with checkpoints
**Which approach?"**
**If Subagent-Driven chosen:**
- **REQUIRED SUB-SKILL:** Use superpowers:subagent-driven-development
- Fresh subagent per task + two-stage review
**If Inline Execution chosen:**
- **REQUIRED SUB-SKILL:** Use superpowers:executing-plans
- Batch execution with checkpoints for review
すべてのファイル
0件のファイルwriting-plansをインストール
スキルファイルをダウンロードし、.claude/skills/ ディレクトリに解凍してください。
ZIPをダウンロードリポジトリをクローンし、スキルファイルをプロジェクトにコピーしてください。
git clone https://github.com/obra/superpowers/tree/main/skills/writing-plans # Copy SKILL.md to your .claude/skills/ directory
コピー





家
