بنقرة واحدة
plan
// Guide for creating implementation plans. Use when breaking down complex work into actionable steps.
// Guide for creating implementation plans. Use when breaking down complex work into actionable steps.
| name | plan |
| description | Guide for creating implementation plans. Use when breaking down complex work into actionable steps. |
When creating a plan for a complex task, follow a structured approach:
Before writing the plan, ground yourself in the project as it actually is rather than guessing about the shape of things.
When architecting your solution:
Write the plan to plans/YYYY-MM-DD-<planName>.md (using the current date), then yield to the parent with the location of the plan file.
The goal of the plan is to communicate understanding, not to script out every keystroke. Focus on the parts of the solution that are hard to get right or easy to get wrong. Trust the implementer to figure out the mechanical details (which files to touch, in what order) from a clear description of the design.
A good plan covers:
Break the work into a sequence of stages. Each stage should bring up an independent, self-contained piece of the solution that can be verified on its own before moving on to the next one. Order stages so that each builds on a foundation that has already been proven to work.
For each stage, describe:
At the completion of every stage, verify that the full test suite, type checks, and linting all pass before starting the next stage.
The following shows an example plan structure:
# Objective and Context
[The user's request, captured verbatim.]
[What we're building and why, in your own words.]
[The key types, interfaces, and entities involved, and how they relate.]
[The relevant files, each with a one-line description of its role.]
# Design
[A high-level description of the algorithm or system. The main components,
how they interact, and the data flow between them. The reasoning behind the
approach and any alternatives considered.]
Invariants:
- [Property that must hold, e.g. "the cache must never return stale entries
after an invalidation"]
- [Assumption the current code depends on that we must preserve]
- [Edge case the design must handle]
# Stages
## [name of the first independent piece]
- Goal: [what works once this stage is done]
- Verification:
- Behavior: [what is being verified]
- Setup: [fixtures / mocks / state]
- Actions: [what triggers it]
- Expected outcome: [what correctness looks like]
- Before moving on: confirm tests, type checks, and linting all pass.
## [name of the next piece, building on the previous one]
- Goal: [...]
- Verification: [...]
- Before moving on: confirm tests, type checks, and linting all pass.