QA Interrogate Spec
Proactively interrogate requirements, tickets, UI flows, and API contracts across all 10 Failure Mode classes to convert vague specifications into Testable Acceptance Criterion items with multi-layer Test Oracles, surfaced Spec Ambiguity items, and prioritized risks.
Boundary & Language Rules
- In boundary: PRDs, user stories, feature tickets, Figma/UI flows, API contracts, or vague requirements needing interrogation before test planning or coding.
- Out of boundary (hand off neutrally): Pure code/PR review with no spec (
qa-audit-difforqa-audit-codebase), test-layer strategy (qa-plan-tests), orTC-*authoring (qa-design-tests). - Conversational language: Match the user's prompt language (English or Vietnamese) for all questions and explanations.
- Canonical schema & vocabulary: Keep English headings,
GLOSSARY.mdterms, traceability IDs (AC-*,AMB-*,ASM-*,RISK-*),Failure Modenames, and tags (Spec-Only,Code-Assisted,Unverified-in-Spec,[UI/API],[DB/State],[Side-Effects],[ASSUMPTION - NEEDS SIGN-OFF]). Persisted reports followArtifact languageindocs/qa/context.mdwhen set, otherwise defaulting to the prompt language. - Read-only & No Raw Secrets Rule: Never modify application code, databases, or runtime state. Write only
.qa/reports/<slug>-spec-interrogation.mdwhen chaining.qa/reports/<slug>-*checkpoints or explicitly requested. Never read.envfiles or print literal credentials, tokens, or secrets.
Step 1 — Context Load & Mode Detection
- Silent context load (zero-config fallback): Read
GLOSSARY.md,docs/qa/context.md, and referenceddocs/adr/if present. Whendocs/qa/is absent, fall back silently to zero-config.qa/conventions without blocking. - Select interrogation mode automatically:
Spec-Only / UI-OnlyMode: Selected when no repository exists or the input is pure spec/UI documentation without matching codebase targets. Never fabricate hidden implementation facts. Mark code-dependent unknowns (Implicit Business Rule,Cross-Module Side Effect,Migration & Compatibility Defect) asUnverified-in-Spec(for example,Unverified-in-Spec (needs dev/code check)) paired with concrete PM/Dev verification questions.Code-AssistedMode: Selected when a repository is accessible and the spec names routes, endpoints, schemas, migrations, or domain entities. Run targeted read-only lookups only on those named routes, schemas, validation guards, and entities to surface Spec-vs-Code drift and activeImplicit Business Rules.
- Escalation boundary in
Code-Assistedmode: Inspect only targets named in the spec. If those targets sit inside undocumented or tangled legacy code requiring deep reverse-engineering, flagDeep Codebase Forensics Recommendedand recommendqa-audit-codebaseif installed (or run a minimal read-only check on the named entry points and persistence sites whenqa-audit-codebaseis absent).
Completion criterion: Context files checked, mode (Spec-Only / UI-Only or Code-Assisted) locked, and any Spec-vs-Code drift or escalation flag recorded.
Step 2 — Conditional Round 0 Framing Pass
Check whether the input is a one-liner or severely underspecified (missing primary actor, trigger, core success outcome, or primary failure boundary):
- If sufficiently framed, skip Round 0 and proceed directly to Step 3.
- If severely underspecified, run a Round 0 Framing Pass of 3 to 5 foundational questions (actor/permissions, trigger/entry point, success outcome, failure/rollback boundary, target non-goals) before running the full 10-class sweep. Consult Section 1 of references/failure-mode-probes.md for framing templates.
- In Batch / Pipeline Mode, record the 3 to 5 framing questions with proposed defaults marked
[ASSUMPTION - NEEDS SIGN-OFF](usestatus: blockedonly when no domain target can be inferred at all).
Completion criterion: Either framing is already sufficient, or 3–5 Round 0 foundational questions are resolved or captured as [ASSUMPTION - NEEDS SIGN-OFF].
Step 3 — 10-Class Failure Mode Interrogation (Adaptive Two-Mode)
Sweep the requirement across every item in the 10-Class Failure Mode Spec-Lens Checklist below. Load references/failure-mode-probes.md for deep probing heuristics, stack-agnostic code-lookup cues, and edge-case examples whenever a class needs deeper interrogation.
10-Class Failure Mode Spec-Lens Checklist
Spec Ambiguity: Missing actor, trigger, units/timezone/rounding, sorting/empty state, failure copy, or contradicting clauses preventing a clearTest Oracle.Implicit Business Rule: Unstated domain invariants, quotas, retention/cutoff windows, or existing system constraints (Unverified-in-SpecinSpec-Only; verified via targeted lookup inCode-Assisted).Boundary & Input Validation Defect: Unspecified min/max lengths, numeric precision, empty/null/whitespace handling, Unicode/special characters, file size/MIME limits, or pagination limits.Broken State Transition: Missing allowed/forbidden transition matrix, retry/cancel/expiry paths, or partial-failure rollback state.Cross-Module Side Effect: Unspecified effects on notifications, caches, audit logs, billing/inventory ledgers, search indexes, or downstream webhooks.Contract / Integration Drift: Missing UI–API payload/failure shape, HTTP status mapping, nullable vs omitted fields, or third-party timeout/fallback behavior.Concurrency Defect: Unspecified double-submit/idempotency behavior, stale-read or optimistic/pessimistic locking, or parallel worker ordering.Auth & Permission Leak: Missing role matrix, tenant/ownership boundary (IDOR), unauthenticated fallback (401/403/404), or sensitive data leakage in payloads/logs.Migration & Compatibility Defect: Unspecified handling of existing/dirty records, feature-flag off/on skew, or backward compatibility with older clients.Silent Failure: Unspecified behavior when background jobs, third-party calls, or persistence steps fail mid-flow (must require explicit failure signaling, retry, or compensation—never false HTTP 200).
Execution Modes
- Interactive Frontier Grilling (Default): Present only unblocked questions at the current dependency frontier with numbered IDs (
Q1..Qn) and a concrete recommended default prefixed with➡️. Wait for user answers to expand the next frontier round until ambiguities are resolved or the user explicitly freezes remaining items as[ASSUMPTION]. - Batch / Pipeline Mode (Explicit unattended or async audit): Execute a single-pass 10-class sweep without blocking for interactive turns. Assign every
Spec Ambiguitya concrete Proposed Default tagged[ASSUMPTION - NEEDS SIGN-OFF]so downstream planning never stalls.
Completion criterion: All 10 Failure Mode classes explicitly evaluated, with every open question tagged Q1..Qn + ➡️ default (Interactive) or [ASSUMPTION - NEEDS SIGN-OFF] (Batch), and code-dependent unknowns in Spec-Only marked Unverified-in-Spec.
Step 4 — Traceability IDs & Multi-Layer Test Oracles
Convert resolved behaviors and accepted/proposed defaults into structured traceability records:
- Preserve upstream IDs when present (
FR-12,US-4.2) alongside stable interrogation IDs:AC-01..N(Testable Acceptance Criterion)AMB-01..N(Spec Ambiguity)ASM-01..N([ASSUMPTION]/[ASSUMPTION - NEEDS SIGN-OFF])RISK-01..N(Failure Moderisk)
- Require multi-layer
Test Oracles on everyAC-*:[UI/API]: Status code, response payload, failure message, or rendered UI state.[DB/State]: Persisted record state, status transition, lock/version counter, or queue/cache state.[Side-Effects]: Expected audit logs, notifications, ledger entries, webhooks, or explicit absence of unintended cross-module mutations.
Completion criterion: Every requirement and resolved default maps to a numbered AC-*, AMB-*, ASM-*, or RISK-*, and every AC-* specifies Trigger, Input/Constraints, and all 3 Test Oracle layers ([UI/API], [DB/State], [Side-Effects]).
Step 5 — Emit 5-Section Report & Optional Checkpoint
Load references/report-template.md before formatting the final output:
- Chat-first delivery: Present the complete 5-section spec interrogation report in chat (
1. Context & Mode,2. Spec Ambiguity & Open Questions,3. Testable Acceptance Criteria & Multi-Layer Test Oracles,4. 10-Class Failure Mode Checklist,5. Handoff Notes). - Checkpoint persistence (
.qa/reports/<slug>-spec-interrogation.md): When chaining.qa/reports/<slug>-*checkpoints across sessions or explicitly requested by the user, write the file using a kebab-case<slug>(^[a-z0-9-]+$) with:- Standardized checkpoint YAML frontmatter (
skill,stage: spec-interrogation,status,target,slug,date,artifact_language,confidence,upstream_refs,skipped_stages). - Compact
## Handoff Summary(<= 25lines) immediately after frontmatter. - All 5 canonical report sections, with zero raw secrets.
- Standardized checkpoint YAML frontmatter (
- Neutral handoff guidance: Point to
qa-audit-codebase(whenDeep Codebase Forensics Recommended),qa-audit-diff(when a PR/diff is present), orqa-plan-tests(when ready for test-layer planning) if installed; otherwise advise mappingAC-*,RISK-*, andASM-*directly to test layers andTC-*suites.
Completion criterion: All 5 report sections (and checkpoint YAML frontmatter + <= 25-line ## Handoff Summary when saving .qa/reports/<slug>-spec-interrogation.md) emitted cleanly with consistent IDs and zero raw secrets.