DEV Community

popiol
popiol

Posted on

How I improved BMAD with one simple skill

When asked how I evaluate BMAD recently I said haven't quite decided yet, but it definitely has strong sides and makes development faster. Of course, it dependss what you are currently work on. If you work in scrum and handle single tasks from Jira, you probably won't fin BMAD useful in any way. It's strength is in handling large projects which have to be taken from brainstorming, through requirement specification to proper design and implementation plan. BMAD does really good job in asking the right questions and pushing you into providing all necessary details. The only thing I found a bit discouraging was the boring implementation phase where you just keep clicking approve.

I was recently pointed to Superpowers framework, which apparently deosn't have that problem and does the implementation part without human interaction. I tested it, but to be honest I wasn't impressed. In my case it didn't work so good. The whole planning phase comes down to brainstorming and implementation plan. This is clearly not meant to be handling large complex projects. In BMAD you have several distinct steps where each of them is handled with care and brings value to the final design. First, the brainstorming in BMAD pushes you into providing all available information, any documents you may already have and then asks a bunch of questions. Superpowers is more like: give me a brief intro and I will make up the rest. In BMAD, brainstorming is just the start, then you go to PRD, UX and architecture. You have to really spend some time to get it right, but that's exactly the real value, you spend the effort on planning, but save long hours of searching for bugs in the implementation or re-implementing the solution.

Having said that, I am going to keep using BMAD, but there is still the issue I mentioned, and it has to be taken care of. The implementation itself is a pain. It's not just the approval thing, this can be fixed easily, by running cluade with --dangerously-skip-permissions, which is not as dangerous as it sounds. If you just have the agent write some code, there's no much risk it will do any harm to your system. In worst case it can write bad code - I can take that risk. But that's not the only problem. The whole imlpementation consists of multiple cyclic steps:

  1. create story
  2. dev story
  3. commit and push

It gets more complicated if you want to manually review each commit, but I figured it is more efficient to review final result rather than each step. However, you could still extend the steps with auto review:

  1. create story
  2. dev story
  3. review and fix (repeat until no issues)
  4. commit and push

So, these are the steps I want to run autonomously, it shouldn't stop to ask me for permissions, it should only stop if a real blocker is faced. The names of commit should refer to the story names. It should be able to continue from current state if interrupted. Also, I don't want all the stories to be implemented in a single session and have the context grow just to spend extra tokens on pointless context comperession. Each story should be implemented independantly with a new context.

The first thought was to write a python script that would run the steps in a loop. Seems to make sense, right? But luckly, I soon realized there is an even easier way to do it - a skill! I can simply describe to the agent what has to be done. There will be the main agent that will spawn sub-agents for each story and it will keep doing it in a loop until all stories are done. And that's the final result:

# BMAD Automation Loop

Orchestrate the full BMAD story implementation loop unattended. For each story, spawn a subagent to do the work in an isolated context, then loop until no new commits are made.

## Orchestrator steps (this session)

### 1. Check for a clean working tree (once, before the loop)

```bash
git status --porcelain
```

If any output is returned, **stop with failure**: "❌ Working tree is not clean. Commit or stash changes before running bmad-loop."

Log: "βœ… Working tree is clean. Starting bmad-loop."

---

Repeat the following loop, keeping a counter starting at 1:

### 2. Record the current commit hash

```bash
git log -1 --format="%H" HEAD
```

Store this as `$HASH_BEFORE`.

Log: "πŸ”„ Story #$COUNTER β€” running bmad-create-story..."

### 3. Spawn a subagent via the Task tool

Pass the following as the subagent prompt:

> You are implementing a single BMAD story. Complete these steps in order and do not stop until all are done:
>
> 1. Run `/bmad-create-story` and wait for it to complete fully.
> 2. Find the uncommitted story file:
>    ```bash
>    git diff --name-only HEAD -- '_bmad-output/implementation-artifacts/*.md'
>    ```
>    If no file is returned, stop β€” there is nothing to implement.
> 3. Extract the story title from that file:
>    ```bash
>    grep -m1 '^# Story' <file>
>    ```
>    Strip the leading `# ` to get `$STORY_TITLE` (e.g. `Story 5.5: Boss Match Flow & Chapter Unlock`).
>    If no matching line exists, stop with an error.
> 4. Log: "πŸ“– Implementing: $STORY_TITLE"
> 5. Run `/bmad-dev` and wait for it to complete fully.
> 6. Run:
>    ```bash
>    git add .
>    git commit -m "$STORY_TITLE"
>    git push
>    ```
> 7. Log: "βœ… Committed and pushed: $STORY_TITLE"

### 4. Check whether anything was committed

```bash
git log -1 --format="%H" HEAD
```

If the hash matches `$HASH_BEFORE`, log "🏁 No new commit detected β€” bmad-loop complete." and **stop**.
Otherwise increment `$COUNTER`, log "βœ… Story #$COUNTER done." and go back to step 2.

## Rules

- The orchestrator never runs `/bmad-create-story` or `/bmad-dev` directly β€” always delegates to a subagent.
- The commit message must be exactly `$STORY_TITLE` β€” no prefix, no suffix, no surrounding quotes.
- Never proceed to the next story if the git push failed.
- If `/bmad-create-story` or `/bmad-dev` produces errors or unresolved TODOs, the subagent must stop without committing.
- If the specification is ambiguous or unclear, the subagent must never ask the user for clarification. Instead, stop with failure: "❌ Ambiguous specification: [reason]. Please clarify before re-running bmad-loop."
Enter fullscreen mode Exit fullscreen mode

This works perfectly and makes my life easier. This way I was able to come down with implementation time from several days to several hours. This was the missing part of BMAD for me. I simlpy add it to .claude/skills/bmad-loop/SKILL.md, run claude with --dangerously-skip-permissions and trigger /bmad-loop. It only stops when running out of tokens or facing serious design flaw.

Top comments (0)