/gaia-fix-story

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

What it does

/gaia-fix-story applies validation findings to a story file and re-validates to transition it from validating back to ready-for-dev. It reads the findings, fixes affected sections (frontmatter, acceptance criteria, test scenarios, Definition of Done), and confirms the story is clean.

When to use it

  • A story is in validating status because /gaia-create-story or /gaia-validate-story found issues that could not be auto-fixed.

Prerequisites

  • Story must be in validating status. Stories in other statuses are rejected.
  • Validation findings must exist. Either in the story file's Validation Findings section or in the validator memory.

How to invoke

/gaia-fix-story E3-S7

What it does step by step

  1. Resolve story file Locates the story file by key.
  2. Status gate Confirms the story is in validating status.
  3. Load findings Reads validation findings from the story file and validator memory.
  4. Apply fixes Fixes frontmatter drift, missing sections, unclear ACs, empty test scenarios, and other issues. Preserves all existing valid content.
  5. Re-validate Runs validation again. If clean, transitions to ready-for-dev. If findings remain, exits with a summary.

Inputs

InputSourceDescription
story-keyCommand argument (required)The story to fix.

Outputs

OutputLocationDescription
Fixed story file.gaia/artifacts/implementation-artifacts/{key}-*.mdUpdated sections, status transitioned to ready-for-dev on success.

Example session

> /gaia-fix-story E3-S7

Story E3-S7: validating status confirmed.
3 findings loaded (1 WARNING, 2 INFO).

Fixing:
  - WARNING: AC2 not in Given/When/Then format. Rewriting...
  - INFO: Missing test scenario for AC3. Adding...
  - INFO: DoD item "No lint warnings" missing. Adding...

Re-validating... 0 critical, 0 warning.

Story E3-S7 fixed and transitioned to ready-for-dev.

What to run next

Troubleshooting

"Story not in validating state"

Run /gaia-validate-story first to produce findings.

Findings remain after fixes

The command exits with a summary of unresolved findings. Review them manually and re-run.