fix: standardize GIVEN scenario guidance#1121
Conversation
📝 WalkthroughWalkthroughThis PR standardizes OpenSpec's scenario step guidance across schemas, templates, examples, and validation messages to consistently use GIVEN/WHEN/THEN format instead of WHEN/THEN-only. The change updates documentation, workflow schemas, code templates, validation messages, and test baselines without breaking existing specs. ChangesScenario Step Standardization
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
GIVENbeforeWHENandTHEN.Scope
This updates framework guidance and generated templates only. It does not add parser enforcement, validation warnings, or rewrite existing specs.
OpenSpec already recognizes
GIVEN,WHEN,THEN, andANDas valid scenario keywords, and that shape aligns with the common Given/When/Then style used in behavior-driven specifications. The current generated guidance mostly shows onlyWHENandTHEN, which can unintentionally steer new specs toward a narrower subset of the scenario language. This PR keeps the guidance non-enforcing, but makes the generated examples show the fuller pattern so preconditions have a clear place when they matter.The intent is to make new generated examples match the existing Given/When/Then convention while preserving compatibility with specs that currently omit
GIVEN.Validation
node bin/openspec.js validate standardize-given-scenario-guidancenpm exec -- changeset status --since=origin/mainnpm run buildnpm run lintnpx vitest run test/core/templates/skill-templates-parity.test.ts test/core/validation.enriched-messages.test.ts test/core/artifact-graph/instruction-loader.test.tsnpm testAI Assistance
Prepared with Codex using GPT-5.5 and manually reviewed/validated with the commands above.