bmad-auto-copilot 1.2.3 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bmad-auto-copilot",
3
- "version": "1.2.3",
3
+ "version": "1.3.0",
4
4
  "description": "Automated BMAD story development loop using GitHub Copilot CLI — install into any BMAD project",
5
5
  "keywords": [
6
6
  "bmad",
@@ -3,7 +3,8 @@
3
3
  BMAD Auto Loop — GitHub Copilot CLI Edition (Windows PowerShell)
4
4
  .DESCRIPTION
5
5
  Executes the BMAD workflow in a loop using GitHub Copilot CLI:
6
- create-story (SM agent) → dev-story (Dev agent) → code-review (Dev agent) → commit
6
+ create-story (CS) → validate-story (VS) → dev-story (DS) → code-review (CR)
7
+ → qa-generate-e2e-tests (QA, optional) → sprint-status (SS) → commit
7
8
  Each step runs as a NEW Copilot CLI session (fresh context window).
8
9
  Continues until all stories reach 'done' state in sprint-status.yaml.
9
10
 
@@ -65,8 +66,23 @@ if (-not $ReasoningEffort) {
65
66
  $ReasoningEffort = "xhigh"
66
67
  }
67
68
 
68
- # Delay between iterations (seconds)
69
- $IterationDelay = if ($env:ITERATION_DELAY) { [int]$env:ITERATION_DELAY } else { 10 }
69
+ # Delay between iterations (seconds) with enforced minimum
70
+ $IterationDelay = if ($env:ITERATION_DELAY) { [int]$env:ITERATION_DELAY } else { 60 }
71
+ if ($IterationDelay -lt 60) {
72
+ $IterationDelay = 60
73
+ }
74
+
75
+ # Canonical loop controls
76
+ $EnableValidateGate = if ($env:ENABLE_VALIDATE_GATE) { $env:ENABLE_VALIDATE_GATE } else { "true" }
77
+ $EnableQAStep = if ($env:ENABLE_QA_STEP) { $env:ENABLE_QA_STEP } else { "true" }
78
+ $EnableSprintStatusStep = if ($env:ENABLE_SPRINT_STATUS_STEP) { $env:ENABLE_SPRINT_STATUS_STEP } else { "true" }
79
+
80
+ function Test-Enabled {
81
+ param([string]$Value)
82
+ if (-not $Value) { return $false }
83
+ $v = $Value.ToLowerInvariant()
84
+ return $v -eq "true" -or $v -eq "1" -or $v -eq "yes" -or $v -eq "y"
85
+ }
70
86
 
71
87
  # ============================================================
72
88
  # CONFIGURATION LOADING
@@ -220,7 +236,8 @@ function Invoke-CopilotSession {
220
236
  param(
221
237
  [string]$Agent,
222
238
  [string]$PromptFile,
223
- [string]$ActionLabel
239
+ [string]$ActionLabel,
240
+ [string]$StoryKey = ""
224
241
  )
225
242
 
226
243
  if (-not (Test-Path $PromptFile)) {
@@ -230,6 +247,7 @@ function Invoke-CopilotSession {
230
247
 
231
248
  $prompt = Get-Content $PromptFile -Raw
232
249
  $prompt = $prompt -replace '\{TIMESTAMP\}', (Get-Date -Format "yyyy-MM-dd HH:mm:ss")
250
+ $prompt = $prompt -replace '\{STORY_KEY\}', $StoryKey
233
251
 
234
252
  Write-Log "[SESSION] New Copilot CLI session -> Agent: $Agent | Model: $Model | Reasoning: $ReasoningEffort | Action: $ActionLabel" "Magenta"
235
253
 
@@ -280,6 +298,31 @@ function Get-StoryKeyForState {
280
298
  return "unknown"
281
299
  }
282
300
 
301
+ function Get-StoryStateByKey {
302
+ param([string]$StoryKey)
303
+
304
+ if (-not $StoryKey) { return "" }
305
+
306
+ $line = Get-Content $SprintStatusPath |
307
+ Where-Object { $_ -match "^\s*${StoryKey}:" } |
308
+ Select-Object -First 1
309
+
310
+ if (-not $line) { return "" }
311
+
312
+ $line = $line -replace '\s*#.*$', ''
313
+ $line = $line -replace '^[^:]*:\s*', ''
314
+ return $line.Trim()
315
+ }
316
+
317
+ function Get-StoryStateToken {
318
+ param([string]$RawState)
319
+ if (-not $RawState) { return "" }
320
+ if ($RawState -match '^\s*([A-Za-z-]+)') {
321
+ return $Matches[1].ToLowerInvariant()
322
+ }
323
+ return $RawState.Trim().ToLowerInvariant()
324
+ }
325
+
283
326
  # ============================================================
284
327
  # GIT COMMIT
285
328
  # ============================================================
@@ -356,6 +399,10 @@ Write-Log "[START] BMAD Auto Loop Started" "Green"
356
399
  Write-Log "Max iterations: $MaxIterations" "Gray"
357
400
  Write-Log "Model: $Model" "Gray"
358
401
  Write-Log "Reasoning effort: $ReasoningEffort" "Gray"
402
+ Write-Log "Delay between steps: ${IterationDelay}s" "Gray"
403
+ Write-Log "Validate gate enabled: $EnableValidateGate" "Gray"
404
+ Write-Log "QA step enabled: $EnableQAStep" "Gray"
405
+ Write-Log "Sprint-status step enabled: $EnableSprintStatusStep" "Gray"
359
406
  Write-Log "Project root: $ProjectRoot" "Gray"
360
407
  Write-Log "Sprint status: $SprintStatusPath" "Gray"
361
408
  if ($DryRun) {
@@ -377,6 +424,14 @@ for ($iteration = 1; $iteration -le $MaxIterations; $iteration++) {
377
424
  "create-story" {
378
425
  Write-Log "[ACTION] CREATE STORY (SM Agent -> new session)" "Yellow"
379
426
  Invoke-CopilotSession -Agent "bmad-agent-bmm-sm" -PromptFile (Join-Path $PromptDir "create-story.md") -ActionLabel "create-story"
427
+
428
+ if (Test-Enabled $EnableValidateGate) {
429
+ Write-Log "[ACTION] VALIDATE STORY READINESS (VS gate)" "Yellow"
430
+ $validateOk = Invoke-CopilotSession -Agent "bmad-agent-bmm-sm" -PromptFile (Join-Path $PromptDir "validate-story.md") -ActionLabel "validate-story"
431
+ if (-not $validateOk) {
432
+ Write-Log "[WARN] Validate-story step failed; will retry canonical CS->VS cycle next iteration" "Yellow"
433
+ }
434
+ }
380
435
  }
381
436
  "dev-story" {
382
437
  Write-Log "[ACTION] DEVELOP STORY (Dev Agent -> new session)" "Yellow"
@@ -389,12 +444,42 @@ for ($iteration = 1; $iteration -le $MaxIterations; $iteration++) {
389
444
  Invoke-CopilotSession -Agent "bmad-agent-bmm-dev" -PromptFile (Join-Path $PromptDir "code-review.md") -ActionLabel "code-review"
390
445
 
391
446
  # Only commit if the story actually moved to 'done'
392
- $currentState = (Get-Content $SprintStatusPath | Where-Object { $_ -match "^\s*${reviewStoryKey}:" } | Select-Object -First 1) -replace '.*:\s*', '' | ForEach-Object { $_.Trim() }
393
- if ($currentState -eq "done") {
394
- Write-Log "[VERIFIED] Story $reviewStoryKey confirmed DONE" "Green"
395
- Invoke-GitCommit -StoryKey $reviewStoryKey
447
+ if (-not $reviewStoryKey -or $reviewStoryKey -eq "unknown") {
448
+ Write-Log "[WARN] Could not determine review story key; skipping auto-commit this iteration" "Yellow"
396
449
  } else {
397
- Write-Log "[RETRY] Story $reviewStoryKey still in '$currentState' (not done) - will retry next iteration" "Yellow"
450
+ $currentState = Get-StoryStateByKey -StoryKey $reviewStoryKey
451
+ $currentStateToken = Get-StoryStateToken -RawState $currentState
452
+
453
+ if ($currentStateToken -ne $currentState) {
454
+ Write-Log "[WARN] Non-canonical sprint status value for $reviewStoryKey: '$currentState' (parsed token: '$currentStateToken')" "Yellow"
455
+ }
456
+
457
+ if ($currentStateToken -eq "done") {
458
+ Write-Log "[VERIFIED] Story $reviewStoryKey confirmed DONE" "Green"
459
+
460
+ $qaPassed = $true
461
+ if (Test-Enabled $EnableQAStep) {
462
+ Write-Log "[ACTION] QA GENERATE E2E TESTS (recommended)" "Yellow"
463
+ $qaPassed = Invoke-CopilotSession -Agent "bmad-agent-bmm-qa" -PromptFile (Join-Path $PromptDir "qa-generate-e2e-tests.md") -ActionLabel "qa-generate-e2e-tests" -StoryKey $reviewStoryKey
464
+ if (-not $qaPassed) {
465
+ Write-Log "[WARN] QA step failed; skipping commit and continuing loop for remediation" "Yellow"
466
+ }
467
+ }
468
+
469
+ if ($qaPassed -and (Test-Enabled $EnableSprintStatusStep)) {
470
+ Write-Log "[ACTION] SPRINT STATUS UPDATE + NEXT STORY" "Yellow"
471
+ $ssOk = Invoke-CopilotSession -Agent "bmad-agent-bmm-sm" -PromptFile (Join-Path $PromptDir "sprint-status.md") -ActionLabel "sprint-status" -StoryKey $reviewStoryKey
472
+ if (-not $ssOk) {
473
+ Write-Log "[WARN] Sprint-status step failed; continuing to commit because story is done" "Yellow"
474
+ }
475
+ }
476
+
477
+ if ($qaPassed) {
478
+ Invoke-GitCommit -StoryKey $reviewStoryKey
479
+ }
480
+ } else {
481
+ Write-Log "[RETRY] Story $reviewStoryKey still in '$currentState' (token: '$currentStateToken', not done) - will retry next iteration" "Yellow"
482
+ }
398
483
  }
399
484
  }
400
485
  "complete" {
@@ -5,7 +5,8 @@
5
5
  #
6
6
  # DESCRIPTION:
7
7
  # Executes the BMAD workflow in a loop using GitHub Copilot CLI:
8
- # create-story (SM agent) → dev-story (Dev agent) → code-review (Dev agent) → commit
8
+ # create-story (CS) → validate-story (VS) → dev-story (DS) → code-review (CR)
9
+ # → qa-generate-e2e-tests (QA, optional) → sprint-status (SS) → commit
9
10
  # Each step runs as a NEW Copilot CLI session (fresh context window).
10
11
  # Continues until all stories reach 'done' state in sprint-status.yaml.
11
12
  #
@@ -63,6 +64,18 @@ if ! [[ "$ITERATION_DELAY" =~ ^[0-9]+$ ]] || [[ "$ITERATION_DELAY" -lt 60 ]]; th
63
64
  ITERATION_DELAY=60
64
65
  fi
65
66
 
67
+ # Canonical loop controls
68
+ # VS gate runs after CS. QA and SS run after CR when story reaches done.
69
+ ENABLE_VALIDATE_GATE="${ENABLE_VALIDATE_GATE:-true}"
70
+ ENABLE_QA_STEP="${ENABLE_QA_STEP:-true}"
71
+ ENABLE_SPRINT_STATUS_STEP="${ENABLE_SPRINT_STATUS_STEP:-true}"
72
+
73
+ is_enabled() {
74
+ local value
75
+ value=$(echo "$1" | tr '[:upper:]' '[:lower:]')
76
+ [[ "$value" == "true" || "$value" == "1" || "$value" == "yes" || "$value" == "y" ]]
77
+ }
78
+
66
79
  # ============================================================
67
80
  # CONFIGURATION LOADING
68
81
  # ============================================================
@@ -226,6 +239,7 @@ invoke_copilot() {
226
239
  local agent="$1"
227
240
  local prompt_file="$2"
228
241
  local action_label="$3"
242
+ local story_key="${4:-}"
229
243
 
230
244
  if [[ ! -f "$prompt_file" ]]; then
231
245
  log "[ERROR] Prompt file not found: $prompt_file" "red"
@@ -235,6 +249,7 @@ invoke_copilot() {
235
249
  # Read prompt and substitute timestamp
236
250
  local prompt=$(cat "$prompt_file")
237
251
  prompt="${prompt//\{TIMESTAMP\}/$(date "+%Y-%m-%d %H:%M:%S")}"
252
+ prompt="${prompt//\{STORY_KEY\}/$story_key}"
238
253
 
239
254
  log "[SESSION] New Copilot CLI session → Model: $COPILOT_MODEL | Reasoning: $COPILOT_REASONING_EFFORT | Action: $action_label" "magenta"
240
255
 
@@ -286,6 +301,13 @@ get_story_state_by_key() {
286
301
  | sed 's/[[:space:]]*$//'
287
302
  }
288
303
 
304
+ get_story_state_token() {
305
+ local raw_state="$1"
306
+
307
+ # Extract leading canonical token (letters/hyphen), normalize to lowercase.
308
+ echo "$raw_state" | sed -E 's/^[[:space:]]*([A-Za-z-]+).*$/\1/' | tr '[:upper:]' '[:lower:]'
309
+ }
310
+
289
311
  # ============================================================
290
312
  # GIT COMMIT
291
313
  # ============================================================
@@ -356,6 +378,9 @@ log "Max iterations: $MAX_ITERATIONS" "gray"
356
378
  log "Model: $COPILOT_MODEL" "gray"
357
379
  log "Reasoning effort: $COPILOT_REASONING_EFFORT" "gray"
358
380
  log "Delay between steps: ${ITERATION_DELAY}s" "gray"
381
+ log "Validate gate enabled: $ENABLE_VALIDATE_GATE" "gray"
382
+ log "QA step enabled: $ENABLE_QA_STEP" "gray"
383
+ log "Sprint-status step enabled: $ENABLE_SPRINT_STATUS_STEP" "gray"
359
384
  log "Project root: $PROJECT_ROOT" "gray"
360
385
  log "Sprint status: $SPRINT_STATUS_PATH" "gray"
361
386
  if $DRY_RUN; then
@@ -377,6 +402,13 @@ for ((iteration=1; iteration<=MAX_ITERATIONS; iteration++)); do
377
402
  "create-story")
378
403
  log "[ACTION] CREATE STORY (SM Agent → new session)" "yellow"
379
404
  invoke_copilot "bmad-agent-bmm-sm" "$PROMPT_DIR/create-story.md" "create-story"
405
+
406
+ if is_enabled "$ENABLE_VALIDATE_GATE"; then
407
+ log "[ACTION] VALIDATE STORY READINESS (VS gate)" "yellow"
408
+ if ! invoke_copilot "bmad-agent-bmm-sm" "$PROMPT_DIR/validate-story.md" "validate-story"; then
409
+ log "[WARN] Validate-story step failed; will retry canonical CS→VS cycle next iteration" "yellow"
410
+ fi
411
+ fi
380
412
  ;;
381
413
  "dev-story")
382
414
  log "[ACTION] DEVELOP STORY (Dev Agent → new session)" "yellow"
@@ -393,11 +425,36 @@ for ((iteration=1; iteration<=MAX_ITERATIONS; iteration++)); do
393
425
  log "[WARN] Could not determine review story key; skipping auto-commit this iteration" "yellow"
394
426
  else
395
427
  current_state=$(get_story_state_by_key "$review_story_key")
396
- if [[ "$current_state" == "done" ]]; then
428
+ current_state_token=$(get_story_state_token "$current_state")
429
+
430
+ if [[ "$current_state_token" != "$current_state" ]]; then
431
+ log "[WARN] Non-canonical sprint status value for $review_story_key: '$current_state' (parsed token: '$current_state_token')" "yellow"
432
+ fi
433
+
434
+ if [[ "$current_state_token" == "done" ]]; then
397
435
  log "[VERIFIED] Story $review_story_key confirmed DONE" "green"
398
- invoke_git_commit "$review_story_key"
436
+
437
+ qa_passed=true
438
+ if is_enabled "$ENABLE_QA_STEP"; then
439
+ log "[ACTION] QA GENERATE E2E TESTS (recommended)" "yellow"
440
+ if ! invoke_copilot "bmad-agent-bmm-qa" "$PROMPT_DIR/qa-generate-e2e-tests.md" "qa-generate-e2e-tests" "$review_story_key"; then
441
+ qa_passed=false
442
+ log "[WARN] QA step failed; skipping commit and continuing loop for remediation" "yellow"
443
+ fi
444
+ fi
445
+
446
+ if $qa_passed && is_enabled "$ENABLE_SPRINT_STATUS_STEP"; then
447
+ log "[ACTION] SPRINT STATUS UPDATE + NEXT STORY" "yellow"
448
+ if ! invoke_copilot "bmad-agent-bmm-sm" "$PROMPT_DIR/sprint-status.md" "sprint-status" "$review_story_key"; then
449
+ log "[WARN] Sprint-status step failed; continuing to commit because story is done" "yellow"
450
+ fi
451
+ fi
452
+
453
+ if $qa_passed; then
454
+ invoke_git_commit "$review_story_key"
455
+ fi
399
456
  else
400
- log "[RETRY] Story $review_story_key still in '$current_state' (not done) — will retry next iteration" "yellow"
457
+ log "[RETRY] Story $review_story_key still in '$current_state' (token: '$current_state_token', not done) — will retry next iteration" "yellow"
401
458
  fi
402
459
  fi
403
460
  ;;
@@ -6,12 +6,13 @@ Timestamp: {TIMESTAMP}
6
6
 
7
7
  ## Step 1: Load Configuration and Workflow
8
8
  Read the BMAD config from: `_bmad/bmm/config.yaml` — resolve all variables ({project-root}, {output_folder}, etc.)
9
- Read the workflow definition from: `_bmad/bmm/workflows/4-implementation/bmad-code-review/workflow.md`
10
- Read and follow these review step files:
11
- - `_bmad/bmm/workflows/4-implementation/bmad-code-review/steps/step-01-gather-context.md`
12
- - `_bmad/bmm/workflows/4-implementation/bmad-code-review/steps/step-02-review.md`
13
- - `_bmad/bmm/workflows/4-implementation/bmad-code-review/steps/step-03-triage.md`
14
- - `_bmad/bmm/workflows/4-implementation/bmad-code-review/steps/step-04-present.md`
9
+ Prefer these BMAD workflow paths:
10
+ - `_bmad/bmm/4-implementation/bmad-code-review/workflow.md`
11
+ - `_bmad/bmm/4-implementation/bmad-code-review/steps/step-01-gather-context.md`
12
+ - `_bmad/bmm/4-implementation/bmad-code-review/steps/step-02-review.md`
13
+ - `_bmad/bmm/4-implementation/bmad-code-review/steps/step-03-triage.md`
14
+ - `_bmad/bmm/4-implementation/bmad-code-review/steps/step-04-present.md`
15
+ If they do not exist, fallback to legacy paths under `_bmad/bmm/workflows/4-implementation/...`.
15
16
 
16
17
  ## Step 2: Find Next Story
17
18
  Read `_bmad-output/implementation-artifacts/sprint-status.yaml` and find the FIRST story in `review` state (scan top to bottom, exclude retrospectives).
@@ -38,6 +39,8 @@ Based on review outcome:
38
39
  - If ALL HIGH and MEDIUM issues are fixed AND all ACs implemented: update status from `review` to `done`
39
40
  - If issues remain unfixable: update status from `review` to `in-progress` (will re-enter dev cycle)
40
41
  - Preserve ALL comments and structure in `_bmad-output/implementation-artifacts/sprint-status.yaml`
42
+ - The status value MUST be a literal token only: exactly `done` or `in-progress` (never prose, counts, or summaries)
43
+ - After saving, re-read the same story entry and verify the value is exactly `done` or `in-progress`; if not, correct it immediately and save again
41
44
 
42
45
  ## Rules
43
46
  - Use best judgment for ALL decisions — never ask the user
@@ -46,3 +49,4 @@ Based on review outcome:
46
49
  - Document issues you cannot auto-fix in the story file
47
50
  - All tests must pass after any fixes
48
51
  - Follow the workflow checklist to verify completeness
52
+ - NEVER write explanatory text into sprint status values; write explanations only in story Dev Agent Record / Change Log
@@ -6,10 +6,12 @@ Timestamp: {TIMESTAMP}
6
6
 
7
7
  ## Step 1: Load Configuration and Workflow
8
8
  Read the BMAD config from: `_bmad/bmm/config.yaml` — resolve all variables ({project-root}, {output_folder}, etc.)
9
- Read the workflow definition from: `_bmad/bmm/workflows/4-implementation/bmad-create-story/workflow.md`
10
- Read the input discovery protocol from: `_bmad/bmm/workflows/4-implementation/bmad-create-story/discover-inputs.md`
11
- Read the workflow template from: `_bmad/bmm/workflows/4-implementation/bmad-create-story/template.md`
12
- Read the workflow checklist from: `_bmad/bmm/workflows/4-implementation/bmad-create-story/checklist.md`
9
+ Prefer these BMAD workflow paths:
10
+ - `_bmad/bmm/4-implementation/bmad-create-story/workflow.md`
11
+ - `_bmad/bmm/4-implementation/bmad-create-story/discover-inputs.md`
12
+ - `_bmad/bmm/4-implementation/bmad-create-story/template.md`
13
+ - `_bmad/bmm/4-implementation/bmad-create-story/checklist.md`
14
+ If they do not exist, fallback to legacy paths under `_bmad/bmm/workflows/4-implementation/...`.
13
15
 
14
16
  ## Step 2: Find Next Story
15
17
  Read `_bmad-output/implementation-artifacts/sprint-status.yaml` and find the FIRST story in `backlog` state (scan top to bottom, exclude retrospectives).
@@ -6,8 +6,10 @@ Timestamp: {TIMESTAMP}
6
6
 
7
7
  ## Step 1: Load Configuration and Workflow
8
8
  Read the BMAD config from: `_bmad/bmm/config.yaml` — resolve all variables ({project-root}, {output_folder}, etc.)
9
- Read the workflow definition from: `_bmad/bmm/workflows/4-implementation/bmad-dev-story/workflow.md`
10
- Read the workflow checklist from: `_bmad/bmm/workflows/4-implementation/bmad-dev-story/checklist.md`
9
+ Prefer these BMAD workflow paths:
10
+ - `_bmad/bmm/4-implementation/bmad-dev-story/workflow.md`
11
+ - `_bmad/bmm/4-implementation/bmad-dev-story/checklist.md`
12
+ If they do not exist, fallback to legacy paths under `_bmad/bmm/workflows/4-implementation/...`.
11
13
 
12
14
  ## Step 2: Find Next Story
13
15
  Read `_bmad-output/implementation-artifacts/sprint-status.yaml` and find the FIRST story in `ready-for-dev` or `in-progress` state (scan top to bottom, exclude retrospectives).
@@ -0,0 +1,36 @@
1
+ You are an automated BMAD workflow executor. Your task is to execute QA automation tests (`bmad-qa-generate-e2e-tests`).
2
+
3
+ IMPORTANT: This is a non-interactive automated execution. Do NOT show menus, greetings, or ask questions. Execute continuously.
4
+
5
+ Timestamp: {TIMESTAMP}
6
+ Story key hint: {STORY_KEY}
7
+
8
+ ## Step 1: Load Configuration and QA Workflow
9
+ Read `_bmad/bmm/config.yaml` and resolve variables.
10
+ Prefer path: `_bmad/bmm/4-implementation/bmad-qa-generate-e2e-tests/workflow.md`
11
+ Fallback to legacy path under `_bmad/bmm/workflows/4-implementation/...` if needed.
12
+
13
+ ## Step 2: Select Story Context
14
+ Read `_bmad-output/implementation-artifacts/sprint-status.yaml`.
15
+ Target story in this order:
16
+ 1) `{STORY_KEY}` if provided and present
17
+ 2) Else first story in `done`
18
+ 3) Else halt with clear reason
19
+
20
+ ## Step 3: Generate and Run QA Tests
21
+ Generate and run API/E2E automation tests for the target story's critical flows.
22
+ - Follow existing test framework conventions
23
+ - Keep tests readable and maintainable
24
+ - Run tests and fix immediate test issues where possible
25
+
26
+ ## Step 4: QA Outcome Handling
27
+ - If QA passes: keep story status as `done`
28
+ - If QA fails and can be remediated now: implement fixes and re-run QA until pass
29
+ - If QA still fails with unresolved blockers: set story status to `in-progress` and record blockers for DS remediation
30
+ - If remediation changed core logic materially, run a CR pass before final status confirmation
31
+
32
+ ## Rules
33
+ - Status values must be literal tokens only (`in-progress` or `done` here)
34
+ - Preserve sprint-status.yaml comments/structure
35
+ - Write details in story Dev Agent Record / Change Log, not in status value
36
+ - Do NOT pause between steps
@@ -0,0 +1,28 @@
1
+ You are an automated BMAD workflow executor. Your task is to execute sprint-status (`bmad-sprint-status`) as the per-story closure step.
2
+
3
+ IMPORTANT: This is a non-interactive automated execution. Do NOT show menus, greetings, or ask questions. Execute continuously.
4
+
5
+ Timestamp: {TIMESTAMP}
6
+ Story key hint: {STORY_KEY}
7
+
8
+ ## Step 1: Load Configuration and Workflow
9
+ Read `_bmad/bmm/config.yaml` and resolve variables.
10
+ Prefer path: `_bmad/bmm/4-implementation/bmad-sprint-status/workflow.md`
11
+ Fallback to legacy path under `_bmad/bmm/workflows/4-implementation/...` if needed.
12
+
13
+ ## Step 2: Update and Validate Sprint Status
14
+ Read `_bmad-output/implementation-artifacts/sprint-status.yaml` and update status transitions based on evidence from this story:
15
+ - `ready-for-dev`
16
+ - `in-progress`
17
+ - `review`
18
+ - `done`
19
+ Ensure all status values are canonical literal tokens and file structure/comments are preserved.
20
+
21
+ ## Step 3: Recommend Next Story
22
+ Show the next highest-priority story and key dependencies/risks.
23
+ If there are blockers or unknown status values, surface them explicitly with corrective actions.
24
+
25
+ ## Rules
26
+ - Non-interactive execution only
27
+ - No status prose in YAML values
28
+ - Do NOT pause between steps
@@ -0,0 +1,35 @@
1
+ You are an automated BMAD workflow executor. Your task is to execute the Validate Story gate (`bmad-create-story` with action: validate).
2
+
3
+ IMPORTANT: This is a non-interactive automated execution. Do NOT show menus, greetings, or ask questions. Execute continuously until the gate result is final.
4
+
5
+ Timestamp: {TIMESTAMP}
6
+ Story key hint: {STORY_KEY}
7
+
8
+ ## Step 1: Load Configuration and Validation Workflow
9
+ Read `_bmad/bmm/config.yaml` and resolve variables.
10
+ Prefer these paths:
11
+ - `_bmad/bmm/4-implementation/bmad-create-story/workflow.md`
12
+ - `_bmad/bmm/4-implementation/bmad-create-story/checklist.md`
13
+ Fallback to legacy `_bmad/bmm/workflows/4-implementation/...` paths if needed.
14
+
15
+ ## Step 2: Select Target Story
16
+ Read `_bmad-output/implementation-artifacts/sprint-status.yaml` and select target in this order:
17
+ 1) `{STORY_KEY}` if provided and present
18
+ 2) Else first story in `ready-for-dev`
19
+ 3) Else halt with clear reason
20
+
21
+ ## Step 3: Run Validation Gate (VS)
22
+ Run create-story validation against the selected story using the checklist quality criteria.
23
+ - Validate readiness/completeness for implementation
24
+ - Produce concrete blockers and fixes if any
25
+
26
+ ## Step 4: Gate Handling
27
+ - If validation PASSES: ensure sprint status for the story is exactly `ready-for-dev` (literal token only)
28
+ - If validation FAILS with fixable blockers: refine story context and re-run validation in the same session
29
+ - If validation still fails after remediation attempts: set story status back to `backlog` (literal token), record blockers in story file, and stop
30
+
31
+ ## Rules
32
+ - Never proceed to implementation from this prompt
33
+ - Status values in sprint-status must be literal tokens only (`backlog`, `ready-for-dev`, `in-progress`, `review`, `done`)
34
+ - Preserve sprint-status.yaml structure/comments
35
+ - Do NOT pause between steps