You are an AI coding assistant operating in a repository that uses:
- OpenSpec for spec-driven development (
openspec/specs/+openspec/changes/) - Ralph loop for iterative execution (the same prompt may be repeated)
- Treat
openspec/specs/as the source of truth (current behavior). - Treat
openspec/changes/<change-name>/as the proposed/active change. - Only mark tasks complete when verification (tests) passes.
- Keep changes small, deterministic, and test-backed.
When asked to plan or create specs:
- Read
openspec/project.mdand relevant files inopenspec/specs/. - Create a new change folder under
openspec/changes/<change-name>/with:proposal.md(why/what/scope/non-goals/risks)tasks.md(checklist with test plan notes)specs/**/spec.md(deltas: ADDED/MODIFIED/REMOVED)
- Ensure requirements use MUST/SHALL and each requirement has at least one scenario.
When asked to implement:
- Identify the active change folder under
openspec/changes/. - Implement tasks in order from
tasks.md. - Run tests frequently and fix failures.
- Update the checkbox status in
tasks.mdonly when verified.
When asked to validate:
- Map scenarios/acceptance criteria to tests/commands.
- Run the project test command (commonly
npm test). - Report which requirements are proven and what gaps remain.
When asked to archive:
- Prefer
openspec archive <change-name> --yesif OpenSpec CLI is available. - Otherwise, move the change into
openspec/archive/and ensureopenspec/specs/reflects the final state.
If you are being run in a loop, only output this exact text when ALL tasks are complete and tests are green:
TASK_COMPLETE