Module Setup
Overview
Installs, configures, and upgrades the bmad-loop module in a project.
This module is unusual: alongside its automation skills it relies on the
bmad-loop orchestrator tool — the Python program that actually drives the loop — installed as the
package from its public Git repository. The skills do nothing on their own.
The BMAD installer owns registration; this skill does not. When bmad-loop is installed through the BMAD installer (
), the installer stages the skills under
, writes that module's own config and help files, records it in
(manifest, skill manifest, files manifest), and rebuilds the
catalog. It regenerates the central
on every run, so nothing outside the installer should write there.
So this skill's job is the part the installer structurally cannot do:
- Install or upgrade the orchestrator tool (the installer copies skill directories only — it cannot carry a Python package).
- Run to register the per-CLI hooks, lay down the bundled skills, and write + gitignore entries.
- Preflight with and point the user at per-role adapter config.
It also refreshes one file —
_bmad/bmad-loop/module-help.csv
— so the module's help entries are present even on a project that installed the tool directly rather than through the BMAD installer. Nothing else under
is written or deleted.
Module identity (name, code, version) comes from
.
is a
literal token in BMAD config
values — never substitute it there.
This does not apply to the filesystem path arguments in the commands below: those are real paths, so resolve
to the actual project root before running.
On Activation
- Read for module metadata (the field is the module identifier).
- Check whether exists. If it does not, this project has no BMAD install — say so, and note that the automation skills expect one. Setup can still install the orchestrator tool.
- Check whether
{project-root}/_bmad/bmad-loop/
exists. If it does, the module was installed by the BMAD installer and is already registered. If it does not, tell the user the module is not registered with BMAD, and that installing it via (selecting bmad-loop) adds it to . Do not gate setup on this — continue either way. On BMAD v7 the module installs with instead (see bmad-loop's docs/setup-guide.md, "Installing on BMAD v7"), not the v6 installer.
Decide fresh-install vs upgrade. This drives whether the tool is upgraded and whether the per-project skills are refreshed. Treat it as an upgrade when either holds:
- The user asked for one in their arguments — , , , or similar.
- The orchestrator tool is already installed under uv: run and look for a entry. (A bare is not sufficient on its own — it can be satisfied by a source checkout or unrelated virtualenv; see step 1 below.)
Otherwise it is a fresh install. State the decision to the user before proceeding — e.g. "Detected an existing bmad-loop install — running an upgrade: tool + skills" or "No existing install detected — running a fresh setup".
If the user provides arguments (e.g.
,
,
), use them and skip interactive prompting. Still display the full confirmation summary at the end.
Register Help Entries
Refresh the module's help entries. This is the only file this skill writes under
, and it is exactly what the BMAD installer itself places there — so it is a no-op on an installer-installed project and idempotent on every re-run.
bash
mkdir -p "{project-root}/_bmad/bmad-loop"
cp ./assets/module-help.csv "{project-root}/_bmad/bmad-loop/module-help.csv"
reads the assembled catalog at
_bmad/_config/bmad-help.csv
, which the BMAD installer rebuilds from every
_bmad/<module>/module-help.csv
. So on a project that never ran the BMAD installer, these entries become visible the next time it runs — not immediately. Say that plainly in the Confirm step rather than claiming the help system was updated.
Skip this step entirely if
does not exist.
Install the Orchestrator Tool
The orchestrator is what spawns fresh coding CLI sessions through the selected adapter(s) to invoke
(the upstream dev primitive;
on pre-rename releases) for the dev pass — then re-invokes it on the
spec for the follow-up review pass — and
, watches their hook signals, and verifies their artifacts. Installing it is therefore part of setup, not an optional extra.
Why from Git? The BMAD installer copies only skill directories into a project — it does not carry sibling files, so the tool can't ride along in the skill folder. The canonical source is
https://github.com/bmad-code-org/bmad-loop. (The reverse holds, though: the tool's wheel
bundles the skills, so
lays them down into a project's skill trees on its own — see step 3.)
Unless the user explicitly asked to skip it (e.g.
/
), install
or upgrade and bootstrap now. Resolve
to the real project path before running.
-
Check what's already on PATH: run
. A version printing here does
not mean this project is set up — it only means
some is importable in the current environment. Before trusting it, run
and look for
: if it's absent (the on-PATH copy comes from a source checkout or an unrelated virtualenv), warn the user that the active environment is shadowing a clean install and that the project would be relying on that checkout. Unless the user explicitly declines, install/upgrade from the canonical source below so the project doesn't depend on an incidental dev environment.
-
Install or upgrade from the Git repository (the
extra pulls in the Textual dashboard so
works).
puts
in uv's own managed environment, so there's no PEP 668 externally-managed conflict and no need for
, an activated virtualenv, or
.
-
Fresh install (no uv-managed
):
bash
uv tool install "bmad-loop[tui] @ git+https://github.com/bmad-code-org/bmad-loop.git"
Pin a release tag for reproducibility by appending
to the Git URL.
-
Upgrade (uv already manages
):
-
Record the current version first so you can report the delta:
.
-
Default — follow
(or the currently pinned tag):
bash
uv tool upgrade bmad-loop --reinstall
The
is
required for a Git source: a plain
reuses the cached commit and won't pull new code. Then
offer to pin a release tag for reproducibility — if the user wants a specific version, move to it with:
bash
uv tool install --force "bmad-loop[tui] @ git+https://github.com/bmad-code-org/bmad-loop.git@v<X.Y.Z>"
-
Re-run
and note the before → after for the confirmation step.
-
Bootstrap the project — install the coding-CLI hooks, the bundled
skills, the
template, and the gitignore entry (idempotent).
First decide
which coding CLI(s) the orchestrator should drive. The supported adapters are
(default),
,
,
, and
(Google's
). Hooks are registered per CLI, so the choice matters — register every CLI you intend to use for dev/review/triage. Ask the user (unless they already specified it in their setup args, e.g.
, or accepted defaults — then default to
only):
"Which coding CLI(s) should the orchestrator drive —
,
,
,
, and/or
? You can pick more than one. [claude]"
Build the command with one
per selected CLI (the flag is repeatable).
On an upgrade, append so the per-project skill copies are actually refreshed — without it
skips every existing skill dir and the project keeps stale skills against the upgraded tool. On a fresh install, omit it.
bash
# fresh install, claude only (default)
bmad-loop init --project "{project-root}" --cli claude
# fresh install, multiple, e.g. claude + codex + gemini
bmad-loop init --project "{project-root}" --cli claude --cli codex --cli gemini
# upgrade — refresh the bundled skills in place
bmad-loop init --project "{project-root}" --cli claude --force-skills
Names must be exactly
,
,
,
, or
—
errors on an unknown profile and lists the valid ones.
prints any one-time first-run notes per CLI (e.g. start
once in the project and accept the workspace-trust + hooks-approval dialogs before
— spawned sessions can't answer first-run dialogs). Relay those notes to the user.
Skills are installed automatically: lays the bundled
skills into the right tree for each selected CLI —
for
,
for
/
/
/
. On a fresh install, existing skill dirs are left untouched; on an upgrade,
overwrites them with the bundled copies from the upgraded tool (use
to skip the step and manage skills yourself).
Note: also overwrites
itself (it ships in the same bundle). That's expected and safe — the freshly laid-down setup skill takes effect on the
next invocation, and your
overrides (keyed by skill directory name) are untouched.
-
Preflight — verify config, sprint-status, git, tmux, and the coding CLI:
bash
bmad-loop validate --project "{project-root}"
exits non-zero when the project isn't fully ready (e.g. no
yet, or
hasn't run). On a fresh project that is
expected — report its findings to the user as a readiness checklist, not as an install failure.
-
Point the user at per-role adapter config. in step 3 only registers
hooks for each CLI. Which CLI actually
runs each stage is governed by
{project-root}/.bmad-loop/policy.toml
, written from a template by
. The
(default
) applies to every stage; optional
,
, and
tables override individual stages (each takes its own
,
,
and
). So a mixed setup — e.g.
for dev,
for review — needs both the hooks registered (step 3)
and the role pointed at that CLI in
:
toml
[adapter]
name = "claude" # default for all stages
[adapter.review]
name = "codex" # review runs on codex instead
Tell the user where the file is and that any CLI named in
must also have been registered with
in step 3 (re-run
bmad-loop init --cli <name>
to add one later). Leave
untouched if they only use a single CLI — the default is correct.
Confirm
Report:
- Fresh install: the installed , that registered hooks, installed the skills, and wrote policy/gitignore for the selected coding CLI(s) (name each one — e.g. "hooks + skills installed for claude, codex").
- Upgrade: the before → after (e.g. "upgraded 0.3.1 → 0.3.2", or "already current at 0.3.2"), and that the skills were refreshed (not skipped) with in each CLI tree.
Also report:
- The preflight result (pass, or the readiness checklist of what's still missing).
- That
_bmad/bmad-loop/module-help.csv
was refreshed. If did not exist before this run (i.e. the BMAD installer never installed the module), say that the help entries will appear in after the BMAD installer next runs, and that installing the module via registers it properly (on BMAD v7, instead).
- That this skill wrote nothing else under — module registration, , and the help catalog are owned by the BMAD installer.
Then display the
from
to the user.
Outcome
Use the user's configured name and language for the remainder of the session. Read them from BMAD's central config via its own resolver (four-layer TOML merge; needs BMAD v6.10+ and Python 3.11+):
bash
uv run "{project-root}/_bmad/scripts/resolve_config.py" --project-root "{project-root}" --key core
Take
and
from the
table. If the script is absent or exits non-zero, fall back to addressing the user neutrally in English — do not write or repair any config file.