peaks-cli 1.3.4 → 1.3.6

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.
Files changed (69) hide show
  1. package/dist/src/cli/commands/hook-handle.d.ts +2 -2
  2. package/dist/src/cli/commands/hook-handle.js +5 -10
  3. package/dist/src/cli/commands/hooks-commands.js +44 -29
  4. package/dist/src/cli/commands/project-commands.js +7 -1
  5. package/dist/src/cli/commands/workspace-commands.js +1 -2
  6. package/dist/src/cli/program.js +3 -4
  7. package/dist/src/services/dashboard/project-dashboard-service.d.ts +0 -7
  8. package/dist/src/services/dashboard/project-dashboard-service.js +1 -8
  9. package/dist/src/services/dispatch/sub-agent-dispatcher.d.ts +45 -40
  10. package/dist/src/services/dispatch/sub-agent-dispatcher.js +25 -20
  11. package/dist/src/services/ide/adapters/claude-code-adapter.js +0 -3
  12. package/dist/src/services/ide/adapters/trae-adapter.js +2 -17
  13. package/dist/src/services/ide/ide-types.d.ts +1 -18
  14. package/dist/src/services/progress/progress-service.d.ts +23 -103
  15. package/dist/src/services/progress/progress-service.js +24 -137
  16. package/dist/src/services/scan/file-size-scan.d.ts +4 -0
  17. package/dist/src/services/scan/file-size-scan.js +32 -3
  18. package/dist/src/services/skills/hooks-settings-service.d.ts +57 -5
  19. package/dist/src/services/skills/hooks-settings-service.js +153 -28
  20. package/dist/src/shared/incrementing-number.d.ts +0 -8
  21. package/dist/src/shared/incrementing-number.js +11 -1
  22. package/dist/src/shared/version.d.ts +1 -1
  23. package/dist/src/shared/version.js +1 -1
  24. package/package.json +1 -1
  25. package/skills/peaks-prd/SKILL.md +16 -16
  26. package/skills/peaks-prd/references/workflow.md +4 -4
  27. package/skills/peaks-qa/SKILL.md +25 -32
  28. package/skills/peaks-qa/references/qa-fanout-contract.md +6 -6
  29. package/skills/peaks-qa/references/regression-gates.md +1 -1
  30. package/skills/peaks-rd/SKILL.md +8 -21
  31. package/skills/peaks-rd/references/{openspec-mcp-cli.md → openspec-cli.md} +11 -14
  32. package/skills/peaks-solo/SKILL.md +1 -1
  33. package/skills/peaks-solo/references/a2a-artifact-mapping.md +1 -1
  34. package/skills/peaks-solo/references/browser-workflow.md +49 -38
  35. package/skills/peaks-solo/references/external-skill-invocation.md +9 -7
  36. package/skills/peaks-solo/references/{openspec-mcp-workflow.md → openspec-workflow.md} +5 -20
  37. package/skills/peaks-solo/references/runbook.md +21 -21
  38. package/skills/peaks-solo/references/sub-agent-dispatch.md +16 -35
  39. package/skills/peaks-solo/references/swarm-dispatch-contract.md +9 -9
  40. package/skills/peaks-ui/SKILL.md +22 -24
  41. package/skills/peaks-ui/references/workflow.md +2 -2
  42. package/dist/src/cli/commands/mcp-commands.d.ts +0 -3
  43. package/dist/src/cli/commands/mcp-commands.js +0 -144
  44. package/dist/src/cli/commands/progress-close-kill.d.ts +0 -51
  45. package/dist/src/cli/commands/progress-close-kill.js +0 -152
  46. package/dist/src/cli/commands/progress-commands.d.ts +0 -3
  47. package/dist/src/cli/commands/progress-commands.js +0 -379
  48. package/dist/src/cli/commands/progress-start-spawn.d.ts +0 -59
  49. package/dist/src/cli/commands/progress-start-spawn.js +0 -140
  50. package/dist/src/cli/commands/progress-watch-render.d.ts +0 -80
  51. package/dist/src/cli/commands/progress-watch-render.js +0 -308
  52. package/dist/src/services/mcp/mcp-apply-service.d.ts +0 -31
  53. package/dist/src/services/mcp/mcp-apply-service.js +0 -112
  54. package/dist/src/services/mcp/mcp-call-service.d.ts +0 -17
  55. package/dist/src/services/mcp/mcp-call-service.js +0 -34
  56. package/dist/src/services/mcp/mcp-client-service.d.ts +0 -14
  57. package/dist/src/services/mcp/mcp-client-service.js +0 -49
  58. package/dist/src/services/mcp/mcp-install-registry.d.ts +0 -11
  59. package/dist/src/services/mcp/mcp-install-registry.js +0 -38
  60. package/dist/src/services/mcp/mcp-plan-service.d.ts +0 -29
  61. package/dist/src/services/mcp/mcp-plan-service.js +0 -109
  62. package/dist/src/services/mcp/mcp-protocol.d.ts +0 -24
  63. package/dist/src/services/mcp/mcp-protocol.js +0 -41
  64. package/dist/src/services/mcp/mcp-scan-service.d.ts +0 -8
  65. package/dist/src/services/mcp/mcp-scan-service.js +0 -214
  66. package/dist/src/services/mcp/mcp-stdio-transport.d.ts +0 -10
  67. package/dist/src/services/mcp/mcp-stdio-transport.js +0 -50
  68. package/dist/src/services/mcp/mcp-types.d.ts +0 -31
  69. package/dist/src/services/mcp/mcp-types.js +0 -1
@@ -43,7 +43,7 @@ For frontend or UI-affecting slices, RD's self-test uses the Playwright MCP head
43
43
 
44
44
  ### Contract 1 — Self-test screenshots must land under .peaks/_runtime/<sessionId>/qa/screenshots/
45
45
 
46
- Even though RD runs the self-test, **the screenshot evidence is QA's** by convention (the test report under `.peaks/_runtime/<sessionId>/qa/test-reports/` cites these paths). Therefore RD's Playwright screenshot tool calls (via `peaks mcp call --capability playwright-mcp.browser-validation --tool browser_take_screenshot --args-json '<args>' --json`) MUST pass `filename` (in the args object) whose absolute path is inside `.peaks/_runtime/<sessionId>/qa/screenshots/`, exactly the same contract QA enforces. Do not let Playwright fall back to the project root.
46
+ Even though RD runs the self-test, **the screenshot evidence is QA's** by convention (the test report under `.peaks/_runtime/<sessionId>/qa/test-reports/` cites these paths). Therefore RD's Playwright screenshot tool calls (the LLM invokes `browser_take_screenshot` directly when the the Playwright MCP tools are present in the LLM's tool list) MUST pass `filename` (in the args object) whose absolute path is inside `.peaks/_runtime/<sessionId>/qa/screenshots/`, exactly the same contract QA enforces. Do not let Playwright fall back to the project root. If the the Playwright MCP tools are absent from the tool list, STOP and tell the user: `claude mcp add playwright -- npx @playwright/mcp@latest` (Claude Code) or consult the IDE's MCP install docs.
47
47
 
48
48
  ### Contract 2 — Login / CAPTCHA / SSO / MFA wall is a hard block, not a skip
49
49
 
@@ -119,21 +119,6 @@ On the first presence:set in a project, ensure the out-of-band status bar is ins
119
119
  peaks statusline install --project <repo> # idempotent; skips if already installed
120
120
  ```
121
121
 
122
- **Auto-spawn a progress watch terminal once per slice (BLOCKING on the first phase transition).** The user opens a fresh VSCode window per slice, not per Bash call. Without a separate progress terminal the user has no live signal that the sub-agent is alive — the only signal they have is the static statusline. So at the first phase transition of every slice, fire `peaks progress start` ONCE. The CLI auto-spawns a new terminal tab running `peaks progress watch` and the user can close the new tab at any time. Do NOT re-invoke on every phase change — one per slice is the contract. The LLM-side cost of this one invocation is one Bash call plus a small JSON envelope; the watch side is a 1s file poll that does not consume LLM tokens.
123
-
124
- ```bash
125
- # At the first phase transition of a slice (after the first
126
- # peaks progress step), fire the watch:
127
- peaks progress start --project <repo> --reason "rd-implementing for <rid>"
128
-
129
- # On every subsequent phase transition, only update the
130
- # progress file — the watch is already running in another tab:
131
- peaks progress step --project <repo> --request-id <rid> --role rd \
132
- --step "running pnpm test" --phase running
133
- ```
134
-
135
- If `peaks progress start` is unsupported on the current platform (no terminal emulator, headless container, etc.) it returns a recoverable error envelope. Surface that in the RD handoff so the user knows the auto-spawn failed; the sub-agent can still emit `peaks progress step` writes that the user reads from the on-disk file. The auto-spawn is convenience, not a gate.
136
-
137
122
  Read persistent project memory via CLI (durable, LLM-authored memories):
138
123
 
139
124
  ```bash
@@ -264,9 +249,11 @@ peaks codegraph affected --project <repo> <changed-files...> --json
264
249
  # NEVER write mock data inline in component files.
265
250
  # See "Mock data placement rules" section for the full framework mapping.
266
251
 
267
- # 5. optional library docs lookup through an installed MCP server
268
- peaks mcp list --json
269
- peaks mcp call --capability context7.docs-lookup --tool <name> --args-json '{...}' --json
252
+ # 5. optional library docs lookup through the LLM's own tool list (Context7 MCP)
253
+ # If the Context7 MCP is present in the tool list, invoke the
254
+ # tool directly (resolve-library-id / query-docs / etc.). If absent, skip
255
+ # library docs and rely on existing project knowledge — do NOT hand-edit
256
+ # `~/.claude/settings.json` to install MCPs.
270
257
 
271
258
  # 6. record red-line scope, slice contract, coverage status into the RD artifact, then implement
272
259
 
@@ -581,7 +568,7 @@ RD cannot mark a development slice complete until all of these are true. Each ga
581
568
  1. OpenSpec change artifacts exist and are linked for non-trivial work when the target repo already has `openspec/`, or the user has approved adding it;
582
569
  2. unit tests covering the new or changed behavior have been added or updated and run successfully; **→ verified by Peaks-Cli Gate B2**
583
570
  3. if the repository is legacy and total UT coverage is below the project target, do not block on historical coverage, but require coverage evidence for newly added or changed code;
584
- 4. for frontend or UI-affecting slices, RD self-test has launched the app and used Playwright MCP for real browser end-to-end validation with visible-browser confirmation (install via `peaks mcp plan --capability playwright-mcp.browser-validation --json` then `peaks mcp apply --capability playwright-mcp.browser-validation --yes --json` if not yet present; navigate with `peaks mcp call --capability playwright-mcp.browser-validation --tool browser_navigate --args-json '<args>' --json`, capture with `browser_snapshot` / `browser_take_screenshot` / `browser_console_messages` / `browser_network_requests` (each via `peaks mcp call`), sanitize route/actions and observations before retention, record acceptance result, close with `browser_close` (via `peaks mcp call`)); the skill body never bakes in the `mcp__playwright__` prefix; if login, CAPTCHA, SSO, or MFA appears, the headed browser is already visible — wait for the user to complete login and explicitly confirm completion before continuing;
571
+ 4. for frontend or UI-affecting slices, RD self-test has launched the app and used the Playwright MCP for real browser end-to-end validation with visible-browser confirmation (the LLM checks its own tool list for any Playwright MCP entry in the LLM tool list; if absent, the user installs via `claude mcp add playwright -- npx @playwright/mcp@latest` RD does NOT hand-edit `~/.claude/settings.json` or auto-install on the user's behalf); navigate with `browser_navigate`, capture with `browser_snapshot` / `browser_take_screenshot` / `browser_console_messages` / `browser_network_requests`, sanitize route/actions and observations before retention, record acceptance result, close with `browser_close`; if login, CAPTCHA, SSO, or MFA appears, the headed browser is already visible — wait for the user to complete login and explicitly confirm completion before continuing;
585
572
  5. code review has been performed with findings recorded and CRITICAL/HIGH issues fixed before progression; unresolved CRITICAL/HIGH findings only allow a blocked handoff; **→ verified by Peaks-Cli Gate B3** — evidence file must exist at `.peaks/<changeId>/rd/code-review.md`
586
573
  6. security review has been performed for the changed surface, with CRITICAL/HIGH issues fixed before progression and particular attention to user input, file system access, external calls, auth, secrets, and dependency changes; **→ verified by Peaks-Cli Gate B4** — evidence file must exist at `.peaks/<changeId>/rd/security-review.md`
587
574
  6.5. perf-baseline output is in place for any slice with a user-perceivable performance surface — `peaks perf baseline --apply` has been run and `.peaks/_runtime/<sessionId>/rd/perf-baseline.md` exists with the Results table filled in with measurements (or `N/A — no perf surface` in Notes for slices without a perf surface). For docs / chore / pure-bugfix-no-perf, the file is not required. Run the fan-out from "Parallel review fan-out" below; **→ verified by Peaks-Cli Gate B9** — evidence file must exist at `.peaks/<changeId>/rd/perf-baseline.md` and contain a non-empty Results table or the N/A marker.
@@ -816,7 +803,7 @@ Do not run upstream installer flows, mutate agent settings, or commit `.codegrap
816
803
 
817
804
  **Other external resources** (Context7, SearchCode, everything-claude-code, GitNexus, etc.): Use `peaks capabilities --source access-repo/mcp-server --json` for capability discovery before recommending. References only — do not execute upstream installers, do not install upstream resources, do not persist sensitive examples. Peaks-Cli RD gates remain authoritative.
818
805
 
819
- **OpenSpec and MCP CLI**: Route through Peaks-Cli CLI (`peaks openspec show/to-rd/render`, `peaks mcp list/plan/apply/call`). Do not hand-edit `openspec/changes/**` or `~/.claude/settings.json`. Recipes: `references/openspec-mcp-cli.md`.
806
+ **OpenSpec CLI**: Route through Peaks-Cli CLI (`peaks openspec show/to-rd/render`). Do not hand-edit `openspec/changes/**`. Recipes: `references/openspec-cli.md`. (MCP CLI was retired in slice #016; the LLM's own tool list is the source of truth for which MCPs are installed.)
820
807
 
821
808
  ## Boundaries
822
809
 
@@ -1,6 +1,8 @@
1
- # OpenSpec and MCP CLI for Peaks RD
1
+ # OpenSpec CLI for Peaks RD
2
2
 
3
- Peaks RD reads OpenSpec change packs and external MCP servers through the Peaks CLI rather than re-parsing markdown or spawning subprocesses by hand. The CLI returns the same stable envelope shape (`{ ok, command, data, warnings, nextActions }`) so RD can capture it as artifact JSON.
3
+ Peaks RD reads OpenSpec change packs through the Peaks CLI rather than re-parsing markdown or spawning subprocesses by hand. The CLI returns the same stable envelope shape (`{ ok, command, data, warnings, nextActions }`) so RD can capture it as artifact JSON.
4
+
5
+ > **Slice #016 (2026-06-09)**: this document used to live at `openspec-mcp-cli.md` and contained a section on the now-retired peaks-cli MCP install / call verbs. The MCP subsystem was retired in slice #016; the LLM's own tool list is now the source of truth for installed MCPs. The OpenSpec CLI recipes below are unchanged.
4
6
 
5
7
  ## Loading an existing OpenSpec change as RD input
6
8
 
@@ -43,23 +45,18 @@ The request JSON shape is:
43
45
 
44
46
  `render --apply` refuses to overwrite an existing change directory unless `--overwrite` is passed. Treat that refusal as intentional.
45
47
 
46
- ## Calling MCP tools for research evidence
48
+ ## Library docs lookup via the LLM's own MCP tool list (slice #016)
47
49
 
48
- When RD needs external library or API docs, prefer a registered MCP server through Peaks instead of free-form web fetches:
50
+ When RD needs external library or API docs, the consuming LLM checks its own tool list for an MCP entry (typically `mcp__plugin_context7_context7__*` for Context7). If present, the LLM invokes the tool by name directly (`resolve-library-id` then `query-docs` are the canonical Context7 tool names). If absent, the LLM tells the user the install command:
49
51
 
50
52
  ```bash
51
- peaks mcp list --json
52
- peaks mcp plan --capability context7.docs-lookup --json
53
- peaks mcp apply --capability context7.docs-lookup --yes --json # one-time install
54
- peaks mcp call --capability context7.docs-lookup --tool <toolName> --args-json '{...}' --json
53
+ # Claude Code:
54
+ claude mcp add context7 -- npx @upstash/context7-mcp
55
+ # Restart the IDE after install; the runtime picks up the new server only after a fresh process.
55
56
  ```
56
57
 
57
- Rules:
58
-
59
- - `plan` must be inspected before `apply`. `apply` is a real side effect; it backs up `~/.claude/settings.json` first.
60
- - Required env vars must be present before `apply` and `call`; Peaks refuses to spawn a server with missing env.
61
- - `call` results should be written into the RD artifact (e.g. `.peaks/<session-id>/rd/mcp-call-<ts>.json`) as the evidence link. Do not paste secrets or full network bodies into the RD handoff.
58
+ peaks-cli does not install MCPs on the user's behalf as of slice #016; the LLM is the executor and the IDE is the dispatcher. Evidence of the lookup (sanitized query + response summary) goes into the RD artifact, not full network bodies or secrets.
62
59
 
63
60
  ## Boundary
64
61
 
65
- Peaks RD must not hand-edit `openspec/changes/**` or `~/.claude/settings.json` directly. All writes go through the CLI commands above with dry-run preview, explicit confirmation, and Peaks-managed source labels.
62
+ Peaks RD must not hand-edit `openspec/changes/**` or `~/.claude/settings.json` directly. All OpenSpec writes go through the CLI commands above with dry-run preview, explicit confirmation, and Peaks-managed source labels.
@@ -324,7 +324,7 @@ Use the Peaks-Cli CLI for runtime side effects.
324
324
 
325
325
  Map gstack stages to Peaks-Cli role artifacts; preserve Peaks-Cli confirmation gates. Do not delegate orchestration to gstack commands.
326
326
 
327
- For frontend workflows, RD and QA must use Playwright MCP for real browser E2E. The skill body never bakes in the `mcp__playwright__` prefix; it uses the peaks mcp plan/apply/call pattern (`peaks mcp plan --capability playwright-mcp.browser-validation --json` then `peaks mcp apply --capability playwright-mcp.browser-validation --yes --json` then `peaks mcp call --capability playwright-mcp.browser-validation --tool <toolName> --args-json '<args>' --json`). Chrome DevTools MCP is a secondary CDP surface only. Sanitize browser artifacts before retention (no login URLs, cookies, tokens, PII). See `references/browser-workflow.md`.
327
+ For frontend workflows, RD and QA must use Playwright MCP for real browser E2E. The consuming LLM detects the MCP from its own tool list: any Playwright MCP entry in the LLM tool list means the MCP is installed; absent means the user needs to install (`claude mcp add playwright -- npx @playwright/mcp@latest` in Claude Code; other IDEs have their own MCP install path). The LLM invokes the tool directly (browser_navigate / browser_click / browser_snapshot / browser_take_screenshot / browser_console_messages / browser_network_requests / browser_close) by name — there is no peaks-cli indirection. Chrome DevTools MCP is a secondary CDP surface only. Sanitize browser artifacts before retention (no login URLs, cookies, tokens, PII). See `references/browser-workflow.md`.
328
328
 
329
329
  ## Peaks-Cli Local intermediate artifact workspace (MANDATORY)
330
330
 
@@ -99,7 +99,7 @@ To keep the mapping honest, peaks-cli **does not** currently provide the followi
99
99
  - A2A **AgentCard** served over HTTP at `/.well-known/agent-card.json`. peaks-cli is a local CLI; its "card" is the on-disk `.peaks/.active-skill.json` plus `peaks skill doctor --json`.
100
100
  - A2A **streaming** responses (SSE / WebSocket). peaks commands are synchronous and return a single JSON envelope.
101
101
  - A2A **identity / auth** (OAuth, OIDC, mTLS). peaks assumes local-machine trust.
102
- - A2A **cross-vendor discovery**. peaks has no A2A registry entry; it has `peaks mcp list --json` for MCP-compatible capabilities.
102
+ - A2A **cross-vendor discovery**. peaks has no A2A registry entry; MCP-compatible capabilities are discovered by the LLM via its own tool list (the LLM checks for `mcp__<server>__*` entries in its own function schema) and reported back to the user. Slice #016 retired the `peaks mcp *` indirection layer.
103
103
  - A2A **Task delegation across the network**. peaks's "sub-agent" is a Claude Code `Task` tool call in the same process, not a remote A2A server.
104
104
 
105
105
  These are *deliberate* omissions. peaks-cli solves a different problem (a local workflow-gating CLI for Claude Code), and adopting A2A's networking surface would add weight without addressing peaks's actual failure modes (which are around LLM bypassing gates, not around inter-agent discovery).
@@ -11,6 +11,8 @@ Peaks skills standardize on **Playwright MCP** as the controlled headed-browser
11
11
 
12
12
  > **Bug history**: an earlier version of this document recommended Chrome DevTools MCP for "open a headed browser when peaks-solo gets a product document link." Dogfood testing in 2026-05 revealed the tool requires a pre-running Chrome with remote debugging enabled — it does NOT launch its own browser. Playwright MCP is the correct tool for the "open on demand" case.
13
13
 
14
+ > **Slice #016 (2026-06-09)**: peaks-cli no longer manages MCP install / dispatch. Skill bodies instruct the LLM to (a) check its own tool list for any Playwright MCP entry, (b) invoke the tool by name if present, (c) tell the user the install command if absent. There is no peaks-cli MCP indirection layer anymore.
15
+
14
16
  ## When to open the headed browser
15
17
 
16
18
  Open a controlled browser when:
@@ -21,63 +23,71 @@ Open a controlled browser when:
21
23
 
22
24
  Never open a browser to bypass authentication, run arbitrary URLs the user has not approved, or interact with payment / delete / authenticated mutation flows without explicit user confirmation.
23
25
 
24
- ## Install the Playwright MCP server (one-time)
26
+ ## Playwright MCP install + detect
27
+
28
+ The LLM runtime exposes Playwright's tools under the `mcp__playwright__*` namespace when the user has installed the MCP. Skill bodies MUST NOT bake the prefix into a SKILL.md or reference; the prefix is owned by the LLM runtime.
29
+
30
+ **Detect**: the LLM checks its own tool list for any `mcp__playwright__*` entry. If present, the MCP is installed; the LLM invokes the tool by name (e.g. `browser_navigate`, `browser_take_screenshot`).
25
31
 
26
- Capability discovery exposes `playwright-mcp.browser-validation`. Install through the Peaks CLI rather than hand-editing settings.json so the peaks-managed marker and backup flow apply:
32
+ **Install (if absent)**: skill bodies surface the install command to the user. The user runs it themselves — peaks-cli does not hand-edit `~/.claude/settings.json`.
27
33
 
28
- ```bash
29
- peaks mcp list --json
30
- peaks mcp plan --capability playwright-mcp.browser-validation --json
31
- peaks mcp apply --capability playwright-mcp.browser-validation --yes --json
32
- ```
34
+ - Claude Code:
35
+ ```bash
36
+ claude mcp add playwright -- npx @playwright/mcp@latest
37
+ ```
38
+ Restart Claude Code (or reload the window) so the MCP runtime picks up the new server.
33
39
 
34
- If a non-peaks-managed Playwright MCP entry already exists in `.claude/settings.json`, `apply` will refuse unless `--claim` is passed. Discuss with the user before claiming.
40
+ - Other IDEs (Trae, Cursor, Codex, Qoder, Tongyi, ...): consult the IDE's MCP install docs. The install command and the runtime prefix differ per IDE; the LLM checks the tool list rather than assuming a prefix.
35
41
 
36
- After install, Claude Code's MCP runtime exposes the tools under the `mcp__playwright__*` namespace. Peaks skill bodies reference these tools via the `peaks mcp call` primitive (the skill body never bakes in the `mcp__playwright__` prefix; the prefix is owned by Claude Code's runtime, and `peaks mcp call` is the load-bearing fallback for sub-agents and non-Claude IDEs). The 4-step plan → apply → call pattern is the contract.
42
+ The skill body uses the LLM's tool list as the source of truth never the cached `~/.claude/settings.json` (the LLM cannot read the file, and the file's contents may have drifted from runtime state).
37
43
 
38
- ## Optional: install Chrome DevTools MCP for CDP inspection
44
+ ## Chrome DevTools MCP optional, secondary surface
39
45
 
40
- When inspecting an already-running Chrome (e.g., the user's own browser session opened with `chrome --remote-debugging-port=9222`), additionally install Chrome DevTools MCP:
46
+ When inspecting an already-running Chrome (e.g., the user's own browser session opened with `chrome --remote-debugging-port=9222`), the LLM checks its tool list for any `mcp__chrome_devtools__*` entry. If present, the LLM invokes the tool by name directly (e.g. `list_pages`, `take_screenshot`, `performance_start_trace`).
41
47
 
42
- ```bash
43
- peaks mcp plan --capability chrome-devtools-mcp.browser-debug --json
44
- peaks mcp apply --capability chrome-devtools-mcp.browser-debug --yes --json
45
- ```
48
+ Install (if absent) is the user's responsibility:
46
49
 
47
- Tools become available under `mcp__chrome-devtools__*` in the LLM runtime. Peaks skill bodies invoke them via `peaks mcp call --capability chrome-devtools-mcp.browser-debug --tool <name> --args-json '<args>' --json` (the skill body never bakes in the `mcp__chrome-devtools__` prefix). They fail with "Could not connect to Chrome" if no Chrome is running on `:9222`; that is by design.
50
+ - Claude Code:
51
+ ```bash
52
+ claude mcp add chrome-devtools -- npx chrome-devtools-mcp@latest
53
+ ```
54
+
55
+ Chrome DevTools tools fail with "Could not connect to Chrome" if no Chrome is running on `:9222`; that is by design and the skill must surface it as a blocked precondition, not silently fall back.
48
56
 
49
57
  ## Tool mapping for the "open a browser on demand" path (Playwright MCP)
50
58
 
51
- | Verb | peaks mcp call invocation | Notes |
59
+ The LLM invokes these tools directly from its `mcp__playwright__*` namespace. Peaks skill bodies describe the args shape; the LLM supplies them.
60
+
61
+ | Verb | Direct invocation (LLM tool list) | Notes |
52
62
  |---|---|---|
53
- | Open visible browser and navigate | `peaks mcp call --capability playwright-mcp.browser-validation --tool browser_navigate --args-json '{"url":"<url>"}' --json` | Spawns a headed browser if none open; navigates in the existing context otherwise. |
54
- | Confirm visible browser opened | `peaks mcp call --capability playwright-mcp.browser-validation --tool browser_take_screenshot --args-json '{"filename":"<abs-path>"}' --json` | Screenshot is the visible-browser confirmation. |
55
- | Read structured page (text + a11y) | `peaks mcp call --capability playwright-mcp.browser-validation --tool browser_snapshot --args-json '{}' --json` | Accessibility tree with element refs. |
56
- | Click / fill / press key | `peaks mcp call --capability playwright-mcp.browser-validation --tool browser_click --args-json '<args>' --json` (and `browser_fill`, `browser_press_key`) | Drive the page after navigation. |
57
- | Inspect console errors | `peaks mcp call --capability playwright-mcp.browser-validation --tool browser_console_messages --args-json '{"level":"error"}' --json` | Pass `level` to filter (`error`, `warning`). |
58
- | Inspect network failures | `peaks mcp call --capability playwright-mcp.browser-validation --tool browser_network_requests --args-json '{"filter":"<regex>"}' --json` | Pass `filter` regex when the page has many requests. |
59
- | Resize viewport for responsive checks | `peaks mcp call --capability playwright-mcp.browser-validation --tool browser_resize --args-json '<args>' --json` | |
60
- | Capture a full-page screenshot | `peaks mcp call --capability playwright-mcp.browser-validation --tool browser_take_screenshot --args-json '{"filename":"<abs-path>","fullPage":true}' --json` | Sanitize before retention. |
61
- | Close the session cleanly | `peaks mcp call --capability playwright-mcp.browser-validation --tool browser_close --args-json '{}' --json` | End-of-task. |
62
- | **Reference (runtime prefix, do not bake into skills)** | `mcp__playwright__<toolName>` | The Claude Code runtime prefix; the LLM resolves this from the registered server. The skill body uses `peaks mcp call` exclusively. |
63
+ | Open visible browser and navigate | `browser_navigate --args '{"url":"<url>"}'` | Spawns a headed browser if none open; navigates in the existing context otherwise. |
64
+ | Confirm visible browser opened | `browser_take_screenshot --args '{"filename":"<abs-path>"}'` | Screenshot is the visible-browser confirmation. |
65
+ | Read structured page (text + a11y) | `browser_snapshot --args '{}'` | Accessibility tree with element refs. |
66
+ | Click / fill / press key | `browser_click --args '<args>'` (and `browser_type`, `browser_press_key`) | Drive the page after navigation. |
67
+ | Inspect console errors | `browser_console_messages --args '{"level":"error"}'` | Pass `level` to filter (`error`, `warning`). |
68
+ | Inspect network failures | `browser_network_requests --args '{"filter":"<regex>"}'` | Pass `filter` regex when the page has many requests. |
69
+ | Resize viewport for responsive checks | `browser_resize --args '<args>'` | |
70
+ | Capture a full-page screenshot | `browser_take_screenshot --args '{"filename":"<abs-path>","fullPage":true}'` | Sanitize before retention. |
71
+ | Close the session cleanly | `browser_close --args '{}'` | End-of-task. |
72
+ | **Runtime prefix (LLM-owned, do not bake into skills)** | `mcp__playwright__<toolName>` | The Claude Code / Trae / etc. runtime prefix; the LLM resolves this from the registered server. |
63
73
 
64
74
  ## Tool mapping for the "connect to running Chrome" path (Chrome DevTools MCP, optional)
65
75
 
66
- | Verb | peaks mcp call invocation | Notes |
76
+ | Verb | Direct invocation (LLM tool list) | Notes |
67
77
  |---|---|---|
68
- | List pages in user's Chrome | `peaks mcp call --capability chrome-devtools-mcp.browser-debug --tool list_pages --args-json '{}' --json` | Requires Chrome already running with `--remote-debugging-port=9222`. |
69
- | Bring a tab to front | `peaks mcp call --capability chrome-devtools-mcp.browser-debug --tool select_page --args-json '{"bringToFront":true}' --json` | Useful when the user navigated themselves. |
70
- | Screenshot the visible viewport | `peaks mcp call --capability chrome-devtools-mcp.browser-debug --tool take_screenshot --args-json '<args>' --json` | |
71
- | Read structured page | `peaks mcp call --capability chrome-devtools-mcp.browser-debug --tool take_snapshot --args-json '{}' --json` | |
72
- | Performance trace | `peaks mcp call --capability chrome-devtools-mcp.browser-debug --tool performance_start_trace --args-json '<args>' --json` then `performance_stop_trace` (each via `peaks mcp call`) | |
73
- | Lighthouse audit | `peaks mcp call --capability chrome-devtools-mcp.browser-debug --tool lighthouse_audit --args-json '{"mode":"snapshot"}' --json` | |
74
- | **Reference (runtime prefix, do not bake into skills)** | `mcp__chrome-devtools__<toolName>` | The Claude Code runtime prefix; the LLM resolves this from the registered server. The skill body uses `peaks mcp call` exclusively. |
78
+ | List pages in user's Chrome | `list_pages --args '{}'` | Requires Chrome already running with `--remote-debugging-port=9222`. |
79
+ | Bring a tab to front | `select_page --args '{"bringToFront":true}'` | Useful when the user navigated themselves. |
80
+ | Screenshot the visible viewport | `take_screenshot --args '<args>'` | |
81
+ | Read structured page | `take_snapshot --args '{}'` | |
82
+ | Performance trace | `performance_start_trace --args '<args>'` then `performance_stop_trace` | |
83
+ | Lighthouse audit | `lighthouse_audit --args '{"mode":"snapshot"}'` | |
84
+ | **Runtime prefix (LLM-owned, do not bake into skills)** | `mcp__chrome_devtools__<toolName>` | The Claude Code / Trae / etc. runtime prefix; the LLM resolves this from the registered server. |
75
85
 
76
86
  If Chrome is not running on `:9222`, every Chrome DevTools MCP tool fails. The skill must surface that as a blocked precondition, not silently fall back.
77
87
 
78
88
  ## URL allow-list (always required before navigation)
79
89
 
80
- Before calling `peaks mcp call --capability playwright-mcp.browser-validation --tool browser_navigate --args-json '{"url":"<url>"}' --json` (or any other navigation), verify:
90
+ Before invoking `browser_navigate --args '{"url":"<url>"}'` (or any other navigation), verify:
81
91
 
82
92
  1. URL uses `https:` (reject `http:`, `file:`, `data:`, `javascript:`).
83
93
  2. Host belongs to an approved domain for the role (Feishu/Lark tenant for PRD product docs, the user-approved app target for UI/QA validation).
@@ -107,10 +117,11 @@ Redact sensitive values before retention. Store evidence as sanitized observatio
107
117
 
108
118
  ## Fallback when Playwright MCP is not installed
109
119
 
110
- If `peaks mcp list --json` does not include `playwright` in `mcpServers`:
120
+ If the LLM tool list does not include `mcp__playwright__*`:
111
121
 
112
- 1. Surface the install commands above (peaks mcp plan / apply).
122
+ 1. Surface the install command for the user's IDE (the Claude Code install is `claude mcp add playwright -- npx @playwright/mcp@latest`; other IDEs differ).
113
123
  2. Do not silently fall back to unauthenticated fetch tools, screenshots-only, or manual transcription.
114
124
  3. Frontend QA workflows that require headed browser validation mark the gate `blocked` with the install command in the next action. Manual steps or text-only fetching do not substitute for the mandatory headed browser gate.
125
+ 4. Restart the IDE after install; the runtime picks up the new server only after a fresh process / window reload.
115
126
 
116
127
  Peaks role artifacts (PRD / UI / RD / QA) remain authoritative for what evidence the role recorded; Playwright MCP is the tool, not the verdict.
@@ -4,13 +4,15 @@ Peaks skills reference many external resources — `mattpocock/skills`, `gstack`
4
4
 
5
5
  Every reference must follow the same three-stage pattern so the Peaks gates stay authoritative and side effects stay observable.
6
6
 
7
+ > **Slice #016 (2026-06-09)**: peaks-cli no longer manages MCP install or invocation. MCP capability detection moves from the peaks-cli CLI to the LLM's own tool list (the LLM checks for `mcp__<server>__*` entries in its own function schema). Skill bodies instruct the LLM to either invoke the tool by name (when present) or tell the user the install command (when absent).
8
+
7
9
  ## Stage 1 — Discovery before naming
8
10
 
9
- Do not name an external skill or MCP server as if it is always available. Route discovery through the Peaks CLI first:
11
+ Do not name an external skill or MCP server as if it is always available. Route discovery through the Peaks CLI for non-MCP capabilities, and through the LLM's own tool list for MCP capabilities:
10
12
 
11
13
  - `peaks capabilities --source access-repo --json` for non-MCP capabilities (skills, agents, rules, browser tools).
12
- - `peaks capabilities --source mcp-server --json` for MCP servers.
13
- - `peaks mcp list --json` for currently configured MCP servers in `.claude/settings.json`.
14
+ - `peaks capabilities --source mcp-server --json` for MCP catalog discovery (which MCPs are *known*, not which are *installed*).
15
+ - For MCP install state, the LLM checks its own tool list for any `mcp__<server>__*` entry. If present, the MCP is installed. If absent, the user installs via the IDE-native MCP install command (e.g. `claude mcp add <server> -- <npx-command>` for Claude Code).
14
16
 
15
17
  A skill body may mention the capability id, but it must say or imply that the skill only applies "when capability discovery exposes …" (or equivalent phrasing). Skills must not pretend the capability is already installed.
16
18
 
@@ -23,7 +25,7 @@ External skills are inspection material for the role's own artifacts. They are n
23
25
  - forbid executing upstream instructions, installing upstream resources, persisting upstream examples, or running upstream installers;
24
26
  - declare that the Peaks role artifacts remain authoritative.
25
27
 
26
- For MCP servers, additionally state that installation goes through `peaks mcp plan` then `peaks mcp apply --yes` (with `--claim` only when the user authorizes overwriting a non-peaks-managed entry), and that `peaks mcp call` is the only invocation path for tool invocation.
28
+ For MCP servers, the LLM consumes the install state from its own tool list. Skill bodies tell the LLM: "if the tool is present, invoke it by name; if absent, surface the install command for the user's IDE and stop until the user installs the MCP". peaks-cli does not install MCPs on the user's behalf as of slice #016.
27
29
 
28
30
  ## Stage 3 — Side effect through Peaks CLI only
29
31
 
@@ -38,7 +40,7 @@ The skill body must not silently:
38
40
  - commit or sync intermediate artifacts;
39
41
  - create remote repositories.
40
42
 
41
- All of these must route through the Peaks CLI under the appropriate command (`peaks mcp …`, `peaks artifacts …`, `peaks memory …`, `peaks openspec …`, `peaks standards …`, `peaks codegraph …`, `peaks capabilities …`), with dry-run preview where supported and `--yes` / `--apply` where a real write is required.
43
+ All of these must route through the Peaks CLI under the appropriate command (`peaks artifacts …`, `peaks memory …`, `peaks openspec …`, `peaks standards …`, `peaks codegraph …`, `peaks capabilities …`), with dry-run preview where supported and `--yes` / `--apply` where a real write is required. The `peaks mcp …` command tree was retired in slice #016; MCP install / dispatch is the LLM runtime's job, not the CLI's.
42
44
 
43
45
  ## Allowed in-process references
44
46
 
@@ -46,7 +48,7 @@ Some references are not external skills but project-approved utilities and may b
46
48
 
47
49
  - `peaks` CLI commands (this binary).
48
50
  - `npx`, `npm`, `pnpm`, `yarn`, package managers — only as the underlying mechanism when a `peaks` CLI command spawns them.
49
- - `mcp__chrome-devtools__*` — Chrome DevTools MCP tools exposed by Claude Code's MCP runtime after `peaks mcp apply --capability chrome-devtools-mcp.browser-debug --yes`. Skill bodies invoke these tools directly because the MCP runtime is the host; they are not piped through `peaks mcp call`. Login / CAPTCHA / SSO / MFA handoff rules and sanitization rules in `browser-workflow.md` still apply.
51
+ - `mcp__chrome_devtools__*` — Chrome DevTools MCP tools exposed by the LLM's MCP runtime when the user has installed Chrome DevTools MCP (Claude Code: `claude mcp add chrome-devtools -- npx chrome-devtools-mcp@latest`). Skill bodies tell the LLM to invoke these tools by name when they appear in the tool list. Login / CAPTCHA / SSO / MFA handoff rules and sanitization rules in `browser-workflow.md` still apply.
50
52
 
51
53
  These are not subject to capability discovery because they are part of the Peaks engineering surface, not external skills. The previous `gstack/browse/dist/browse` binary reference is no longer endorsed — see `browser-workflow.md` for the migration recipe.
52
54
 
@@ -66,5 +68,5 @@ When a skill body adds a new external reference, it must include the equivalent
66
68
  1. read the failing skill body section;
67
69
  2. identify the external skill or MCP that triggered the failure;
68
70
  3. add the capability discovery clause, the reference-only qualifier, the do-not-execute clause, and the Peaks-authoritative gate to that section;
69
- 4. for MCP servers, point the user at `peaks mcp plan/apply/call` instead of describing manual `.claude/settings.json` edits;
71
+ 4. for MCP servers, point the LLM at the tool-list self-check (its own `mcp__<server>__*` namespace) instead of describing manual `~/.claude/settings.json` edits;
70
72
  5. rerun the audit.
@@ -1,6 +1,8 @@
1
- # OpenSpec and MCP Lifecycle for Peaks Solo
1
+ # OpenSpec Lifecycle for Peaks Solo
2
2
 
3
- Peaks Solo orchestrates RD, QA, and SC. When the target repository uses OpenSpec or external MCP servers, Solo must drive the full lifecycle through the Peaks CLI so each role works against the same stable surface.
3
+ Peaks Solo orchestrates RD, QA, and SC. When the target repository uses OpenSpec, Solo must drive the full lifecycle through the Peaks CLI so each role works against the same stable surface.
4
+
5
+ > **Slice #016 (2026-06-09)**: this document used to live at `openspec-mcp-workflow.md` and contained a section on the `peaks mcp *` lifecycle. The MCP subsystem was retired in slice #016; that section is gone. The OpenSpec lifecycle described below is unchanged.
4
6
 
5
7
  ## OpenSpec change lifecycle
6
8
 
@@ -20,23 +22,6 @@ Rules Solo applies:
20
22
  - `validate` is run twice per change in a refactor flow: once before slicing (RD entry gate) and once before archive (QA exit gate). Both must end with `data.valid === true`.
21
23
  - `archive --apply` is the lifecycle terminator; Solo only invokes it after QA acceptance and SC commit.
22
24
 
23
- ## MCP capability lifecycle
24
-
25
- ```text
26
- peaks mcp list / scan → Solo inventories what is configured today
27
- peaks mcp plan → Solo previews the install diff before any write
28
- peaks mcp apply --yes → Solo authorizes the install (real side effect)
29
- peaks mcp call → RD or QA invokes a tool on the installed server
30
- peaks mcp rollback → Solo restores from a peaks-managed backup
31
- ```
32
-
33
- Rules Solo applies:
34
-
35
- - `apply` is the first real side effect in the MCP track. It requires `--yes`, backs up `~/.claude/settings.json` first, and refuses to overwrite non-peaks-managed entries unless `--claim` is passed. Solo decides whether `--claim` is appropriate.
36
- - Required env vars must be set in the runtime environment before `apply` or `call`. Peaks refuses to spawn a server with missing env, surfacing each missing key in `envCheck.missing`.
37
- - `call` writes evidence into the RD or QA artifact. Solo never pastes secrets, full request/response bodies, or session tokens into the handoff capsule.
38
- - `rollback` is the recovery action when an install or update made things worse. The backup path is the one Peaks reported during `apply`.
39
-
40
25
  ## Refactor workflow wiring
41
26
 
42
27
  For `peaks-solo refactor` runs against a repository with `openspec/`:
@@ -46,7 +31,7 @@ For `peaks-solo refactor` runs against a repository with `openspec/`:
46
31
  3. QA exit gate — re-run `peaks openspec validate <id>` after implementation; record the result in the QA validation report.
47
32
  4. Archive — `peaks openspec archive <id> --apply` only after QA passes the exit gate and SC closes the final commit.
48
33
 
49
- If MCP servers are needed for docs lookup or research, Solo coordinates the one-time install before RD starts so RD does not block on capability resolution mid-slice.
34
+ If the consuming LLM needs an MCP server for docs lookup or research (e.g. Context7), it checks its own tool list for `mcp__<server>__*` and tells the user the install command if absent. peaks-cli is no longer in the install path; the LLM is the executor, the IDE is the dispatcher.
50
35
 
51
36
  ## Boundary
52
37
 
@@ -20,12 +20,12 @@ peaks skill runbook peaks-solo --json
20
20
  peaks workspace init --project <repo> --json
21
21
  peaks workspace reconcile --project <repo> --json
22
22
  peaks scan archetype --project <repo> --json
23
- # → copy archetype, frontendOnly, signals into .peaks/<session-id>/rd/project-scan.md (Peaks-Cli Gate A)
24
- # → copy libraries[] into .peaks/<session-id>/rd/project-scan.md under `## Library versions`
23
+ # → copy archetype, frontendOnly, signals into .peaks/_runtime/<session-id>/rd/project-scan.md (Peaks-Cli Gate A)
24
+ # → copy libraries[] into .peaks/_runtime/<session-id>/rd/project-scan.md under `## Library versions`
25
25
  peaks scan libraries --project <repo> --json
26
26
  # → if archetype != greenfield AND archetype != unknown:
27
27
  peaks scan existing-system --project <repo> --json
28
- # → copy tokens, sources, conventions, inconsistencies into .peaks/<session-id>/system/existing-system.md (Peaks-Cli Gate A.5)
28
+ # → copy tokens, sources, conventions, inconsistencies into .peaks/_runtime/<session-id>/system/existing-system.md (Peaks-Cli Gate A.5)
29
29
 
30
30
  # 1. Peaks-Cli Standards preflight + apply
31
31
  # Run dry-run first to inspect deltas, then APPLY. In full-auto and swarm modes,
@@ -55,7 +55,7 @@ peaks request transition <rid> --role prd --state handed-off --project <repo> --
55
55
 
56
56
  # 3. Peaks-Cli Swarm parallel — sub-agent fan-out (peaks sub-agent dispatch, NOT Skill tool)
57
57
  # Solo computes the swarm plan from --type + frontendOnly + frontend-keyword scan,
58
- # writes it to .peaks/<sid>/sc/swarm-plan.json, then launches one
58
+ # writes it to .peaks/_runtime/<sid>/sc/swarm-plan.json, then launches one
59
59
  # `peaks sub-agent dispatch <role>` call per sub-agent in the same message.
60
60
  # See "Peaks-Cli Swarm parallel phase" above for the full decision table and the
61
61
  # prompt template; the role's required artefact paths are listed there.
@@ -80,36 +80,36 @@ peaks skill presence:set peaks-solo --project <repo> --mode <mode> --gate swarm-
80
80
  # Step 0 / presence, plus the runtime args (rid / sid / mode / type / paths).
81
81
  # 3c. After fan-out, Solo restores presence once and runs Gate B (ls checks):
82
82
  peaks skill presence:set peaks-solo --project <repo> --mode <mode> --gate swarm-converged
83
- ls .peaks/<sid>/prd/requests/<rid>.md # PRD artefact must exist (Gate B hard)
84
- # feature / refactor → ls .peaks/<sid>/rd/tech-doc.md
85
- # bugfix → ls .peaks/<sid>/rd/bug-analysis.md
86
- ls .peaks/<sid>/qa/test-cases/<rid>.md # QA test-cases (skipped for docs|chore)
83
+ ls .peaks/_runtime/<sid>/prd/requests/<rid>.md # PRD artefact must exist (Gate B hard)
84
+ # feature / refactor → ls .peaks/_runtime/<sid>/rd/tech-doc.md
85
+ # bugfix → ls .peaks/_runtime/<sid>/rd/bug-analysis.md
86
+ ls .peaks/_runtime/<sid>/qa/test-cases/<rid>.md # QA test-cases (skipped for docs|chore)
87
87
  # ui (only when in plan):
88
- ls .peaks/<sid>/ui/design-draft.md 2>&1 # non-blocking (Gate B info)
88
+ ls .peaks/_runtime/<sid>/ui/design-draft.md 2>&1 # non-blocking (Gate B info)
89
89
  # Apply the degradation rules in the main SKILL.md if any artefact is missing.
90
90
  # → Peaks-Cli Gate B convergence check. Assisted/Strict: [CONFIRM]
91
91
 
92
92
  # 4. Peaks-Cli RD planning artifact (the file required by the prerequisite gate)
93
- # feature / refactor → write .peaks/<id>/rd/tech-doc.md
94
- # bugfix → write .peaks/<id>/rd/bug-analysis.md
93
+ # feature / refactor → write .peaks/_runtime/<id>/rd/tech-doc.md
94
+ # bugfix → write .peaks/_runtime/<id>/rd/bug-analysis.md
95
95
  # config → no planning artifact required at this state
96
96
  # docs / chore → no planning artifact required
97
97
  peaks request transition <rid> --role rd --state implemented --project <repo> --json
98
98
 
99
99
  # 5. Peaks-Cli Code review + security review BEFORE qa-handoff transition.
100
100
  # Produce the evidence files the CLI gate enforces:
101
- # - .peaks/<id>/rd/code-review.md (CRITICAL/HIGH findings + fixes; required for feature/bugfix/refactor)
102
- # - .peaks/<id>/rd/security-review.md (required for feature/bugfix/refactor/config)
101
+ # - .peaks/_runtime/<id>/rd/code-review.md (CRITICAL/HIGH findings + fixes; required for feature/bugfix/refactor)
102
+ # - .peaks/_runtime/<id>/rd/security-review.md (required for feature/bugfix/refactor/config)
103
103
  # Then transition. If --type is docs/chore the gate is empty and the transition is unguarded.
104
104
  peaks request transition <rid> --role rd --state qa-handoff --project <repo> --json
105
105
 
106
106
  # 6. Peaks-Cli QA validation (AUTO-PROCEED from RD in full-auto)
107
107
  # Before each QA transition, produce the evidence files the CLI gate enforces:
108
- # Before qa:running → .peaks/<id>/qa/test-cases/<rid>.md
108
+ # Before qa:running → .peaks/_runtime/<id>/qa/test-cases/<rid>.md
109
109
  peaks request transition <rid> --role qa --state running --project <repo> --json
110
- # Before qa:verdict-issued → .peaks/<id>/qa/test-reports/<rid>.md
111
- # + .peaks/<id>/qa/security-findings.md
112
- # + .peaks/<id>/qa/performance-findings.md (feature/refactor only)
110
+ # Before qa:verdict-issued → .peaks/_runtime/<id>/qa/test-reports/<rid>.md
111
+ # + .peaks/_runtime/<id>/qa/security-findings.md
112
+ # + .peaks/_runtime/<id>/qa/performance-findings.md (feature/refactor only)
113
113
  peaks request transition <rid> --role qa --state verdict-issued --project <repo> --json
114
114
  # → Peaks-Cli Gate D check. Assisted/Strict: [CONFIRM]
115
115
 
@@ -135,12 +135,12 @@ peaks openspec archive <cid> --project <repo> --apply --json
135
135
  peaks workspace reconcile --project <repo> --apply --older-than 7
136
136
 
137
137
  # 10. Peaks-Cli TXT handoff — invoke peaks-txt which embeds memory markers and extracts
138
- # peaks-txt writes the handoff capsule to .peaks/<id>/txt/handoff.md. Inside the
138
+ # peaks-txt writes the handoff capsule to .peaks/_runtime/<id>/txt/handoff.md. Inside the
139
139
  # capsule body, peaks-txt embeds <!-- peaks-memory:start --> blocks for every
140
140
  # stable project fact surfaced this session.
141
141
  #
142
142
  # 10a. Skill-side scan (do this BEFORE the AskUserQuestion below):
143
- # grep -n "peaks-memory:start" .peaks/<id>/txt/handoff.md
143
+ # grep -n "peaks-memory:start" .peaks/_runtime/<id>/txt/handoff.md
144
144
  # Record the count. This is the skill doing the work, not a CLI command —
145
145
  # we deliberately do not ship a `peaks memory scan` because the LLM is
146
146
  # the only consumer and the LLM has grep.
@@ -148,7 +148,7 @@ peaks workspace reconcile --project <repo> --apply --older-than 7
148
148
  # 10b. AskUserQuestion (only if 10a returned count >= 1):
149
149
  # "The TXT handoff has N peaks-memory:start blocks. Persist to .peaks/memory/?
150
150
  # (a) Apply all — `peaks memory extract --project <repo>
151
- # --artifact .peaks/<id>/txt/handoff.md --apply --json`
151
+ # --artifact .peaks/_runtime/<id>/txt/handoff.md --apply --json`
152
152
  # (b) Apply selectively — re-edit handoff.md first, then re-apply
153
153
  # (c) Skip for now — blocks stay in the handoff only, no .peaks/memory/ write"
154
154
  # If 10a returned 0 AND the session surfaced a stable project fact
@@ -156,7 +156,7 @@ peaks workspace reconcile --project <repo> --apply --older-than 7
156
156
  # back and embed at least one block before Solo can advance.
157
157
 
158
158
  # 10c. After the user picks (a) or (b), run:
159
- peaks memory extract --project <repo> --artifact .peaks/<id>/txt/handoff.md --apply --json
159
+ peaks memory extract --project <repo> --artifact .peaks/_runtime/<id>/txt/handoff.md --apply --json
160
160
  # --apply is REQUIRED to write .peaks/memory/; without it the command only
161
161
  # previews. The extract regenerates index.json in the same call.
162
162
 
@@ -143,45 +143,26 @@ While running, call `peaks sub-agent heartbeat --record <dispatchRecordPath>
143
143
  to keep the user informed during the wait.
144
144
  ```
145
145
 
146
- **Slice #007-007-2026-06-07-mcp-decouple (G3 prompt template addition)**:
147
- when the sub-agent is dispatched into a non-Claude IDE (Trae, Cursor,
148
- Codex, Qoder, Tongyi, ...) or into a Claude Code environment where the
149
- LLM cannot directly invoke the `mcp__<server>__*` tool prefix, the
150
- sub-agent prompt must additionally include the MCP-decouple instruction
151
- below. Without it, the sub-agent would either fall back to direct
152
- `mcp__` invocations (which fail in non-Claude IDEs) or skip MCP
153
- operations entirely (which breaks RD/QA/UI flows that depend on the
154
- Playwright, Chrome DevTools, Figma, or Context7 servers).
146
+ **Slice #016 retirement (G3 prompt template — MCP subsystem removed)**:
147
+ The MCP-decouple paragraph from slice #007-007 no longer applies.
148
+ peaks-cli no longer manages MCP install or invocation. Sub-agents
149
+ check their own tool list for `mcp__<server>__*` entries and invoke
150
+ the tool by name directly. The only prompt-template addition that
151
+ remains is the tool-list self-check:
155
152
 
156
153
  ```
157
- When you need to use an MCP server (playwright, chrome-devtools, figma, or
158
- context7), do NOT invoke the `mcp__<server>__*` tool prefix directly. The
159
- canonical path is `peaks mcp call`:
160
-
161
- peaks mcp call --capability <capabilityId> --tool <toolName> --args-json '<argsObject>' --json
162
-
163
- where `<capabilityId>` is one of:
164
- - playwright-mcp.browser-validation (headed browser, primary E2E surface)
165
- - chrome-devtools-mcp.browser-debug (CDP to running Chrome on :9222, secondary)
166
- - figma-context-mcp.design-context (Figma design data, requires FIGMA_API_KEY)
167
- - context7.docs-lookup (library docs, requires CONTEXT7_API_KEY)
168
-
169
- For install / plan / detect, use:
170
- peaks mcp list --json
171
- peaks mcp plan --capability <capabilityId> --json
172
- peaks mcp apply --capability <capabilityId> --yes --json
173
-
174
- The `peaks mcp plan` envelope's `envCheck.missing` field is the source of
175
- truth for required env vars. Do not bake the `mcp__<server>__*` prefix
176
- into any artifact or message; the prefix is owned by the LLM runtime, not
177
- by the skill. On Trae, `capabilities.mcpInstall` is `false`; do not
178
- attempt `peaks mcp apply` on Trae — surface the manual install path
179
- instead.
154
+ This task may need an MCP server (playwright, chrome-devtools, figma,
155
+ or context7). Check your tool list for any `mcp__<server>__*` entry.
156
+ If present, invoke the tool by name directly. If absent, tell the user
157
+ the install command for their IDE (Claude Code:
158
+ `claude mcp add <server> -- <npx-command>`) and stop the sub-task until
159
+ the user installs the MCP. Do NOT hand-edit `.claude/settings.json` or
160
+ auto-install on the user's behalf.
180
161
  ```
181
162
 
182
- The MCP-decouple paragraph is required for any sub-agent dispatched
183
- into a non-Claude environment or any sub-agent that needs an MCP
184
- capability. The CLI auto-generates it for `role in (rd, qa, ui, txt)`
163
+ The tool-list self-check is required for any sub-agent that needs a
164
+ browser, design, or docs-lookup capability. The CLI auto-generates it
165
+ for `role in (rd, qa, ui, txt)`.
185
166
  when the active IDE is not `claude-code`; for `role = general-purpose`
186
167
  or unknown roles, the caller (the SKILL.md heart of the Dispatcher) must
187
168
  add it explicitly.