/gaia-validate-story

user-facing
Category:
Validation
Lifecycle phase:
4 -- Implementation
Arguments:
[story-key]

What it does

/gaia-validate-story performs a full validation of a story file against the codebase and ground truth. It checks that frontmatter fields are complete, acceptance criteria follow the expected format, file references are valid, and dependencies are accurate. The validator runs in an isolated context and records a PASSED, FAILED, or UNVERIFIED verdict.

When to use it

  • You created or edited a story file and want to verify it is complete and accurate before implementation.
  • A story failed review and you want to confirm the fix addressed the validation findings.
  • You want to check whether a story is ready for the ready-for-dev status transition.

Prerequisites

  • A story file must exist at .gaia/artifacts/implementation-artifacts/epic-{epic_key}-{slug}/stories/{story_key}-{slug}.md.

How to invoke

/gaia-validate-story E3-S7

The argument is the story key in E{n}-S{n} format.

What it does step by step

  1. Resolve story file Locates the story file using the story key. Fails if the file is not found or if multiple files match.
  2. Run validation Invokes the validator in an isolated context. The validator checks frontmatter completeness (15 required fields), acceptance criteria format, file path references, dependency accuracy, and structural conformance.
  3. Fix loop (up to 3 attempts) If the validator reports CRITICAL or WARNING findings, the command automatically attempts to fix them (adding missing frontmatter fields, correcting AC format, updating references). After each fix, it re-validates. The loop runs up to 3 attempts.
  4. Record verdict Records the terminal verdict (PASSED, FAILED, or UNVERIFIED) in the story's validation ledger. This verdict is separate from the six Review Gate rows used by review commands.
  5. Report results Displays the verdict and lists any remaining findings.

Inputs

InputSourceDescription
story-keyCommand argumentThe story to validate, in E{n}-S{n} format.
Story file.gaia/artifacts/implementation-artifacts/epic-{epic_key}-{slug}/stories/{story_key}-{slug}.mdThe story file containing frontmatter, acceptance criteria, and subtasks.

Outputs

OutputLocationDescription
Validation verdictStory validation ledgerPASSED, FAILED, or UNVERIFIED recorded for downstream consumers.
Updated story fileStory file pathAuto-fixes applied during the fix loop (if any).

Example session

> /gaia-validate-story E5-S12

Resolving story file...
  Found: .gaia/artifacts/implementation-artifacts/epic-E5-api-layer/stories/E5-S12-pagination.md

Running validation (attempt 1 of 3)...
  2 findings: 1 WARNING (missing depends_on field), 1 INFO.

Applying fix: adding depends_on: [] to frontmatter...
Re-validating (attempt 2 of 3)...
  0 CRITICAL/WARNING findings.

Story E5-S12 validation PASSED.

What to run next

Troubleshooting

"Story file not found"

The story key did not match any file under .gaia/artifacts/implementation-artifacts/. Run /gaia-create-story first.

Verdict is UNVERIFIED

The validator could not complete its run (timeout or unavailable). Try again. If the issue persists, check your project configuration.

Verdict is FAILED after 3 attempts

Some findings could not be auto-fixed. Use /gaia-fix-story to address them manually.