fix: make dev-story RED phase ATDD-aware to activate pre-existing tests

When TEA's ATDD workflow creates test files with test.fixme() before
dev-story runs, the RED phase had no awareness of these pre-existing
tests. It instructed the agent to write new failing tests from scratch,
leaving all ATDD tests permanently skipped.

This change adds a conditional to the RED phase: if test.fixme() or
test.skip() tests exist for the current task, activate them instead of
writing new tests. Falls back to the original behavior when no
pre-existing tests are found. Also adds a DoD validation gate to ensure
no test.fixme() calls remain after story completion.
This commit is contained in:
Nikolas de Hor 2026-03-11 21:34:34 -03:00
parent 32693f1a6b
commit 5bd1e8a12b
1 changed files with 12 additions and 3 deletions

View File

@ -273,9 +273,17 @@ Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve:
<action>Review the current task/subtask from the story file - this is your authoritative implementation guide</action> <action>Review the current task/subtask from the story file - this is your authoritative implementation guide</action>
<action>Plan implementation following red-green-refactor cycle</action> <action>Plan implementation following red-green-refactor cycle</action>
<!-- RED PHASE --> <!-- RED PHASE (ATDD-aware) -->
<action>Write FAILING tests first for the task/subtask functionality</action> <check if="test files with test.fixme() or test.skip() exist for this story (check story Dev Notes for ATDD test file paths, or search project test directories for files referencing this story's acceptance criteria)">
<action>Confirm tests fail before implementation - this validates test correctness</action> <action>Identify test files containing test.fixme() or test.skip() that map to the current task/subtask</action>
<action>Convert matching test.fixme()/test.skip() calls to regular test() calls to activate them</action>
<action>Run activated tests to confirm they FAIL due to missing implementation (RED phase verified)</action>
<action>If a test passes unexpectedly before implementation, investigate — it may not be validating real behavior</action>
</check>
<check if="no pre-existing test.fixme()/test.skip() tests found for this task">
<action>Write FAILING tests first for the task/subtask functionality</action>
<action>Confirm tests fail before implementation - this validates test correctness</action>
</check>
<!-- GREEN PHASE --> <!-- GREEN PHASE -->
<action>Implement MINIMAL code to make tests pass</action> <action>Implement MINIMAL code to make tests pass</action>
@ -386,6 +394,7 @@ Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve:
- Dev Agent Record contains implementation notes - Dev Agent Record contains implementation notes
- Change Log includes summary of changes - Change Log includes summary of changes
- Only permitted story sections were modified - Only permitted story sections were modified
- No test.fixme() or test.skip() calls remain for completed tasks (all ATDD tests activated and passing)
</action> </action>
<!-- Mark story ready for review - sprint status conditional --> <!-- Mark story ready for review - sprint status conditional -->