bmad-auto-copilot 1.2.0 → 1.2.2

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.0",
3
+ "version": "1.2.2",
4
4
  "description": "Automated BMAD story development loop using GitHub Copilot CLI — install into any BMAD project",
5
5
  "keywords": [
6
6
  "bmad",
@@ -56,8 +56,12 @@ PROMPT_DIR="$SCRIPT_DIR/prompts"
56
56
  COPILOT_MODEL="${COPILOT_MODEL:-gpt-5.3-codex}"
57
57
  COPILOT_REASONING_EFFORT="${COPILOT_REASONING_EFFORT:-xhigh}"
58
58
 
59
- # Delay between iterations (seconds)
60
- ITERATION_DELAY="${ITERATION_DELAY:-10}"
59
+ # Delay between workflow steps/iterations (seconds)
60
+ # Minimum enforced delay is 60s to reduce rate-limit/ban risk.
61
+ ITERATION_DELAY="${ITERATION_DELAY:-60}"
62
+ if ! [[ "$ITERATION_DELAY" =~ ^[0-9]+$ ]] || [[ "$ITERATION_DELAY" -lt 60 ]]; then
63
+ ITERATION_DELAY=60
64
+ fi
61
65
 
62
66
  # ============================================================
63
67
  # CONFIGURATION LOADING
@@ -161,7 +165,7 @@ get_next_action() {
161
165
 
162
166
  # Filter story lines (pattern: digits-digits-*) excluding retrospectives
163
167
  # Strip inline YAML comments (# ...) so status matching works with annotated lines
164
- local story_lines=$(grep -E '^\s*[0-9]+-[0-9]+-' "$SPRINT_STATUS_PATH" | grep -v "retrospective" | sed 's/ *#.*//')
168
+ local story_lines=$(grep -E '^[[:space:]]*[0-9]+-[0-9]+-' "$SPRINT_STATUS_PATH" | grep -v "retrospective" | sed 's/ *#.*//')
165
169
 
166
170
  if $VERBOSE; then
167
171
  local count=$(echo "$story_lines" | wc -l | tr -d ' ')
@@ -264,7 +268,22 @@ invoke_copilot() {
264
268
 
265
269
  get_story_key_for_state() {
266
270
  local state="$1"
267
- grep -E '^\s*[0-9]+-[0-9]+-' "$SPRINT_STATUS_PATH" | grep -v "retrospective" | sed 's/ *#.*//' | grep ": *${state} *$" | head -1 | sed 's/^[[:space:]]*//' | cut -d: -f1
271
+ grep -E '^[[:space:]]*[0-9]+-[0-9]+-' "$SPRINT_STATUS_PATH" | grep -v "retrospective" | sed 's/ *#.*//' | grep ": *${state} *$" | head -1 | sed 's/^[[:space:]]*//' | cut -d: -f1
272
+ }
273
+
274
+ get_story_state_by_key() {
275
+ local story_key="$1"
276
+
277
+ if [[ -z "$story_key" ]]; then
278
+ echo ""
279
+ return
280
+ fi
281
+
282
+ grep -E "^[[:space:]]*${story_key}:" "$SPRINT_STATUS_PATH" \
283
+ | head -1 \
284
+ | sed 's/ *#.*//' \
285
+ | sed 's/^[^:]*:[[:space:]]*//' \
286
+ | sed 's/[[:space:]]*$//'
268
287
  }
269
288
 
270
289
  # ============================================================
@@ -309,7 +328,7 @@ print_summary() {
309
328
  return
310
329
  fi
311
330
 
312
- local story_lines=$(grep -E '^\s*[0-9]+-[0-9]+-' "$SPRINT_STATUS_PATH" | grep -v "retrospective" | sed 's/ *#.*//')
331
+ local story_lines=$(grep -E '^[[:space:]]*[0-9]+-[0-9]+-' "$SPRINT_STATUS_PATH" | grep -v "retrospective" | sed 's/ *#.*//')
313
332
  local done=$(echo "$story_lines" | grep -c ': *done *$' || true)
314
333
  local total=$(echo "$story_lines" | grep -c '.' || true)
315
334
  local pct=0
@@ -336,6 +355,7 @@ log "[START] BMAD Auto Loop Started" "green"
336
355
  log "Max iterations: $MAX_ITERATIONS" "gray"
337
356
  log "Model: $COPILOT_MODEL" "gray"
338
357
  log "Reasoning effort: $COPILOT_REASONING_EFFORT" "gray"
358
+ log "Delay between steps: ${ITERATION_DELAY}s" "gray"
339
359
  log "Project root: $PROJECT_ROOT" "gray"
340
360
  log "Sprint status: $SPRINT_STATUS_PATH" "gray"
341
361
  if $DRY_RUN; then
@@ -369,12 +389,16 @@ for ((iteration=1; iteration<=MAX_ITERATIONS; iteration++)); do
369
389
  invoke_copilot "bmad-agent-bmm-dev" "$PROMPT_DIR/code-review.md" "code-review"
370
390
 
371
391
  # Only commit if the story actually moved to 'done'
372
- current_state=$(grep -E "^\s*${review_story_key}:" "$SPRINT_STATUS_PATH" | sed 's/.*: *//' | tr -d ' \r')
373
- if [[ "$current_state" == "done" ]]; then
374
- log "[VERIFIED] Story $review_story_key confirmed DONE" "green"
375
- invoke_git_commit "$review_story_key"
392
+ if [[ -z "$review_story_key" ]]; then
393
+ log "[WARN] Could not determine review story key; skipping auto-commit this iteration" "yellow"
376
394
  else
377
- log "[RETRY] Story $review_story_key still in '$current_state' (not done) — will retry next iteration" "yellow"
395
+ current_state=$(get_story_state_by_key "$review_story_key")
396
+ if [[ "$current_state" == "done" ]]; then
397
+ log "[VERIFIED] Story $review_story_key confirmed DONE" "green"
398
+ invoke_git_commit "$review_story_key"
399
+ else
400
+ log "[RETRY] Story $review_story_key still in '$current_state' (not done) — will retry next iteration" "yellow"
401
+ fi
378
402
  fi
379
403
  ;;
380
404
  "complete")