Index of every page on this site: llms.txt
All skills
aj-geddes avatar

/bmad-parallel-plan

@27dca0e
Run it yourself

Turns a sequential, ready-for-dev story backlog into conflict-free CONCURRENT WAVES. Builds a dependency DAG from epic order, per-story dependency maps, and Owned File/Module Scope overlaps, then topologically sorts it into parallel waves of mutually disjoint, dependency-satisfied stories (capped by maxParallel), and emits a parallelization-plan.md with per-story git-worktree branch names and an ordered merge sequence. Use when the user says "plan parallel work", "which stories can run in parallel", "parallelize the backlog", "build the wave plan", "parallelization plan", "conflict-free workstreams", "what can we run concurrently", "split into worktrees", "dependency graph for the stories", "merge order", or "how do I fan this backlog out to multiple dev agents". Run AFTER stories are ready-for-dev (scrum-master) and an architecture exists. This skill PLANS parallelism only — it does NOT run agents, spawn worktrees, write code, run tests, or perform git operations.

Use this Skill: https://skilld.dev/gh/aj-geddes/claude-code-bmad-skills/bmad-parallel-plan

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

REFERENCE.md

≈2.1k tokens on demand. Your agent reads this file only when SKILL.md points to it.

BMAD Parallel Plan — Reference

Detailed mechanics for turning a sequential backlog into conflict-free concurrent waves. This file documents the conflict classes, the wave algorithm, and the merge-order rationale. The skill plans; it does not execute.


1. Why architecture comes first

Parallelism is only safe when the work items are isolated. Two kinds of collision exist:

  • Syntactic / file collision — two stories edit the same file. Git surfaces this as a merge conflict. Cheap to detect (compare Owned File/Module Scopes), cheap to catch.
  • Semantic collision — two stories edit different files but change the same behavior, contract, or shared invariant (e.g. both alter the auth flow, the DB schema, or a shared type). Git will not flag it; it surfaces as a broken integration.

A clean architecture (clear module boundaries, explicit shared modules) is what prevents semantic collisions. So step 1 of the skill is to read architecture.md and enumerate the shared / cross-cutting modules. Any two stories that both touch a shared module are treated as semantically conflicting even if their file scopes are disjoint.


2. Conflict classes (edge types in the DAG)

Class Direction Source Effect
Ordering — epic directed epic order; stories within one epic are usually sequential story B depends_on the prior story in its epic unless the story explicitly marks itself epic-parallel
Ordering — explicit directed a story's Dependency Maps / depends_on list B cannot start until A is done
File scope undirected Owned File/Module Scope intersection A and B may not share a wave; resolved lower-id-first
Semantic undirected both touch a shared module from §1 A and B may not share a wave

Directed edges constrain which wave a story lands in (it must come after its prerequisites). Undirected edges constrain who else can be in the same wave (mutual exclusion within a wave) — they do not by themselves force an ordering, so the planner breaks the tie deterministically by ascending story id.

Epics parallel, stories sequential

The default BMAD heuristic: stories within an epic are usually sequential (they build on each other), while epics often run in parallel (they target different components). The graph builder encodes this by chaining stories inside an epic via ordering edges, and by not adding cross-epic ordering edges unless an explicit depends_on says so. A story may opt out of its intra-epic chain by declaring epic_parallel: true (or by having no preceding sibling).


3. The wave algorithm

Input: a DAG G = (V, E) where V = eligible stories (ready-for-dev+), directed edges = ordering constraints, plus an undirected conflicts set (file + semantic). Cap = maxParallel.

waves        = []
scheduled    = {}            # story_id -> wave index
remaining    = topo-eligible vertices of G

while remaining:
    # candidates whose every directed prerequisite is already scheduled
    ready = [ s for s in remaining
              if all(dep in scheduled for dep in prereqs(s)) ]
    ready.sort(by ascending story id)        # deterministic tie-break

    wave = []
    for s in ready:
        if len(wave) == maxParallel: break
        # mutual exclusion: no undirected conflict with anyone already in this wave
        if any(conflict(s, t) for t in wave): continue
        wave.append(s)

    if wave is empty:        # only happens on a dependency cycle
        raise "cycle detected among: <remaining>"

    assign wave -> next wave index in scheduled
    waves.append(wave)
    remaining -= wave

Properties:

  • Dependency-safe. A story enters a wave only after all prerequisites are in earlier waves. (Prerequisites in the same generation are deferred to a later wave.)
  • Conflict-free. No two stories in a wave have intersecting file scope or a shared semantic module.
  • Capped. No wave exceeds maxParallel; overflow ready-stories roll forward (lowest id first), preserving fairness and determinism.
  • Cycle-detecting. An empty ready/wave with stories still remaining means the dependency maps contain a cycle — a planning bug to surface, not to silently resolve.

Width vs. depth

A smaller maxParallel yields more, narrower waves (slower wall-clock, fewer integration collisions). A larger cap yields fewer, wider waves (faster, more merge contention). The default of 3 is a conservative balance; the user sets it via userConfig.maxParallel.


4. Merge-order rationale

Within a wave every branch is file-disjoint, so the branches can merge in any order without textual conflict. We still impose a deterministic order for predictable review:

  1. Ascending story id into integration/wave-{N}. Lower ids are typically foundational (earlier in the epic / earlier authored), so the integration branch grows from the most foundational change outward. Determinism also makes re-runs reproducible.
  2. Integration review checkpoint. After all of a wave's branches land on integration/wave-{N}, review the combined result. This is the only place a hidden semantic interaction between same-wave stories would appear — catching it here keeps main green.
  3. Single PR integration/wave-{N} -> main. One reviewed, integrated unit lands on main rather than N independent PRs racing each other.
  4. Wave N+1 branches off the merged main. Each wave starts from a known-good base, so later waves automatically see earlier waves' changes and their prerequisites hold.

This skill only describes this sequence. Creating worktrees, merging, reviewing diffs, and opening PRs are all carried out by external dev tools / humans.


5. Worktree & branch naming

Thing Pattern Example
Story branch (one isolated worktree each) story/{epic}.{story}-{slug} story/2.1-stripe-integration
Per-wave integration branch integration/wave-{N} integration/wave-1
Final PR integration/wave-{N} -> main wave-1 -> main

One worktree per story guarantees filesystem isolation, so concurrent dev agents never share a working tree. The plan supplies the names; it does not run git worktree.


6. Eligibility & blockers

A story is wave-eligible only if:

  • status is ready-for-dev, in-progress, or review (not backlog, not done), and
  • it declares a non-empty Owned File/Module Scope, and
  • every id in its depends_on resolves to a known story.

If a story is ready-for-dev but has no declared scope, it is excluded and reported as a planning blocker for bmad-epics-and-stories to fix (scope refinement). The planner must never invent file paths to make a story schedulable.


7. Outputs

File Producer Purpose
dependency-graph.json build-dependency-graph.py nodes + typed edges + conflict set
waves.json plan-parallel-waves.py ordered list of waves with member stories
parallelization-plan.md the skill (from template) the human/dev-tool deliverable
decision-log.md (append) the skill records cap, wave count, deferred stories

dependency-graph.json shape

{
  "max_parallel": 3,
  "nodes": [
    {"id": "2.1", "slug": "stripe-integration", "epic": 2,
     "status": "ready-for-dev", "scope": ["src/payments/stripe.ts"]}
  ],
  "ordering_edges": [{"from": "2.1", "to": "2.2", "reason": "intra-epic-sequence"}],
  "conflicts": [{"a": "2.1", "b": "3.4", "class": "file",
                 "detail": "src/payments/stripe.ts"}],
  "blocked": [{"id": "4.1", "reason": "no Owned File/Module Scope declared"}]
}

waves.json shape

{
  "max_parallel": 3,
  "waves": [
    {"wave": 1, "stories": [
      {"id": "1.1", "slug": "auth-skeleton",
       "branch": "story/1.1-auth-skeleton", "scope": ["src/auth/"]}
    ],
    "integration_branch": "integration/wave-1",
    "merge_order": ["1.1"]}
  ],
  "deferred": [{"id": "4.1", "reason": "no declared scope"}]
}

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts5mo3 checks · Risk SAFE
  • Gen Agent Trust Hub5mo

    The skill is a project planning tool designed to analyze story backlogs and generate conflict-free parallelization plans. It uses bundled Python and Bash scripts to process local project files and output planning artifacts. No malicious behavior, data exfiltration, or unauthorized command execution was detected.

  • Socket5mo

    No alerts

  • Snyk5mo

    Risk: LOW · No issues

Signed by skilld at 27dca0e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 5 months ago
What it can do
Reads files Edits files Runs commands
All 7 allowed tools
ReadWriteEditBashGlobGrepTodoWrite

README badge

README badge for aj-geddes/claude-code-bmad-skills/bmad-parallel-plan