Skip to main content
SPEC FILE · STAGE 04 · SPEC KIT

plan.md

Spec Kit's HOW: a solution-style design for one feature, with the constitution re-checked before any task is written.

DEFINITION // GEO SNIPPETENTITY EXTRACT

plan.md is Spec Kit's implementation plan for one feature: a solution-style design document - technical context, architecture with Mermaid diagrams, system modules, data model, testing strategy, key decisions - plus Spec Kit's Constitution Check gates and a Complexity Tracking table that justifies any gate a design has to break.

THINK OF IT AS - SOLUTION.MD WITH A PERMIT INSPECTION STAPLED TO IT

It is the same drawing set as solution.md - floor plan, plumbing, wiring - but before the crew starts, the inspector walks it against the building code and signs three boxes: simple enough? no needless abstraction? contracts before internals? Fail a box and you must write down why, and which cheaper option you turned down.

SECTION 01 WHERE & WHEN

Where it lives and when it is written

The Spec Kit workflow writes it in its plan stage to specs/<NNN-feature>/plan.md, after spec.md is approved and against the project-wide constitution in specs/memory/. Where upstream Spec Kit spreads planning across plan.md, research.md, data-model.md, and contracts/, MySpec folds them into one comprehensive plan.md so the reviewer can check it as a whole.

SECTION 02 ANATOMY

The sections

specs/001-photo-albums/plan.md - skeleton ([optional] may be omitted) markdown
# Implementation Plan: [FEATURE]

**Branch**: `001-photo-albums` | **Date**: 2026-06-13 | **Spec**: [./spec.md](./spec.md)

## Summary                     primary requirement + technical approach (1–3 paragraphs)

## Technical Context
**Language/Version**: TypeScript 5.4          **Primary Dependencies**: React Router 7, Hono
**Storage**: PostgreSQL via Drizzle            **Testing**: vitest, playwright
**Target Platform**: Cloudflare Workers        **Project Type**: web-service
**Performance Goals**: p95 < 200 ms            **Constraints**: offline-capable
**Scale/Scope**: 10k users, 50 screens         (unknowns: NEEDS CLARIFICATION: <question>, ≤ 3)

## Constitution Check
*GATE: re-checked after design. Violations require a row in Complexity Tracking.*
- **Simplicity Gate**: pass - one library, no speculative layers
- **Anti-Abstraction Gate**: pass - repositories only where two stores exist
- **Integration-First Gate**: pass - contract tests precede implementation

## High-Level Architecture      description · Mermaid flowchart · sequenceDiagram with 3+ modules
## System Modules               per module: Responsibilities, Key Components, Key Interfaces,
                                Dependencies, Error Handling
## Data Model                   Mermaid erDiagram · entities with fields, validation, state transitions
## API / Protocol Design [optional]
## Security Architecture [optional]
## Deployment & Operations [optional]
## Observability [optional]
## Testing Strategy             validation steps mapped to US## and Acceptance Scenarios in spec.md
## Key Decisions                | Decision | Rationale | Alternatives Considered |
## Complexity Tracking          | Violation | Why Needed | Simpler Alternative Rejected Because |
  • Technical Context - nine fixed fields. An unknown is written as NEEDS CLARIFICATION: <question>, never left blank; at most three across the file.
  • Constitution Check - required even when every gate passes; each gate lists its result and a one-sentence justification.
  • Diagrams - a Mermaid flowchart for the architecture and an erDiagram for the data model are mandatory; a sequenceDiagram joins them when three or more modules interact.
  • Testing Strategy - validation steps are mapped to the user stories and acceptance scenarios in spec.md; the Polish phase of tasks.md runs them.
  • Key Decisions - one row per significant or open technical choice; this replaces standalone research documents.
  • Complexity Tracking - empty unless a gate failed.
SECTION 03 COMPARED

plan.md vs solution.md

Spec Kit plan.mdMySpec solution.md
ScopeOne feature (a numbered directory)The whole bundle / product
ConstitutionExplicit gates re-evaluated per featureImplicit: only approved technology allowed, checked at review
TraceabilityFR-### and user stories US##FR-/NFR- IDs; NFRs become Success Criteria rows
Diagramsflowchart, erDiagram, sequenceflowchart, erDiagram, sequence, C4 Context + Container
HeaderBranch, Date, link to spec.mdNone (no metadata footers either)
SECTION 04 RULES

Review rules

✓ PASSES REVIEW
  • Every FR in spec.md maps to a module or a decision; every success criterion is addressed by the Testing Strategy.
  • Constitution Check present with a result per gate; Complexity Tracking filled only for failures.
  • Scaled to the feature - optional sections omitted rather than padded.
✗ SENT BACK
  • Blank Technical Context fields, or more than three clarification markers.
  • A failed gate with no Complexity Tracking row.
  • Missing architecture or data-model diagram; the whole document wrapped in a code fence.
SPEC FILES FIELD GUIDE

Related spec files

WORKFLOWS MYSPEC · SPEC KIT · OPENSPEC

Workflows that write it

Let the AI Architect write it for you

MySpec interviews you, then drafts every spec file with collect → generate → review gates. Free during Open Beta.