peaks-loop 3.1.1 → 4.0.0-beta

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 (308) hide show
  1. package/.claude-plugin/marketplace.json +62 -12
  2. package/CHANGELOG.md +74 -36
  3. package/README-en.md +58 -240
  4. package/README.md +49 -325
  5. package/agents/karpathy-reviewer.md +3 -3
  6. package/dist/src/cli/cli-helpers.d.ts +18 -0
  7. package/dist/src/cli/cli-helpers.js +8 -0
  8. package/dist/src/cli/commands/adapter-commands.d.ts +30 -0
  9. package/dist/src/cli/commands/adapter-commands.js +35 -0
  10. package/dist/src/cli/commands/context-commands.d.ts +1 -1
  11. package/dist/src/cli/commands/context-commands.js +1 -1
  12. package/dist/src/cli/commands/contract-commands.d.ts +1 -1
  13. package/dist/src/cli/commands/contract-commands.js +1 -1
  14. package/dist/src/cli/commands/core/session-command.js +12 -0
  15. package/dist/src/cli/commands/core/skill-command.js +4 -4
  16. package/dist/src/cli/commands/dispatch-commands.js +2 -2
  17. package/dist/src/cli/commands/job-commands.js +58 -5
  18. package/dist/src/cli/commands/observability-commands.js +1 -1
  19. package/dist/src/cli/commands/perf-audit-commands.js +2 -2
  20. package/dist/src/cli/commands/security-audit-commands.js +2 -2
  21. package/dist/src/cli/commands/sediment-commands.d.ts +80 -0
  22. package/dist/src/cli/commands/sediment-commands.js +640 -0
  23. package/dist/src/cli/commands/session-migrate-skill-name.d.ts +17 -0
  24. package/dist/src/cli/commands/session-migrate-skill-name.js +41 -0
  25. package/dist/src/cli/commands/skill-visibility.d.ts +8 -0
  26. package/dist/src/cli/commands/skill-visibility.js +63 -0
  27. package/dist/src/cli/commands/slice-commands.js +2 -2
  28. package/dist/src/cli/commands/solo-commands.d.ts +2 -2
  29. package/dist/src/cli/commands/solo-commands.js +246 -20
  30. package/dist/src/cli/commands/sub-agent-commands.d.ts +1 -1
  31. package/dist/src/cli/commands/sub-agent-commands.js +1 -1
  32. package/dist/src/cli/commands/understand-commands.js +1 -1
  33. package/dist/src/cli/commands/upgrade-commands.d.ts +1 -1
  34. package/dist/src/cli/commands/upgrade-commands.js +3 -3
  35. package/dist/src/cli/commands/user-touchpoint-commands.js +1 -1
  36. package/dist/src/cli/commands/verdict-aggregate-command.d.ts +1 -1
  37. package/dist/src/cli/commands/verdict-aggregate-command.js +2 -2
  38. package/dist/src/cli/commands/workflow-commands.js +2 -2
  39. package/dist/src/cli/commands/workspace/init-command.d.ts +3 -3
  40. package/dist/src/cli/commands/workspace/init-command.js +7 -7
  41. package/dist/src/cli/program.js +19 -2
  42. package/dist/src/services/adapter/adapter.d.ts +27 -0
  43. package/dist/src/services/adapter/adapter.js +5 -0
  44. package/dist/src/services/adapter/auto-adapter.d.ts +11 -0
  45. package/dist/src/services/adapter/auto-adapter.js +15 -0
  46. package/dist/src/services/adapter/claude-adapter.d.ts +14 -0
  47. package/dist/src/services/adapter/claude-adapter.js +40 -0
  48. package/dist/src/services/adapter/codex-adapter.d.ts +14 -0
  49. package/dist/src/services/adapter/codex-adapter.js +14 -0
  50. package/dist/src/services/adapter/copilot-adapter.d.ts +14 -0
  51. package/dist/src/services/adapter/copilot-adapter.js +14 -0
  52. package/dist/src/services/audit/enforcers/solo-code-ban.d.ts +1 -1
  53. package/dist/src/services/audit/enforcers/solo-code-ban.js +2 -2
  54. package/dist/src/services/audit/red-line-catalog.js +1 -1
  55. package/dist/src/services/audit/scanners/skills-tree-scanner.js +22 -0
  56. package/dist/src/services/context/auto-compact-dispatcher.d.ts +1 -1
  57. package/dist/src/services/dispatch/batch-counter.js +1 -1
  58. package/dist/src/services/dispatch/leak-detector.js +1 -1
  59. package/dist/src/services/doctor/doctor-service.js +2 -2
  60. package/dist/src/services/job/job-progress-store.d.ts +60 -0
  61. package/dist/src/services/job/job-progress-store.js +70 -0
  62. package/dist/src/services/job/job-resource-snapshot.js +29 -1
  63. package/dist/src/services/job/job-types.d.ts +4 -4
  64. package/dist/src/services/memory/project-memory-service.js +1 -1
  65. package/dist/src/services/migrate-skill-name/migrate.d.ts +17 -0
  66. package/dist/src/services/migrate-skill-name/migrate.js +152 -0
  67. package/dist/src/services/migrate-skill-name/schema.d.ts +42 -0
  68. package/dist/src/services/migrate-skill-name/schema.js +25 -0
  69. package/dist/src/services/observability/aggregation.d.ts +1 -1
  70. package/dist/src/services/observability/aggregation.js +1 -1
  71. package/dist/src/services/perf/perf-baseline-service.d.ts +1 -1
  72. package/dist/src/services/perf/perf-baseline-service.js +1 -1
  73. package/dist/src/services/prd/handoff-types.d.ts +1 -1
  74. package/dist/src/services/prd/handoff-types.js +1 -1
  75. package/dist/src/services/progress/progress-service.d.ts +1 -1
  76. package/dist/src/services/progress/progress-service.js +1 -1
  77. package/dist/src/services/rd/standards-diagnostic.js +1 -1
  78. package/dist/src/services/recommendations/capability-seed-mappings.js +1 -1
  79. package/dist/src/services/sc/sc-service.js +1 -1
  80. package/dist/src/services/sediment/dispose-confirm.d.ts +9 -0
  81. package/dist/src/services/sediment/dispose-confirm.js +5 -0
  82. package/dist/src/services/sediment/json-schema.d.ts +247 -0
  83. package/dist/src/services/sediment/json-schema.js +26 -0
  84. package/dist/src/services/sediment/manifest-lint.d.ts +13 -0
  85. package/dist/src/services/sediment/manifest-lint.js +11 -0
  86. package/dist/src/services/sediment/pool-paths.d.ts +22 -0
  87. package/dist/src/services/sediment/pool-paths.js +25 -0
  88. package/dist/src/services/sediment/pool-read.d.ts +20 -0
  89. package/dist/src/services/sediment/pool-read.js +73 -0
  90. package/dist/src/services/sediment/pool-rebuild-index.d.ts +15 -0
  91. package/dist/src/services/sediment/pool-rebuild-index.js +28 -0
  92. package/dist/src/services/sediment/pool-write.d.ts +14 -0
  93. package/dist/src/services/sediment/pool-write.js +25 -0
  94. package/dist/src/services/sediment/promotion-gate.d.ts +12 -0
  95. package/dist/src/services/sediment/promotion-gate.js +20 -0
  96. package/dist/src/services/sediment/types.d.ts +52 -0
  97. package/dist/src/services/sediment/types.js +1 -0
  98. package/dist/src/services/session/binding-store.d.ts +1 -1
  99. package/dist/src/services/session/binding-store.js +1 -1
  100. package/dist/src/services/session/caller-id-types.d.ts +1 -1
  101. package/dist/src/services/session/session-manager.d.ts +1 -1
  102. package/dist/src/services/session/session-manager.js +1 -1
  103. package/dist/src/services/skill/resume-detector.js +1 -1
  104. package/dist/src/services/skill/skill-scheduler.d.ts +1 -1
  105. package/dist/src/services/skill/skill-scheduler.js +1 -1
  106. package/dist/src/services/skillhub/release-diff.d.ts +18 -0
  107. package/dist/src/services/skillhub/release-diff.js +38 -0
  108. package/dist/src/services/skillhub/release-export.d.ts +8 -0
  109. package/dist/src/services/skillhub/release-export.js +31 -0
  110. package/dist/src/services/skillhub/release-gc-blobs.d.ts +13 -0
  111. package/dist/src/services/skillhub/release-gc-blobs.js +32 -0
  112. package/dist/src/services/skillhub/release-import.d.ts +7 -0
  113. package/dist/src/services/skillhub/release-import.js +59 -0
  114. package/dist/src/services/skillhub/release-retain.d.ts +23 -0
  115. package/dist/src/services/skillhub/release-retain.js +89 -0
  116. package/dist/src/services/skillhub/sqlite-store.d.ts +22 -0
  117. package/dist/src/services/skillhub/sqlite-store.js +47 -0
  118. package/dist/src/services/skillhub/tar-runtime.d.ts +21 -0
  119. package/dist/src/services/skillhub/tar-runtime.js +91 -0
  120. package/dist/src/services/skillhub/types.d.ts +105 -0
  121. package/dist/src/services/skillhub/types.js +1 -0
  122. package/dist/src/services/skills/skill-conformance-service.js +8 -5
  123. package/dist/src/services/skills/skill-presence-service.d.ts +4 -4
  124. package/dist/src/services/skills/skill-presence-service.js +2 -2
  125. package/dist/src/services/skills/skill-registry.js +27 -0
  126. package/dist/src/services/skills/skill-runbook-service.js +2 -2
  127. package/dist/src/services/slice/slice-check-service.js +1 -1
  128. package/dist/src/services/slice/slice-check-types.d.ts +1 -1
  129. package/dist/src/services/slice/slice-check-types.js +1 -1
  130. package/dist/src/services/slice/slice-decompose-types.d.ts +1 -1
  131. package/dist/src/services/slice/slice-decompose-types.js +1 -1
  132. package/dist/src/services/solo/auto-compact-orchestrator.d.ts +1 -1
  133. package/dist/src/services/solo/auto-compact-orchestrator.js +2 -2
  134. package/dist/src/services/solo/dag-orchestrator.d.ts +3 -3
  135. package/dist/src/services/solo/dag-orchestrator.js +4 -4
  136. package/dist/src/services/solo/emit-handoff.d.ts +49 -0
  137. package/dist/src/services/solo/emit-handoff.js +79 -0
  138. package/dist/src/services/solo/mode-gate.d.ts +2 -2
  139. package/dist/src/services/solo/post-compact-detector.js +2 -2
  140. package/dist/src/services/solo/status-line-renderer.d.ts +4 -4
  141. package/dist/src/services/solo/step-08-gate.d.ts +90 -0
  142. package/dist/src/services/solo/step-08-gate.js +136 -0
  143. package/dist/src/services/standards/missing-standards-detector.d.ts +1 -1
  144. package/dist/src/services/standards/missing-standards-detector.js +1 -1
  145. package/dist/src/services/standards/project-standards-service.d.ts +1 -1
  146. package/dist/src/services/standards/project-standards-service.js +4 -4
  147. package/dist/src/services/understand/understand-types.d.ts +1 -1
  148. package/dist/src/services/upgrade/1x-detector-service.js +1 -1
  149. package/dist/src/services/upgrade/upgrade-service.d.ts +34 -0
  150. package/dist/src/services/upgrade/upgrade-service.js +52 -30
  151. package/dist/src/services/verdict/verdict-aggregator.d.ts +1 -1
  152. package/dist/src/services/workflow/workflow-router-service.d.ts +1 -1
  153. package/dist/src/services/workflow/workflow-router-service.js +3 -3
  154. package/dist/src/services/workspace/claude-settings-template.d.ts +7 -2
  155. package/dist/src/services/workspace/claude-settings-template.js +42 -3
  156. package/dist/src/services/workspace/workspace-claude-settings-materializer.d.ts +1 -1
  157. package/dist/src/services/workspace/workspace-claude-settings-materializer.js +1 -1
  158. package/dist/src/services/workspace/workspace-service.d.ts +4 -4
  159. package/dist/src/services/workspace/workspace-service.js +2 -2
  160. package/dist/src/shared/paths.d.ts +1 -1
  161. package/dist/src/shared/paths.js +1 -1
  162. package/dist/src/shared/version.d.ts +1 -1
  163. package/dist/src/shared/version.js +1 -1
  164. package/dist/src/skills/peaks-maker/index.d.ts +5 -0
  165. package/dist/src/skills/peaks-maker/index.js +32 -0
  166. package/package.json +8 -3
  167. package/scripts/install-skills.mjs +29 -4
  168. package/skills/{peaks-prd → bee/peaks-prd}/SKILL.md +8 -2
  169. package/skills/{peaks-prd → bee/peaks-prd}/references/workflow.md +1 -1
  170. package/skills/{peaks-qa → bee/peaks-qa}/SKILL.md +10 -4
  171. package/skills/{peaks-qa → bee/peaks-qa}/references/browser-validation-contracts.md +2 -2
  172. package/skills/{peaks-qa → bee/peaks-qa}/references/external-capability-guidance.md +1 -1
  173. package/skills/{peaks-qa → bee/peaks-qa}/references/qa-fanout-contract.md +3 -3
  174. package/skills/{peaks-qa → bee/peaks-qa}/references/qa-sub-agent-dispatch.md +1 -1
  175. package/skills/{peaks-rd → bee/peaks-rd}/SKILL.md +13 -6
  176. package/skills/{peaks-rd → bee/peaks-rd}/references/browser-self-test-contracts.md +1 -1
  177. package/skills/{peaks-rd → bee/peaks-rd}/references/mock-data-placement.md +1 -1
  178. package/skills/{peaks-rd → bee/peaks-rd}/references/parallel-review-fanout.md +1 -1
  179. package/skills/{peaks-rd → bee/peaks-rd}/references/rd-runbook.md +1 -1
  180. package/skills/{peaks-rd → bee/peaks-rd}/references/rd-sub-agent-dispatch.md +2 -2
  181. package/skills/{peaks-rd → bee/peaks-rd}/references/rd-transition-gates.md +1 -1
  182. package/skills/{peaks-rd → bee/peaks-rd}/references/skill-presence-and-title.md +1 -1
  183. package/skills/{peaks-reviewer → bee/peaks-reviewer}/SKILL.md +2 -2
  184. package/skills/{peaks-sc → bee/peaks-sc}/SKILL.md +7 -1
  185. package/skills/{peaks-txt → bee/peaks-txt}/SKILL.md +9 -3
  186. package/skills/{peaks-ui → bee/peaks-ui}/SKILL.md +11 -5
  187. package/skills/peaks-audit/SKILL.md +1 -1
  188. package/skills/{peaks-solo → peaks-code}/SKILL.md +53 -104
  189. package/skills/{peaks-solo → peaks-code}/references/a2a-artifact-mapping.md +2 -2
  190. package/skills/{peaks-solo → peaks-code}/references/anchoring-and-session-info.md +4 -4
  191. package/skills/{peaks-solo → peaks-code}/references/artifact-contracts.md +2 -2
  192. package/skills/{peaks-solo → peaks-code}/references/browser-workflow.md +1 -1
  193. package/skills/peaks-code/references/command-migration.md +3 -0
  194. package/skills/{peaks-solo → peaks-code}/references/completion-handoff.md +2 -2
  195. package/skills/{peaks-solo → peaks-code}/references/context-governance.md +2 -2
  196. package/skills/{peaks-solo → peaks-code}/references/frontend-only-mode.md +1 -1
  197. package/skills/{peaks-solo → peaks-code}/references/local-artifact-workspace.md +1 -1
  198. package/skills/{peaks-solo → peaks-code}/references/micro-cycle.md +9 -9
  199. package/skills/{peaks-solo → peaks-code}/references/mode-selection-with-stale-presence.md +12 -12
  200. package/skills/{peaks-solo → peaks-code}/references/mode-selection.md +1 -1
  201. package/skills/{peaks-solo → peaks-code}/references/openspec-workflow.md +1 -1
  202. package/skills/{peaks-solo → peaks-code}/references/project-scan-checklist.md +1 -1
  203. package/skills/{peaks-solo → peaks-code}/references/refactor-mode.md +1 -1
  204. package/skills/{peaks-solo → peaks-code}/references/resume-detection.md +1 -1
  205. package/skills/{peaks-solo → peaks-code}/references/runbook.md +25 -5
  206. package/skills/{peaks-solo → peaks-code}/references/skill-presence-and-title.md +3 -3
  207. package/skills/{peaks-solo → peaks-code}/references/standards-preflight.md +1 -1
  208. package/skills/{peaks-solo → peaks-code}/references/step-0-55-1x-detection.md +5 -5
  209. package/skills/peaks-code/references/step-0-8-gate.md +60 -0
  210. package/skills/{peaks-solo → peaks-code}/references/sub-agent-dispatch.md +10 -10
  211. package/skills/{peaks-solo → peaks-code}/references/swarm-dispatch-contract.md +7 -7
  212. package/skills/{peaks-solo → peaks-code}/references/workflow-gates-and-types.md +3 -3
  213. package/skills/peaks-doctor/SKILL.md +1 -1
  214. package/skills/peaks-doctor/references/doctor-check-catalog.md +1 -1
  215. package/skills/peaks-final-review/SKILL.md +3 -3
  216. package/skills/peaks-final-review/references/4-dimensions.md +1 -1
  217. package/skills/peaks-ide/SKILL.md +1 -1
  218. package/skills/{peaks-solo-resume → peaks-resume}/SKILL.md +14 -14
  219. package/skills/peaks-sop/SKILL.md +1 -1
  220. package/skills/{peaks-solo-status → peaks-status}/SKILL.md +13 -13
  221. package/skills/{peaks-solo-test → peaks-test}/SKILL.md +11 -11
  222. package/skills/peaks-solo/references/command-migration.md +0 -3
  223. /package/skills/{peaks-perf-audit → bee/peaks-perf-audit}/SKILL.md +0 -0
  224. /package/skills/{peaks-perf-audit → bee/peaks-perf-audit}/references/audit-protocol.md +0 -0
  225. /package/skills/{peaks-prd → bee/peaks-prd}/references/artifact-contracts.md +0 -0
  226. /package/skills/{peaks-prd → bee/peaks-prd}/references/artifact-per-request.md +0 -0
  227. /package/skills/{peaks-prd → bee/peaks-prd}/references/command-migration.md +0 -0
  228. /package/skills/{peaks-prd → bee/peaks-prd}/references/prd-for-multi-pass.md +0 -0
  229. /package/skills/{peaks-qa → bee/peaks-qa}/references/artifact-contracts.md +0 -0
  230. /package/skills/{peaks-qa → bee/peaks-qa}/references/artifact-per-request.md +0 -0
  231. /package/skills/{peaks-qa → bee/peaks-qa}/references/codegraph-regression-focus.md +0 -0
  232. /package/skills/{peaks-qa → bee/peaks-qa}/references/command-migration.md +0 -0
  233. /package/skills/{peaks-qa → bee/peaks-qa}/references/openspec-validation-gate.md +0 -0
  234. /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-compact-handoff.md +0 -0
  235. /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-context-governance.md +0 -0
  236. /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-gstack-integration.md +0 -0
  237. /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-local-artifacts.md +0 -0
  238. /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-matt-pocock-integration.md +0 -0
  239. /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-perf-test-plan.md +0 -0
  240. /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-refactor-role.md +0 -0
  241. /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-runbook.md +0 -0
  242. /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-security-test-plan.md +0 -0
  243. /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-skill-presence.md +0 -0
  244. /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-standards-preflight.md +0 -0
  245. /package/skills/{peaks-qa → bee/peaks-qa}/references/qa-transition-gates.md +0 -0
  246. /package/skills/{peaks-qa → bee/peaks-qa}/references/reading-handoff-frontmatter.md +0 -0
  247. /package/skills/{peaks-qa → bee/peaks-qa}/references/regression-gates.md +0 -0
  248. /package/skills/{peaks-qa → bee/peaks-qa}/references/requirement-boundary-recheck.md +0 -0
  249. /package/skills/{peaks-qa → bee/peaks-qa}/references/test-case-generation.md +0 -0
  250. /package/skills/{peaks-qa → bee/peaks-qa}/references/test-report-output.md +0 -0
  251. /package/skills/{peaks-rd → bee/peaks-rd}/references/artifact-and-standards-output.md +0 -0
  252. /package/skills/{peaks-rd → bee/peaks-rd}/references/artifact-contracts.md +0 -0
  253. /package/skills/{peaks-rd → bee/peaks-rd}/references/artifact-per-request.md +0 -0
  254. /package/skills/{peaks-rd → bee/peaks-rd}/references/browser-action-wrapper.md +0 -0
  255. /package/skills/{peaks-rd → bee/peaks-rd}/references/code-reviewer-4dim-hint.md +0 -0
  256. /package/skills/{peaks-rd → bee/peaks-rd}/references/codegraph-project-analysis.md +0 -0
  257. /package/skills/{peaks-rd → bee/peaks-rd}/references/command-migration.md +0 -0
  258. /package/skills/{peaks-rd → bee/peaks-rd}/references/compact-handoff.md +0 -0
  259. /package/skills/{peaks-rd → bee/peaks-rd}/references/external-references.md +0 -0
  260. /package/skills/{peaks-rd → bee/peaks-rd}/references/frontend-project-generation.md +0 -0
  261. /package/skills/{peaks-rd → bee/peaks-rd}/references/karpathy-reviewer-prompt.md +0 -0
  262. /package/skills/{peaks-rd → bee/peaks-rd}/references/library-version-awareness.md +0 -0
  263. /package/skills/{peaks-rd → bee/peaks-rd}/references/mandatory-perf-baseline.md +0 -0
  264. /package/skills/{peaks-rd → bee/peaks-rd}/references/matt-pocock-integration.md +0 -0
  265. /package/skills/{peaks-rd → bee/peaks-rd}/references/ocr-integration.md +0 -0
  266. /package/skills/{peaks-rd → bee/peaks-rd}/references/openspec-cli.md +0 -0
  267. /package/skills/{peaks-rd → bee/peaks-rd}/references/rd-context-governance.md +0 -0
  268. /package/skills/{peaks-rd → bee/peaks-rd}/references/rd-fanout-contracts.md +0 -0
  269. /package/skills/{peaks-rd → bee/peaks-rd}/references/rd-gstack-integration.md +0 -0
  270. /package/skills/{peaks-rd → bee/peaks-rd}/references/rd-standards-preflight.md +0 -0
  271. /package/skills/{peaks-rd → bee/peaks-rd}/references/reading-v2-slice-results.md +0 -0
  272. /package/skills/{peaks-rd → bee/peaks-rd}/references/refactor-workflow.md +0 -0
  273. /package/skills/{peaks-rd → bee/peaks-rd}/references/v2-12-fanout-collapse.md +0 -0
  274. /package/skills/{peaks-rd → bee/peaks-rd}/references/writing-handoff-frontmatter.md +0 -0
  275. /package/skills/{peaks-reviewer → bee/peaks-reviewer}/references/reviewer-prompt.md +0 -0
  276. /package/skills/{peaks-reviewer → bee/peaks-reviewer}/references/reviewer-schema.md +0 -0
  277. /package/skills/{peaks-sc → bee/peaks-sc}/references/artifact-contracts.md +0 -0
  278. /package/skills/{peaks-sc → bee/peaks-sc}/references/artifact-retention.md +0 -0
  279. /package/skills/{peaks-sc → bee/peaks-sc}/references/command-migration.md +0 -0
  280. /package/skills/{peaks-sc → bee/peaks-sc}/references/openspec-commit-boundaries.md +0 -0
  281. /package/skills/{peaks-security-audit → bee/peaks-security-audit}/SKILL.md +0 -0
  282. /package/skills/{peaks-security-audit → bee/peaks-security-audit}/references/audit-protocol.md +0 -0
  283. /package/skills/{peaks-txt → bee/peaks-txt}/references/artifact-contracts.md +0 -0
  284. /package/skills/{peaks-txt → bee/peaks-txt}/references/command-migration.md +0 -0
  285. /package/skills/{peaks-txt → bee/peaks-txt}/references/context-capsule.md +0 -0
  286. /package/skills/{peaks-ui → bee/peaks-ui}/references/artifact-contracts.md +0 -0
  287. /package/skills/{peaks-ui → bee/peaks-ui}/references/artifact-per-request.md +0 -0
  288. /package/skills/{peaks-ui → bee/peaks-ui}/references/command-migration.md +0 -0
  289. /package/skills/{peaks-ui → bee/peaks-ui}/references/workflow.md +0 -0
  290. /package/skills/{peaks-solo → peaks-code}/references/boundaries.md +0 -0
  291. /package/skills/{peaks-solo → peaks-code}/references/checkpoint-resume.md +0 -0
  292. /package/skills/{peaks-solo → peaks-code}/references/codegraph-orchestration.md +0 -0
  293. /package/skills/{peaks-solo → peaks-code}/references/cross-date-session-check.md +0 -0
  294. /package/skills/{peaks-solo → peaks-code}/references/dag-orchestrator.md +0 -0
  295. /package/skills/{peaks-solo → peaks-code}/references/envelope-contract.md +0 -0
  296. /package/skills/{peaks-solo → peaks-code}/references/existing-system-extraction.md +0 -0
  297. /package/skills/{peaks-solo → peaks-code}/references/external-references.md +0 -0
  298. /package/skills/{peaks-solo → peaks-code}/references/external-skill-invocation.md +0 -0
  299. /package/skills/{peaks-solo → peaks-code}/references/fanout-mandatory.md +0 -0
  300. /package/skills/{peaks-solo → peaks-code}/references/fast-mode.md +0 -0
  301. /package/skills/{peaks-solo → peaks-code}/references/gstack-integration.md +0 -0
  302. /package/skills/{peaks-solo → peaks-code}/references/headroom-integration.md +0 -0
  303. /package/skills/{peaks-solo → peaks-code}/references/job-loop.md +0 -0
  304. /package/skills/{peaks-solo → peaks-code}/references/periodic-checkpoint.md +0 -0
  305. /package/skills/{peaks-solo → peaks-code}/references/playwright-mcp-multi-terminal.md +0 -0
  306. /package/skills/{peaks-solo → peaks-code}/references/project-memory-loading.md +0 -0
  307. /package/skills/{peaks-solo → peaks-code}/references/quality-gate-cheatsheet.md +0 -0
  308. /package/skills/{peaks-solo → peaks-code}/references/workflow.md +0 -0
@@ -1,5 +1,5 @@
1
1
  /**
2
- * `peaks workspace init` — slice 006 + 007 + 014 + 018 + 2026-06-16-peaks-solo-auto-scaffold.
2
+ * `peaks workspace init` — slice 006 + 007 + 014 + 018 + 2026-06-16-peaks-code-auto-scaffold.
3
3
  *
4
4
  * Extracted from `src/cli/commands/workspace-commands.ts` (slice
5
5
  * 2026-06-16-workspace-commands-split) to keep that entry file under the
@@ -44,7 +44,7 @@ export function registerWorkspaceInitCommand(workspace, io) {
44
44
  return value;
45
45
  })
46
46
  .option('--no-claude-hooks', 'do NOT materialize .claude/settings.local.json (slice 2.0.1-bug3 fact-forcing bypass). Default: hooks installed so tool calls inside .peaks/** are not blocked by the [Fact-Forcing Gate].')
47
- .option('--init-standards', 'slice 2026-06-16-peaks-solo-auto-scaffold: when the consumer project\'s .claude/rules/ is missing or empty, auto-apply `peaks standards init --project <path> --apply` after emitting the diagnostic. Default: diagnostic only (no write).')).action(async (options) => {
47
+ .option('--init-standards', 'slice 2026-06-16-peaks-code-auto-scaffold: when the consumer project\'s .claude/rules/ is missing or empty, auto-apply `peaks standards init --project <path> --apply` after emitting the diagnostic. Default: diagnostic only (no write).')).action(async (options) => {
48
48
  try {
49
49
  // Resolve the session id. Two paths:
50
50
  // - explicit --session-id: use it as the requested binding target
@@ -110,7 +110,7 @@ export function registerWorkspaceInitCommand(workspace, io) {
110
110
  // `false`, so the default is "install hooks" (the bypass is
111
111
  // on). Pass `--no-claude-hooks` to opt out.
112
112
  noClaudeHooks: options.claudeHooks === false,
113
- // Slice 2026-06-16-peaks-solo-auto-scaffold (RD#7): opt-in
113
+ // Slice 2026-06-16-peaks-code-auto-scaffold (RD#7): opt-in
114
114
  // auto-apply for the missing-standards scaffold. Default false
115
115
  // — only the diagnostic is emitted. Pass --init-standards to
116
116
  // also run `executeProjectStandardsInit({ apply: true })`.
@@ -129,7 +129,7 @@ export function registerWorkspaceInitCommand(workspace, io) {
129
129
  `Re-run with --no-rotate-on-outer-mismatch to suppress this rotation.`);
130
130
  // Slice 002 (v2.15.0) AC-1: a presence marker stamped by the
131
131
  // OLD outer session is now stale (defect A from the PRD).
132
- // peaks-solo Step 1 would otherwise pick up the old `mode`
132
+ // peaks-code Step 1 would otherwise pick up the old `mode`
133
133
  // field and silently lock the new session into a mode the
134
134
  // user never explicitly chose. Clear it here so Step 1's
135
135
  // presence:check-stale reports `reason: 'no-presence'` and
@@ -142,7 +142,7 @@ export function registerWorkspaceInitCommand(workspace, io) {
142
142
  });
143
143
  if (presenceClearOutcome.cleared) {
144
144
  nextActions.push(`Auto-cleared stale skill presence (recorded outer id "${presenceClearOutcome.recordedOuter ?? '?'}" did not match the new outer session). ` +
145
- 'peaks-solo Step 1 will now AskUserQuestion to confirm the mode.');
145
+ 'peaks-code Step 1 will now AskUserQuestion to confirm the mode.');
146
146
  }
147
147
  else if (presenceClearOutcome.reason === 'recorded-by-different-outer') {
148
148
  nextActions.push(`Kept skill presence: it was recorded by a different live outer session (id "${presenceClearOutcome.recordedOuter ?? '?'}"). ` +
@@ -227,7 +227,7 @@ export function registerWorkspaceInitCommand(workspace, io) {
227
227
  else if (hooksOutcome.action === 'first-decision' && hooksOutcome.decision === 'skipped') {
228
228
  nextActions.push('Skipped peaks-managed hook install for this project. Re-run with --install-hooks=auto (or peaks hooks install) to install later.');
229
229
  }
230
- // Slice 2026-06-16-peaks-solo-auto-scaffold (RD#7):
230
+ // Slice 2026-06-16-peaks-code-auto-scaffold (RD#7):
231
231
  // - When the consumer project's `.claude/rules/` is missing or
232
232
  // empty, emit the copy-pasteable diagnostic to stderr (via
233
233
  // the JSON envelope `warnings` array) AND surface the
@@ -246,7 +246,7 @@ export function registerWorkspaceInitCommand(workspace, io) {
246
246
  nextActions.push(`Run \`peaks workspace init --init-standards --project ${projectRoot}\` to auto-apply the scaffold, or \`peaks standards init --project ${projectRoot} --apply\` manually.`);
247
247
  }
248
248
  if (report.standardsApplied !== undefined) {
249
- nextActions.push(`Auto-applied .claude/rules/${report.standardsApplied.language}/ scaffold (slice 2026-06-16-peaks-solo-auto-scaffold): ` +
249
+ nextActions.push(`Auto-applied .claude/rules/${report.standardsApplied.language}/ scaffold (slice 2026-06-16-peaks-code-auto-scaffold): ` +
250
250
  `wrote ${report.standardsApplied.writtenFiles.length} file(s), ` +
251
251
  `kept ${report.standardsApplied.skippedFiles.length} existing file(s).`);
252
252
  }
@@ -1,7 +1,7 @@
1
1
  import { readdirSync, existsSync } from 'node:fs';
2
2
  import { join } from 'node:path';
3
3
  import { Command } from 'commander';
4
- import { skillsDir } from '../shared/paths.js';
4
+ import { skillsDir, repoRoot } from '../shared/paths.js';
5
5
  import { CLI_VERSION } from '../shared/version.js';
6
6
  import { registerCoreAndArtifactCommands } from './commands/core-artifact-commands.js';
7
7
  import { registerWorkflowCommands } from './commands/workflow-commands.js';
@@ -76,6 +76,12 @@ import { registerObservabilityCommands } from './commands/observability-commands
76
76
  import { registerCompactCommands } from './commands/compact-command.js';
77
77
  // Slice 2026-07-01-job-m3.1: `peaks job init|status|...` — Job orchestration CLI surface.
78
78
  import { registerJobCommands } from './commands/job-commands.js';
79
+ // Slice 2026-07-04-cli-15a: `peaks skill sediment <verb>` + `peaks skill adapter <verb>`
80
+ // — Task 15a 4-verb subset (add-segment / add-bee / list / rebuild-index).
81
+ // 15b / 15c / 15d will extend sediment-commands.ts with the remaining 14 verbs.
82
+ import { registerSedimentCommands } from './commands/sediment-commands.js';
83
+ import { registerAdapterCommands } from './commands/adapter-commands.js';
84
+ import { registerSkillVisibilityCommand } from './commands/skill-visibility.js';
79
85
  import { applyRetention } from '../services/log/retention.js';
80
86
  import { writeLogEntry, maybeWriteStderr } from '../services/log/logger.js';
81
87
  export { printResult } from './cli-helpers.js';
@@ -315,7 +321,7 @@ Run peaks (no arguments) for a quickstart. You likely want one of:
315
321
  // Slice 2026-06-17-2.5.0-sub-fix-C: `peaks playwright start|ls|stop`
316
322
  // (multi-terminal Playwright MCP lifecycle).
317
323
  registerPlaywrightCommands(program, io);
318
- // Slice 2 (peaks-solo fast mode): `peaks solo plan [--fast] <change-id>`
324
+ // Slice 2 (peaks-code fast mode): `peaks solo plan [--fast] <change-id>`
319
325
  // v2.11.0 Group F (D5 + D7): also registers `peaks solo should-pause` and
320
326
  // `peaks solo post-compact-detect` for runtime-friction probes.
321
327
  registerSoloCommands(program, io);
@@ -347,5 +353,16 @@ Run peaks (no arguments) for a quickstart. You likely want one of:
347
353
  // orchestration CLI surface. M3.1 wires init + status + 2 stubs;
348
354
  // the remaining 5 subcommands land in M3.2.
349
355
  registerJobCommands(program, io);
356
+ // Slice 2026-07-04-cli-15a: `peaks skill sediment <verb>` — Task 15a
357
+ // 4-verb subset. Dispatches to runSediment; remaining verbs land in 15b/15c/15d.
358
+ registerSedimentCommands(program, io);
359
+ // Slice 2026-07-04-cli-15a: `peaks skill adapter <verb>` — adapter list / set-active.
360
+ registerAdapterCommands(program, io);
361
+ // Slice 2026-07-05-peaks-code-to-peaks-code (Task 1): `peaks skill:visibility --list --json`
362
+ // — read .claude-plugin/marketplace.json and report each skill's
363
+ // visibility (public vs internal). Used to surface which skills are
364
+ // user-invocable vs LLM-only internal role skills. See
365
+ // src/cli/commands/skill-visibility.ts.
366
+ registerSkillVisibilityCommand(program, repoRoot);
350
367
  return program;
351
368
  }
@@ -0,0 +1,27 @@
1
+ export interface AdapterSegment {
2
+ name: string;
3
+ skillMd: string;
4
+ scripts: {
5
+ name: string;
6
+ content: string;
7
+ }[];
8
+ }
9
+ export interface AdapterEnvelope {
10
+ preamble: string;
11
+ refs: {
12
+ path: string;
13
+ kind: "file" | "dir" | "script";
14
+ }[];
15
+ }
16
+ export interface Adapter {
17
+ readonly name: "claude" | "codex" | "copilot" | "auto";
18
+ resolveScratchDir(beeName: string): Promise<string>;
19
+ materialize(beeName: string, env: AdapterEnvelope, segments: AdapterSegment[]): Promise<string>;
20
+ publish(scratchDir: string): Promise<string>;
21
+ activate(scratchDir: string): Promise<void>;
22
+ cleanup(scratchDir: string): Promise<void>;
23
+ detect(): Promise<boolean>;
24
+ }
25
+ export declare class ADAPTER_NOT_IMPLEMENTED extends Error {
26
+ constructor(adapter: string, method: string);
27
+ }
@@ -0,0 +1,5 @@
1
+ export class ADAPTER_NOT_IMPLEMENTED extends Error {
2
+ constructor(adapter, method) {
3
+ super(`ADAPTER_NOT_IMPLEMENTED: ${adapter}.${method} — stub until later slice`);
4
+ }
5
+ }
@@ -0,0 +1,11 @@
1
+ import { Adapter } from "./adapter.js";
2
+ type Detectable = Pick<Adapter, "name" | "detect">;
3
+ export declare class AutoAdapter {
4
+ private readonly _o;
5
+ private readonly _adapters;
6
+ constructor(_o: {
7
+ home: string;
8
+ }, _adapters: Detectable[]);
9
+ detectAndPick(): Promise<Detectable>;
10
+ }
11
+ export {};
@@ -0,0 +1,15 @@
1
+ export class AutoAdapter {
2
+ _o;
3
+ _adapters;
4
+ constructor(_o, _adapters) {
5
+ this._o = _o;
6
+ this._adapters = _adapters;
7
+ }
8
+ async detectAndPick() {
9
+ for (const a of this._adapters) {
10
+ if (await a.detect())
11
+ return a;
12
+ }
13
+ throw new Error("No adapter detected. Use `peaks skill adapter set-active <name>` to force one.");
14
+ }
15
+ }
@@ -0,0 +1,14 @@
1
+ import { Adapter, AdapterEnvelope, AdapterSegment } from "./adapter.js";
2
+ export declare class ClaudeAdapter implements Adapter {
3
+ private readonly opts;
4
+ readonly name: "claude";
5
+ constructor(opts: {
6
+ home: string;
7
+ });
8
+ detect(): Promise<boolean>;
9
+ resolveScratchDir(beeName: string): Promise<string>;
10
+ materialize(beeName: string, env: AdapterEnvelope, segments: AdapterSegment[]): Promise<string>;
11
+ publish(scratchDir: string): Promise<string>;
12
+ activate(_scratchDir: string): Promise<void>;
13
+ cleanup(scratchDir: string): Promise<void>;
14
+ }
@@ -0,0 +1,40 @@
1
+ import { writeFileSync, mkdirSync, rmSync, existsSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ export class ClaudeAdapter {
4
+ opts;
5
+ name = "claude";
6
+ constructor(opts) {
7
+ this.opts = opts;
8
+ }
9
+ async detect() {
10
+ return true; /* Claude is the default; ship this slice first */
11
+ }
12
+ async resolveScratchDir(beeName) {
13
+ return join(this.opts.home, ".claude", "skills", `peaks-bee-${beeName}.peaks-generated`);
14
+ }
15
+ async materialize(beeName, env, segments) {
16
+ const dir = await this.resolveScratchDir(beeName);
17
+ if (existsSync(dir))
18
+ rmSync(dir, { recursive: true, force: true });
19
+ mkdirSync(dir, { recursive: true });
20
+ const frontmatter = `---\nname: peaks-bee-${beeName}\ndescription: peaks-loop generated bee ${beeName} — see local SkillHub for source\n---\n\n`;
21
+ const body = `${env.preamble}\n\n` + segments.map((s) => s.skillMd).join("\n\n");
22
+ writeFileSync(join(dir, "SKILL.md"), frontmatter + body);
23
+ mkdirSync(join(dir, "scripts"), { recursive: true });
24
+ for (const s of segments) {
25
+ for (const sc of s.scripts)
26
+ writeFileSync(join(dir, "scripts", sc.name), sc.content);
27
+ }
28
+ return dir;
29
+ }
30
+ async publish(scratchDir) {
31
+ return scratchDir;
32
+ }
33
+ async activate(_scratchDir) {
34
+ /* no-op; runtime picks up by convention */
35
+ }
36
+ async cleanup(scratchDir) {
37
+ if (existsSync(scratchDir))
38
+ rmSync(scratchDir, { recursive: true, force: true });
39
+ }
40
+ }
@@ -0,0 +1,14 @@
1
+ import { Adapter } from "./adapter.js";
2
+ export declare class CodexAdapter implements Pick<Adapter, "name"> {
3
+ private readonly _o;
4
+ readonly name: "codex";
5
+ constructor(_o: {
6
+ home: string;
7
+ });
8
+ detect(): Promise<boolean>;
9
+ resolveScratchDir(): Promise<void>;
10
+ materialize(): Promise<void>;
11
+ publish(): Promise<void>;
12
+ activate(): Promise<void>;
13
+ cleanup(): Promise<void>;
14
+ }
@@ -0,0 +1,14 @@
1
+ import { ADAPTER_NOT_IMPLEMENTED } from "./adapter.js";
2
+ export class CodexAdapter {
3
+ _o;
4
+ name = "codex";
5
+ constructor(_o) {
6
+ this._o = _o;
7
+ }
8
+ async detect() { return false; }
9
+ async resolveScratchDir() { throw new ADAPTER_NOT_IMPLEMENTED("codex", "resolveScratchDir"); }
10
+ async materialize() { throw new ADAPTER_NOT_IMPLEMENTED("codex", "materialize"); }
11
+ async publish() { throw new ADAPTER_NOT_IMPLEMENTED("codex", "publish"); }
12
+ async activate() { throw new ADAPTER_NOT_IMPLEMENTED("codex", "activate"); }
13
+ async cleanup() { throw new ADAPTER_NOT_IMPLEMENTED("codex", "cleanup"); }
14
+ }
@@ -0,0 +1,14 @@
1
+ import { Adapter } from "./adapter.js";
2
+ export declare class CopilotAdapter implements Pick<Adapter, "name"> {
3
+ private readonly _o;
4
+ readonly name: "copilot";
5
+ constructor(_o: {
6
+ home: string;
7
+ });
8
+ detect(): Promise<boolean>;
9
+ resolveScratchDir(): Promise<void>;
10
+ materialize(): Promise<void>;
11
+ publish(): Promise<void>;
12
+ activate(): Promise<void>;
13
+ cleanup(): Promise<void>;
14
+ }
@@ -0,0 +1,14 @@
1
+ import { ADAPTER_NOT_IMPLEMENTED } from "./adapter.js";
2
+ export class CopilotAdapter {
3
+ _o;
4
+ name = "copilot";
5
+ constructor(_o) {
6
+ this._o = _o;
7
+ }
8
+ async detect() { return false; }
9
+ async resolveScratchDir() { throw new ADAPTER_NOT_IMPLEMENTED("copilot", "resolveScratchDir"); }
10
+ async materialize() { throw new ADAPTER_NOT_IMPLEMENTED("copilot", "materialize"); }
11
+ async publish() { throw new ADAPTER_NOT_IMPLEMENTED("copilot", "publish"); }
12
+ async activate() { throw new ADAPTER_NOT_IMPLEMENTED("copilot", "activate"); }
13
+ async cleanup() { throw new ADAPTER_NOT_IMPLEMENTED("copilot", "cleanup"); }
14
+ }
@@ -2,7 +2,7 @@
2
2
  * Solo-code-ban enforcer — PreToolUse Bash guard.
3
3
  *
4
4
  * Per L2 redesign §5.4. Deny `git commit` or `git apply` invocations from
5
- * a peaks-* skill. The Solo Code-Change Red Line says peaks-solo / peaks-rd
5
+ * a peaks-* skill. The Solo Code-Change Red Line says peaks-code / peaks-rd
6
6
  * are orchestrators, not implementers; the actual `git commit` step must
7
7
  * go through `peaks request transition`, which itself enforces spec-locked
8
8
  * + tech-doc-presence.
@@ -2,7 +2,7 @@
2
2
  * Solo-code-ban enforcer — PreToolUse Bash guard.
3
3
  *
4
4
  * Per L2 redesign §5.4. Deny `git commit` or `git apply` invocations from
5
- * a peaks-* skill. The Solo Code-Change Red Line says peaks-solo / peaks-rd
5
+ * a peaks-* skill. The Solo Code-Change Red Line says peaks-code / peaks-rd
6
6
  * are orchestrators, not implementers; the actual `git commit` step must
7
7
  * go through `peaks request transition`, which itself enforces spec-locked
8
8
  * + tech-doc-presence.
@@ -12,7 +12,7 @@
12
12
  * never bricked by a peaks bug.
13
13
  */
14
14
  const COMMIT_APPLY_PATTERN = /^\s*git\s+(commit|apply)\b/;
15
- const DENY_REASON = 'Solo Code-Change Red Line: peaks-* skills must go through peaks-solo / peaks-rd. ' +
15
+ const DENY_REASON = 'Solo Code-Change Red Line: peaks-* skills must go through peaks-code / peaks-rd. ' +
16
16
  'Use `peaks request transition` instead of `git commit` / `git apply` directly.';
17
17
  export function isSoloCodeCommit(skill, command) {
18
18
  if (!skill.startsWith('peaks-'))
@@ -13,7 +13,7 @@ export const RED_LINE_CATALOG = [
13
13
  rule: 'Solo Code-Change Red Line',
14
14
  markers: ['BLOCKING', 'MANDATORY'],
15
15
  phrases: [
16
- 'peaks-solo',
16
+ 'peaks-code',
17
17
  'orchestrator, NOT an implementer',
18
18
  'solo',
19
19
  ],
@@ -39,6 +39,28 @@ export function scanSkillsTree(input) {
39
39
  for (const entry of entries) {
40
40
  if (!entry.isDirectory() || entry.name.startsWith('.'))
41
41
  continue;
42
+ // LLM-internal skills live under `skills/bee/<name>/` per spec 2026-07-05.
43
+ // Recurse one level into `bee/` to cover all 9 demoted role/audit skills.
44
+ if (entry.name === 'bee') {
45
+ let subEntries;
46
+ try {
47
+ subEntries = readdirSync(join(skillsRoot, 'bee'), { withFileTypes: true });
48
+ }
49
+ catch (error) {
50
+ warnings.push({
51
+ file: 'skills/bee',
52
+ message: `readdir failed: ${error instanceof Error ? error.message : String(error)}`,
53
+ });
54
+ continue;
55
+ }
56
+ for (const subEntry of subEntries) {
57
+ if (!subEntry.isDirectory() || subEntry.name.startsWith('.'))
58
+ continue;
59
+ const skillMd = readSkillFile(input.projectRoot, join('bee', subEntry.name), 'SKILL.md');
60
+ lines.push(...skillMd);
61
+ }
62
+ continue;
63
+ }
42
64
  const skillMd = readSkillFile(input.projectRoot, entry.name, 'SKILL.md');
43
65
  lines.push(...skillMd);
44
66
  }
@@ -9,7 +9,7 @@ export interface DispatchIdeCompactInput {
9
9
  /**
10
10
  * Slice 2026-06-28-solo-mode-bypass-fix (defect #4): which session
11
11
  * the compact should target. Default `'main'` — the orchestrator
12
- * (peaks-solo body) runs in the main-session Claude Code window and
12
+ * (peaks-code body) runs in the main-session Claude Code window and
13
13
  * wants to compress *its* context, not a sub-agent's. Sub-agent
14
14
  * shells that spawn their own `peaks solo auto-compact` flow pass
15
15
  * `'sub-agent'` to preserve the legacy shell-spawn behaviour.
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Empirical upper bound for one Dispatcher × one batch: 6 sub-agents.
5
5
  * Above 6, the LLM / human is encouraged to split into multiple
6
- * batches with an explicit reducer step in between. peaks-solo's
6
+ * batches with an explicit reducer step in between. peaks-code's
7
7
  * swarm phase dispatches 3; peaks-rd's 4-way fan-out dispatches 4;
8
8
  * peaks-qa's 3-way fan-out dispatches 3. The 6 limit leaves headroom
9
9
  * for "qa-business-api" / "qa-business-frontend" / "qa-business-regression"
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Slice #009 / G5 RL-7 — dispatch record leak detector.
3
3
  *
4
- * After peaks-solo's reducer consumes a batch, any dispatch record that
4
+ * After peaks-code's reducer consumes a batch, any dispatch record that
5
5
  * is still `disposed === false` AND was created more than `thresholdMs`
6
6
  * ago is a **leak**. This helper scans the on-disk records under
7
7
  * `.peaks/_sub_agents/<sid>/` and returns the leaked ones. The CLI or
@@ -538,7 +538,7 @@ export async function runDoctor(options = {}) {
538
538
  }
539
539
  }
540
540
  }
541
- // Workspace guard: an active workflow presence (peaks-solo) with no workspace
541
+ // Workspace guard: an active workflow presence (peaks-code) with no workspace
542
542
  // session means the skill was anchored but `peaks workspace init` never ran —
543
543
  // the #1 reported failure where .peaks/ artifacts are never created. This
544
544
  // turns the SKILL.md "MUST create the workspace" prose into an executable check.
@@ -554,7 +554,7 @@ export async function runDoctor(options = {}) {
554
554
  checks.push({
555
555
  id: 'skill-presence:workspace',
556
556
  ok: false,
557
- message: `Skill ${presence.skill} is active but no workspace session exists (.peaks/_runtime/session.json missing); run \`peaks workspace init --project <repo>\` — peaks-solo Step 0 must anchor the workspace before any work`
557
+ message: `Skill ${presence.skill} is active but no workspace session exists (.peaks/_runtime/session.json missing); run \`peaks workspace init --project <repo>\` — peaks-code Step 0 must anchor the workspace before any work`
558
558
  });
559
559
  }
560
560
  else {
@@ -0,0 +1,60 @@
1
+ /**
2
+ * v3.1.2 — On-disk slice progress mirror.
3
+ *
4
+ * After each `peaks job checkpoint --state done`, the orchestrator writes
5
+ * `.peaks/_runtime/<sessionId>/job/<jid>/progress.json` so the next LLM
6
+ * turn (after compact or resume) can read it before any Bash call lands.
7
+ *
8
+ * Shape (schemaVersion 1):
9
+ * {
10
+ * jobId, done, total, currentSlice, lastCommitSha, updatedAt
11
+ * }
12
+ *
13
+ * The `peaks solo gate-step-08` hook reads this file in its case-1 path
14
+ * (job-shape.json says isJob=true) and surfaces `Next: slice #N+1 of M
15
+ * (<currentSlice>)` to stdout. The LLM cannot "wake up cold" — the
16
+ * next-slice context is mechanically injected on every Bash call.
17
+ *
18
+ * Karpathy §2 (Simplicity First): ~50 lines, single-purpose writer +
19
+ * reader. Schema is zod-validated on read so a stale on-disk copy
20
+ * from an earlier peaks-loop release fails loud (no silent fallback).
21
+ */
22
+ import { z } from 'zod';
23
+ export declare const JOB_PROGRESS_SCHEMA_VERSION: 1;
24
+ export declare const JobProgressSchema: z.ZodObject<{
25
+ schemaVersion: z.ZodLiteral<1>;
26
+ jobId: z.ZodString;
27
+ done: z.ZodNumber;
28
+ total: z.ZodNumber;
29
+ currentSlice: z.ZodString;
30
+ lastCommitSha: z.ZodNullable<z.ZodString>;
31
+ updatedAt: z.ZodString;
32
+ }, "strip", z.ZodTypeAny, {
33
+ updatedAt: string;
34
+ done: number;
35
+ schemaVersion: 1;
36
+ jobId: string;
37
+ total: number;
38
+ currentSlice: string;
39
+ lastCommitSha: string | null;
40
+ }, {
41
+ updatedAt: string;
42
+ done: number;
43
+ schemaVersion: 1;
44
+ jobId: string;
45
+ total: number;
46
+ currentSlice: string;
47
+ lastCommitSha: string | null;
48
+ }>;
49
+ export type JobProgress = z.infer<typeof JobProgressSchema>;
50
+ export interface WriteProgressInput {
51
+ readonly jobId: string;
52
+ readonly done: number;
53
+ readonly total: number;
54
+ readonly currentSlice: string;
55
+ readonly lastCommitSha: string | null;
56
+ readonly updatedAt?: string;
57
+ }
58
+ export declare function writeJobProgress(projectRoot: string, sessionId: string, input: WriteProgressInput): JobProgress;
59
+ export declare function readJobProgress(projectRoot: string, sessionId: string, jobId: string): JobProgress;
60
+ export declare function tryReadJobProgress(projectRoot: string, sessionId: string, jobId: string): JobProgress | null;
@@ -0,0 +1,70 @@
1
+ /**
2
+ * v3.1.2 — On-disk slice progress mirror.
3
+ *
4
+ * After each `peaks job checkpoint --state done`, the orchestrator writes
5
+ * `.peaks/_runtime/<sessionId>/job/<jid>/progress.json` so the next LLM
6
+ * turn (after compact or resume) can read it before any Bash call lands.
7
+ *
8
+ * Shape (schemaVersion 1):
9
+ * {
10
+ * jobId, done, total, currentSlice, lastCommitSha, updatedAt
11
+ * }
12
+ *
13
+ * The `peaks solo gate-step-08` hook reads this file in its case-1 path
14
+ * (job-shape.json says isJob=true) and surfaces `Next: slice #N+1 of M
15
+ * (<currentSlice>)` to stdout. The LLM cannot "wake up cold" — the
16
+ * next-slice context is mechanically injected on every Bash call.
17
+ *
18
+ * Karpathy §2 (Simplicity First): ~50 lines, single-purpose writer +
19
+ * reader. Schema is zod-validated on read so a stale on-disk copy
20
+ * from an earlier peaks-loop release fails loud (no silent fallback).
21
+ */
22
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
23
+ import { join } from 'node:path';
24
+ import { z } from 'zod';
25
+ export const JOB_PROGRESS_SCHEMA_VERSION = 1;
26
+ export const JobProgressSchema = z.object({
27
+ schemaVersion: z.literal(JOB_PROGRESS_SCHEMA_VERSION),
28
+ jobId: z.string(),
29
+ done: z.number().int().nonnegative(),
30
+ total: z.number().int().positive(),
31
+ currentSlice: z.string(),
32
+ lastCommitSha: z.string().nullable(),
33
+ updatedAt: z.string().datetime()
34
+ });
35
+ export function writeJobProgress(projectRoot, sessionId, input) {
36
+ const dir = join(projectRoot, '.peaks', '_runtime', sessionId, 'job', input.jobId);
37
+ mkdirSync(dir, { recursive: true });
38
+ const record = {
39
+ schemaVersion: JOB_PROGRESS_SCHEMA_VERSION,
40
+ jobId: input.jobId,
41
+ done: input.done,
42
+ total: input.total,
43
+ currentSlice: input.currentSlice,
44
+ lastCommitSha: input.lastCommitSha,
45
+ updatedAt: input.updatedAt ?? new Date().toISOString()
46
+ };
47
+ const path = join(dir, 'progress.json');
48
+ writeFileSync(path, JSON.stringify(record, null, 2) + '\n', 'utf8');
49
+ return record;
50
+ }
51
+ export function readJobProgress(projectRoot, sessionId, jobId) {
52
+ const path = join(projectRoot, '.peaks', '_runtime', sessionId, 'job', jobId, 'progress.json');
53
+ if (!existsSync(path)) {
54
+ throw new Error(`JobProgressStore: no progress for ${jobId} at ${path}`);
55
+ }
56
+ const raw = readFileSync(path, 'utf8');
57
+ return JobProgressSchema.parse(JSON.parse(raw));
58
+ }
59
+ export function tryReadJobProgress(projectRoot, sessionId, jobId) {
60
+ const path = join(projectRoot, '.peaks', '_runtime', sessionId, 'job', jobId, 'progress.json');
61
+ if (!existsSync(path))
62
+ return null;
63
+ try {
64
+ const raw = readFileSync(path, 'utf8');
65
+ return JobProgressSchema.parse(JSON.parse(raw));
66
+ }
67
+ catch { // TODO(g2): legacy silent catch — grace: 1 minor release (v2.14.0)
68
+ return null;
69
+ }
70
+ }
@@ -26,10 +26,37 @@ export function collectResourceSnapshot(jobDir) {
26
26
  contextRatio,
27
27
  };
28
28
  }
29
- function dirSizeMb(dir) {
29
+ // Non-enumerable internal attachment for test-time access via
30
+ // `collectResourceSnapshot.dirSizeMb`. NOT a public export — keeps
31
+ // the prod module surface clean per PRD while still allowing
32
+ // targeted AC-1/AC-2/AC-3 unit tests to drive `dirSizeMb` directly.
33
+ Object.defineProperty(collectResourceSnapshot, 'dirSizeMb', {
34
+ value: dirSizeMb,
35
+ enumerable: false,
36
+ writable: false,
37
+ configurable: false,
38
+ });
39
+ /**
40
+ * Best-effort, non-recursive size of one directory level, in rounded megabytes.
41
+ *
42
+ * - Missing directory → 0.
43
+ * - Per-entry stat failures (race with deletion, EBUSY on Windows) → silently skipped.
44
+ * - When `opts.maxEntries` > 0 and the directory has more entries than the cap,
45
+ * the returned value is a partial sum (a lower bound), and no further `stat`
46
+ * calls are issued past the cap. Callers must treat the value as a lower bound.
47
+ * - `opts.maxEntries` defaults to 0 (unbounded, legacy behaviour).
48
+ *
49
+ * NOTE: when maxEntries > 0 and the directory contains more entries than the
50
+ * cap, this is a partial sum. Callers must treat the value as a lower bound.
51
+ */
52
+ function dirSizeMb(dir, opts) {
53
+ const cap = opts?.maxEntries ?? 0;
30
54
  let total = 0;
55
+ let index = 0;
31
56
  try {
32
57
  for (const name of readdirSync(dir)) {
58
+ if (cap > 0 && index >= cap)
59
+ break;
33
60
  try {
34
61
  total += statSync(join(dir, name)).size;
35
62
  }
@@ -37,6 +64,7 @@ function dirSizeMb(dir) {
37
64
  // best-effort: missing entries (race with deletion) are silently skipped
38
65
  void e;
39
66
  }
67
+ index++;
40
68
  }
41
69
  }
42
70
  catch (e) {
@@ -192,6 +192,7 @@ export declare const JobStateSchema: z.ZodObject<{
192
192
  }, "strip", z.ZodTypeAny, {
193
193
  sessionId: string;
194
194
  startedAt: string;
195
+ jobId: string;
195
196
  slices: {
196
197
  status: "pending" | "skipped" | "done" | "failed" | "blocked" | "in-progress";
197
198
  label: string;
@@ -202,7 +203,6 @@ export declare const JobStateSchema: z.ZodObject<{
202
203
  failureReason?: string | undefined;
203
204
  blockedReason?: string | undefined;
204
205
  }[];
205
- jobId: string;
206
206
  lastCheckpointAt: string;
207
207
  parallelismHint: "serial" | "llm-decides";
208
208
  exitPolicy: "strict" | "best-effort";
@@ -218,6 +218,7 @@ export declare const JobStateSchema: z.ZodObject<{
218
218
  }, {
219
219
  sessionId: string;
220
220
  startedAt: string;
221
+ jobId: string;
221
222
  slices: {
222
223
  status: "pending" | "skipped" | "done" | "failed" | "blocked" | "in-progress";
223
224
  label: string;
@@ -228,7 +229,6 @@ export declare const JobStateSchema: z.ZodObject<{
228
229
  repairCycles?: number | undefined;
229
230
  blockedReason?: string | undefined;
230
231
  }[];
231
- jobId: string;
232
232
  lastCheckpointAt: string;
233
233
  parallelismHint?: "serial" | "llm-decides" | undefined;
234
234
  exitPolicy?: "strict" | "best-effort" | undefined;
@@ -296,9 +296,9 @@ export declare const JobStatusSummarySchema: z.ZodObject<{
296
296
  done: number;
297
297
  failed: number;
298
298
  blocked: number;
299
+ total: number;
299
300
  mainLoopStrategy: "single" | "rotating";
300
301
  mainSessionCycle: number;
301
- total: number;
302
302
  lastCheckpoint: string;
303
303
  currentSlice?: string | undefined;
304
304
  etaSec?: number | undefined;
@@ -314,9 +314,9 @@ export declare const JobStatusSummarySchema: z.ZodObject<{
314
314
  done: number;
315
315
  failed: number;
316
316
  blocked: number;
317
+ total: number;
317
318
  mainLoopStrategy: "single" | "rotating";
318
319
  mainSessionCycle: number;
319
- total: number;
320
320
  lastCheckpoint: string;
321
321
  currentSlice?: string | undefined;
322
322
  etaSec?: number | undefined;
@@ -600,7 +600,7 @@ export function executeProjectMemoryExtract(options) {
600
600
  const safeMemoryDir = assertSafeProjectMemoryDir(plan.projectRoot);
601
601
  // Idempotency: skip writes for memories whose slug already lives in
602
602
  // .peaks/memory/. Re-running `peaks memory extract --apply` on the
603
- // same handoff is a normal peaks-solo / peaks-txt retry pattern (the
603
+ // same handoff is a normal peaks-code / peaks-txt retry pattern (the
604
604
  // skill prompt may invoke extract more than once when a handoff is
605
605
  // edited and re-extracted). Without this, writeNewFile's O_EXCL
606
606
  // throws EEXIST and aborts the whole batch. Symmetric with