Skip to content

fix: add TEA ATDD pre-check gate to dev-story initialization#2272

Open
pablontiv wants to merge 1 commit intobmad-code-org:mainfrom
pablontiv:fix/dev-story-add-atdd-pre-check-gate
Open

fix: add TEA ATDD pre-check gate to dev-story initialization#2272
pablontiv wants to merge 1 commit intobmad-code-org:mainfrom
pablontiv:fix/dev-story-add-atdd-pre-check-gate

Conversation

@pablontiv
Copy link
Copy Markdown

What

Adds an explicit TEA ATDD pre-check gate in Step 1 of dev-story initialization. When TEA is installed and no ATDD checklist exists for the story, the workflow warns and asks for confirmation before proceeding.

Why

When TEA module is installed, dev-story previously had zero enforcement of ATDD. The only TEA reference was a Step 10 "Optional" suggestion placed after the story was already complete. Entire epics could be implemented with 0% new test coverage and no acceptance scaffolds, with no warning.
Fixes #2271. Related to #2243 and PR #2260 — this targets the missing entry gate, while #2260 addresses artifact consumption inside the workflow (both fixes are complementary).

How

  • Added TEA detection + ATDD checklist lookup at <anchor id="task_check" /> in Step 1
  • If TEA installed and no checklist found: explicit warning + ask to confirm or halt
  • Changed Step 10 "Optional: ..." wording to remove the "Optional" label for TEA automate suggestion

Testing

Verified locally with TEA 1.7.2 + BMM 6.3.0: dev-story now prompts when testarch-atdd output is missing. Existing behavior unchanged when TEA is not installed or checklist already exists.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 15, 2026

📝 Walkthrough

Walkthrough

Modified bmad-dev-story workflow to add a TEA ATDD pre-check gate in Step 1 that detects whether bmad-testarch-atdd module is installed, searches for the ATDD checklist file for the current story, warns the user if the module is installed but no checklist exists, and halts for ATDD execution if the user declines to proceed. Also updated the optional automation command reference from /bmad:tea:automate to [TA] bmad-testarch-automate.

Changes

Cohort / File(s) Summary
TEA ATDD Pre-Check Gate
src/bmm-skills/4-implementation/bmad-dev-story/workflow.md
Added conditional logic in Step 1 initialization to detect bmad-testarch-atdd module installation and search for ATDD checklist; emits warning with user prompt when module present but checklist missing; halts execution to run /bmad-testarch-atdd if user declines to proceed. Updated Step 10 automation command reference from /bmad:tea:automate to [TA] bmad-testarch-automate.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers

  • bmadcode
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the main change: adding a TEA ATDD pre-check gate to dev-story initialization.
Description check ✅ Passed The description clearly explains what was changed, why it was needed, and how it was implemented, all related to the changeset.
Linked Issues check ✅ Passed The changes meet the primary objectives from issue #2271: added TEA detection + ATDD checklist lookup in Step 1, explicit warning when TEA is installed but no checklist exists, and confirmation prompt before proceeding.
Out of Scope Changes check ✅ Passed All changes are scoped to the stated objectives: adding the pre-check gate in Step 1 and updating Step 10 wording. No extraneous modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/bmm-skills/4-implementation/bmad-dev-story/workflow.md (1)

458-458: Standardize TEA automation command references across docs/workflows.

Line 458 uses [TA] bmad-testarch-automate, but other workflow guidance still references /bmad:tea:automate (see src/bmm-skills/4-implementation/bmad-create-story/workflow.md Line 370-376). Please align references (and related docs/help pages) to one canonical command format to avoid user confusion. As per coding guidelines: “src/**: … changed behavior, renamed concepts, altered CLI flags … should all be reflected in the relevant doc pages.”

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/bmm-skills/4-implementation/bmad-dev-story/workflow.md` at line 458, The
docs use two different TEA automation command formats—"[TA]
bmad-testarch-automate" and "/bmad:tea:automate"—causing inconsistency; pick the
canonical command (decide between bmad-testarch-automate or bmad:tea:automate)
and update this file's line that currently reads "[TA] bmad-testarch-automate"
as well as any other workflow/help pages that reference "/bmad:tea:automate" so
all documentation consistently uses the chosen form (search for the tokens
bmad-testarch-automate and bmad:tea:automate and replace occurrences, and update
any surrounding examples or bracket notation like [TA] to match the canonical
style).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/bmm-skills/4-implementation/bmad-dev-story/workflow.md`:
- Around line 163-173: The ATDD gate check "no ATDD checklist found for
{{story_key}}" assumes {{story_key}} is set; add a pre-gate fallback that, when
{{story_key}} is empty, extracts/parses the key from {{story_path}} (the same
logic used in Step 1 branches that set {{story_path}}) before performing the
checklist lookup; update the gate or preceding task_check to populate
{{story_key}} from {{story_path}} if missing so the HALT/ask logic behaves
correctly even when earlier branches only set {{story_path}}.

---

Nitpick comments:
In `@src/bmm-skills/4-implementation/bmad-dev-story/workflow.md`:
- Line 458: The docs use two different TEA automation command formats—"[TA]
bmad-testarch-automate" and "/bmad:tea:automate"—causing inconsistency; pick the
canonical command (decide between bmad-testarch-automate or bmad:tea:automate)
and update this file's line that currently reads "[TA] bmad-testarch-automate"
as well as any other workflow/help pages that reference "/bmad:tea:automate" so
all documentation consistently uses the chosen form (search for the tokens
bmad-testarch-automate and bmad:tea:automate and replace occurrences, and update
any surrounding examples or bracket notation like [TA] to match the canonical
style).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 06694ec1-7c42-4bff-a30d-94528ff11c59

📥 Commits

Reviewing files that changed from the base of the PR and between 6b964ac and 9802a30.

📒 Files selected for processing (1)
  • src/bmm-skills/4-implementation/bmad-dev-story/workflow.md

Comment on lines +163 to +173
<check if="no ATDD checklist found for {{story_key}}">
<output>⚠️ **TEA module detected — no ATDD checklist found for story {{story_key}}**

Running `dev-story` without `testarch-atdd` means:
- No red-phase acceptance tests will be scaffolded before implementation
- Coverage gaps won't be detected until after the story is complete

Recommended: run **[AT] bmad-testarch-atdd** first to generate acceptance test scaffolds.</output>
<ask>Continue without ATDD checklist? [y] to proceed anyway, [n] to halt and run ATDD first:</ask>
<check if="user says 'n' or does not confirm">
<action>HALT — Run /bmad-testarch-atdd for story {{story_key}} before continuing</action>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Ensure {{story_key}} is guaranteed before running the ATDD gate.

This gate assumes {{story_key}} is already available, but some Step 1 branches jump to task_check after setting only {{story_path}} (e.g., Line 100-101 and Line 111-112). That can cause false missing-checklist warnings or incorrect HALT behavior. Add a pre-gate extraction fallback from {{story_path}} when {{story_key}} is empty.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/bmm-skills/4-implementation/bmad-dev-story/workflow.md` around lines 163
- 173, The ATDD gate check "no ATDD checklist found for {{story_key}}" assumes
{{story_key}} is set; add a pre-gate fallback that, when {{story_key}} is empty,
extracts/parses the key from {{story_path}} (the same logic used in Step 1
branches that set {{story_path}}) before performing the checklist lookup; update
the gate or preceding task_check to populate {{story_key}} from {{story_path}}
if missing so the HALT/ask logic behaves correctly even when earlier branches
only set {{story_path}}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] dev-story skips TEA ATDD pre-check — testarch-atdd not gated before implementation

1 participant