Add prototype/openapi/validate/resume commands, wire edge-failure matrix into UX, enforce traceability + validation gates, mandate C4/C5 belief-runtime verification. Rework 038-dashboard-scenario-model artifacts: applicability, structured edge cases, 24-class UX state matrix, interactive HTML prototype, standardized OpenAPI 3.1 (7 ops), full RTM with coverage gate, 56-task backlog, and PASS validation report.
13 KiB
User Input
$ARGUMENTS
You MUST consider the user input before proceeding (if not empty).
Required Skills
MANDATORY USE skill({name="semantics-core"}), skill({name="semantics-contracts"}).
Operating Constraints
STRICTLY READ-ONLY: This command MUST NOT modify any feature artifact EXCEPT specs/<feature>/validation.md. It reads everything, validates everything, and reports — but does not implement, fix, or rewrite. The ONLY write is the validation report itself.
Gate Behavior: If any blocking finding is discovered, the report MUST say BLOCKED and /speckit.implement MUST refuse to proceed until the finding is resolved.
Outline
Phase 0: Pre-Flight
- Setup: Run
.specify/scripts/bash/check-prerequisites.sh --json --require-tasks --include-tasksfrom repo root. ParseFEATURE_DIR,FEATURE_SPEC,IMPL_PLAN,TASKS. - Verify all prerequisite artifacts exist:
FEATURE_DIR/spec.mdFEATURE_DIR/plan.mdFEATURE_DIR/tasks.mdFEATURE_DIR/contracts/modules.md(when plan references contracts)FEATURE_DIR/data-model.md(when plan references data model)FEATURE_DIR/research.md(when plan references research)
- Capture input provenance before validation: For every artifact in the validation scope, record its repository-relative path, byte size, modification timestamp, and SHA-256 digest. At minimum include
spec.md,plan.md,tasks.md,traceability.md,contracts/modules.md,contracts/openapi.yaml,ux_reference.md,contracts/ux/**, andprototype/manifest.mdwhen present. These values define the exact snapshot covered by the verdict. - Load context (progressive disclosure — only load sections needed for each check):
- All feature artifacts
.specify/memory/constitution.mddocs/adr/*.md— all ADRs (for decision-memory checks).opencode/skills/semantics-core/SKILL.md— §VIII Attention Architecturebackend/src/andfrontend/src/— current codebase state (for path validation)
Phase 1: Unresolved Marker Scan
Scan ALL feature artifacts for any of the following blocking markers:
| Marker | Pattern | Severity | Action |
|---|---|---|---|
[NEEDS CLARIFICATION] |
spec.md | BLOCKING | Must be resolved in /speckit.clarify before implementation |
[NEED_CONTEXT: *] |
contracts/modules.md | BLOCKING | Blind dependency — must be resolved before contracts are implementable |
TODO (in spec/plan) |
spec.md, plan.md | WARNING | Review — may indicate incomplete design |
TKTK |
any artifact | BLOCKING | Placeholder — must be filled |
??? |
any artifact | WARNING | Ambiguity — review |
<placeholder> / TBD / TBC |
any artifact | WARNING | Review |
[NEEDS CLARIFICATION: ...] |
any artifact | BLOCKING | Unresolved from spec |
Report: count of each marker type, file locations, severity.
Phase 2: Artifact Completeness
Verify every expected artifact is present and non-empty:
| Artifact | Required? | Check |
|---|---|---|
spec.md |
ALWAYS | Has ## User Scenarios, ## Requirements, ## Success Criteria |
ux_reference.md |
ALWAYS | Has personae, narrative, error experience |
plan.md |
ALWAYS | Has ## Summary, ## Technical Context, ## Constitution Check, ## Project Structure |
tasks.md |
ALWAYS | Has phases, task IDs, file paths |
contracts/modules.md |
When plan references contracts | Has #region contracts, @RELATION edges |
data-model.md |
When plan references data model | Has entity definitions, schemas |
research.md |
When plan references research | Has decisions, rationale, alternatives |
traceability.md |
When plan declares RTM | Has Story → Model → API → Task → Test matrix |
quickstart.md |
When plan references quickstart | Has verification commands |
contracts/ux/ |
When UI surface | Has UX contracts from /speckit.ux |
prototype/index.html |
When /speckit.prototype was run |
Has interactive prototype |
contracts/openapi.yaml |
When /speckit.openapi was run |
Has valid OpenAPI 3.1 spec |
fixtures/manifest.md |
When plan generated fixtures | Has fixture index |
Phase 3: Schema & Contract Validation
-
OpenAPI validation (if
contracts/openapi.yamlexists):- YAML parseability (Python
yaml.safe_load) operationIduniqueness$reftarget existence- Required keys:
openapi,info,paths,components - Example coverage for all response classes
- YAML parseability (Python
-
Contract validation (via Axiom MCP):
- Run
axiom_search({operation="status"})— confirm index is FRESH - Run
axiom_audit({operation="audit_contracts"})— check for invalid tiers, missing metadata, unresolved relations - Run
axiom_search({operation="workspace_health"})— check for orphan/unresolved metrics - If Axiom MCP is unavailable, fall back to manual
grepchecks:# Find all #region contracts in plan's contract files grep -rn "#region" specs/<feature>/contracts/ # Check every #region has a matching #endregion
- Run
-
ATTN rules compliance (for
contracts/modules.md):- ATTN_1: Every
#regionanchor packs[C:N] [TYPE] [SEMANTICS]on ONE line - ATTN_2: Contract IDs are hierarchical (
Domain.Sub.Name), not flat - ATTN_3: Same-domain contracts share primary
@SEMANTICSkeyword - ATTN_4: No contract exceeds 150 lines, no module exceeds 400 lines
- ATTN_1: Every
Phase 4: Reference & ADR Integrity
-
ADR continuity check:
- Every
@REJECTEDpath in any ADR → verify NO task intasks.mdschedules that path - Every architectural decision in
plan.md→ verify it aligns with the governing ADR (or carries<ESCALATION>) - Every
@RATIONALEincontracts/modules.md→ verify it is consistent with upstream ADR rationale
- Every
-
Cross-reference integrity:
- Every file path in
tasks.md→ verify parent directory exists inbackend/src/orfrontend/src/ - Every
@RELATION -> [TargetId]in contracts → verify TargetId exists incontracts/modules.mdor is a known existing contract - Every
$refinopenapi.yaml→ verify target exists in the same file - Every
operationIdinopenapi.yaml→ verify it appears intraceability.md(if RTM exists)
- Every file path in
Phase 5: Decision-Memory Continuity
Verify the three-layer chain is intact:
Global ADR → plan/research → contracts → preventive tasks → tests
For each @REJECTED path at any layer:
- ADR layer:
@REJECTEDexists→downstream layer must NOT schedule it - Plan layer:
@RATIONALEjustification exists→contracts must propagate it - Contract layer:
@REJECTEDguardrail exists→at least one task must verify the rejection holds - Task layer:
@RATIONALE/@REJECTEDinline→must trace to a contract or ADR
Findings:
- Dangling rationale (downstream missing): WARNING
- Contradictory resurrection (rejected path scheduled): BLOCKING
- Missing guardrail (ADR rejection, no task verification): WARNING
- Unjustified workaround (local
@RATIONALEwithout upstream source): WARNING
Phase 6: Task Dependency & Path Validation
-
Task dependency graph:
- Phase 1 (Setup) tasks exist before Phase 2 (Foundational)
- Foundational tasks marked before any User Story phase
- No cross-story dependency that blocks independent verification
- Circular dependency check: if T001 depends on T002 and T002 depends on T001 → BLOCKING
-
Path validation:
- Every task with a file path → path starts with
backend/src/,frontend/src/,specs/,docs/, orbackend/tests/,frontend/src/lib/**/__tests__/ - No task path references
.kilo/,.ai/,.kilocode/ - No task path references Rust/MCP (
.rs,cargo,src/server/) - Every task file path is syntactically valid (no unmatched braces, no absolute
/paths outside repo)
- Every task with a file path → path starts with
Phase 7: UX State Coverage
If the feature has a UI surface (UX contracts or ux_reference.md exists):
-
State matrix coverage: Verify every state class from the edge/failure matrix (speckit.ux.md Phase 2) is accounted for:
- Each screen's UX contract declares the applicable states
- No state class was skipped without explicit rationale
- Every error state has a
@UX_RECOVERYpath
-
Prototype coverage (if
prototype/index.htmlexists):- Every
@UX_STATEin contracts → represented in prototype state switcher - Every
@UX_RECOVERYpath → traversable in prototype
- Every
-
UX test coverage:
- Every
@UX_STATEdeclared → at least one@UX_TESTscenario - Every error state → at least one
@UX_TESTscenario with recovery path - Test ownership (L1/L2) assigned from matrix
- Every
Phase 8: Axiom Health Check
Run Axiom MCP diagnostics:
axiom_search({operation="status"})— index health: FRESH / STALE / ERRORaxiom_search({operation="workspace_health"})— orphan count, unresolved relations, complexity distributionaxiom_audit({operation="audit_belief_protocol"})— C4/C5 contracts missing@RATIONALE/@REJECTED
Interpretation:
- Index STALE: WARNING — recent changes may not be indexed
- High orphan count (>10%): WARNING — structural drift
- Unresolved relations: BLOCKING if the unresolved target is in this feature's scope
- Missing belief protocol tags: WARNING — will block C4/C5 implementation
Phase 9: Produce Validation Report
Write specs/<feature>/validation.md:
#region Std.Opencode.ValidationReport [C:3] [TYPE ADR] [SEMANTICS validation,gate,[DOMAIN]]
@defgroup Validation Pre-implementation validation gate for [FEATURE].
## Status: [PASS / BLOCKED]
**Date**: [DATE]
**Feature**: [feature name]
**Branch**: [branch]
## Validated Inputs
| Artifact | Size (bytes) | Modified (UTC) | SHA-256 |
|----------|-------------:|----------------|---------|
| spec.md | [size] | [timestamp] | `[digest]` |
| plan.md | [size] | [timestamp] | `[digest]` |
| tasks.md | [size] | [timestamp] | `[digest]` |
| ... applicable artifacts ... | | | |
The verdict is stale and MUST NOT authorize implementation when any listed artifact is missing or its current digest differs. New applicable artifacts created after this report also make the verdict stale.
## Blocking Findings
> If BLOCKED, these MUST be resolved before `/speckit.implement`.
| ID | Check | Severity | Location | Finding |
|----|-------|:--------:|----------|---------|
| B01 | Unresolved Marker | BLOCKING | spec.md:L42 | [NEEDS CLARIFICATION: auth mechanism] |
| B02 | ADR Resurrection | BLOCKING | tasks.md:T017 | Task schedules `@REJECTED` path from ADR-0007 |
*If no blocking findings:* "✅ No blocking findings. Proceed to `/speckit.implement`."
## Warning Findings
| ID | Check | Severity | Location | Finding |
|----|-------|:--------:|----------|---------|
| W01 | Missing Guardrail | WARNING | contracts/modules.md:Api.Export | ADR-0004 @REJECTED path has no verification task |
| W02 | Dangling Rationale | WARNING | plan.md:§Decisions | @RATIONALE exists but no contract propagates it |
## Check Results
### Phase 1: Unresolved Markers
- [NEEDS CLARIFICATION]: N
- [NEED_CONTEXT]: N
- TODO/TKTK/???: N
- **Status**: ✅ PASS / ❌ BLOCKED
### Phase 2: Artifact Completeness
| Artifact | Expected | Present | Status |
|----------|:--------:|:-------:|:------:|
| spec.md | required | ✅ | PASS |
| plan.md | required | ✅ | PASS |
| tasks.md | required | ✅ | PASS |
| traceability.md | required | ✅ | PASS |
| ... | | | |
### Phase 3: Schema & Contract Validation
- YAML parse: ✅ / ❌
- operationId uniqueness: ✅ / ❌
- Contract audit: N warnings, N errors
- ATTN rules: N/N contracts pass
### Phase 4: Reference & ADR Integrity
- ADR continuity: N ADRs checked, N issues
- Cross-reference integrity: N $refs/resolved, N broken
### Phase 5: Decision-Memory Continuity
- Three-layer chain: N chains checked
- Dangling rationale: N
- Contradictory resurrection: N
- Missing guardrail: N
### Phase 6: Task Dependency & Path
- Task count: N
- Invalid paths: N
- Circular dependencies: N
### Phase 7: UX State Coverage
- State matrix coverage: N/N state classes evaluated
- Prototype coverage: N/N @UX_STATEs represented
- UX test coverage: N/N states have tests
### Phase 8: Axiom Health
- Index status: FRESH / STALE
- Orphans: N
- Unresolved relations: N
## Gate Decision
**Verdict**: ✅ PASS — `/speckit.implement` may proceed.
OR
**Verdict**: ❌ BLOCKED — resolve N blocking findings before implementation.
## Resolution Instructions
If BLOCKED:
- B01: Run `/speckit.clarify` to resolve [NEEDS CLARIFICATION] markers.
- B02: Remove or re-scope T017 to avoid the rejected path, or file `<ESCALATION>` to ADR-0007.
- ...
#endregion Std.Opencode.ValidationReport
Phase 10: Report
Report:
- Validation report path:
specs/<feature>/validation.md - Status: PASS or BLOCKED
- Blocking findings: N
- Warning findings: N
- Checks executed: 8 phases, N individual checks
- If PASS: "Ready for
/speckit.implement" - If BLOCKED: "Resolve N blocking findings, re-run
/speckit.validate"