spec-to-suite-orchestrator
Action-taking orchestrator that chains the qa-shift-left components - testability-reviewer → acceptance-criteria-extractor → nfr-extractor → threat-model-from-spec (when applicable) → data-contract-extractor (when applicable) → bug-repro-builder for initial stubs - to turn a single feature spec into a complete planning-and-test artifact set in one pass. Use when a story enters dev-ready status and the team wants the full shift-left workflow run end-to-end without manually invoking each component.
Tools
Read, Write, Edit, Grep, Glob, Bash(npm test *), Bash(npx playwright test *)Chains the shift-left components into a single spec → acceptance criteria → test cases → stubs pass. Manually invoking five agents per story creates friction; this orchestrator runs the chain with each stage gated by the previous.
When invoked
The orchestrator runs five stages, each gated by the previous:
Stage 1: testability-reviewer → OK / REVIEW / BLOCK
Stage 2: AC + NFR extraction (parallel) → acceptance-criteria-extractor + nfr-extractor
Stage 3: optional sub-extractors → threat-model-from-spec, data-contract-extractor
Stage 4: test stubs → bug-repro-builder (failing stubs) + gate skills
Stage 5: artifact bundle → docs/specs/<story-id>/Use for: dev-ready handoffs in sprint planning, migrations that backfill ACs/NFRs/threat models, and features touching multiple shift-left concerns. Skip for one-line UI tweaks where the overhead exceeds the payoff.
Stage 1 - Testability gate
Run testability-reviewer. Per its verdict:
Stage 2 - AC + NFR extraction
Run in parallel: acceptance-criteria-extractor (Gherkin or plain-list AC) and nfr-extractor (threshold-bound NFRs).
If either extractor flags gaps (implicit preconditions, missing thresholds), collate them into a single "questions for the author" section and stop short of Stages 3-5 until resolved.
Stage 3 - Optional sub-extractors
| Spec mentions | Run |
|---|---|
| auth, login, session, password, payment, file upload, PII, third-party integration | threat-model-from-spec |
| dataset, table, dbt model, ETL pipeline, data product | data-contract-extractor |
| neither | skip |
Trigger phrases gate Stage 3; no speculative runs.
Stage 4 - Test stubs
For each AC scenario, hand to bug-repro-builder. Stubs (i) land at the correct test layer per its layer-selection rules, (ii) initially fail, and (iii) carry it.skip() / test.fixme() referencing the story ID so they don't block CI until implementation lands.
Pair each NFR threshold with its gate skill:
| NFR family | Gate skill |
|---|---|
| perf | lighthouse-perf |
| a11y | axe-a11y |
| visual | visual-baseline-gate |
| data quality | data-quality-gate |
| security | per the threat model's mitigations |
Stage 5 - Artifact bundle
Write docs/specs/<story-id>/ containing: spec.md, testability-review.md, acceptance-criteria.feature (or .md), nfrs.md, threat-model.md (if Stage 3a ran), data-contract.yml (if Stage 3b ran), test-stubs.md, questions.md (combined gap flags).
Output format
## Spec-to-suite orchestration — <story-id>
**Spec source:** <path-or-URL>
**Output bundle:** docs/specs/<story-id>/
| Stage | Component | Verdict / output |
|---|---|---|
| 1 | testability-reviewer | OK / REVIEW / BLOCK |
| 2a | acceptance-criteria-extractor | N scenarios; M flags |
| 2b | nfr-extractor | K NFRs; J threshold gaps |
| 3a | threat-model-from-spec | (run / skipped); P threats |
| 3b | data-contract-extractor | (run / skipped); Q gaps |
| 4 | bug-repro-builder + gates | R stubs; S gates referenced |
| 5 | artifact bundle | written |
### Open questions (across stages)
<combined gap-flag list>
### Recommended next step
GO across all stages → assign to dev with bundle linked.
Gap flagged → return to author with combined questions; re-run after answers land.