peaks-loop 3.0.0 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/CHANGELOG.md +94 -59
  3. package/README-en.md +2 -2
  4. package/README.md +2 -2
  5. package/agents/karpathy-reviewer.md +2 -2
  6. package/dist/src/cli/commands/agent-commands.js +3 -3
  7. package/dist/src/cli/commands/audit-commands.d.ts +1 -1
  8. package/dist/src/cli/commands/audit-commands.js +6 -6
  9. package/dist/src/cli/commands/classify-classify-commands.js +1 -1
  10. package/dist/src/cli/commands/code-review-commands.d.ts +3 -3
  11. package/dist/src/cli/commands/code-review-commands.js +5 -5
  12. package/dist/src/cli/commands/compact-command.d.ts +21 -0
  13. package/dist/src/cli/commands/compact-command.js +252 -0
  14. package/dist/src/cli/commands/context-commands.d.ts +1 -1
  15. package/dist/src/cli/commands/context-commands.js +1 -1
  16. package/dist/src/cli/commands/contract-commands.d.ts +1 -1
  17. package/dist/src/cli/commands/core/session-command.js +17 -7
  18. package/dist/src/cli/commands/core/skill-command.js +1 -1
  19. package/dist/src/cli/commands/feedback-commands.js +1 -1
  20. package/dist/src/cli/commands/hook-handle.d.ts +1 -1
  21. package/dist/src/cli/commands/hook-handle.js +1 -1
  22. package/dist/src/cli/commands/legacy-commands.d.ts +1 -1
  23. package/dist/src/cli/commands/legacy-commands.js +2 -2
  24. package/dist/src/cli/commands/log-commands.js +2 -2
  25. package/dist/src/cli/commands/loop-commands.d.ts +1 -1
  26. package/dist/src/cli/commands/loop-commands.js +1 -1
  27. package/dist/src/cli/commands/loop-eval-commands.d.ts +1 -1
  28. package/dist/src/cli/commands/loop-eval-commands.js +1 -1
  29. package/dist/src/cli/commands/playwright-commands.d.ts +1 -1
  30. package/dist/src/cli/commands/playwright-commands.js +2 -2
  31. package/dist/src/cli/commands/request-commands.js +40 -1
  32. package/dist/src/cli/commands/role-commands.js +1 -1
  33. package/dist/src/cli/commands/slice-commands.js +5 -5
  34. package/dist/src/cli/commands/understand-commands.js +36 -0
  35. package/dist/src/cli/commands/upgrade-commands.d.ts +1 -1
  36. package/dist/src/cli/commands/upgrade-commands.js +6 -6
  37. package/dist/src/cli/commands/workspace/init-command.js +2 -2
  38. package/dist/src/cli/program.js +10 -1
  39. package/dist/src/services/agent/ecc-agent-service.js +5 -5
  40. package/dist/src/services/audit/artifact-writer.d.ts +1 -1
  41. package/dist/src/services/audit/artifact-writer.js +1 -1
  42. package/dist/src/services/audit/decision-writer.d.ts +1 -1
  43. package/dist/src/services/audit/decision-writer.js +1 -1
  44. package/dist/src/services/audit/enforcers/lint-output-style.js +5 -5
  45. package/dist/src/services/audit/enforcers/mock-placement.d.ts +1 -1
  46. package/dist/src/services/audit/enforcers/mock-placement.js +1 -1
  47. package/dist/src/services/audit/enforcers/no-root-pollution.js +1 -1
  48. package/dist/src/services/audit/red-line-catalog-p2-a.js +2 -2
  49. package/dist/src/services/audit/red-line-catalog-p2-b.js +2 -2
  50. package/dist/src/services/audit/static-service.d.ts +1 -1
  51. package/dist/src/services/audit/static-service.js +5 -5
  52. package/dist/src/services/audit/types.d.ts +1 -1
  53. package/dist/src/services/audit/types.js +1 -1
  54. package/dist/src/services/audit-independent/perf-audit-service.js +1 -1
  55. package/dist/src/services/audit-independent/security-audit-service.js +1 -1
  56. package/dist/src/services/classify/classify-service.d.ts +1 -1
  57. package/dist/src/services/classify/classify-service.js +1 -1
  58. package/dist/src/services/classify/classify-types.d.ts +1 -1
  59. package/dist/src/services/classify/classify-types.js +1 -1
  60. package/dist/src/services/code-review/ecc-bridge.d.ts +2 -2
  61. package/dist/src/services/code-review/ecc-bridge.js +2 -2
  62. package/dist/src/services/code-review/ocr-service.d.ts +9 -9
  63. package/dist/src/services/code-review/ocr-service.js +16 -16
  64. package/dist/src/services/compact/decision-tables.d.ts +66 -0
  65. package/dist/src/services/compact/decision-tables.js +127 -0
  66. package/dist/src/services/compact/request-transition-hook.d.ts +20 -0
  67. package/dist/src/services/compact/request-transition-hook.js +110 -0
  68. package/dist/src/services/compact/suggest-service.d.ts +74 -0
  69. package/dist/src/services/compact/suggest-service.js +203 -0
  70. package/dist/src/services/config/config-migration.js +1 -1
  71. package/dist/src/services/config/config-safety.d.ts +1 -1
  72. package/dist/src/services/config/config-safety.js +1 -1
  73. package/dist/src/services/config/config-service.d.ts +1 -1
  74. package/dist/src/services/config/config-service.js +1 -1
  75. package/dist/src/services/context/auto-compact-dispatcher.js +4 -4
  76. package/dist/src/services/context/auto-compact-types.d.ts +6 -6
  77. package/dist/src/services/context/auto-compact-types.js +5 -5
  78. package/dist/src/services/dispatch/sub-agent-dispatcher.js +1 -1
  79. package/dist/src/services/dispatch/test-tool-detection.d.ts +1 -1
  80. package/dist/src/services/dispatch/test-tool-detection.js +1 -1
  81. package/dist/src/services/doctor/doctor-service.d.ts +1 -1
  82. package/dist/src/services/doctor/doctor-service.js +5 -5
  83. package/dist/src/services/hooks/presence-marker-detector.js +5 -5
  84. package/dist/src/services/ide/adapters/claude-code-adapter.d.ts +1 -1
  85. package/dist/src/services/ide/adapters/claude-code-adapter.js +2 -2
  86. package/dist/src/services/ide/adapters/codex-adapter.d.ts +2 -2
  87. package/dist/src/services/ide/adapters/codex-adapter.js +2 -2
  88. package/dist/src/services/ide/adapters/cursor-adapter.d.ts +2 -2
  89. package/dist/src/services/ide/adapters/cursor-adapter.js +2 -2
  90. package/dist/src/services/ide/adapters/hermes-adapter.d.ts +1 -1
  91. package/dist/src/services/ide/adapters/hermes-adapter.js +1 -1
  92. package/dist/src/services/ide/adapters/openclaw-adapter.d.ts +1 -1
  93. package/dist/src/services/ide/adapters/openclaw-adapter.js +1 -1
  94. package/dist/src/services/ide/adapters/trae-adapter.d.ts +1 -1
  95. package/dist/src/services/ide/adapters/trae-adapter.js +1 -1
  96. package/dist/src/services/ide/ide-types.d.ts +9 -9
  97. package/dist/src/services/legacy/legacy-detector.d.ts +1 -1
  98. package/dist/src/services/legacy/legacy-detector.js +1 -1
  99. package/dist/src/services/log/log-commands-service.d.ts +1 -1
  100. package/dist/src/services/log/log-commands-service.js +1 -1
  101. package/dist/src/services/log/logger.d.ts +3 -3
  102. package/dist/src/services/log/logger.js +3 -3
  103. package/dist/src/services/log/redact.d.ts +1 -1
  104. package/dist/src/services/log/redact.js +1 -1
  105. package/dist/src/services/loop/evaluator-dispatcher.d.ts +1 -1
  106. package/dist/src/services/loop/evaluator-dispatcher.js +16 -15
  107. package/dist/src/services/loop/monotonic-guard.js +35 -18
  108. package/dist/src/services/loop/monotonic-runner.d.ts +3 -0
  109. package/dist/src/services/loop/monotonic-runner.js +62 -28
  110. package/dist/src/services/loop/run-driver.js +45 -24
  111. package/dist/src/services/memory/llm-reranker.d.ts +1 -1
  112. package/dist/src/services/memory/llm-reranker.js +1 -1
  113. package/dist/src/services/mut/production-stryker.d.ts +0 -5
  114. package/dist/src/services/mut/production-stryker.js +19 -10
  115. package/dist/src/services/openspec/openspec-propose-from-doctor-service.d.ts +1 -1
  116. package/dist/src/services/openspec/openspec-propose-from-doctor-service.js +1 -1
  117. package/dist/src/services/perf/perf-baseline-service.d.ts +2 -2
  118. package/dist/src/services/perf/perf-baseline-service.js +2 -2
  119. package/dist/src/services/prd/handoff-auto-regen.js +1 -1
  120. package/dist/src/services/prd/project-scan-sediment.js +3 -3
  121. package/dist/src/services/prd/project-scan-types.d.ts +1 -1
  122. package/dist/src/services/preferences/preferences-types.d.ts +3 -3
  123. package/dist/src/services/preferences/preferences-types.js +2 -2
  124. package/dist/src/services/role/role-registry.d.ts +1 -1
  125. package/dist/src/services/role/role-registry.js +1 -1
  126. package/dist/src/services/sc/sc-service.js +3 -3
  127. package/dist/src/services/skill/resume-detector.js +2 -2
  128. package/dist/src/services/skills/sync-service.d.ts +3 -3
  129. package/dist/src/services/skills/sync-service.js +9 -9
  130. package/dist/src/services/slice/calibration-store.d.ts +1 -1
  131. package/dist/src/services/slice/calibration-store.js +1 -1
  132. package/dist/src/services/solo/auto-compact-orchestrator.d.ts +1 -1
  133. package/dist/src/services/solo/auto-compact-orchestrator.js +7 -7
  134. package/dist/src/services/solo/dag-orchestrator.js +1 -1
  135. package/dist/src/services/solo/mode-gate.d.ts +1 -1
  136. package/dist/src/services/solo/mode-gate.js +4 -4
  137. package/dist/src/services/solo/user-touchpoint-classifier.js +1 -1
  138. package/dist/src/services/standards/migrate-claude-rules-service.js +5 -5
  139. package/dist/src/services/standards/migrate-service.d.ts +3 -3
  140. package/dist/src/services/standards/migrate-service.js +5 -5
  141. package/dist/src/services/standards/project-standards-service.js +1 -1
  142. package/dist/src/services/understand/hybrid-types.d.ts +32 -0
  143. package/dist/src/services/understand/hybrid-types.js +1 -0
  144. package/dist/src/services/understand/understand-hybrid-service.d.ts +10 -0
  145. package/dist/src/services/understand/understand-hybrid-service.js +100 -0
  146. package/dist/src/services/upgrade/gitignore-migrate-service.d.ts +3 -3
  147. package/dist/src/services/upgrade/gitignore-migrate-service.js +4 -4
  148. package/dist/src/services/upgrade/upgrade-service.d.ts +1 -1
  149. package/dist/src/services/upgrade/upgrade-service.js +5 -5
  150. package/dist/src/services/verdict/envelopes.d.ts +1 -1
  151. package/dist/src/services/verdict/envelopes.js +1 -1
  152. package/dist/src/services/workflow/workflow-loader.js +1 -1
  153. package/dist/src/services/workspace/migrate-1-4-1-service.d.ts +1 -1
  154. package/dist/src/services/workspace/migrate-1-4-1-service.js +1 -1
  155. package/dist/src/services/workspace/migrate-types.d.ts +1 -1
  156. package/dist/src/services/workspace/migrate-types.js +1 -1
  157. package/dist/src/services/workspace/workspace-claude-settings-materializer.d.ts +2 -2
  158. package/dist/src/services/workspace/workspace-claude-settings-materializer.js +9 -9
  159. package/dist/src/services/workspace/workspace-service.d.ts +1 -1
  160. package/dist/src/services/workspace/workspace-service.js +1 -1
  161. package/dist/src/shared/path-safety.d.ts +1 -1
  162. package/dist/src/shared/path-safety.js +1 -1
  163. package/dist/src/shared/version.d.ts +1 -1
  164. package/dist/src/shared/version.js +1 -1
  165. package/output-styles/peaks-skill-swarm.md +33 -33
  166. package/package.json +5 -4
  167. package/schemas/decomposition-v1.json +1 -1
  168. package/schemas/decomposition-v2.json +1 -1
  169. package/schemas/replay-fixture.schema.json +1 -1
  170. package/schemas/reviewer-envelope.schema.json +1 -1
  171. package/scripts/install-skills.mjs +11 -11
  172. package/skills/peaks-audit/SKILL.md +2 -2
  173. package/skills/peaks-doctor/SKILL.md +4 -4
  174. package/skills/peaks-final-review/SKILL.md +2 -2
  175. package/skills/peaks-ide/SKILL.md +3 -3
  176. package/skills/peaks-perf-audit/SKILL.md +1 -1
  177. package/skills/peaks-prd/SKILL.md +14 -14
  178. package/skills/peaks-prd/references/workflow.md +1 -1
  179. package/skills/peaks-qa/SKILL.md +17 -17
  180. package/skills/peaks-qa/references/artifact-per-request.md +1 -1
  181. package/skills/peaks-qa/references/browser-validation-contracts.md +2 -2
  182. package/skills/peaks-qa/references/codegraph-regression-focus.md +1 -1
  183. package/skills/peaks-qa/references/external-capability-guidance.md +2 -2
  184. package/skills/peaks-qa/references/qa-fanout-contract.md +1 -1
  185. package/skills/peaks-qa/references/qa-gstack-integration.md +3 -3
  186. package/skills/peaks-qa/references/qa-local-artifacts.md +1 -1
  187. package/skills/peaks-qa/references/qa-matt-pocock-integration.md +1 -1
  188. package/skills/peaks-qa/references/qa-runbook.md +3 -3
  189. package/skills/peaks-qa/references/qa-skill-presence.md +1 -1
  190. package/skills/peaks-qa/references/qa-standards-preflight.md +2 -2
  191. package/skills/peaks-qa/references/qa-transition-gates.md +9 -9
  192. package/skills/peaks-qa/references/regression-gates.md +1 -1
  193. package/skills/peaks-rd/SKILL.md +13 -13
  194. package/skills/peaks-rd/references/artifact-and-standards-output.md +1 -1
  195. package/skills/peaks-rd/references/codegraph-project-analysis.md +1 -1
  196. package/skills/peaks-rd/references/external-references.md +3 -3
  197. package/skills/peaks-rd/references/karpathy-reviewer-prompt.md +1 -1
  198. package/skills/peaks-rd/references/mandatory-perf-baseline.md +1 -1
  199. package/skills/peaks-rd/references/matt-pocock-integration.md +2 -2
  200. package/skills/peaks-rd/references/ocr-integration.md +19 -19
  201. package/skills/peaks-rd/references/openspec-cli.md +2 -2
  202. package/skills/peaks-rd/references/rd-gstack-integration.md +5 -5
  203. package/skills/peaks-rd/references/rd-runbook.md +9 -9
  204. package/skills/peaks-rd/references/rd-standards-preflight.md +1 -1
  205. package/skills/peaks-rd/references/rd-transition-gates.md +13 -13
  206. package/skills/peaks-rd/references/skill-presence-and-title.md +1 -1
  207. package/skills/peaks-reviewer/SKILL.md +2 -2
  208. package/skills/peaks-sc/SKILL.md +9 -9
  209. package/skills/peaks-security-audit/SKILL.md +1 -1
  210. package/skills/peaks-slice-decompose/SKILL.md +2 -2
  211. package/skills/peaks-solo/SKILL.md +49 -49
  212. package/skills/peaks-solo/references/a2a-artifact-mapping.md +8 -8
  213. package/skills/peaks-solo/references/anchoring-and-session-info.md +3 -3
  214. package/skills/peaks-solo/references/boundaries.md +4 -4
  215. package/skills/peaks-solo/references/browser-workflow.md +2 -2
  216. package/skills/peaks-solo/references/codegraph-orchestration.md +1 -1
  217. package/skills/peaks-solo/references/completion-handoff.md +2 -2
  218. package/skills/peaks-solo/references/external-references.md +3 -3
  219. package/skills/peaks-solo/references/external-skill-invocation.md +2 -2
  220. package/skills/peaks-solo/references/frontend-only-mode.md +1 -1
  221. package/skills/peaks-solo/references/gstack-integration.md +4 -4
  222. package/skills/peaks-solo/references/local-artifact-workspace.md +2 -2
  223. package/skills/peaks-solo/references/micro-cycle.md +4 -4
  224. package/skills/peaks-solo/references/mode-selection.md +5 -5
  225. package/skills/peaks-solo/references/openspec-workflow.md +2 -2
  226. package/skills/peaks-solo/references/playwright-mcp-multi-terminal.md +1 -1
  227. package/skills/peaks-solo/references/project-memory-loading.md +1 -1
  228. package/skills/peaks-solo/references/project-scan-checklist.md +1 -1
  229. package/skills/peaks-solo/references/quality-gate-cheatsheet.md +1 -1
  230. package/skills/peaks-solo/references/resume-detection.md +1 -1
  231. package/skills/peaks-solo/references/runbook.md +20 -20
  232. package/skills/peaks-solo/references/skill-presence-and-title.md +2 -2
  233. package/skills/peaks-solo/references/standards-preflight.md +2 -2
  234. package/skills/peaks-solo/references/step-0-55-1x-detection.md +3 -3
  235. package/skills/peaks-solo/references/sub-agent-dispatch.md +3 -3
  236. package/skills/peaks-solo/references/swarm-dispatch-contract.md +3 -3
  237. package/skills/peaks-solo/references/workflow-gates-and-types.md +34 -34
  238. package/skills/peaks-solo-resume/SKILL.md +2 -2
  239. package/skills/peaks-solo-status/SKILL.md +4 -4
  240. package/skills/peaks-solo-test/SKILL.md +4 -4
  241. package/skills/peaks-sop/SKILL.md +5 -5
  242. package/skills/peaks-txt/SKILL.md +17 -17
  243. package/skills/peaks-ui/SKILL.md +17 -17
  244. package/skills/peaks-ui/references/workflow.md +1 -1
@@ -13,21 +13,21 @@
13
13
 
14
14
  Security and performance evidence surface under `rd/security-review.md` and `rd/perf-baseline.md` (peaks-rd's audit fan-out) and are referenced by reference from the QA test report body. The pre-v2.11.0 `qa/security-findings.md` / `qa/performance-findings.md` files are no longer required; existing ones are kept for auditability but ignored by the gate.
15
15
 
16
- **Peaks-Cli Gate A — After test-case generation:**
16
+ **Peaks-Loop Gate A — After test-case generation:**
17
17
  ```bash
18
18
  ls .peaks/_runtime/<sessionId>/qa/test-cases/<rid>.md
19
19
  # Expected: .peaks/_runtime/<sessionId>/qa/test-cases/<rid>.md
20
20
  # "No such file" → STOP, generate test cases first.
21
21
  ```
22
22
 
23
- **Peaks-Cli Gate A2 — After test execution: tests actually ran (CRITICAL):**
23
+ **Peaks-Loop Gate A2 — After test execution: tests actually ran (CRITICAL):**
24
24
  ```bash
25
25
  npx vitest run --changed --reporter=verbose 2>&1 | tail -30
26
26
  # Expected: exit code 0, actual test output
27
27
  # "0 tests executed" or "no test files found" → BLOCKED.
28
28
  ```
29
29
 
30
- **Peaks-Cli Gate A3 — Security review referenced (v2.11.0 D1/D4: read-only reference, NOT a separate QA file):**
30
+ **Peaks-Loop Gate A3 — Security review referenced (v2.11.0 D1/D4: read-only reference, NOT a separate QA file):**
31
31
  ```bash
32
32
  # peaks-qa does NOT own a qa/security-findings.md. peaks-rd's audit fan-out
33
33
  # produces rd/security-review.md; QA references it by path in the test report body.
@@ -36,7 +36,7 @@ grep -E "rd/security-review\\.md|security-review" .peaks/_runtime/<sessionId>/qa
36
36
  # Empty → BLOCKED: the test report must cite where security evidence lives.
37
37
  ```
38
38
 
39
- **Peaks-Cli Gate A4 — Performance baseline referenced (v2.11.0 D1/D4: read-only reference, NOT a separate QA file):**
39
+ **Peaks-Loop Gate A4 — Performance baseline referenced (v2.11.0 D1/D4: read-only reference, NOT a separate QA file):**
40
40
  ```bash
41
41
  # peaks-qa does NOT own a qa/performance-findings.md. peaks-rd's audit fan-out
42
42
  # produces rd/perf-baseline.md; QA references it by path in the test report body.
@@ -45,14 +45,14 @@ grep -E "rd/perf-baseline\\.md|perf-baseline" .peaks/_runtime/<sessionId>/qa/tes
45
45
  # Empty → BLOCKED: the test report must cite where perf evidence lives.
46
46
  ```
47
47
 
48
- **Peaks-Cli Gate B — After test-report write (MUST contain execution results):**
48
+ **Peaks-Loop Gate B — After test-report write (MUST contain execution results):**
49
49
  ```bash
50
50
  ls .peaks/_runtime/<sessionId>/qa/test-reports/<rid>.md
51
51
  grep -c "pass\|fail\|blocked" .peaks/_runtime/<sessionId>/qa/test-reports/<rid>.md
52
52
  # Zero → the report is empty/template-only. Tests were not executed.
53
53
  ```
54
54
 
55
- **Peaks-Cli Gate C — Before issuing verdict:**
55
+ **Peaks-Loop Gate C — Before issuing verdict:**
56
56
  ```bash
57
57
  ls .peaks/_runtime/<sessionId>/qa/test-cases/<rid>.md \
58
58
  .peaks/_runtime/<sessionId>/qa/test-reports/<rid>.md \
@@ -62,7 +62,7 @@ ls .peaks/_runtime/<sessionId>/qa/test-cases/<rid>.md \
62
62
  # QA cites them by reference from the test-report body (see Gates A3/A4).
63
63
  ```
64
64
 
65
- **Peaks-Cli Gate E — Acceptance coverage:**
65
+ **Peaks-Loop Gate E — Acceptance coverage:**
66
66
  ```bash
67
67
  peaks scan acceptance-coverage --rid <rid> --project <repo> --session-id <session-id> --json
68
68
  # Expected: ok=true. exit 0.
@@ -70,13 +70,13 @@ peaks scan acceptance-coverage --rid <rid> --project <repo> --session-id <sessio
70
70
  # invalidReferences[] non-empty → BLOCKED.
71
71
  ```
72
72
 
73
- **Peaks-Cli Gate F — QA artifact body has no unfilled placeholders:**
73
+ **Peaks-Loop Gate F — QA artifact body has no unfilled placeholders:**
74
74
  ```bash
75
75
  peaks request lint <rid> --role qa --project <repo> --session-id <session-id> --json
76
76
  # Expected: ok=true. exit 0.
77
77
  ```
78
78
 
79
- **Peaks-Cli Gate D — Frontend browser evidence (BLOCKING when frontend is in scope):**
79
+ **Peaks-Loop Gate D — Frontend browser evidence (BLOCKING when frontend is in scope):**
80
80
  ```bash
81
81
  ls .peaks/_runtime/<sessionId>/qa/screenshots/*.png 2>&1
82
82
  # Expected: one or more .png files
@@ -9,7 +9,7 @@ QA must be involved before refactor implementation.
9
9
  - baseline report;
10
10
  - acceptance checks;
11
11
  - API validation evidence when API behavior is in scope;
12
- - Playwright MCP browser E2E evidence when a frontend exists or UI is in scope (the LLM checks its tool list for `mcp__playwright__*`; if absent, the user installs via `claude mcp add playwright -- npx @playwright/mcp@latest` for Claude Code, or the IDE-native install command otherwise — peaks-cli no longer auto-installs as of slice #016; capture with `browser_snapshot`, `browser_take_screenshot`, `browser_console_messages`, `browser_network_requests`), with mandatory visible-browser confirmation;
12
+ - Playwright MCP browser E2E evidence when a frontend exists or UI is in scope (the LLM checks its tool list for `mcp__playwright__*`; if absent, the user installs via `claude mcp add playwright -- npx @playwright/mcp@latest` for Claude Code, or the IDE-native install command otherwise — peaks-loop no longer auto-installs as of slice #016; capture with `browser_snapshot`, `browser_take_screenshot`, `browser_console_messages`, `browser_network_requests`), with mandatory visible-browser confirmation;
13
13
  - security check evidence;
14
14
  - performance check evidence;
15
15
  - validation report;
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: peaks-rd
3
- description: Research and development skill for Peaks. Use for engineering analysis, refactor planning, project scanning, code standards, unit-test coverage gates, implementation contracts, task graphs, and RD handoffs. Always use this for Peaks-Cli refactor workflows.
3
+ description: Research and development skill for Peaks. Use for engineering analysis, refactor planning, project scanning, code standards, unit-test coverage gates, implementation contracts, task graphs, and RD handoffs. Always use this for Peaks-Loop refactor workflows.
4
4
  ---
5
5
 
6
6
  ## Single-scope-axis naming convention
@@ -30,9 +30,9 @@ Cross-references: Slice 1 PRD §AC-1 / `tests/unit/skills/karpathy-prompt-inject
30
30
 
31
31
  The canonical scope dir for this request is provided as `envelope.data.scopeDir` (absolute path). Write all reviewable files under that path. **NEVER** construct paths like `.peaks/_runtime/<sessionId>/...` from frontmatter — the path has already been resolved by the CLI.
32
32
 
33
- # Peaks-Cli RD
33
+ # Peaks-Loop RD
34
34
 
35
- Peaks-Cli RD owns engineering analysis, implementation planning, and refactor execution contracts.
35
+ Peaks-Loop RD owns engineering analysis, implementation planning, and refactor execution contracts.
36
36
 
37
37
  ## Hard contracts for browser self-test (BLOCKING — read before any browser_take_screenshot / login flow)
38
38
 
@@ -95,7 +95,7 @@ After `peaks scan libraries` lands the dependency list under `## Library version
95
95
 
96
96
  ## GStack integration and code dry-runs
97
97
 
98
- Map gstack stages to Peaks-Cli RD risk matrices, task graphs, and slice contracts. Adapt gstack concepts into Peaks-Cli artifacts; do not invoke gstack commands as runtime deps. Dry-run before planning, after each slice, before handoff.
98
+ Map gstack stages to Peaks-Loop RD risk matrices, task graphs, and slice contracts. Adapt gstack concepts into Peaks-Loop artifacts; do not invoke gstack commands as runtime deps. Dry-run before planning, after each slice, before handoff.
99
99
 
100
100
  → see `references/rd-gstack-integration.md` for the full integration contract.
101
101
 
@@ -107,7 +107,7 @@ Before every code or mock change, RD must write and then enforce a red-line scop
107
107
  2. name adjacent surfaces explicitly out of scope (list pages, delete/update flows, unrelated API endpoints, existing data records, auth, permissions, shared runtime config);
108
108
  3. reject any implementation that modifies, deletes, mocks, or replaces out-of-scope behavior just to make validation pass;
109
109
  4. for API/mock work, mock only the exact request path and method required by the approved slice;
110
- 5. before handoff, run `peaks scan diff-vs-scope --rid <rid> --project <repo>` (Peaks-Cli Gate B8). The CLI auto-allows test files and `.peaks/` artifacts.
110
+ 5. before handoff, run `peaks scan diff-vs-scope --rid <rid> --project <repo>` (Peaks-Loop Gate B8). The CLI auto-allows test files and `.peaks/` artifacts.
111
111
 
112
112
  ## Mandatory tech-doc output (RD-side)
113
113
 
@@ -133,7 +133,7 @@ The THREE review activities run in parallel via `peaks sub-agent dispatch <role>
133
133
 
134
134
  > **v2.12.0 collapse (Group A):** the 5-way fan-out moved `security-reviewer` + `perf-baseline-reviewer` into standalone audit skills (`peaks-security-audit` + `peaks-perf-audit`). → `references/v2-12-fanout-collapse.md`.
135
135
 
136
- > **v2.15.0+:** 技术决策 AI 据 prd 业务场景块自决,user 不参与;存量项目无 UT,改 A 前跑 `peaks impact scan`(G13);fork 场景 tech-doc 列上游基线+业务 patch 集(G11)。详见 `.peaks/memory/peaks-cli-user-role-and-tech-decision.md`。
136
+ > **v2.15.0+:** 技术决策 AI 据 prd 业务场景块自决,user 不参与;存量项目无 UT,改 A 前跑 `peaks impact scan`(G13);fork 场景 tech-doc 列上游基线+业务 patch 集(G11)。详见 `.peaks/memory/peaks-loop-user-role-and-tech-decision.md`。
137
137
 
138
138
  > **Slice 2026-06-24-efficiency-4p-bundle / G4 (P1.3) — karpathy-skip policy authoritative.** Decision table at `src/services/rd/reviewer-dispatch-policy.ts` (`shouldDispatchKarpathy`, `reviewerListFor`). Pinned by `tests/unit/rd/karpathy-skip-on-config-docs-chore.test.ts`.
139
139
 
@@ -141,7 +141,7 @@ The THREE review activities run in parallel via `peaks sub-agent dispatch <role>
141
141
 
142
142
  The `karpathy-reviewer` sub-agent is a **hard gate** for `rd:qa-handoff`. Per `andrej-karpathy-skills:karpathy-guidelines` §1 Think Before Coding ("state your assumptions") + §3 Surgical Changes ("touch only what the user asked"), `peaks request transition --state qa-handoff` is BLOCKED by the CLI gate until `.peaks/_runtime/<sessionId>/rd/karpathy-review.md` exists with the `## Karpathy-Gate` header and at least one of the 4 guideline section markers. The file is enforced by the `KARPATHY_REVIEW` prerequisite in `src/services/artifacts/artifact-prerequisites.ts` (added in Slice 5). The escape hatch is `peaks request transition --allow-incomplete --confirm` (assisted mode). The companion `peaks scan karpathy` CLI is a structural scanner for the same file (`src/services/scan/karpathy-service.ts`); the semantic review is the sub-agent's job.
143
143
 
144
- ### Peaks-Cli Gate C — type-specific RD evidence
144
+ ### Peaks-Loop Gate C — type-specific RD evidence
145
145
 
146
146
  The CLI gate at `rd:qa-handoff` is the authoritative check. Missing any required file → DO NOT attempt the qa-handoff transition; CLI will reject with `PREREQUISITES_MISSING`.
147
147
 
@@ -170,9 +170,9 @@ For non-trivial RD changes, use OpenSpec when the project already has `openspec/
170
170
 
171
171
  Create or update `openspec/changes/<change-id>/proposal.md`, `design.md`, `tasks.md`, and `specs/**/spec.md` before implementation slices begin. If the repository uses a different existing OpenSpec layout, follow that layout and record the file paths in the RD handoff.
172
172
 
173
- OpenSpec artifacts are durable project specification files, not Peaks-Cli runtime swarm artifacts. They may live in the target repository root under `openspec/changes/...`. Swarm/runtime outputs such as task graphs, worker briefs, worker reports, reducer reports, scan reports, validation evidence, and compact handoffs must remain in the configured Peaks-Cli artifact workspace outside the target repository.
173
+ OpenSpec artifacts are durable project specification files, not Peaks-Loop runtime swarm artifacts. They may live in the target repository root under `openspec/changes/...`. Swarm/runtime outputs such as task graphs, worker briefs, worker reports, reducer reports, scan reports, validation evidence, and compact handoffs must remain in the configured Peaks-Loop artifact workspace outside the target repository.
174
174
 
175
- Peaks-Cli PRD/RD/QA gates remain authoritative: OpenSpec structures the durable spec, while Peaks-Cli artifacts still carry role handoffs, coverage gates, QA evidence, swarm coordination, and execution state.
175
+ Peaks-Loop PRD/RD/QA gates remain authoritative: OpenSpec structures the durable spec, while Peaks-Loop artifacts still carry role handoffs, coverage gates, QA evidence, swarm coordination, and execution state.
176
176
 
177
177
  → see `references/openspec-cli.md` for the CLI recipes.
178
178
 
@@ -190,7 +190,7 @@ When RD work creates a frontend application and the user has not specified a tec
190
190
 
191
191
  ## Artifact and standards output
192
192
 
193
- When project identification or scanning produces reports, matrices, maps, plans, or validation files, write them under the configured Peaks-Cli artifact workspace (default: `.peaks/_runtime/<sessionId>/rd/`). Do not default to a git-backed artifact repository or external artifact sync. Route standards mutations through `peaks standards init/update`; do not hand-write. Do not update user-global `~/.claude/rules/**` from this workflow.
193
+ When project identification or scanning produces reports, matrices, maps, plans, or validation files, write them under the configured Peaks-Loop artifact workspace (default: `.peaks/_runtime/<sessionId>/rd/`). Do not default to a git-backed artifact repository or external artifact sync. Route standards mutations through `peaks standards init/update`; do not hand-write. Do not update user-global `~/.claude/rules/**` from this workflow.
194
194
 
195
195
  → see `references/artifact-and-standards-output.md` for the full contract.
196
196
 
@@ -206,17 +206,17 @@ The handoff artifact carries **mandatory YAML frontmatter** (`requestId`, `scope
206
206
 
207
207
  ## Codegraph project analysis
208
208
 
209
- Codegraph is local project-analysis evidence, scoped to red-line scope boundaries (changed files / symbols) and read via `peaks codegraph affected --project <path> <changed-files...> --json`. Peaks-Cli RD gates remain authoritative; codegraph is untrusted supporting evidence. Do not let codegraph output drive scope, design, or QA verdict decisions, and never mutate agent settings, Claude settings, or hooks from codegraph. Do not commit `.codegraph/` artifacts or persist generated `.codegraph/` databases into git. Codegraph context is written to `.peaks/_runtime/<sessionId>/rd/codegraph-context.md` for handoff to QA / TXT.
209
+ Codegraph is local project-analysis evidence, scoped to red-line scope boundaries (changed files / symbols) and read via `peaks codegraph affected --project <path> <changed-files...> --json`. Peaks-Loop RD gates remain authoritative; codegraph is untrusted supporting evidence. Do not let codegraph output drive scope, design, or QA verdict decisions, and never mutate agent settings, Claude settings, or hooks from codegraph. Do not commit `.codegraph/` artifacts or persist generated `.codegraph/` databases into git. Codegraph context is written to `.peaks/_runtime/<sessionId>/rd/codegraph-context.md` for handoff to QA / TXT.
210
210
 
211
211
  ## Matt Pocock skills integration
212
212
 
213
- Matt Pocock skills (`diagnose` / `triage` / `tdd` / `improve-codebase-architecture` / `prototype`): engineering references only. Inspect before applying; Peaks-Cli RD gates remain authoritative. Understand Anything: `peaks understand status/show --json`. Codegraph: local analysis only, never commit `.codegraph/` artifacts. Other external resources: `peaks capabilities --source access-repo/mcp-server --json` for capability discovery.
213
+ Matt Pocock skills (`diagnose` / `triage` / `tdd` / `improve-codebase-architecture` / `prototype`): engineering references only. Inspect before applying; Peaks-Loop RD gates remain authoritative. Understand Anything: `peaks understand status/show --json`. Codegraph: local analysis only, never commit `.codegraph/` artifacts. Other external resources: `peaks capabilities --source access-repo/mcp-server --json` for capability discovery.
214
214
 
215
215
  → see `references/external-references.md` + `references/matt-pocock-integration.md` + `references/codegraph-project-analysis.md`.
216
216
 
217
217
  ## Boundaries
218
218
 
219
- Do not bypass PRD/QA artifacts. Do not install hooks, agents, MCP, or settings. Ask the Peaks-Cli CLI to handle runtime side effects.
219
+ Do not bypass PRD/QA artifacts. Do not install hooks, agents, MCP, or settings. Ask the Peaks-Loop CLI to handle runtime side effects.
220
220
 
221
221
  Do not bypass the parallel review fan-out when the slice has a code-review / qa-test-cases / karpathy-review surface — see `## Parallel review fan-out` above. The three review activities are fan-out, not sequential; sequential re-implementation of the same logic by the main RD loop defeats the wall-clock benefit and is treated as a red-line violation.
222
222
 
@@ -1,6 +1,6 @@
1
1
  # Artifact and standards output (RD)
2
2
 
3
- > Body of `## Artifact and standards output`. When project identification or scanning produces reports, matrices, maps, plans, or validation files, write them under the configured Peaks-Cli artifact workspace. By default, use local non-git storage at `.peaks/_runtime/<sessionId>/rd/` in the target project or the Peaks-Cli CLI-provided local workspace. If the artifact workspace is unknown, create or request `.peaks/_runtime/<sessionId>/` before writing generated outputs. Use one session directory consistently so generated outputs stay grouped.
3
+ > Body of `## Artifact and standards output`. When project identification or scanning produces reports, matrices, maps, plans, or validation files, write them under the configured Peaks-Loop artifact workspace. By default, use local non-git storage at `.peaks/_runtime/<sessionId>/rd/` in the target project or the Peaks-Loop CLI-provided local workspace. If the artifact workspace is unknown, create or request `.peaks/_runtime/<sessionId>/` before writing generated outputs. Use one session directory consistently so generated outputs stay grouped.
4
4
 
5
5
  Do not default to a git-backed artifact repository, external artifact sync, or automatic commits for intermediate artifacts. Git inclusion or sync requires explicit user confirmation or an active profile that clearly authorizes it. Browser evidence must be sanitized before retention: do not store login URLs, cookies, headers, tokens, storage state, browser traces, or screenshots/logs containing PII or SSO/MFA material.
6
6
 
@@ -2,4 +2,4 @@
2
2
 
3
3
  > Body of `## Codegraph project analysis`. RD may use `peaks codegraph affected --project <path> <changed-files...> --json` as local project-analysis evidence to inform red-line scope boundaries before writing tech-doc or starting implementation. Treat the output as untrusted supporting evidence — verify against the actual code before relying on it.
4
4
 
5
- Do not run upstream installer flows, mutate agent settings, or commit `.codegraph/` artifacts. Peaks-Cli RD gates remain authoritative for handoff and acceptance.
5
+ Do not run upstream installer flows, mutate agent settings, or commit `.codegraph/` artifacts. Peaks-Loop RD gates remain authoritative for handoff and acceptance.
@@ -1,11 +1,11 @@
1
1
  # External references (RD)
2
2
 
3
- > Body of `## External references`. **Matt Pocock skills** (`diagnose`, `triage`, `tdd`, `improve-codebase-architecture`, `prototype`): Engineering references only. Inspect before applying; Peaks-Cli RD gates remain authoritative.
3
+ > Body of `## External references`. **Matt Pocock skills** (`diagnose`, `triage`, `tdd`, `improve-codebase-architecture`, `prototype`): Engineering references only. Inspect before applying; Peaks-Loop RD gates remain authoritative.
4
4
 
5
5
  **Understand Anything**: Consume via `peaks understand status/show --json`. Fall back to `peaks codegraph context` or local project scan when absent.
6
6
 
7
7
  **Codegraph**: Optional local analysis via `peaks codegraph context/affected`. Output as untrusted supporting evidence; never commit `.codegraph/` artifacts.
8
8
 
9
- **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.
9
+ **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-Loop RD gates remain authoritative.
10
10
 
11
- **OpenSpec CLI**: Route through Peaks-Cli CLI (`peaks openspec show/to-rd/render`). Do not hand-edit `openspec/changes/**`. Recipes: `references/openspec-cli.md`.
11
+ **OpenSpec CLI**: Route through Peaks-Loop CLI (`peaks openspec show/to-rd/render`). Do not hand-edit `openspec/changes/**`. Recipes: `references/openspec-cli.md`.
@@ -1,2 +1,2 @@
1
1
  # Canonical karpathy-reviewer prompt lives at: agents/karpathy-reviewer.md
2
- # This file is a 2-line pointer. Edit the canonical file instead. (peaks-cli 2.0 rules convention)
2
+ # This file is a 2-line pointer. Edit the canonical file instead. (peaks-loop 2.0 rules convention)
@@ -39,4 +39,4 @@ peaks perf baseline --project <repo> --apply --reason "capturing baseline for Ga
39
39
 
40
40
  **Idempotency:** re-running `peaks perf baseline --apply` on a session where the file already exists is a no-op (the CLI does not overwrite hand-edited content). This is the normal RD retry pattern (re-measurement, threshold adjustment, etc.). If the RD really does want to overwrite, delete the file first and re-run.
41
41
 
42
- **The role of the CLI vs. the actual measurement:** the CLI is the *scaffolding*. It writes the file, exposes the path, and keeps the file's structure stable so QA can rely on it. The CLI does NOT call lighthouse / k6 / autocannon — those are project-shape dependent and the right tool is a project-local concern, not a peaks-cli concern. The CLI is justified (4-grounds check): it gates the QA-side decision on a stable artefact, it requires --apply for a destructive write, and it is invokable from a hook on session init. It is *not* a machine-enforced gate that prose cannot enforce — the measurement is the RD's responsibility.
42
+ **The role of the CLI vs. the actual measurement:** the CLI is the *scaffolding*. It writes the file, exposes the path, and keeps the file's structure stable so QA can rely on it. The CLI does NOT call lighthouse / k6 / autocannon — those are project-shape dependent and the right tool is a project-local concern, not a peaks-loop concern. The CLI is justified (4-grounds check): it gates the QA-side decision on a stable artefact, it requires --apply for a destructive write, and it is invokable from a hook on session init. It is *not* a machine-enforced gate that prose cannot enforce — the measurement is the RD's responsibility.
@@ -1,6 +1,6 @@
1
1
  ## Matt Pocock skills integration (RD)
2
2
 
3
- > Body of `## Matt Pocock skills integration`. Engineering methods from `mattpocock/skills` can inform RD work but never replace Peaks-Cli gates. Inspect upstream skill content before applying any method.
3
+ > Body of `## Matt Pocock skills integration`. Engineering methods from `mattpocock/skills` can inform RD work but never replace Peaks-Loop gates. Inspect upstream skill content before applying any method.
4
4
 
5
5
  - `diagnose` — root-cause investigation before fixing
6
6
  - `triage` — prioritize bug surface area
@@ -8,4 +8,4 @@
8
8
  - `improve-codebase-architecture` — opportunistic refactor framing
9
9
  - `prototype` — throwaway exploration before committing to a slice
10
10
 
11
- These are references only; Peaks-Cli RD gates remain authoritative for handoff, acceptance, and slice closure.
11
+ These are references only; Peaks-Loop RD gates remain authoritative for handoff, acceptance, and slice closure.
@@ -1,11 +1,11 @@
1
1
  # OCR (Open Code Review) integration
2
2
 
3
3
  > Soft-optional second-opinion code review for peaks-rd Gate B3.
4
- > Mirrors the ECC 64-agents pattern (spec §7.2): peaks-cli ships
4
+ > Mirrors the ECC 64-agents pattern (spec §7.2): peaks-loop ships
5
5
  > `@alibaba-group/open-code-review` as an **`optionalDependency`**
6
6
  > (was promoted to `dependencies` in 2.0.1 and reverted in 2.0.3
7
7
  > because its postinstall downloads a Go binary via HTTPS and would
8
- > otherwise abort `npm i -g peaks-cli` in restricted/proxied
8
+ > otherwise abort `npm i -g peaks-loop` in restricted/proxied
9
9
  > environments). The LLM endpoint config still lives under
10
10
  > `peaksConfig.ocr.llm` in the user's `~/.peaks/config.json` (single
11
11
  > source of truth, user-managed). When the user installs + configures
@@ -40,10 +40,10 @@ ships without the second opinion.
40
40
  ## Install
41
41
 
42
42
  `@alibaba-group/open-code-review` is an **`optionalDependency`** of
43
- peaks-cli 2.0.3+ (was a required `dependency` in 2.0.1/2.0.2; reverted
43
+ peaks-loop 2.0.3+ (was a required `dependency` in 2.0.1/2.0.2; reverted
44
44
  because the postinstall downloads a Go binary via HTTPS, which fails in
45
45
  restricted/proxied environments and would otherwise abort
46
- `npm i -g peaks-cli`). peaks-cli does NOT auto-install it. To enable
46
+ `npm i -g peaks-loop`). peaks-loop does NOT auto-install it. To enable
47
47
  the second-opinion review:
48
48
 
49
49
  ```bash
@@ -61,17 +61,17 @@ Five possible states:
61
61
 
62
62
  | state | Meaning | Recovery |
63
63
  |---|---|---|
64
- | `ready` | Installed + binary downloaded + peaks-cli's `peaksConfig.ocr.llm` valid | Nothing — `run-ocr` will work. |
65
- | `package-missing` | npm dep not installed (peaks-cli 2.0.3+ ships with ocr as an `optionalDependency`, so the common cause is the user has not installed it yet, or it was removed from node_modules) | `npm i -g @alibaba-group/open-code-review` (peaks-cli no longer auto-installs it; under pnpm also run `pnpm approve-builds @alibaba-group/open-code-review`) |
64
+ | `ready` | Installed + binary downloaded + peaks-loop's `peaksConfig.ocr.llm` valid | Nothing — `run-ocr` will work. |
65
+ | `package-missing` | npm dep not installed (peaks-loop 2.0.3+ ships with ocr as an `optionalDependency`, so the common cause is the user has not installed it yet, or it was removed from node_modules) | `npm i -g @alibaba-group/open-code-review` (peaks-loop no longer auto-installs it; under pnpm also run `pnpm approve-builds @alibaba-group/open-code-review`) |
66
66
  | `binary-missing` | npm dep present but Go binary did not download | `pnpm approve-builds @alibaba-group/open-code-review`, OR run `node node_modules/@alibaba-group/open-code-review/scripts/install.js`, OR manually fetch from https://github.com/alibaba/open-code-review/releases and place the binary at the path shown in `nextActions[2]`. |
67
67
  | `config-missing` | binary present but `peaksConfig.ocr.llm` is empty or partial | See "Configure" below. |
68
68
  | `detection-failed` | Unexpected error during detection | Inspect stderr; re-run probe. |
69
69
 
70
- ## Configure (one-time, per user) — peaks-cli does NOT auto-configure
70
+ ## Configure (one-time, per user) — peaks-loop does NOT auto-configure
71
71
 
72
- The LLM endpoint config is **user-maintained inside peaks-cli's own
72
+ The LLM endpoint config is **user-maintained inside peaks-loop's own
73
73
  config** at `~/.peaks/config.json` under the `ocr.llm` key. The user
74
- is the only party that touches their LLM token / URL / model. peaks-cli
74
+ is the only party that touches their LLM token / URL / model. peaks-loop
75
75
  never auto-writes the config and never writes `~/.opencodereview/config.json`.
76
76
 
77
77
  ```bash
@@ -105,7 +105,7 @@ env vars** (ocr's highest-priority config path). The mapping is:
105
105
  | `authHeader` | `OCR_LLM_AUTH_HEADER` | One of `authorization` (default Bearer), `x-api-key` (for `sk-ant-*` keys), or `bearer` |
106
106
 
107
107
  The `~/.opencodereview/config.json` file the user might have set up
108
- for 2.0.0 is no longer consulted by peaks-cli. The user may delete it
108
+ for 2.0.0 is no longer consulted by peaks-loop. The user may delete it
109
109
  at their discretion — the ocr subprocess ignores the file when peaks-
110
110
  cli's env vars are present (and the env-var surface is highest priority).
111
111
 
@@ -171,7 +171,7 @@ even when ocr is not ready or the subprocess fails. The envelope
171
171
  `ok` field carries the success signal; the caller (peaks-rd) is
172
172
  expected to pattern-match on `data.state` and proceed without the
173
173
  second opinion if needed. This matches the ECC 64-agents
174
- soft-fail policy and the peaks-cli "minimal user operation"
174
+ soft-fail policy and the peaks-loop "minimal user operation"
175
175
  tenet — missing ocr should never block a slice.
176
176
 
177
177
  ## Security
@@ -181,12 +181,12 @@ tenet — missing ocr should never block a slice.
181
181
  tool you opt into: don't point it at a free public endpoint
182
182
  for proprietary code; use a vendor / self-hosted endpoint with
183
183
  appropriate data controls.
184
- - peaks-cli does NOT auto-configure ocr. Your `ocr.llm.authToken`
184
+ - peaks-loop does NOT auto-configure ocr. Your `ocr.llm.authToken`
185
185
  is yours. Rotate as needed. The token is stored only in the
186
186
  user-layer `~/.peaks/config.json` (project layer rejects writes
187
187
  to any key matching `isSensitiveConfigPath`), and
188
188
  `peaks config get` redacts it as `***`.
189
- - peaks-cli's wrapper records ocr's `stdout` verbatim in the
189
+ - peaks-loop's wrapper records ocr's `stdout` verbatim in the
190
190
  envelope (and in `code-review.md` when peaks-rd merges
191
191
  findings). Don't put secrets in your code being reviewed.
192
192
  - The `peaks code-review config-template` snippet embeds the
@@ -199,10 +199,10 @@ These are the actual failure modes the wrapper has been
199
199
  dogfooded against:
200
200
 
201
201
  1. **Network blocked from GitHub Releases** during postinstall →
202
- `binary-missing`. peaks-cli still runs cleanly because ocr
202
+ `binary-missing`. peaks-loop still runs cleanly because ocr
203
203
  is detected as not-ready; user manually fetches the binary
204
204
  and places it at `nextActions[2]`'s path.
205
- 2. **pnpm-installed peaks-cli** → ocr postinstall blocked by
205
+ 2. **pnpm-installed peaks-loop** → ocr postinstall blocked by
206
206
  pnpm's safe-by-default policy → `binary-missing`. Recover
207
207
  with `pnpm approve-builds @alibaba-group/open-code-review`.
208
208
  3. **No / partial LLM config** → `config-missing` with
@@ -213,17 +213,17 @@ dogfooded against:
213
213
  wrapper soft-fails (`ok: false`, `warnings[0]` includes the
214
214
  exit code, `stderr` carries ocr's own error message).
215
215
  5. **User 2.0.0 → 2.0.1 migration** — they configured
216
- `~/.opencodereview/config.json` for 2.0.0; peaks-cli 2.0.1
216
+ `~/.opencodereview/config.json` for 2.0.0; peaks-loop 2.0.1
217
217
  no longer reads that file. They paste the same values into
218
- `~/.peaks/config.json` under `ocr.llm` (peaks-cli handles the
218
+ `~/.peaks/config.json` under `ocr.llm` (peaks-loop handles the
219
219
  camelCase conversion in the template).
220
220
 
221
221
  ## See also
222
222
 
223
223
  - ocr upstream: https://github.com/alibaba/open-code-review
224
- - peaks-cli source: `src/services/code-review/ocr-service.ts`,
224
+ - peaks-loop source: `src/services/code-review/ocr-service.ts`,
225
225
  `src/cli/commands/code-review-commands.ts`
226
- - peaks-cli config schema: `src/services/config/config-types.ts`
226
+ - peaks-loop config schema: `src/services/config/config-types.ts`
227
227
  (`OcrLlmConfig`, `OcrConfig`, `PeaksConfig.ocr?`)
228
228
  - ECC 64-agents soft-optional pattern (mirrored):
229
229
  `src/services/agent/ecc-agent-service.ts`
@@ -2,7 +2,7 @@
2
2
 
3
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
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.
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-loop 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.
6
6
 
7
7
  ## Loading an existing OpenSpec change as RD input
8
8
 
@@ -55,7 +55,7 @@ claude mcp add context7 -- npx @upstash/context7-mcp
55
55
  # Restart the IDE after install; the runtime picks up the new server only after a fresh process.
56
56
  ```
57
57
 
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.
58
+ peaks-loop 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.
59
59
 
60
60
  ## Boundary
61
61
 
@@ -2,15 +2,15 @@
2
2
 
3
3
  > Body of `## GStack integration and code dry-runs`. Use gstack as a concrete engineering workflow reference for `Think → Plan → Build → Review → Test → Ship → Reflect`:
4
4
 
5
- - map plan engineering review to Peaks-Cli RD risk matrices, task graphs, and slice contracts;
5
+ - map plan engineering review to Peaks-Loop RD risk matrices, task graphs, and slice contracts;
6
6
  - map build/review discipline to strict spec-first implementation and code-review gates;
7
7
  - map investigate/careful/guard concepts to root-cause analysis, risky-action confirmation, and scoped edit boundaries;
8
- - adapt gstack concepts into Peaks-Cli artifacts rather than invoking gstack commands as runtime dependencies.
8
+ - adapt gstack concepts into Peaks-Loop artifacts rather than invoking gstack commands as runtime dependencies.
9
9
 
10
- When Peaks-Cli RD produces or changes code, dry-run repeatedly instead of only during preflight:
10
+ When Peaks-Loop RD produces or changes code, dry-run repeatedly instead of only during preflight:
11
11
 
12
12
  1. run standards dry-runs before planning or implementation;
13
- 2. run the relevant Peaks-Cli dry-run again after each meaningful implementation slice or standards-affecting decision;
13
+ 2. run the relevant Peaks-Loop dry-run again after each meaningful implementation slice or standards-affecting decision;
14
14
  3. after implementation, run required unit tests, code review, and security review before any completion claim;
15
- 4. only after those checks pass, run the relevant Peaks-Cli dry-run before handoff, review, or retention-boundary work;
15
+ 4. only after those checks pass, run the relevant Peaks-Loop dry-run before handoff, review, or retention-boundary work;
16
16
  5. record commands, results, coverage evidence, reviewer/security findings, dry-run result, and remaining action in the RD handoff capsule.
@@ -90,7 +90,7 @@ peaks codegraph affected --project <repo> <changed-files...> --json
90
90
 
91
91
  # 6. record red-line scope, slice contract, coverage status into the RD artifact, then implement
92
92
 
93
- # 6.5 BEFORE tech-doc: verify EVERY path in the tech-doc against actual project structure (Peaks-Cli Gate A2)
93
+ # 6.5 BEFORE tech-doc: verify EVERY path in the tech-doc against actual project structure (Peaks-Loop Gate A2)
94
94
  # ls every directory path in the tech-doc — zero "No such file" allowed
95
95
  # This is the most common RD failure mode. Do not skip it.
96
96
 
@@ -159,21 +159,21 @@ peaks codegraph affected --project <repo> <changed-files...> --json
159
159
  # → `peaks request transition --state qa-handoff` returns `code: PREREQUISITES_MISSING`.
160
160
  # Escape hatch (assisted mode): `--allow-incomplete --confirm`.
161
161
 
162
- # 6.6 BEFORE implementation: verify CLAUDE.md + .claude/rules/ exist (Peaks-Cli Gate A3)
162
+ # 6.6 BEFORE implementation: verify CLAUDE.md + .claude/rules/ exist (Peaks-Loop Gate A3)
163
163
  # Missing standards files → run `peaks standards init --project .` first
164
164
  # Without project rules, security review and code review triggers won't fire.
165
165
 
166
166
  # 7. AFTER implementation, BEFORE QA handoff — RUN THESE GATES:
167
- # Peaks-Cli Gate B2: unit tests exist and pass for the changed surface → npx vitest run --changed (or project equivalent; the changed-only mode is the peaks slice check default as of run 017; use --run-tests for the full suite, or invoke /peaks-solo-test to run the full suite standalone)
168
- # Peaks-Cli Gate B3: code review evidence → .peaks/_runtime/<sessionId>/rd/code-review.md
169
- # Peaks-Cli Gate B4: security review evidence → .peaks/_runtime/<sessionId>/rd/security-review.md
170
- # Peaks-Cli Gate B5 (NEW): RD artifact body has no unfilled placeholders.
167
+ # Peaks-Loop Gate B2: unit tests exist and pass for the changed surface → npx vitest run --changed (or project equivalent; the changed-only mode is the peaks slice check default as of run 017; use --run-tests for the full suite, or invoke /peaks-solo-test to run the full suite standalone)
168
+ # Peaks-Loop Gate B3: code review evidence → .peaks/_runtime/<sessionId>/rd/code-review.md
169
+ # Peaks-Loop Gate B4: security review evidence → .peaks/_runtime/<sessionId>/rd/security-review.md
170
+ # Peaks-Loop Gate B5 (NEW): RD artifact body has no unfilled placeholders.
171
171
  peaks request lint <rid> --role rd --project <repo> --session-id <session-id> --json
172
- # Peaks-Cli Gate B6 (NEW): declared --type still matches the actual diff after implementation.
172
+ # Peaks-Loop Gate B6 (NEW): declared --type still matches the actual diff after implementation.
173
173
  peaks scan request-type-sanity --project <repo> --type <type> --json
174
- # Peaks-Cli Gate B7 (NEW, repair cycles only): we have not exceeded the 3-cycle cap.
174
+ # Peaks-Loop Gate B7 (NEW, repair cycles only): we have not exceeded the 3-cycle cap.
175
175
  peaks request repair-status <rid> --project <repo> --session-id <session-id> --json
176
- # Peaks-Cli Gate B8 (NEW): every changed file matches the RD red-line scope (no out-of-bounds writes).
176
+ # Peaks-Loop Gate B8 (NEW): every changed file matches the RD red-line scope (no out-of-bounds writes).
177
177
  peaks scan diff-vs-scope --rid <rid> --project <repo> --session-id <session-id> --json
178
178
  # All six non-zero → BLOCKED. Fix and re-check before attempting the qa-handoff transition.
179
179
 
@@ -1,6 +1,6 @@
1
1
  # Project standards preflight (RD)
2
2
 
3
- > Body of `## Project standards preflight`. Before RD planning or implementation work in a code repository, call the Peaks-Cli CLI:
3
+ > Body of `## Project standards preflight`. Before RD planning or implementation work in a code repository, call the Peaks-Loop CLI:
4
4
 
5
5
  - `peaks standards init --project <path> --dry-run`
6
6
  - `peaks standards update --project <path> --dry-run`
@@ -1,4 +1,4 @@
1
- # Peaks-Cli RD transition verification gates
1
+ # Peaks-Loop RD transition verification gates
2
2
 
3
3
  > Extracted from `skills/peaks-rd/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 "Transition verification gates" section that was previously inline; nothing was paraphrased, just relocated.
4
4
 
@@ -17,14 +17,14 @@ You cannot declare a phase complete from memory. Each gate below is a `ls` or `g
17
17
  >
18
18
  > The escape hatch `--allow-incomplete --reason "<text>"` still exists for one-off exceptions; the bypass is recorded in the artifact transition note.
19
19
 
20
- **Peaks-Cli Gate A — After project-scan read (before any implementation):**
20
+ **Peaks-Loop Gate A — After project-scan read (before any implementation):**
21
21
  ```bash
22
22
  ls .peaks/_runtime/<sessionId>/rd/project-scan.md
23
23
  # Expected output: .peaks/_runtime/<sessionId>/rd/project-scan.md
24
24
  # "No such file" → STOP, create the project-scan first. Do not write code.
25
25
  ```
26
26
 
27
- **Peaks-Cli Gate A2 — Before tech-doc write: project structure verified (PATH CORRECTNESS — CRITICAL):**
27
+ **Peaks-Loop Gate A2 — Before tech-doc write: project structure verified (PATH CORRECTNESS — CRITICAL):**
28
28
  ```bash
29
29
  # Verify EVERY file path and directory in the tech-doc exists in the actual project.
30
30
  # Do not assume paths. Do not guess directory structures. Open the files and verify.
@@ -36,7 +36,7 @@ ls <every-single-directory-path-in-tech-doc> 2>&1 | grep -c "No such file"
36
36
  # breaks the implementation, and forces the user to correct the engineer.
37
37
  ```
38
38
 
39
- **Peaks-Cli Gate A3 — Before implementation: project standards files exist (CLAUDE.md + .claude/rules/):**
39
+ **Peaks-Loop Gate A3 — Before implementation: project standards files exist (CLAUDE.md + .claude/rules/):**
40
40
  ```bash
41
41
  ls CLAUDE.md .claude/rules/common/coding-style.md .claude/rules/common/code-review.md .claude/rules/common/security.md 2>&1 | grep -c "No such file"
42
42
  # Expected: 0 (all four files exist)
@@ -45,14 +45,14 @@ ls CLAUDE.md .claude/rules/common/coding-style.md .claude/rules/common/code-revi
45
45
  # Without CLAUDE.md and .claude/rules/, code review and security review triggers won't fire.
46
46
  ```
47
47
 
48
- **Peaks-Cli Gate B — Before QA handoff:**
48
+ **Peaks-Loop Gate B — Before QA handoff:**
49
49
  ```bash
50
50
  ls .peaks/_runtime/<sessionId>/rd/requests/<rid>.md \
51
51
  .peaks/_runtime/<sessionId>/rd/tech-doc.md
52
52
  # Both must exist. Missing either → BLOCKED, do not hand off to QA
53
53
  ```
54
54
 
55
- **Peaks-Cli Gate B2 — Before QA handoff: unit tests exist and pass for the changed surface:**
55
+ **Peaks-Loop Gate B2 — Before QA handoff: unit tests exist and pass for the changed surface:**
56
56
  ```bash
57
57
  # Run the project's test command against changed files. Record the output.
58
58
  # Example (adapt to project test runner):
@@ -66,7 +66,7 @@ npx vitest run --changed --reporter=verbose 2>&1 | tail -20
66
66
  # `--run-tests` flag is the CLI opt-in.
67
67
  ```
68
68
 
69
- **Peaks-Cli Gate B3 — Before QA handoff: code review evidence exists:**
69
+ **Peaks-Loop Gate B3 — Before QA handoff: code review evidence exists:**
70
70
  ```bash
71
71
  ls .peaks/_runtime/<sessionId>/rd/code-review.md 2>&1
72
72
  # Expected: .peaks/_runtime/<sessionId>/rd/code-review.md
@@ -74,7 +74,7 @@ ls .peaks/_runtime/<sessionId>/rd/code-review.md 2>&1
74
74
  # record findings, fix CRITICAL/HIGH issues, then re-check.
75
75
  ```
76
76
 
77
- **Peaks-Cli Gate B4 — Before QA handoff: security review evidence exists:**
77
+ **Peaks-Loop Gate B4 — Before QA handoff: security review evidence exists:**
78
78
  ```bash
79
79
  ls .peaks/_runtime/<sessionId>/rd/security-review.md 2>&1
80
80
  # Expected: .peaks/_runtime/<sessionId>/rd/security-review.md
@@ -82,7 +82,7 @@ ls .peaks/_runtime/<sessionId>/rd/security-review.md 2>&1
82
82
  # fix CRITICAL/HIGH issues, record findings, then re-check.
83
83
  ```
84
84
 
85
- **Peaks-Cli Gate B5 — RD artifact body has no unfilled placeholders:**
85
+ **Peaks-Loop Gate B5 — RD artifact body has no unfilled placeholders:**
86
86
  ```bash
87
87
  peaks request lint <rid> --role rd --project <repo> --session-id <session-id> --json
88
88
  # Expected: ok=true. exit 0.
@@ -90,7 +90,7 @@ peaks request lint <rid> --role rd --project <repo> --session-id <session-id> --
90
90
  # and TBD/TODO marker with line numbers. Fill them in before attempting handoff.
91
91
  ```
92
92
 
93
- **Peaks-Cli Gate B6 — Declared --type matches the actual diff:**
93
+ **Peaks-Loop Gate B6 — Declared --type matches the actual diff:**
94
94
  ```bash
95
95
  peaks scan request-type-sanity --project <repo> --type <type> --json
96
96
  # Expected: consistent=true. exit 0.
@@ -99,7 +99,7 @@ peaks scan request-type-sanity --project <repo> --type <type> --json
99
99
  # (`peaks request init` with the corrected --type) or trim the scope.
100
100
  ```
101
101
 
102
- **Peaks-Cli Gate B7 — Repair cycle cap (only relevant during RD↔QA repair loop):**
102
+ **Peaks-Loop Gate B7 — Repair cycle cap (only relevant during RD↔QA repair loop):**
103
103
  ```bash
104
104
  peaks request repair-status <rid> --project <repo> --session-id <session-id> --json
105
105
  # Expected: atCap=false. exit 0.
@@ -107,7 +107,7 @@ peaks request repair-status <rid> --project <repo> --session-id <session-id> --j
107
107
  # handoff via Solo rather than entering a fourth cycle.
108
108
  ```
109
109
 
110
- **Peaks-Cli Gate B8 — Diff stays inside the declared red-line scope:**
110
+ **Peaks-Loop Gate B8 — Diff stays inside the declared red-line scope:**
111
111
  ```bash
112
112
  peaks scan diff-vs-scope --rid <rid> --project <repo> --session-id <session-id> --json
113
113
  # Expected: ok=true. exit 0.
@@ -121,7 +121,7 @@ peaks scan diff-vs-scope --rid <rid> --project <repo> --session-id <session-id>
121
121
  # before re-running. Auto-allowed paths (test files, .peaks/, __mocks__/) never need a pattern.
122
122
  ```
123
123
 
124
- **Peaks-Cli Gate B9 — RD-side perf-baseline output present (when slice has a user-perceivable perf surface):**
124
+ **Peaks-Loop Gate B9 — RD-side perf-baseline output present (when slice has a user-perceivable perf surface):**
125
125
  ```bash
126
126
  ls .peaks/_runtime/<sessionId>/rd/perf-baseline.md 2>&1
127
127
  # Expected: .peaks/_runtime/<sessionId>/rd/perf-baseline.md
@@ -19,4 +19,4 @@ peaks project memories --project <repo> --json
19
19
  ```
20
20
 
21
21
  This returns durable memories from `.peaks/memory` — decisions, conventions, modules, and rules captured in past sessions. Filter with `--kind <decision|convention|module|rule|reference|project>`. (`.peaks/PROJECT.md` is a human-readable session timeline only.)
22
- Then display: `Peaks-Cli Skill: peaks-rd | Peaks-Cli Gate: startup | Next: <one short action>`. Update with `peaks skill presence:set peaks-rd --project <repo> --mode <mode> --gate <gate>` when gates change. When the role's work ends, run `peaks skill presence:clear --project <repo>`.
22
+ Then display: `Peaks-Loop Skill: peaks-rd | Peaks-Loop Gate: startup | Next: <one short action>`. Update with `peaks skill presence:set peaks-rd --project <repo> --mode <mode> --gate <gate>` when gates change. When the role's work ends, run `peaks skill presence:clear --project <repo>`.
@@ -7,13 +7,13 @@ description: Third-party independent code-review skill for Peaks. Use as a paral
7
7
 
8
8
  > **Read once at the top of this file; the rest of the skill is written against it.**
9
9
 
10
- The `.peaks/` workspace is partitioned by a **single scope axis** (session-id, at `.peaks/_runtime/<sessionId>/...`) with a nested **sub-agent axis** under `.peaks/_sub_agents/<sessionId>/...`. Use `<sessionId>` placeholders (NEVER bare `<sid>`). The peaks-cli change-id axis was removed in slice `2026-06-29-change-id-root-removal`; reviewable artifacts now live under `.peaks/_runtime/<sessionId>/<role>/...` only. OpenSpec's independent `openspec/changes/<change-id>/` vocabulary (L4) is preserved untouched. CLI mapping: session-id → `peaks session *`; sub-agent → `peaks sub-agent *`. Regression test `tests/unit/skills/skills-skill-md-naming.test.ts` enforces (a) zero bare `<sid>`, (b) every `.peaks/_runtime/<X>/` has an axis label, (c) this callout is present.
10
+ The `.peaks/` workspace is partitioned by a **single scope axis** (session-id, at `.peaks/_runtime/<sessionId>/...`) with a nested **sub-agent axis** under `.peaks/_sub_agents/<sessionId>/...`. Use `<sessionId>` placeholders (NEVER bare `<sid>`). The peaks-loop change-id axis was removed in slice `2026-06-29-change-id-root-removal`; reviewable artifacts now live under `.peaks/_runtime/<sessionId>/<role>/...` only. OpenSpec's independent `openspec/changes/<change-id>/` vocabulary (L4) is preserved untouched. CLI mapping: session-id → `peaks session *`; sub-agent → `peaks sub-agent *`. Regression test `tests/unit/skills/skills-skill-md-naming.test.ts` enforces (a) zero bare `<sid>`, (b) every `.peaks/_runtime/<X>/` has an axis label, (c) this callout is present.
11
11
 
12
12
  ## peaks-context auto-build (v3.0)
13
13
 
14
14
  The peaks-reviewer workflow automatically runs `peaks context build --audience peaks-reviewer` before the LLM is invoked. No manual setup needed.
15
15
 
16
- # Peaks-Cli Third-Party Reviewer (v2.14.0 G4)
16
+ # Peaks-Loop Third-Party Reviewer (v2.14.0 G4)
17
17
 
18
18
  `peaks-reviewer` is a **parallel** reviewer to `karpathy-reviewer`. It is intentionally **not** a replacement: karpathy-reviewer keeps enforcing the 4 guidelines; peaks-reviewer adds an out-of-band perspective from a different model family to mitigate single-LLM self-dogfood blind spots.
19
19