--- name: openspec-workflow description: Mandatory prerequisite for ALL OpenSpec operations — load this BEFORE any openspec-* skill. Use when running /opsx-apply, /opsx-propose, /opsx-verify, /opsx-archive, /opsx-explore, /opsx-sync; running `openspec status`, `openspec list`, `openspec instructions`; reading files under `openspec/changes/`; or doing any OpenSpec stage (propose, apply, verify, archive, explore, sync). license: MIT compatibility: Requires openspec CLI. metadata: author: Peng Qian version: "1.0" --- ## OpenSpec Workflow (Mandatory) **All code changes must have a proposal before any code gets written.** ### Process 1. **Explore** - When the user says "think about it," "discuss," or "explore," discuss only — no coding. 2. **Propose** - Create proposal files under `openspec/changes//`. 3. **Apply** - Implement according to the proposal tasks. **No file modifications without a proposal.** 4. **Verify** - Verify after implementation is complete. 5. **Archive** - Archive the change. ### Hard Rules - **Bug fixes don't require editing or creating a proposal.** This hard rule only applies to feature changes or new features. - **No proposal, no change:** If the user asks to modify code, confirm that a matching proposal exists first, or create one. - **No proposal, no edits:** Before editing a file, check that a matching change directory exists under `openspec/changes/`. - **No coding in Explore mode:** When the user is in explore mode, **do not** create proposals, **do not** edit files, **do not** write tests. - **After a change is complete:** Run the verify process to check that the implementation matches the proposal. ### Proposal Creation Requirements Every change must include: - `proposal.md` - reason and scope of the change - `design.md` - design plan - `tasks.md` - specific task list - `.openspec.yaml` - change metadata Additional requirements: - **Task granularity:** Each task in `tasks.md` should take no more than 2 hours. ### Violation Handling Stop immediately and alert the user if any of the following are detected: - Code modification starts without a proposal. - Files are edited in explore mode. - Files outside the current proposal's scope are modified.