From d5049f321d9bcdbcce0cbd23e6f7a308e113e50e Mon Sep 17 00:00:00 2001 From: Sylvain Gougouzian Date: Tue, 14 Jul 2026 09:20:23 +0200 Subject: [PATCH] :bug: fix(openspec): forbid code generation in pre-apply steps The discuss step already guarded against artifacts, but proposal, design, specs and tasks lacked an equivalent guard, so the model could generate implementation code during spec authoring. Add an explicit prohibition to each pre-apply step; apply stays the only step that implements. --- src/services/openspec-hook.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/services/openspec-hook.ts b/src/services/openspec-hook.ts index 82441f6..ca46722 100644 --- a/src/services/openspec-hook.ts +++ b/src/services/openspec-hook.ts @@ -26,13 +26,13 @@ const STEP_GUIDANCE: Record = { discuss: "Free-form discussion. Explore the problem space with the user — constraints, tradeoffs, prior art, edge cases. Do NOT create any OpenSpec artifacts or run any openspec commands yet.", proposal: - "Create an OpenSpec change: run `openspec new change `, then write its `proposal.md` (Why / What Changes / Impact).", + "Create an OpenSpec change: run `openspec new change `, then write its `proposal.md` (Why / What Changes / Impact). Only write the proposal spec — do NOT write, edit, or generate any implementation/source code. Implementation happens later, in the apply step.", design: - "Write the technical design in the change's `design.md`: architecture, data model, API, integration points, alternatives considered.", + "Write the technical design in the change's `design.md`: architecture, data model, API, integration points, alternatives considered. Only write the design doc — do NOT write, edit, or generate any implementation/source code. Implementation happens later, in the apply step.", specs: - "Write the spec deltas under the change's `specs//spec.md` — the requirements this change adds or modifies. Run `openspec validate ` to check them.", + "Write the spec deltas under the change's `specs//spec.md` — the requirements this change adds or modifies. Run `openspec validate ` to check them. Only write the spec — do NOT write, edit, or generate any implementation/source code. Implementation happens later, in the apply step.", tasks: - "Break the change into an ordered checklist in its `tasks.md` (`- [ ]` items, grouped, parallelizable work flagged).", + "Break the change into an ordered checklist in its `tasks.md` (`- [ ]` items, grouped, parallelizable work flagged). Only write the task list — do NOT write, edit, or generate any implementation/source code. Implementation happens later, in the apply step.", apply: "Implement the tasks from the change's `tasks.md`, checking them off (`- [x]`) as you complete them. Validate with `openspec validate `.", archive: -- 2.51.2