Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
32 changes: 30 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,25 @@ breaking changes may land in a minor release.
ends there non-completed and takes the existing uncharged pauses
(`hook channel silent:`, or `parked:` / `no work produced:` when the pane shows a
parked prompt or never changed) instead of waiting out `session_timeout_min`.
- Add opt-in `[skills] user_roots` (default off): resolve a BMAD skill the project
lacks from the user-level folders the coding CLI loads on its own (`npx skills add -g`).
Each packaged profile declares those folders, its disabling variables and its
clash precedence in a new `[user_skills]` table; validate, preflight, `run --dry-run`,
dispatch and worktree seeding share one lookup, so `validate` checks the copy the
session loads. `validate` reports each driven skill's location (`skills.root`) and
warns on `skills.user-root-unavailable`, `-version-skew`, `-unsupported` (opencode
1.x, whose sessions then refuse to start) and `-sandboxed`; sessions journal
`skill-user-root`. opencode 2.x allows only the BMAD module skills a session needs
from a user root. See ADR 0002 (#770).
- Warn with `skills.user-shadow` when a user-level copy of a driven skill outranks
the project's checked copy (claude, with `[skills] user_roots` off) or competes with
it (codex, antigravity, whatever the switch).
- Read opencode-http's project skills from `.agents/skills` as well as
`.claude/skills` (new profile field `extra_skill_trees`, refused when an entry starts
with `-`); on opencode 2.x the `.claude/skills` copy wins a duplicate id, as
`validate` assumes.
- Add a `{skill_dir}` profile prompt placeholder (the located skill folder); copilot's
prompt uses it.

### Changed

Expand Down Expand Up @@ -176,6 +195,15 @@ breaking changes may land in a minor release.
- With `[verify] reuse_unchanged` on, `post_review_verify` may carry the reused pass's
`dev`/`fix` stage and sequence, flagged by the new `verification_reused` (#1002).
- Name each BMAD-METHOD module folder in the module record's skill sources: `skills/core-tools` for `bmad`, `skills/method` for `bmad-build-auto`, `bmad-agent-po` and `bmad-retrospective`. BMAD-METHOD moved each module's skills into its own folder.
- Refuse a leading `~` in a profile's `skill_tree`, `extra_skill_trees`, `seed_files`
and `hooks.config_path` at load: it is not expanded.
- Report a skill tree, or a skill the run requires linked inside it, that resolves
outside the project or repository as `skills.tree-outside`; under worktree isolation
a link outside the repository is refused at preflight (and named by the
`run --dry-run` banner) instead of escalating mid-run.
- Change copilot's default prompt template to `{skill_dir}`: the text is unchanged
for project skills, but the config digest changes once, so the first resume of a
copilot run after upgrading journals `security_config_changed`.

### Removed

Expand All @@ -201,8 +229,8 @@ breaking changes may land in a minor release.
refuses to load as a `skills.customize-unreadable` problem.
- Report a missing dev primitive once, without stacking review-skill and dispatch
failures under the legacy `bmad-dev-auto` name on top of it. Name core-tools as
the v7 home of `bmad-review`, and note when a missing skill is installed only
globally (`~/.claude/skills`, `~/.agents/skills`).
the v7 home of `bmad-review`, and note when a missing skill is installed only in
one of the CLI's own user-level folders, naming `[skills] user_roots`.
- Stop reading an empty psmux window listing as a dead session. psmux can drop a live
server's reply and exit 0 with nothing, which the liveness probe took for a crashed CLI
and the control-window prune for a verified kill. That listing now counts as a failed
Expand Down
16 changes: 16 additions & 0 deletions docs/FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,22 @@ bmad-loop drives a BMAD sprint unattended: a deterministic Python loop launches
- **Tested by:** `tests/test_profile.py`, `tests/test_probe.py`, `tests/test_adapter_registry.py`, `tests/test_workspace_trust.py`, `tests/test_codex_trust.py`, `tests/test_generic_tmux.py`, `tests/test_cli.py`
- **Docs:** [Choosing which CLIs to drive](setup-guide.md#choosing-which-clis-to-drive), [Codex shared app-server daemon](setup-guide.md#codex-shared-app-server-daemon), [Adapter authoring guide: finalizing a profile](adapter-authoring-guide.md#walkthrough-finalizing-a-profile), [CLI reference: probe-adapter](reference/cli.md#probe-adapter), [CLI reference: adapters](reference/cli.md#adapters)

### User-level skill roots

- **Stability:** experimental
- **Description:** An opt-in that lets a run use BMAD skills installed in the user's home folder (`npx skills add -g`) instead of the project's skill trees. Each CLI's profile declares the user folders that CLI loads on its own and which copy it runs on a name clash, so `validate` checks the copy the session will load.
- **Properties:**
- Off by default: skills resolve only from the project's skill trees, and a skill found only in a user root keeps the run refused with a hint naming that copy.
- On, `validate`, the run preflight, `run --dry-run`, session dispatch and worktree seeding resolve every skill through the same lookup, and `validate` reports where each driven skill was found (`skills.root`).
- Only the folders a profile's `[user_skills]` table declares are searched; a root disabled by a set environment variable or unreadable is skipped and reported.
- With the switch on, a claude user copy outranks the project's, as Claude Code itself does. A user copy the CLI runs instead of the project copy the checks read is reported as `skills.user-shadow`: for claude with the switch off, for codex and antigravity (no stated order) with the switch on or off.
- Each session journals the skills it loads from a user root (`skill-user-root`); worktrees never copy from a user root.
- opencode-http 2.x allows only the BMAD module skills a session needs from a user root, never the operator's personal skills; on 1.x the session refuses to start and `validate` warns.
- A leading `~` in a profile's `skill_tree`, `extra_skill_trees`, `seed_files` or `hooks.config_path` is refused, and a skill tree linked outside the repository is refused at preflight under worktree isolation.
- **Config:** `[skills] user_roots`; profile `[user_skills]`, `extra_skill_trees`
- **Tested by:** `tests/test_skill_locate.py`, `tests/test_install.py`, `tests/test_profile.py`, `tests/test_cli.py`, `tests/test_engine.py`, `tests/test_engine_worktree.py`, `tests/test_opencode_protocol.py`, `tests/test_opencode_http.py`
- **Docs:** [Project skills and user-level skill roots](setup-guide.md#project-skills-and-user-level-skill-roots), [Adapter authoring guide: user-level skill roots](adapter-authoring-guide.md#user-level-skill-roots), [Configuration reference: [skills]](reference/configuration.md#skills)

### Per-stage adapters

- **Stability:** stable
Expand Down
33 changes: 31 additions & 2 deletions docs/adapter-authoring-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,10 @@ a new `name` extends the set. The aliases `claude-code-tmux` and `opencode` reso
| `binary` | ✅ | — | Executable resolved on `PATH`. `validate` runs `--version` only on binary names a packaged profile declares (`adapter.binary-unrunnable`). |
| `[hooks]` | ✅ | — | The [`HookSpec`](#hookspec-the-hooks-table) table. |
| `adapter` | | `generic` (`opencode-http` if `dialect=none`) | Adapter kind, resolved against the live [registry](#shipping-a-new-adapter-class-out-of-tree) at run start and by `validate` (`adapter.kind`). `generic` with `dialect = "none"` is refused. |
| `skill_tree` | | `.claude/skills` | Project-relative tree the CLI reads skills from; `init` installs the `bmad-loop-*` skills here. Must stay inside the project. |
| `prompt_template` | | `{prompt}` | Renders the canonical `/skill args` prompt. Placeholders: `{prompt}` (whole string), `{skill}` (command name, no `/`), `{args}` (the rest). |
| `skill_tree` | | `.claude/skills` | Project-relative tree the CLI reads skills from; `init` installs the `bmad-loop-*` skills here. Must stay inside the project; a leading `~` is refused (it is not expanded). |
| `extra_skill_trees` | | `[]` | Further project-relative trees the CLI also reads skills from (opencode-http: `[".agents/skills"]`). Each entry gets the `skill_tree` checks and must differ from it. Read by validate, the run and worktree seeding; `init` installs only into `skill_tree`. |
| `[user_skills]` | | unset | The user-level folders the CLI loads skills from on its own, used only under `[skills] user_roots = true`. See [User-level skill roots](#user-level-skill-roots). Unset: no user root is resolved, hinted or shadow-checked. |
| `prompt_template` | | `{prompt}` | Renders the canonical `/skill args` prompt. Placeholders: `{prompt}` (whole string), `{skill}` (command name, no `/`), `{args}` (the rest), `{skill_dir}` (the skill's folder: `<skill_tree>/<skill>`, or the absolute path when it resolved from a user root). |
| `launch_args` | | `[]` | Argv after `binary` (`["-i"]` keeps gemini/copilot interactive). Under `opencode-http` it precedes `serve`; `validate` warns on unservable shapes. |
| `bypass_args` | | `[]` | Permission-bypass flags for unattended runs, launched under `permission_mode = "bypass"`. A policy `extra_args` replaces them; `validate` warns (`policy.bypass-dropped`) when one is dropped. |
| `model_flag` | | `--model` | Flag passed with the model name when one is configured. |
Expand Down Expand Up @@ -454,6 +456,33 @@ settings_path = "~/.gemini/antigravity-cli/settings.json"
key = "trustedWorkspaces"
```

### User-level skill roots

The `[user_skills]` table declares the folders in the user's home that the CLI loads skills
from by itself. bmad-loop resolves a skill from them only when the project sets
`[skills] user_roots = true`; with the switch off they serve the `skills.base-missing` hint
and the `skills.user-shadow` warning.

```toml
[user_skills]
precedence = "project"
roots = [
{ path = "~/.copilot/skills", disabled_by = ["COPILOT_HOME"] },
"~/.agents/skills",
]
```

| Key | Default | Meaning |
| ------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `precedence` | `"project"` | Which copy the CLI runs when the project and a user root both hold one: `project` (the project's), `user` (the user root's; validate and the run check that copy) or `unordered` (both load in no documented order; bmad-loop checks the project copy and warns). |
| `roots` | `[]` | The user roots, in the order the CLI reads them. Each is a `"~/..."` string or a `{ path = "~/...", disabled_by = [...] }` table. A path must start with `~/` and stay inside the home folder; duplicate roots are refused. |
| `disabled_by` | `[]` | Environment variables that make the CLI skip this root when set (even to an empty value), such as a variable that moves the CLI's config home. Read from bmad-loop's environment plus the profile's `[env]`; at session dispatch, also the env a `pre_session` plugin hook sets. |

Declare only folders the CLI loads natively, as its own docs describe them. `validate` passes
a skill found in a declared root, so a root the CLI does not read gives a green `validate`
and a session that cannot find its skill. Recheck the list when the CLI changes how it
discovers skills.

### Environment-fault patterns

`env_fault_patterns` are matched line by line against the ANSI-stripped log tail of a
Expand Down
Loading
Loading