Skip to content
Development
Skill

/gate-spec

Maps every acceptance criterion from the spec to implementation evidence and test evidence. Criteria without evidence fail. The ultimate quality gate. Internal — invoked by verify.

From plugin
specwright
1023 skills9 agents18 commands

Claude Code

$ npx -y skills add Obsidian-Owl/specwright --skill gate-spec --agent claude-code

SKILL.md

gate-spec.SKILL.md
name: gate-spec
description: >-
  Maps every acceptance criterion from the spec to implementation evidence
  and test evidence. Criteria without evidence fail. The ultimate quality
  gate. Internal — invoked by verify.
allowed-tools:
  - Read
  - Bash
  - Glob
  - Grep
  - Write
  - Task

Gate: Spec Compliance

Goal

Prove that the implementation actually does what was asked for. Every acceptance criterion in the spec must map to implementation evidence (file:line) and test evidence (test name at file:line). This is the gate that closes the loop.

Inputs

  • `{workDir}/spec.md` -- acceptance criteria
  • `{repoStateRoot}/work/{selectedWork.id}/workflow.json` -- selected work unit
  • The codebase (implementation and tests)

Outputs

  • Evidence file at `{workDir}/evidence/spec-compliance.md`
  • Compliance matrix: each criterion → implementation ref + test ref + status
  • Gate status in the selected work's `workflow.json`
  • The compliance matrix remains the canonical AC / IC proof surface that

downstream `review-packet.md` synthesis summarizes or references

Constraints

**Criteria extraction (LOW freedom):**

  • Parse spec.md for all acceptance criteria (lines matching `- [ ] AC-*`).
  • Number them. Every single one must be mapped. No skipping.
  • On the final work unit of a multi-WU design: also parse behavioral integration

criteria (IC-B{n} entries) from `integration-criteria.md` in the design-level directory. IC-B entries are added to the compliance matrix alongside ACs. When not on the final work unit, when `integration-criteria.md` does not exist, or when `integration-criteria.md` has no IC-B entries, gate-spec operates exactly as before — no behavioral IC mapping.

**Evidence mapping (HIGH freedom):**

  • For each criterion, search the codebase for implementation evidence.
  • For each criterion, search test files for test evidence.
  • Delegate to `specwright-reviewer` for thorough analysis if needed.
  • For behavioral criteria (execution-path claims, not structural checks), trace

premises from the spec and code, derive claims from those premises, and draw conclusions without adding uncited evidence.

  • Evidence must be specific: file path and line number, not "somewhere in src/".

**Verdict (LOW freedom):**

  • Follow `protocols/evidence.md#verdict-rendering`.
  • Criterion with both implementation AND test evidence = PASS.
  • Criterion with implementation but no test = WARN.
  • Criterion with neither = FAIL.
  • Overall: if ANY criterion is FAIL, gate is FAIL.
  • IC-B entries (when present): IC-B with both implementation and test evidence = PASS.

IC-B without test evidence = FAIL (gate-spec's standard verdict vocabulary). Note: gate-spec FAIL for IC-Bs and deliverable verification BLOCK for IC-Bs are complementary — gate-spec reports the finding within its standard framework, deliverable verification enforces the action. gate-spec runs first (as part of the 6 standard gates); deliverable verification runs after all gates.

  • Reference discovered behaviors at INFO level per `protocols/build-quality.md`. Does not alter PASS/WARN/FAIL verdict.

**Compliance matrix format:**

| # | Criterion | Implementation | Test | Status |
|---|-----------|---------------|------|--------|
| AC-1 | Description | file:line | test_name at file:line | PASS |

**Matrix stability (LOW freedom):** Preserve the five-column compliance matrix shape above. `sw-verify` may digest or quote it in `review-packet.md`, but gate-spec remains the canonical proof surface for AC / IC conformance.

Protocol References

  • `protocols/evidence.md#verdict-rendering` -- verdict rendering and self-critique
  • `protocols/evidence.md` -- evidence storage
  • `protocols/state.md` -- gate status updates
  • `protocols/delegation.md` -- reviewer agent delegation

Failure Modes

| Condition | Action | |-----------|--------| | No spec.md found | Gate ERROR: "No spec found for this work unit" | | No acceptance criteria in spec | Gate ERROR: "Spec has no acceptance criteria" | | Implementation exists but tests don't | WARN per criterion, gate WARN overall | | Can't determine mapping with confidence | FAIL the criterion. Don't guess. |

Read more
@obsidian-owl
Ships withspecwright

Craft quality software with AI discipline. Spec-driven development plugin for Claude Code and Opencode — quality gates, adversarial testing, and evidence capture.

1023 skills9 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
10
Star history of Obsidian-Owl/specwright on GitHub, a chart by star-history.com

Other skills on specwright.

gate-build

gate-build

Runs configured build and test commands in tiered order. Captures output as evidence per tier. Returns PASS, FAIL, WARN, or SKIP…

gate-security

gate-security

Detects leaked secrets, injection patterns, and sensitive data exposure across changed files. Uses real tooling when configured,…

gate-semantic

gate-semantic

Tiered semantic analysis of changed code (rg → ast-grep → OpenGrep). Detects error-path bugs structural gates miss. Findings…

gate-tests

gate-tests

Audits test quality — assertion strength, boundary coverage, mock discipline, error path testing. Delegates to the tester agent…

gate-wiring

gate-wiring

Detects unused exports, orphaned files, architecture layer violations, and circular dependencies across changed files. Delegates…

sw-adopt

sw-adopt

Explicitly adopt an existing work into the current worktree after validating live ownership, stale sessions, and branch…

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills10d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about gate-spec.

Which coding agents can use gate-spec?
gate-spec installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.