bmad-loop-setup
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseModule 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.
bmad-loopThe 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.
_bmad/npx bmad-method install_bmad/bmad-loop/_bmad/_config//bmad-help_bmad/config.tomlSo 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
bmad-loop init+ gitignore entries..bmad-loop/policy.toml - Preflight with and point the user at per-role adapter config.
bmad-loop validate
It also refreshes one file — — 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.
_bmad/bmad-loop/module-help.csv_bmad/Module identity (name, code, version) comes from .
./assets/module.yaml{project-root}{project-root}在项目中安装、配置并升级 bmad-loop 模块。
该模块比较特殊:除了自动化 skills 之外,它还依赖 bmad-loop orchestrator 工具——即实际驱动 loop 的 Python 程序——该工具需要从其公开 Git 仓库以 package 的形式安装。仅靠这些 skills 本身无法完成任何操作。
bmad-loopBMAD 安装器负责 注册;此 skill 不负责。 通过 BMAD 安装器()安装 bmad-loop 时,安装器会将 skills 暂存到 ,写入该模块自身的 config 和 help 文件,将其记录到 (manifest、skill manifest、files manifest),并重新构建 catalog。每次运行安装器时,它都会重新生成中央的 ,因此安装器之外的任何内容都不应写入该文件。
_bmad/npx bmad-method install_bmad/bmad-loop/_bmad/_config//bmad-help_bmad/config.toml因此,此 skill 负责的是安装器在结构上无法完成的部分:
- 安装或升级 orchestrator 工具(安装器只复制 skill 目录,无法携带 Python package)。
- 运行 以注册各 CLI hooks、部署内置 skills,并写入
bmad-loop init及 gitignore 条目。.bmad-loop/policy.toml - 使用 进行预检,并引导用户配置各角色的 adapter config。
bmad-loop validate
它还会刷新一个文件————以确保即使项目是直接安装工具而非通过 BMAD 安装器安装,模块的 help 条目仍然存在。 下的其他内容均不会被写入或删除。
_bmad/bmad-loop/module-help.csv_bmad/模块标识(name、code、version)来自 。
./assets/module.yaml{project-root}{project-root}On Activation
激活时执行的操作
- Read for module metadata (the
./assets/module.yamlfield is the module identifier).code - 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.
{project-root}/_bmad/ - Check whether 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
{project-root}/_bmad/bmad-loop/(selecting bmad-loop) adds it tonpx bmad-method install. Do not gate setup on this — continue either way. On BMAD v7 the module installs with/bmad-helpinstead (see bmad-loop's docs/setup-guide.md, "Installing on BMAD v7"), not the v6 installer.bmad setup bmad-loop
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 — ,
upgrade,update, or similar.upgrade tool and skills - The orchestrator tool is already installed under uv: run and look for a
uv tool listentry. (A barebmad-loopis not sufficient on its own — it can be satisfied by a source checkout or unrelated virtualenv; see step 1 below.)bmad-loop --version
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.
accept all defaults--headlessupgrade- 读取 获取模块元数据(
./assets/module.yaml字段是模块标识符)。code - 检查 是否存在。如果不存在,说明该项目未安装 BMAD,并指出自动化 skills 依赖 BMAD 安装。设置流程仍可安装 orchestrator 工具。
{project-root}/_bmad/ - 检查 是否存在。如果存在,说明该模块已由 BMAD 安装器安装并完成注册。如果不存在,则告知用户该模块尚未注册到 BMAD,并说明通过
{project-root}/_bmad/bmad-loop/安装并选择 bmad-loop 后,它会出现在npx bmad-method install中。不要因此阻止设置流程——无论是否存在都应继续。在 BMAD v7 上,应改用/bmad-help安装模块(见 bmad-loop 的bmad setup bmad-loop中“Installing on BMAD v7”一节),而不是使用 v6 安装器。docs/setup-guide.md
判断全新安装还是升级。 这将决定是否升级工具以及是否刷新项目级 skills。出现以下任一情况时,将其视为升级:
- 用户在参数中要求升级——例如 、
upgrade、update或类似表述。upgrade tool and skills - orchestrator 工具已通过 uv 安装:运行 并查找
uv tool list条目。(单独执行bmad-loop不足以确认这一点——它可能来自 source checkout 或无关的 virtualenv;参见下方步骤 1。)bmad-loop --version
否则即为全新安装。继续操作前应向用户说明判断结果——例如:“检测到已有 bmad-loop 安装——正在执行升级:工具 + skills”或“未检测到现有安装——正在执行全新设置”。
如果用户提供参数(例如 、、),使用这些参数并跳过交互式提示。仍在最后显示完整的确认摘要。
accept all defaults--headlessupgradeRegister 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.
_bmad/bash
mkdir -p "{project-root}/_bmad/bmad-loop"
cp ./assets/module-help.csv "{project-root}/_bmad/bmad-loop/module-help.csv"/bmad-help_bmad/_config/bmad-help.csv_bmad/<module>/module-help.csvSkip this step entirely if does not exist.
{project-root}/_bmad/刷新模块的 help 条目。这是此 skill 在 下唯一会写入的文件,且与 BMAD 安装器自身放置的文件完全相同——因此,对通过安装器安装的项目而言,此操作不会产生变化,并且每次重新运行都具备幂等性。
_bmad/bash
mkdir -p "{project-root}/_bmad/bmad-loop"
cp ./assets/module-help.csv "{project-root}/_bmad/bmad-loop/module-help.csv"/bmad-help_bmad/_config/bmad-help.csv_bmad/<module>/module-help.csv如果 不存在,则完全跳过此步骤。
{project-root}/_bmad/Install the Orchestrator Tool
安装 Orchestrator 工具
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.
bmad-build-autobmad-dev-autodonebmad-loop-sweepWhy 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, solays them down into a project's skill trees on its own — see step 3.)bmad-loop init
Unless the user explicitly asked to skip it (e.g. / ), install or upgrade and bootstrap now. Resolve to the real project path before running.
skills only--no-tool{project-root}-
Check what's already on PATH: run. A version printing here does not mean this project is set up — it only means some
bmad-loop --versionis importable in the current environment. Before trusting it, runbmad-loopand look foruv tool list: 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.bmad-loop -
Install or upgrade from the Git repository (theextra pulls in the Textual dashboard so
[tui]works).bmad-loop tuiputsuv tool installin uv's own managed environment, so there's no PEP 668 externally-managed conflict and no need forbmad-loop, an activated virtualenv, or--user.--break-system-packages-
Fresh install (no uv-managed):
bmad-loopbashuv tool install "bmad-loop[tui] @ git+https://github.com/bmad-code-org/bmad-loop.git"Pin a release tag for reproducibility by appendingto the Git URL.@v<X.Y.Z> -
Upgrade (uv already manages):
bmad-loop-
Record the current version first so you can report the delta:.
bmad-loop --version -
Default — follow(or the currently pinned tag):
mainbashuv tool upgrade bmad-loop --reinstallTheis required for a Git source: a plain--reinstallreuses 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:uv tool upgradebashuv tool install --force "bmad-loop[tui] @ git+https://github.com/bmad-code-org/bmad-loop.git@v<X.Y.Z>" -
Re-runand note the before → after for the confirmation step.
bmad-loop --version
-
-
-
Bootstrap the project — install the coding-CLI hooks, the bundledskills, the
bmad-loop-*template, and the gitignore entry (idempotent)..bmad-loop/policy.tomlFirst decide which coding CLI(s) the orchestrator should drive. The supported adapters are(default),claude,codex,gemini, andcopilot(Google'santigravity). 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.agy, or accepted defaults — then default tocli: claude, codexonly):claude"Which coding CLI(s) should the orchestrator drive —,claude,codex,gemini, and/orcopilot? You can pick more than one. [claude]"antigravityBuild the command with oneper selected CLI (the flag is repeatable). On an upgrade, append--cli <name>so the per-project skill copies are actually refreshed — without it--force-skillsskips every existing skill dir and the project keeps stale skills against the upgraded tool. On a fresh install, omit it.initbash# 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-skillsNames must be exactly,claude,codex,gemini, orcopilot—antigravityerrors on an unknown profile and lists the valid ones.initprints any one-time first-run notes per CLI (e.g. startinitonce in the project and accept the workspace-trust + hooks-approval dialogs beforeclaude— spawned sessions can't answer first-run dialogs). Relay those notes to the user.bmad-loop runSkills are installed automatically:lays the bundledinitskills into the right tree for each selected CLI —bmad-loop-*for.claude/skills/,claudefor.agents/skills//codex/gemini/copilot. On a fresh install, existing skill dirs are left untouched; on an upgrade,antigravityoverwrites them with the bundled copies from the upgraded tool (use--force-skillsto skip the step and manage skills yourself).--no-skillsNote:also overwrites--force-skillsitself (it ships in the same bundle). That's expected and safe — the freshly laid-down setup skill takes effect on the next invocation, and yourbmad-loop-setupoverrides (keyed by skill directory name) are untouched._bmad/custom/*.toml -
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. novalidateyet, orsprint-status.yamlhasn't run). On a fresh project that is expected — report its findings to the user as a readiness checklist, not as an install failure.bmad-sprint-planning -
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
--cli, written from a template by{project-root}/.bmad-loop/policy.toml. Theinit(default[adapter] name) applies to every stage; optionalclaude,[adapter.dev], and[adapter.review]tables override individual stages (each takes its own[adapter.triage],name,modelandeffort). So a mixed setup — e.g.extra_argsfor dev,claudefor review — needs both the hooks registered (step 3) and the role pointed at that CLI incodex:policy.tomltoml[adapter] name = "claude" # default for all stages [adapter.review] name = "codex" # review runs on codex insteadTell the user where the file is and that any CLI named inmust also have been registered withpolicy.tomlin step 3 (re-run--clito add one later). Leavebmad-loop init --cli <name>untouched if they only use a single CLI — the default is correct.policy.toml
orchestrator 会通过所选 adapter 启动全新的 coding CLI 会话,以调用 (上游 dev primitive;在改名前的版本中为 )执行开发阶段——随后基于 spec 再次调用它,执行后续 review 阶段——并调用 、监控它们的 hook 信号并验证产物。因此,安装 orchestrator 是设置的一部分,而不是可选的附加项。
bmad-build-autobmad-dev-autodonebmad-loop-sweep为什么从 Git 安装? BMAD 安装器只将 skill 目录复制到项目中——不会携带同级文件,因此该工具无法随 skill 文件夹一起安装。规范来源是 https://github.com/bmad-code-org/bmad-loop。(与此相反,工具的 wheel 会捆绑 skills,因此本身可以将 skills 部署到项目的 skill 目录树中——参见步骤 3。)bmad-loop init
除非用户明确要求跳过此步骤(例如 / ),否则现在立即执行安装或升级并完成初始化。运行前应将 解析为真实项目路径。
skills only--no-tool{project-root}-
检查 PATH 上已有的内容:运行。这里打印出版本并不意味着项目已完成设置——它只表示当前环境中_某个_ bmad-loop 可导入。在信任它之前,运行
bmad-loop --version并查找uv tool list:如果其中不存在(在 PATH 上的副本来自 source checkout 或无关的 virtualenv),则警告用户当前环境中的副本遮蔽了干净安装,项目将依赖那个 checkout。除非用户明确拒绝,否则从下面的规范来源执行安装或升级,避免项目依赖偶然的开发环境。bmad-loop -
从 Git 仓库安装或升级(extra 会引入 Textual dashboard,使
[tui]可以运行)。bmad-loop tui会将uv tool install放入 uv 自身管理的环境中,因此不存在 PEP 668 的 externally-managed 冲突,也不需要bmad-loop、激活 virtualenv 或--user。--break-system-packages-
全新安装(没有由 uv 管理的):
bmad-loopbashuv tool install "bmad-loop[tui] @ git+https://github.com/bmad-code-org/bmad-loop.git"为保证可复现性,可在 Git URL 后附加,以固定 release tag。@v<X.Y.Z> -
升级(uv 已管理):
bmad-loop-
首先记录当前版本,以便报告版本差异:。
bmad-loop --version -
默认情况下——跟随(或当前固定的 tag):
mainbashuv tool upgrade bmad-loop --reinstall对于 Git source,是必需的:普通的--reinstall会复用缓存的 commit,不会拉取新代码。随后提议固定 release tag以确保可复现性——如果用户需要特定版本,可使用以下命令切换:uv tool upgradebashuv tool install --force "bmad-loop[tui] @ git+https://github.com/bmad-code-org/bmad-loop.git@v<X.Y.Z>" -
重新运行,并在确认步骤中记录升级前 → 升级后的版本。
bmad-loop --version
-
-
-
初始化项目——安装 coding-CLI hooks、内置的skills、
bmad-loop-*模板及 gitignore 条目(幂等)。.bmad-loop/policy.toml首先决定 orchestrator 应驱动哪些 coding CLI。受支持的 adapter 为(默认)、claude、codex、gemini和copilot(Google 的antigravity)。Hooks 按 CLI 注册,因此这一选择很重要——应注册所有计划用于 dev、review 或 triage 的 CLI。除非用户已在设置参数中指定(例如agy)或接受默认值,否则应询问用户;接受默认值时,仅使用cli: claude, codex:claude“orchestrator 应驱动哪些 coding CLI——、claude、codex、gemini和/或copilot?可以选择多个。[claude]”antigravity每个选定的 CLI 都在命令中添加一个(该参数可以重复)。升级时,追加--cli <name>,确保项目级 skill 副本得到实际刷新——否则,--force-skills会跳过每个已有的 skill 目录,导致项目继续使用与升级后工具不匹配的旧 skills。全新安装时则省略此参数。initbash# 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名称必须严格为、claude、codex、gemini或copilot——antigravity遇到未知 profile 时会报错并列出有效选项。init会输出各 CLI 的一次性首次运行说明(例如,需要先在项目中启动一次init,并接受 workspace-trust 和 hooks-approval 对话框,然后才能运行claude——由工具启动的会话无法回答首次运行对话框)。应将这些说明传达给用户。bmad-loop runSkills 会自动安装:会将内置的initskills 部署到每个所选 CLI 对应的目录树——bmad-loop-*对应claude,.claude/skills//codex/gemini/copilot对应antigravity。全新安装时,已有 skill 目录保持不变;升级时,.agents/skills/会使用升级后工具内置的副本覆盖它们(可使用--force-skills跳过此步骤并自行管理 skills)。--no-skills注意:也会覆盖--force-skills自身(它包含在同一 bundle 中)。这是预期行为且是安全的——新部署的 setup skill 会在下一次调用时生效,而你的bmad-loop-setupoverrides(以 skill 目录名为键)不会受到影响。_bmad/custom/*.toml -
预检——验证 config、sprint-status、git、tmux 和 coding CLI:bash
bmad-loop validate --project "{project-root}"当项目尚未完全准备就绪时,会以非零状态退出(例如尚无validate,或尚未运行sprint-status.yaml)。在全新项目中,这是预期情况——应将检查结果作为就绪检查清单报告给用户,而不是将其视为安装失败。bmad-sprint-planning -
**引导用户配置各角色的 adapter。**步骤 3 中的只会为各 CLI 注册 hooks。实际运行各阶段的是哪个 CLI,则由
--cli决定,该文件由{project-root}/.bmad-loop/policy.toml根据模板写入。init(默认值为[adapter] name)适用于所有阶段;可选的claude、[adapter.dev]和[adapter.review]表可分别覆盖单个阶段(每个表都可设置自己的[adapter.triage]、name、model和effort)。因此,对于混合设置——例如使用extra_args执行 dev、使用claude执行 review——既需要注册 hooks(步骤 3),也需要在codex中将对应角色指向该 CLI:policy.tomltoml[adapter] name = "claude" # default for all stages [adapter.review] name = "codex" # review runs on codex instead告知用户该文件的位置,并说明中指定的每个 CLI 都必须已通过步骤 3 中的policy.toml注册(如需之后添加,可重新运行--cli)。如果用户只使用一个 CLI,则不要修改bmad-loop init --cli <name>——默认配置已经正确。policy.toml
Confirm
确认
Report:
- Fresh install: the installed , that
bmad-loop --versionregistered hooks, installed thebmad-loop initskills, and wrote policy/gitignore for the selected coding CLI(s) (name each one — e.g. "hooks + skills installed for claude, codex").bmad-loop-* - Upgrade: the before → after (e.g. "upgraded 0.3.1 → 0.3.2", or "already current at 0.3.2"), and that the
bmad-loop --versionskills were refreshed (not skipped) withbmad-loop-*in each CLI tree.--force-skills
Also report:
- The preflight result (pass, or the readiness checklist of what's still missing).
bmad-loop validate - That was refreshed. If
_bmad/bmad-loop/module-help.csvdid not exist before this run (i.e. the BMAD installer never installed the module), say that the help entries will appear in_bmad/bmad-loop/after the BMAD installer next runs, and that installing the module via/bmad-helpregisters it properly (on BMAD v7,npx bmad-method installinstead).bmad setup bmad-loop - That this skill wrote nothing else under — module registration,
_bmad/, and the help catalog are owned by the BMAD installer.config.toml
Then display the from to the user.
module_greeting./assets/module.yaml报告:
- **全新安装:**已安装的 ;
bmad-loop --version已注册 hooks、安装bmad-loop initskills,并为所选的 coding CLI 写入 policy/gitignore(逐一列明,例如“已为 claude、codex 安装 hooks + skills”)。bmad-loop-* - 升级:的升级前 → 升级后版本(例如“从 0.3.1 升级到 0.3.2”或“已是最新版本 0.3.2”),以及
bmad-loop --versionskills 已在每个 CLI 目录树中使用bmad-loop-*完成刷新而非跳过。--force-skills
还需报告:
- 预检结果(通过,或列出仍缺失内容的就绪检查清单)。
bmad-loop validate - 已刷新。如果本次运行前
_bmad/bmad-loop/module-help.csv不存在(即 BMAD 安装器从未安装该模块),应说明帮助条目会在 BMAD 安装器下次运行后出现在{project-root}/_bmad/bmad-loop/中,并说明通过/bmad-help安装模块可完成正式注册(在 BMAD v7 上则使用npx bmad-method install)。bmad setup bmad-loop - 此 skill 没有写入 下的其他任何内容——模块注册、
_bmad/和 help catalog 均由 BMAD 安装器负责。config.toml
然后向用户显示 中的 。
./assets/module.yamlmodule_greetingOutcome
后续处理
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 coreTake 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.
user_namecommunication_languagecore在本次会话余下部分,使用用户配置的 name 和 language。通过 BMAD 自身的 resolver 读取这些配置(四层 TOML 合并;需要 BMAD v6.10+ 和 Python 3.11+):
bash
uv run "{project-root}/_bmad/scripts/resolve_config.py" --project-root "{project-root}" --key core从 表中获取 和 。如果脚本不存在或以非零状态退出,则改用中性英文称呼用户——不要写入或修复任何配置文件。
coreuser_namecommunication_language