Skip to content
🚧 This documentation is a draft and is currently under review. 🚧

202 Spec Design

202-spec-design writes Gherkin scenarios for a feature. It captures what the system should do in user-visible terms, supports multiple coverage levels (Happy Path Only, Balanced, Comprehensive), and continues existing numbering when a spec file already exists.

Output path: .specflow/features/<fid>-<feature-slug>/specs.feature

  • After 201-high-level-design, when behavior needs to be written before code
  • When you want the feature to be reviewable in user terms before implementation
  • When you need a shared testable description of the expected behavior
  • When adding coverage to an existing spec file
  • Before 201 — scenarios without an agreed scope boundary tend to expand in ways that complicate implementation
  • For a change so small that a plain description in the commit message is sufficient
  • When 301 will synthesize the spec in memory and you do not want a persisted file
  • .specflow/features/<fid>-<feature-slug>/specs.feature with:
    • Numbered TS# scenarios (e.g., TS001, TS002)
    • Grouped into TSM# test modules by logical area
    • Lifecycle tags (@status_pending)
    • Path tags (@happyPath, @errorPath, @edgePath)
LevelWhat it includes
Happy Path OnlyPrimary success flows only — fastest first pass
BalancedHappy paths plus meaningful error and edge cases
ComprehensiveFull scenario coverage including less common paths

Start with Happy Path Only for a fast first pass. Add more coverage in a second pass when the scope is confirmed.

  • Feature name or existing feature artifact path
  • Coverage level: Happy Path Only, Balanced, or Comprehensive

When the feature already has a 201 artifact, 202 should reuse the same .specflow/features/<fid>-<feature-slug>/ folder.

Prompt
Use 202-spec-design for account recovery with happy path coverage only.
Prompt
Use 202-spec-design for invoice approval with balanced coverage.
Prompt
Add comprehensive coverage to the existing invoice approval spec.

203-implementation-design is the optional next step when you want a persisted implementation plan. 204-feature-validation can then review all artifacts together before coding. Otherwise, go directly to 301-spec-implementation.

  • Keep steps user-observable. Avoid implementation details in scenario text.
  • Extend an existing scenario when the extra coverage belongs to the same business outcome, instead of creating a near-duplicate.
  • The goal is not maximum scenario count — the goal is enough coverage to guide implementation and review without creating noise.
  • When updating an existing spec file, continue the existing TS# numbering rather than restarting.
  • Treating scenarios like unit tests instead of user-observable business outcomes
  • Writing every tiny UI action as a separate scenario
  • Asking 202 to invent a new feature definition that should have been resolved in 201
  • Treating 202 as append-only when an existing scenario should just be extended