peaks-loop 4.0.0-beta → 4.0.0-beta.3

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 (179) hide show
  1. package/CHANGELOG.md +105 -87
  2. package/README-en.md +17 -4
  3. package/README.md +17 -4
  4. package/dist/src/cli/commands/asset-commands.d.ts +45 -0
  5. package/dist/src/cli/commands/asset-commands.js +404 -0
  6. package/dist/src/cli/commands/bee-commands.d.ts +26 -0
  7. package/dist/src/cli/commands/bee-commands.js +169 -0
  8. package/dist/src/cli/commands/{solo-commands.d.ts → code-commands.d.ts} +24 -24
  9. package/dist/src/cli/commands/{solo-commands.js → code-commands.js} +78 -78
  10. package/dist/src/cli/commands/core/skill-command.js +1 -1
  11. package/dist/src/cli/commands/dispatch-from-dag.js +1 -1
  12. package/dist/src/cli/commands/evolution-commands.d.ts +27 -0
  13. package/dist/src/cli/commands/evolution-commands.js +393 -0
  14. package/dist/src/cli/commands/hook-handle.js +7 -7
  15. package/dist/src/cli/commands/job-commands.js +2 -2
  16. package/dist/src/cli/commands/loop-commands.d.ts +19 -13
  17. package/dist/src/cli/commands/loop-commands.js +147 -13
  18. package/dist/src/cli/commands/sediment-commands.js +9 -0
  19. package/dist/src/cli/commands/session-auto-compact-hook-command.js +2 -2
  20. package/dist/src/cli/commands/skill-loop-engineering-readiness-commands.d.ts +67 -0
  21. package/dist/src/cli/commands/skill-loop-engineering-readiness-commands.js +173 -0
  22. package/dist/src/cli/commands/sub-agent-shared.d.ts +1 -1
  23. package/dist/src/cli/commands/user-touchpoint-commands.d.ts +4 -4
  24. package/dist/src/cli/commands/user-touchpoint-commands.js +14 -14
  25. package/dist/src/cli/commands/workflow-commands.js +22 -22
  26. package/dist/src/cli/program.js +23 -6
  27. package/dist/src/services/artifacts/repair-cycle-service.js +1 -1
  28. package/dist/src/services/audit/enforcers/active-skill-resolver.d.ts +1 -1
  29. package/dist/src/services/audit/enforcers/active-skill-resolver.js +1 -1
  30. package/dist/src/services/audit/enforcers/{solo-code-ban.d.ts → code-ban.d.ts} +6 -6
  31. package/dist/src/services/audit/enforcers/{solo-code-ban.js → code-ban.js} +6 -6
  32. package/dist/src/services/audit/red-line-catalog.d.ts +2 -2
  33. package/dist/src/services/audit/red-line-catalog.js +5 -5
  34. package/dist/src/services/audit/types.d.ts +2 -2
  35. package/dist/src/services/{solo → code}/auto-compact-orchestrator.d.ts +1 -1
  36. package/dist/src/services/{solo → code}/auto-compact-orchestrator.js +3 -3
  37. package/dist/src/services/{solo → code}/dag-orchestrator.d.ts +1 -1
  38. package/dist/src/services/{solo → code}/dag-orchestrator.js +1 -1
  39. package/dist/src/services/{solo → code}/emit-handoff.d.ts +1 -1
  40. package/dist/src/services/{solo → code}/emit-handoff.js +1 -1
  41. package/dist/src/services/{solo → code}/job-shape-decision.d.ts +1 -1
  42. package/dist/src/services/{solo → code}/job-shape-decision.js +5 -5
  43. package/dist/src/services/{solo → code}/mode-gate.d.ts +9 -9
  44. package/dist/src/services/{solo → code}/mode-gate.js +5 -5
  45. package/dist/src/services/{solo → code}/post-compact-detector.d.ts +3 -3
  46. package/dist/src/services/{solo → code}/post-compact-detector.js +4 -4
  47. package/dist/src/services/{solo → code}/step-08-gate.d.ts +4 -4
  48. package/dist/src/services/{solo → code}/step-08-gate.js +4 -4
  49. package/dist/src/services/{solo → code}/user-touchpoint-classifier.d.ts +1 -1
  50. package/dist/src/services/{solo → code}/user-touchpoint-classifier.js +1 -1
  51. package/dist/src/services/context/auto-compact-dispatcher.d.ts +2 -2
  52. package/dist/src/services/context/auto-compact-dispatcher.js +2 -2
  53. package/dist/src/services/context/auto-compact-types.d.ts +1 -1
  54. package/dist/src/services/crystallization/crystallization-service.d.ts +239 -0
  55. package/dist/src/services/crystallization/crystallization-service.js +397 -0
  56. package/dist/src/services/crystallization/crystallization-store.d.ts +75 -0
  57. package/dist/src/services/crystallization/crystallization-store.js +193 -0
  58. package/dist/src/services/crystallization/crystallization-types.d.ts +313 -0
  59. package/dist/src/services/crystallization/crystallization-types.js +299 -0
  60. package/dist/src/services/crystallization/evidence-brief-builder.d.ts +237 -0
  61. package/dist/src/services/crystallization/evidence-brief-builder.js +240 -0
  62. package/dist/src/services/dispatch/slice-dag.d.ts +2 -2
  63. package/dist/src/services/dispatch/test-tool-detection.d.ts +1 -1
  64. package/dist/src/services/dispatch/test-tool-detection.js +1 -1
  65. package/dist/src/services/evolution/evolution-service.d.ts +137 -0
  66. package/dist/src/services/evolution/evolution-service.js +281 -0
  67. package/dist/src/services/evolution/evolution-store.d.ts +57 -0
  68. package/dist/src/services/evolution/evolution-store.js +232 -0
  69. package/dist/src/services/evolution/evolution-types.d.ts +706 -0
  70. package/dist/src/services/evolution/evolution-types.js +286 -0
  71. package/dist/src/services/evolution/independent-evaluator-runner.d.ts +90 -0
  72. package/dist/src/services/evolution/independent-evaluator-runner.js +106 -0
  73. package/dist/src/services/evolution/regression-skeptic-runner.d.ts +64 -0
  74. package/dist/src/services/evolution/regression-skeptic-runner.js +113 -0
  75. package/dist/src/services/feedback/feedback-promotion-service.js +2 -2
  76. package/dist/src/services/job/job-progress-store.d.ts +1 -1
  77. package/dist/src/services/job/job-progress-store.js +1 -1
  78. package/dist/src/services/loop/loop-bee-relation-service.d.ts +107 -0
  79. package/dist/src/services/loop/loop-bee-relation-service.js +211 -0
  80. package/dist/src/services/loop/loop-bee-relation-store.d.ts +53 -0
  81. package/dist/src/services/loop/loop-bee-relation-store.js +130 -0
  82. package/dist/src/services/loop/loop-bee-relation-types.d.ts +118 -0
  83. package/dist/src/services/loop/loop-bee-relation-types.js +114 -0
  84. package/dist/src/services/loop/loop-release-service.d.ts +46 -0
  85. package/dist/src/services/loop/loop-release-service.js +66 -0
  86. package/dist/src/services/loop/loop-release-store.d.ts +55 -0
  87. package/dist/src/services/loop/loop-release-store.js +134 -0
  88. package/dist/src/services/loop/loop-release-types.d.ts +250 -0
  89. package/dist/src/services/loop/loop-release-types.js +162 -0
  90. package/dist/src/services/preferences/preferences-service.d.ts +1 -1
  91. package/dist/src/services/preferences/preferences-types.d.ts +1 -1
  92. package/dist/src/services/rd/standards-diagnostic.d.ts +1 -1
  93. package/dist/src/services/rd/standards-diagnostic.js +2 -2
  94. package/dist/src/services/recommendations/capability-seed-items.js +1 -1
  95. package/dist/src/services/recommendations/capability-seed-mappings.js +1 -1
  96. package/dist/src/services/recommendations/recommendation-service.js +1 -1
  97. package/dist/src/services/refactor/refactor-service.d.ts +1 -1
  98. package/dist/src/services/share/bundle-reader.d.ts +100 -0
  99. package/dist/src/services/share/bundle-reader.js +434 -0
  100. package/dist/src/services/share/bundle-types.d.ts +392 -0
  101. package/dist/src/services/share/bundle-types.js +318 -0
  102. package/dist/src/services/share/bundle-writer.d.ts +97 -0
  103. package/dist/src/services/share/bundle-writer.js +429 -0
  104. package/dist/src/services/share/run-state-contract.d.ts +133 -0
  105. package/dist/src/services/share/run-state-contract.js +138 -0
  106. package/dist/src/services/signal/cancel-handler.js +3 -3
  107. package/dist/src/services/skill/resume-detector.js +1 -1
  108. package/dist/src/services/skillhub/release-import.js +7 -2
  109. package/dist/src/services/skillhub/release-retain.js +6 -1
  110. package/dist/src/services/skillhub/sqlite-store.js +17 -1
  111. package/dist/src/services/skillhub/types.d.ts +10 -0
  112. package/dist/src/services/skills/skill-presence-service.d.ts +1 -1
  113. package/dist/src/services/standards/loop-engineering-lint.d.ts +38 -0
  114. package/dist/src/services/standards/loop-engineering-lint.js +101 -0
  115. package/dist/src/services/standards/loop-engineering-readiness-lint.d.ts +111 -0
  116. package/dist/src/services/standards/loop-engineering-readiness-lint.js +248 -0
  117. package/dist/src/services/upgrade/1x-detector-service.js +1 -1
  118. package/dist/src/services/workflow/pipeline-verify-service.d.ts +1 -1
  119. package/dist/src/services/workflow/pipeline-verify-service.js +3 -3
  120. package/dist/src/services/workflow/workflow-autonomous-service.d.ts +3 -3
  121. package/dist/src/services/workflow/workflow-autonomous-service.js +2 -2
  122. package/dist/src/services/workflow/workflow-router-service.d.ts +6 -6
  123. package/dist/src/services/workflow/workflow-router-service.js +33 -33
  124. package/dist/src/services/workspace/claude-settings-template.d.ts +1 -1
  125. package/dist/src/services/workspace/claude-settings-template.js +5 -5
  126. package/dist/src/shared/version.d.ts +1 -1
  127. package/dist/src/shared/version.js +1 -1
  128. package/examples/video-demo/README.md +57 -0
  129. package/examples/video-demo/out/en-closing-960.png +0 -0
  130. package/examples/video-demo/out/zh-closing-960.png +0 -0
  131. package/examples/video-demo/preview/peaks-loop-demo-en.mp4 +0 -0
  132. package/examples/video-demo/preview/peaks-loop-demo.mp4 +0 -0
  133. package/output-styles/peaks-skill-swarm.md +3 -3
  134. package/package.json +6 -2
  135. package/skills/bee/peaks-qa/SKILL.md +1 -1
  136. package/skills/bee/peaks-qa/references/artifact-per-request.md +3 -3
  137. package/skills/bee/peaks-qa/references/qa-sub-agent-dispatch.md +6 -6
  138. package/skills/bee/peaks-rd/references/rd-fanout-contracts.md +1 -1
  139. package/skills/bee/peaks-rd/references/rd-runbook.md +1 -1
  140. package/skills/bee/peaks-rd/references/rd-sub-agent-dispatch.md +11 -11
  141. package/skills/bee/peaks-rd/references/rd-transition-gates.md +1 -1
  142. package/skills/bee/peaks-sc/SKILL.md +1 -1
  143. package/skills/bee/peaks-txt/SKILL.md +3 -3
  144. package/skills/bee/peaks-ui/SKILL.md +8 -8
  145. package/skills/peaks-code/SKILL.md +34 -21
  146. package/skills/peaks-code/references/anchoring-and-session-info.md +2 -2
  147. package/skills/peaks-code/references/artifact-contracts.md +1 -1
  148. package/skills/peaks-code/references/boundaries.md +3 -3
  149. package/skills/peaks-code/references/codegraph-orchestration.md +1 -1
  150. package/skills/peaks-code/references/dag-orchestrator.md +7 -7
  151. package/skills/peaks-code/references/external-references.md +2 -2
  152. package/skills/peaks-code/references/fanout-mandatory.md +3 -3
  153. package/skills/peaks-code/references/fast-mode.md +2 -2
  154. package/skills/peaks-code/references/frontend-only-mode.md +9 -9
  155. package/skills/peaks-code/references/job-loop.md +1 -1
  156. package/skills/peaks-code/references/local-artifact-workspace.md +2 -2
  157. package/skills/peaks-code/references/micro-cycle.md +14 -14
  158. package/skills/peaks-code/references/mode-selection-with-stale-presence.md +5 -5
  159. package/skills/peaks-code/references/mode-selection.md +3 -3
  160. package/skills/peaks-code/references/openspec-workflow.md +16 -16
  161. package/skills/peaks-code/references/periodic-checkpoint.md +4 -4
  162. package/skills/peaks-code/references/quality-gate-cheatsheet.md +1 -1
  163. package/skills/peaks-code/references/refactor-mode.md +1 -1
  164. package/skills/peaks-code/references/runbook.md +15 -15
  165. package/skills/peaks-code/references/step-0-55-1x-detection.md +1 -1
  166. package/skills/peaks-code/references/step-0-8-gate.md +11 -11
  167. package/skills/peaks-code/references/sub-agent-dispatch.md +8 -8
  168. package/skills/peaks-code/references/swarm-dispatch-contract.md +17 -17
  169. package/skills/peaks-code/references/workflow-gates-and-types.md +2 -2
  170. package/skills/peaks-code/references/workflow.md +5 -5
  171. package/skills/peaks-content/SKILL.md +272 -0
  172. package/skills/peaks-issue-fix-orchestrator/SKILL.md +307 -0
  173. package/skills/peaks-resume/SKILL.md +2 -2
  174. package/skills/peaks-status/SKILL.md +2 -2
  175. package/skills/peaks-test/SKILL.md +2 -2
  176. /package/dist/src/services/{solo → code}/batch-heartbeat-poller.d.ts +0 -0
  177. /package/dist/src/services/{solo → code}/batch-heartbeat-poller.js +0 -0
  178. /package/dist/src/services/{solo → code}/status-line-renderer.d.ts +0 -0
  179. /package/dist/src/services/{solo → code}/status-line-renderer.js +0 -0
@@ -2,7 +2,7 @@
2
2
 
3
3
  > Extracted from `skills/peaks-code/SKILL.md` on 2026-06-09 (slice 019 — slim skill files to references) to keep SKILL.md under the 800-line cap from `common/coding-style.md`. The content below is the verbatim Frontend-only development mode section that was previously inline; nothing was paraphrased, just relocated.
4
4
 
5
- When the project has no live backend (no swagger.json, no API server), Solo must activate frontend-only mode.
5
+ When the project has no live backend (no swagger.json, no API server), Code must activate frontend-only mode.
6
6
 
7
7
  ### Mode determination (deterministic — CLI is the source of truth)
8
8
 
@@ -11,13 +11,13 @@ The CLI decision is authoritative. Read `frontendOnly` and `frontendOnlyReason`
11
11
  User-stated intent is **only** consulted when it conflicts with the CLI result. The two conflict cases:
12
12
 
13
13
  - **CLI says `frontendOnly=false` but the user says "前端项目 / 没有后端 / 先 mock 数据"**: STOP and `AskUserQuestion` to confirm whether to override the scan (the repo probably contains a backend folder the user wants to ignore). Record the override decision and reason in `project-scan.md`.
14
- - **CLI says `frontendOnly=true` but the user says "需要做后端 / 加 API"**: STOP and `AskUserQuestion` to confirm whether the request actually targets the missing backend (the user may be confused about repo scope, or there is a separate backend repo Solo should switch to).
14
+ - **CLI says `frontendOnly=true` but the user says "需要做后端 / 加 API"**: STOP and `AskUserQuestion` to confirm whether the request actually targets the missing backend (the user may be confused about repo scope, or there is a separate backend repo Code should switch to).
15
15
 
16
16
  When there is no conflict, do not ask — the CLI value wins and the workflow proceeds.
17
17
 
18
18
  ### Mock data strategy selection
19
19
 
20
- Solo records the chosen mock strategy in `.peaks/_runtime/<sessionId>/rd/tech-doc.md` under a `## Mock Data Strategy` section. The choice depends on the project scan results:
20
+ Code records the chosen mock strategy in `.peaks/_runtime/<sessionId>/rd/tech-doc.md` under a `## Mock Data Strategy` section. The choice depends on the project scan results:
21
21
 
22
22
  | Project data-fetching pattern | Recommended mock approach | Rationale |
23
23
  |---|---|---|
@@ -59,15 +59,15 @@ When swagger.json becomes available later, the migration follows this sequence:
59
59
  3. Remove corresponding mock files.
60
60
  4. Run QA regression to verify the real API responses match the mock interface contracts.
61
61
 
62
- Solo records the migration readiness in the TXT handoff capsule under a `## API Migration` section listing: mock file paths, the corresponding swagger endpoints (when known), and the migration status for each.
62
+ Code records the migration readiness in the TXT handoff capsule under a `## API Migration` section listing: mock file paths, the corresponding swagger endpoints (when known), and the migration status for each.
63
63
 
64
64
  ### Feishu document access fallback
65
65
 
66
66
  When the PRD source is a Feishu/Lark document that requires authentication:
67
67
 
68
- 1. **Primary path**: Playwright MCP headed browser → user completes login → Solo reads document content via `browser_snapshot`.
69
- 2. **Fallback A (user cannot login)**: Ask user to copy-paste the document content or export as Markdown/PDF. Solo creates the PRD artifact from the pasted content.
70
- 3. **Fallback B (user provides export)**: User drops a `.md` or `.pdf` export into `.peaks/_runtime/<sessionId>/prd/source/`. Solo reads and processes it.
68
+ 1. **Primary path**: Playwright MCP headed browser → user completes login → Code reads document content via `browser_snapshot`.
69
+ 2. **Fallback A (user cannot login)**: Ask user to copy-paste the document content or export as Markdown/PDF. Code creates the PRD artifact from the pasted content.
70
+ 3. **Fallback B (user provides export)**: User drops a `.md` or `.pdf` export into `.peaks/_runtime/<sessionId>/prd/source/`. Code reads and processes it.
71
71
  4. **Fallback C (none of the above)**: Mark PRD as `blocked` with reason `doc-inaccessible`, list the exact next steps for the user, and pause the workflow.
72
72
 
73
73
  Never silently fall back to unauthenticated `fetch` or `WebFetch` for authenticated documents.
@@ -76,7 +76,7 @@ Never silently fall back to unauthenticated `fetch` or `WebFetch` for authentica
76
76
 
77
77
  ### Frontend-only trigger pre-flight
78
78
 
79
- > Body of `### Frontend-only trigger pre-flight`. Before computing the swarm plan, Solo runs the keyword scan deterministically:
79
+ > Body of `### Frontend-only trigger pre-flight`. Before computing the swarm plan, Code runs the keyword scan deterministically:
80
80
 
81
81
  1. Read `.peaks/_runtime/<sessionId>/prd/requests/<rid>.md` body.
82
82
  2. Lowercase + strip markdown; check regex `\b(页面|组件|表单|弹窗|表格|样式|布局|交互|UI|UX|page|component|form|modal|table|styling|layout|interaction|frontend|前端)\b`.
@@ -84,4 +84,4 @@ Never silently fall back to unauthenticated `fetch` or `WebFetch` for authentica
84
84
  4. If `frontendOnly` (from project-scan) is `true` and no keyword hit → UI joins anyway (frontend-only project, even non-visual changes may need visual sanity for regressions).
85
85
  5. If `frontendOnly` is `false` and no keyword hit → UI skipped.
86
86
 
87
- Solo records the pre-flight result in `sc/swarm-plan.json` so the audit trail shows why UI was or was not included.
87
+ Code records the pre-flight result in `sc/swarm-plan.json` so the audit trail shows why UI was or was not included.
@@ -1,4 +1,4 @@
1
- # Peaks-Loop Solo — Job Loop Deep-Dive
1
+ # Peaks-Loop Code — Job Loop Deep-Dive
2
2
 
3
3
  > Read alongside `SKILL.md` Steps 0.8 / 0.81 / 0.85 / 0.86 / 0.87.
4
4
 
@@ -50,13 +50,13 @@ system/ # Existing-system extraction output (visual tokens, conventions
50
50
 
51
51
  Files written into these directories during the workflow (not pre-created — they appear as their step runs):
52
52
 
53
- - `rd/project-scan.md` (Solo step 0.6)
53
+ - `rd/project-scan.md` (Code step 0.6)
54
54
  - `rd/tech-doc.md` (feature/refactor planning; required by `rd → implemented` gate)
55
55
  - `rd/bug-analysis.md` (bugfix planning; required by `rd → implemented` gate for `--type bugfix`)
56
56
  - `rd/code-review.md`, `rd/security-review.md` (required by `rd → qa-handoff` gate for feature/bugfix/refactor; security-review only for config)
57
57
  - `rd/mock-plan.md` (frontend-only mode)
58
58
  - `ui/design-draft.md` (UI step)
59
- - `system/existing-system.md` (Solo step 0.7; legacy projects only)
59
+ - `system/existing-system.md` (Code step 0.7; legacy projects only)
60
60
  - `qa/test-cases/<rid>.md`, `qa/test-reports/<rid>.md`, `qa/security-findings.md`, `qa/performance-findings.md` (gated per `--type`)
61
61
 
62
62
  ## Root pollution prohibition (CRITICAL)
@@ -171,20 +171,20 @@ verdict=return-to-rd → RD 修 (new slice 内部走 micro-cycle)
171
171
  >
172
172
  > When PRD lands, classify the request type before running `peaks request init` for every role — pass `--type <type>` so the artifact records it and downstream transitions enforce the right gates. Misclassifying a feature as `docs` to skip gates is a workflow violation. If a transition fails with `code: PREREQUISITES_MISSING`, the response lists every missing path — produce them, then re-transition. For one-off exceptions, the escape hatch `--allow-incomplete --reason "<text>"` records the bypass in the artifact transition note.
173
173
 
174
- After `peaks-rd` finishes any implementation, repair, or code-output slice, Peaks-Loop Solo MUST automatically route the result to `peaks-qa` without waiting for user confirmation. This is not optional in full-auto mode. Solo must not declare the workflow complete, emit a TXT handoff, or stop at RD completion.
174
+ After `peaks-rd` finishes any implementation, repair, or code-output slice, Peaks-Loop Code MUST automatically route the result to `peaks-qa` without waiting for user confirmation. This is not optional in full-auto mode. Code must not declare the workflow complete, emit a TXT handoff, or stop at RD completion.
175
175
 
176
- **How Solo invokes another role (mechanism, not metaphor):**
176
+ **How Code invokes another role (mechanism, not metaphor):**
177
177
 
178
- Solo is itself a skill running in the current session. There are **two distinct mechanisms** in this skill, and they MUST NOT be confused:
178
+ Code is itself a skill running in the current session. There are **two distinct mechanisms** in this skill, and they MUST NOT be confused:
179
179
 
180
180
  1. **Swarm fan-out (planning side, after PRD confirmed)** — uses `peaks sub-agent dispatch <role>` to launch real concurrent sub-agents. The CLI returns a per-IDE tool-call descriptor that the LLM executes in its environment. See "Peaks-Loop Swarm parallel phase" above for the full contract. Sub-agents do NOT call Skill(...) back into the role; they execute the role's instructions inline from the prompt.
181
- 2. **Sequential handoff (execution side, RD↔QA repair loop)** — Solo is the only loop, and after RD or QA finishes (whether as a sub-agent or directly), Solo drives the next step from the orchestrator seat. Do NOT use the `Skill` tool to "reactivate" peaks-rd or peaks-qa in the main loop; doing so is the v1.x anti-pattern that masqueraded as "calling the role" but actually just re-prompted the same session. From v1.3 onward, the main loop drives roles via the CLI gate (`peaks request transition`) and reads back artefacts (`peaks request show ... --json`); the actual RD/QA work is either done inline by Solo (when Solo has just been re-invoked by the user) or by a Task sub-agent (in swarm mode).
181
+ 2. **Sequential handoff (execution side, RD↔QA repair loop)** — Code is the only loop, and after RD or QA finishes (whether as a sub-agent or directly), Code drives the next step from the orchestrator seat. Do NOT use the `Skill` tool to "reactivate" peaks-rd or peaks-qa in the main loop; doing so is the v1.x anti-pattern that masqueraded as "calling the role" but actually just re-prompted the same session. From v1.3 onward, the main loop drives roles via the CLI gate (`peaks request transition`) and reads back artefacts (`peaks request show ... --json`); the actual RD/QA work is either done inline by Code (when Code has just been re-invoked by the user) or by a Task sub-agent (in swarm mode).
182
182
 
183
- After RD completes (whether inline or sub-agent), Solo does not stop — it must advance to QA. There is no "RD done, ask the user" state in full-auto mode. The only valid stops are: (a) QA verdict=pass, (b) repair cap hit, (c) explicit user cancel.
183
+ After RD completes (whether inline or sub-agent), Code does not stop — it must advance to QA. There is no "RD done, ask the user" state in full-auto mode. The only valid stops are: (a) QA verdict=pass, (b) repair cap hit, (c) explicit user cancel.
184
184
 
185
- **RD's internal reviews are already parallelized.** When RD finishes implementation, it issues a 3-way sub-agent fan-out (code-review + security-review + perf-baseline, see `skills/peaks-rd/SKILL.md` "Parallel review fan-out") and waits for all to return before transitioning to `qa-handoff`. Solo does NOT need to track three separate RD-side sub-runs; the RD role owns the fan-out lifecycle end-to-end. Solo's presence restoration after the swarm converges is the only coordination point.
185
+ **RD's internal reviews are already parallelized.** When RD finishes implementation, it issues a 3-way sub-agent fan-out (code-review + security-review + perf-baseline, see `skills/peaks-rd/SKILL.md` "Parallel review fan-out") and waits for all to return before transitioning to `qa-handoff`. Code does NOT need to track three separate RD-side sub-runs; the RD role owns the fan-out lifecycle end-to-end. Code's presence restoration after the swarm converges is the only coordination point.
186
186
 
187
- **Presence restoration after RD/QA work returns (MANDATORY):** In v1.x, role skills called `peaks skill presence:set <role>` internally and stomped on `.peaks/.active-skill.json`. From v1.3 onward, sub-agents in the Swarm path are forbidden from calling `peaks skill presence:set` (see "Sub-agent dispatch" in each role's SKILL.md), so the main loop's presence file is preserved across the fan-out window by construction. The one place Solo still has to actively restore presence is **once after the fan-out returns** (gate=swarm-converged) and again **after each RD↔QA repair iteration** (gate=repair-cycle-<N>). Use the same command from Step 2 with the current mode and the gate that has just advanced:
187
+ **Presence restoration after RD/QA work returns (MANDATORY):** In v1.x, role skills called `peaks skill presence:set <role>` internally and stomped on `.peaks/.active-skill.json`. From v1.3 onward, sub-agents in the Swarm path are forbidden from calling `peaks skill presence:set` (see "Sub-agent dispatch" in each role's SKILL.md), so the main loop's presence file is preserved across the fan-out window by construction. The one place Code still has to actively restore presence is **once after the fan-out returns** (gate=swarm-converged) and again **after each RD↔QA repair iteration** (gate=repair-cycle-<N>). Use the same command from Step 2 with the current mode and the gate that has just advanced:
188
188
 
189
189
  ```bash
190
190
  peaks skill presence:set peaks-code --project <repo> --mode <mode> --gate <current-gate>
@@ -192,13 +192,13 @@ peaks skill presence:set peaks-code --project <repo> --mode <mode> --gate <curre
192
192
 
193
193
  This keeps the CLAUDE.md status header accurate (`Peaks-Loop Skill: peaks-code`) instead of showing a stale role name. Use the current mode and gate values; the gate may have advanced since startup. Skipping this step causes the header to display the last-known gate permanently.
194
194
 
195
- **Full-auto auto-proceed rule**: In the `full-auto` profile, when RD transitions to `qa-handoff`, Solo immediately drives QA — by launching a `peaks sub-agent dispatch qa` sub-agent carrying the `peaks-qa` body (swarm path), then executing the returned toolCall, or by running QA inline in the main loop (assisted/strict path). Do not pause, do not ask the user, do not summarize RD results as if they were final. The only valid reason to skip QA is when `--type` is `docs` or `chore` (no acceptance surface).
195
+ **Full-auto auto-proceed rule**: In the `full-auto` profile, when RD transitions to `qa-handoff`, Code immediately drives QA — by launching a `peaks sub-agent dispatch qa` sub-agent carrying the `peaks-qa` body (swarm path), then executing the returned toolCall, or by running QA inline in the main loop (assisted/strict path). Do not pause, do not ask the user, do not summarize RD results as if they were final. The only valid reason to skip QA is when `--type` is `docs` or `chore` (no acceptance surface).
196
196
 
197
197
  A QA report with any failing, blocked, missing, or unverified acceptance item is not a pass.
198
198
 
199
- **How Solo routes QA findings back to RD (mechanism, not metaphor):**
199
+ **How Code routes QA findings back to RD (mechanism, not metaphor):**
200
200
 
201
- When `peaks-qa` returns `verdict=return-to-rd`, Solo does NOT manually rewrite RD artifacts. Instead it follows this exact sequence:
201
+ When `peaks-qa` returns `verdict=return-to-rd`, Code does NOT manually rewrite RD artifacts. Instead it follows this exact sequence:
202
202
 
203
203
  1. Read the QA verdict and findings via `peaks request show <rid> --role qa --project <repo> --json`. The findings live in the QA artifact body (failing acceptance items, evidence paths, severity).
204
204
  2. Transition the RD artifact back from `qa-handoff` to a working state and record the QA verdict in the transition note:
@@ -209,13 +209,13 @@ When `peaks-qa` returns `verdict=return-to-rd`, Solo does NOT manually rewrite R
209
209
  ```
210
210
  `spec-locked` is the canonical "needs more RD work" state. The reason is mandatory in repair cycles so the artifact history shows the loop.
211
211
  3. Re-launch `peaks-rd` work. Two paths, mode-driven:
212
- - **Swarm / full-auto**: launch a fresh `peaks sub-agent dispatch rd` sub-agent (then execute the returned toolCall) with the same `peaks-rd` body used in the Swarm phase, plus the QA findings path so it can read the failure list. Solo restores presence after the sub-agent returns.
213
- - **Assisted / strict / inline-fallback**: Solo executes the RD repair steps directly in the main loop, since there is no concurrent fan-out to coordinate.
212
+ - **Swarm / full-auto**: launch a fresh `peaks sub-agent dispatch rd` sub-agent (then execute the returned toolCall) with the same `peaks-rd` body used in the Swarm phase, plus the QA findings path so it can read the failure list. Code restores presence after the sub-agent returns.
213
+ - **Assisted / strict / inline-fallback**: Code executes the RD repair steps directly in the main loop, since there is no concurrent fan-out to coordinate.
214
214
  In both paths, pass the QA findings path so the repair sees what failed.
215
215
  4. peaks-rd fixes the reported issues only (red-line scope: do not modify unrelated surfaces), regenerates code-review and security-review evidence if changes touched reviewed surfaces, then transitions `rd → implemented → qa-handoff` again.
216
- 5. Solo re-runs QA (sub-agent Task in swarm/full-auto, inline in assisted/strict) with the same `<request-id>`. QA re-runs gates against the new diff.
216
+ 5. Code re-runs QA (sub-agent Task in swarm/full-auto, inline in assisted/strict) with the same `<request-id>`. QA re-runs gates against the new diff.
217
217
  6. Repeat steps 1-5 until QA returns `verdict=pass`, or the cap below fires.
218
- **After each repair iteration** (after peaks-rd and peaks-qa both return), Solo MUST restore presence:
218
+ **After each repair iteration** (after peaks-rd and peaks-qa both return), Code MUST restore presence:
219
219
  ```bash
220
220
  peaks skill presence:set peaks-code --project <repo> --mode <mode> --gate repair-cycle-<N>
221
221
  ```
@@ -62,14 +62,14 @@ peaks skill presence --check-stale --project <path> --json
62
62
 
63
63
  Returns the same `stale` / `reason` / `currentOuterSessionId` / `recordedOuterSessionId` fields attached to the standard presence envelope. Default `false` (back-compat).
64
64
 
65
- ## Pause integration via `peaks solo should-pause`
65
+ ## Pause integration via `peaks code should-pause`
66
66
 
67
- `peaks solo should-pause --step step-1-mode-select --mode <mode>` now consults `presence:check-stale` automatically. When stale:
67
+ `peaks code should-pause --step step-1-mode-select --mode <mode>` now consults `presence:check-stale` automatically. When stale:
68
68
 
69
69
  ```json
70
70
  {
71
71
  "ok": true,
72
- "command": "solo.should-pause",
72
+ "command": "code.should-pause",
73
73
  "data": {
74
74
  "shouldPause": true,
75
75
  "reason": "stale-presence — re-ask Step 1 (recorded outer session id does not match current)",
@@ -79,7 +79,7 @@ Returns the same `stale` / `reason` / `currentOuterSessionId` / `recordedOuterSe
79
79
  }
80
80
  ```
81
81
 
82
- The hard-pause on `step-1-mode-select` is preserved for ALL modes (defect #1 fix from slice 2026-06-28-solo-mode-bypass-fix). Stale-presence is an additional reason — even when the user names a profile explicitly, peaks-code can still surface the staleness for visibility.
82
+ The hard-pause on `step-1-mode-select` is preserved for ALL modes (defect #1 fix from slice 2026-06-28-code-mode-bypass-fix). Stale-presence is an additional reason — even when the user names a profile explicitly, peaks-code can still surface the staleness for visibility.
83
83
 
84
84
  ## Auto-clear on session rotation
85
85
 
@@ -108,7 +108,7 @@ peaks workspace init --project . --json
108
108
  peaks skill presence:check-stale --project . --json
109
109
  # → { stale: true, reason: "no-presence", presence: null }
110
110
 
111
- peaks solo should-pause --step step-1-mode-select --mode full-auto --json
111
+ peaks code should-pause --step step-1-mode-select --mode full-auto --json
112
112
  # → { shouldPause: true, reason: "step=step-1-mode-select is a mode/context-selection step → always pause" }
113
113
 
114
114
  # 3. User picks a profile (or repeats "full-auto"). Then:
@@ -1,13 +1,13 @@
1
1
  # Step 1 — Mode selection
2
2
 
3
- > Body of `### Peaks-Loop Step 1`. After Step 0 has anchored the workspace and presence, when the user invokes Peaks-Loop Solo without explicitly naming an execution profile, use `AskUserQuestion` to pick the profile. Present the recommended full-auto path as the first/default option with a practical description for each:
3
+ > Body of `### Peaks-Loop Step 1`. After Step 0 has anchored the workspace and presence, when the user invokes Peaks-Loop Code without explicitly naming an execution profile, use `AskUserQuestion` to pick the profile. Present the recommended full-auto path as the first/default option with a practical description for each:
4
4
 
5
5
  1. **Full auto (Recommended)** — Peaks-Loop handles planning, role coordination, validation, and compact handoff end-to-end while preserving required confirmation gates for risky or shared-state actions.
6
6
  2. **Assisted** — Peaks-Loop proposes plans, artifacts, and checks, then pauses for user decisions at major workflow boundaries.
7
7
  3. **Swarm** — Peaks-Loop maximizes safe parallel role/worker execution for larger RD or QA workloads while keeping reducer validation and artifact boundaries explicit.
8
8
  4. **Strict** — Peaks-Loop uses the most conservative gates: explicit confirmations, strict slice specs, coverage evidence, QA acceptance, and commit boundaries before continuing.
9
9
 
10
- Map the user's selection to the `--mode` flag value (used by `peaks skill presence:set`; `presence:set --mode` accepts any string, so the name matches the user-facing label rather than overloading "solo" which is also the skill name):
10
+ Map the user's selection to the `--mode` flag value (used by `peaks skill presence:set`; `presence:set --mode` accepts any string, so the name matches the user-facing label rather than overloading "code" which is also the skill name):
11
11
 
12
12
  | User selects | `--mode` value |
13
13
  |---|---|
@@ -16,6 +16,6 @@ Map the user's selection to the `--mode` flag value (used by `peaks skill presen
16
16
  | Swarm | `swarm` |
17
17
  | Strict | `strict` |
18
18
 
19
- > Note: `peaks workflow route --mode solo|team` is a **different** CLI dimension (solo developer vs team flow) and is unrelated to the profile choice here. Do not conflate them.
19
+ > Note: `peaks workflow route --mode code|team` is a **different** CLI dimension (code developer vs team flow) and is unrelated to the profile choice here. Do not conflate them.
20
20
 
21
21
  If the user already names a profile in their invocation (e.g. `/peaks-code --full-auto`, "用全自动模式"), skip this question and use the named profile directly.
@@ -1,6 +1,6 @@
1
- # OpenSpec Lifecycle for Peaks Solo
1
+ # OpenSpec Lifecycle for Peaks Code
2
2
 
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.
3
+ Peaks Code orchestrates RD, QA, and SC. When the target repository uses OpenSpec, Code must drive the full lifecycle through the Peaks CLI so each role works against the same stable surface.
4
4
 
5
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.
6
6
 
@@ -8,19 +8,19 @@ Peaks Solo orchestrates RD, QA, and SC. When the target repository uses OpenSpec
8
8
 
9
9
  ```text
10
10
  peaks openspec render → RD authors a change pack (dry-run, then --apply)
11
- peaks openspec validate → Solo gates RD output before slicing starts
11
+ peaks openspec validate → Code gates RD output before slicing starts
12
12
  peaks openspec show → any role reads parsed proposal/tasks state
13
13
  peaks openspec to-rd → RD projects the pack into refactor slice input
14
14
  SC projects it into commit boundary candidates
15
15
  peaks openspec validate → QA gates the final state before sign-off
16
- peaks openspec archive → Solo moves the change under changes/archive/<id>/
16
+ peaks openspec archive → Code moves the change under changes/archive/<id>/
17
17
  ```
18
18
 
19
- Rules Solo applies:
19
+ Rules Code applies:
20
20
 
21
21
  - `render --apply` is the only Peaks-managed way to write a change pack. Other roles must not hand-edit `openspec/changes/**`.
22
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`.
23
- - `archive --apply` is the lifecycle terminator; Solo only invokes it after QA acceptance and SC commit.
23
+ - `archive --apply` is the lifecycle terminator; Code only invokes it after QA acceptance and SC commit.
24
24
 
25
25
  ## Refactor workflow wiring
26
26
 
@@ -35,27 +35,27 @@ If the consuming LLM needs an MCP server for docs lookup or research (e.g. Conte
35
35
 
36
36
  ## Boundary
37
37
 
38
- Solo must not write `openspec/changes/**` or `~/.claude/settings.json` directly. Every mutation goes through the CLI commands above. The CLI returns stable envelopes; Solo captures them as artifact links rather than re-explaining their content in the handoff.
38
+ Code must not write `openspec/changes/**` or `~/.claude/settings.json` directly. Every mutation goes through the CLI commands above. The CLI returns stable envelopes; Code captures them as artifact links rather than re-explaining their content in the handoff.
39
39
 
40
40
  ---
41
41
 
42
42
  # Step 0.5 — OpenSpec first-run opt-in (conditional)
43
43
 
44
- > Body of `### Peaks-Loop Step 0.5`. After the workspace is anchored, before project scan, Solo checks whether
44
+ > Body of `### Peaks-Loop Step 0.5`. After the workspace is anchored, before project scan, Code checks whether
45
45
  the project already has an `openspec/` directory. The lifecycle
46
46
  (`render → validate → show → to-rd → validate → archive`) only applies
47
47
  when `openspec/` exists; without it, RD/QA/SC silently skip the
48
48
  openspec-aware paths and you lose change-proposal tracking, commit
49
49
  boundaries from `tasks.md`, and the historical archive.
50
50
 
51
- To make that opt-in visible instead of silent, Solo runs:
51
+ To make that opt-in visible instead of silent, Code runs:
52
52
 
53
53
  ```bash
54
54
  # 1. Detect whether the project already has openspec/.
55
55
  ls <repo>/openspec/changes 2>&1
56
- # 2. If absent, ask the user once — only on the first Solo run in this
56
+ # 2. If absent, ask the user once — only on the first Code run in this
57
57
  # project. The decision is sticky: write it to .peaks/.peaks-openspec-opt-in.json
58
- # so subsequent Solo invocations do not re-ask.
58
+ # so subsequent Code invocations do not re-ask.
59
59
  test -f <repo>/.peaks/.peaks-openspec-opt-in.json || \
60
60
  echo "{\"enabled\": <bool>}" > <repo>/.peaks/.peaks-openspec-opt-in.json
61
61
  ```
@@ -65,11 +65,11 @@ file is missing):
65
65
 
66
66
  | Option | What it does |
67
67
  |---|---|
68
- | Enable OpenSpec for this project (Recommended) | Run `peaks openspec init --project <repo> --apply`. After that, every Solo run uses the change-proposal lifecycle for the same project. |
69
- | Skip for now | Do nothing. Solo proceeds without openspec; the question is re-asked on the next first-run detection. |
70
- | Never ask again for this project | Write `{enabled: false, sticky: true}`. Solo stops asking. The user can re-enable later by removing `.peaks/.peaks-openspec-opt-in.json` and re-running. |
68
+ | Enable OpenSpec for this project (Recommended) | Run `peaks openspec init --project <repo> --apply`. After that, every Code run uses the change-proposal lifecycle for the same project. |
69
+ | Skip for now | Do nothing. Code proceeds without openspec; the question is re-asked on the next first-run detection. |
70
+ | Never ask again for this project | Write `{enabled: false, sticky: true}`. Code stops asking. The user can re-enable later by removing `.peaks/.peaks-openspec-opt-in.json` and re-running. |
71
71
 
72
- The first option is the recommended default because it gives Solo the
72
+ The first option is the recommended default because it gives Code the
73
73
  full change-proposal lifecycle (proposal / tasks / design / specs
74
74
  deltas, archive on ship, commit boundaries from `tasks.md`). It costs
75
75
  only a single scaffolded directory and pays back the first time the
@@ -77,5 +77,5 @@ project needs a real review trail.
77
77
 
78
78
  If the user picks "Enable", the only required follow-up is to make
79
79
  sure `openspec/changes/` is added to git (it is part of the project
80
- repo, not a tool-managed artefact). Solo does not run `git add` for
80
+ repo, not a tool-managed artefact). Code does not run `git add` for
81
81
  the user; that is the user's commit boundary.
@@ -27,7 +27,7 @@ checkpoint as often as it wants.
27
27
  > does **not** expose a `--periodic-every <n>` override flag — the
28
28
  > cadence is owned by the skill, not the CLI. Any patch that relaxes
29
29
  > this must update both files in lockstep or fail the
30
- > `tests/unit/solo/checkpoint-periodic-frequency.test.ts` guard.
30
+ > `tests/unit/code/checkpoint-periodic-frequency.test.ts` guard.
31
31
 
32
32
  ## Checkpoint CLI contract
33
33
 
@@ -72,10 +72,10 @@ This step is strictly IDE-agnostic. The LLM calls the peaks CLI; no IDE-specific
72
72
 
73
73
  ## Companion surface — auto-compact (zero-pause)
74
74
 
75
- When the runner crosses the v2.13.0 auto-compact thresholds (0.85 pre-compact / 0.95 red-line), `peaks session checkpoint` is NOT enough on its own — the LLM must also fire `peaks solo auto-compact --execute` (or wait for the in-band PreToolUse hook at ratio ≥ 0.95 to compact the runner itself). See:
75
+ When the runner crosses the v2.13.0 auto-compact thresholds (0.85 pre-compact / 0.95 red-line), `peaks session checkpoint` is NOT enough on its own — the LLM must also fire `peaks code auto-compact --execute` (or wait for the in-band PreToolUse hook at ratio ≥ 0.95 to compact the runner itself). See:
76
76
 
77
- - `peaks solo auto-compact --execute` — orchestrator that writes the convergence plan + dispatches the compact pathway
77
+ - `peaks code auto-compact --execute` — orchestrator that writes the convergence plan + dispatches the compact pathway
78
78
  - `peaks session auto-compact-hook` — the PreToolUse hook entrypoint fired by `.claude/settings.local.json` (slice 2026-07-02-auto-compact-zero-pause)
79
79
  - `.peaks/memory/2026-06-27-auto-compact-design.md` — zero-human-intervention design rationale
80
80
 
81
- The two surfaces compose: `peaks session checkpoint` persists the context state, `peaks solo auto-compact` collapses the runner's window. The LLM fires both in the 0.85–0.95 zone; the hook fires alone at ≥ 0.95.
81
+ The two surfaces compose: `peaks session checkpoint` persists the context state, `peaks code auto-compact` collapses the runner's window. The LLM fires both in the 0.85–0.95 zone; the hook fires alone at ≥ 0.95.
@@ -7,7 +7,7 @@
7
7
  | `peaks request lint <rid> --role <role> --project <path>` | Scan artifact body for unfilled `<placeholder>`, bare `- ...` bullets, TBD/TODO markers | Before every transition out of `draft` / before role handoff | Any `error`-severity finding (unfilled placeholder, bare-dot bullet) |
8
8
  | `peaks request repair-status <rid> --project <path>` | Count RD↔QA repair cycles from `--reason` transition notes ("QA cycle N: ...") | Before every RD repair iteration in step 7 | Cycle count reached the 3-cycle cap |
9
9
  | `peaks scan request-type-sanity --project <path> --type <type>` | Cross-verify declared `--type` against the actual `git diff` file mix (catches "feature mis-declared as docs" workflow violations) | After PRD type lock-in AND after each RD repair iteration | Declared type disagrees with the file mix |
10
- | `peaks scan libraries --project <path>` | Enumerate every dependency + devDependency + peerDependency + optionalDependency with parsed major version; output goes to `## Library versions` in `rd/project-scan.md`. Read-only. | At Solo step 0.6 (alongside `peaks scan archetype`) | Always exits 0 (warnings in JSON envelope; never blocks) |
10
+ | `peaks scan libraries --project <path>` | Enumerate every dependency + devDependency + peerDependency + optionalDependency with parsed major version; output goes to `## Library versions` in `rd/project-scan.md`. Read-only. | At Code step 0.6 (alongside `peaks scan archetype`) | Always exits 0 (warnings in JSON envelope; never blocks) |
11
11
  | `peaks slice check [--rid <rid>] [--project <path>]` | 4-stage slice 边界 check (typecheck + unit-tests + review-fanout + gate-verify-pipeline). Aggregate pass/fail; non-zero exit if any stage fails. See "Slice 边界 check" below for usage rules (boundary only, never inside a micro-cycle). | At slice 边界(post-micro-cycle, pre-peaks-qa)| Any stage fails |
12
12
 
13
13
  Together with `peaks request transition` (which already CLI-enforces per-type artifact prerequisites), these five commands form the runtime quality net. SKILL.md prose is descriptive; the CLI is what physically blocks bad workflows.
@@ -1,4 +1,4 @@
1
- # Peaks Solo Refactor Mode
1
+ # Peaks Code Refactor Mode
2
2
 
3
3
  `peaks-code refactor` is the primary MVP path.
4
4
 
@@ -60,7 +60,7 @@ peaks request transition <rid> --role prd --state confirmed-by-user --project <r
60
60
  peaks request transition <rid> --role prd --state handed-off --project <repo> --json
61
61
 
62
62
  # 3. Peaks-Loop Default sub-agent fan-out (slice 5 contract)
63
- # Solo computes the swarm plan from --type + frontendOnly + frontend-keyword scan,
63
+ # Code computes the swarm plan from --type + frontendOnly + frontend-keyword scan,
64
64
  # writes it to .peaks/_runtime/<sid>/sc/swarm-plan.json, then writes the slice
65
65
  # DAG to .peaks/_runtime/<sid>/sc/slice-dag.json and launches ONE
66
66
  # `peaks sub-agent dispatch --from-dag <dag-file>` call. The CLI's
@@ -75,10 +75,10 @@ peaks request transition <rid> --role prd --state handed-off --project <repo> --
75
75
  # `peaks sub-agent dispatch <role>` calls in N separate messages when a fan-out
76
76
  # shape exists — `--from-dag` is the only path that exercises the orchestrator.
77
77
  #
78
- # 3a. Pre-fan-out: Solo initialises every role's request artefact slot in the main
78
+ # 3a. Pre-fan-out: Code initialises every role's request artefact slot in the main
79
79
  # loop so sub-agents find a stable rid <-> artefact binding. Each role's
80
80
  # sub-agent may also call peaks request init itself (idempotent on the same rid);
81
- # Solo's call here is the source of truth. Only init roles that are in the
81
+ # Code's call here is the source of truth. Only init roles that are in the
82
82
  # swarm plan — roles not in the plan do not get a slot yet.
83
83
  peaks skill presence:set peaks-code --project <repo> --mode <mode> --gate swarm-fan-out
84
84
  # for each role in swarm-plan.subAgents:
@@ -88,7 +88,7 @@ peaks skill presence:set peaks-code --project <repo> --mode <mode> --gate swarm-
88
88
  # e.g. if plan = [ui, rd, qa]: run init for ui, rd, qa.
89
89
  # If plan = [rd, qa]: run for rd, qa only.
90
90
  # If plan = [] (config|docs|chore skip): no inits here, jump to step 4 directly.
91
- # 3b. Solo writes the slice DAG to a JSON file then issues ONE
91
+ # 3b. Code writes the slice DAG to a JSON file then issues ONE
92
92
  # `peaks sub-agent dispatch --from-dag <dag-file> --batch-id <id>` call.
93
93
  # The CLI envelope returns N parallel buildToolCall descriptors
94
94
  # (dispatchCount = len(swarm-plan.subAgents) when the DAG has >= 2
@@ -98,7 +98,7 @@ peaks skill presence:set peaks-code --project <repo> --mode <mode> --gate swarm-
98
98
  # concurrently, so wall-time approximates max(per-leaf time), not sum.
99
99
  peaks sc build-dag --change-id <cid> --project <repo> --json > .peaks/_runtime/<sid>/sc/slice-dag.json
100
100
  peaks sub-agent dispatch --from-dag .peaks/_runtime/<sid>/sc/slice-dag.json --batch-id <id> --project <repo> --json
101
- # 3c. After fan-out, Solo restores presence once and runs Gate B (ls checks):
101
+ # 3c. After fan-out, Code restores presence once and runs Gate B (ls checks):
102
102
  peaks skill presence:set peaks-code --project <repo> --mode <mode> --gate swarm-converged
103
103
  ls .peaks/_runtime/<sid>/prd/requests/<rid>.md # PRD artefact must exist (Gate B hard)
104
104
  # feature / refactor → ls .peaks/_runtime/<sid>/rd/tech-doc.md
@@ -174,7 +174,7 @@ peaks workspace reconcile --project <repo> --apply --older-than 7
174
174
  # (c) Skip for now — blocks stay in the handoff only, no .peaks/memory/ write"
175
175
  # If 10a returned 0 AND the session surfaced a stable project fact
176
176
  # (decision / convention / approved refactor), STOP — peaks-txt must go
177
- # back and embed at least one block before Solo can advance.
177
+ # back and embed at least one block before Code can advance.
178
178
 
179
179
  # 10c. After the user picks (a) or (b), run:
180
180
  peaks memory extract --project <repo> --artifact .peaks/_runtime/<id>/txt/handoff.md --apply --json
@@ -195,13 +195,13 @@ Repair loop details: see `## Mandatory RD QA repair loop` in SKILL.md for the fu
195
195
  # Step 0.8 (BLOCKING): LLM judges Job-shape, CLI records it.
196
196
  # This is a RECORDER, not a detector. The LLM supplies --is-job + --rationale;
197
197
  # the CLI writes .peaks/_runtime/<sid>/job-shape.json. Downstream steps call
198
- # `peaks solo read-job-shape` to enforce the decision exists.
198
+ # `peaks code read-job-shape` to enforce the decision exists.
199
199
 
200
200
  # (The LLM does the semantic judgement, e.g.:)
201
201
  # "The user named N=35 parallel app/ subdirs, said 'continue until all done',
202
202
  # and disavowed cost. isJob=true, rationale=..., suggestedJobId=app-ut-batch,
203
203
  # suggestedStrategy=rotating, confidence=high."
204
- peaks solo detect-job \
204
+ peaks code detect-job \
205
205
  --is-job true \
206
206
  --rationale "35 parallel app/ subdirs + 'until all done' + '不用考虑费用'" \
207
207
  --suggested-job-id app-ut-batch \
@@ -209,7 +209,7 @@ peaks solo detect-job \
209
209
  --confidence high
210
210
 
211
211
  # Step 0.81-init: if Job-shaped, init BEFORE Step 1.
212
- DECISION=$(peaks solo read-job-shape --json)
212
+ DECISION=$(peaks code read-job-shape --json)
213
213
  if [ "$(echo "$DECISION" | jq -r '.data.decision.isJob')" = "true" ]; then
214
214
  JID=$(echo "$DECISION" | jq -r '.data.decision.suggestedJobId')
215
215
  STRATEGY=$(echo "$DECISION" | jq -r '.data.decision.suggestedStrategy')
@@ -232,18 +232,18 @@ peaks job subagent-cleanup --job-id <jid> --batch-id <bid> --force # Step 0.87
232
232
 
233
233
  # v3.1.2 size-fear ban: refuse to emit a final handoff while remaining > 0.
234
234
  # The LLM cannot bypass this; --force-under-job requires explicit user approval.
235
- peaks solo emit-handoff --project <repo> --job-id <jid> --json
235
+ peaks code emit-handoff --project <repo> --job-id <jid> --json
236
236
 
237
237
  # v3.1.2 forced auto-compact: when --enforce-job-mode is set OR
238
238
  # job-shape.json says isJob=true, ≥0.85 is MANDATORY auto-compact.
239
- # Solo MUST call this without confirmation under Job mode.
240
- peaks solo context-now --project <repo> --enforce-job-mode --json
239
+ # Code MUST call this without confirmation under Job mode.
240
+ peaks code context-now --project <repo> --enforce-job-mode --json
241
241
  peaks session auto-compact --execute --project <repo> --json
242
242
 
243
243
  # v3.1.2 PreToolUse gate (installed by `peaks workspace init`):
244
- # every Bash tool call runs `peaks solo gate-step-08` automatically.
244
+ # every Bash tool call runs `peaks code gate-step-08` automatically.
245
245
  # Exit 0 = allow (with optional Next: slice #N+1 of M line when
246
246
  # progress.json exists). Exit 2 = BLOCKED; LLM must call
247
- # `peaks solo detect-job` first.
248
- peaks solo gate-step-08 --project <repo> --json
247
+ # `peaks code detect-job` first.
248
+ peaks code gate-step-08 --project <repo> --json
249
249
  ```
@@ -1,6 +1,6 @@
1
1
  # Step 0.55 — 1.x → 2.0 detection reference
2
2
 
3
- > Body of `### Peaks-Loop Step 0.55`. Slice: 2026-06-12-solo-step-0-55-1x-detection.
3
+ > Body of `### Peaks-Loop Step 0.55`. Slice: 2026-06-12-code-step-0-55-1x-detection.
4
4
 
5
5
  ## Why this step exists
6
6
 
@@ -1,10 +1,10 @@
1
- # Peaks-Loop Solo — Step 0.8 (v3.1.1 + v3.1.2) Gate Deep-Dive
1
+ # Peaks-Loop Code — Step 0.8 (v3.1.1 + v3.1.2) Gate Deep-Dive
2
2
 
3
3
  > Read alongside `SKILL.md` Step 0.8. The SKILL.md header is the LOCKED CONTRACT; this file is the mechanics.
4
4
 
5
- ## Recorder contract (`peaks solo detect-job`)
5
+ ## Recorder contract (`peaks code detect-job`)
6
6
 
7
- The CLI does NOT judge whether the request is Job-shaped — that is the LLM's job. Keyword regexes are wrong here (too brittle, miss natural-language variants, shift the LLM's semantic understanding into code). The CLI is a **recorder and gate**: the LLM makes the judgement, writes it via `peaks solo detect-job`, and downstream steps refuse to proceed until the decision file exists.
7
+ The CLI does NOT judge whether the request is Job-shaped — that is the LLM's job. Keyword regexes are wrong here (too brittle, miss natural-language variants, shift the LLM's semantic understanding into code). The CLI is a **recorder and gate**: the LLM makes the judgement, writes it via `peaks code detect-job`, and downstream steps refuse to proceed until the decision file exists.
8
8
 
9
9
  ### LLM judgement criteria (read once, then call the recorder)
10
10
 
@@ -16,40 +16,40 @@ The CLI does NOT judge whether the request is Job-shaped — that is the LLM's j
16
16
  ### Action sequence
17
17
 
18
18
  1. LLM reads the user prompt and applies judgement → `isJob: boolean + rationale + suggestedJobId + suggestedStrategy + confidence`.
19
- 2. LLM calls `peaks solo detect-job --is-job <bool> --rationale <text> --suggested-job-id <jid> --suggested-strategy <single|rotating> --confidence <high|medium|low> [--force]`.
19
+ 2. LLM calls `peaks code detect-job --is-job <bool> --rationale <text> --suggested-job-id <jid> --suggested-strategy <single|rotating> --confidence <high|medium|low> [--force]`.
20
20
  3. CLI records to `.peaks/_runtime/<sessionId>/job-shape.json`.
21
21
  4. If `isJob: true` → `peaks job init --job-id <jid> --slice-list <...> --main-loop-strategy <strategy> --rotate-every 3` (BEFORE Step 1).
22
22
  5. Downstream steps (Step 1, Step 0.81, etc.) call `read-job-shape` to refuse if missing.
23
23
 
24
24
  ### Hard rule (v3.1.1 red-line #10)
25
25
 
26
- LLM MUST NOT skip `peaks solo detect-job` even when the trigger is obvious from context. If the next step's `read-job-shape` throws `JOB_SHAPE_NOT_DECIDED`, Solo MUST record a decision before proceeding. Keyword-based "I already know it's a Job" is not a substitute.
26
+ LLM MUST NOT skip `peaks code detect-job` even when the trigger is obvious from context. If the next step's `read-job-shape` throws `JOB_SHAPE_NOT_DECIDED`, Code MUST record a decision before proceeding. Keyword-based "I already know it's a Job" is not a substitute.
27
27
 
28
28
  ## v3.1.2 mechanical gates
29
29
 
30
30
  The recorder-only design was bypassed twice under load; the gate must be un-bypassable.
31
31
 
32
- ### 1. PreToolUse hook — `peaks solo gate-step-08`
32
+ ### 1. PreToolUse hook — `peaks code gate-step-08`
33
33
 
34
- `peaks workspace init` installs the `Bash` matcher `peaks solo gate-step-08 --project .` in `.claude/settings.local.json` (alongside the existing Write|Edit|MultiEdit matcher). The hook runs before every Bash call:
34
+ `peaks workspace init` installs the `Bash` matcher `peaks code gate-step-08 --project .` in `.claude/settings.local.json` (alongside the existing Write|Edit|MultiEdit matcher). The hook runs before every Bash call:
35
35
 
36
36
  | Condition | Exit | Behaviour |
37
37
  |---|---|---|
38
38
  | `job-shape.json` exists | 0 (allow) | allow + emit decision; if `progress.json` exists, add `Next: slice #N+1 of M (<currentSlice>)` |
39
- | `job-shape.json` missing AND prompt matches the fail-closed backup regex | 2 (BLOCKED) | LLM must call `peaks solo detect-job` before retrying |
39
+ | `job-shape.json` missing AND prompt matches the fail-closed backup regex | 2 (BLOCKED) | LLM must call `peaks code detect-job` before retrying |
40
40
  | `job-shape.json` missing AND no regex match | 0 (allow) | allow, no Job trigger |
41
41
 
42
- ### 2. Size-fear ban — `peaks solo emit-handoff`
42
+ ### 2. Size-fear ban — `peaks code emit-handoff`
43
43
 
44
44
  Refuses to emit a final handoff while `remaining > 0` under Job mode. Pass `--force-under-job` only with explicit user approval.
45
45
 
46
46
  ### 3. Forced auto-compact — `--enforce-job-mode`
47
47
 
48
- `peaks solo context-now --enforce-job-mode` (auto-enabled when `job-shape.json` says `isJob=true`) returns `action: 'auto-compact-now'` at ≥ 0.85; Solo MUST call `peaks session auto-compact --execute` without confirmation.
48
+ `peaks code context-now --enforce-job-mode` (auto-enabled when `job-shape.json` says `isJob=true`) returns `action: 'auto-compact-now'` at ≥ 0.85; Code MUST call `peaks session auto-compact --execute` without confirmation.
49
49
 
50
50
  ### 4. On-disk slice progress — `progress.json`
51
51
 
52
- `peaks job checkpoint --state done` writes `progress.json`. `peaks job progress --job-id <jid> [--allow-missing]` is the canonical reader; `peaks solo gate-step-08` also surfaces it on every Bash call so the LLM cannot "wake up cold".
52
+ `peaks job checkpoint --state done` writes `progress.json`. `peaks job progress --job-id <jid> [--allow-missing]` is the canonical reader; `peaks code gate-step-08` also surfaces it on every Bash call so the LLM cannot "wake up cold".
53
53
 
54
54
  ## Backup regex rationale
55
55
 
@@ -20,7 +20,7 @@ the skills compose. For sub-agent dispatch the relationship is:
20
20
 
21
21
  | Surface | Who owns | What it does | Who calls it |
22
22
  |---|---|---|---|
23
- | SKILL.md (主面) | peaks-code, peaks-rd, peaks-qa | Tells the LLM when and why to dispatch a sub-agent; what prompt to pass; what artifacts to expect back | LLM (during normal Solo / RD / QA flow) |
23
+ | SKILL.md (主面) | peaks-code, peaks-rd, peaks-qa | Tells the LLM when and why to dispatch a sub-agent; what prompt to pass; what artifacts to expect back | LLM (during normal Code / RD / QA flow) |
24
24
  | CLI (副 / 原子) | `peaks sub-agent dispatch` | Validates the role, looks up the current IDE's `subAgentDispatcher`, returns a per-IDE tool-call descriptor + writes a dispatch record | LLM (read from the SKILL.md) |
25
25
  | Dispatcher 抽象 (per-IDE) | `src/services/dispatch/sub-agent-dispatcher.ts` | Encapsulates the IDE-private tool name (claude-code: `Task`, trae: UNVERIFIED placeholder) and arg shape | CLI (called by the CLI) |
26
26
 
@@ -278,7 +278,7 @@ When writing a SKILL.md that fans out sub-agents:
278
278
 
279
279
  ### Sub-agent mechanism (IDE-agnostic dispatch, NOT Skill tool)
280
280
 
281
- > Body of `### Sub-agent mechanism`. **Solo is itself a skill running in the current session. To invoke a role in the Swarm, Solo MUST call the IDE-agnostic dispatch primitive `peaks sub-agent dispatch <role>` — NOT the `Skill` tool, NOT any IDE-private sub-agent literal.** The `Skill` tool is single-stack and blocking; using it for "parallel" work was the v1.x illusion of concurrency. The dispatch CLI is the only mechanism that keeps SKILL.md free of IDE-private tool names and lets the same prompt work on every registered IDE.
281
+ > Body of `### Sub-agent mechanism`. **Code is itself a skill running in the current session. To invoke a role in the Swarm, Code MUST call the IDE-agnostic dispatch primitive `peaks sub-agent dispatch <role>` — NOT the `Skill` tool, NOT any IDE-private sub-agent literal.** The `Skill` tool is single-stack and blocking; using it for "parallel" work was the v1.x illusion of concurrency. The dispatch CLI is the only mechanism that keeps SKILL.md free of IDE-private tool names and lets the same prompt work on every registered IDE.
282
282
 
283
283
  Each sub-agent dispatch call looks like:
284
284
 
@@ -304,21 +304,21 @@ The role's required artefact paths (also see peaks-ui/rd/qa SKILL.md and `refere
304
304
  | `rd-planning` | `.peaks/_runtime/<sessionId>/rd/tech-doc.md` (feature/refactor) or `.peaks/_runtime/<sessionId>/rd/bug-analysis.md` (bugfix) | PRD body, project-scan, existing-system, codegraph |
305
305
  | `qa-test-cases` | `.peaks/_runtime/<sessionId>/qa/test-cases/<rid>.md` | PRD body, RD planning artefact, project-scan, codegraph |
306
306
 
307
- **Solo launches all sub-agents in the swarm plan in a single message (multiple `peaks sub-agent dispatch` calls in parallel, each followed by execution of the returned toolCall)** — this is what gives real concurrency. Do not sequentialize them. The CLI returns N toolCall descriptors; the LLM fires all N in the same message; the IDE dispatches them concurrently; Solo then waits for all to return, runs `ls` checks against the paths above (Peaks-Loop Gate B), and only then advances to RD implementation.
307
+ **Code launches all sub-agents in the swarm plan in a single message (multiple `peaks sub-agent dispatch` calls in parallel, each followed by execution of the returned toolCall)** — this is what gives real concurrency. Do not sequentialize them. The CLI returns N toolCall descriptors; the LLM fires all N in the same message; the IDE dispatches them concurrently; Code then waits for all to return, runs `ls` checks against the paths above (Peaks-Loop Gate B), and only then advances to RD implementation.
308
308
 
309
309
  **Hard prohibitions on sub-agents** (also passed in each dispatch prompt):
310
310
 
311
311
  - Do NOT call `Skill(skill="...")` — sub-agents must not recursively activate skills, that defeats the fan-out.
312
- - Do NOT call `peaks skill presence:set` — only the main Solo loop owns `.peaks/.active-skill.json`. Sub-agents write to a per-agent marker file `.peaks/_runtime/<sessionId>/system/sub-agent-<role>.json` if they need to record state, but never the main presence file.
313
- - Do NOT open interactive user prompts. If a sub-agent needs clarification, it must return a `blocked` verdict in its return string and let Solo handle the user message.
314
- - Do NOT commit, push, install hooks, or apply settings.json mutations. Only Solo holds those permissions.
312
+ - Do NOT call `peaks skill presence:set` — only the main Code loop owns `.peaks/.active-skill.json`. Sub-agents write to a per-agent marker file `.peaks/_runtime/<sessionId>/system/sub-agent-<role>.json` if they need to record state, but never the main presence file.
313
+ - Do NOT open interactive user prompts. If a sub-agent needs clarification, it must return a `blocked` verdict in its return string and let Code handle the user message.
314
+ - Do NOT commit, push, install hooks, or apply settings.json mutations. Only Code holds those permissions.
315
315
  - **Reinforced (2026-06-28 incident):** an RD sub-agent silently auto-committed its own diff during a fix-callerid-leak dispatch (commit `bff4dff`). The orchestrator caught the unauthorized commit on the next turn but the user had to manually re-approve. **Every dispatch prompt MUST copy the verbatim block below into its `--prompt` argument** so the sub-agent sees the rule with full weight:
316
316
 
317
317
  ```
318
318
  ## Commit / push policy (verbatim, mandatory)
319
319
  - Do NOT run `git commit`, `git push`, `git tag`, `git checkout -b`, or any
320
320
  state-mutating git command. Leave the diff on disk and return the
321
- diff summary in your final message. The orchestrator (Solo) owns the
321
+ diff summary in your final message. The orchestrator (Code) owns the
322
322
  commit / push decision; it will run `git status` and `git diff` after
323
323
  your return and decide whether to commit.
324
324
  - If you believe a commit is urgent (e.g. emergency hotfix), return
@@ -327,7 +327,7 @@ The role's required artefact paths (also see peaks-ui/rd/qa SKILL.md and `refere
327
327
  ```
328
328
  - **Do write heartbeats** — call `peaks sub-agent heartbeat --record <dispatchRecordPath> --status running --progress <pct> --note "<text>"` at least every 30s (see `references/sub-agent-dispatch.md` §G6 for the full contract). The parent Dispatcher uses these to render the live status line during the wait.
329
329
 
330
- After every sub-agent dispatch returns, Solo **restores presence** once (not per-agent), then continues to Gate B verification:
330
+ After every sub-agent dispatch returns, Code **restores presence** once (not per-agent), then continues to Gate B verification:
331
331
 
332
332
  ```bash
333
333
  peaks skill presence:set peaks-code --project <repo> --mode <mode> --gate swarm-converged