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 +1 -1
- package/templates/bmad-loop.sh +34 -10
package/package.json
CHANGED
package/templates/bmad-loop.sh
CHANGED
|
@@ -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
|
-
|
|
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 '
|
|
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 '
|
|
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 '
|
|
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
|
-
|
|
373
|
-
|
|
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
|
-
|
|
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")
|