bmad-auto-copilot 1.0.0 → 1.0.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.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Automated BMAD story development loop using GitHub Copilot CLI — install into any BMAD project",
5
5
  "keywords": [
6
6
  "bmad",
@@ -229,12 +229,13 @@ function Invoke-CopilotSession {
229
229
  try {
230
230
  Set-Content -Path $tempPrompt -Value $prompt
231
231
 
232
- Get-Content $tempPrompt | copilot `
233
- --agent $Agent `
232
+ # NOTE: We do NOT use --agent to avoid the agent's menu/activation loop.
233
+ # The prompt itself contains all workflow instructions.
234
+ copilot `
234
235
  --model $Model `
235
236
  --allow-all `
236
237
  --no-ask-user `
237
- -p -
238
+ -p $prompt
238
239
 
239
240
  $success = $LASTEXITCODE -eq 0
240
241
 
@@ -345,15 +346,15 @@ for ($iteration = 1; $iteration -le $MaxIterations; $iteration++) {
345
346
  switch ($action) {
346
347
  "create-story" {
347
348
  Write-Log "[ACTION] CREATE STORY (SM Agent -> new session)" "Yellow"
348
- Invoke-CopilotSession -Agent "sm" -PromptFile (Join-Path $PromptDir "create-story.md") -ActionLabel "create-story"
349
+ Invoke-CopilotSession -Agent "bmad-agent-bmm-sm" -PromptFile (Join-Path $PromptDir "create-story.md") -ActionLabel "create-story"
349
350
  }
350
351
  "dev-story" {
351
352
  Write-Log "[ACTION] DEVELOP STORY (Dev Agent -> new session)" "Yellow"
352
- Invoke-CopilotSession -Agent "dev" -PromptFile (Join-Path $PromptDir "dev-story.md") -ActionLabel "dev-story"
353
+ Invoke-CopilotSession -Agent "bmad-agent-bmm-dev" -PromptFile (Join-Path $PromptDir "dev-story.md") -ActionLabel "dev-story"
353
354
  }
354
355
  "code-review" {
355
356
  Write-Log "[ACTION] CODE REVIEW (Dev Agent -> new session)" "Yellow"
356
- $success = Invoke-CopilotSession -Agent "dev" -PromptFile (Join-Path $PromptDir "code-review.md") -ActionLabel "code-review"
357
+ $success = Invoke-CopilotSession -Agent "bmad-agent-bmm-dev" -PromptFile (Join-Path $PromptDir "code-review.md") -ActionLabel "code-review"
357
358
  if ($success) {
358
359
  Invoke-GitCommit
359
360
  }
@@ -153,7 +153,7 @@ log() {
153
153
 
154
154
  get_next_action() {
155
155
  if [[ ! -f "$SPRINT_STATUS_PATH" ]]; then
156
- log "[ERROR] sprint-status.yaml not found: $SPRINT_STATUS_PATH" "red"
156
+ echo "[ERROR] sprint-status.yaml not found: $SPRINT_STATUS_PATH" >&2
157
157
  echo "error"
158
158
  return
159
159
  fi
@@ -163,7 +163,7 @@ get_next_action() {
163
163
 
164
164
  if $VERBOSE; then
165
165
  local count=$(echo "$story_lines" | wc -l | tr -d ' ')
166
- log "[DEBUG] Found $count story lines" "gray"
166
+ echo "[DEBUG] Found $count story lines" >&2
167
167
  fi
168
168
 
169
169
  # Count stories in each state
@@ -175,24 +175,24 @@ get_next_action() {
175
175
  local total_count=$(echo "$story_lines" | grep -c '.' || true)
176
176
 
177
177
  if $VERBOSE; then
178
- log "[DEBUG] Review: $review_count | Ready: $ready_count | Backlog: $backlog_count | In-Progress: $in_progress_count | Done: $done_count / $total_count" "gray"
178
+ echo "[DEBUG] Review: $review_count | Ready: $ready_count | Backlog: $backlog_count | In-Progress: $in_progress_count | Done: $done_count / $total_count" >&2
179
179
  fi
180
180
 
181
181
  # Priority order: review > ready-for-dev > backlog
182
182
  if [[ $review_count -gt 0 ]]; then
183
- log "[NEXT] Found story in REVIEW state → code-review (Dev agent)" "green"
183
+ log "[NEXT] Found story in REVIEW state → code-review (Dev agent)" "green" >&2
184
184
  echo "code-review"
185
185
  return
186
186
  fi
187
187
 
188
188
  if [[ $ready_count -gt 0 ]]; then
189
- log "[NEXT] Found story in READY-FOR-DEV state → dev-story (Dev agent)" "green"
189
+ log "[NEXT] Found story in READY-FOR-DEV state → dev-story (Dev agent)" "green" >&2
190
190
  echo "dev-story"
191
191
  return
192
192
  fi
193
193
 
194
194
  if [[ $backlog_count -gt 0 ]]; then
195
- log "[NEXT] Found story in BACKLOG state → create-story (SM agent)" "green"
195
+ log "[NEXT] Found story in BACKLOG state → create-story (SM agent)" "green" >&2
196
196
  echo "create-story"
197
197
  return
198
198
  fi
@@ -205,7 +205,7 @@ get_next_action() {
205
205
 
206
206
  # Check for in-progress (waiting state)
207
207
  if [[ $in_progress_count -gt 0 ]]; then
208
- log "[WAIT] Found $in_progress_count story(ies) in-progress" "yellow"
208
+ log "[WAIT] Found $in_progress_count story(ies) in-progress" "yellow" >&2
209
209
  fi
210
210
 
211
211
  echo "wait"
@@ -229,20 +229,21 @@ invoke_copilot() {
229
229
  local prompt=$(cat "$prompt_file")
230
230
  prompt="${prompt//\{TIMESTAMP\}/$(date "+%Y-%m-%d %H:%M:%S")}"
231
231
 
232
- log "[SESSION] New Copilot CLI session → Agent: $agent | Model: $COPILOT_MODEL | Action: $action_label" "magenta"
232
+ log "[SESSION] New Copilot CLI session → Model: $COPILOT_MODEL | Action: $action_label" "magenta"
233
233
 
234
234
  if $DRY_RUN; then
235
- log "[DRY RUN] Would execute: copilot --agent $agent --model $COPILOT_MODEL -p '...' --allow-all --no-ask-user" "yellow"
235
+ log "[DRY RUN] Would execute: copilot --model $COPILOT_MODEL -p '...' --allow-all --no-ask-user" "yellow"
236
236
  return 0
237
237
  fi
238
238
 
239
239
  # Execute Copilot CLI in programmatic mode (each -p call = new session)
240
- if echo "$prompt" | copilot \
241
- --agent "$agent" \
240
+ # NOTE: We do NOT use --agent to avoid the agent's menu/activation loop.
241
+ # The prompt itself contains all workflow instructions.
242
+ if copilot \
242
243
  --model "$COPILOT_MODEL" \
243
244
  --allow-all \
244
245
  --no-ask-user \
245
- -p - \
246
+ -p "$prompt" \
246
247
  2>&1; then
247
248
  log "[SUCCESS] Session completed: $action_label" "green"
248
249
  return 0
@@ -340,15 +341,15 @@ for ((iteration=1; iteration<=MAX_ITERATIONS; iteration++)); do
340
341
  case $action in
341
342
  "create-story")
342
343
  log "[ACTION] CREATE STORY (SM Agent → new session)" "yellow"
343
- invoke_copilot "sm" "$PROMPT_DIR/create-story.md" "create-story"
344
+ invoke_copilot "bmad-agent-bmm-sm" "$PROMPT_DIR/create-story.md" "create-story"
344
345
  ;;
345
346
  "dev-story")
346
347
  log "[ACTION] DEVELOP STORY (Dev Agent → new session)" "yellow"
347
- invoke_copilot "dev" "$PROMPT_DIR/dev-story.md" "dev-story"
348
+ invoke_copilot "bmad-agent-bmm-dev" "$PROMPT_DIR/dev-story.md" "dev-story"
348
349
  ;;
349
350
  "code-review")
350
351
  log "[ACTION] CODE REVIEW (Dev Agent → new session)" "yellow"
351
- if invoke_copilot "dev" "$PROMPT_DIR/code-review.md" "code-review"; then
352
+ if invoke_copilot "bmad-agent-bmm-dev" "$PROMPT_DIR/code-review.md" "code-review"; then
352
353
  invoke_git_commit
353
354
  fi
354
355
  ;;
@@ -1,41 +1,3 @@
1
- # BMAD Code Review — Copilot CLI Prompt
1
+ CR
2
2
 
3
- You are the BMAD Developer (Dev) agent performing an ADVERSARIAL code review. Execute the following command and complete the entire workflow:
4
-
5
- ```
6
- /bmad-bmm-code-review
7
- ```
8
-
9
- ## Your Role
10
-
11
- You are Amelia, the Developer, in code-review mode. Load your full persona from `_bmad/bmm/agents/dev.md` and execute the `code-review` workflow from `_bmad/bmm/workflows/4-implementation/code-review/workflow.yaml`.
12
-
13
- ## Instructions
14
-
15
- 1. Read `_bmad-output/implementation-artifacts/sprint-status.yaml` to find the NEXT story in `review` state
16
- 2. Read the story file from `_bmad-output/implementation-artifacts/stories/`
17
- 3. Load the code-review workflow and follow ALL steps
18
- 4. Perform an ADVERSARIAL review — find 3-10 specific problems
19
- 5. Check: code quality, test coverage, architecture compliance, security, performance
20
- 6. If issues found that you can auto-fix: FIX THEM, then re-review
21
- 7. Run all tests to verify fixes pass
22
- 8. When review passes: Update `sprint-status.yaml` — change the story status to `done`
23
-
24
- ## Automation Context
25
-
26
- - Timestamp: {TIMESTAMP}
27
- - This is an automated execution — proceed without user interaction
28
- - Use best judgment for any decisions that would normally require user input
29
- - NEVER accept "looks good" without thorough review — find minimum issues
30
- - Auto-fix issues where possible, document issues you cannot fix
31
- - All tests must pass after any fixes
32
- - Prioritize finding and fixing real issues
33
-
34
- ## Expected Outcome
35
-
36
- - Thorough adversarial code review completed
37
- - Any fixable issues resolved and tests passing
38
- - sprint-status.yaml updated with the story status changed to `done`
39
- - After this, the automation loop will auto-commit all changes
40
-
41
- Proceed with the workflow execution now.
3
+ Automation context: This is an automated BMAD sprint execution ({TIMESTAMP}). Skip the menu display — I am selecting menu item [CR] Code Review. Proceed immediately with the code-review workflow without asking questions. Find the NEXT story in `review` state in sprint-status.yaml, read the story file, perform an ADVERSARIAL review (find 3-10 specific problems), check code quality/test coverage/architecture compliance/security/performance, auto-fix all fixable issues, run all tests to verify fixes pass, and update sprint-status.yaml to `done`. Use best judgment for all decisions. NEVER accept "looks good" without thorough review.
@@ -1,36 +1,3 @@
1
- # BMAD Create Story — Copilot CLI Prompt
1
+ CS
2
2
 
3
- You are the BMAD Scrum Master (SM) agent. Execute the following command and complete the entire workflow:
4
-
5
- ```
6
- /bmad-bmm-create-story
7
- ```
8
-
9
- ## Your Role
10
-
11
- You are Bob, the Scrum Master. Load your full persona from `_bmad/bmm/agents/sm.md` and execute the `create-story` workflow from `_bmad/bmm/workflows/4-implementation/create-story/workflow.yaml`.
12
-
13
- ## Instructions
14
-
15
- 1. Read `_bmad-output/implementation-artifacts/sprint-status.yaml` to find the NEXT story in `backlog` state
16
- 2. Read the corresponding epic file to understand the story requirements
17
- 3. Load the create-story workflow and follow ALL steps
18
- 4. Create the story file in `_bmad-output/implementation-artifacts/stories/`
19
- 5. Update `sprint-status.yaml` — change the story status from `backlog` to `ready-for-dev`
20
- 6. Do NOT proceed to implement the story — only create the story file
21
-
22
- ## Automation Context
23
-
24
- - Timestamp: {TIMESTAMP}
25
- - This is an automated execution — proceed without user interaction
26
- - Use best judgment for any decisions that would normally require user input
27
- - If you encounter blocking issues, document them in the story file and move on
28
- - Prioritize completing the workflow over perfection
29
-
30
- ## Expected Outcome
31
-
32
- - A new story file created in the stories directory
33
- - sprint-status.yaml updated with the story status changed to `ready-for-dev`
34
- - The story file contains all acceptance criteria, tasks, and subtasks
35
-
36
- Proceed with the workflow execution now.
3
+ Automation context: This is an automated BMAD sprint execution ({TIMESTAMP}). Skip the menu display — I am selecting menu item [CS] Context Story. Proceed immediately with the create-story workflow without asking questions. Find the NEXT story in `backlog` state in sprint-status.yaml, create the story file, and update sprint-status.yaml to `ready-for-dev`. Use best judgment for all decisions. Do NOT implement the story — only create the story file.
@@ -1,40 +1,3 @@
1
- # BMAD Dev Story — Copilot CLI Prompt
1
+ DS
2
2
 
3
- You are the BMAD Developer (Dev) agent. Execute the following command and complete the entire workflow:
4
-
5
- ```
6
- /bmad-bmm-dev-story
7
- ```
8
-
9
- ## Your Role
10
-
11
- You are Amelia, the Developer. Load your full persona from `_bmad/bmm/agents/dev.md` and execute the `dev-story` workflow from `_bmad/bmm/workflows/4-implementation/dev-story/workflow.yaml`.
12
-
13
- ## Instructions
14
-
15
- 1. Read `_bmad-output/implementation-artifacts/sprint-status.yaml` to find the NEXT story in `ready-for-dev` state
16
- 2. Read the story file from `_bmad-output/implementation-artifacts/stories/`
17
- 3. Load the dev-story workflow and follow ALL steps
18
- 4. Implement every task and subtask defined in the story
19
- 5. Write comprehensive unit tests for ALL new code — tests must pass 100%
20
- 6. Update the story file to track completion of each task/subtask
21
- 7. Update `sprint-status.yaml` — change the story status from `ready-for-dev` to `review`
22
-
23
- ## Automation Context
24
-
25
- - Timestamp: {TIMESTAMP}
26
- - This is an automated execution — proceed without user interaction
27
- - Use best judgment for any decisions that would normally require user input
28
- - Follow ALL acceptance criteria precisely
29
- - Ensure all existing tests continue to pass
30
- - If you encounter blocking issues, document them and continue with what you can
31
- - Prioritize completing the implementation over perfection
32
-
33
- ## Expected Outcome
34
-
35
- - All tasks and subtasks in the story are implemented
36
- - Comprehensive unit tests written and passing
37
- - Story file updated with completion status
38
- - sprint-status.yaml updated with the story status changed to `review`
39
-
40
- Proceed with the workflow execution now.
3
+ Automation context: This is an automated BMAD sprint execution ({TIMESTAMP}). Skip the menu display — I am selecting menu item [DS] Dev Story. Proceed immediately with the dev-story workflow without asking questions. Find the NEXT story in `ready-for-dev` state in sprint-status.yaml, read the story file, implement ALL tasks and subtasks, write comprehensive unit tests (must pass 100%), update story file completion status, and update sprint-status.yaml to `review`. Use best judgment for all decisions. Follow ALL acceptance criteria precisely.