dsh-compound-engineering 0.0.0-stage → 0.1.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 (461) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +160 -2
  3. package/README.zh.md +161 -0
  4. package/cordis.patch.yml +6 -0
  5. package/lib/frontmatter.js +167 -0
  6. package/lib/index.js +46 -0
  7. package/lib/provider.js +201 -0
  8. package/package.json +62 -4
  9. package/skills/CODING_STANDARDS.md +68 -0
  10. package/skills/ce-babysit-pr/SKILL.md +59 -0
  11. package/skills/ce-babysit-pr/references/branch-currency.md +22 -0
  12. package/skills/ce-babysit-pr/references/envelope.md +44 -0
  13. package/skills/ce-babysit-pr/references/pipeline.md +15 -0
  14. package/skills/ce-babysit-pr/references/report.md +20 -0
  15. package/skills/ce-babysit-pr/references/settle.md +37 -0
  16. package/skills/ce-babysit-pr/references/setup.md +33 -0
  17. package/skills/ce-babysit-pr/references/stack-commands.md +39 -0
  18. package/skills/ce-babysit-pr/references/stack.md +43 -0
  19. package/skills/ce-babysit-pr/references/tick.md +102 -0
  20. package/skills/ce-babysit-pr/references/watch-loop.md +222 -0
  21. package/skills/ce-babysit-pr/scripts/pr-snapshot +3656 -0
  22. package/skills/ce-bakeoff/SKILL.md +48 -0
  23. package/skills/ce-bakeoff/references/candidates.md +37 -0
  24. package/skills/ce-bakeoff/references/judging.md +19 -0
  25. package/skills/ce-bakeoff/references/output.md +11 -0
  26. package/skills/ce-bakeoff/references/verification.md +15 -0
  27. package/skills/ce-brainstorm/SKILL.md +69 -0
  28. package/skills/ce-brainstorm/references/agents/slack-researcher.md +127 -0
  29. package/skills/ce-brainstorm/references/approaches.md +57 -0
  30. package/skills/ce-brainstorm/references/bakeoff.md +9 -0
  31. package/skills/ce-brainstorm/references/blindspot-pass.md +70 -0
  32. package/skills/ce-brainstorm/references/brainstorm-sections.md +458 -0
  33. package/skills/ce-brainstorm/references/dialogue.md +89 -0
  34. package/skills/ce-brainstorm/references/handoff.md +187 -0
  35. package/skills/ce-brainstorm/references/html-rendering.md +638 -0
  36. package/skills/ce-brainstorm/references/interaction-rules.md +33 -0
  37. package/skills/ce-brainstorm/references/markdown-rendering.md +242 -0
  38. package/skills/ce-brainstorm/references/model-tiers.md +13 -0
  39. package/skills/ce-brainstorm/references/output-mode.md +26 -0
  40. package/skills/ce-brainstorm/references/phase-0.md +104 -0
  41. package/skills/ce-brainstorm/references/plan-write.md +32 -0
  42. package/skills/ce-brainstorm/references/product-pressure-test.md +42 -0
  43. package/skills/ce-brainstorm/references/reasoning-elevation.md +124 -0
  44. package/skills/ce-brainstorm/references/settled-decisions.md +45 -0
  45. package/skills/ce-brainstorm/references/synthesis-summary.md +149 -0
  46. package/skills/ce-brainstorm/references/universal-brainstorming.md +72 -0
  47. package/skills/ce-brainstorm/references/verdict-routing.md +26 -0
  48. package/skills/ce-brainstorm/references/visual-probes.md +164 -0
  49. package/skills/ce-brainstorm/scripts/elevation-dispatch.sh +288 -0
  50. package/skills/ce-brainstorm/scripts/light-webserver.js +1275 -0
  51. package/skills/ce-brainstorm/scripts/packs-resolve.py +737 -0
  52. package/skills/ce-brainstorm/scripts/peer-job-runner.py +2594 -0
  53. package/skills/ce-code-review/SKILL.md +40 -0
  54. package/skills/ce-code-review/references/action-class-rubric.md +67 -0
  55. package/skills/ce-code-review/references/cross-model-recovery.md +38 -0
  56. package/skills/ce-code-review/references/cross-model-review.md +191 -0
  57. package/skills/ce-code-review/references/depth-paths.md +32 -0
  58. package/skills/ce-code-review/references/diff-scope.md +59 -0
  59. package/skills/ce-code-review/references/dispatch-reviewers.md +135 -0
  60. package/skills/ce-code-review/references/findings-schema.json +125 -0
  61. package/skills/ce-code-review/references/finish-input.md +118 -0
  62. package/skills/ce-code-review/references/finish-review.md +202 -0
  63. package/skills/ce-code-review/references/intent-and-plan.md +73 -0
  64. package/skills/ce-code-review/references/modes-and-output.md +156 -0
  65. package/skills/ce-code-review/references/persona-catalog.md +66 -0
  66. package/skills/ce-code-review/references/personas/adversarial-reviewer.md +111 -0
  67. package/skills/ce-code-review/references/personas/agent-native-reviewer.md +173 -0
  68. package/skills/ce-code-review/references/personas/api-contract-reviewer.md +44 -0
  69. package/skills/ce-code-review/references/personas/correctness-reviewer.md +48 -0
  70. package/skills/ce-code-review/references/personas/data-migration-reviewer.md +111 -0
  71. package/skills/ce-code-review/references/personas/deployment-verification-agent.md +157 -0
  72. package/skills/ce-code-review/references/personas/julik-frontend-races-reviewer.md +45 -0
  73. package/skills/ce-code-review/references/personas/learnings-researcher.md +260 -0
  74. package/skills/ce-code-review/references/personas/maintainability-reviewer.md +85 -0
  75. package/skills/ce-code-review/references/personas/performance-reviewer.md +45 -0
  76. package/skills/ce-code-review/references/personas/previous-comments-reviewer.md +59 -0
  77. package/skills/ce-code-review/references/personas/project-standards-reviewer.md +77 -0
  78. package/skills/ce-code-review/references/personas/reliability-reviewer.md +49 -0
  79. package/skills/ce-code-review/references/personas/security-reviewer.md +50 -0
  80. package/skills/ce-code-review/references/personas/swift-ios-reviewer.md +99 -0
  81. package/skills/ce-code-review/references/personas/testing-reviewer.md +51 -0
  82. package/skills/ce-code-review/references/review-output-template.md +172 -0
  83. package/skills/ce-code-review/references/scope.md +176 -0
  84. package/skills/ce-code-review/references/select-and-route.md +93 -0
  85. package/skills/ce-code-review/references/subagent-template.md +206 -0
  86. package/skills/ce-code-review/references/validator-batch-template.md +67 -0
  87. package/skills/ce-code-review/scripts/cross-model-adversarial-review.sh +1275 -0
  88. package/skills/ce-code-review/scripts/findings-mechanics.py +274 -0
  89. package/skills/ce-code-review/scripts/packs-resolve.py +737 -0
  90. package/skills/ce-code-review/scripts/peer-job-runner.py +2594 -0
  91. package/skills/ce-code-review/scripts/review-scope.py +419 -0
  92. package/skills/ce-code-review/scripts/run-log.py +280 -0
  93. package/skills/ce-commit/SKILL.md +60 -0
  94. package/skills/ce-commit-push-pr/SKILL.md +69 -0
  95. package/skills/ce-commit-push-pr/references/apply-and-handoff.md +79 -0
  96. package/skills/ce-commit-push-pr/references/branch-creation.md +47 -0
  97. package/skills/ce-commit-push-pr/references/commit-and-push.md +26 -0
  98. package/skills/ce-commit-push-pr/references/compose.md +29 -0
  99. package/skills/ce-commit-push-pr/references/context.md +42 -0
  100. package/skills/ce-commit-push-pr/references/gh-stack-cli.md +83 -0
  101. package/skills/ce-commit-push-pr/references/pr-description-writing.md +208 -0
  102. package/skills/ce-commit-push-pr/references/stack-submit.md +81 -0
  103. package/skills/ce-compound/SKILL.md +79 -0
  104. package/skills/ce-compound/assets/resolution-template.md +96 -0
  105. package/skills/ce-compound/references/agents/best-practices-researcher.md +115 -0
  106. package/skills/ce-compound/references/agents/data-integrity-guardian.md +68 -0
  107. package/skills/ce-compound/references/agents/framework-docs-researcher.md +93 -0
  108. package/skills/ce-compound/references/agents/pattern-recognition-specialist.md +55 -0
  109. package/skills/ce-compound/references/agents/performance-oracle.md +108 -0
  110. package/skills/ce-compound/references/agents/security-sentinel.md +91 -0
  111. package/skills/ce-compound/references/agents/session-historian.md +82 -0
  112. package/skills/ce-compound/references/assembly.md +127 -0
  113. package/skills/ce-compound/references/concepts-vocabulary.md +98 -0
  114. package/skills/ce-compound/references/enhancement.md +42 -0
  115. package/skills/ce-compound/references/grounding-validation.md +89 -0
  116. package/skills/ce-compound/references/lightweight.md +56 -0
  117. package/skills/ce-compound/references/modes.md +13 -0
  118. package/skills/ce-compound/references/refresh-and-discoverability.md +96 -0
  119. package/skills/ce-compound/references/report.md +115 -0
  120. package/skills/ce-compound/references/research.md +144 -0
  121. package/skills/ce-compound/references/schema.yaml +236 -0
  122. package/skills/ce-compound/references/session-history.md +73 -0
  123. package/skills/ce-compound/references/yaml-schema.md +130 -0
  124. package/skills/ce-compound/scripts/packs-resolve.py +737 -0
  125. package/skills/ce-compound/scripts/session-history/__pycache__/dsh_session.cpython-314.pyc +0 -0
  126. package/skills/ce-compound/scripts/session-history/discover-sessions.sh +290 -0
  127. package/skills/ce-compound/scripts/session-history/discover_dsh.py +123 -0
  128. package/skills/ce-compound/scripts/session-history/dsh_session.py +225 -0
  129. package/skills/ce-compound/scripts/session-history/extract-errors.py +178 -0
  130. package/skills/ce-compound/scripts/session-history/extract-metadata.py +301 -0
  131. package/skills/ce-compound/scripts/session-history/extract-skeleton.py +346 -0
  132. package/skills/ce-compound/scripts/validate-doc-claims.py +497 -0
  133. package/skills/ce-compound/scripts/validate-frontmatter.py +137 -0
  134. package/skills/ce-compound-refresh/SKILL.md +88 -0
  135. package/skills/ce-compound-refresh/assets/resolution-template.md +96 -0
  136. package/skills/ce-compound-refresh/references/classify.md +42 -0
  137. package/skills/ce-compound-refresh/references/commit.md +7 -0
  138. package/skills/ce-compound-refresh/references/concepts-vocabulary.md +116 -0
  139. package/skills/ce-compound-refresh/references/discoverability.md +15 -0
  140. package/skills/ce-compound-refresh/references/investigate.md +23 -0
  141. package/skills/ce-compound-refresh/references/modes.md +27 -0
  142. package/skills/ce-compound-refresh/references/per-action-flows.md +142 -0
  143. package/skills/ce-compound-refresh/references/report.md +23 -0
  144. package/skills/ce-compound-refresh/references/schema.yaml +236 -0
  145. package/skills/ce-compound-refresh/references/scope.md +18 -0
  146. package/skills/ce-compound-refresh/references/worth-audit.md +35 -0
  147. package/skills/ce-compound-refresh/references/yaml-schema.md +130 -0
  148. package/skills/ce-compound-refresh/scripts/validate-doc-claims.py +497 -0
  149. package/skills/ce-compound-refresh/scripts/validate-frontmatter.py +137 -0
  150. package/skills/ce-debug/SKILL.md +122 -0
  151. package/skills/ce-debug/references/anti-patterns.md +91 -0
  152. package/skills/ce-debug/references/defense-in-depth.md +39 -0
  153. package/skills/ce-debug/references/fix.md +21 -0
  154. package/skills/ce-debug/references/investigate.md +114 -0
  155. package/skills/ce-debug/references/investigation-techniques.md +384 -0
  156. package/skills/ce-debug/references/pipeline-mode.md +78 -0
  157. package/skills/ce-debug/references/post-fix-handoff.md +60 -0
  158. package/skills/ce-debug/references/return-to-caller.md +57 -0
  159. package/skills/ce-doc-review/SKILL.md +75 -0
  160. package/skills/ce-doc-review/references/bulk-preview.md +146 -0
  161. package/skills/ce-doc-review/references/cross-model-review.md +207 -0
  162. package/skills/ce-doc-review/references/decision-primer.md +47 -0
  163. package/skills/ce-doc-review/references/dispatch.md +56 -0
  164. package/skills/ce-doc-review/references/document-intake.md +44 -0
  165. package/skills/ce-doc-review/references/findings-schema.json +85 -0
  166. package/skills/ce-doc-review/references/modes.md +20 -0
  167. package/skills/ce-doc-review/references/open-questions-defer.md +158 -0
  168. package/skills/ce-doc-review/references/persona-selection.md +41 -0
  169. package/skills/ce-doc-review/references/personas/adversarial-document-reviewer.md +109 -0
  170. package/skills/ce-doc-review/references/personas/coherence-reviewer.md +69 -0
  171. package/skills/ce-doc-review/references/personas/design-lens-reviewer.md +48 -0
  172. package/skills/ce-doc-review/references/personas/feasibility-reviewer.md +50 -0
  173. package/skills/ce-doc-review/references/personas/product-lens-reviewer.md +85 -0
  174. package/skills/ce-doc-review/references/personas/scope-guardian-reviewer.md +83 -0
  175. package/skills/ce-doc-review/references/personas/security-lens-reviewer.md +41 -0
  176. package/skills/ce-doc-review/references/personas/whole-doc-reviewer.md +25 -0
  177. package/skills/ce-doc-review/references/rendering-floor.md +175 -0
  178. package/skills/ce-doc-review/references/review-output-template.md +123 -0
  179. package/skills/ce-doc-review/references/subagent-template.md +188 -0
  180. package/skills/ce-doc-review/references/synthesis-and-presentation.md +350 -0
  181. package/skills/ce-doc-review/references/walkthrough.md +347 -0
  182. package/skills/ce-doc-review/scripts/cross-model-doc-review.sh +1270 -0
  183. package/skills/ce-doc-review/scripts/packs-resolve.py +737 -0
  184. package/skills/ce-doc-review/scripts/peer-job-runner.py +2594 -0
  185. package/skills/ce-dogfood/SKILL.md +66 -0
  186. package/skills/ce-dogfood/agents/openai.yaml +2 -0
  187. package/skills/ce-dogfood/references/dogfood-report-template.md +97 -0
  188. package/skills/ce-dogfood/references/phases.md +167 -0
  189. package/skills/ce-dogfood/references/test-matrix-taxonomy.md +62 -0
  190. package/skills/ce-dogfood/scripts/packs-resolve.py +737 -0
  191. package/skills/ce-explain/SKILL.md +81 -0
  192. package/skills/ce-explain/references/agents/behavior-trace-scout.md +19 -0
  193. package/skills/ce-explain/references/agents/work-recap-scout.md +23 -0
  194. package/skills/ce-explain/references/check-in.md +18 -0
  195. package/skills/ce-explain/references/destinations.md +35 -0
  196. package/skills/ce-explain/references/explainer-html.md +29 -0
  197. package/skills/ce-explain/references/explainer-markdown.md +24 -0
  198. package/skills/ce-explain/references/intake.md +50 -0
  199. package/skills/ce-explain/references/orchestration.md +46 -0
  200. package/skills/ce-handoff/SKILL.md +54 -0
  201. package/skills/ce-handoff/references/create.md +88 -0
  202. package/skills/ce-handoff/references/resume.md +46 -0
  203. package/skills/ce-ideate/SKILL.md +75 -0
  204. package/skills/ce-ideate/references/agents/issue-intelligence-analyst.md +166 -0
  205. package/skills/ce-ideate/references/agents/learnings-researcher.md +247 -0
  206. package/skills/ce-ideate/references/agents/slack-researcher.md +127 -0
  207. package/skills/ce-ideate/references/agents/web-researcher.md +121 -0
  208. package/skills/ce-ideate/references/decomposition.md +39 -0
  209. package/skills/ce-ideate/references/divergent-ideation.md +112 -0
  210. package/skills/ce-ideate/references/grounding.md +138 -0
  211. package/skills/ce-ideate/references/html-rendering.md +638 -0
  212. package/skills/ce-ideate/references/ideation-sections.md +191 -0
  213. package/skills/ce-ideate/references/issue-intelligence.md +44 -0
  214. package/skills/ce-ideate/references/markdown-rendering.md +242 -0
  215. package/skills/ce-ideate/references/output-mode.md +34 -0
  216. package/skills/ce-ideate/references/post-ideation-workflow.md +169 -0
  217. package/skills/ce-ideate/references/scope-gates.md +148 -0
  218. package/skills/ce-ideate/references/universal-ideation.md +119 -0
  219. package/skills/ce-ideate/references/user-research-artifacts.md +28 -0
  220. package/skills/ce-ideate/references/web-research-cache.md +56 -0
  221. package/skills/ce-noslop/SKILL.md +45 -0
  222. package/skills/ce-noslop/references/patterns.md +61 -0
  223. package/skills/ce-noslop/references/terminology.md +3 -0
  224. package/skills/ce-optimize/SKILL.md +64 -0
  225. package/skills/ce-optimize/references/agents/learnings-researcher.md +247 -0
  226. package/skills/ce-optimize/references/agents/repo-research-analyst.md +258 -0
  227. package/skills/ce-optimize/references/example-expensive-benchmark-spec.yaml +88 -0
  228. package/skills/ce-optimize/references/example-hard-spec.yaml +64 -0
  229. package/skills/ce-optimize/references/example-judge-spec.yaml +83 -0
  230. package/skills/ce-optimize/references/example-text-target-spec.yaml +80 -0
  231. package/skills/ce-optimize/references/experiment-log-schema.yaml +563 -0
  232. package/skills/ce-optimize/references/experiment-prompt-template.md +143 -0
  233. package/skills/ce-optimize/references/judge-prompt-template.md +117 -0
  234. package/skills/ce-optimize/references/loop.md +286 -0
  235. package/skills/ce-optimize/references/measurement.md +168 -0
  236. package/skills/ce-optimize/references/optimize-spec-schema.yaml +570 -0
  237. package/skills/ce-optimize/references/persistence.md +93 -0
  238. package/skills/ce-optimize/references/spec.md +107 -0
  239. package/skills/ce-optimize/references/text-targets.md +51 -0
  240. package/skills/ce-optimize/references/usage-guide.md +147 -0
  241. package/skills/ce-optimize/references/wrap-up.md +54 -0
  242. package/skills/ce-optimize/scripts/decide.mjs +676 -0
  243. package/skills/ce-optimize/scripts/experiment-worktree.sh +330 -0
  244. package/skills/ce-optimize/scripts/measure.sh +140 -0
  245. package/skills/ce-optimize/scripts/parallel-probe.sh +134 -0
  246. package/skills/ce-plan/SKILL.md +60 -0
  247. package/skills/ce-plan/references/agents/agent-native-planning-strategist.md +66 -0
  248. package/skills/ce-plan/references/agents/architecture-strategist.md +46 -0
  249. package/skills/ce-plan/references/agents/best-practices-researcher.md +118 -0
  250. package/skills/ce-plan/references/agents/data-integrity-guardian.md +68 -0
  251. package/skills/ce-plan/references/agents/framework-docs-researcher.md +97 -0
  252. package/skills/ce-plan/references/agents/git-history-analyzer.md +40 -0
  253. package/skills/ce-plan/references/agents/learnings-researcher.md +268 -0
  254. package/skills/ce-plan/references/agents/pattern-recognition-specialist.md +55 -0
  255. package/skills/ce-plan/references/agents/performance-oracle.md +108 -0
  256. package/skills/ce-plan/references/agents/repo-research-analyst.md +262 -0
  257. package/skills/ce-plan/references/agents/security-sentinel.md +91 -0
  258. package/skills/ce-plan/references/agents/slack-researcher.md +131 -0
  259. package/skills/ce-plan/references/agents/spec-flow-analyzer.md +84 -0
  260. package/skills/ce-plan/references/agents/web-researcher.md +125 -0
  261. package/skills/ce-plan/references/approach-altitude.md +55 -0
  262. package/skills/ce-plan/references/bakeoff.md +9 -0
  263. package/skills/ce-plan/references/deepening-workflow.md +263 -0
  264. package/skills/ce-plan/references/final-review.md +134 -0
  265. package/skills/ce-plan/references/html-rendering.md +638 -0
  266. package/skills/ce-plan/references/intake.md +158 -0
  267. package/skills/ce-plan/references/markdown-rendering.md +242 -0
  268. package/skills/ce-plan/references/output-contracts.md +29 -0
  269. package/skills/ce-plan/references/output-mode.md +45 -0
  270. package/skills/ce-plan/references/plan-handoff.md +116 -0
  271. package/skills/ce-plan/references/plan-sections.md +489 -0
  272. package/skills/ce-plan/references/reasoning-elevation.md +124 -0
  273. package/skills/ce-plan/references/research.md +211 -0
  274. package/skills/ce-plan/references/resume.md +61 -0
  275. package/skills/ce-plan/references/settled-decisions.md +45 -0
  276. package/skills/ce-plan/references/structure.md +207 -0
  277. package/skills/ce-plan/references/synthesis-summary.md +260 -0
  278. package/skills/ce-plan/references/universal-planning.md +170 -0
  279. package/skills/ce-plan/scripts/elevation-dispatch.sh +288 -0
  280. package/skills/ce-plan/scripts/packs-resolve.py +737 -0
  281. package/skills/ce-plan/scripts/peer-job-runner.py +2594 -0
  282. package/skills/ce-polish/SKILL.md +22 -0
  283. package/skills/ce-polish/agents/openai.yaml +2 -0
  284. package/skills/ce-polish/references/dev-server-astro.md +58 -0
  285. package/skills/ce-polish/references/dev-server-detection.md +40 -0
  286. package/skills/ce-polish/references/dev-server-next.md +61 -0
  287. package/skills/ce-polish/references/dev-server-nuxt.md +58 -0
  288. package/skills/ce-polish/references/dev-server-procfile.md +59 -0
  289. package/skills/ce-polish/references/dev-server-rails.md +50 -0
  290. package/skills/ce-polish/references/dev-server-remix.md +58 -0
  291. package/skills/ce-polish/references/dev-server-sveltekit.md +58 -0
  292. package/skills/ce-polish/references/dev-server-vite.md +48 -0
  293. package/skills/ce-polish/references/install-riffrec.md +35 -0
  294. package/skills/ce-polish/references/launch-json-schema.md +177 -0
  295. package/skills/ce-polish/references/live-loop.md +98 -0
  296. package/skills/ce-polish/references/live-remote.md +35 -0
  297. package/skills/ce-polish/references/live-start.md +93 -0
  298. package/skills/ce-polish/references/live-stream-contract.md +253 -0
  299. package/skills/ce-polish/references/run.md +67 -0
  300. package/skills/ce-polish/scripts/detect-project-type.sh +277 -0
  301. package/skills/ce-polish/scripts/detect-riffrec.sh +225 -0
  302. package/skills/ce-polish/scripts/live-endpoint.js +2841 -0
  303. package/skills/ce-polish/scripts/read-launch-json.sh +117 -0
  304. package/skills/ce-polish/scripts/resolve-package-manager.sh +95 -0
  305. package/skills/ce-polish/scripts/resolve-port.sh +307 -0
  306. package/skills/ce-pov/SKILL.md +64 -0
  307. package/skills/ce-pov/references/agents/external-evidence-researcher.md +26 -0
  308. package/skills/ce-pov/references/agents/pov-peer.md +43 -0
  309. package/skills/ce-pov/references/agents/precedent-activity-scout.md +21 -0
  310. package/skills/ce-pov/references/agents/project-grounding-scout.md +32 -0
  311. package/skills/ce-pov/references/boundaries.md +36 -0
  312. package/skills/ce-pov/references/cross-model-panel.md +596 -0
  313. package/skills/ce-pov/references/followup.md +9 -0
  314. package/skills/ce-pov/references/grounding.md +47 -0
  315. package/skills/ce-pov/references/intake.md +61 -0
  316. package/skills/ce-pov/references/invocation.md +47 -0
  317. package/skills/ce-pov/references/method.md +68 -0
  318. package/skills/ce-pov/references/pov-schema.json +56 -0
  319. package/skills/ce-pov/references/report.md +7 -0
  320. package/skills/ce-pov/scripts/cross-model-pov.sh +1110 -0
  321. package/skills/ce-pov/scripts/peer-job-runner.py +2594 -0
  322. package/skills/ce-product-pulse/SKILL.md +81 -0
  323. package/skills/ce-product-pulse/agents/openai.yaml +2 -0
  324. package/skills/ce-product-pulse/references/config.md +20 -0
  325. package/skills/ce-product-pulse/references/interview.md +260 -0
  326. package/skills/ce-product-pulse/references/report-template.md +89 -0
  327. package/skills/ce-product-pulse/references/run.md +46 -0
  328. package/skills/ce-product-pulse/references/setup.md +43 -0
  329. package/skills/ce-promote/SKILL.md +90 -0
  330. package/skills/ce-promote/agents/openai.yaml +2 -0
  331. package/skills/ce-promote/references/spiral-cli.md +149 -0
  332. package/skills/ce-proof/SKILL.md +65 -0
  333. package/skills/ce-proof/references/api.md +176 -0
  334. package/skills/ce-proof/references/workflows.md +124 -0
  335. package/skills/ce-prototype/SKILL.md +59 -0
  336. package/skills/ce-prototype/assets/annotate.css +206 -0
  337. package/skills/ce-prototype/assets/annotate.js +837 -0
  338. package/skills/ce-prototype/references/annotation-loop.md +32 -0
  339. package/skills/ce-prototype/references/build.md +39 -0
  340. package/skills/ce-prototype/references/craft-floor.md +43 -0
  341. package/skills/ce-prototype/references/preview.md +118 -0
  342. package/skills/ce-prototype/references/scoping.md +38 -0
  343. package/skills/ce-prototype/references/write-back.md +37 -0
  344. package/skills/ce-prototype/scripts/light-webserver.js +1275 -0
  345. package/skills/ce-resolve-pr-feedback/SKILL.md +60 -0
  346. package/skills/ce-resolve-pr-feedback/references/agents/pr-comment-resolver.md +59 -0
  347. package/skills/ce-resolve-pr-feedback/references/evaluation-rubric.md +141 -0
  348. package/skills/ce-resolve-pr-feedback/references/full-mode.md +336 -0
  349. package/skills/ce-resolve-pr-feedback/references/pipeline-mode.md +23 -0
  350. package/skills/ce-resolve-pr-feedback/references/resume.md +60 -0
  351. package/skills/ce-resolve-pr-feedback/references/return-to-caller.md +111 -0
  352. package/skills/ce-resolve-pr-feedback/references/targeted-mode.md +48 -0
  353. package/skills/ce-resolve-pr-feedback/scripts/get-pr-comments +176 -0
  354. package/skills/ce-resolve-pr-feedback/scripts/get-thread-for-comment +84 -0
  355. package/skills/ce-resolve-pr-feedback/scripts/pending-feedback.py +287 -0
  356. package/skills/ce-resolve-pr-feedback/scripts/reply-to-pr-thread +57 -0
  357. package/skills/ce-resolve-pr-feedback/scripts/resolve-pr-thread +23 -0
  358. package/skills/ce-retune/SKILL.md +42 -0
  359. package/skills/ce-retune/agents/openai.yaml +2 -0
  360. package/skills/ce-retune/references/baseline-mining.md +122 -0
  361. package/skills/ce-retune/references/corpus-audit.md +128 -0
  362. package/skills/ce-retune/references/cut-passes.md +129 -0
  363. package/skills/ce-retune/references/halt-taxonomy.md +123 -0
  364. package/skills/ce-retune/references/noise-floor.md +131 -0
  365. package/skills/ce-retune/references/workflow-shapes.md +73 -0
  366. package/skills/ce-riffrec-feedback-analysis/SKILL.md +33 -0
  367. package/skills/ce-riffrec-feedback-analysis/references/analyzer.md +18 -0
  368. package/skills/ce-riffrec-feedback-analysis/references/compound-engineering-feedback-format.md +116 -0
  369. package/skills/ce-riffrec-feedback-analysis/references/extensive-analysis.md +98 -0
  370. package/skills/ce-riffrec-feedback-analysis/references/install-riffrec.md +27 -0
  371. package/skills/ce-riffrec-feedback-analysis/references/quick-bug-report.md +38 -0
  372. package/skills/ce-riffrec-feedback-analysis/scripts/analyze_riffrec_zip.py +1306 -0
  373. package/skills/ce-setup/SKILL.md +103 -0
  374. package/skills/ce-setup/agents/openai.yaml +2 -0
  375. package/skills/ce-setup/assets/compounding-directive.md +11 -0
  376. package/skills/ce-setup/assets/noslop-directive.md +7 -0
  377. package/skills/ce-setup/assets/pack-rule-template.md +11 -0
  378. package/skills/ce-setup/references/acpx-cache-warm.md +14 -0
  379. package/skills/ce-setup/references/config-template.yaml +210 -0
  380. package/skills/ce-setup/references/legacy-codex-tool-map.md +15 -0
  381. package/skills/ce-setup/references/pack-scaffold.md +45 -0
  382. package/skills/ce-setup/references/repo-fixes.md +121 -0
  383. package/skills/ce-setup/scripts/check-health +929 -0
  384. package/skills/ce-setup/scripts/packs-resolve.py +737 -0
  385. package/skills/ce-simplify-code/SKILL.md +76 -0
  386. package/skills/ce-simplify-code/references/personas/code-quality-reviewer.md +17 -0
  387. package/skills/ce-simplify-code/references/personas/code-reuse-reviewer.md +7 -0
  388. package/skills/ce-simplify-code/references/personas/comment-reviewer.md +24 -0
  389. package/skills/ce-simplify-code/references/personas/efficiency-reviewer.md +11 -0
  390. package/skills/ce-simplify-code/references/personas/test-value-reviewer.md +23 -0
  391. package/skills/ce-simplify-code/references/reviewer-dispatch.md +11 -0
  392. package/skills/ce-simplify-code/references/standalone-report.md +25 -0
  393. package/skills/ce-strategy/SKILL.md +61 -0
  394. package/skills/ce-strategy/references/grounding.md +22 -0
  395. package/skills/ce-strategy/references/interview.md +179 -0
  396. package/skills/ce-strategy/references/strategy-template.md +94 -0
  397. package/skills/ce-strategy/references/update-run.md +33 -0
  398. package/skills/ce-sweep/SKILL.md +93 -0
  399. package/skills/ce-sweep/agents/openai.yaml +2 -0
  400. package/skills/ce-sweep/references/agents/media-analyzer.md +54 -0
  401. package/skills/ce-sweep/references/interview.md +208 -0
  402. package/skills/ce-sweep/references/model-tiers.md +13 -0
  403. package/skills/ce-sweep/references/plan-template.md +62 -0
  404. package/skills/ce-sweep/references/run.md +126 -0
  405. package/skills/ce-sweep/references/sources/email.md +57 -0
  406. package/skills/ce-sweep/references/sources/github-issues.md +59 -0
  407. package/skills/ce-sweep/references/sources/slack.md +61 -0
  408. package/skills/ce-sweep/references/state-schema.md +157 -0
  409. package/skills/ce-sweep/references/subagent-template.md +60 -0
  410. package/skills/ce-sweep/scripts/analyze_riffrec_zip.py +1306 -0
  411. package/skills/ce-sweep/scripts/sweep-state.py +793 -0
  412. package/skills/ce-test-browser/SKILL.md +50 -0
  413. package/skills/ce-test-browser/references/agent-browser-driver.md +47 -0
  414. package/skills/ce-test-browser/references/pipeline-orchestration.md +45 -0
  415. package/skills/ce-test-browser/references/route-and-report.md +129 -0
  416. package/skills/ce-test-browser/scripts/resolve-port.sh +41 -0
  417. package/skills/ce-test-xcode/SKILL.md +26 -0
  418. package/skills/ce-test-xcode/agents/openai.yaml +2 -0
  419. package/skills/ce-test-xcode/references/setup-and-build.md +32 -0
  420. package/skills/ce-test-xcode/references/test-and-report.md +64 -0
  421. package/skills/ce-work/SKILL.md +62 -0
  422. package/skills/ce-work/references/agents/figma-design-sync.md +27 -0
  423. package/skills/ce-work/references/agents/implementation-worker.md +17 -0
  424. package/skills/ce-work/references/cross-model-execution.md +191 -0
  425. package/skills/ce-work/references/execution-engines.md +64 -0
  426. package/skills/ce-work/references/execution-strategy.md +73 -0
  427. package/skills/ce-work/references/implementation-loop.md +107 -0
  428. package/skills/ce-work/references/implementation-result-schema.json +52 -0
  429. package/skills/ce-work/references/input-triage.md +50 -0
  430. package/skills/ce-work/references/non-code-execution.md +23 -0
  431. package/skills/ce-work/references/return-to-caller.md +33 -0
  432. package/skills/ce-work/references/review-findings-followup.md +82 -0
  433. package/skills/ce-work/references/shipping-workflow.md +89 -0
  434. package/skills/ce-work/references/tracker-defer.md +150 -0
  435. package/skills/ce-work/references/work-intake.md +51 -0
  436. package/skills/ce-work/references/workspace-setup.md +27 -0
  437. package/skills/ce-work/scripts/__pycache__/unit_workspace_jobs.cpython-314.pyc +0 -0
  438. package/skills/ce-work/scripts/__pycache__/unit_workspace_state.cpython-314.pyc +0 -0
  439. package/skills/ce-work/scripts/cross-model-work.sh +1385 -0
  440. package/skills/ce-work/scripts/peer-job-runner.py +2594 -0
  441. package/skills/ce-work/scripts/unit-workspace.py +215 -0
  442. package/skills/ce-work/scripts/unit_workspace_ignored.py +93 -0
  443. package/skills/ce-work/scripts/unit_workspace_integration.py +677 -0
  444. package/skills/ce-work/scripts/unit_workspace_jobs.py +1216 -0
  445. package/skills/ce-work/scripts/unit_workspace_lifecycle.py +981 -0
  446. package/skills/ce-work/scripts/unit_workspace_state.py +1379 -0
  447. package/skills/ce-work/scripts/unit_workspace_transaction.py +612 -0
  448. package/skills/ce-worktree/SKILL.md +54 -0
  449. package/skills/lfg/SKILL.md +59 -0
  450. package/skills/lfg/references/debug-return.md +25 -0
  451. package/skills/lfg/references/intake.md +30 -0
  452. package/skills/lfg/references/next-work-handoff.md +96 -0
  453. package/skills/lfg/references/plan-brief.md +36 -0
  454. package/skills/lfg/references/review-followup.md +78 -0
  455. package/skills/lfg/references/shipping.md +65 -0
  456. package/skills/lfg/references/stage-routing.md +49 -0
  457. package/skills/lfg/references/task-visibility.md +11 -0
  458. package/skills/lfg/references/tracker-defer.md +150 -0
  459. package/skills/lfg/references/work-return.md +27 -0
  460. package/skills/wtf/SKILL.md +33 -0
  461. package/skills/wtf/agents/openai.yaml +2 -0
@@ -0,0 +1,570 @@
1
+ # Optimization Spec Schema
2
+ # This is the canonical schema for optimization spec files created by users
3
+ # to configure a /ce-optimize run. The orchestrating agent validates specs
4
+ # against this schema before proceeding.
5
+ #
6
+ # Usage: Create a YAML file matching this schema and pass it to /ce-optimize.
7
+ # The agent reads this spec, validates required fields, and uses it to
8
+ # configure the entire optimization run.
9
+
10
+ # ============================================================================
11
+ # REQUIRED FIELDS
12
+ # ============================================================================
13
+
14
+ required_fields:
15
+
16
+ name:
17
+ type: string
18
+ pattern: "^[a-z0-9]+(?:-[a-z0-9]+)*$"
19
+ description: "Unique identifier for this optimization run (lowercase kebab-case, safe for git refs and worktree paths)"
20
+ example: "improve-issue-clustering"
21
+
22
+ description:
23
+ type: string
24
+ description: "Human-readable description of the optimization goal"
25
+ example: "Improve coherence and coverage of issue/PR clusters"
26
+
27
+ metric:
28
+ type: object
29
+ description: "Three-tier metric configuration"
30
+ required_children:
31
+
32
+ primary:
33
+ type: object
34
+ description: "The metric the loop optimizes against"
35
+ required_children:
36
+
37
+ type:
38
+ type: enum
39
+ values:
40
+ - hard # scalar metric from measurement command (e.g., build time, test pass rate)
41
+ - judge # LLM-as-judge quality score from sampled outputs
42
+ description: "Whether the primary metric comes from the measurement command directly or from LLM-as-judge evaluation"
43
+
44
+ name:
45
+ type: string
46
+ description: "Metric name: must match a key in the measurement command's JSON output (for hard type) or a scoring field (for judge type)"
47
+ example: "cluster_coherence"
48
+
49
+ direction:
50
+ type: enum
51
+ values:
52
+ - maximize
53
+ - minimize
54
+ description: "Whether higher or lower is better"
55
+
56
+ optional_children:
57
+
58
+ baseline:
59
+ type: number
60
+ default: null
61
+ description: "Filled automatically during Phase 1 baseline measurement. Do not set manually."
62
+
63
+ target:
64
+ type: number
65
+ default: null
66
+ description: "Optional target value. Loop stops when this is reached. When metric.objectives is set, target_reached instead requires every required objective that declares a target."
67
+ example: 4.2
68
+
69
+ degenerate_gates:
70
+ type: array
71
+ description: "Fast boolean checks that reject obviously broken solutions before expensive evaluation. Run first, before the primary metric or judge."
72
+ required: true
73
+ items:
74
+ type: object
75
+ required_children:
76
+ name:
77
+ type: string
78
+ description: "Metric name: must match a key in the measurement command's JSON output"
79
+ check:
80
+ type: string
81
+ description: "Comparison operator and threshold. Supported operators: >=, <=, >, <, ==, !="
82
+ example: "<= 0.10"
83
+ optional_children:
84
+ description:
85
+ type: string
86
+ description: "Human-readable explanation of what this gate catches"
87
+
88
+ optional_children:
89
+
90
+ objectives:
91
+ type: array
92
+ default: []
93
+ description: >
94
+ Additional required or secondary hard targets. The primary is always
95
+ a required comparison, even when this list omits it. An experiment is
96
+ eligible when it improves at least one required objective beyond the
97
+ comparison threshold and does not violate any other required
98
+ objective. Completion via target_reached requires every declared
99
+ required target. A spec without metric.objectives keeps single-primary
100
+ acceptance: the primary is the only required objective.
101
+ items:
102
+ type: object
103
+ required_children:
104
+ name:
105
+ type: string
106
+ description: "Metric name: must match a key in the measurement command's JSON output"
107
+ direction:
108
+ type: enum
109
+ values:
110
+ - maximize
111
+ - minimize
112
+ optional_children:
113
+ role:
114
+ type: enum
115
+ values:
116
+ - required
117
+ - secondary
118
+ default: required
119
+ description: "required objectives participate in eligibility and completion; secondary objectives are logged only"
120
+ type:
121
+ type: enum
122
+ values:
123
+ - hard
124
+ default: hard
125
+ description: "Always hard. Additional objectives come from the measurement command."
126
+ target:
127
+ type: number
128
+ default: null
129
+ description: "Declared success value for this objective. target_reached requires every required objective that sets this."
130
+ max_regression:
131
+ type: object
132
+ description: "Optional explicit violation bound. When set, violation uses this bound rather than the comparison threshold, including when the bound is looser. When unset, a comparison-threshold regression is a violation."
133
+ required_children:
134
+ type:
135
+ type: enum
136
+ values:
137
+ - relative
138
+ - absolute
139
+ value:
140
+ type: number
141
+
142
+ diagnostics:
143
+ type: array
144
+ default: []
145
+ description: "Metrics logged for understanding but never gated on. Useful for understanding WHY a primary metric changed."
146
+ items:
147
+ type: object
148
+ required_children:
149
+ name:
150
+ type: string
151
+ description: "Metric name: must match a key in the measurement command's JSON output"
152
+
153
+ judge:
154
+ type: object
155
+ description: "LLM-as-judge configuration. Required when metric.primary.type is 'judge'. Ignored when type is 'hard'."
156
+ required_when: "metric.primary.type == 'judge'"
157
+ required_children:
158
+ rubric:
159
+ type: string
160
+ description: "Multi-line rubric text sent to the judge model. Must instruct the judge to return JSON."
161
+ example: |
162
+ Rate this cluster 1-5:
163
+ - 5: All items clearly about the same issue/feature
164
+ - 4: Strong theme, minor outliers
165
+ - 3: Related but covers 2-3 sub-topics
166
+ - 2: Weak connection
167
+ - 1: Unrelated items grouped together
168
+ scoring:
169
+ type: object
170
+ required_children:
171
+ primary:
172
+ type: string
173
+ description: "Field name from judge JSON output to use as the primary optimization target"
174
+ example: "mean_score"
175
+ optional_children:
176
+ secondary:
177
+ type: array
178
+ default: []
179
+ description: "Additional scoring fields to log (not optimized against)"
180
+ optional_children:
181
+ model:
182
+ type: enum
183
+ values:
184
+ - cheap # the host's fastest, lowest-cost tier
185
+ - strong # the host's most capable tier
186
+ default: cheap
187
+ description: "Capability tier for the judge. The active harness resolves the tier to a concrete model; the spec never names one. Legacy values haiku and sonnet read as cheap and strong."
188
+ confirmation_seed:
189
+ type: integer
190
+ default: null
191
+ description: "Seed for a second, held-out judge sample scored only before a keep and at final confirmation. Must differ from sample_seed. A different seed alone does not make the sample held out: draw it only from items of that same output the selection sample did not draw, so the two share no item. An output with no item left outside the selection sample cannot be confirmed this way, so its candidate is not kept; a spec whose outputs are that small needs measurement.holdout.command instead. This is the judge-type holdout when measurement.holdout is unset; see the holdout validation rules."
192
+ calibration:
193
+ type: object
194
+ default: null
195
+ description: "Optional evidence that the judge scores the way a person would, checked in Phase 1 when labels are set. Without it the approval gate states that the judge is unchecked. Required (labels or an explicit waiver) only when the run waits between ticks through a wake after turn end."
196
+ optional_children:
197
+ labels:
198
+ type: string
199
+ default: null
200
+ description: "Path to a human-labeled sample: items with the user's rubric score and, when given, the reason. Phase 1 writes it for the user during the guided check (default <state-root>/judge-labels.yaml); a sample kept in the repo is reusable across runs. Around ten items shows a pattern; 20-50 makes the agreement figure dependable."
201
+ min_agreement:
202
+ type: number
203
+ default: 0.8
204
+ description: "Fraction of labeled items on which the judge's score must agree with the human label for the harness to be accepted."
205
+ waived:
206
+ type: boolean
207
+ default: false
208
+ description: "True only when the user explicitly waived calibration for a run that would otherwise require it. Record who waived and when in the experiment log's harness_validation."
209
+ sample_size:
210
+ type: integer
211
+ default: 10
212
+ description: "Total number of output items to sample for judge evaluation per experiment"
213
+ stratification:
214
+ type: array
215
+ default: null
216
+ description: "Stratified sampling buckets. If null, uses uniform random sampling."
217
+ items:
218
+ type: object
219
+ required_children:
220
+ bucket:
221
+ type: string
222
+ description: "Bucket name for this stratum"
223
+ count:
224
+ type: integer
225
+ description: "Number of items to sample from this bucket"
226
+ singleton_sample:
227
+ type: integer
228
+ default: 0
229
+ description: "Number of singleton items to sample for false-negative evaluation"
230
+ singleton_rubric:
231
+ type: string
232
+ default: null
233
+ description: "Rubric for evaluating sampled singletons. Required if singleton_sample > 0."
234
+ sample_seed:
235
+ type: integer
236
+ default: 42
237
+ description: "Fixed seed for reproducible sampling across experiments"
238
+ batch_size:
239
+ type: integer
240
+ default: 5
241
+ description: "Number of samples per judge sub-agent batch. Controls parallelism vs overhead."
242
+ minimum_improvement:
243
+ type: number
244
+ default: 0.3
245
+ description: "Minimum judge score improvement required to accept an experiment as 'better'. Accounts for sample-composition variance when output structure changes between experiments. Distinct from measurement.stability.noise_threshold which handles run-to-run flakiness."
246
+ max_total_cost_usd:
247
+ type: number
248
+ default: 5
249
+ description: "Do not start a judge pass whose estimated cost would take cumulative judge spend past this cap. Counts judge scoring only; stopping.max_total_cost_usd caps the whole run. This is a first-run safety default; raise it only after the rubric and harness are trustworthy. Set to null only with explicit user approval."
250
+
251
+ measurement:
252
+ type: object
253
+ description: "How to run the measurement harness"
254
+ required_children:
255
+ command:
256
+ type: string
257
+ description: "Shell command that runs the evaluation and outputs JSON to stdout. The JSON must contain keys matching all gate names and diagnostic names."
258
+ example: "python evaluate.py"
259
+ optional_children:
260
+ timeout_seconds:
261
+ type: integer
262
+ default: 600
263
+ description: "Maximum seconds for the measurement command to run before being killed"
264
+ output_format:
265
+ type: enum
266
+ values:
267
+ - json
268
+ default: json
269
+ description: "Format of the measurement command's stdout. Currently only JSON is supported."
270
+ working_directory:
271
+ type: string
272
+ default: "."
273
+ description: "Working directory for the measurement command, relative to the repo root"
274
+ holdout:
275
+ type: object
276
+ default: null
277
+ description: >
278
+ A held-out confirmation set the loop never selects or generates
279
+ hypotheses from. Scored only before a keep and at final
280
+ confirmation. When configured, a keep requires the holdout comparison
281
+ to agree with the selection comparison (decide.mjs takes the second
282
+ snapshot pair as `holdout` and returns `next_measurement: holdout`
283
+ when it is still missing). Required when metric.primary.type is
284
+ 'judge' and when the run waits between ticks through a wake after
285
+ turn end; otherwise optional, and its absence is stated in the
286
+ Phase 1 approval presentation.
287
+ optional_children:
288
+ command:
289
+ type: string
290
+ default: null
291
+ description: "Shell command that runs the harness on the held-out set and prints the same JSON shape as measurement.command. For a judge primary, metric.judge.confirmation_seed may stand in for this command."
292
+ per_case:
293
+ type: boolean
294
+ default: false
295
+ description: "When true, the measurement JSON also carries a `cases` object mapping a stable case id to a boolean pass/fail (1/0 accepted). decide.mjs then reports `regressions`: cases the reference passed and the candidate fails. Report only; it does not change the decision."
296
+ stability:
297
+ type: object
298
+ default: { mode: "stable" }
299
+ description: "How to handle metric variance across runs"
300
+ required_children:
301
+ mode:
302
+ type: enum
303
+ values:
304
+ - stable # run once, trust the result
305
+ - repeat # run N times, aggregate
306
+ - ladder # smoke, one paired exploratory sample, adaptive extras, full protocol only before keep
307
+ default: stable
308
+ optional_children:
309
+ repeat_count:
310
+ type: integer
311
+ default: 5
312
+ description: "Number of times to run the harness when mode is 'repeat', and the confirmation sample count when mode is 'ladder'"
313
+ aggregation:
314
+ type: enum
315
+ values:
316
+ - median
317
+ - mean
318
+ - min
319
+ - max
320
+ default: median
321
+ description: "How to combine repeated measurements into a single value"
322
+ noise_threshold:
323
+ type: number
324
+ default: 0.02
325
+ description: "Absolute improvement that must be exceeded when comparison.method is absolute (the default). Applied to hard metrics only."
326
+ comparison:
327
+ type: object
328
+ default: { method: "absolute" }
329
+ description: "How to decide keep / revert / inconclusive. Unset method preserves the legacy absolute noise_threshold rule."
330
+ required_children:
331
+ method:
332
+ type: enum
333
+ values:
334
+ - absolute
335
+ - relative
336
+ - paired
337
+ default: absolute
338
+ description: "absolute uses noise_threshold; relative uses relative_threshold; paired uses sample ranges / paired diffs and may return inconclusive"
339
+ optional_children:
340
+ relative_threshold:
341
+ type: number
342
+ default: 0.05
343
+ description: "Fraction of the current-best value that counts as a real change when method is relative or paired"
344
+ ladder:
345
+ type: object
346
+ description: "Cost-aware measurement stages. Used when mode is ladder; ignored otherwise."
347
+ optional_children:
348
+ smoke_command:
349
+ type: string
350
+ default: null
351
+ description: "Cheap correctness check. Failure is degenerate and skips timed measurement."
352
+ exploratory_pairs:
353
+ type: integer
354
+ default: 1
355
+ description: "Paired exploratory samples before deciding whether to spend more. Must be a positive integer."
356
+ confirmation_repeats:
357
+ type: integer
358
+ default: null
359
+ description: "Full protocol sample count before keep. Defaults to repeat_count. Must be a positive integer at least as large as exploratory_pairs."
360
+ futility:
361
+ type: object
362
+ description: "Predeclared abort bound for a clearly noncompetitive live run"
363
+ optional_children:
364
+ worse_factor:
365
+ type: number
366
+ default: 1.2
367
+ description: "Censor after the first sample if the candidate is this multiple worse than the current best (minimize: candidate >= best * factor)"
368
+ after_elapsed_seconds:
369
+ type: number
370
+ default: null
371
+ description: "Censor a still-noncompetitive live run once elapsed time reaches this bound. When set, must be a positive number."
372
+
373
+ scope:
374
+ type: object
375
+ description: "What the experiment agent is allowed to modify"
376
+ required_children:
377
+ mutable:
378
+ type: array
379
+ description: "Files and directories the agent MAY modify during experiments"
380
+ items:
381
+ type: string
382
+ description: "File path or directory (relative to repo root). Directories match all files within."
383
+ example:
384
+ - "src/clustering/"
385
+ - "src/preprocessing/"
386
+ - "config/clustering.yaml"
387
+ immutable:
388
+ type: array
389
+ description: "Files and directories the agent MUST NOT modify. The measurement harness should always be listed here."
390
+ items:
391
+ type: string
392
+ example:
393
+ - "evaluate.py"
394
+ - "tests/fixtures/"
395
+ - "data/"
396
+
397
+ # ============================================================================
398
+ # OPTIONAL FIELDS
399
+ # ============================================================================
400
+
401
+ optional_fields:
402
+
403
+ execution:
404
+ type: object
405
+ default: { mode: "parallel", backend: "worktree", max_concurrent: 4 }
406
+ description: "How experiments are executed"
407
+ optional_children:
408
+ mode:
409
+ type: enum
410
+ values:
411
+ - parallel # run experiments simultaneously (default)
412
+ - serial # run one at a time
413
+ default: parallel
414
+ backend:
415
+ type: enum
416
+ values:
417
+ - worktree # git worktrees for isolation (default)
418
+ - codex # Codex sandboxes for isolation
419
+ - remote # detached workers with their own checkout; results arrive as a pushed ref or store file
420
+ default: worktree
421
+ description: "Where experiments run. remote needs a detached-worker capability (SKILL.md Execution Surface); without one the run falls back to worktree. remote workers measure paired on their own machine, so it requires a relative or paired comparison."
422
+ max_concurrent:
423
+ type: integer
424
+ default: 4
425
+ minimum: 1
426
+ description: "Maximum experiments to run in parallel. Capped at 6 for worktree backend. 8+ only valid for Codex or remote backends. For remote this caps dispatched workers, not local worktrees."
427
+ max_experiments_per_tick:
428
+ type: integer
429
+ default: null
430
+ minimum: 1
431
+ description: "Optional cap on experiments dispatched in one tick (one batch) of the loop. Bounds how much a single wake or session does before it checkpoints. Unset means max_concurrent alone bounds the batch."
432
+ codex_security:
433
+ type: enum
434
+ values:
435
+ - full-auto # --full-auto (workspace write)
436
+ - yolo # --dangerously-bypass-approvals-and-sandbox
437
+ default: null
438
+ description: "Codex security posture. If null, user is asked once per session."
439
+
440
+ parallel:
441
+ type: object
442
+ default: {}
443
+ description: "Parallelism configuration discovered or set during Phase 1"
444
+ optional_children:
445
+ port_strategy:
446
+ type: enum
447
+ values:
448
+ - parameterized # use env var for port
449
+ - none # no port parameterization needed
450
+ default: null
451
+ description: "If null, auto-detected during Phase 1 parallelism probe"
452
+ port_env_var:
453
+ type: string
454
+ default: null
455
+ description: "Environment variable name for port parameterization (e.g., EVAL_PORT)"
456
+ port_base:
457
+ type: integer
458
+ default: null
459
+ description: "Base port number. Each experiment gets port_base + experiment_index."
460
+ shared_files:
461
+ type: array
462
+ default: []
463
+ description: "Files that must be copied into each experiment worktree (e.g., SQLite databases)"
464
+ items:
465
+ type: string
466
+ exclusive_resources:
467
+ type: array
468
+ default: []
469
+ description: "Resources requiring exclusive access (e.g., 'gpu'). If non-empty, forces serial mode."
470
+ items:
471
+ type: string
472
+
473
+ dependencies:
474
+ type: object
475
+ default: { approved: [] }
476
+ description: "Dependency management for experiments"
477
+ optional_children:
478
+ approved:
479
+ type: array
480
+ default: []
481
+ description: "Pre-approved new dependencies that experiments may add"
482
+ items:
483
+ type: string
484
+
485
+ constraints:
486
+ type: array
487
+ default: []
488
+ description: "Free-text constraints that experiment agents must follow"
489
+ items:
490
+ type: string
491
+ example:
492
+ - "Do not change the output format of clusters"
493
+ - "Preserve backward compatibility with existing cluster consumers"
494
+
495
+ stopping:
496
+ type: object
497
+ default: { max_iterations: 100, max_hours: 8, max_wall_hours: 72, plateau_iterations: 10, target_reached: true }
498
+ description: "When the optimization loop should stop. Any criterion can trigger a stop."
499
+ optional_children:
500
+ max_iterations:
501
+ type: integer
502
+ default: 100
503
+ description: "Stop after this many total experiments"
504
+ max_hours:
505
+ type: number
506
+ default: 8
507
+ description: "Stop after this many active hours: time spent inside loop ticks since Phase 3 started, summed across ticks. Time spent waiting between ticks does not count. In one uninterrupted session this equals wall-clock time."
508
+ max_wall_hours:
509
+ type: number
510
+ default: 72
511
+ description: "Calendar backstop: stop once this many hours have passed since Phase 3 started, whether or not the run was active. No wake or resume extends it. Must be >= max_hours."
512
+ plateau_iterations:
513
+ type: integer
514
+ default: 10
515
+ description: "Stop if no improvement for this many consecutive experiments"
516
+ target_reached:
517
+ type: boolean
518
+ default: true
519
+ description: "Stop when the primary metric reaches the target value (if set)"
520
+ max_total_cost_usd:
521
+ type: number
522
+ default: null
523
+ description: "Do not start a dispatch whose estimated cost would take model spend for the whole run (experiment workers, judges, and research subagents) past this cap. Counted from host-reported usage where available and estimated otherwise."
524
+
525
+ max_runner_up_merges_per_batch:
526
+ type: integer
527
+ default: 1
528
+ description: "Maximum number of file-disjoint runner-up experiments to attempt merging per batch after keeping the best experiment"
529
+
530
+ # ============================================================================
531
+ # VALIDATION RULES
532
+ # ============================================================================
533
+
534
+ validation_rules:
535
+ - "All required fields must be present"
536
+ - "name must be lowercase kebab-case (`^[a-z0-9]+(?:-[a-z0-9]+)*$`)"
537
+ - "metric.primary.type must be 'hard' or 'judge'"
538
+ - "If metric.primary.type is 'judge', metric.judge must be present with rubric and scoring"
539
+ - "metric.degenerate_gates must have at least one entry"
540
+ - "measurement.command must be a non-empty string"
541
+ - "scope.mutable must have at least one entry"
542
+ - "scope.immutable must have at least one entry"
543
+ - "Gate check operators must be one of: >=, <=, >, <, ==, !="
544
+ - "execution.max_concurrent must be >= 1"
545
+ - "execution.max_concurrent must not exceed 6 when execution.backend is 'worktree'"
546
+ - "execution.backend must be one of: worktree, codex, remote"
547
+ - "If execution.backend is 'remote', measurement.stability.comparison.method must be 'paired' or 'relative'; absolute numbers from different machines are not comparable"
548
+ - "If parallel.exclusive_resources is non-empty, execution.mode should be 'serial'"
549
+ - "If metric.judge.singleton_sample > 0, metric.judge.singleton_rubric must be present"
550
+ - "If metric.primary.type is 'judge' and metric.judge.max_total_cost_usd is null, the user should explicitly approve uncapped spend"
551
+ - "stopping must have at least one non-default criterion or use defaults"
552
+ - "stopping.max_total_cost_usd, when set, must be a positive number"
553
+ - "If metric.objectives is set, each additional objective is a hard metric whose name is unique and matches a measurement JSON key"
554
+ - "The primary is always a required comparison, including when metric.objectives omits it"
555
+ - "If measurement.stability.mode is 'ladder', comparison.method should be relative or paired unless the user explicitly keeps absolute"
556
+ - "A spec without metric.objectives keeps single-primary acceptance"
557
+ - "comparison.method, when set, must be one of: absolute, relative, paired"
558
+ - "If measurement.stability.mode is 'ladder', exploratory_pairs and confirmation_repeats (or repeat_count) must be positive integers, and confirmation must be at least exploratory_pairs"
559
+ - "futility.after_elapsed_seconds, when set, must be a positive number"
560
+ - "stopping.max_wall_hours must be a positive number and at least stopping.max_hours"
561
+ - "execution.max_experiments_per_tick, when set, must be a positive integer"
562
+ - "If the run waits between ticks through a wake after turn end and metric.primary.type is 'judge', metric.judge.max_total_cost_usd must be set; unattended spend is never uncapped"
563
+ - "metric.judge.model, when set, must be cheap or strong (legacy haiku and sonnet read as cheap and strong)"
564
+ - "A holdout is configured when measurement.holdout.command is set, or when metric.primary.type is 'judge' and metric.judge.confirmation_seed is set and differs from sample_seed"
565
+ - "If metric.primary.type is 'judge', a holdout must be configured"
566
+ - "If the run waits between ticks through a wake after turn end, a holdout must be configured; an unattended keep is never confirmed on the selection sample alone"
567
+ - "When a holdout is configured, a keep requires the holdout comparison to agree with the selection comparison; the holdout is never used to select or generate hypotheses"
568
+ - "When metric.judge.calibration.labels is set, the harness is accepted only when the judge meets min_agreement against them"
569
+ - "If metric.primary.type is 'judge' and the run waits between ticks through a wake after turn end, calibration labels must meet min_agreement or metric.judge.calibration.waived must be true with the user's explicit waiver; an attended judge run may proceed uncalibrated, stated at approval"
570
+ - "If measurement.per_case is true, the measurement JSON must carry a `cases` object"
@@ -0,0 +1,93 @@
1
+ # Persistence: the rules, the checkpoints, and resume
2
+
3
+ Read this before Phase 0 and follow it for the whole run. The body states the invariant and names the six checkpoints; this file carries the rules that implement them, the state root, the checkpoint table, the file layout, the wait record, and the resume procedure.
4
+
5
+ ### Core Rules
6
+
7
+ 1. **Write each experiment result to disk IMMEDIATELY after measurement.** Not after the batch, not after evaluation, IMMEDIATELY. Append the experiment entry to the experiment log file the moment its metrics are known, before evaluating the next experiment. This is the #1 crash-safety rule.
8
+
9
+ 2. **VERIFY every critical write.** After writing the experiment log, read the file back and confirm the entry is present. This catches silent write failures. Do not proceed to the next experiment until verification passes.
10
+
11
+ 3. **Re-read from disk at every phase boundary and before every decision.** Never trust in-memory state across phase transitions, batch boundaries, or after any operation that might have taken significant time. Re-read the experiment log and strategy digest from disk.
12
+
13
+ 4. **One experiment, one log entry.** Append a new experiment entry on its first measurement. Later ladder samples for that same experiment update that entry's metrics and outcome in place so a crash can resume the ladder without losing samples or duplicating the hypothesis. Distinct `comparisons` pairings accumulate on that same entry; in-place updates must not replace a previously persisted distinct pairing. Never rewrite a different experiment's samples or gate values. Outcome, `best`, and `hypothesis_backlog` are also updated in place at batch evaluation (CP-4). Do not rebuild the file from memory.
14
+
15
+ 5. **Per-experiment result markers for crash recovery.** Each experiment writes a `result.yaml` marker in its worktree immediately after measurement. On resume, scan for these markers to recover experiments that were measured but not yet logged.
16
+
17
+ 6. **Write the strategy digest after every batch, before generating new hypotheses.** The agent reads the digest (not its memory) when deciding what to try next.
18
+
19
+ 7. **Never present results to the user without writing them to disk first.** The order is: measure -> write to disk -> verify -> THEN show the user. Not the reverse.
20
+
21
+ ### The State Root
22
+
23
+ `<state-root>` is the directory that holds the run's ledger. Resolve it once, in Phase 0, by the body's Execution Surface rule: when the harness names a durable state root, `<state-root>` is `<that location>/ce-optimize/<spec-name>/`, placed where that location's own conventions keep working state rather than user-facing documents; otherwise it is `.context/compound-engineering/ce-optimize/<spec-name>/` in the repo checkout, which is gitignored and survives a local resume only on this machine. A run's root is wherever its log already is: never move a ledger mid-run, and a resume that finds the log at one root uses that root even when the other is now available. Give every subagent and worker the resolved path, not the rule.
24
+
25
+ Examples of what the three capabilities look like on some harnesses. This table is not a tool list; the body's rule decides.
26
+
27
+ | Harness | Durable state root | Wake after turn end | Detached worker |
28
+ |---|---|---|---|
29
+ | A coordinator harness with a persistent agent store (for example Cursor Projects' Agent Store) | The store path named in your context | Event subscriptions or a timer subscription that re-invokes the agent | A cloud-agent launch that returns a receipt and lands its work as a pushed branch or a store file |
30
+ | Grok (CLI/TUI) | None named; `.context/` | `scheduler_create --durable` | None; `worktree` |
31
+ | Claude Code, Codex, Cursor CLI sessions | None named; `.context/` | Whatever scheduling or wake tool the session lists; when it lists none, cron running the resume invocation is the user's escalation | None; `worktree` (or `codex` when the spec says so) |
32
+
33
+ When the harness shows the user a status surface for this run, write a one-line run status there at CP-4 and at each stop, in addition to the log.
34
+
35
+ ### Mandatory Disk Checkpoints
36
+
37
+ These are non-negotiable write-then-verify steps. At each checkpoint, the agent MUST write the specified file and then read it back to confirm the write succeeded.
38
+
39
+ | Checkpoint | File Written | Phase |
40
+ |---|---|---|
41
+ | CP-0: Spec saved | `spec.yaml` | Phase 0, after user approval |
42
+ | CP-1: Baseline recorded | `experiment-log.yaml` (initial with baseline) | Phase 1, after baseline measurement |
43
+ | Approval recorded | `experiment-log.yaml` (`approval` section) | Phase 1.7, the moment the user approves |
44
+ | CP-2: Hypothesis backlog saved | `experiment-log.yaml` (hypothesis_backlog section) | Phase 2, after hypothesis generation |
45
+ | CP-3: Each experiment result | `experiment-log.yaml` (append on first measurement; update that entry on later samples) | Phase 3.3, immediately after each measurement |
46
+ | CP-4: Batch summary | `experiment-log.yaml` (outcomes + best + `run_state`) + `strategy-digest.md` | Phase 3.5, after batch evaluation |
47
+ | CP-5: Final summary | `experiment-log.yaml` (final state) | Phase 4, at wrap-up |
48
+
49
+ **Format of a verification step:**
50
+ 1. Write the file using the native file-write tool
51
+ 2. Read the file back using the native file-read tool
52
+ 3. Confirm the expected content is present
53
+ 4. If verification fails, retry the write. If it fails twice, alert the user.
54
+
55
+ ### File Locations (all under `<state-root>`)
56
+
57
+ Anything the branch's readers need durably must be exported to a tracked path; the ledger does not travel with the branch from either root.
58
+
59
+ | File | Purpose | Written When |
60
+ |------|---------|-------------|
61
+ | `spec.yaml` | Optimization spec (fixed once the Phase 1 approval gate is cleared) | Phase 0 (CP-0) |
62
+ | `experiment-log.yaml` | Full history of all experiments, the approval record, and `run_state` | Initialized at CP-1, appended at first CP-3, updated on later samples and at CP-4 |
63
+ | `strategy-digest.md` | Compressed learnings for hypothesis generation | Written at CP-4 after each batch |
64
+ | `source-digest.md` | What experiment workers need to know about the target's material and current approach | Phase 2.1; rewritten only when a keep changes what it describes |
65
+ | `judge-cache.yaml` | Per-run judge results keyed by item content hash, so identical output is scored once (`references/experiment-log-schema.yaml`, JUDGE CACHE) | Phase 3.3, as each judge batch lands |
66
+ | `<worktree>/result.yaml` | Per-experiment crash-recovery marker | Immediately after measurement, before CP-3 |
67
+
68
+ ### The Approval Record
69
+
70
+ The Phase 1 approval is a user decision the log records so that a resume, including an unattended wake, does not re-ask it. Write `approval` the moment the user approves, before Phase 2 starts, with the fields the log schema names: the time, the SHA-256 of the saved `spec.yaml` bytes, and the caps in force (`stopping.*`, `metric.judge.max_total_cost_usd`, `execution.max_concurrent`). The record is valid while the spec digest and every recorded cap match the spec on disk. A record that is absent or no longer matches means the Phase 1 gate is presented again; the answer is a new record.
71
+
72
+ The baseline and every logged experiment were measured under the spec that was approved, so what changed decides what still stands. When the change leaves how those measurements were produced untouched (a cap, or a holdout or calibration added to a spec that lacked one), the measurements stand and approving the new spec continues the run. When anything that produced them differs (the metric, the measurement command, the scope, the comparison), the measurements no longer describe this spec: while the log holds no hypothesis backlog and no experiments, go back through Phase 1 so the baseline matches the new spec; once it holds either, the spec is fixed for the run, so restore the approved spec or take Fresh start (Phase 0.4). Say which of the two applies when presenting the gate.
73
+
74
+ ### The Wait Record and Ticks
75
+
76
+ Phase 3 runs as ticks (`references/loop.md`). Before ending a turn with work outstanding, verify the ledger with `run_state.status: waiting` and each pending receipt's result location and on-arrival action in `run_state.pending_waits`.
77
+
78
+ Automatic resumption requires registered wakes for pending results and a timer wake at the wall deadline, even if no worker ever returns. Record the deadline timer in `pending_waits` too. The deadline is `phase3_started_at` plus `stopping.max_wall_hours`; a resume never resets it. If either result delivery or the deadline wake cannot be secured, continue an attached wait only while this session can enforce that deadline. Otherwise hand back the verified checkpoint, tell the user monitoring is paused, and print the resume invocation. Record unavailable wakes as such; do not claim automatic monitoring. Never fake a wait with a foreground sleep or an unmanaged detached process.
79
+
80
+ Write and verify `run_state` whenever a wait is registered or cleared and at CP-4. It also carries `active_seconds` (time spent inside ticks), `phase3_started_at` (the calendar anchor), the completed `tick` count, and `status` (`running`, `waiting`, `blocked`, `final`). Use `blocked` when progress needs an external change other than an outstanding result or a manual resume; report the blocker instead of spinning.
81
+
82
+ **User-runnable resume syntax.** When this reference tells you to print or copy a resume invocation, default to `/ce-optimize <state-root>/spec.yaml`. Use `$ce-optimize <state-root>/spec.yaml` only when the active harness is Codex or explicitly documents dollar-prefixed skill invocation. Render only the invocation as inline code and output one form only.
83
+
84
+ ### On Resume
85
+
86
+ A wake, a scheduler fire, or a manual re-run re-enters here. When Phase 0.4 detects an existing run:
87
+ 1. Read the experiment log from `<state-root>`. It is the ground truth. Check the wall deadline before resuming work or re-registering a wait. If it has passed, persist any already-arrived results and go to Phase 4 without waiting for missing results or integrating candidates
88
+ 2. Scan worktree directories for `result.yaml` markers not yet in the log
89
+ 3. Recover any measured-but-unlogged experiments. The recovered first CP-3 entry copies `opportunity` from the hypothesis backlog as of dispatch; `result.yaml` holds metrics only, so a missing forecast stays unrecorded rather than being reconstructed from the result
90
+ 4. Collect every `run_state.pending_waits` item whose result has arrived, by the shape recorded for it, and persist each at CP-3. An item whose result has not arrived stays pending; an item whose wake is gone follows The Wait Record and Ticks above, including its manual-resume fallback
91
+ 5. Continue as the SKILL.md body's resume rule directs. Skip the work the log proves finished, and re-enter any gate whose record is absent or no longer matches
92
+
93
+ ---