--- name: openspec-execute description: Scope guardrail and deviation classifier consulted during /gsd-execute-phase when a phase has a linked OpenSpec change. Not an executor itself — GSD's own executor subagents write the code; this skill only classifies what to do when an executor's discovery doesn't match the locked spec. allowed-tools: Read license: MIT metadata: author: openspec-gsd-integration version: "0.1.0" --- ## Purpose Give GSD's executor subagents (and the human reviewing `SUMMARY.md`) a fixed, shared vocabulary for "the spec and the reality on the ground disagree" — so a deviation gets classified and routed, never silently reinterpreted mid-execution. ## Invocation conditions - Consulted by an executor (or the user) whenever implementation reveals a mismatch with `openspec/changes//specs/` or `design.md`. - Not wired to a loop extension point — execution-time guardrails are advisory text an executor reads, not a step this integration forces (the phase loop's `execute:pre/wave:pre/wave:post/post` points are reserved for GSD's own executor/verifier roles; this capability does not inject at those points to avoid interfering with wave dispatch). ## Required inputs - The specific mismatch encountered (freeform). - `.planning/phases/-/-OPENSPEC-LINK.md` for the change/requirement IDs in scope. ## Files read - `openspec/changes//specs/**/spec.md`, `design.md` - The current `PLAN.md` and any `--SUMMARY.md` already written this phase ## Files this skill may write - None. This is a classification aid, not a writer — the executor itself records the classification in its own `SUMMARY.md` (a field GSD's native summary template already supports for deviations). ## Algorithm — classification table | Situation | Classification | Correct next action | |---|---|---| | A requirement's wording admits two readings, and the difference matters for implementation | `SPEC_AMBIGUITY` | Stop, ask the user (or the discussing agent on the next session) to disambiguate; do not guess and proceed. | | The spec says one thing, `design.md` says another, and both can't be true | `SPEC_CONFLICT` | Stop; this is an OpenSpec-internal inconsistency — route to `/opsx:update ` to reconcile, not a code fix. | | The design is internally consistent but doesn't fit the actual codebase (e.g. assumes an API that doesn't exist) | `DESIGN_CONFLICT` | Stop; route to `/opsx:update ` for `design.md`, or a new change if the fix is itself a real design decision. | | A dependency, permission, or external system blocks the task regardless of what the spec says | `IMPLEMENTATION_BLOCKER` | Record in `SUMMARY.md`, use GSD's own blocker mechanism (`gsd-tools state add-blocker`) — not an OpenSpec concern. | | The executor finds work worth doing that no requirement asked for | `OUT_OF_SCOPE_DISCOVERY` | Do **not** implement it under this phase. Record it (GSD's own ``/todo capture, or a note for a future `/opsx:propose`) and continue only the in-scope work. | ## Outputs One classification tag per mismatch, surfaced in the executor's own `SUMMARY.md` deviations section (no new file format — reuses GSD's existing summary structure). ## Failure states None of its own — every classification above already names its correct escalation path; there is no "unclassified" exit. ## Guardrails - Never lets an executor silently reinterpret a requirement to make the easiest implementation "technically" satisfy it. - Never lets `OUT_OF_SCOPE_DISCOVERY` work get implemented under the current phase's commits — scope creep here is exactly what `openspec-verify`'s Level 4 (design compliance) is built to catch, so it must not happen upstream of it. ## Idempotency N/A — advisory classification, no persisted state of its own. ## Example ``` Executor: The spec says "the endpoint SHALL return 200 for a healthy dependency" but design.md says "return 204 with no body." Which one? [openspec-execute] SPEC_CONFLICT — stop, do not guess. Route to `/opsx:update add-health-check-endpoint`. ```