Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion docs/customize/adopt-bmad-across-a-team.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ When you roll BMad out to a team, you want every developer, designer, and PM to

Choose where a rule belongs by how broadly it applies:

- Rules that span multiple skills matching a name pattern belong in `_bmad/custom/rules.toml` (`_bmad/custom/rules.user.toml` for personal rules) through `bmad-customize`.
- Rules that apply whenever an engineer does implementation or review work belong on Amelia (`bmad-agent-dev`).
- Rules that apply to every structured document across Mary, John, Sally, Winston, Nadia, and Clio belong on `bmad-facilitate`.
- Rules that apply to one document type (such as every PRD or brief) belong in a template extension under `_bmad/custom/facilitate-templates/`.
- Shared repository settings (such as output folder or a brand design system) belong in `bmad setup`.
- Shared central or module settings belong in `bmad setup` (`_bmad/config.toml`) for initial answers, and in `_bmad/custom/config.toml` through `bmad-customize` for team overrides.

:::tip[Start with `bmad-customize` for Every Recipe]
You do not need to hand-author TOML files to roll these out. Open chat, invoke `/bmad-customize`, and paste or adapt the plain-English request at the start of each recipe. `bmad-customize` creates the right file under `_bmad/custom/` and verifies the merged result. For the full TOML schema and merge rules, see [Configuration and Customization Reference](../reference/configuration.md).
Expand Down Expand Up @@ -134,6 +135,23 @@ BMad customizations load when a BMad skill runs. For short, universal rules that
| Workflow or template customization | One workflow or one document type | Review depth, required sections, editorial standards, publishing hooks |
| Shared project config (`bmad setup`) | Whole project | Output folder, design system, and module setup answers |

## Multi-Repo and Worktree Topologies

You can organize `_bmad/` and your installed skills to fit single-repo or multi-repo projects on any AI harness:

| Topology | Where `_bmad/` and planning live | How each repo connects |
| --- | --- | --- |
| **Single repository** | `<repo>/_bmad/` and `<repo>/_bmad-output/` | Automatic upward discovery from anywhere inside the repo |
| **Shared-parent polyrepo** | `<workspace>/_bmad/` and shared planning output (`_bmad-output/` or a dedicated folder such as `_bmad-obeya/`) above sibling repos | Sibling repos automatically inherit the parent workspace; a repo with its own `_bmad/` stacks team and personal overrides on top |
| **Scattered polyrepo** | `<workspace>/_bmad/` in a separate folder (such as a dedicated planning repo) | Run `git config bmad.workspace <path-to-workspace>` in each linked repo (and optionally point workspace `core.output_folder` at `{project-root}/_bmad-obeya`) |
| **Out-of-tree worktrees** | Main checkout's `_bmad/` or linked `bmad.workspace` | Resolved automatically through `.git` `commondir`, reading main-checkout `*.user.toml` files read-only until worktree-local files exist |

- **Per-repo opt-out:** Add `standalone = true` under `[core]` in a repo's `_bmad/config.toml` or `_bmad/custom/config*.toml` to keep workspace inheritance off for that repo, or pass `--no-workspace` to `resolve_config.py`, `resolve_customization.py`, `render_skill.py`, `tickets.py`, or `read_store.py`.
- **Where skills live (harness discovery):** Skills remain separate from `_bmad/` so they keep working even inside repositories where `bmad setup` has not been run yet. Some AI harnesses (such as Antigravity) stop skill discovery at a repository's `.git` boundary, so skills placed only in a shared-parent folder above sibling repos can be hidden when a session opens inside a child repo:
- **User-global install** (`~/.agents/skills/`, `~/.claude/skills/`, `~/.codex/skills/`, etc.) works everywhere across scattered repos, shared-parent repos, and worktrees regardless of `.git` boundaries.
- **Repo-local install** (`.claude/skills/`, `.agents/skills/`, `.agent/skills/`, `.cline/skills/`, `.codex/skills/`, `.cursor/skills/`, `.windsurf/skills/`) pins exact skill versions inside each repository when a harness stops at `.git` or clones are scattered.
- **Shared-parent install** only reaches child sessions on harnesses that walk past `.git` (or when sessions open at the shared workspace root itself).

## Troubleshooting

- When an override does not take effect, ask `bmad-customize` to inspect your overrides, or verify the file under `_bmad/custom/` matches the exact skill directory name (for example, `bmad-agent-dev.toml`, not `bmad-dev.toml`).
Expand Down
7 changes: 5 additions & 2 deletions docs/customize/customize-bmad.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Other everyday requests work the same way:
- "Hey BMad, tell Amelia to always check our internal component library before writing new UI primitives."
- "Hey BMad, make Mary always include a one-line risk summary when she creates a brief, just for me."
- "Hey BMad, set my personal writing voice guide at `.local/my-voice.md` for facilitated documents, just for me."
- "For all BMad workflows on this team, always read `docs/api-standards.md` as a persistent fact and append a one-line outcome summary to `docs/run-log.md` when done" — `bmad-customize` writes a `[[rules]]` entry in `_bmad/custom/rules.toml` and verifies it with `resolve_customization.py --check` (personal cross-skill rules, such as "just for me across all agents," go to `_bmad/custom/rules.user.toml`).

`bmad-customize` handles agent behavior, workflow settings, and document templates end to end. You do not need to know which underlying skill or file owns a setting before asking.

Expand All @@ -39,8 +40,10 @@ Every customization falls into one of four areas:
| --- | --- | --- |
| **An agent's behavior** | Tell `bmad-customize` what to change on that agent | Change role focus, communication style, principles, standing facts, startup hooks, or custom menu shortcuts |
| **A workflow's settings** | Tell `bmad-customize` which workflow behavior to change | Raise `bmad-build` review depth to `thorough`, add `on_complete` publishing steps, or set `bmad-facilitate` defaults |
| **Cross-skill rules** | Ask `bmad-customize` to write a `[[rules]]` entry in `_bmad/custom/rules.toml` (or `.user.toml`) | Apply shared `persistent_facts` or `on_complete` instructions across every skill matching `bmad-*` |
| **Central and module settings** | Ask `bmad-customize` for `_bmad/custom/config.toml` (or `config.user.toml`) overrides, or run `bmad setup` initially | Override `core.output_folder`, external sources/destinations, or `[modules.<code>]` module settings without touching `_bmad/config.toml` |
| **A document's structure or look** | Tell `bmad-customize` what a document should ask for, contain, or render | Add a required PRD section, change default facilitation mode, or set HTML view preferences |
| **Shared settings and custom casts** | Run `bmad setup` for shared project config, or ask `bmad-party-mode` / `bmad-customize` for custom discussion casts | Change your output folder, set a shared brand design system, or save a custom party cast |
| **Custom party casts** | Ask `bmad-party-mode` or `bmad-customize` for custom discussion casts | Save custom personas or focus groups in `bmad-party-mode` |

## Team Scope vs. Personal Scope

Expand Down Expand Up @@ -78,7 +81,7 @@ To build custom personas, themed casts, or reusable focus groups, ask `bmad-part

## Shared Project Configuration

Shared project settings such as where BMad writes output, your active initiative, and module setup answers (such as your design system or Founder and Creative record folders) are managed by `bmad setup`. Ask the BMad Agent whenever you want to switch initiatives or change a setup answer.
Shared project settings such as where BMad writes output, your active initiative, and module setup answers are initialized by `bmad setup` (writing team defaults to `_bmad/config.toml` and personal choices to `_bmad/custom/config.user.toml`). To override central or module settings afterward — including team overrides in `_bmad/custom/config.toml`, personal overrides in `_bmad/custom/config.user.toml`, or defaults declared in `[bmod.config_defaults]` — ask `bmad-customize` or `bmad`, without editing `_bmad/config.toml` manually.

## How Configuration Layers Work

Expand Down
74 changes: 64 additions & 10 deletions docs/reference/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,24 @@ If you want to know what can be tailored on a specific agent or skill, ask `"Hey

## Central Configuration Files

Project-wide setup answers and shared overrides live in three TOML layers under `_bmad/`, where higher-priority files win when the same key appears in more than one place:
Project-wide setup answers, unasked module defaults, and shared overrides merge across four TOML layers in a single repository, where higher-priority layers win when the same key appears in more than one place:

```text
Priority 1 (wins): _bmad/custom/config.user.toml (project personal overrides, gitignored)
Priority 2: _bmad/custom/config.toml (team overrides, committed)
Priority 3 (base): _bmad/config.toml (setup-owned project defaults, committed)
Priority 1 (wins): _bmad/custom/config.user.toml (project personal overrides, gitignored)
Priority 2: _bmad/custom/config.toml (team overrides, committed)
Priority 3: _bmad/config.toml (setup-owned project defaults, committed)
Priority 4 (base): <module>/bmod.toml [bmod.config_defaults] (shipped unasked module defaults)
```

Running `bmad setup` writes team-scope answers to `_bmad/config.toml`, and project personal answers, model tiers, harness capabilities, and detected tooling to `_bmad/custom/config.user.toml`. Setup fills in missing keys and migrates renamed skill files on upgrades, while leaving anything you set under `_bmad/custom/` untouched. You can also ask `bmad` in chat to view or update any of these settings at any time without editing TOML by hand.
When a repository also inherits an outer workspace `_bmad/` directory, the workspace's team and personal layers stack beneath the repository's layers (see [Multi-Repo Workspaces, Worktrees, and Layer Stacking](#multi-repo-workspaces-worktrees-and-layer-stacking)).

Running `bmad setup` writes prompted team answers and seeds `[bmod.config_defaults]` into `_bmad/config.toml` (and personal setup answers to `_bmad/custom/config.user.toml`) without overwriting existing keys; runtime resolution also falls back to `[bmod.config_defaults]` at the lowest priority if a key has not been written to `_bmad/config.toml` yet. Setup preserves your overrides under `_bmad/custom/` (only renaming a per-skill file if a retired skill moves to a new name), and `bmad-customize` edits `_bmad/custom/config.toml` or `_bmad/custom/config.user.toml` without mutating `_bmad/config.toml`. Inside a fresh linked worktree where gitignored personal `*.user.toml` files (`config.user.toml`, `rules.user.toml`, `<skill>.user.toml`) are absent locally, BMAD reads your main checkout's `*.user.toml` files read-only until you create a worktree-local file.

| Setting | Scope | What it controls |
| --- | --- | --- |
| `core.output_folder` | Team | Root folder holding initiatives, standalone epics, `backlog/`, and run folders (defaults to `_bmad-output`; for a multi-repo workspace, setup recommends a shared folder such as `../_bmad-output`) |
| `core.active_initiative` | Personal | Active initiative, standalone epic, or child initiative under a program |
| `core.standalone` | Team / Personal | Set to `true` in a repository's central config to ignore any outer parent or linked workspace `_bmad/` layer and resolve only that repository's own `_bmad/` |
| `core.models` / `core.models.<harness>` | Personal | Ordered model preference lists per semantic tier (`quick`, `standard`, `deep`, optional `router` for System-1 decisioning/routing models such as Gemini Decision or Jev); entries may be plain model names or `{ model, tool }` tables for models delivered over a CLI or MCP; unlike generic list appends, a higher-priority layer or harness table replaces the list for that tier (and an explicit empty list `[]` clears it before fallback to `standard`, where empty `standard` means the active session model); tracks `seen_models` deltas per harness |
| `core.capabilities` / `core.capabilities.<harness>` | Personal | Interactive harness flags (`subagents`, `inline_visuals`, `computer_use`, `browser_interaction`) with optional per-harness overrides |
| `core.tooling` | Personal | Detected local CLIs (`clis`), deep-research MCPs/subscriptions (`deep_research`), media/visual tools (`media`), external doc/storage/hosting services (`external_services`), per-domain `preferred` picks, and `ignore` opt-outs |
Expand All @@ -50,6 +54,32 @@ Running `bmad setup` writes team-scope answers to `_bmad/config.toml`, and proje

Custom modules you install add their own setup questions under `modules.<code>.<key>`; see [Module Files](./module-files.md).

## Multi-Repo Workspaces, Worktrees, and Layer Stacking

Read-only BMad config, customization, and ticket scripts discover `_bmad/` using the same three-phase lookup without requiring `--project-root` (mutating setup and onboarding commands stop at repository and worktree boundaries):

1. **Walk up from the working directory** to the nearest folder containing `_bmad/` (covering single-repo and shared-parent polyrepo layouts).
2. **Follow linked git worktrees** via `.git` -> `gitdir` -> `commondir` back to the main checkout (preserving monorepo subdirectory offsets), then walk up from there.
3. **Follow local git workspace links** from `<common-git-dir>/config`'s `[bmad] workspace = <path>` (`git config bmad.workspace <path>`), allowing scattered repositories and their linked worktrees to share one workspace `_bmad/`. Relative `bmad.workspace` paths resolve against the repository's main checkout root (use an absolute path for git submodules or non-standard `.git` layouts); BMad parses `[bmad]` directly in `<common-git-dir>/config` without following `[include]`, `includeIf`, or `config.worktree`.

When both an outer workspace root and an inner repository define `_bmad/` (stacking at most one outer workspace root beneath the inner repo), `resolve_config.py`, `resolve_customization.py`, `render_skill.py`, `tickets.py`, and `read_store.py` merge seven layers in priority order:

```text
Priority 1 (wins): <repo>/_bmad/custom/config.user.toml (repo personal overrides)
Priority 2: <workspace>/_bmad/custom/config.user.toml (workspace personal overrides)
Priority 3: <repo>/_bmad/custom/config.toml (repo team overrides)
Priority 4: <repo>/_bmad/config.toml (repo setup defaults)
Priority 5: <workspace>/_bmad/custom/config.toml (workspace team overrides)
Priority 6: <workspace>/_bmad/config.toml (workspace setup defaults)
Priority 7 (base): <module>/bmod.toml [bmod.config_defaults] (shipped unasked module defaults)
```

Outer workspace layers expand `{project-root}` and relative path fields against the workspace root rather than the inner repository.

- **Isolating a standalone repo:** Set `core.standalone = true` in a repo's `_bmad/config.toml`, `_bmad/custom/config.toml`, or `config.user.toml` to disable workspace inheritance, or pass `--no-workspace` for one-off isolation on `resolve_config.py`, `resolve_customization.py`, `render_skill.py`, `tickets.py`, or `read_store.py`.
- **Write protection across boundaries:** Mutating setup and onboarding commands refuse to modify an outer parent workspace or linked `bmad.workspace` target unless you pass `--project-root <workspace>` explicitly.
- **Standalone skill degradation:** Skills and scripts work without any `_bmad/` folder by falling back to `{skill-root}` defaults when central state is optional, or exiting cleanly with a setup prompt when central workspace state is required.

## Knowledge Sources and Artifact Destinations

BMad splits external integrations cleanly by direction under `[core]` so teams and individuals do not have to repeat the same Confluence space, Notion workspace, Obsidian vault, sibling repo, or preview host in every skill:
Expand Down Expand Up @@ -105,16 +135,40 @@ Three rules govern every destination:
- **Explicit confirmation by default:** Every destination defaults to `mode = "ask"`, meaning skills must show the exact destination and payload summary before executing any external write. Use `mode = "manual"` for on-request-only targets, `mode = "auto"` only when explicitly opted in (unfinished drafts still require confirmation), and `mode = "disabled"` in a higher layer to mute an inherited entry.
- **Layering and backward compatibility:** Shared team entries belong in `_bmad/custom/config.toml` (committed). Project personal entries and sparse overrides of team entries (such as changing `mode`, `scope`, or `for`) belong in `_bmad/custom/config.user.toml` (gitignored, highest priority). Replacing `scope` or `for` in a higher layer replaces that entry's tag list cleanly rather than appending stale tags. The central config resolver also preserves backward compatibility with existing per-skill `workflow.external_sources` and `workflow.external_handoffs` overrides as bundled skills adopt central sources and destinations.

## Per-Skill Override Files
## Cross-Skill Rules and Per-Skill Override Files

Every customizable skill ships a `customize.toml` inside its installed directory defining its defaults. Never edit installed skill files, because updates overwrite them. Instead, sparse override files sit under `_bmad/custom/` using the exact skill name:
Every customizable skill ships a `customize.toml` inside its installed directory defining its defaults. Never edit installed skill files, because updates overwrite them. Instead, shared cross-skill rules and sparse per-skill overrides sit under `_bmad/custom/` and merge in five layers:

```text
Priority 1 (wins): _bmad/custom/<skill>.user.toml (personal overrides, gitignored)
Priority 2: _bmad/custom/<skill>.toml (team overrides, committed)
Priority 3 (base): <skill-dir>/customize.toml (shipped defaults)
Priority 1 (wins): _bmad/custom/<skill>.user.toml (personal skill overrides, gitignored)
Priority 2: _bmad/custom/rules.user.toml (personal cross-skill rules, gitignored)
Priority 3: _bmad/custom/<skill>.toml (team skill overrides, committed)
Priority 4: _bmad/custom/rules.toml (team cross-skill rules, committed)
Priority 5 (base): <skill-dir>/customize.toml (shipped defaults)
```

In `rules.toml` and `rules.user.toml`, each `[[rules]]` entry targets installed skill folders via `match` glob patterns (and optional `id` or `surface`), supplying `[rules.agent]` or `[rules.workflow]` tables. Keys not declared by a matched skill's `customize.toml` are skipped cleanly at load time unless they sit inside an open `{}` table such as `[workflow.harnesses]`.

```toml
# Team cross-skill rules: _bmad/custom/rules.toml (committed)
[[rules]]
id = "team-workflow-standards"
match = "bmad-*"

[rules.workflow]
persistent_facts = ["file:{project-root}/docs/api-standards.md"]
on_complete = "Log a one-line outcome summary to {project-root}/docs/run-log.md"

[[rules]]
id = "agent-date-format"
match = "bmad-agent-*"

[rules.agent]
persistent_facts = ["Always format dates in ISO 8601 (YYYY-MM-DD)."]
```

Personal cross-skill rules use the exact same `[[rules]]` schema in `_bmad/custom/rules.user.toml` (gitignored).

:::caution[Keep Override Files Sparse]
Only include the settings you intentionally change. Copying an entire `customize.toml` into `_bmad/custom/` locks in old defaults and prevents future skill improvements from taking effect.
:::
Expand Down
Loading