bmad-autopilot-addon 1.0.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.
Files changed (65) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +279 -0
  3. package/_bmad-addons/.secrets-allowlist +26 -0
  4. package/_bmad-addons/BMAD.md +216 -0
  5. package/_bmad-addons/install.sh +495 -0
  6. package/_bmad-addons/manifest.yaml +22 -0
  7. package/_bmad-addons/modules/git/branching-and-pr-strategy.md +101 -0
  8. package/_bmad-addons/modules/git/config.yaml +83 -0
  9. package/_bmad-addons/modules/git/templates/commit-patch.txt +1 -0
  10. package/_bmad-addons/modules/git/templates/commit-story.txt +1 -0
  11. package/_bmad-addons/modules/git/templates/pr-body.md +20 -0
  12. package/_bmad-addons/modules/ma/config.yaml +9 -0
  13. package/_bmad-addons/scripts/create-pr.sh +198 -0
  14. package/_bmad-addons/scripts/detect-platform.sh +89 -0
  15. package/_bmad-addons/scripts/health-check.sh +107 -0
  16. package/_bmad-addons/scripts/lint-changed.sh +292 -0
  17. package/_bmad-addons/scripts/lock.sh +111 -0
  18. package/_bmad-addons/scripts/sanitize-branch.sh +83 -0
  19. package/_bmad-addons/scripts/stage-and-commit.sh +168 -0
  20. package/_bmad-addons/scripts/sync-status.sh +138 -0
  21. package/_bmad-addons/skills/bmad-autopilot-off/SKILL.md +6 -0
  22. package/_bmad-addons/skills/bmad-autopilot-off/workflow.md +154 -0
  23. package/_bmad-addons/skills/bmad-autopilot-on/SKILL.md +6 -0
  24. package/_bmad-addons/skills/bmad-autopilot-on/workflow.md +998 -0
  25. package/_bmad-addons/skills/bmad-ma-assess/SKILL.md +6 -0
  26. package/_bmad-addons/skills/bmad-ma-assess/agents/debt-classifier.md +64 -0
  27. package/_bmad-addons/skills/bmad-ma-assess/agents/dependency-auditor.md +57 -0
  28. package/_bmad-addons/skills/bmad-ma-assess/agents/migration-analyzer.md +62 -0
  29. package/_bmad-addons/skills/bmad-ma-assess/workflow.md +114 -0
  30. package/_bmad-addons/skills/bmad-ma-code-review/SKILL.md +6 -0
  31. package/_bmad-addons/skills/bmad-ma-code-review/agents/acceptance-auditor.md +51 -0
  32. package/_bmad-addons/skills/bmad-ma-code-review/agents/blind-hunter.md +39 -0
  33. package/_bmad-addons/skills/bmad-ma-code-review/agents/edge-case-hunter.md +46 -0
  34. package/_bmad-addons/skills/bmad-ma-code-review/workflow.md +111 -0
  35. package/_bmad-addons/skills/bmad-ma-codebase-map/SKILL.md +6 -0
  36. package/_bmad-addons/skills/bmad-ma-codebase-map/agents/architecture-mapper.md +129 -0
  37. package/_bmad-addons/skills/bmad-ma-codebase-map/agents/concerns-hunter.md +132 -0
  38. package/_bmad-addons/skills/bmad-ma-codebase-map/agents/integration-mapper.md +138 -0
  39. package/_bmad-addons/skills/bmad-ma-codebase-map/agents/quality-assessor.md +143 -0
  40. package/_bmad-addons/skills/bmad-ma-codebase-map/agents/stack-analyzer.md +123 -0
  41. package/_bmad-addons/skills/bmad-ma-codebase-map/workflow.md +120 -0
  42. package/_bmad-addons/skills/bmad-ma-migrate/SKILL.md +6 -0
  43. package/_bmad-addons/skills/bmad-ma-migrate/agents/dependency-analyzer.md +51 -0
  44. package/_bmad-addons/skills/bmad-ma-migrate/agents/risk-assessor.md +55 -0
  45. package/_bmad-addons/skills/bmad-ma-migrate/agents/stack-mapper.md +49 -0
  46. package/_bmad-addons/skills/bmad-ma-migrate/agents/test-parity-analyzer.md +49 -0
  47. package/_bmad-addons/skills/bmad-ma-migrate/resources/coexistence-patterns.md +59 -0
  48. package/_bmad-addons/skills/bmad-ma-migrate/resources/strategies.md +43 -0
  49. package/_bmad-addons/skills/bmad-ma-migrate/templates/component-card.md +11 -0
  50. package/_bmad-addons/skills/bmad-ma-migrate/templates/migration-epics.md +35 -0
  51. package/_bmad-addons/skills/bmad-ma-migrate/templates/migration-plan.md +66 -0
  52. package/_bmad-addons/skills/bmad-ma-migrate/workflow.md +235 -0
  53. package/_bmad-addons/skills/bmad-ma-party-mode/SKILL.md +6 -0
  54. package/_bmad-addons/skills/bmad-ma-party-mode/workflow.md +138 -0
  55. package/_bmad-addons/skills/bmad-ma-research/SKILL.md +6 -0
  56. package/_bmad-addons/skills/bmad-ma-research/workflow.md +128 -0
  57. package/_bmad-addons/skills/bmad-ma-reverse-architect/SKILL.md +6 -0
  58. package/_bmad-addons/skills/bmad-ma-reverse-architect/agents/component-mapper.md +53 -0
  59. package/_bmad-addons/skills/bmad-ma-reverse-architect/agents/data-flow-tracer.md +54 -0
  60. package/_bmad-addons/skills/bmad-ma-reverse-architect/agents/pattern-extractor.md +67 -0
  61. package/_bmad-addons/skills/bmad-ma-reverse-architect/workflow.md +119 -0
  62. package/_bmad-addons/templates/agent-rules.md +43 -0
  63. package/_bmad-addons/uninstall.sh +204 -0
  64. package/bin/bmad-autopilot-addon.sh +48 -0
  65. package/package.json +32 -0
@@ -0,0 +1,138 @@
1
+ #!/bin/bash
2
+ # Write git metadata to git-status.yaml (addon-owned file).
3
+ # NEVER modifies sprint-status.yaml (BMAD-owned).
4
+ #
5
+ # Usage: sync-status.sh --story <key> --git-status-file <path> \
6
+ # [--branch <name>] [--commit <sha>] [--patch-commits <sha,...>] \
7
+ # [--push-status <status>] [--pr-url <url>] [--lint-result <text>] \
8
+ # [--worktree <path>] [--platform <name>] [--base-branch <name>]
9
+ #
10
+ # Reads existing git-status.yaml and updates the story entry.
11
+ # Creates the file if it doesn't exist.
12
+ # Uses atomic write (same-dir tmp + mv).
13
+ set -e
14
+
15
+ STORY=""
16
+ GIT_STATUS_FILE=""
17
+ BRANCH=""
18
+ WORKTREE=""
19
+ STORY_COMMIT=""
20
+ PATCH_COMMITS=""
21
+ PUSH_STATUS="pending"
22
+ PR_URL=""
23
+ LINT_RESULT=""
24
+ PLATFORM=""
25
+ BASE_BRANCH="main"
26
+ WORKTREE_CLEANED="false"
27
+
28
+ while [ "$#" -gt 0 ]; do
29
+ case $1 in
30
+ --story) STORY="$2"; shift 2 ;;
31
+ --git-status-file) GIT_STATUS_FILE="$2"; shift 2 ;;
32
+ --branch) BRANCH="$2"; shift 2 ;;
33
+ --worktree) WORKTREE="$2"; shift 2 ;;
34
+ --commit) STORY_COMMIT="$2"; shift 2 ;;
35
+ --patch-commits) PATCH_COMMITS="$2"; shift 2 ;;
36
+ --push-status) PUSH_STATUS="$2"; shift 2 ;;
37
+ --pr-url) PR_URL="$2"; shift 2 ;;
38
+ --lint-result) LINT_RESULT="$2"; shift 2 ;;
39
+ --platform) PLATFORM="$2"; shift 2 ;;
40
+ --base-branch) BASE_BRANCH="$2"; shift 2 ;;
41
+ --worktree-cleaned) WORKTREE_CLEANED="$2"; shift 2 ;;
42
+ -h|--help)
43
+ echo "Usage: sync-status.sh --story <key> --git-status-file <path> [git fields...]"
44
+ exit 0
45
+ ;;
46
+ *) shift ;;
47
+ esac
48
+ done
49
+
50
+ if [ -z "$STORY" ] || [ -z "$GIT_STATUS_FILE" ]; then
51
+ echo "ERROR: --story and --git-status-file required" >&2
52
+ exit 1
53
+ fi
54
+
55
+ # Ensure parent directory exists
56
+ mkdir -p "$(dirname "$GIT_STATUS_FILE")"
57
+
58
+ # Read existing file or start fresh
59
+ if [ -f "$GIT_STATUS_FILE" ]; then
60
+ EXISTING=$(cat "$GIT_STATUS_FILE")
61
+ else
62
+ EXISTING=""
63
+ fi
64
+
65
+ # YAML-safe quoting: wrap values that may contain special chars
66
+ yaml_safe() {
67
+ local val="$1"
68
+ # Quote if contains : { } [ ] , & * # ? | - < > = ! % @ ` or newlines
69
+ case "$val" in
70
+ *[:\{\}\[\],\&\*\#\?\|\-\<\>\=\!\%\@\`]*|*"
71
+ "*) printf '"%s"' "$(echo "$val" | sed 's/"/\\"/g')" ;;
72
+ *) printf '%s' "$val" ;;
73
+ esac
74
+ }
75
+
76
+ # Build the story entry
77
+ STORY_BLOCK=" ${STORY}:"
78
+ [ -n "$BRANCH" ] && STORY_BLOCK="$STORY_BLOCK
79
+ branch: $(yaml_safe "$BRANCH")"
80
+ [ -n "$WORKTREE" ] && STORY_BLOCK="$STORY_BLOCK
81
+ worktree: $(yaml_safe "$WORKTREE")"
82
+ [ -n "$STORY_COMMIT" ] && STORY_BLOCK="$STORY_BLOCK
83
+ story_commit: $(yaml_safe "$STORY_COMMIT")"
84
+ [ -n "$PATCH_COMMITS" ] && STORY_BLOCK="$STORY_BLOCK
85
+ patch_commits: [${PATCH_COMMITS}]"
86
+ [ -n "$LINT_RESULT" ] && STORY_BLOCK="$STORY_BLOCK
87
+ lint_result: $(yaml_safe "$LINT_RESULT")"
88
+ STORY_BLOCK="$STORY_BLOCK
89
+ push_status: $(yaml_safe "$PUSH_STATUS")"
90
+ [ -n "$PR_URL" ] && STORY_BLOCK="$STORY_BLOCK
91
+ pr_url: $(yaml_safe "$PR_URL")"
92
+ STORY_BLOCK="$STORY_BLOCK
93
+ worktree_cleaned: ${WORKTREE_CLEANED}"
94
+
95
+ # If file exists and has this story, replace that story's block
96
+ # If file exists without this story, append under stories:
97
+ # If file doesn't exist, create fresh
98
+ TMP_FILE="${GIT_STATUS_FILE}.tmp"
99
+
100
+ if [ -z "$EXISTING" ]; then
101
+ # Create new file
102
+ cat > "$TMP_FILE" <<EOF
103
+ # BMAD Autopilot Add-On — Git Status
104
+ # Tracks git metadata per story. Do not edit manually.
105
+ git_integration:
106
+ enabled: true
107
+ base_branch: ${BASE_BRANCH}
108
+ platform: ${PLATFORM}
109
+
110
+ stories:
111
+ ${STORY_BLOCK}
112
+ EOF
113
+ elif echo "$EXISTING" | grep -q "^ ${STORY}:"; then
114
+ # Replace existing story block
115
+ # Write replacement block to temp file (awk -v can't handle embedded newlines on macOS)
116
+ BLOCK_FILE="${GIT_STATUS_FILE}.block"
117
+ printf '%s\n' "$STORY_BLOCK" > "$BLOCK_FILE"
118
+ awk -v story=" ${STORY}:" -v blockfile="$BLOCK_FILE" '
119
+ $0 == story {
120
+ skip=1
121
+ while ((getline line < blockfile) > 0) print line
122
+ close(blockfile)
123
+ next
124
+ }
125
+ skip && /^ [^ ]/ { skip=0 }
126
+ skip { next }
127
+ { print }
128
+ ' "$GIT_STATUS_FILE" > "$TMP_FILE"
129
+ rm -f "$BLOCK_FILE"
130
+ else
131
+ # Append new story
132
+ printf '%s\n%s\n' "$EXISTING" "$STORY_BLOCK" > "$TMP_FILE"
133
+ fi
134
+
135
+ # Atomic rename
136
+ mv "$TMP_FILE" "$GIT_STATUS_FILE"
137
+
138
+ echo "OK:${STORY}:push=${PUSH_STATUS}"
@@ -0,0 +1,6 @@
1
+ ---
2
+ name: bmad-autopilot-off
3
+ description: 'Disengage autonomous BMAD execution mode with git status report. Reports sprint position, completed work, git branch/PR status, and next steps. Releases the autopilot lock file. Use when user says "/bmad-autopilot-off" or "stop autopilot" or "pause autopilot".'
4
+ ---
5
+
6
+ Follow the instructions in ./workflow.md.
@@ -0,0 +1,154 @@
1
+ # BMAD Autopilot — OFF (Enhanced with Git Status)
2
+
3
+ ## Purpose
4
+
5
+ Disengage autopilot mode. Produce a complete status report including git branch/PR status, release the autopilot lock, and consult `bmad-help` for the exact next recommended step.
6
+
7
+ ---
8
+
9
+ ## INITIALIZATION
10
+
11
+ Load config: `{project-root}/_bmad/bmm/config.yaml`
12
+
13
+ Resolve:
14
+ - `implementation_artifacts`
15
+ - `status_file` = `{implementation_artifacts}/sprint-status.yaml` (BMAD-owned, read only)
16
+ - `git_status_file` = `{implementation_artifacts}/git-status.yaml` (addon-owned git fields)
17
+ - `decision_log_file` = `{implementation_artifacts}/decision-log.yaml`
18
+ - `planning_artifacts`
19
+ - `project_root` = absolute path of current working directory
20
+
21
+ ### Git integration check
22
+
23
+ <action>Check if `{project-root}/_bmad-addons/manifest.yaml` exists</action>
24
+ <check if="manifest exists">
25
+ <action>Read manifest → set `{{git_enabled}}` from `git.enabled`</action>
26
+ </check>
27
+ <check if="manifest does NOT exist">
28
+ <action>Set `{{git_enabled}}` = false</action>
29
+ </check>
30
+
31
+ ---
32
+
33
+ ## EXECUTION
34
+
35
+ ### Step 1 — Exit worktree if active
36
+
37
+ <check if="current working directory appears to be inside a worktree (check if `.worktrees/` is in the path or run `git rev-parse --show-toplevel` and compare to project_root)">
38
+ <action>Commit any uncommitted work if possible</action>
39
+ <action>`cd` to project root — preserve worktree for later resume</action>
40
+ <action>Log: "Exited worktree, returned to project root"</action>
41
+ </check>
42
+
43
+ ### Step 2 — Load sprint state
44
+
45
+ Read `{status_file}` fully.
46
+
47
+ If `{status_file}` does not exist:
48
+ > "No sprint-status.yaml found. Run `/bmad-sprint-planning` first, or `/bmad-autopilot-on` to start from the beginning."
49
+ > Stop.
50
+
51
+ ### Step 3 — Summarize completed and in-progress work
52
+
53
+ Scan all entries in sprint-status:
54
+ - Count stories with status `done` — list them grouped by epic
55
+ - Find the first story that is `in-progress` or `ready-for-dev` — this is the current position
56
+ - Count remaining stories not yet `done`
57
+
58
+ ### Step 4 — Collect git status (if enabled)
59
+
60
+ <check if="{{git_enabled}}">
61
+ <action>Read `{git_status_file}` (addon's git-status.yaml) if it exists</action>
62
+ <action>Extract `git_integration` block (platform, base_branch)</action>
63
+ <action>For each story in `stories:` section:
64
+ - Note `branch`, `push_status`, `pr_url`, `worktree_cleaned`
65
+ </action>
66
+ <action>Check for active worktrees: `git worktree list --porcelain 2>/dev/null`</action>
67
+ <action>Check current branch: `git branch --show-current 2>/dev/null`</action>
68
+ </check>
69
+
70
+ ### Step 5 — Consult bmad-help for next action
71
+
72
+ Invoke `bmad-help` with the question: "Where are we in the sprint and what is the next required step?"
73
+
74
+ Extract the recommended next skill and any important context.
75
+
76
+ ### Step 6 — Release lock
77
+
78
+ <check if="{{git_enabled}}">
79
+ <action>Release lock: `bash {{project_root}}/_bmad-addons/scripts/lock.sh release`</action>
80
+ </check>
81
+
82
+ ### Step 7 — Collect decision log
83
+
84
+ <action>Read `{decision_log_file}` if it exists</action>
85
+ <action>Collect:
86
+ - All decisions with impact `medium` or `high`
87
+ - Count of `review-accept` entries (patches applied)
88
+ - Count of `review-triage` entries (findings dismissed)
89
+ - Per-story summary: patches applied and findings dismissed
90
+ </action>
91
+
92
+ ### Step 8 — Produce status report
93
+
94
+ Output to user (use exact format):
95
+
96
+ ```
97
+ ╔═══════════════════════════════════════════════════════════════╗
98
+ ║ BMAD AUTOPILOT — STATUS REPORT ║
99
+ ╚═══════════════════════════════════════════════════════════════╝
100
+
101
+ SUMMARY
102
+ Stories completed : {{done_count}}/{{total_stories}}
103
+ Epics completed : {{done_epics}}/{{total_epics}}
104
+ {{#if git_enabled}}
105
+ Platform : {{platform}}
106
+ {{/if}}
107
+
108
+ STORIES
109
+ {{#each epic}}
110
+ Epic {{epic_number}}: {{epic_title}}
111
+ {{#each stories}}
112
+ {{#if done}}✓{{else}}{{#if in_progress}}▶{{else}}·{{/if}}{{/if}} {{story-key}}{{#if done}}{{#if pr_url}} PR: {{pr_url}}{{/if}}{{/if}}{{#if in_progress}} ← current{{/if}}
113
+ {{/each}}
114
+ {{/each}}
115
+
116
+ {{#if medium_high_decisions}}
117
+ DECISIONS REQUIRING REVIEW (high/medium impact)
118
+ {{#each medium_high_decisions}}
119
+ #{{id}} [{{impact}}] {{story}} / {{phase}}
120
+ {{decision}}
121
+ → {{rationale}}
122
+ {{/each}}
123
+
124
+ Full log: {decision_log_file}
125
+ {{/if}}
126
+
127
+ {{#if has_review_data}}
128
+ REVIEW FINDINGS APPLIED
129
+ Patches applied : {{total_patches}}
130
+ Findings dismissed : {{total_dismissed}}
131
+
132
+ CODE REVIEW SUMMARY (per story)
133
+ {{#each reviewed_stories}}
134
+ {{story-key}} : {{patches_applied}} patches applied, {{findings_dismissed}} dismissed
135
+ {{/each}}
136
+ {{/if}}
137
+
138
+ {{#if git_enabled}}
139
+ GIT STATUS
140
+ {{#each stories_with_git_fields}}
141
+ {{story-key}}: branch={{branch}} push={{push_status}} {{#if pr_url}}PR: {{pr_url}}{{/if}}
142
+ {{/each}}
143
+ Active worktrees: {{worktree_count}}
144
+ Lock: released
145
+ {{/if}}
146
+
147
+ NEXT REQUIRED STEP (from bmad-help)
148
+ {{next_skill_name}} — {{next_skill_description}}
149
+
150
+ WHAT TO DO NEXT
151
+ 1. Review decisions marked medium/high above (if any)
152
+ 2. TO RESUME AUTOPILOT: /bmad-autopilot-on
153
+ 3. TO CONTINUE MANUALLY: /{{next-skill-name}}
154
+ ```
@@ -0,0 +1,6 @@
1
+ ---
2
+ name: bmad-autopilot-on
3
+ description: 'Engage autonomous BMAD execution with git workflow integration. Implements stories end-to-end with automatic branching (git worktrees), commits, linting, and PR creation. Uses standard git worktree commands for story isolation — works with any coding agent. Falls back to stock BMAD behavior when git is disabled. Use when user says "/bmad-autopilot-on" or "start autopilot".'
4
+ ---
5
+
6
+ Follow the instructions in ./workflow.md.