Turn a scoped feature into a plan an engineer can build from without another meeting.
Context
- Feature (already scoped to an MVP): [FEATURE DESCRIPTION]
- Stack and key data model: [STACK AND ENTITIES]
- Constraints (performance, security, deadline): [CONSTRAINTS]
If you can read the codebase, read the relevant modules first and list the files you looked at.
Produce
- Goals, non-goals, and invariants that must always hold (e.g. "an order is charged at most once").
- Components touched and the data flow as a numbered sequence, including state transitions.
- Contracts: routes or function signatures with request/response shapes and error cases; schema changes with column types, indexes, and a reversible migration (in the repo's migrations folder; if there is none, say where schema changes are applied today and put the up/down SQL inline).
- Trust boundaries: where untrusted input enters, who may call what, and where that is enforced.
- Edge cases and failure modes (timeouts, retries, partial writes, concurrent edits, empty and very large inputs), each with its mitigation.
- Test matrix: 5-10 named tests across unit, integration and end-to-end, each with setup, action, and the exact assertion.
- Task breakdown: tasks of 2 hours or less, in order, with the files each touches; mark which can run in parallel.
- Rollout: flag or no flag, the metrics to watch, and the specific signal that triggers a rollback.
Rules
- State assumptions and keep going; do not stall on ambiguity.
- Name the one trade-off most likely to hurt later, and the simplest safe choice.
- No code beyond short signatures and schema snippets.
Output
Markdown with the 8 numbered sections above, then a 5-line summary that can open the PR description.