bmad-method-test-architecture-enterprise 4.0.0 → 4.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,36 +2,68 @@
2
2
 
3
3
  ## Principle
4
4
 
5
- Use the SmartBear MCP server to enable AI agent interaction with PactFlow/Pact Broker during contract testing workflows. The MCP server provides tools for generating pact tests, fetching provider states, reviewing test quality, and checking deployment safety — all accessible through the Model Context Protocol.
5
+ Use the SmartBear MCP server to give TEA live, read-only knowledge of a PactFlow or Pact Broker workspace: which provider states exist, which pacticipants depend on a provider, what the verification matrix says, and whether a version can deploy. TEA writes, reviews and gates contract tests itself; the broker supplies facts those decisions rest on.
6
6
 
7
7
  ## Rationale
8
8
 
9
9
  ### Why MCP for contract testing?
10
10
 
11
- - **Live broker queries**: AI agents can fetch existing provider states, verification results, and deployment status directly from PactFlow
12
- - **Test generation assistance**: MCP tools generate consumer and provider tests based on existing contracts, OpenAPI specs, or templates
13
- - **Automated review**: MCP-powered review checks tests against best practices without manual inspection
14
- - **Deployment safety**: `can-i-deploy` checks integrated into agent workflows for real-time compatibility verification
11
+ - **Live broker queries**: provider states, verification results, deployed versions and the integration network come straight from the workspace instead of being guessed from consumer code
12
+ - **Deployment safety**: `can-i-deploy` and the matrix can be queried while designing a pipeline or diagnosing a failed gate
13
+ - **Blast radius**: the pacticipant network shows every consumer of a provider, which feeds risk scoring in test design
15
14
 
16
15
  ### When TEA uses it
17
16
 
18
- - **test-design workflow**: Fetch existing provider states to understand current contract landscape
19
- - **automate workflow**: Generate pact tests using broker knowledge and existing contracts
20
- - **test-review workflow**: Review pact tests against best practices with automated feedback
21
- - **ci workflow**: Reference can-i-deploy and matrix tools for pipeline guidance
17
+ - **test-design workflow**: provider states and the pacticipant network inform contract scope and risk
18
+ - **automate workflow**: existing provider states and exact pacticipant names shape generated consumer tests
19
+ - **test-review workflow**: provider states and verification results check that reviewed tests match the broker
20
+ - **ci workflow**: can-i-deploy, matrix and deployed-version queries inform pipeline gates and failure diagnosis
22
21
 
23
- ## Available Tools
22
+ ## Tool Names
24
23
 
25
- | # | Tool | Description | When Used |
26
- | --- | ------------------------- | ----------------------------------------------------------------------- | --------------------- |
27
- | 1 | **Generate Pact Tests** | Create consumer/provider tests from code, OpenAPI, or templates | automate workflow |
28
- | 2 | **Fetch Provider States** | List all provider states from broker for a given consumer-provider pair | test-design, automate |
29
- | 3 | **Review Pact Tests** | Analyze tests against contract testing best practices | test-review |
30
- | 4 | **Can I Deploy** | Check deployment safety via broker verification matrix | ci workflow |
31
- | 5 | **Matrix** | Query consumer-provider verification matrix | ci, test-design |
32
- | 6 | **PactFlow AI Status** | Check AI credits and permissions (PactFlow Cloud only) | diagnostics |
33
- | 7 | **Metrics - All** | Workspace-wide contract testing metrics | reporting |
34
- | 8 | **Metrics - Team** | Team-level adoption statistics (PactFlow Cloud only) | reporting |
24
+ Every Pact tool the server registers carries the `contract-testing_` prefix. Clients add their own server prefix in front, so Claude Code shows `mcp__smartbear__contract-testing_can_i_deploy` for a server registered as `smartbear`. Match on the `contract-testing_` part.
25
+
26
+ `@smartbear/mcp` 0.44.0 registers 104 `contract-testing_*` tools. 60 carry `readOnlyHint: true`, 15 carry `destructiveHint: true`, and the rest write to the workspace: publishing, recording deployments, webhooks, secrets, labels, environments, and an `admin_*` family that manages users, roles, teams, system accounts and API tokens. Names change between server releases, so read them from the session's tool list rather than from memory.
27
+
28
+ ## Tools TEA Calls
29
+
30
+ All of these are read-only.
31
+
32
+ | Tool | Purpose | Used in |
33
+ | ------------------------------------------------------------------- | -------------------------------------------------------------------------- | ---------------------------------- |
34
+ | `contract-testing_get_provider_states` | Provider states already defined for a provider | test-design, automate, test-review |
35
+ | `contract-testing_list_pacticipants` | Exact pacticipant names as registered | automate, ci |
36
+ | `contract-testing_get_pacticipant_network` | Every consumer and provider connected to a pacticipant | test-design (risk, blast radius) |
37
+ | `contract-testing_list_integrations` | All consumer-provider pairs in the workspace | test-design |
38
+ | `contract-testing_get_pacts_for_verification` | Pacts a provider build would verify for given selectors | ci, test-review |
39
+ | `contract-testing_can_i_deploy` | Whether a version is safe to deploy to an environment | ci |
40
+ | `contract-testing_matrix` | Verification results between consumer and provider versions | ci, test-review |
41
+ | `contract-testing_list_environments` | Environment names and UUIDs | ci |
42
+ | `contract-testing_get_currently_deployed_versions` | What runs in an environment now | ci |
43
+ | `contract-testing_get_currently_supported_versions` | Released versions still supported (mobile apps, libraries) | ci |
44
+ | `contract-testing_get_metrics`, `contract-testing_get_team_metrics` | Workspace and team adoption figures (team metrics are PactFlow Cloud only) | reporting |
45
+
46
+ List tools page their results: `contract-testing_get_provider_states`, `contract-testing_get_pacticipant_network` and `contract-testing_get_currently_deployed_versions` return 5 rows per page by default. Raise `pageSize` or follow `pageNumber` until a page comes back short; reading only the first page silently drops provider states and consumers. `contract-testing_matrix` takes `latestby: "cvpv"` for a two-selector query and `"cvp"` for one.
47
+
48
+ ## Safety Rules
49
+
50
+ ### Read-only by default
51
+
52
+ TEA calls only tools whose `readOnlyHint` is true. Publishing contracts, recording deployments or releases, creating or deleting pacticipants, branches, environments, webhooks, secrets or labels, executing webhooks, and every `admin_*` tool change shared state that other teams' pipelines depend on. Those belong in CI, driven by the Pact CLI or the pipeline the ci workflow generates.
53
+
54
+ TEA calls a write tool only when the user asks for that specific change in the current conversation, names the target, and confirms. A workflow step never decides to write on its own, and a headless run never writes.
55
+
56
+ Recommend a read-only API token for agent use. A read/write token exposes every write and `admin_*` tool to the agent session.
57
+
58
+ ### PactFlow AI tools need an explicit request
59
+
60
+ `contract-testing_generate_pact_tests` and `contract-testing_review_pact_tests` are PactFlow Cloud features. Each call sends the supplied code, specs or test files to the hosted service and spends the workspace's PactFlow AI credits. TEA generates and reviews contract tests with its own knowledge fragments, so it does not call either tool unless the user asks for PactFlow AI output.
61
+
62
+ When the user does ask:
63
+
64
+ - Fetch provider states first and pass them in, so generated tests reuse existing state names.
65
+ - Treat the output as a draft. It must still pass the provider scrutiny checklist in `contract-testing.md` and, when `tea_use_pactjs_utils` is active, the substitutions in `pactjs-utils-mandate.md`.
66
+ - On a 401 or a credit error, call `contract-testing_check_pactflow_ai_entitlements` once and report what it says.
35
67
 
36
68
  ## Installation
37
69
 
@@ -132,49 +164,54 @@ Add to `.vscode/mcp.json` (note: uses `servers` key, not `mcpServers`):
132
164
 
133
165
  ## Pattern Examples
134
166
 
135
- ### Example 1: Fetching Provider States During Test Design
136
-
137
- When designing contract tests, use MCP to query existing provider states:
167
+ ### Example 1: Provider States During Test Design
138
168
 
139
169
  ```text
140
- # Agent queries SmartBear MCP during test-design workflow:
141
- # → Fetch Provider States for consumer="movie-web", provider="SampleMoviesAPI"
142
- # ← Returns: ["movie with id 1 exists", "no movies exist", "user is authenticated"]
170
+ # → contract-testing_get_provider_states provider="SampleMoviesAPI"
171
+ # ← ["movie with id 1 exists", "no movies exist", "user is authenticated"]
143
172
  #
144
- # Agent uses this to generate comprehensive consumer tests covering all states
173
+ # Consumer tests reuse these names exactly; a new state is proposed to the provider team, never invented silently.
145
174
  ```
146
175
 
147
- ### Example 2: Reviewing Pact Tests
148
-
149
- During test-review workflow, use MCP to evaluate test quality:
176
+ ### Example 2: Blast Radius for Risk Scoring
150
177
 
151
178
  ```text
152
- # Agent submits test file to SmartBear MCP Review tool:
153
- # → Review Pact Tests with test file content
154
- # ← Returns: feedback on matcher usage, state coverage, interaction naming
179
+ # → contract-testing_get_pacticipant_network pacticipantName="SampleMoviesAPI"
180
+ # ← consumers: movie-web, movie-mobile, recommendations-service
155
181
  #
156
- # Agent incorporates feedback into review report
182
+ # A breaking change to this provider touches three consumers; impact scores reflect that.
157
183
  ```
158
184
 
159
- ### Example 3: Can I Deploy Check in CI
160
-
161
- During CI workflow design, reference the can-i-deploy tool:
185
+ ### Example 3: Diagnosing a Failed can-i-deploy
162
186
 
163
187
  ```text
164
- # Agent generates CI pipeline with can-i-deploy gate:
165
- # → Can I Deploy: pacticipant="SampleMoviesAPI", version="${GITHUB_SHA}", to="production"
166
- # ← Returns: { ok: true/false, reason: "..." }
188
+ # → contract-testing_can_i_deploy pacticipant="movie-web" version="${GITHUB_SHA}" environment="production"
189
+ # ← ok: false, "no verified pact between movie-web and the version of SampleMoviesAPI in production"
167
190
  #
168
- # Agent designs pipeline to block deployment if can-i-deploy fails
191
+ # → contract-testing_list_environments (find the production UUID)
192
+ # → contract-testing_get_currently_deployed_versions environmentId=<uuid>
193
+ # → contract-testing_matrix q=[{pacticipant:"movie-web", version:"${GITHUB_SHA}"},
194
+ # {pacticipant:"SampleMoviesAPI", environment:"production"}]
195
+ # latestby="cvpv"
169
196
  ```
170
197
 
198
+ Read the matrix result:
199
+
200
+ | Matrix result | Meaning | Fix |
201
+ | ------------------------------------------------------------------ | ---------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
202
+ | No row, consumer version is new | No provider build has verified this pact yet | Trigger verification on pact publish with a `contract_requiring_verification_published` webhook (`pact-broker-webhooks.md`), and make the provider's selectors include the consumer's branch |
203
+ | No row, provider is the one deploying | The provider never verified the consumer versions already in the environment | Add `{ deployedOrReleased: true }` to the provider's consumer version selectors |
204
+ | Row whose verification result is `success: false` | Verification ran and failed: a real contract break | Fix the consumer expectation or the provider |
205
+ | Row whose verification result is `success: true`, gate still fails | Another integration of the same pacticipant is unverified | Repeat the matrix query for each integration |
206
+ | Provider version absent from the environment | The deployment was never recorded | Record it from the deploy pipeline with `pact-broker record-deployment` |
207
+
171
208
  ## When the Tools Are Not Reachable
172
209
 
173
210
  `tea_pact_mcp` defaults to `"mcp"`, so every contract-testing step reaches this fragment on a normal install. Most installs have no broker. That is expected, and it must cost nothing.
174
211
 
175
212
  ### The probe is a tool-list check, never a broker call
176
213
 
177
- Reachability means **the SmartBear MCP tools are present in this session's tool list**. Nothing else. Do not call `Can I Deploy`, `Matrix`, or any other tool to discover whether the broker answers: a missing server is instant and free to detect, while a misconfigured or unreachable broker is a network round trip that can hang the step. The two failure modes have very different costs and only the free one is worth probing for.
214
+ Reachability means **at least one tool whose name contains `contract-testing_` is present in this session's tool list**. Nothing else. Do not call `contract-testing_can_i_deploy`, `contract-testing_matrix`, or any other tool to discover whether the broker answers: a missing server is instant and free to detect, while a misconfigured or unreachable broker is a network round trip that can hang the step. The two failure modes have very different costs and only the free one is worth probing for.
178
215
 
179
216
  Credentials are likewise not probed. `PACT_BROKER_BASE_URL` and `PACT_BROKER_TOKEN` being unset is a reason the first real tool call will fail, not a reason to make one.
180
217
 
@@ -210,14 +247,15 @@ Everything above applies to the tools in this fragment only. It has no bearing o
210
247
  - **Per-project install recommended**: Different projects may target different PactFlow tenants — match TEA's per-project config philosophy
211
248
  - **Env vars are project-specific**: `PACT_BROKER_BASE_URL` and `PACT_BROKER_TOKEN` vary by project/team
212
249
  - **Node.js 20+ required**: SmartBear MCP server requires Node.js 20 or higher
213
- - **PactFlow Cloud features**: Some tools (AI Status, Team Metrics) are only available with PactFlow Cloud, not self-hosted Pact Broker
250
+ - **PactFlow Cloud features**: PactFlow AI generation and review, bi-directional contract testing queries, team metrics and the `admin_*` tools need PactFlow Cloud; a self-hosted Pact Broker exposes the rest
251
+ - **Read-only token for agents**: a read/write token hands every write and admin tool to the session
214
252
  - **Complements pactjs-utils**: MCP provides broker interaction during design/review; pactjs-utils provides runtime utilities for test code
215
253
 
216
254
  ## Related Fragments
217
255
 
218
256
  - `pactjs-utils-overview.md` — runtime utilities that pact tests import
219
257
  - `pactjs-utils-provider-verifier.md` — verifier options that reference broker config
220
- - `pact-broker-webhooks.md` — PactFlow → GitHub webhook auth pattern and staleness monitoring; `Metrics - All` / `Matrix` MCP tools are useful here for dashboards
258
+ - `pact-broker-webhooks.md` — PactFlow → GitHub webhook auth pattern and staleness monitoring; `contract-testing_get_metrics` and `contract-testing_matrix` are useful here for dashboards
221
259
  - `contract-testing.md` — foundational contract testing patterns
222
260
 
223
261
  ## Anti-Patterns
@@ -234,9 +272,16 @@ Everything above applies to the tools in this fragment only. It has no bearing o
234
272
  ```text
235
273
  # ✅ Use MCP during planning and review:
236
274
  # - Fetch provider states to inform test design
237
- # - Generate test scaffolds from existing contracts
238
- # - Review tests for best practice compliance
239
- # - Check can-i-deploy during CI pipeline design
275
+ # - Map the pacticipant network for risk scoring
276
+ # - Check can-i-deploy and the matrix during CI pipeline design and failure diagnosis
277
+ ```
278
+
279
+ ### Wrong: Letting an agent write to the broker
280
+
281
+ ```text
282
+ # ❌ Agent calls contract-testing_publish_consumer_contracts or contract-testing_record_deployment
283
+ # from a workstation. The broker now holds a version no pipeline built, and can-i-deploy answers for it.
284
+ # ✅ Publishing and deployment records come from CI, with the commit SHA and branch of the build.
240
285
  ```
241
286
 
242
- _Source: SmartBear MCP documentation, PactFlow developer docs._
287
+ _Source: SmartBear MCP documentation, PactFlow developer docs, and the tool list of `@smartbear/mcp` 0.44.0 read over MCP `tools/list`._
@@ -40,7 +40,7 @@ pactjs-utils-zod-to-pact,Pact.js Utils Zod to Pact,"zodToPactMatchers for consum
40
40
  pactjs-utils-consumer-helpers,Pact.js Utils Consumer Helpers,"createProviderState, toJsonMap, setJsonContent, setJsonBody; PactV4 one-interaction-per-it() determinism rule","pactjs-utils,consumer,contract-testing,pact,api,determinism,pactv4",specialized,pactjs-utils-consumer-helpers.md
41
41
  pactjs-utils-provider-verifier,Pact.js Utils Provider Verifier,"Verifier builders, scoped consumerBranch selectors, provider revision metadata, isBreakingChangeTolerantBranch, and FFI-safe Vitest config","pactjs-utils,provider,consumer,contract-testing,pact,api,backend,ci,vitest,ffi,consumer-branch,provider-branch,short-lived-branch,selectors,release-branch,breaking-change",specialized,pactjs-utils-provider-verifier.md
42
42
  pactjs-utils-request-filter,Pact.js Utils Request Filter,"createRequestFilter, noOpRequestFilter for auth injection","pactjs-utils,auth,contract-testing,pact",specialized,pactjs-utils-request-filter.md
43
- pact-mcp,Pact MCP Server,"SmartBear MCP for PactFlow: generate tests, review, can-i-deploy, provider states","pact,mcp,pactflow,contract-testing,broker",specialized,pact-mcp.md
43
+ pact-mcp,Pact MCP Server,"SmartBear MCP for PactFlow: verified contract-testing_ tool names, read-only use, provider states, pacticipant network, can-i-deploy diagnosis, paging, PactFlow AI opt-in","pact,mcp,pactflow,contract-testing,broker",specialized,pact-mcp.md
44
44
  pact-consumer-framework-setup,Pact Consumer CDC Framework Setup,"Directory structure, FFI-safe vitest config, deterministic publishing, PR-only provider branch detection, and additive branch-aware can-i-deploy","pactjs-utils,consumer,contract-testing,pact,ci,framework,setup,vitest,shell-scripts,jq,pactv4,ffi,file-organization,one-file-per-pair,provider-branch,can-i-deploy,short-lived-branch",specialized,pact-consumer-framework-setup.md
45
45
  pact-broker-webhooks,Pact Broker Webhooks,"PactFlow → GitHub repository_dispatch auth, exact registered provider target checkout, staleness monitoring, and PAT rotation","pact,pactflow,broker,webhooks,github,auth,pat,ci,operations,security,provider-branch,short-lived-branch",specialized,pact-broker-webhooks.md
46
46
  adr-quality-readiness-checklist,ADR Quality Readiness Checklist,"8-category 29-criteria framework for ADR testability and NFR evidence audit","nfr,testability,adr,quality,assessment,checklist",extended,adr-quality-readiness-checklist.md
@@ -28,7 +28,7 @@ precautions = """
28
28
  - Read before writing. Show the user the plan (each key and where it goes) and wait for approval.
29
29
  - Edit only the `[modules.tea]` tables of `_bmad/config.toml`, `_bmad/custom/config.toml` and `_bmad/custom/config.user.toml`, and the two customization files `_bmad/custom/bmad-tea-framework.toml` and `_bmad/custom/bmad-tea-evaluate.toml`. Keep every other table, key and comment in those files as it is, and merge into a customization file that already exists instead of replacing it.
30
30
  - Never delete a file outside version control. Removing the leftovers is a commit the user chooses; offer it and stop there.
31
- - Preserve `_bmad/custom/bmad-testarch-atdd.toml`, `_bmad/custom/bmad-testarch-atdd.user.toml`, `_bmad/custom/bmad-testarch-automate.toml` and `_bmad/custom/bmad-testarch-automate.user.toml` until `bmad migrate tea` (migration-3) or `tea-migrate-customizations` moves their settings into `[workflow.red]` of `bmad-tea-automate.toml`. The combined skill reads red settings only from that table.
31
+ - Preserve `_bmad/custom/bmad-testarch-atdd.toml` and `_bmad/custom/bmad-testarch-atdd.user.toml` until `bmad migrate tea` (migration-3) or `tea-migrate-customizations` moves their settings into `[workflow.red]` of `bmad-tea-automate.toml`. The combined skill reads red settings only from that table. Preserve `_bmad/custom/bmad-testarch-automate.toml` and `_bmad/custom/bmad-testarch-automate.user.toml` (expand mode) until `tea-migrate-customizations` renames them to `bmad-tea-automate.toml` and `bmad-tea-automate.user.toml` with `[workflow]` unchanged; migration-3 does not rename them, and their settings never go into `[workflow.red]`.
32
32
  - Never run `bmad setup` from inside this migration; it owns the rest of `_bmad/`. When `[modules.tea]` is missing from every layer, stop and tell the user to run `bmad setup tea` first and to run this migration again afterwards.
33
33
  """
34
34
 
@@ -5,21 +5,21 @@ module = "tea"
5
5
  from = "3 with separate atdd and ci customization files"
6
6
  to = "3 with [workflow.red] and [workflow.ci] tables"
7
7
  title = "Move TEA red and CI customizations into their owning skills"
8
- summary = "Moves the settings of bmad-tea-atdd into [workflow.red] of bmad-tea-automate.toml and those of bmad-tea-ci into [workflow.ci] of bmad-tea-framework.toml, team and user layers separately, reading live files first and cleanup backups when `bmad setup` already removed a file. Also offers to move [modules.tea] keys held only by the legacy _bmad/config.user.toml into _bmad/custom/config.user.toml. Nothing is overwritten without your choice."
8
+ summary = "Moves the settings of bmad-tea-atdd into [workflow.red] of bmad-tea-automate.toml and those of bmad-tea-ci into [workflow.ci] of bmad-tea-framework.toml, team and user layers separately, reading live files first and cleanup backups when `bmad setup` already removed a file. Also offers to move [modules.tea] keys of the legacy _bmad/config.user.toml that neither custom layer holds into _bmad/custom/config.user.toml. Nothing is overwritten without your choice."
9
9
 
10
10
  # Read-only signals. Any one of them makes this migration worth offering.
11
11
  detect = """
12
12
  - `{project-root}/_bmad/custom/` holds `bmad-tea-atdd.toml`, `bmad-tea-atdd.user.toml`, `bmad-tea-ci.toml`, `bmad-tea-ci.user.toml`, `bmad-testarch-atdd.toml`, `bmad-testarch-atdd.user.toml`, `bmad-testarch-ci.toml` or `bmad-testarch-ci.user.toml`.
13
13
  - `bmad-tea-framework.toml` or `bmad-tea-framework.user.toml` in `{project-root}/_bmad/custom/` holds `ci_platform` directly under `[workflow]`.
14
14
  - A `{project-root}/.v6-v7-migration-backup-*/_bmad/custom/` folder holds one of the files above, or a pre-3.0 `bmad-testarch-<skill>.toml` or `.user.toml` file, and the live `_bmad/custom/` holds neither that file nor its `bmad-tea-*` successor. `bmad setup` cleanup lists these files as unused customizations and deletes them, so a backup can be the only copy left.
15
- - `{project-root}/_bmad/config.user.toml` exists with a `[modules.tea]` table, live or only as `{project-root}/.v6-v7-migration-backup-*/_bmad/config.user.toml`. Core merges only `_bmad/config.toml`, `_bmad/custom/config.toml` and `_bmad/custom/config.user.toml`, so keys that only this file holds are ignored.
15
+ - `{project-root}/_bmad/config.user.toml` exists with a `[modules.tea]` table, live or only as `{project-root}/.v6-v7-migration-backup-*/_bmad/config.user.toml`. Core no longer merges this file. It ranked above `_bmad/config.toml` and below `_bmad/custom/config.toml` and `_bmad/custom/config.user.toml`, so a key is ignored when neither custom file holds it, even if `_bmad/config.toml` sets the same key.
16
16
  A project with none of those signals, or one whose plan below is already complete, is migrated; say so and stop.
17
17
  """
18
18
 
19
19
  target = """
20
20
  - Red-mode settings are `[workflow.red]` in `_bmad/custom/bmad-tea-automate.toml` (team) and `bmad-tea-automate.user.toml` (user). CI settings, `ci_platform` included, are `[workflow.ci]` in `bmad-tea-framework.toml` and `bmad-tea-framework.user.toml`.
21
21
  - No `bmad-tea-atdd`, `bmad-tea-ci`, `bmad-testarch-atdd` or `bmad-testarch-ci` file remains in `_bmad/custom/` once its content is verified in the target. `ci_platform` is no longer a key of `[workflow]` in the framework files.
22
- - Every `[modules.tea]` key that only `_bmad/config.user.toml` held lives in `_bmad/custom/config.user.toml`, keeping its precedence over team values.
22
+ - Every `[modules.tea]` key of `_bmad/config.user.toml` that neither custom file holds lives in `_bmad/custom/config.user.toml`, where it keeps its precedence over `_bmad/config.toml`.
23
23
  """
24
24
 
25
25
  precautions = """
@@ -33,8 +33,8 @@ precautions = """
33
33
  """
34
34
 
35
35
  guide = """
36
- 1. **Inventory.** List, per layer (team, user) and surface (red from atdd, CI from ci), every candidate source: the live files named in the detect signals, and for each absent live file the newest backup folder that contains it. Record each source's provenance (`live` or the backup folder). Add framework override files that set `ci_platform` directly under `[workflow]`. Add every `[modules.tea]` key of `_bmad/config.user.toml`, live or from the newest backup that contains it. A personal override is a candidate even when `_bmad/config.toml` or `_bmad/custom/config.toml` holds the same key, because it takes precedence over those layers. Compare each key only with `_bmad/custom/config.user.toml`, the canonical personal layer.
37
- 2. **Plan.** Build one row per moved table or key: source file and provenance, destination file and table, and the status (`new`, `same value already present`, `conflict`). Show each conflict with both values. Retired v6 names (`bmad-testarch-atdd`, `bmad-testarch-ci`) are sources too, read before any content rewrite. Wait for approval, and for the user's choice on each conflict. For a `_bmad/config.user.toml` key present in `_bmad/custom/config.user.toml` with a different value, report both values and keep the canonical value unless the user chooses the legacy one.
36
+ 1. **Inventory.** List, per layer (team, user) and surface (red from atdd, CI from ci), every candidate source: the live files named in the detect signals, and for each absent live file the newest backup folder that contains it. Record each source's provenance (`live` or the backup folder). Add framework override files that set `ci_platform` directly under `[workflow]`. Add every `[modules.tea]` key of `_bmad/config.user.toml`, live or from the newest backup that contains it. The old core order was `_bmad/config.toml`, `_bmad/config.user.toml`, `_bmad/custom/config.toml`, `_bmad/custom/config.user.toml`, later files winning. A personal override is a candidate when neither `_bmad/custom/config.toml` nor `_bmad/custom/config.user.toml` holds the key, because only those two layers outranked it. `_bmad/config.toml` is ignored in that comparison, so a key it sets to a different value is still a candidate; show both values and their files. A key that either custom file holds is not a candidate, because the custom value already won before the change.
37
+ 2. **Plan.** Build one row per moved table or key: source file and provenance, destination file and table, and the status (`new`, `same value already present`, `conflict`). Show each conflict with both values. Retired v6 names (`bmad-testarch-atdd`, `bmad-testarch-ci`) are sources too, read before any content rewrite. Wait for approval, and for the user's choice on each conflict. For a `_bmad/config.user.toml` key that `_bmad/config.toml` sets to a different value, report both values and their files, and move the legacy value unless the user keeps the `_bmad/config.toml` one.
38
38
  3. **Apply.** For each approved row write the destination, preserving the source text (comments and order) and rewriting `[workflow]` to `[workflow.red]` or `[workflow.ci]`. Re-read and parse the destination to verify it holds every moved key, then remove the old live file. Move a top-level `ci_platform` into `[workflow.ci]` of the same framework file. Move approved legacy `config.user.toml` keys into `[modules.tea]` of `_bmad/custom/config.user.toml`. A backup source is only read.
39
39
  4. **Resume.** A rerun recomputes the plan from disk: a source whose content is fully present in its destination changes nothing, and an interrupted run continues from the files that remain. Record each key or file restored from a backup, and each backup value the user chose to leave out, in the plan (the script uses `_bmad/custom/.tea-customization-migration.json`); a recorded item is never a conflict again, so a destination the user edited after migrating stays quiet. An unrecorded backup value that differs from the destination is a conflict.
40
40
  5. **Report.** Show the destination tables, the files removed, any conflicts left for the user and the files that remain.
@@ -45,6 +45,6 @@ checklist = [
45
45
  "`uv run _bmad/scripts/resolve_customization.py --skill <automate-skill-root> --project-root . --key workflow.red` prints the migrated red settings.",
46
46
  "`uv run _bmad/scripts/resolve_customization.py --skill <framework-skill-root> --project-root . --key workflow.ci` prints the migrated CI settings, `ci_platform` included.",
47
47
  "`[workflow]` of the framework override files holds no `ci_platform`.",
48
- "Every `[modules.tea]` key that only `_bmad/config.user.toml` held is in `_bmad/custom/config.user.toml`, or the user kept the canonical value.",
48
+ "Every `[modules.tea]` key of `_bmad/config.user.toml` that neither custom file holds is in `_bmad/custom/config.user.toml`, or the user kept the canonical value.",
49
49
  "A second run changes nothing.",
50
50
  ]