stephenleo/bmad-autonomous-development/bad
Claude Code and agent skill by stephenleo/bmad-autonomous-development
- community
Checking that the SKILL.md file is still in the repository.
BMad Autonomous Development — orchestrates parallel story implementation pipelines. Builds a dependency graph, updates PR status from GitHub, picks stories from the backlog, and runs each through create → dev → review → PR in parallel — each story isolated in its own git worktree — using dedicated subagents with fresh context windows. Loops through the entire sprint plan in batches, with optional epic retrospective. Use when the user says "run BAD", "start autonomous development", "automate the sprint", "run the pipeline", "kick off the sprint", or "start the dev pipeline". Run /bad setup or /bad configure to install and configure the module.
Install
npx vskill@latest install stephenleo/bmad-autonomous-development/badSKILL.md
BAD — BMad Autonomous Development
On Activation
Check if {project-root}/_bmad/config.yaml contains a bad section. If not — or if the user passed setup or configure as an argument — load ./assets/module-setup.md and complete registration before proceeding.
The setup/configure argument always triggers ./assets/module-setup.md, even if the module is already registered (for reconfiguration).
After setup completes (or if config already exists), load the bad config and continue to Startup below.
You are a coordinator. You delegate every step to subagents via the Agent tool. You never read files, run git/gh commands, or write to disk yourself.
Coordinator-only responsibilities:
- Pick stories from subagent-reported data
- Call the Agent tool to spawn subagents (in parallel where allowed — multiple Agent tool calls in one message)
- Manage timers (CronCreate / CronDelete)
- Run Pre-Continuation Checks (requires session stdin JSON — coordinator only)
- Handle user input, print summaries, and send channel notifications
Everything else — file reads, git operations, gh commands, disk writes — happens inside Agent tool subagents with fresh context windows.
Startup: Capture Channel Context
Before doing anything else, determine how to send notifications:
- Check for a connected channel — look at the current conversation context:
- If you see a
<channel source="telegram" chat_id="..." ...>tag, saveNOTIFY_CHAT_IDandNOTIFY_SOURCE="telegram". - If another channel type is connected, save its equivalent identifier.
- If no channel is connected, set
NOTIFY_SOURCE="terminal".
- Send the BAD started notification using the Notify Pattern:
`` 🤖 BAD started — building dependency graph... ``
Then proceed to Phase 0.
Configuration
Load base values from the bad section of _bmad/config.yaml at startup. Then parse any KEY=VALUE overrides from arguments passed to /bad — args win over config. For any variable not in config or args, use the default below.
| Variable | Config Key | Default | Description | |
|---|---|---|---|---|
MAX_PARALLEL_STORIES | max_parallel_stories | 3 | Max stories to run in a single batch | |
WORKTREE_BASE_PATH | worktree_base_path | .worktrees | Root directory for git worktrees | |
MODEL_STANDARD | model_standard | sonnet | Model for all subagents except Step 5 (code review): Phase 0, Phase 1 Epic-Start, Steps 1–4 and 6–7, Phase 3 (merge + cleanup), Phase 4 (assessment + retrospective) | |
MODEL_QUALITY | model_quality | opus | Model for Step 5 (code review) | |
RETRO_TIMER_SECONDS | retro_timer_seconds | 600 | Auto-retrospective countdown after epic completion (10 min) | |
WAIT_TIMER_SECONDS | wait_timer_seconds | 3600 | Post-batch wait before re-checking PR status (1 hr) | |
CONTEXT_COMPACTION_THRESHOLD | context_compaction_threshold | 80 | Context window % at which to compact/summarise context | |
STALE_TIMEOUT_MINUTES | stale_timeout_minutes | 60 | Minutes of subagent inactivity before watchdog alerts (0 = disabled) | |
TIMER_SUPPORT | timer_support | true | When true, use native platform timers; when false, use prompt-based continuation | |
MONITOR_SUPPORT | monitor_support | true | When true, use the Monitor tool for CI and PR-merge polling; when false, fall back to manual polling loops (required for Bedrock/Vertex/Foundry) | |
API_FIVE_HOUR_THRESHOLD | api_five_hour_threshold | 80 | (Claude Code) 5-hour rate limit % that triggers a pause | |
API_SEVEN_DAY_THRESHOLD | api_seven_day_threshold | 95 | (Claude Code) 7-day rate limit % that triggers a pause | |
API_USAGE_THRESHOLD | api_usage_threshold | 80 | (Other harnesses) Generic API usage % that triggers a pause | |
RUN_CI_LOCALLY | run_ci_locally | false | When true, skip GitHub Actions and always run the local CI fallback | |
AUTO_PR_MERGE | auto_pr_merge | false | When true, auto-merge batch PRs sequentially (lowest → highest) before Phase 4 |
After resolving all values, print the active configuration so the user can confirm before Phase 0 begins:
Pipeline
Phase 0: Build or Update the Dependency Graph
Before spawning the subagent, create the full initial task list using TaskCreate so the user can see the complete pipeline at a glance. Mark Phase 0 in_progress; all others start as [ ]. Apply the Phase 3 rule at creation time:
Call the Agent tool with model: MODEL_STANDARD, description: "Phase 0: dependency graph", and this prompt. The coordinator waits for the report.
The coordinator uses the report to drive Phase 1. No coordinator-side file reads.
📣 Notify after Phase 0:
After Phase 0 completes, rebuild the task list in correct execution order — tasks display in creation order, so delete and re-add to ensure Phase 2 story tasks appear before Phase 3 and Phase 4:
- Mark
Phase 0: Dependency graph→completed - Mark
Phase 1: Story selection→completed(already done) - Delete all nine generic startup tasks: the seven
Phase 2: Step Ntasks,Phase 3: Auto-merge, andPhase 4: Batch summary + continuation - Re-add in execution order using TaskCreate:
Update each story step task to in_progress when its subagent is spawned, and completed (or failed) when it reports back. Update Phase 3 and Phase 4 tasks similarly as they execute.
Phase 1: Discover Stories
Pure coordinator logic — no file reads, no tool calls.
- From Phase 0's
ready_storiesreport, select at mostMAX_PARALLEL_STORIESstories.
- Epic ordering is strictly enforced: only pick stories from the lowest incomplete epic. Never pick a story from epic N if any story in epic N-1 (or earlier) is not yet merged — check this against the Phase 0 report.
- If no stories are ready → report to the user which stories are blocked (from Phase 0 warnings), then jump to Phase 4, Step 3 (Gate & Continue).
- Epic transition detection: Compare the selected stories' epic to
CURRENT_EPIC(a coordinator variable, initially unset).
- If
CURRENT_EPICis unset or the selected stories belong to a different epic → updateCURRENT_EPICand run Epic-Start Test Design (below) as a blocking subagent before Phase 2 begins. - Otherwise → proceed directly to Phase 2.
Why epic ordering matters: Stories in later epics build on earlier epics' code and product foundation. Starting epic 3 while epic 2 has open PRs risks merge conflicts and building on code that may still change.
Epic-Start Test Design (MODEL_STANDARD)
Spawn before Phase 2 when starting a new epic (blocking — wait for completion before story pipelines begin):
Phase 2: Run the Pipeline
Launch all stories' Step 1 subagents in a single message (parallel). Each story's steps are strictly sequential — do not spawn step N+1 until step N reports success.
Skip steps based on story status (from Phase 0 report):
| Status | Start from | Skip | |
|---|---|---|---|
backlog | Step 1 | nothing | |
ready-for-dev | Step 2 | Step 1 | |
atdd-done | Step 3 | Steps 1–2 | |
in-progress | Step 3 | Steps 1–2 | |
review | Step 4 | Steps 1–3 | |
done | — | all |
After each step — mandatory gate (never skip, even with parallel stories): 📣 Notify the step result (formats below), then run Pre-Continuation Checks (references/coordinator/gate-pre-continuation.md). Only after all checks pass → spawn the next subagent.
📣 Notify per step as each step completes:
- Success:
✅ Story {number}: Step {N} — {step name} - Failure:
❌ Story {number}: Step {N} — {step name} failed — {brief error}
Step names: Step 1 — Create, Step 2 — ATDD, Step 3 — Develop, Step 4 — Test review, Step 5 — Code review, Step 6 — PR + CI, Step 7 — PR review.
On failure: stop that story's pipeline. Report step, story, and error. Other stories continue. Exception: rate/usage limit failures → run Pre-Continuation Checks (which auto-pauses until reset) then retry.
Hung subagents: when MONITOR_SUPPORT=true and the activity log hook is installed (Step 4 of setup), use the Watchdog Pattern when spawning Steps 2, 3, 4, and 5 to detect stale agents.
Step 1: Create Story (MODEL_STANDARD)
Spawn with model MODEL_STANDARD (yolo mode):
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/bad/SKILL.md
Popularity
- Repository stars
- 107
- Repository forks
- 15
- 7-day trend score
- 23
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/stephenleo/bmad-autonomous-development/bad)