peaks-loop 3.0.0

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 (1052) hide show
  1. package/.claude-plugin/marketplace.json +51 -0
  2. package/CHANGELOG.md +3136 -0
  3. package/LICENSE +21 -0
  4. package/README-en.md +281 -0
  5. package/README.md +365 -0
  6. package/agents/karpathy-reviewer.md +229 -0
  7. package/bin/peaks.js +2 -0
  8. package/dist/src/cli/cli-helpers.d.ts +25 -0
  9. package/dist/src/cli/cli-helpers.js +78 -0
  10. package/dist/src/cli/commands/agent-commands.d.ts +20 -0
  11. package/dist/src/cli/commands/agent-commands.js +48 -0
  12. package/dist/src/cli/commands/audit-commands.d.ts +28 -0
  13. package/dist/src/cli/commands/audit-commands.js +437 -0
  14. package/dist/src/cli/commands/capability-commands.d.ts +16 -0
  15. package/dist/src/cli/commands/capability-commands.js +45 -0
  16. package/dist/src/cli/commands/capability-worker-config-sc-commands.d.ts +3 -0
  17. package/dist/src/cli/commands/capability-worker-config-sc-commands.js +10 -0
  18. package/dist/src/cli/commands/classify-classify-commands.d.ts +19 -0
  19. package/dist/src/cli/commands/classify-classify-commands.js +151 -0
  20. package/dist/src/cli/commands/code-review-commands.d.ts +34 -0
  21. package/dist/src/cli/commands/code-review-commands.js +83 -0
  22. package/dist/src/cli/commands/codegraph-commands.d.ts +3 -0
  23. package/dist/src/cli/commands/codegraph-commands.js +99 -0
  24. package/dist/src/cli/commands/complexity-commands.d.ts +9 -0
  25. package/dist/src/cli/commands/complexity-commands.js +34 -0
  26. package/dist/src/cli/commands/config-commands.d.ts +3 -0
  27. package/dist/src/cli/commands/config-commands.js +220 -0
  28. package/dist/src/cli/commands/context-builder-commands.d.ts +11 -0
  29. package/dist/src/cli/commands/context-builder-commands.js +85 -0
  30. package/dist/src/cli/commands/context-commands.d.ts +21 -0
  31. package/dist/src/cli/commands/context-commands.js +254 -0
  32. package/dist/src/cli/commands/contract-commands.d.ts +26 -0
  33. package/dist/src/cli/commands/contract-commands.js +114 -0
  34. package/dist/src/cli/commands/core/artifacts-command.d.ts +3 -0
  35. package/dist/src/cli/commands/core/artifacts-command.js +62 -0
  36. package/dist/src/cli/commands/core/binding-commands.d.ts +3 -0
  37. package/dist/src/cli/commands/core/binding-commands.js +58 -0
  38. package/dist/src/cli/commands/core/doctor-command.d.ts +11 -0
  39. package/dist/src/cli/commands/core/doctor-command.js +204 -0
  40. package/dist/src/cli/commands/core/memory-command.d.ts +3 -0
  41. package/dist/src/cli/commands/core/memory-command.js +98 -0
  42. package/dist/src/cli/commands/core/profile-command.d.ts +3 -0
  43. package/dist/src/cli/commands/core/profile-command.js +9 -0
  44. package/dist/src/cli/commands/core/proxy-command.d.ts +3 -0
  45. package/dist/src/cli/commands/core/proxy-command.js +26 -0
  46. package/dist/src/cli/commands/core/session-command.d.ts +3 -0
  47. package/dist/src/cli/commands/core/session-command.js +213 -0
  48. package/dist/src/cli/commands/core/skill-command.d.ts +3 -0
  49. package/dist/src/cli/commands/core/skill-command.js +275 -0
  50. package/dist/src/cli/commands/core/standards-command.d.ts +3 -0
  51. package/dist/src/cli/commands/core/standards-command.js +95 -0
  52. package/dist/src/cli/commands/core-artifact-commands.d.ts +15 -0
  53. package/dist/src/cli/commands/core-artifact-commands.js +31 -0
  54. package/dist/src/cli/commands/dispatch-commands.d.ts +10 -0
  55. package/dist/src/cli/commands/dispatch-commands.js +351 -0
  56. package/dist/src/cli/commands/dispatch-from-dag.d.ts +3 -0
  57. package/dist/src/cli/commands/dispatch-from-dag.js +251 -0
  58. package/dist/src/cli/commands/doc-commands.d.ts +11 -0
  59. package/dist/src/cli/commands/doc-commands.js +65 -0
  60. package/dist/src/cli/commands/feedback-commands.d.ts +18 -0
  61. package/dist/src/cli/commands/feedback-commands.js +145 -0
  62. package/dist/src/cli/commands/final-review-commands.d.ts +31 -0
  63. package/dist/src/cli/commands/final-review-commands.js +161 -0
  64. package/dist/src/cli/commands/fixture-commands.d.ts +32 -0
  65. package/dist/src/cli/commands/fixture-commands.js +91 -0
  66. package/dist/src/cli/commands/fork-commands.d.ts +16 -0
  67. package/dist/src/cli/commands/fork-commands.js +163 -0
  68. package/dist/src/cli/commands/gate-commands.d.ts +3 -0
  69. package/dist/src/cli/commands/gate-commands.js +117 -0
  70. package/dist/src/cli/commands/heartbeat-commands.d.ts +3 -0
  71. package/dist/src/cli/commands/heartbeat-commands.js +135 -0
  72. package/dist/src/cli/commands/hook-handle.d.ts +17 -0
  73. package/dist/src/cli/commands/hook-handle.js +157 -0
  74. package/dist/src/cli/commands/hooks-commands.d.ts +3 -0
  75. package/dist/src/cli/commands/hooks-commands.js +156 -0
  76. package/dist/src/cli/commands/impact-commands.d.ts +15 -0
  77. package/dist/src/cli/commands/impact-commands.js +62 -0
  78. package/dist/src/cli/commands/legacy-commands.d.ts +11 -0
  79. package/dist/src/cli/commands/legacy-commands.js +32 -0
  80. package/dist/src/cli/commands/log-commands.d.ts +17 -0
  81. package/dist/src/cli/commands/log-commands.js +64 -0
  82. package/dist/src/cli/commands/loop-commands.d.ts +21 -0
  83. package/dist/src/cli/commands/loop-commands.js +128 -0
  84. package/dist/src/cli/commands/loop-eval-commands.d.ts +20 -0
  85. package/dist/src/cli/commands/loop-eval-commands.js +526 -0
  86. package/dist/src/cli/commands/memory-commands.d.ts +23 -0
  87. package/dist/src/cli/commands/memory-commands.js +129 -0
  88. package/dist/src/cli/commands/migrate-1-4-1-command.d.ts +11 -0
  89. package/dist/src/cli/commands/migrate-1-4-1-command.js +34 -0
  90. package/dist/src/cli/commands/migrate-v2-10-to-v2-11-command.d.ts +20 -0
  91. package/dist/src/cli/commands/migrate-v2-10-to-v2-11-command.js +52 -0
  92. package/dist/src/cli/commands/mut-commands.d.ts +20 -0
  93. package/dist/src/cli/commands/mut-commands.js +239 -0
  94. package/dist/src/cli/commands/observability-commands.d.ts +22 -0
  95. package/dist/src/cli/commands/observability-commands.js +201 -0
  96. package/dist/src/cli/commands/openspec-commands.d.ts +3 -0
  97. package/dist/src/cli/commands/openspec-commands.js +237 -0
  98. package/dist/src/cli/commands/perf-audit-commands.d.ts +22 -0
  99. package/dist/src/cli/commands/perf-audit-commands.js +132 -0
  100. package/dist/src/cli/commands/perf-commands.d.ts +3 -0
  101. package/dist/src/cli/commands/perf-commands.js +41 -0
  102. package/dist/src/cli/commands/playwright-commands.d.ts +95 -0
  103. package/dist/src/cli/commands/playwright-commands.js +432 -0
  104. package/dist/src/cli/commands/prd-blocks-commands.d.ts +18 -0
  105. package/dist/src/cli/commands/prd-blocks-commands.js +50 -0
  106. package/dist/src/cli/commands/prd-commands.d.ts +18 -0
  107. package/dist/src/cli/commands/prd-commands.js +141 -0
  108. package/dist/src/cli/commands/preferences-commands.d.ts +2 -0
  109. package/dist/src/cli/commands/preferences-commands.js +197 -0
  110. package/dist/src/cli/commands/project-commands.d.ts +3 -0
  111. package/dist/src/cli/commands/project-commands.js +248 -0
  112. package/dist/src/cli/commands/qa-business-review-commands.d.ts +17 -0
  113. package/dist/src/cli/commands/qa-business-review-commands.js +148 -0
  114. package/dist/src/cli/commands/qa-commands.d.ts +94 -0
  115. package/dist/src/cli/commands/qa-commands.js +271 -0
  116. package/dist/src/cli/commands/release-commands.d.ts +24 -0
  117. package/dist/src/cli/commands/release-commands.js +231 -0
  118. package/dist/src/cli/commands/request-commands.d.ts +3 -0
  119. package/dist/src/cli/commands/request-commands.js +509 -0
  120. package/dist/src/cli/commands/retrospective-commands.d.ts +12 -0
  121. package/dist/src/cli/commands/retrospective-commands.js +175 -0
  122. package/dist/src/cli/commands/reviewer-commands.d.ts +14 -0
  123. package/dist/src/cli/commands/reviewer-commands.js +64 -0
  124. package/dist/src/cli/commands/role-commands.d.ts +13 -0
  125. package/dist/src/cli/commands/role-commands.js +85 -0
  126. package/dist/src/cli/commands/sc-commands.d.ts +3 -0
  127. package/dist/src/cli/commands/sc-commands.js +45 -0
  128. package/dist/src/cli/commands/scan-commands.d.ts +3 -0
  129. package/dist/src/cli/commands/scan-commands.js +445 -0
  130. package/dist/src/cli/commands/security-audit-commands.d.ts +23 -0
  131. package/dist/src/cli/commands/security-audit-commands.js +132 -0
  132. package/dist/src/cli/commands/session-checkpoint-command.d.ts +10 -0
  133. package/dist/src/cli/commands/session-checkpoint-command.js +100 -0
  134. package/dist/src/cli/commands/session-resume-command.d.ts +11 -0
  135. package/dist/src/cli/commands/session-resume-command.js +83 -0
  136. package/dist/src/cli/commands/share-commands.d.ts +17 -0
  137. package/dist/src/cli/commands/share-commands.js +296 -0
  138. package/dist/src/cli/commands/skill-conformance-commands.d.ts +9 -0
  139. package/dist/src/cli/commands/skill-conformance-commands.js +39 -0
  140. package/dist/src/cli/commands/slice-commands.d.ts +24 -0
  141. package/dist/src/cli/commands/slice-commands.js +492 -0
  142. package/dist/src/cli/commands/slice-integrate-commands.d.ts +11 -0
  143. package/dist/src/cli/commands/slice-integrate-commands.js +74 -0
  144. package/dist/src/cli/commands/slice-review-commands.d.ts +23 -0
  145. package/dist/src/cli/commands/slice-review-commands.js +162 -0
  146. package/dist/src/cli/commands/smoke-commands.d.ts +21 -0
  147. package/dist/src/cli/commands/smoke-commands.js +203 -0
  148. package/dist/src/cli/commands/solo-commands.d.ts +80 -0
  149. package/dist/src/cli/commands/solo-commands.js +435 -0
  150. package/dist/src/cli/commands/sop-commands.d.ts +3 -0
  151. package/dist/src/cli/commands/sop-commands.js +215 -0
  152. package/dist/src/cli/commands/statusline-commands.d.ts +3 -0
  153. package/dist/src/cli/commands/statusline-commands.js +169 -0
  154. package/dist/src/cli/commands/sub-agent-commands.d.ts +22 -0
  155. package/dist/src/cli/commands/sub-agent-commands.js +19 -0
  156. package/dist/src/cli/commands/sub-agent-dispatch-guard.d.ts +55 -0
  157. package/dist/src/cli/commands/sub-agent-dispatch-guard.js +57 -0
  158. package/dist/src/cli/commands/sub-agent-shared.d.ts +99 -0
  159. package/dist/src/cli/commands/sub-agent-shared.js +67 -0
  160. package/dist/src/cli/commands/test-commands.d.ts +47 -0
  161. package/dist/src/cli/commands/test-commands.js +204 -0
  162. package/dist/src/cli/commands/understand-commands.d.ts +3 -0
  163. package/dist/src/cli/commands/understand-commands.js +112 -0
  164. package/dist/src/cli/commands/upgrade-commands.d.ts +23 -0
  165. package/dist/src/cli/commands/upgrade-commands.js +119 -0
  166. package/dist/src/cli/commands/user-touchpoint-commands.d.ts +18 -0
  167. package/dist/src/cli/commands/user-touchpoint-commands.js +78 -0
  168. package/dist/src/cli/commands/verdict-aggregate-command.d.ts +14 -0
  169. package/dist/src/cli/commands/verdict-aggregate-command.js +106 -0
  170. package/dist/src/cli/commands/worker-commands.d.ts +3 -0
  171. package/dist/src/cli/commands/worker-commands.js +52 -0
  172. package/dist/src/cli/commands/workflow-commands.d.ts +3 -0
  173. package/dist/src/cli/commands/workflow-commands.js +535 -0
  174. package/dist/src/cli/commands/workflow-plan-commands.d.ts +39 -0
  175. package/dist/src/cli/commands/workflow-plan-commands.js +163 -0
  176. package/dist/src/cli/commands/workspace/clean-command.d.ts +14 -0
  177. package/dist/src/cli/commands/workspace/clean-command.js +49 -0
  178. package/dist/src/cli/commands/workspace/helpers.d.ts +28 -0
  179. package/dist/src/cli/commands/workspace/helpers.js +87 -0
  180. package/dist/src/cli/commands/workspace/init-command.d.ts +121 -0
  181. package/dist/src/cli/commands/workspace/init-command.js +436 -0
  182. package/dist/src/cli/commands/workspace/migrate-command.d.ts +11 -0
  183. package/dist/src/cli/commands/workspace/migrate-command.js +91 -0
  184. package/dist/src/cli/commands/workspace/reconcile-command.d.ts +14 -0
  185. package/dist/src/cli/commands/workspace/reconcile-command.js +103 -0
  186. package/dist/src/cli/commands/workspace-commands.d.ts +18 -0
  187. package/dist/src/cli/commands/workspace-commands.js +50 -0
  188. package/dist/src/cli/index.d.ts +1 -0
  189. package/dist/src/cli/index.js +30 -0
  190. package/dist/src/cli/program.d.ts +5 -0
  191. package/dist/src/cli/program.js +336 -0
  192. package/dist/src/hooks/pre-tool-use-sub-agent.d.ts +28 -0
  193. package/dist/src/hooks/pre-tool-use-sub-agent.js +105 -0
  194. package/dist/src/lib/render/message-renderer.d.ts +20 -0
  195. package/dist/src/lib/render/message-renderer.js +80 -0
  196. package/dist/src/services/agent/ecc-agent-service.d.ts +47 -0
  197. package/dist/src/services/agent/ecc-agent-service.js +143 -0
  198. package/dist/src/services/artifacts/artifact-lint-service.d.ts +23 -0
  199. package/dist/src/services/artifacts/artifact-lint-service.js +99 -0
  200. package/dist/src/services/artifacts/artifact-prerequisites.d.ts +78 -0
  201. package/dist/src/services/artifacts/artifact-prerequisites.js +491 -0
  202. package/dist/src/services/artifacts/artifact-service.d.ts +43 -0
  203. package/dist/src/services/artifacts/artifact-service.js +98 -0
  204. package/dist/src/services/artifacts/artifact-templates.d.ts +30 -0
  205. package/dist/src/services/artifacts/artifact-templates.js +302 -0
  206. package/dist/src/services/artifacts/repair-cycle-service.d.ts +23 -0
  207. package/dist/src/services/artifacts/repair-cycle-service.js +52 -0
  208. package/dist/src/services/artifacts/request-artifact-service.d.ts +116 -0
  209. package/dist/src/services/artifacts/request-artifact-service.js +451 -0
  210. package/dist/src/services/artifacts/request-artifact-state-helpers.d.ts +51 -0
  211. package/dist/src/services/artifacts/request-artifact-state-helpers.js +114 -0
  212. package/dist/src/services/artifacts/workspace-service.d.ts +34 -0
  213. package/dist/src/services/artifacts/workspace-service.js +272 -0
  214. package/dist/src/services/audit/artifact-writer.d.ts +93 -0
  215. package/dist/src/services/audit/artifact-writer.js +303 -0
  216. package/dist/src/services/audit/audit-goal-service.d.ts +35 -0
  217. package/dist/src/services/audit/audit-goal-service.js +75 -0
  218. package/dist/src/services/audit/audit-goal-types.d.ts +40 -0
  219. package/dist/src/services/audit/audit-goal-types.js +15 -0
  220. package/dist/src/services/audit/backing-detector.d.ts +24 -0
  221. package/dist/src/services/audit/backing-detector.js +59 -0
  222. package/dist/src/services/audit/classifier.d.ts +38 -0
  223. package/dist/src/services/audit/classifier.js +134 -0
  224. package/dist/src/services/audit/decision-writer.d.ts +76 -0
  225. package/dist/src/services/audit/decision-writer.js +217 -0
  226. package/dist/src/services/audit/enforcers/active-skill-resolver.d.ts +29 -0
  227. package/dist/src/services/audit/enforcers/active-skill-resolver.js +71 -0
  228. package/dist/src/services/audit/enforcers/design-draft-confirm.d.ts +24 -0
  229. package/dist/src/services/audit/enforcers/design-draft-confirm.js +58 -0
  230. package/dist/src/services/audit/enforcers/lint-audit-regression.d.ts +21 -0
  231. package/dist/src/services/audit/enforcers/lint-audit-regression.js +86 -0
  232. package/dist/src/services/audit/enforcers/lint-catalog-governance.d.ts +32 -0
  233. package/dist/src/services/audit/enforcers/lint-catalog-governance.js +48 -0
  234. package/dist/src/services/audit/enforcers/lint-cli-back.d.ts +16 -0
  235. package/dist/src/services/audit/enforcers/lint-cli-back.js +35 -0
  236. package/dist/src/services/audit/enforcers/lint-output-style.d.ts +11 -0
  237. package/dist/src/services/audit/enforcers/lint-output-style.js +94 -0
  238. package/dist/src/services/audit/enforcers/lint-reference-integrity.d.ts +6 -0
  239. package/dist/src/services/audit/enforcers/lint-reference-integrity.js +83 -0
  240. package/dist/src/services/audit/enforcers/lint-reference-shape.d.ts +30 -0
  241. package/dist/src/services/audit/enforcers/lint-reference-shape.js +272 -0
  242. package/dist/src/services/audit/enforcers/lint-style.d.ts +49 -0
  243. package/dist/src/services/audit/enforcers/lint-style.js +173 -0
  244. package/dist/src/services/audit/enforcers/lint-workflow-shape.d.ts +4 -0
  245. package/dist/src/services/audit/enforcers/lint-workflow-shape.js +100 -0
  246. package/dist/src/services/audit/enforcers/login-gate.d.ts +23 -0
  247. package/dist/src/services/audit/enforcers/login-gate.js +40 -0
  248. package/dist/src/services/audit/enforcers/mock-placement.d.ts +25 -0
  249. package/dist/src/services/audit/enforcers/mock-placement.js +48 -0
  250. package/dist/src/services/audit/enforcers/no-root-pollution.d.ts +21 -0
  251. package/dist/src/services/audit/enforcers/no-root-pollution.js +56 -0
  252. package/dist/src/services/audit/enforcers/pre-rd-scan.d.ts +22 -0
  253. package/dist/src/services/audit/enforcers/pre-rd-scan.js +23 -0
  254. package/dist/src/services/audit/enforcers/prototype-fidelity.d.ts +25 -0
  255. package/dist/src/services/audit/enforcers/prototype-fidelity.js +75 -0
  256. package/dist/src/services/audit/enforcers/resume-detection.d.ts +21 -0
  257. package/dist/src/services/audit/enforcers/resume-detection.js +52 -0
  258. package/dist/src/services/audit/enforcers/solo-code-ban.d.ts +23 -0
  259. package/dist/src/services/audit/enforcers/solo-code-ban.js +27 -0
  260. package/dist/src/services/audit/enforcers/sub-agent-sid.d.ts +25 -0
  261. package/dist/src/services/audit/enforcers/sub-agent-sid.js +63 -0
  262. package/dist/src/services/audit/prose-ratio-calculator.d.ts +45 -0
  263. package/dist/src/services/audit/prose-ratio-calculator.js +52 -0
  264. package/dist/src/services/audit/red-line-catalog-p2-a.d.ts +21 -0
  265. package/dist/src/services/audit/red-line-catalog-p2-a.js +229 -0
  266. package/dist/src/services/audit/red-line-catalog-p2-b.d.ts +19 -0
  267. package/dist/src/services/audit/red-line-catalog-p2-b.js +225 -0
  268. package/dist/src/services/audit/red-line-catalog.d.ts +51 -0
  269. package/dist/src/services/audit/red-line-catalog.js +195 -0
  270. package/dist/src/services/audit/red-lines-service.d.ts +23 -0
  271. package/dist/src/services/audit/red-lines-service.js +464 -0
  272. package/dist/src/services/audit/scanners/openspec-scanner.d.ts +15 -0
  273. package/dist/src/services/audit/scanners/openspec-scanner.js +55 -0
  274. package/dist/src/services/audit/scanners/rules-tree-scanner.d.ts +16 -0
  275. package/dist/src/services/audit/scanners/rules-tree-scanner.js +56 -0
  276. package/dist/src/services/audit/scanners/skills-tree-scanner.d.ts +17 -0
  277. package/dist/src/services/audit/scanners/skills-tree-scanner.js +46 -0
  278. package/dist/src/services/audit/static-service.d.ts +60 -0
  279. package/dist/src/services/audit/static-service.js +130 -0
  280. package/dist/src/services/audit/types.d.ts +86 -0
  281. package/dist/src/services/audit/types.js +13 -0
  282. package/dist/src/services/audit-independent/perf-audit-service.d.ts +151 -0
  283. package/dist/src/services/audit-independent/perf-audit-service.js +316 -0
  284. package/dist/src/services/audit-independent/security-audit-service.d.ts +155 -0
  285. package/dist/src/services/audit-independent/security-audit-service.js +316 -0
  286. package/dist/src/services/classify/classify-service.d.ts +42 -0
  287. package/dist/src/services/classify/classify-service.js +122 -0
  288. package/dist/src/services/classify/classify-types.d.ts +79 -0
  289. package/dist/src/services/classify/classify-types.js +90 -0
  290. package/dist/src/services/code-review/ecc-bridge.d.ts +148 -0
  291. package/dist/src/services/code-review/ecc-bridge.js +242 -0
  292. package/dist/src/services/code-review/ocr-service.d.ts +129 -0
  293. package/dist/src/services/code-review/ocr-service.js +369 -0
  294. package/dist/src/services/codegraph/codegraph-process-runner.d.ts +2 -0
  295. package/dist/src/services/codegraph/codegraph-process-runner.js +93 -0
  296. package/dist/src/services/codegraph/codegraph-service.d.ts +43 -0
  297. package/dist/src/services/codegraph/codegraph-service.js +160 -0
  298. package/dist/src/services/complexity/complexity-estimator.d.ts +34 -0
  299. package/dist/src/services/complexity/complexity-estimator.js +64 -0
  300. package/dist/src/services/config/config-migration.d.ts +45 -0
  301. package/dist/src/services/config/config-migration.js +154 -0
  302. package/dist/src/services/config/config-restore.d.ts +10 -0
  303. package/dist/src/services/config/config-restore.js +47 -0
  304. package/dist/src/services/config/config-rollback.d.ts +13 -0
  305. package/dist/src/services/config/config-rollback.js +26 -0
  306. package/dist/src/services/config/config-safety.d.ts +40 -0
  307. package/dist/src/services/config/config-safety.js +359 -0
  308. package/dist/src/services/config/config-service.d.ts +69 -0
  309. package/dist/src/services/config/config-service.js +814 -0
  310. package/dist/src/services/config/config-types.d.ts +119 -0
  311. package/dist/src/services/config/config-types.js +18 -0
  312. package/dist/src/services/config/model-routing.d.ts +4 -0
  313. package/dist/src/services/config/model-routing.js +17 -0
  314. package/dist/src/services/config/provider-service.d.ts +48 -0
  315. package/dist/src/services/config/provider-service.js +143 -0
  316. package/dist/src/services/config/proxy-service.d.ts +21 -0
  317. package/dist/src/services/config/proxy-service.js +44 -0
  318. package/dist/src/services/config/sidecar-store.d.ts +25 -0
  319. package/dist/src/services/config/sidecar-store.js +61 -0
  320. package/dist/src/services/config/workspace-state-service.d.ts +30 -0
  321. package/dist/src/services/config/workspace-state-service.js +142 -0
  322. package/dist/src/services/context/artifact-meta.d.ts +72 -0
  323. package/dist/src/services/context/artifact-meta.js +105 -0
  324. package/dist/src/services/context/auto-compact-dispatcher.d.ts +37 -0
  325. package/dist/src/services/context/auto-compact-dispatcher.js +190 -0
  326. package/dist/src/services/context/auto-compact-reader.d.ts +51 -0
  327. package/dist/src/services/context/auto-compact-reader.js +164 -0
  328. package/dist/src/services/context/auto-compact-types.d.ts +143 -0
  329. package/dist/src/services/context/auto-compact-types.js +36 -0
  330. package/dist/src/services/context/collector.d.ts +24 -0
  331. package/dist/src/services/context/collector.js +133 -0
  332. package/dist/src/services/context/context-builder.d.ts +30 -0
  333. package/dist/src/services/context/context-builder.js +78 -0
  334. package/dist/src/services/context/context-guard.d.ts +49 -0
  335. package/dist/src/services/context/context-guard.js +91 -0
  336. package/dist/src/services/context/context-schema.d.ts +415 -0
  337. package/dist/src/services/context/context-schema.js +73 -0
  338. package/dist/src/services/context/dispatch-context-guard.d.ts +27 -0
  339. package/dist/src/services/context/dispatch-context-guard.js +192 -0
  340. package/dist/src/services/context/doc-retriever.d.ts +26 -0
  341. package/dist/src/services/context/doc-retriever.js +51 -0
  342. package/dist/src/services/context/headroom-client.d.ts +34 -0
  343. package/dist/src/services/context/headroom-client.js +117 -0
  344. package/dist/src/services/context/headroom-fetcher.d.ts +6 -0
  345. package/dist/src/services/context/headroom-fetcher.js +28 -0
  346. package/dist/src/services/context/headroom-prefs.d.ts +46 -0
  347. package/dist/src/services/context/headroom-prefs.js +34 -0
  348. package/dist/src/services/context/index.d.ts +7 -0
  349. package/dist/src/services/context/index.js +6 -0
  350. package/dist/src/services/context/main-session-monitor.d.ts +77 -0
  351. package/dist/src/services/context/main-session-monitor.js +130 -0
  352. package/dist/src/services/context/renderer.d.ts +20 -0
  353. package/dist/src/services/context/renderer.js +30 -0
  354. package/dist/src/services/context/shared-channel.d.ts +93 -0
  355. package/dist/src/services/context/shared-channel.js +308 -0
  356. package/dist/src/services/context/threshold.d.ts +35 -0
  357. package/dist/src/services/context/threshold.js +76 -0
  358. package/dist/src/services/context/tokenizer.d.ts +12 -0
  359. package/dist/src/services/context/tokenizer.js +43 -0
  360. package/dist/src/services/context/types.d.ts +93 -0
  361. package/dist/src/services/context/types.js +9 -0
  362. package/dist/src/services/dashboard/project-dashboard-service.d.ts +91 -0
  363. package/dist/src/services/dashboard/project-dashboard-service.js +147 -0
  364. package/dist/src/services/dispatch/batch-counter.d.ts +27 -0
  365. package/dist/src/services/dispatch/batch-counter.js +102 -0
  366. package/dist/src/services/dispatch/contract-store.d.ts +63 -0
  367. package/dist/src/services/dispatch/contract-store.js +157 -0
  368. package/dist/src/services/dispatch/dispatch-record-writer.d.ts +138 -0
  369. package/dist/src/services/dispatch/dispatch-record-writer.js +460 -0
  370. package/dist/src/services/dispatch/heartbeat-truncator.d.ts +26 -0
  371. package/dist/src/services/dispatch/heartbeat-truncator.js +13 -0
  372. package/dist/src/services/dispatch/leak-detector.d.ts +11 -0
  373. package/dist/src/services/dispatch/leak-detector.js +72 -0
  374. package/dist/src/services/dispatch/slice-dag.d.ts +81 -0
  375. package/dist/src/services/dispatch/slice-dag.js +238 -0
  376. package/dist/src/services/dispatch/sub-agent-dispatcher.d.ts +239 -0
  377. package/dist/src/services/dispatch/sub-agent-dispatcher.js +382 -0
  378. package/dist/src/services/dispatch/test-tool-detection.d.ts +36 -0
  379. package/dist/src/services/dispatch/test-tool-detection.js +46 -0
  380. package/dist/src/services/doc/doc-generator.d.ts +38 -0
  381. package/dist/src/services/doc/doc-generator.js +122 -0
  382. package/dist/src/services/doctor/doctor-service.d.ts +149 -0
  383. package/dist/src/services/doctor/doctor-service.js +929 -0
  384. package/dist/src/services/feedback/feedback-promotion-service.d.ts +123 -0
  385. package/dist/src/services/feedback/feedback-promotion-service.js +300 -0
  386. package/dist/src/services/filesystem/file-lock.d.ts +11 -0
  387. package/dist/src/services/filesystem/file-lock.js +129 -0
  388. package/dist/src/services/final-review/final-review-service.d.ts +12 -0
  389. package/dist/src/services/final-review/final-review-service.js +52 -0
  390. package/dist/src/services/final-review/final-review-types.d.ts +42 -0
  391. package/dist/src/services/final-review/final-review-types.js +18 -0
  392. package/dist/src/services/fixture/fixture-capture-service.d.ts +87 -0
  393. package/dist/src/services/fixture/fixture-capture-service.js +317 -0
  394. package/dist/src/services/fixture/fixture-sanitize-service.d.ts +117 -0
  395. package/dist/src/services/fixture/fixture-sanitize-service.js +161 -0
  396. package/dist/src/services/fixture/index.d.ts +8 -0
  397. package/dist/src/services/fixture/index.js +8 -0
  398. package/dist/src/services/fork/fork-sync-state.d.ts +85 -0
  399. package/dist/src/services/fork/fork-sync-state.js +130 -0
  400. package/dist/src/services/fuzzy-matching/fuzzy-match-service.d.ts +15 -0
  401. package/dist/src/services/fuzzy-matching/fuzzy-match-service.js +56 -0
  402. package/dist/src/services/fuzzy-matching/fzf-pick-service.d.ts +68 -0
  403. package/dist/src/services/fuzzy-matching/fzf-pick-service.js +158 -0
  404. package/dist/src/services/fuzzy-matching/types.d.ts +20 -0
  405. package/dist/src/services/fuzzy-matching/types.js +1 -0
  406. package/dist/src/services/handoff/handoff-parser.d.ts +28 -0
  407. package/dist/src/services/handoff/handoff-parser.js +69 -0
  408. package/dist/src/services/handoff/handoff-types.d.ts +39 -0
  409. package/dist/src/services/handoff/handoff-types.js +19 -0
  410. package/dist/src/services/handoff/handoff-writer.d.ts +23 -0
  411. package/dist/src/services/handoff/handoff-writer.js +30 -0
  412. package/dist/src/services/hooks/output.d.ts +92 -0
  413. package/dist/src/services/hooks/output.js +111 -0
  414. package/dist/src/services/hooks/presence-marker-detector.d.ts +16 -0
  415. package/dist/src/services/hooks/presence-marker-detector.js +105 -0
  416. package/dist/src/services/ide/adapters/claude-code-adapter.d.ts +18 -0
  417. package/dist/src/services/ide/adapters/claude-code-adapter.js +91 -0
  418. package/dist/src/services/ide/adapters/codex-adapter.d.ts +46 -0
  419. package/dist/src/services/ide/adapters/codex-adapter.js +97 -0
  420. package/dist/src/services/ide/adapters/cursor-adapter.d.ts +36 -0
  421. package/dist/src/services/ide/adapters/cursor-adapter.js +84 -0
  422. package/dist/src/services/ide/adapters/hermes-adapter.d.ts +21 -0
  423. package/dist/src/services/ide/adapters/hermes-adapter.js +51 -0
  424. package/dist/src/services/ide/adapters/openclaw-adapter.d.ts +14 -0
  425. package/dist/src/services/ide/adapters/openclaw-adapter.js +42 -0
  426. package/dist/src/services/ide/adapters/trae-adapter.d.ts +42 -0
  427. package/dist/src/services/ide/adapters/trae-adapter.js +83 -0
  428. package/dist/src/services/ide/hook-protocol.d.ts +47 -0
  429. package/dist/src/services/ide/hook-protocol.js +74 -0
  430. package/dist/src/services/ide/hook-translator.d.ts +72 -0
  431. package/dist/src/services/ide/hook-translator.js +128 -0
  432. package/dist/src/services/ide/ide-detector.d.ts +10 -0
  433. package/dist/src/services/ide/ide-detector.js +19 -0
  434. package/dist/src/services/ide/ide-registry.d.ts +14 -0
  435. package/dist/src/services/ide/ide-registry.js +60 -0
  436. package/dist/src/services/ide/ide-types.d.ts +230 -0
  437. package/dist/src/services/ide/ide-types.js +2 -0
  438. package/dist/src/services/ide/resource-profile.d.ts +52 -0
  439. package/dist/src/services/ide/resource-profile.js +33 -0
  440. package/dist/src/services/ide/shared/atomic-json.d.ts +15 -0
  441. package/dist/src/services/ide/shared/atomic-json.js +58 -0
  442. package/dist/src/services/ide/shared/safe-path.d.ts +11 -0
  443. package/dist/src/services/ide/shared/safe-path.js +29 -0
  444. package/dist/src/services/impact/impact-scan-service.d.ts +66 -0
  445. package/dist/src/services/impact/impact-scan-service.js +197 -0
  446. package/dist/src/services/legacy/legacy-detector.d.ts +34 -0
  447. package/dist/src/services/legacy/legacy-detector.js +111 -0
  448. package/dist/src/services/log/log-commands-service.d.ts +54 -0
  449. package/dist/src/services/log/log-commands-service.js +83 -0
  450. package/dist/src/services/log/logger.d.ts +103 -0
  451. package/dist/src/services/log/logger.js +224 -0
  452. package/dist/src/services/log/redact.d.ts +32 -0
  453. package/dist/src/services/log/redact.js +89 -0
  454. package/dist/src/services/log/retention.d.ts +34 -0
  455. package/dist/src/services/log/retention.js +78 -0
  456. package/dist/src/services/loop/evaluator-dispatcher.d.ts +50 -0
  457. package/dist/src/services/loop/evaluator-dispatcher.js +551 -0
  458. package/dist/src/services/loop/monotonic-guard.d.ts +80 -0
  459. package/dist/src/services/loop/monotonic-guard.js +215 -0
  460. package/dist/src/services/loop/monotonic-runner.d.ts +55 -0
  461. package/dist/src/services/loop/monotonic-runner.js +197 -0
  462. package/dist/src/services/loop/run-driver.d.ts +70 -0
  463. package/dist/src/services/loop/run-driver.js +379 -0
  464. package/dist/src/services/loop/spec-service.d.ts +90 -0
  465. package/dist/src/services/loop/spec-service.js +497 -0
  466. package/dist/src/services/memory/llm-reranker.d.ts +174 -0
  467. package/dist/src/services/memory/llm-reranker.js +284 -0
  468. package/dist/src/services/memory/memory-search-service.d.ts +93 -0
  469. package/dist/src/services/memory/memory-search-service.js +117 -0
  470. package/dist/src/services/memory/project-context-service.d.ts +11 -0
  471. package/dist/src/services/memory/project-context-service.js +148 -0
  472. package/dist/src/services/memory/project-memory-service.d.ts +167 -0
  473. package/dist/src/services/memory/project-memory-service.js +817 -0
  474. package/dist/src/services/migration/v2-10-to-v2-11-service.d.ts +44 -0
  475. package/dist/src/services/migration/v2-10-to-v2-11-service.js +190 -0
  476. package/dist/src/services/migration/v2-10-to-v2-11-types.d.ts +41 -0
  477. package/dist/src/services/migration/v2-10-to-v2-11-types.js +23 -0
  478. package/dist/src/services/mode/bypass-tracker.d.ts +4 -0
  479. package/dist/src/services/mode/bypass-tracker.js +31 -0
  480. package/dist/src/services/mode/mode-enforcement.d.ts +14 -0
  481. package/dist/src/services/mode/mode-enforcement.js +84 -0
  482. package/dist/src/services/mut/assert-scanner.d.ts +6 -0
  483. package/dist/src/services/mut/assert-scanner.js +116 -0
  484. package/dist/src/services/mut/index.d.ts +8 -0
  485. package/dist/src/services/mut/index.js +7 -0
  486. package/dist/src/services/mut/mut-runner.d.ts +39 -0
  487. package/dist/src/services/mut/mut-runner.js +29 -0
  488. package/dist/src/services/mut/production-stryker.d.ts +7 -0
  489. package/dist/src/services/mut/production-stryker.js +66 -0
  490. package/dist/src/services/mut/report-builder.d.ts +11 -0
  491. package/dist/src/services/mut/report-builder.js +110 -0
  492. package/dist/src/services/mut/report-loader.d.ts +31 -0
  493. package/dist/src/services/mut/report-loader.js +78 -0
  494. package/dist/src/services/mut/thresholds.d.ts +21 -0
  495. package/dist/src/services/mut/thresholds.js +22 -0
  496. package/dist/src/services/mut/types.d.ts +336 -0
  497. package/dist/src/services/mut/types.js +59 -0
  498. package/dist/src/services/observability/aggregation.d.ts +64 -0
  499. package/dist/src/services/observability/aggregation.js +217 -0
  500. package/dist/src/services/observability/jsonl-store.d.ts +59 -0
  501. package/dist/src/services/observability/jsonl-store.js +120 -0
  502. package/dist/src/services/observability/observability-service.d.ts +95 -0
  503. package/dist/src/services/observability/observability-service.js +119 -0
  504. package/dist/src/services/observability/report-formatter.d.ts +42 -0
  505. package/dist/src/services/observability/report-formatter.js +156 -0
  506. package/dist/src/services/openspec/openspec-archive-service.d.ts +12 -0
  507. package/dist/src/services/openspec/openspec-archive-service.js +28 -0
  508. package/dist/src/services/openspec/openspec-bridge-service.d.ts +16 -0
  509. package/dist/src/services/openspec/openspec-bridge-service.js +76 -0
  510. package/dist/src/services/openspec/openspec-init-service.d.ts +23 -0
  511. package/dist/src/services/openspec/openspec-init-service.js +122 -0
  512. package/dist/src/services/openspec/openspec-propose-from-doctor-service.d.ts +31 -0
  513. package/dist/src/services/openspec/openspec-propose-from-doctor-service.js +95 -0
  514. package/dist/src/services/openspec/openspec-render-service.d.ts +38 -0
  515. package/dist/src/services/openspec/openspec-render-service.js +130 -0
  516. package/dist/src/services/openspec/openspec-scan-service.d.ts +6 -0
  517. package/dist/src/services/openspec/openspec-scan-service.js +123 -0
  518. package/dist/src/services/openspec/openspec-types.d.ts +39 -0
  519. package/dist/src/services/openspec/openspec-types.js +1 -0
  520. package/dist/src/services/openspec/openspec-validate-service.d.ts +27 -0
  521. package/dist/src/services/openspec/openspec-validate-service.js +77 -0
  522. package/dist/src/services/perf/perf-baseline-service.d.ts +70 -0
  523. package/dist/src/services/perf/perf-baseline-service.js +214 -0
  524. package/dist/src/services/prd/handoff-auto-regen.d.ts +22 -0
  525. package/dist/src/services/prd/handoff-auto-regen.js +73 -0
  526. package/dist/src/services/prd/handoff-service.d.ts +54 -0
  527. package/dist/src/services/prd/handoff-service.js +142 -0
  528. package/dist/src/services/prd/handoff-types.d.ts +64 -0
  529. package/dist/src/services/prd/handoff-types.js +22 -0
  530. package/dist/src/services/prd/prd-blocks-checker.d.ts +51 -0
  531. package/dist/src/services/prd/prd-blocks-checker.js +130 -0
  532. package/dist/src/services/prd/project-scan-reader.d.ts +24 -0
  533. package/dist/src/services/prd/project-scan-reader.js +150 -0
  534. package/dist/src/services/prd/project-scan-sediment.d.ts +97 -0
  535. package/dist/src/services/prd/project-scan-sediment.js +445 -0
  536. package/dist/src/services/prd/project-scan-types.d.ts +66 -0
  537. package/dist/src/services/prd/project-scan-types.js +20 -0
  538. package/dist/src/services/preferences/preferences-service.d.ts +38 -0
  539. package/dist/src/services/preferences/preferences-service.js +198 -0
  540. package/dist/src/services/preferences/preferences-types.d.ts +148 -0
  541. package/dist/src/services/preferences/preferences-types.js +53 -0
  542. package/dist/src/services/profiles/profile-service.d.ts +6 -0
  543. package/dist/src/services/profiles/profile-service.js +19 -0
  544. package/dist/src/services/progress/progress-service.d.ts +125 -0
  545. package/dist/src/services/progress/progress-service.js +192 -0
  546. package/dist/src/services/providers/minimax-provider-service.d.ts +24 -0
  547. package/dist/src/services/providers/minimax-provider-service.js +143 -0
  548. package/dist/src/services/providers/minimax-worker-service.d.ts +21 -0
  549. package/dist/src/services/providers/minimax-worker-service.js +83 -0
  550. package/dist/src/services/proxy/proxy-service.d.ts +7 -0
  551. package/dist/src/services/proxy/proxy-service.js +31 -0
  552. package/dist/src/services/qa/browser-event-logger.d.ts +40 -0
  553. package/dist/src/services/qa/browser-event-logger.js +54 -0
  554. package/dist/src/services/qa/browser-restart-detector.d.ts +74 -0
  555. package/dist/src/services/qa/browser-restart-detector.js +138 -0
  556. package/dist/src/services/qa/browser-reuse-hint.d.ts +18 -0
  557. package/dist/src/services/qa/browser-reuse-hint.js +18 -0
  558. package/dist/src/services/qa/browser-wrapper-service.d.ts +37 -0
  559. package/dist/src/services/qa/browser-wrapper-service.js +88 -0
  560. package/dist/src/services/qa/qa-business-review-state.d.ts +47 -0
  561. package/dist/src/services/qa/qa-business-review-state.js +96 -0
  562. package/dist/src/services/rd/ast-gate.d.ts +19 -0
  563. package/dist/src/services/rd/ast-gate.js +71 -0
  564. package/dist/src/services/rd/impl.d.ts +9 -0
  565. package/dist/src/services/rd/impl.js +57 -0
  566. package/dist/src/services/rd/rd-service.d.ts +129 -0
  567. package/dist/src/services/rd/rd-service.js +438 -0
  568. package/dist/src/services/rd/reviewer-dispatch-policy.d.ts +122 -0
  569. package/dist/src/services/rd/reviewer-dispatch-policy.js +148 -0
  570. package/dist/src/services/rd/standards-diagnostic.d.ts +76 -0
  571. package/dist/src/services/rd/standards-diagnostic.js +166 -0
  572. package/dist/src/services/rd/strategic-stage.d.ts +4 -0
  573. package/dist/src/services/rd/strategic-stage.js +15 -0
  574. package/dist/src/services/rd/strategy.d.ts +13 -0
  575. package/dist/src/services/rd/strategy.js +60 -0
  576. package/dist/src/services/rd/tactical-stage.d.ts +33 -0
  577. package/dist/src/services/rd/tactical-stage.js +62 -0
  578. package/dist/src/services/rd/types.d.ts +252 -0
  579. package/dist/src/services/rd/types.js +47 -0
  580. package/dist/src/services/recommendations/capability-availability.d.ts +5 -0
  581. package/dist/src/services/recommendations/capability-availability.js +40 -0
  582. package/dist/src/services/recommendations/capability-map-service.d.ts +7 -0
  583. package/dist/src/services/recommendations/capability-map-service.js +131 -0
  584. package/dist/src/services/recommendations/capability-seed-items.d.ts +2 -0
  585. package/dist/src/services/recommendations/capability-seed-items.js +140 -0
  586. package/dist/src/services/recommendations/capability-seed-mappings.d.ts +2 -0
  587. package/dist/src/services/recommendations/capability-seed-mappings.js +54 -0
  588. package/dist/src/services/recommendations/capability-seed-sources.d.ts +2 -0
  589. package/dist/src/services/recommendations/capability-seed-sources.js +35 -0
  590. package/dist/src/services/recommendations/recommendation-service.d.ts +8 -0
  591. package/dist/src/services/recommendations/recommendation-service.js +106 -0
  592. package/dist/src/services/recommendations/recommendation-types.d.ts +129 -0
  593. package/dist/src/services/recommendations/recommendation-types.js +1 -0
  594. package/dist/src/services/recommendations/seed-capability-catalog.d.ts +3 -0
  595. package/dist/src/services/recommendations/seed-capability-catalog.js +3 -0
  596. package/dist/src/services/refactor/refactor-service.d.ts +9 -0
  597. package/dist/src/services/refactor/refactor-service.js +36 -0
  598. package/dist/src/services/release/release-state.d.ts +70 -0
  599. package/dist/src/services/release/release-state.js +140 -0
  600. package/dist/src/services/retrospective/retrospective-index.d.ts +37 -0
  601. package/dist/src/services/retrospective/retrospective-index.js +110 -0
  602. package/dist/src/services/retrospective/retrospective-search-service.d.ts +55 -0
  603. package/dist/src/services/retrospective/retrospective-search-service.js +107 -0
  604. package/dist/src/services/retrospective/retrospective-show.d.ts +40 -0
  605. package/dist/src/services/retrospective/retrospective-show.js +109 -0
  606. package/dist/src/services/reviewer/model-family.d.ts +18 -0
  607. package/dist/src/services/reviewer/model-family.js +70 -0
  608. package/dist/src/services/reviewer/providers/anthropic.d.ts +2 -0
  609. package/dist/src/services/reviewer/providers/anthropic.js +61 -0
  610. package/dist/src/services/reviewer/providers/ollama.d.ts +26 -0
  611. package/dist/src/services/reviewer/providers/ollama.js +38 -0
  612. package/dist/src/services/reviewer/providers/openai.d.ts +2 -0
  613. package/dist/src/services/reviewer/providers/openai.js +63 -0
  614. package/dist/src/services/reviewer/reviewer-config.d.ts +34 -0
  615. package/dist/src/services/reviewer/reviewer-config.js +100 -0
  616. package/dist/src/services/reviewer/reviewer-service.d.ts +56 -0
  617. package/dist/src/services/reviewer/reviewer-service.js +263 -0
  618. package/dist/src/services/reviewer/selection-strategies.d.ts +27 -0
  619. package/dist/src/services/reviewer/selection-strategies.js +53 -0
  620. package/dist/src/services/role/role-registry.d.ts +38 -0
  621. package/dist/src/services/role/role-registry.js +83 -0
  622. package/dist/src/services/sc/index.d.ts +1 -0
  623. package/dist/src/services/sc/index.js +1 -0
  624. package/dist/src/services/sc/sc-service.d.ts +131 -0
  625. package/dist/src/services/sc/sc-service.js +552 -0
  626. package/dist/src/services/scan/acceptance-coverage-service.d.ts +42 -0
  627. package/dist/src/services/scan/acceptance-coverage-service.js +140 -0
  628. package/dist/src/services/scan/api-surface-service.d.ts +69 -0
  629. package/dist/src/services/scan/api-surface-service.js +239 -0
  630. package/dist/src/services/scan/archetype-service.d.ts +5 -0
  631. package/dist/src/services/scan/archetype-service.js +242 -0
  632. package/dist/src/services/scan/diff-scope-service.d.ts +40 -0
  633. package/dist/src/services/scan/diff-scope-service.js +198 -0
  634. package/dist/src/services/scan/existing-system-service.d.ts +7 -0
  635. package/dist/src/services/scan/existing-system-service.js +300 -0
  636. package/dist/src/services/scan/file-size-scan.d.ts +23 -0
  637. package/dist/src/services/scan/file-size-scan.js +68 -0
  638. package/dist/src/services/scan/karpathy-service.d.ts +60 -0
  639. package/dist/src/services/scan/karpathy-service.js +228 -0
  640. package/dist/src/services/scan/libraries-service.d.ts +24 -0
  641. package/dist/src/services/scan/libraries-service.js +419 -0
  642. package/dist/src/services/scan/libraries-types.d.ts +59 -0
  643. package/dist/src/services/scan/libraries-types.js +9 -0
  644. package/dist/src/services/scan/orphan-service.d.ts +76 -0
  645. package/dist/src/services/scan/orphan-service.js +538 -0
  646. package/dist/src/services/scan/scan-types.d.ts +59 -0
  647. package/dist/src/services/scan/scan-types.js +1 -0
  648. package/dist/src/services/scan/type-sanity-service.d.ts +23 -0
  649. package/dist/src/services/scan/type-sanity-service.js +116 -0
  650. package/dist/src/services/security/safe-settings-path.d.ts +12 -0
  651. package/dist/src/services/security/safe-settings-path.js +104 -0
  652. package/dist/src/services/session/binding-status-service.d.ts +56 -0
  653. package/dist/src/services/session/binding-status-service.js +106 -0
  654. package/dist/src/services/session/binding-store.d.ts +161 -0
  655. package/dist/src/services/session/binding-store.js +509 -0
  656. package/dist/src/services/session/caller-binding-service.d.ts +70 -0
  657. package/dist/src/services/session/caller-binding-service.js +148 -0
  658. package/dist/src/services/session/caller-id-types.d.ts +77 -0
  659. package/dist/src/services/session/caller-id-types.js +46 -0
  660. package/dist/src/services/session/getSessionDir.d.ts +1 -0
  661. package/dist/src/services/session/getSessionDir.js +27 -0
  662. package/dist/src/services/session/index.d.ts +6 -0
  663. package/dist/src/services/session/index.js +7 -0
  664. package/dist/src/services/session/platform-fallbacks.d.ts +31 -0
  665. package/dist/src/services/session/platform-fallbacks.js +35 -0
  666. package/dist/src/services/session/resolve-caller-id.d.ts +57 -0
  667. package/dist/src/services/session/resolve-caller-id.js +88 -0
  668. package/dist/src/services/session/session-binding-bridge.d.ts +76 -0
  669. package/dist/src/services/session/session-binding-bridge.js +247 -0
  670. package/dist/src/services/session/session-checkpoint-service.d.ts +57 -0
  671. package/dist/src/services/session/session-checkpoint-service.js +143 -0
  672. package/dist/src/services/session/session-manager.d.ts +168 -0
  673. package/dist/src/services/session/session-manager.js +502 -0
  674. package/dist/src/services/session/session-resume-service.d.ts +25 -0
  675. package/dist/src/services/session/session-resume-service.js +101 -0
  676. package/dist/src/services/signal/cancel-handler.d.ts +14 -0
  677. package/dist/src/services/signal/cancel-handler.js +76 -0
  678. package/dist/src/services/skill/resume-detector.d.ts +54 -0
  679. package/dist/src/services/skill/resume-detector.js +334 -0
  680. package/dist/src/services/skill/skill-scheduler.d.ts +40 -0
  681. package/dist/src/services/skill/skill-scheduler.js +53 -0
  682. package/dist/src/services/skills/hooks-settings-service.d.ts +137 -0
  683. package/dist/src/services/skills/hooks-settings-service.js +396 -0
  684. package/dist/src/services/skills/skill-conformance-service.d.ts +40 -0
  685. package/dist/src/services/skills/skill-conformance-service.js +136 -0
  686. package/dist/src/services/skills/skill-presence-service.d.ts +158 -0
  687. package/dist/src/services/skills/skill-presence-service.js +474 -0
  688. package/dist/src/services/skills/skill-registry.d.ts +17 -0
  689. package/dist/src/services/skills/skill-registry.js +40 -0
  690. package/dist/src/services/skills/skill-runbook-service.d.ts +11 -0
  691. package/dist/src/services/skills/skill-runbook-service.js +128 -0
  692. package/dist/src/services/skills/skill-statusline-renderer.d.ts +6 -0
  693. package/dist/src/services/skills/skill-statusline-renderer.js +55 -0
  694. package/dist/src/services/skills/skill-statusline-service.d.ts +24 -0
  695. package/dist/src/services/skills/skill-statusline-service.js +110 -0
  696. package/dist/src/services/skills/statusline-settings-service.d.ts +59 -0
  697. package/dist/src/services/skills/statusline-settings-service.js +141 -0
  698. package/dist/src/services/skills/sync-service.d.ts +86 -0
  699. package/dist/src/services/skills/sync-service.js +271 -0
  700. package/dist/src/services/slice/calibration-store.d.ts +39 -0
  701. package/dist/src/services/slice/calibration-store.js +68 -0
  702. package/dist/src/services/slice/cross-pass-edge-merger.d.ts +53 -0
  703. package/dist/src/services/slice/cross-pass-edge-merger.js +246 -0
  704. package/dist/src/services/slice/granularity-decider.d.ts +37 -0
  705. package/dist/src/services/slice/granularity-decider.js +40 -0
  706. package/dist/src/services/slice/llm-arbitrator.d.ts +35 -0
  707. package/dist/src/services/slice/llm-arbitrator.js +63 -0
  708. package/dist/src/services/slice/multi-pass-orchestrator.d.ts +67 -0
  709. package/dist/src/services/slice/multi-pass-orchestrator.js +225 -0
  710. package/dist/src/services/slice/schema-router.d.ts +44 -0
  711. package/dist/src/services/slice/schema-router.js +61 -0
  712. package/dist/src/services/slice/slice-archive-service.d.ts +20 -0
  713. package/dist/src/services/slice/slice-archive-service.js +111 -0
  714. package/dist/src/services/slice/slice-benchmark-service.d.ts +19 -0
  715. package/dist/src/services/slice/slice-benchmark-service.js +60 -0
  716. package/dist/src/services/slice/slice-check-service.d.ts +2 -0
  717. package/dist/src/services/slice/slice-check-service.js +459 -0
  718. package/dist/src/services/slice/slice-check-types.d.ts +104 -0
  719. package/dist/src/services/slice/slice-check-types.js +28 -0
  720. package/dist/src/services/slice/slice-decompose-runners.d.ts +23 -0
  721. package/dist/src/services/slice/slice-decompose-runners.js +174 -0
  722. package/dist/src/services/slice/slice-decompose-service.d.ts +24 -0
  723. package/dist/src/services/slice/slice-decompose-service.js +532 -0
  724. package/dist/src/services/slice/slice-decompose-types.d.ts +263 -0
  725. package/dist/src/services/slice/slice-decompose-types.js +30 -0
  726. package/dist/src/services/slice/slice-integration.d.ts +43 -0
  727. package/dist/src/services/slice/slice-integration.js +106 -0
  728. package/dist/src/services/slice/slice-pick-service.d.ts +32 -0
  729. package/dist/src/services/slice/slice-pick-service.js +75 -0
  730. package/dist/src/services/slice/slice-review-state.d.ts +70 -0
  731. package/dist/src/services/slice/slice-review-state.js +109 -0
  732. package/dist/src/services/slice/slice-topology-types.d.ts +115 -0
  733. package/dist/src/services/slice/slice-topology-types.js +20 -0
  734. package/dist/src/services/smoke/smoke-paths-state.d.ts +73 -0
  735. package/dist/src/services/smoke/smoke-paths-state.js +117 -0
  736. package/dist/src/services/solo/auto-compact-orchestrator.d.ts +98 -0
  737. package/dist/src/services/solo/auto-compact-orchestrator.js +343 -0
  738. package/dist/src/services/solo/batch-heartbeat-poller.d.ts +51 -0
  739. package/dist/src/services/solo/batch-heartbeat-poller.js +88 -0
  740. package/dist/src/services/solo/dag-orchestrator.d.ts +128 -0
  741. package/dist/src/services/solo/dag-orchestrator.js +304 -0
  742. package/dist/src/services/solo/mode-gate.d.ts +163 -0
  743. package/dist/src/services/solo/mode-gate.js +212 -0
  744. package/dist/src/services/solo/post-compact-detector.d.ts +61 -0
  745. package/dist/src/services/solo/post-compact-detector.js +240 -0
  746. package/dist/src/services/solo/status-line-renderer.d.ts +34 -0
  747. package/dist/src/services/solo/status-line-renderer.js +55 -0
  748. package/dist/src/services/solo/user-touchpoint-classifier.d.ts +44 -0
  749. package/dist/src/services/solo/user-touchpoint-classifier.js +145 -0
  750. package/dist/src/services/sop/gate-enforce-service.d.ts +33 -0
  751. package/dist/src/services/sop/gate-enforce-service.js +168 -0
  752. package/dist/src/services/sop/sop-advance-service.d.ts +74 -0
  753. package/dist/src/services/sop/sop-advance-service.js +115 -0
  754. package/dist/src/services/sop/sop-check-service.d.ts +45 -0
  755. package/dist/src/services/sop/sop-check-service.js +181 -0
  756. package/dist/src/services/sop/sop-paths.d.ts +62 -0
  757. package/dist/src/services/sop/sop-paths.js +92 -0
  758. package/dist/src/services/sop/sop-registry-service.d.ts +46 -0
  759. package/dist/src/services/sop/sop-registry-service.js +89 -0
  760. package/dist/src/services/sop/sop-service.d.ts +55 -0
  761. package/dist/src/services/sop/sop-service.js +222 -0
  762. package/dist/src/services/sop/sop-types.d.ts +95 -0
  763. package/dist/src/services/sop/sop-types.js +11 -0
  764. package/dist/src/services/standards/ide-aware-standards-service.d.ts +94 -0
  765. package/dist/src/services/standards/ide-aware-standards-service.js +89 -0
  766. package/dist/src/services/standards/migrate-claude-rules-service.d.ts +19 -0
  767. package/dist/src/services/standards/migrate-claude-rules-service.js +193 -0
  768. package/dist/src/services/standards/migrate-service.d.ts +63 -0
  769. package/dist/src/services/standards/migrate-service.js +193 -0
  770. package/dist/src/services/standards/missing-standards-detector.d.ts +79 -0
  771. package/dist/src/services/standards/missing-standards-detector.js +132 -0
  772. package/dist/src/services/standards/project-context.d.ts +24 -0
  773. package/dist/src/services/standards/project-context.js +314 -0
  774. package/dist/src/services/standards/project-standards-service.d.ts +114 -0
  775. package/dist/src/services/standards/project-standards-service.js +574 -0
  776. package/dist/src/services/tech/tech-service.d.ts +69 -0
  777. package/dist/src/services/tech/tech-service.js +299 -0
  778. package/dist/src/services/test-cache/test-cache-service.d.ts +70 -0
  779. package/dist/src/services/test-cache/test-cache-service.js +175 -0
  780. package/dist/src/services/understand/understand-scan-service.d.ts +28 -0
  781. package/dist/src/services/understand/understand-scan-service.js +170 -0
  782. package/dist/src/services/understand/understand-types.d.ts +50 -0
  783. package/dist/src/services/understand/understand-types.js +1 -0
  784. package/dist/src/services/upgrade/1x-detector-service.d.ts +7 -0
  785. package/dist/src/services/upgrade/1x-detector-service.js +94 -0
  786. package/dist/src/services/upgrade/gitignore-migrate-service.d.ts +56 -0
  787. package/dist/src/services/upgrade/gitignore-migrate-service.js +170 -0
  788. package/dist/src/services/upgrade/upgrade-service.d.ts +47 -0
  789. package/dist/src/services/upgrade/upgrade-service.js +381 -0
  790. package/dist/src/services/verdict/envelopes.d.ts +93 -0
  791. package/dist/src/services/verdict/envelopes.js +349 -0
  792. package/dist/src/services/verdict/verdict-aggregator.d.ts +94 -0
  793. package/dist/src/services/verdict/verdict-aggregator.js +112 -0
  794. package/dist/src/services/workflow/artifact-paths.d.ts +59 -0
  795. package/dist/src/services/workflow/artifact-paths.js +166 -0
  796. package/dist/src/services/workflow/autonomous-resume-writer.d.ts +16 -0
  797. package/dist/src/services/workflow/autonomous-resume-writer.js +170 -0
  798. package/dist/src/services/workflow/pipeline-verify-service.d.ts +90 -0
  799. package/dist/src/services/workflow/pipeline-verify-service.js +449 -0
  800. package/dist/src/services/workflow/plan-reader.d.ts +29 -0
  801. package/dist/src/services/workflow/plan-reader.js +174 -0
  802. package/dist/src/services/workflow/plan-refresher.d.ts +32 -0
  803. package/dist/src/services/workflow/plan-refresher.js +353 -0
  804. package/dist/src/services/workflow/plan-trigger-detector.d.ts +55 -0
  805. package/dist/src/services/workflow/plan-trigger-detector.js +142 -0
  806. package/dist/src/services/workflow/workflow-autonomous-resume-helpers.d.ts +19 -0
  807. package/dist/src/services/workflow/workflow-autonomous-resume-helpers.js +300 -0
  808. package/dist/src/services/workflow/workflow-autonomous-service.d.ts +100 -0
  809. package/dist/src/services/workflow/workflow-autonomous-service.js +306 -0
  810. package/dist/src/services/workflow/workflow-loader.d.ts +63 -0
  811. package/dist/src/services/workflow/workflow-loader.js +168 -0
  812. package/dist/src/services/workflow/workflow-router-service.d.ts +85 -0
  813. package/dist/src/services/workflow/workflow-router-service.js +227 -0
  814. package/dist/src/services/workflow/workflow-skip-service.d.ts +106 -0
  815. package/dist/src/services/workflow/workflow-skip-service.js +209 -0
  816. package/dist/src/services/workflow/workflow-spec.d.ts +116 -0
  817. package/dist/src/services/workflow/workflow-spec.js +431 -0
  818. package/dist/src/services/workflow/workflow-state-store.d.ts +27 -0
  819. package/dist/src/services/workflow/workflow-state-store.js +95 -0
  820. package/dist/src/services/workspace/claude-settings-template.d.ts +96 -0
  821. package/dist/src/services/workspace/claude-settings-template.js +215 -0
  822. package/dist/src/services/workspace/migrate-1-4-1-service.d.ts +44 -0
  823. package/dist/src/services/workspace/migrate-1-4-1-service.js +195 -0
  824. package/dist/src/services/workspace/migrate-service.d.ts +2 -0
  825. package/dist/src/services/workspace/migrate-service.js +613 -0
  826. package/dist/src/services/workspace/migrate-types.d.ts +127 -0
  827. package/dist/src/services/workspace/migrate-types.js +21 -0
  828. package/dist/src/services/workspace/reconcile-service.d.ts +188 -0
  829. package/dist/src/services/workspace/reconcile-service.js +683 -0
  830. package/dist/src/services/workspace/reconcile-types.d.ts +130 -0
  831. package/dist/src/services/workspace/reconcile-types.js +13 -0
  832. package/dist/src/services/workspace/sid-naming-guard.d.ts +17 -0
  833. package/dist/src/services/workspace/sid-naming-guard.js +34 -0
  834. package/dist/src/services/workspace/workspace-claude-settings-materializer.d.ts +45 -0
  835. package/dist/src/services/workspace/workspace-claude-settings-materializer.js +194 -0
  836. package/dist/src/services/workspace/workspace-clean-service.d.ts +28 -0
  837. package/dist/src/services/workspace/workspace-clean-service.js +46 -0
  838. package/dist/src/services/workspace/workspace-service.d.ts +177 -0
  839. package/dist/src/services/workspace/workspace-service.js +432 -0
  840. package/dist/src/services/workspace/workspace-state-service.d.ts +7 -0
  841. package/dist/src/services/workspace/workspace-state-service.js +43 -0
  842. package/dist/src/shared/format-md-compact.d.ts +32 -0
  843. package/dist/src/shared/format-md-compact.js +297 -0
  844. package/dist/src/shared/frontmatter.d.ts +6 -0
  845. package/dist/src/shared/frontmatter.js +165 -0
  846. package/dist/src/shared/fs-utils.d.ts +4 -0
  847. package/dist/src/shared/fs-utils.js +16 -0
  848. package/dist/src/shared/fs.d.ts +4 -0
  849. package/dist/src/shared/fs.js +26 -0
  850. package/dist/src/shared/incrementing-number.d.ts +23 -0
  851. package/dist/src/shared/incrementing-number.js +68 -0
  852. package/dist/src/shared/json-schema-mini.d.ts +10 -0
  853. package/dist/src/shared/json-schema-mini.js +113 -0
  854. package/dist/src/shared/path-safety.d.ts +21 -0
  855. package/dist/src/shared/path-safety.js +54 -0
  856. package/dist/src/shared/path-utils.d.ts +13 -0
  857. package/dist/src/shared/path-utils.js +56 -0
  858. package/dist/src/shared/paths.d.ts +6 -0
  859. package/dist/src/shared/paths.js +50 -0
  860. package/dist/src/shared/planner-response.d.ts +21 -0
  861. package/dist/src/shared/planner-response.js +26 -0
  862. package/dist/src/shared/platform.d.ts +6 -0
  863. package/dist/src/shared/platform.js +11 -0
  864. package/dist/src/shared/process.d.ts +5 -0
  865. package/dist/src/shared/process.js +12 -0
  866. package/dist/src/shared/result.d.ts +22 -0
  867. package/dist/src/shared/result.js +46 -0
  868. package/dist/src/shared/stale-policy.d.ts +67 -0
  869. package/dist/src/shared/stale-policy.js +85 -0
  870. package/dist/src/shared/version.d.ts +1 -0
  871. package/dist/src/shared/version.js +1 -0
  872. package/output-styles/peaks-skill-swarm.md +132 -0
  873. package/package.json +101 -0
  874. package/schemas/approval-record.schema.json +14 -0
  875. package/schemas/artifact-manifest.schema.json +16 -0
  876. package/schemas/artifact-retention-report.schema.json +38 -0
  877. package/schemas/artifact-workspace.schema.json +22 -0
  878. package/schemas/capability-availability.schema.json +36 -0
  879. package/schemas/capability-item.schema.json +37 -0
  880. package/schemas/capability-source.schema.json +30 -0
  881. package/schemas/change-impact.schema.json +15 -0
  882. package/schemas/context-capsule.schema.json +16 -0
  883. package/schemas/context.schema.json +360 -0
  884. package/schemas/decomposition-v1.json +194 -0
  885. package/schemas/decomposition-v2.json +193 -0
  886. package/schemas/doctor-report.schema.json +34 -0
  887. package/schemas/library-breaking-changes.data.json +141 -0
  888. package/schemas/library-breaking-changes.meta.json +6 -0
  889. package/schemas/library-breaking-changes.schema.json +50 -0
  890. package/schemas/mcp-apply-result.schema.json +46 -0
  891. package/schemas/mcp-install-plan.schema.json +71 -0
  892. package/schemas/mcp-install-spec.schema.json +29 -0
  893. package/schemas/mcp-server.schema.json +29 -0
  894. package/schemas/openspec-change-summary.schema.json +68 -0
  895. package/schemas/openspec-render-request.schema.json +61 -0
  896. package/schemas/openspec-validation-result.schema.json +36 -0
  897. package/schemas/recommendation-plan.schema.json +37 -0
  898. package/schemas/refactor-slice-spec.schema.json +19 -0
  899. package/schemas/replay-fixture.schema.json +158 -0
  900. package/schemas/reviewer-envelope.schema.json +79 -0
  901. package/schemas/sop-manifest.schema.json +52 -0
  902. package/scripts/clean-dist.mjs +8 -0
  903. package/scripts/install-skills.mjs +1202 -0
  904. package/scripts/sync-version.mjs +12 -0
  905. package/scripts/watch.mjs +389 -0
  906. package/skills/peaks-audit/SKILL.md +151 -0
  907. package/skills/peaks-audit/references/6-dimensions.md +141 -0
  908. package/skills/peaks-doctor/SKILL.md +59 -0
  909. package/skills/peaks-doctor/references/doctor-check-catalog.md +31 -0
  910. package/skills/peaks-doctor/references/from-doctor-flow.md +64 -0
  911. package/skills/peaks-doctor/test_prompts.json +17 -0
  912. package/skills/peaks-final-review/SKILL.md +157 -0
  913. package/skills/peaks-final-review/references/4-dimensions.md +117 -0
  914. package/skills/peaks-ide/SKILL.md +161 -0
  915. package/skills/peaks-ide/references/audit-log-helper.md +52 -0
  916. package/skills/peaks-perf-audit/SKILL.md +166 -0
  917. package/skills/peaks-perf-audit/references/audit-protocol.md +173 -0
  918. package/skills/peaks-prd/SKILL.md +319 -0
  919. package/skills/peaks-prd/references/artifact-contracts.md +7 -0
  920. package/skills/peaks-prd/references/artifact-per-request.md +78 -0
  921. package/skills/peaks-prd/references/command-migration.md +3 -0
  922. package/skills/peaks-prd/references/prd-for-multi-pass.md +49 -0
  923. package/skills/peaks-prd/references/workflow.md +43 -0
  924. package/skills/peaks-qa/SKILL.md +240 -0
  925. package/skills/peaks-qa/references/artifact-contracts.md +7 -0
  926. package/skills/peaks-qa/references/artifact-per-request.md +25 -0
  927. package/skills/peaks-qa/references/browser-validation-contracts.md +51 -0
  928. package/skills/peaks-qa/references/codegraph-regression-focus.md +5 -0
  929. package/skills/peaks-qa/references/command-migration.md +3 -0
  930. package/skills/peaks-qa/references/external-capability-guidance.md +9 -0
  931. package/skills/peaks-qa/references/openspec-validation-gate.md +55 -0
  932. package/skills/peaks-qa/references/qa-compact-handoff.md +3 -0
  933. package/skills/peaks-qa/references/qa-context-governance.md +24 -0
  934. package/skills/peaks-qa/references/qa-fanout-contract.md +158 -0
  935. package/skills/peaks-qa/references/qa-gstack-integration.md +7 -0
  936. package/skills/peaks-qa/references/qa-local-artifacts.md +3 -0
  937. package/skills/peaks-qa/references/qa-matt-pocock-integration.md +9 -0
  938. package/skills/peaks-qa/references/qa-perf-test-plan.md +67 -0
  939. package/skills/peaks-qa/references/qa-refactor-role.md +3 -0
  940. package/skills/peaks-qa/references/qa-runbook.md +72 -0
  941. package/skills/peaks-qa/references/qa-security-test-plan.md +73 -0
  942. package/skills/peaks-qa/references/qa-skill-presence.md +22 -0
  943. package/skills/peaks-qa/references/qa-standards-preflight.md +8 -0
  944. package/skills/peaks-qa/references/qa-sub-agent-dispatch.md +46 -0
  945. package/skills/peaks-qa/references/qa-transition-gates.md +86 -0
  946. package/skills/peaks-qa/references/reading-handoff-frontmatter.md +30 -0
  947. package/skills/peaks-qa/references/regression-gates.md +24 -0
  948. package/skills/peaks-qa/references/requirement-boundary-recheck.md +9 -0
  949. package/skills/peaks-qa/references/test-case-generation.md +27 -0
  950. package/skills/peaks-qa/references/test-report-output.md +14 -0
  951. package/skills/peaks-rd/SKILL.md +279 -0
  952. package/skills/peaks-rd/references/artifact-and-standards-output.md +9 -0
  953. package/skills/peaks-rd/references/artifact-contracts.md +7 -0
  954. package/skills/peaks-rd/references/artifact-per-request.md +112 -0
  955. package/skills/peaks-rd/references/browser-action-wrapper.md +39 -0
  956. package/skills/peaks-rd/references/browser-self-test-contracts.md +29 -0
  957. package/skills/peaks-rd/references/code-reviewer-4dim-hint.md +72 -0
  958. package/skills/peaks-rd/references/codegraph-project-analysis.md +5 -0
  959. package/skills/peaks-rd/references/command-migration.md +3 -0
  960. package/skills/peaks-rd/references/compact-handoff.md +3 -0
  961. package/skills/peaks-rd/references/external-references.md +11 -0
  962. package/skills/peaks-rd/references/frontend-project-generation.md +11 -0
  963. package/skills/peaks-rd/references/karpathy-reviewer-prompt.md +2 -0
  964. package/skills/peaks-rd/references/library-version-awareness.md +30 -0
  965. package/skills/peaks-rd/references/mandatory-perf-baseline.md +42 -0
  966. package/skills/peaks-rd/references/matt-pocock-integration.md +11 -0
  967. package/skills/peaks-rd/references/mock-data-placement.md +40 -0
  968. package/skills/peaks-rd/references/ocr-integration.md +229 -0
  969. package/skills/peaks-rd/references/openspec-cli.md +62 -0
  970. package/skills/peaks-rd/references/parallel-review-fanout.md +90 -0
  971. package/skills/peaks-rd/references/rd-context-governance.md +36 -0
  972. package/skills/peaks-rd/references/rd-fanout-contracts.md +216 -0
  973. package/skills/peaks-rd/references/rd-gstack-integration.md +16 -0
  974. package/skills/peaks-rd/references/rd-runbook.md +190 -0
  975. package/skills/peaks-rd/references/rd-standards-preflight.md +8 -0
  976. package/skills/peaks-rd/references/rd-sub-agent-dispatch.md +111 -0
  977. package/skills/peaks-rd/references/rd-transition-gates.md +148 -0
  978. package/skills/peaks-rd/references/reading-v2-slice-results.md +54 -0
  979. package/skills/peaks-rd/references/refactor-workflow.md +39 -0
  980. package/skills/peaks-rd/references/skill-presence-and-title.md +22 -0
  981. package/skills/peaks-rd/references/v2-12-fanout-collapse.md +64 -0
  982. package/skills/peaks-rd/references/writing-handoff-frontmatter.md +68 -0
  983. package/skills/peaks-reviewer/SKILL.md +76 -0
  984. package/skills/peaks-reviewer/references/reviewer-prompt.md +50 -0
  985. package/skills/peaks-reviewer/references/reviewer-schema.md +49 -0
  986. package/skills/peaks-sc/SKILL.md +166 -0
  987. package/skills/peaks-sc/references/artifact-contracts.md +3 -0
  988. package/skills/peaks-sc/references/artifact-retention.md +14 -0
  989. package/skills/peaks-sc/references/command-migration.md +3 -0
  990. package/skills/peaks-sc/references/openspec-commit-boundaries.md +33 -0
  991. package/skills/peaks-security-audit/SKILL.md +167 -0
  992. package/skills/peaks-security-audit/references/audit-protocol.md +175 -0
  993. package/skills/peaks-slice-decompose/SKILL.md +111 -0
  994. package/skills/peaks-slice-decompose/references/cross-pass-edge-interpretation.md +158 -0
  995. package/skills/peaks-slice-decompose/references/granularity-decision.md +129 -0
  996. package/skills/peaks-slice-decompose/references/v2-schema.md +156 -0
  997. package/skills/peaks-solo/SKILL.md +316 -0
  998. package/skills/peaks-solo/references/a2a-artifact-mapping.md +115 -0
  999. package/skills/peaks-solo/references/anchoring-and-session-info.md +34 -0
  1000. package/skills/peaks-solo/references/artifact-contracts.md +65 -0
  1001. package/skills/peaks-solo/references/boundaries.md +21 -0
  1002. package/skills/peaks-solo/references/browser-workflow.md +127 -0
  1003. package/skills/peaks-solo/references/checkpoint-resume.md +70 -0
  1004. package/skills/peaks-solo/references/codegraph-orchestration.md +5 -0
  1005. package/skills/peaks-solo/references/command-migration.md +3 -0
  1006. package/skills/peaks-solo/references/completion-handoff.md +18 -0
  1007. package/skills/peaks-solo/references/context-governance.md +204 -0
  1008. package/skills/peaks-solo/references/cross-date-session-check.md +67 -0
  1009. package/skills/peaks-solo/references/dag-orchestrator.md +56 -0
  1010. package/skills/peaks-solo/references/envelope-contract.md +130 -0
  1011. package/skills/peaks-solo/references/existing-system-extraction.md +78 -0
  1012. package/skills/peaks-solo/references/external-references.md +17 -0
  1013. package/skills/peaks-solo/references/external-skill-invocation.md +72 -0
  1014. package/skills/peaks-solo/references/fanout-mandatory.md +109 -0
  1015. package/skills/peaks-solo/references/fast-mode.md +23 -0
  1016. package/skills/peaks-solo/references/frontend-only-mode.md +87 -0
  1017. package/skills/peaks-solo/references/gstack-integration.md +7 -0
  1018. package/skills/peaks-solo/references/headroom-integration.md +107 -0
  1019. package/skills/peaks-solo/references/local-artifact-workspace.md +79 -0
  1020. package/skills/peaks-solo/references/micro-cycle.md +316 -0
  1021. package/skills/peaks-solo/references/mode-selection-with-stale-presence.md +124 -0
  1022. package/skills/peaks-solo/references/mode-selection.md +21 -0
  1023. package/skills/peaks-solo/references/openspec-workflow.md +81 -0
  1024. package/skills/peaks-solo/references/periodic-checkpoint.md +71 -0
  1025. package/skills/peaks-solo/references/playwright-mcp-multi-terminal.md +114 -0
  1026. package/skills/peaks-solo/references/project-memory-loading.md +17 -0
  1027. package/skills/peaks-solo/references/project-scan-checklist.md +136 -0
  1028. package/skills/peaks-solo/references/quality-gate-cheatsheet.md +13 -0
  1029. package/skills/peaks-solo/references/refactor-mode.md +24 -0
  1030. package/skills/peaks-solo/references/resume-detection.md +63 -0
  1031. package/skills/peaks-solo/references/runbook.md +188 -0
  1032. package/skills/peaks-solo/references/skill-presence-and-title.md +31 -0
  1033. package/skills/peaks-solo/references/standards-preflight.md +23 -0
  1034. package/skills/peaks-solo/references/step-0-55-1x-detection.md +82 -0
  1035. package/skills/peaks-solo/references/sub-agent-dispatch.md +334 -0
  1036. package/skills/peaks-solo/references/swarm-dispatch-contract.md +230 -0
  1037. package/skills/peaks-solo/references/workflow-gates-and-types.md +186 -0
  1038. package/skills/peaks-solo/references/workflow.md +38 -0
  1039. package/skills/peaks-solo-resume/SKILL.md +81 -0
  1040. package/skills/peaks-solo-status/SKILL.md +120 -0
  1041. package/skills/peaks-solo-test/SKILL.md +84 -0
  1042. package/skills/peaks-sop/SKILL.md +209 -0
  1043. package/skills/peaks-sop/references/sop-authoring.md +161 -0
  1044. package/skills/peaks-txt/SKILL.md +303 -0
  1045. package/skills/peaks-txt/references/artifact-contracts.md +7 -0
  1046. package/skills/peaks-txt/references/command-migration.md +3 -0
  1047. package/skills/peaks-txt/references/context-capsule.md +21 -0
  1048. package/skills/peaks-ui/SKILL.md +369 -0
  1049. package/skills/peaks-ui/references/artifact-contracts.md +3 -0
  1050. package/skills/peaks-ui/references/artifact-per-request.md +71 -0
  1051. package/skills/peaks-ui/references/command-migration.md +3 -0
  1052. package/skills/peaks-ui/references/workflow.md +27 -0
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: peaks-doctor
3
+ description: Orchestrate peaks-cli's L3 doctor (peaks audit + peaks doctor + peaks openspec from-doctor) for project health. Use when the user asks for a project health check, doctor report, audit, or wants to convert doctor findings into OpenSpec change records. Coordinates the L2 audit framework + the L3.2 doctor + the L3.3 from-doctor proposal generator. Triggers on `/peaks-doctor`, "peaks doctor", "项目健康", "doctor report", "health check", "check the project", "audit my repo".
4
+ internal: true
5
+ ---
6
+ ---
7
+
8
+ # Peaks-Cli Doctor
9
+
10
+ Peaks-Cli Doctor is the orchestration facade for the L3 doctor workflow. It runs the L2 audit framework (`peaks audit red-lines`) + the L3.2 doctor checks (`peaks doctor`) + the L3.3 from-doctor proposal generator (`peaks openspec from-doctor`). Use it when the user wants a project health check, a red-line audit, or to convert doctor findings into OpenSpec change records.
11
+
12
+ ## Skill-first architecture note (read once, internalise)
13
+
14
+ This skill is the **primary surface**. The `peaks <cmd>` CLI is **auxiliary** — invoked by the skill prompt only when a primitive is the right tool. Behaviour only an LLM in a skill prompt would use lives **here in the SKILL.md**, not as a new CLI command. See `.claude/rules/common/dev-preference.md` for the decision template.
15
+
16
+ ## Code-Change Red Line (BLOCKING — read before ANY tool call)
17
+
18
+ **Peaks-Cli Doctor is a doctor orchestrator, NOT an implementer. You MUST NOT write, edit, or modify any application source code directly.**
19
+
20
+ The doctor workflow is read-only by design. It produces:
21
+ - `peaks audit red-lines` report (121 red lines in the current repo, 6 cli-backed)
22
+ - `peaks doctor` report (69 checks: 68 pass, 1 fail — L3:l3-memory-health)
23
+ - Optional OpenSpec change records via `peaks openspec from-doctor`
24
+
25
+ If a doctor finding requires a code change, the workflow hands off to `peaks-rd` (or `peaks-solo` for the full pipeline). The doctor itself does NOT modify code.
26
+
27
+ ## Workflow (5 steps)
28
+
29
+ 1. **Anchor**: `peaks workspace init --project <repo> --json` (idempotent; same as every peaks-* skill).
30
+ 2. **Run audit**: `peaks audit red-lines --project <repo> --json` — returns the red-line audit (catalog-matched markers + live enforcer findings). Inspect the `enforcerFindings` array for runtime-detected issues.
31
+ 3. **Run doctor**: `peaks doctor --json` — returns 69 checks. Pay special attention to:
32
+ - `L3:l3-orphan-sessions` — invalid sids in .peaks/_runtime/
33
+ - `L3:l3-memory-health` — .peaks/memory/index.json shape
34
+ - `integration:gateguard-peaks-conflict` — third-party Edit/Write hook interference
35
+ - `build:workspace-layout-canonical` — workspace layout
36
+ 4. **Triage findings**: For each FAIL check, decide:
37
+ - **Real bug requiring fix** → hand off to peaks-rd (run `peaks openspec from-doctor` first to generate a draft proposal; then peaks-rd to implement)
38
+ - **Acceptable false positive** → document in the handoff; do not act
39
+ - **Configuration drift** → run the suggested recovery command (e.g. `peaks workspace clean`)
40
+ 5. **Generate proposals** (per FAIL finding): `peaks openspec from-doctor --project <repo> --check-id <id>` writes `openspec/changes/<date>-fix-<slug>/proposal.md`. Hand off to peaks-rd for implementation.
41
+
42
+ ## CLI primitives the skill composes
43
+
44
+ - `peaks workspace init` — anchor the workspace (Step 0)
45
+ - `peaks audit red-lines` — L2 audit
46
+ - `peaks doctor` — L3.2 doctor
47
+ - `peaks openspec from-doctor` — L3.3 proposal generator
48
+ - `peaks openspec validate` — gate a draft proposal
49
+
50
+ ## Boundaries
51
+
52
+ - The doctor is read-only. It does NOT modify code, fix bugs, or clean up sessions.
53
+ - The doctor does NOT install UA or any third-party tool. The opt-in UX is surfaced via `peaks understand opt-in`; the doctor just reports state.
54
+ - The doctor does NOT generate change records automatically; it surfaces findings + the LLM calls `peaks openspec from-doctor` to generate them.
55
+
56
+ ## References
57
+
58
+ - `references/doctor-check-catalog.md` — every doctor check id + what it means
59
+ - `references/from-doctor-flow.md` — the end-to-end "finding → proposal" path
@@ -0,0 +1,31 @@
1
+ # Doctor check catalog (peaks-doctor skill reference)
2
+
3
+ Slice L3.2 ships 69 doctor checks. The most user-relevant ones:
4
+
5
+ ## L2 audit (slice #2)
6
+
7
+ - **`L2:audit:cli-backed`** — count of red lines whose catalog match has a real enforcer
8
+ - **`L2:audit:prose-only`** — count of red lines that need a future enforcer
9
+
10
+ ## L3.2 (slice #9)
11
+
12
+ - **`L3:l3-orphan-sessions`** — directories in `.peaks/_runtime/` that fail `isValidSessionId`. Recover with `peaks workspace clean`.
13
+ - **`L3:l3-memory-health`** — `.peaks/memory/index.json` must be well-formed JSON with a `schema_version` field and an array `entries`. Recovers by re-running `peaks memory extract`.
14
+
15
+ ## Build / workspace
16
+
17
+ - **`build:dist-version-matches-source`** — `dist/src/shared/version.js` matches the source `package.json` version
18
+ - **`build:workspace-layout-canonical`** — `.peaks/` follows the canonical `._archive` / `_runtime` / `_sub_agents` layout
19
+ - **`build:workspace-migrate-not-needed`** — when the layout is already canonical
20
+
21
+ ## Integration (third-party hooks)
22
+
23
+ - **`integration:gateguard-peaks-conflict`** — warns when `gateguard-fact-force` is installed without a `.peaks/**` skip pattern (the 3rd-party hook would block all peaks-qa .peaks/ artifact writes)
24
+
25
+ ## Skills
26
+
27
+ - **`skill:<required-skill>`** — each required skill (peaks-ide, peaks-prd, peaks-rd, peaks-qa, peaks-sc, peaks-solo, peaks-sop, peaks-txt, peaks-ui, peaks-doctor) must be installed in the bundled skills dir
28
+
29
+ ## Doctor self
30
+
31
+ - **`doctor-self:check-id-pattern`** — all check IDs match the `doctor-report.schema.json` regex pattern (prevents typos like `L3:l3-orphan-sesions`)
@@ -0,0 +1,64 @@
1
+ # from-doctor flow (peaks-doctor skill reference)
2
+
3
+ End-to-end path from a doctor finding to an OpenSpec change record.
4
+
5
+ ## Flow
6
+
7
+ ```
8
+ peaks doctor --json # 1. discover findings
9
+ ↓
10
+ match: any check where ok=false
11
+ ↓
12
+ peaks openspec from-doctor \
13
+ --project <repo> \
14
+ --check-id <id> # 2. generate draft proposal
15
+ ↓
16
+ openspec/changes/<date>-fix-<slug>/proposal.md # 3. LLM reviews + edits
17
+ ↓
18
+ peaks openspec validate <change-id> # 4. gate
19
+ ↓
20
+ [next slice: peaks-rd implements the change per the proposal]
21
+ ```
22
+
23
+ ## Example
24
+
25
+ ```bash
26
+ # Discover
27
+ $ peaks doctor --json | jq '.data.checks[] | select(.ok==false) | .id'
28
+ "L3:l3-memory-health"
29
+
30
+ # Generate draft
31
+ $ peaks openspec from-doctor \
32
+ --project . \
33
+ --check-id L3:l3-memory-health \
34
+ --json
35
+ {
36
+ "ok": true,
37
+ "command": "openspec.from-doctor",
38
+ "data": {
39
+ "changeId": "2026-06-11-fix-l3-l3-memory-health",
40
+ "proposalPath": ".../openspec/changes/2026-06-11-fix-l3-l3-memory-health/proposal.md",
41
+ "created": true
42
+ }
43
+ }
44
+
45
+ # LLM reviews + edits the draft (in this case: add a Why section
46
+ # explaining the missing schema_version field; add an Acceptance
47
+ # Criterion that requires peaks doctor to return ok=true for the check)
48
+
49
+ # Validate
50
+ $ peaks openspec validate 2026-06-11-fix-l3-l3-memory-health --json
51
+ {
52
+ "ok": true,
53
+ "data": { "valid": true, "issues": [] }
54
+ }
55
+
56
+ # Implement (peaks-rd)
57
+ $ /peaks-rd 2026-06-11-fix-l3-l3-memory-health
58
+ ```
59
+
60
+ ## Edge cases
61
+
62
+ - **CHECK_ALREADY_PASSING**: `--check-id` matches a passing check. The CLI returns code CHECK_ALREADY_PASSING. Pick a failing check.
63
+ - **CHECK_NOT_FOUND**: `--check-id` doesn't match any check id. Run `peaks doctor --json | jq '.data.checks[].id'` to list.
64
+ - **OPENSPEC_FROM_DOCTOR_FAILED**: filesystem write error (e.g. openspec/ not initialized). Run `peaks openspec init --apply` first.
@@ -0,0 +1,17 @@
1
+ [
2
+ {
3
+ "id": "doctor-baseline",
4
+ "prompt": "/peaks-doctor",
5
+ "expectedOutcome": "Runs peaks workspace init + peaks audit + peaks doctor; returns a triage of FAIL checks with hand-off suggestions."
6
+ },
7
+ {
8
+ "id": "doctor-from-finding",
9
+ "prompt": "peaks doctor flagged L3:l3-memory-health. Generate an OpenSpec change record from it.",
10
+ "expectedOutcome": "Calls peaks openspec from-doctor --check-id L3:l3-memory-health; verifies the proposal.md was written; suggests next step (peaks-rd)."
11
+ },
12
+ {
13
+ "id": "doctor-only-audit",
14
+ "prompt": "Run only the audit (not the full doctor).",
15
+ "expectedOutcome": "Calls peaks audit red-lines --project . --json; summarizes the enforcerFindings and the prose-only ratio."
16
+ }
17
+ ]
@@ -0,0 +1,157 @@
1
+ ---
2
+ name: peaks-final-review
3
+ description: Final-review skill for Peaks. Use when a workflow needs to assemble 4-dimension business-review evidence (functional-completeness, problem-resolution, no-new-bugs, existing-functionality-intact) for human acceptance at the end of an autonomous slice. Triggers on "/peaks-final-review", "prepare final review", "4-dim review", or peaks-solo end-of-workflow handoff.
4
+ ---
5
+
6
+ ## Single-scope-axis naming convention
7
+
8
+ > **Read once at the top of this file; the rest of the skill is written against it.**
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.
11
+
12
+ # Peaks-Cli Final Review
13
+
14
+ Prepare 4-dim business review evidence for human acceptance. The LLM does the work; the human judges the outcome.
15
+
16
+ ## Service entry point (authoritative)
17
+
18
+ The single source of truth for the 4-dim review is the service:
19
+
20
+ ```ts
21
+ // src/services/final-review/final-review-service.ts
22
+ export async function prepareFinalReview(
23
+ rid: string,
24
+ opts: PrepareFinalReviewOptions
25
+ ): Promise<FinalReviewOutput>;
26
+ ```
27
+
28
+ Where `PrepareFinalReviewOptions` is:
29
+
30
+ ```ts
31
+ interface PrepareFinalReviewOptions {
32
+ readonly projectRoot: string;
33
+ readonly sessionId: string;
34
+ readonly llmRunner: LlmRunner; // imported from src/services/audit/audit-goal-service.js
35
+ }
36
+ ```
37
+
38
+ The service is the **gate primitive** that closes the 10% human / 90% LLM loop. It reads the approved audit-goal JSON from `.peaks/_runtime/<sessionId>/audit-goal/<rid>.json`, calls an injected `LlmRunner` exactly once with a 4-dim review prompt, parses the response, and validates that all four required dimensions are present. It throws `IncompleteFinalReviewError` on malformed JSON or missing dimensions — callers MUST treat that as a gate failure (return to human for re-prompting) and never let autonomous work proceed on a partial review.
39
+
40
+ > The `LlmRunner` interface is intentionally minimal so this service reuses the same provider injection seam as `audit-goal-service` and the slice LLMArbitrator (`src/services/audit/audit-goal-service.ts:16`). No provider implementation is baked in at this layer.
41
+
42
+ ## Precondition
43
+
44
+ All of the following MUST be true before invoking this skill:
45
+
46
+ - **RD complete** — implementation merged and the slice boundary recorded at `.peaks/sc/slice-decomposition/<rid>.json` (or `peaks slice check --rid <rid> --json` returns `pass`).
47
+ - **QA complete** — `test-cases` + `test-reports` + `security-findings` + `performance-findings` present under `.peaks/_runtime/<sessionId>/qa/...` and all applicable gates A/A2/A3/A4/B/C/E/F satisfied (per `skills/peaks-qa/references/qa-transition-gates.md`).
48
+ - **Security check complete** — slice 025 project-level security test plan executed; no open CRITICAL/HIGH findings.
49
+ - **Performance baseline complete** — slice 025 project-level perf baseline recorded; no regression beyond the agreed threshold.
50
+ - **Approved audit-goal on disk** — `.peaks/_runtime/<sessionId>/audit-goal/<rid>.json` exists and contains `successCriteria` (the service feeds these into the LLM user prompt verbatim).
51
+
52
+ If any precondition is missing, **STOP** and route back to the responsible skill. Do not paper over a missing artifact with a hand-written successCriteria — the review must reflect what the human originally approved.
53
+
54
+ ## Invocation (CLI wrapper status — READ FIRST)
55
+
56
+ > **Pre-flight finding (HARD):** The plan prose at `docs/superpowers/plans/2026-06-25-slice-topology-multipass-phase-4.md:146` documents the invocation as:
57
+ >
58
+ > ```bash
59
+ > peaks prepare-final-review --rid <rid> --json
60
+ > ```
61
+ >
62
+ > **This CLI command does NOT yet exist.** `prepareFinalReview()` is implemented as a service in `src/services/final-review/final-review-service.ts` and is unit-tested in `tests/unit/final-review/final-review-service.test.ts`, but it is **not wired to a CLI subcommand**. A `peaks prepare-final-review` subcommand is the planned forward-looking surface; the integration sits at the service layer, not the CLI layer, today.
63
+ >
64
+ > **Pick for the future CLI wrapper file (audit recommendation):** create a new `src/cli/commands/final-review-commands.ts` matching the `peaks-<group>-commands.ts` naming convention (`qa-commands.ts`, `code-review-commands.ts`, `audit-commands.ts`). A grep of `src/cli/commands/` confirms NO `final-review-commands.ts` and NO `prepareFinalReview` import in any CLI file. Rationale: the 4-dim business review is conceptually distinct from `peaks qa *` (which is autonomous gate verification) — it is the human-acceptance terminator, not an internal gate. A separate command group preserves that boundary.
65
+
66
+ ### Current call path (today, until a CLI wrapper is built)
67
+
68
+ ```ts
69
+ // peaks-solo end-of-workflow, peaks-txt, or any other hand-rolled caller
70
+ import { prepareFinalReview } from './src/services/final-review/final-review-service.js';
71
+ import { auditGoalLlmRunner } from './src/services/audit/llm-runner.js'; // or your provider
72
+
73
+ const out = await prepareFinalReview('<rid>', {
74
+ projectRoot: '<absolute path>',
75
+ sessionId: '<sessionId>',
76
+ llmRunner: auditGoalLlmRunner
77
+ });
78
+ ```
79
+
80
+ ### Planned call path (after the CLI wrapper lands)
81
+
82
+ ```bash
83
+ # Forward-looking — does not work yet. Track under
84
+ # src/cli/commands/final-review-commands.ts
85
+ peaks prepare-final-review --rid <rid> [--session-id <sid>] --json
86
+ ```
87
+
88
+ `--rid` is required and resolves to `.peaks/_runtime/<sessionId>/audit-goal/<rid>.json`. `--json` is required for machine consumption (peaks-solo, peaks-txt, downstream CI). The wrapper will resolve `--session-id` from `.peaks/_runtime/current-change` when omitted, matching the workspace binding pattern used by `peaks request *`.
89
+
90
+ ## Output
91
+
92
+ A `FinalReviewOutput` (`src/services/final-review/final-review-types.ts:50`):
93
+
94
+ ```ts
95
+ interface FinalReviewOutput {
96
+ readonly rid: string;
97
+ readonly generatedAt: string; // ISO timestamp
98
+ readonly dimensions: readonly DimensionEvidence[]; // EXACTLY 4
99
+ readonly overallSummary: string; // one paragraph
100
+ readonly allPass: boolean; // all 4 verdicts === 'pass'
101
+ readonly needsAttention: readonly DimensionKind[]; // dims that are 'fail' or 'inconclusive'
102
+ }
103
+ ```
104
+
105
+ Each `DimensionEvidence` carries:
106
+
107
+ - `dimension` — one of the four required `DimensionKind` values
108
+ - `verdict` — `pass | fail | inconclusive`
109
+ - `summary` — one short paragraph
110
+ - `evidence` — list of `EvidenceItem` (`{ kind, description, artifact?, link? }`) with `EvidenceKind` ∈ `test-result | test-coverage | manual-spot-check | pre-post-diff | regression-suite | ac-mapping`
111
+ - `confidence` — `high | medium | low`
112
+
113
+ The service enforces that **all 4 dimensions are present**; a missing dimension throws `IncompleteFinalReviewError` and the call is a gate failure. Treat `allPass === true` + empty `needsAttention` as a clean handoff to the human. Anything else — `allPass === false`, a `fail` verdict, or an `inconclusive` verdict — must come back to the LLM loop with a re-prompt (do not ask the human to interpret raw LLM output).
114
+
115
+ ## The 4 dimensions (one-line summary)
116
+
117
+ Full evidence contract per dimension: `references/4-dimensions.md`.
118
+
119
+ 1. **functional-completeness** — every AC from the approved audit-goal maps to a passing test (`evidence.kind === 'ac-mapping'` + `test-result`).
120
+ 2. **problem-resolution** — there is a targeted test for the original problem case (`evidence.kind === 'test-result'` against the original repro).
121
+ 3. **no-new-bugs** — the regression suite is green AND the LLM surfaces 0 net-new failures (`evidence.kind === 'regression-suite'` + `manual-spot-check`).
122
+ 4. **existing-functionality-intact** — a pre/post baseline diff (test count, public API surface, key behavior) shows no unintended drift (`evidence.kind === 'pre-post-diff'`).
123
+
124
+ ## Human's role
125
+
126
+ The human reviews evidence, **judges business outcomes (NOT code)**. The LLM produces structured evidence; the human's job is to:
127
+
128
+ - confirm that `allPass === true` corresponds to the business outcome they actually want (not just "tests are green");
129
+ - decide what to do with `needsAttention` items — accept the LLM's verdict, override a `pass` to `fail` when the evidence is weak, or send the slice back to RD with a re-prompt;
130
+ - gate the release / archive action based on `allPass` + their own business review, not just on the LLM signal.
131
+
132
+ The LLM does NOT decide whether the work is shipped. The LLM only assembles evidence. The human is the final reviewer of business outcomes; the service is the gate that gives them structured evidence to review.
133
+
134
+ ## Boundaries
135
+
136
+ - Do not modify the audit-goal at `.peaks/_runtime/<sessionId>/audit-goal/<rid>.json` — the service reads it as-is. If criteria need to change, route back to `peaks-audit` and re-approve.
137
+ - Do not call `prepareFinalReview()` twice for the same `(rid, sessionId)` without first surfacing the prior result to the human. Each call costs one LLM invocation and may diverge.
138
+ - Do not substitute the 4-dim review for the QA gate family (A/A2/A3/A4/B/C/E/F). The 4-dim review is a human-acceptance surface, not a regression gate. QA gates must pass first.
139
+ - Do not write the review output to git. The LLM output is ephemeral — keep it under `.peaks/_runtime/<sessionId>/final-review/<rid>.json` (gitignored) and reference it from the change-id-scoped handoff at `.peaks/_runtime/<changeId>/handoff/<rid>-<change-id>.md` if downstream review needs it.
140
+ - Do not allow autonomous work to proceed on a `IncompleteFinalReviewError` — that is a gate failure, not a recoverable runtime error.
141
+
142
+ ## Compact handoff
143
+
144
+ When handing off, emit: rid, `allPass`, `needsAttention[]`, output path, source service version (commit hash of `src/services/final-review/final-review-service.ts`), LLM provider used, and one-line summary. Link to the full `FinalReviewOutput` JSON instead of pasting it.
145
+
146
+ ## References
147
+
148
+ | File | Coverage |
149
+ |---|---|
150
+ | `references/4-dimensions.md` | Per-dimension evidence contract, verdict semantics, examples. |
151
+ | `src/services/final-review/final-review-service.ts` | Authoritative service implementation. |
152
+ | `src/services/final-review/final-review-types.ts` | `FinalReviewOutput`, `DimensionEvidence`, verdict/evidence/confidence enums. |
153
+ | `src/services/audit/audit-goal-service.ts:16` | Line of evidence that `LlmRunner` is reusable across audit + final-review (service-level integration). |
154
+ | `tests/unit/final-review/final-review-service.test.ts` | Existing service-level unit tests (5 cases). |
155
+ | `docs/superpowers/plans/2026-06-25-slice-topology-multipass-phase-4.md:127` | Phase-4 plan prose (Task 14). |
156
+ | `skills/peaks-qa/SKILL.md` | Upstream QA skill — 4-dim review is downstream of all QA gates. |
157
+ | `skills/peaks-audit/SKILL.md` | Sibling skill — produces the `audit-goal` JSON that this skill consumes. |
@@ -0,0 +1,117 @@
1
+ # 4 Dimensions — Final Review
2
+
3
+ This reference defines the evidence contract, verdict semantics, and worked examples for the four `DimensionKind` values the LLM must produce in `FinalReviewOutput.dimensions[]`. The authoritative types live at `src/services/final-review/final-review-types.ts`. Verdict values: `pass | fail | inconclusive` (the type-level enum). `inconclusive` is the wire-level name; the human-facing label is **needs-human** — the human must judge this dimension rather than accept the LLM's verdict.
4
+
5
+ When the service at `src/services/final-review/final-review-service.ts` returns `allPass === true` and `needsAttention` is empty, every dimension was judged `pass`. Anything else surfaces to the human for review.
6
+
7
+ ---
8
+
9
+ ## 1. functional-completeness
10
+
11
+ ### Definition
12
+
13
+ Every acceptance criterion in the approved audit-goal at `.peaks/_runtime/<sessionId>/audit-goal/<rid>.json` is realized by at least one passing test, and no AC is left dangling. The LLM is asserting that the slice delivers what the human originally asked for, not just that "something was built."
14
+
15
+ ### Evidence the LLM must produce
16
+
17
+ - An `ac-mapping` `EvidenceItem` for every AC in the approved goal's `successCriteria[]`. Each item references the AC by ID (e.g. `AC-1`) and the test file or test name that exercises it.
18
+ - A `test-result` `EvidenceItem` summarizing the run (e.g. `vitest run src/services/<x>` → 12/12 pass). `artifact` should be the report path; `link` the run URL when CI is involved.
19
+ - A `test-coverage` `EvidenceItem` if the project maintains a coverage threshold for the changed surface. Cover only what is gated by the project's own standards; do not invent thresholds.
20
+
21
+ ### Verdict semantics
22
+
23
+ - `pass` — every AC has a passing test and the test suite is green.
24
+ - `fail` — one or more ACs are unmapped, the targeted test is failing, or the suite is red on a non-flaky ground.
25
+ - `inconclusive` (needs-human) — the mapping is plausible but the human needs to confirm that a passing test truly reflects the business intent of an AC. Example: a test exists for "config-service splits into 3 modules" but the human must decide whether the *seam* the test exercises is the seam they actually wanted.
26
+
27
+ ### Example
28
+
29
+ > `dimension: "functional-completeness"`, `verdict: "pass"`, `summary: "All 3 success criteria from the approved goal are covered by passing tests. AC-1 covered by config-service.modules.test.ts; AC-2 covered by config-service.api.test.ts (public API snapshot unchanged); AC-3 covered by coverage report at 100% lines/branches for the changed files."`, `evidence: [...]`, `confidence: "high"`.
30
+
31
+ ---
32
+
33
+ ## 2. problem-resolution
34
+
35
+ ### Definition
36
+
37
+ The original problem case the slice was opened to fix has a targeted test that fails without the fix and passes with it. This is the most concrete dimension — it asks the LLM to prove the slice actually solves the specific problem on the record, not a generic improvement.
38
+
39
+ ### Evidence the LLM must produce
40
+
41
+ - A `test-result` `EvidenceItem` naming the targeted test (e.g. `tests/integration/<surface>/regression-XXX.test.ts`) with the repro steps encoded as test assertions, and the post-fix result (pass).
42
+ - A `manual-spot-check` `EvidenceItem` when the original problem was a UI or operator-facing behavior that cannot be unit-tested cleanly. `artifact` should point to the recorded evidence (screenshot, log capture, transcript).
43
+ - An `ac-mapping` `EvidenceItem` linking the targeted test back to the original problem statement (e.g. the audit-goal's `proposedGoal` or the human's verbatim "fix X" wording). Without that link, the test is just coverage, not problem-resolution evidence.
44
+
45
+ ### Verdict semantics
46
+
47
+ - `pass` — there is a targeted test that proves the original case is fixed AND that test is currently green.
48
+ - `fail` — there is no targeted test, the targeted test is red, or the targeted test does not actually reproduce the original problem (e.g. it tests an adjacent but different case).
49
+ - `inconclusive` (needs-human) — the targeted test exists and is green, but the human must confirm the test does reproduce the problem they originally reported. Example: the LLM fixed a config-file write race but the targeted test exercises a slightly different code path than the user's reproducer.
50
+
51
+ ### Example
52
+
53
+ > `dimension: "problem-resolution"`, `verdict: "pass"`, `summary: "Targeted test repros the original config-write race (concurrent writes to the same key) and now passes deterministically. The test fails on the pre-fix commit and passes on the post-fix commit."`, `evidence: [{ kind: "test-result", description: "tests/integration/config-write-race.test.ts — 200/200 deterministic", artifact: "tests/integration/config-write-race.test.ts" }, { kind: "ac-mapping", description: "Maps to the user's reported repro: 'concurrent config writes corrupt the file'" }]`, `confidence: "high"`.
54
+
55
+ ---
56
+
57
+ ## 3. no-new-bugs
58
+
59
+ ### Definition
60
+
61
+ The slice did not introduce net-new failures. The pre-existing regression suite is green AND the LLM performed targeted spot-checks on surfaces adjacent to the change (imported modules, callers, fixtures, type signatures). A green regression suite alone is insufficient — a slice can "fix" one thing while breaking an adjacent surface that no test directly covers.
62
+
63
+ ### Evidence the LLM must produce
64
+
65
+ - A `regression-suite` `EvidenceItem` showing the full suite is green on the post-fix commit, with the run command and the aggregate pass/fail/skip count.
66
+ - One or more `manual-spot-check` `EvidenceItem` entries for each adjacent surface the LLM inspected (e.g. "called `config-service.resolve()` from a downstream consumer in a 30-second smoke run; output identical to the pre-fix golden"). List the surfaces explicitly.
67
+ - A `test-result` `EvidenceItem` for any newly-added test that targets the changed surface's direct neighbors (callers, importers, shared fixtures).
68
+
69
+ ### Verdict semantics
70
+
71
+ - `pass` — regression suite is green AND every adjacent surface the LLM spot-checked behaves correctly.
72
+ - `fail` — the regression suite is red OR a spot-check surfaced a behavior change that is not part of the slice's scope (out-of-scope regression).
73
+ - `inconclusive` (needs-human) — the regression suite is green but at least one adjacent surface was either not spot-checked or surfaced a behavior the LLM cannot rule out as intentional. The human judges whether the behavior is acceptable drift or a hidden bug.
74
+
75
+ ### Example
76
+
77
+ > `dimension: "no-new-bugs"`, `verdict: "pass"`, `summary: "Full vitest suite green (2417/2417). Spot-checked 4 adjacent surfaces: callers in src/cli/commands/*, the resolve() consumer in src/services/runtime-bootstrap, the schema fixtures in tests/fixtures/config, and the type signatures exposed via the index file — all behaviorally identical to the pre-fix golden."`, `evidence: [...]`, `confidence: "high"`.
78
+
79
+ ---
80
+
81
+ ## 4. existing-functionality-intact
82
+
83
+ ### Definition
84
+
85
+ A pre/post baseline diff shows no unintended drift in the test surface, public API, or key behavior. This is the structural counterpart to `no-new-bugs`: where `no-new-bugs` is "I ran the suite and spot-checked," this dimension is "I compared the structural shape of the project before and after the slice." The two dimensions can both pass and tell complementary stories — a green suite with a shrinking public API is still a regression in `existing-functionality-intact`.
86
+
87
+ ### Evidence the LLM must produce
88
+
89
+ - A `pre-post-diff` `EvidenceItem` with a concrete diff artifact: a test-count diff (e.g. `+12 / -3`), a public-API surface diff (e.g. a snapshot of exported symbols from the package's main entry), or a behavior-baseline diff (e.g. golden output of an end-to-end happy path).
90
+ - A `test-result` `EvidenceItem` for any existing test that touched the changed surface, confirming it still passes on the post-fix commit.
91
+ - A `manual-spot-check` `EvidenceItem` for any behavioral baseline that is not covered by a test (e.g. CLI help text, error message format) — the LLM must record the pre and post values.
92
+
93
+ ### Verdict semantics
94
+
95
+ - `pass` — every measured dimension (tests, API, behavior) is unchanged or changed only in ways that the slice was explicitly authorized to change (e.g. AC-2 says "add a new exported helper `resolveWithSchema()`" — that IS the authorized change).
96
+ - `fail` — an unauthorized change slipped in: an exported symbol disappeared, a test was deleted rather than updated, a behavior baseline drifted without a corresponding AC.
97
+ - `inconclusive` (needs-human) — a change is present that *could* be authorized drift or *could* be an unintentional regression. The human rules.
98
+
99
+ ### Example
100
+
101
+ > `dimension: "existing-functionality-intact"`, `verdict: "pass"`, `summary: "Public API snapshot: 0 symbols removed, 1 symbol added (resolveWithSchema — authorized by AC-2). Test count: +12 (new tests for resolveWithSchema), -3 (deleted tests for the old monolithic resolve that resolveWithSchema supersedes). CLI help text byte-identical to pre-fix golden."`, `evidence: [{ kind: "pre-post-diff", description: "Public API surface diff: +resolveWithSchema, -3 obsolete test files, no other deltas", artifact: ".peaks/_runtime/<sessionId>/final-review/api-diff.txt" }]`, `confidence: "high"`.
102
+
103
+ ---
104
+
105
+ ## How `allPass` and `needsAttention` are computed
106
+
107
+ The service contract (`src/services/final-review/final-review-service.ts:23-31` and `:88-93`):
108
+
109
+ - `allPass === true` iff every dimension's `verdict === 'pass'`.
110
+ - `needsAttention` is the list of dimension names whose verdict is `fail` or `inconclusive`. The LLM does NOT need to populate it — the service enforces presence of all 4 dimensions and the human-facing summarizer (in peaks-solo or peaks-txt) computes `needsAttention` for display.
111
+ - An `IncompleteFinalReviewError` is thrown when JSON is malformed or any required dimension is missing. That is a **gate failure**, not a `fail` verdict — the LLM call is invalid and must be re-prompted, not surfaced to the human.
112
+
113
+ ## Confidence and what it means
114
+
115
+ - `high` — evidence is concrete (named test file, named artifact, deterministic run).
116
+ - `medium` — evidence is concrete but covers only part of the dimension; the LLM is being honest about coverage gaps.
117
+ - `inconclusive` verdicts should always be `medium` or `low` confidence; `high` confidence on `inconclusive` is a contradiction and the LLM should be re-prompted.
@@ -0,0 +1,161 @@
1
+ ---
2
+ name: peaks-ide
3
+ description: Orchestrate peaks-cli's IDE-aware behavior (hooks + statusline + handle) for a user's specific IDE. Detects the current state (which IDE the user is on, what peaks has already installed), plans the install / switch / status / uninstall actions, and invokes the existing peaks CLI primitives. Triggers on `/peaks-ide`, "set up peaks for my IDE", "switch peaks to Trae", "what did peaks install", "uninstall peaks hooks". Sits between the user and `peaks hooks install` / `peaks statusline install` / `peaks hook handle` — those are the CLI primitives; this skill is the user-facing surface.
4
+ internal: true
5
+ ---
6
+ ---
7
+
8
+ # Peaks-Cli IDE Setup (peaks-ide)
9
+
10
+ `peaks-ide` is the **user-facing surface** for everything peaks-cli does that's IDE-aware. It does NOT introduce new CLI commands. It orchestrates the existing CLI primitives — `peaks hooks install`, `peaks statusline install`, `peaks hook handle` — based on the user's intent and the IDE the user is on.
11
+
12
+ **Why this exists (dev-preference red line):** "skill is primary, CLI is auxiliary." The behavior that only an LLM in a skill prompt would use ("detect which IDE the user is on", "plan the migration steps", "ask the user before destructive actions") lives in this SKILL.md, not in a new `peaks <cmd>`. The CLI commands stay as atomic primitives the skill composes.
13
+
14
+ **Slice #2 scope:** the first version supports Trae (alongside Claude Code, the only other adapter in slice #2's registry). Cursor / Codex / Qoder / Tongyi Lingma will land in slice #3+ — the skill will pick them up automatically because the underlying auto-detect (the `peaks project dashboard --json` flow internally calls `listAdapterIds()` via the `IdeRegistry`) registers them as the registry grows.
15
+
16
+ ## Skill presence (MANDATORY first action)
17
+
18
+ ```bash
19
+ peaks skill presence:set peaks-ide --project <repo> --mode <mode> --gate startup
20
+ peaks project memories --project <repo> --json # load durable memory
21
+ ```
22
+
23
+ The presence marker tells the global peaks status line that peaks-ide is orchestrating. The memory read pulls forward the slice #1 contract: `peaks <cmd> --project <path>` is the canonical project-root source; `process.env[adapter.envVar]` (e.g. `CLAUDE_PROJECT_DIR`, `TRAE_PROJECT_DIR`) is the env-var override for auto-detect.
24
+
25
+ ## Step 1: detect current state
26
+
27
+ The skill's first move is to **read**, not to ask. Build a complete picture of the user's IDE environment before any AskUserQuestion.
28
+
29
+ ```bash
30
+ # 1. What adapters are registered? (slice #2 ships with claude-code + trae)
31
+ peaks project dashboard --project <repo> --json
32
+
33
+ # 2. Is the user on Claude Code, Trae, or something else?
34
+ # Check the cwd for adapter-specific directories:
35
+ ls -la <repo>/.claude 2>/dev/null && echo "claude-code detected"
36
+ ls -la <repo>/.trae 2>/dev/null && echo "trae detected"
37
+
38
+ # 3. Are peaks hooks already installed? For each candidate, read settings.json:
39
+ # claude: <root>/.claude/settings.json
40
+ # trae: <root>/.trae/settings.json
41
+ peaks hooks status --project <repo> --json 2>/dev/null
42
+ peaks statusline status --project <repo> --json 2>/dev/null
43
+ ```
44
+
45
+ The skill composes a 1-2 sentence **state summary** before asking anything:
46
+
47
+ > "I see you're on **Trae** (`.trae/` exists in the project root). peaks hooks are **not installed** yet. peaks statusline is **not installed** either. The `peaks hook handle` runtime is available as a CLI primitive — you don't need to install it separately; what needs installing is the settings.json entries that point to it."
48
+
49
+ The user gets a complete picture without having to answer any question. The next step only fires AskUserQuestion if intent is genuinely ambiguous.
50
+
51
+ ## Step 2: AskUserQuestion (only if intent is ambiguous)
52
+
53
+ If the user typed `/peaks-ide` without context, the skill's intent is genuinely ambiguous. The four canonical intents are:
54
+
55
+ | Option | What it does |
56
+ |---|---|
57
+ | First-time install | Run `peaks hooks install` + `peaks statusline install` for the detected IDE |
58
+ | Switch to a different IDE | Detect current install, uninstall from old IDE, install on new IDE (e.g. Claude → Trae) |
59
+ | Show current status | Just print the state summary from Step 1; no side effects |
60
+ | Uninstall peaks hooks | Run `peaks hooks uninstall` + `peaks statusline uninstall` for the detected IDE |
61
+
62
+ **Default option is "Show current status"** — the cheapest action, and the user gets useful output even if they didn't know what they wanted. AskUserQuestion is the ONLY place this skill asks anything. All destructive paths (Switch, Uninstall) gate on user confirmation here.
63
+
64
+ ## Step 3: plan & preview (dry-run)
65
+
66
+ Before any side effect, the skill prints the exact CLI invocations it will run. This is the "see before you leap" step.
67
+
68
+ ```
69
+ Plan: First-time install for Trae (.trae/ detected in project root)
70
+
71
+ 1. peaks hooks install --project <repo>
72
+ → writes a beforeToolCall hook entry to <root>/.trae/settings.json
73
+ that points to `peaks hook handle --project "${TRAE_PROJECT_DIR}"`
74
+
75
+ 2. peaks statusline install --project <repo>
76
+ → writes a statusLine field with command `peaks statusline`
77
+
78
+ 3. (no third command — `peaks hook handle` is the runtime; once the
79
+ settings.json entries point to it, the user's Trae will invoke it
80
+ on every PreToolUse event)
81
+
82
+ Verification: after install, re-run `peaks hooks status --project <repo>`
83
+ to confirm the entries are present.
84
+
85
+ Proceed? (Y/n)
86
+ ```
87
+
88
+ The plan MUST be human-readable. Don't run a side effect until the user confirms.
89
+
90
+ ## Step 4: execute
91
+
92
+ For each step in the plan, invoke the CLI primitive. The skill does NOT call out to a hidden script — it runs the actual peaks CLI commands, so the user sees the same output they'd see typing the command themselves.
93
+
94
+ ```bash
95
+ # Example: first-time Trae install
96
+ peaks hooks install --project <repo>
97
+ peaks statusline install --project <repo>
98
+
99
+ # After each command, check the exit code. If non-zero, STOP and report
100
+ # the failure to the user. The skill does NOT auto-rollback; the user
101
+ # decides what to do next.
102
+ ```
103
+
104
+ For destructive paths (Switch, Uninstall), the skill uses a **transactional pattern**: it captures the current state, runs the destructive CLI, then runs the install CLI; if any step fails, it reports the partial state and lets the user decide.
105
+
106
+ ## Step 5: audit log
107
+
108
+ Every successful execution writes one JSON line to `.peaks/_runtime/<sid>/ide-onboard.log`:
109
+
110
+ ```json
111
+ {"timestamp":"2026-06-06T19:55:00Z","intent":"first-time-install","detected_ide":"trae","cli_invocations":["peaks hooks install --project <repo>","peaks statusline install --project <repo>"],"outcome":"success","session_id":"2026-06-06-session-22f08c"}
112
+ ```
113
+
114
+ The audit log is **machine-readable** (so `peaks project dashboard` can read it and surface "you installed peaks for Trae on 2026-06-06") and **human-readable** (so the user can `cat` it to see the install history). The skill does NOT write the log file itself — it delegates to `peaks project dashboard` (the canonical log writer, per the dev-preference red line "skill-first for workflow, CLI-backed for gates / side effects"). The audit log writer is a CLI primitive, not a per-skill helper; the skill body MUST NOT introduce a new `peaks <cmd>` for the log writer. The thin helper that writes the log is `scripts/peaks-ide-audit-log.mjs`; see [audit-log-helper.md](references/audit-log-helper.md) for its CLI surface and contract.
115
+
116
+ ## Boundaries
117
+
118
+ `peaks-ide` may:
119
+
120
+ - detect the current IDE (cwd + env var + settings.json)
121
+ - ask the user via AskUserQuestion (Step 2 only)
122
+ - preview the CLI invocations (Step 3)
123
+ - execute existing peaks CLI commands (Step 4)
124
+ - write a single line to the audit log (Step 5)
125
+
126
+ `peaks-ide` must NOT:
127
+
128
+ - introduce new `peaks <cmd>` CLI commands (dev-preference red line: "Default-no on new CLI commands")
129
+ - bypass the user's confirmation on destructive paths (Switch / Uninstall)
130
+ - write the settings.json directly (the CLI primitives own that)
131
+ - run other peaks skills (peaks-solo, peaks-qa, etc.) — those are separate skills with their own scopes
132
+ - handle multi-IDE scenarios in slice #2 (e.g. "I use Claude at work and Trae at home" — the registry is single-IDE per session; a future slice could add multi-IDE)
133
+
134
+ ## Reference: the CLI primitives the skill composes
135
+
136
+ - `peaks hooks install` / `peaks hooks uninstall` / `peaks hooks status` — adapter-driven; auto-detects IDE from env / stdin / cwd
137
+ - `peaks statusline install` / `peaks statusline uninstall` / `peaks statusline status` — same
138
+ - `peaks hook handle` — the runtime handler; not installed, just invoked
139
+ - `peaks project dashboard --json` — surfaces the current state summary
140
+ - `peaks skill runbook` — surfaces the peaks-ide skill body for inspection
141
+
142
+ ## Next-step references
143
+
144
+ - The slice #1 RD artifact at `.peaks/_runtime/<sid>/rd/requests/002-2026-06-06-peaks-ide-skeleton.md` documents the slim `IdeAdapter` shape that the skill is built on.
145
+ - The slice #2 PRD at `.peaks/_runtime/<sid>/prd/requests/002-2026-06-06-trae-adapter-and-peaks-ide-skill.md` documents the 13 ACs this skill is part of.
146
+ - The slice #2 RD artifact (in flight) documents the implementation contract.
147
+
148
+ ## Default runbook
149
+
150
+ The skill is invoked as `/peaks-ide` or via the natural-language triggers listed in the frontmatter. The runbook is the body of this SKILL.md (steps 1-5 plus the boundaries and reference sections above); the runbook-service extracts the section between this `## Default runbook` heading and the next `##` heading.
151
+
152
+ When the user types `/peaks-ide` (or "set up peaks for my IDE" / "switch peaks to Trae" / "what did peaks install" / "uninstall peaks hooks"), execute Steps 1 → 5 in order:
153
+
154
+ 1. **Skill presence (MANDATORY first action)**: `peaks skill presence:set peaks-ide --project <repo> --gate startup` and `peaks project memories --project <repo> --json` (load durable memory).
155
+ 2. **Detect current state** (Step 1 above): `peaks project dashboard --project <repo> --json` + `peaks hooks status --project <repo> --json` + `peaks statusline status --project <repo> --json` + `ls -la <repo>/.claude 2>/dev/null` + `ls -la <repo>/.trae 2>/dev/null`. Build a 1-2 sentence state summary.
156
+ 3. **AskUserQuestion** (Step 2 above, only if intent is ambiguous). Default option: "Show current status". Destructive paths (Switch, Uninstall) gate on user confirmation here.
157
+ 4. **Plan & preview** (Step 3 above): print the exact `peaks hooks install` / `peaks statusline install` invocations before running them. Wait for "Proceed? (Y/n)".
158
+ 5. **Execute** (Step 4 above): run the `peaks hooks install` / `peaks statusline install` (or uninstall / status) commands. Stop on non-zero exit. Do not auto-rollback.
159
+ 6. **Audit log** (Step 5 above): delegate the JSONL write to `peaks project dashboard` (the canonical log writer; per the dev-preference red line, the skill MUST NOT introduce a new CLI primitive for the log writer).
160
+
161
+ CLI primitives the skill composes (per the "Reference" section above): `peaks skill presence:set`, `peaks project memories`, `peaks project dashboard`, `peaks hooks install` / `uninstall` / `status`, `peaks statusline install` / `uninstall` / `status`, `peaks hook handle`, `peaks skill runbook`. The skill does NOT introduce any new `peaks <cmd>` command.