@bastani/atomic 0.6.8-0 → 0.7.0-1

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 (765) hide show
  1. package/bin/atomic +65 -0
  2. package/package.json +17 -82
  3. package/postinstall.mjs +47 -0
  4. package/.agents/skills/ado-commit/SKILL.md +0 -94
  5. package/.agents/skills/ado-create-pr/SKILL.md +0 -211
  6. package/.agents/skills/advanced-evaluation/SKILL.md +0 -404
  7. package/.agents/skills/advanced-evaluation/references/bias-mitigation.md +0 -288
  8. package/.agents/skills/advanced-evaluation/references/evaluation-pipeline.md +0 -43
  9. package/.agents/skills/advanced-evaluation/references/implementation-patterns.md +0 -315
  10. package/.agents/skills/advanced-evaluation/references/metrics-guide.md +0 -331
  11. package/.agents/skills/advanced-evaluation/scripts/evaluation_example.py +0 -392
  12. package/.agents/skills/ast-grep/SKILL.md +0 -325
  13. package/.agents/skills/ast-grep/references/rule_reference.md +0 -297
  14. package/.agents/skills/bdi-mental-states/SKILL.md +0 -313
  15. package/.agents/skills/bdi-mental-states/references/bdi-ontology-core.md +0 -207
  16. package/.agents/skills/bdi-mental-states/references/framework-integration.md +0 -582
  17. package/.agents/skills/bdi-mental-states/references/rdf-examples.md +0 -315
  18. package/.agents/skills/bdi-mental-states/references/sparql-competency.md +0 -420
  19. package/.agents/skills/bun/SKILL.md +0 -233
  20. package/.agents/skills/context-compression/SKILL.md +0 -274
  21. package/.agents/skills/context-compression/references/evaluation-framework.md +0 -213
  22. package/.agents/skills/context-compression/scripts/compression_evaluator.py +0 -862
  23. package/.agents/skills/context-compression/tests/test_compression_evaluator.py +0 -56
  24. package/.agents/skills/context-degradation/SKILL.md +0 -208
  25. package/.agents/skills/context-degradation/references/patterns.md +0 -314
  26. package/.agents/skills/context-degradation/scripts/degradation_detector.py +0 -614
  27. package/.agents/skills/context-fundamentals/SKILL.md +0 -203
  28. package/.agents/skills/context-fundamentals/references/context-components.md +0 -283
  29. package/.agents/skills/context-fundamentals/scripts/context_manager.py +0 -533
  30. package/.agents/skills/context-optimization/SKILL.md +0 -197
  31. package/.agents/skills/context-optimization/references/optimization_techniques.md +0 -272
  32. package/.agents/skills/context-optimization/scripts/compaction.py +0 -562
  33. package/.agents/skills/create-spec/SKILL.md +0 -249
  34. package/.agents/skills/docx/LICENSE.txt +0 -30
  35. package/.agents/skills/docx/SKILL.md +0 -592
  36. package/.agents/skills/docx/scripts/__init__.py +0 -1
  37. package/.agents/skills/docx/scripts/accept_changes.py +0 -135
  38. package/.agents/skills/docx/scripts/comment.py +0 -318
  39. package/.agents/skills/docx/scripts/office/helpers/__init__.py +0 -0
  40. package/.agents/skills/docx/scripts/office/helpers/merge_runs.py +0 -199
  41. package/.agents/skills/docx/scripts/office/helpers/simplify_redlines.py +0 -197
  42. package/.agents/skills/docx/scripts/office/pack.py +0 -159
  43. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +0 -1499
  44. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +0 -146
  45. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +0 -1085
  46. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +0 -11
  47. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +0 -3081
  48. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +0 -23
  49. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +0 -185
  50. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +0 -287
  51. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +0 -1676
  52. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +0 -28
  53. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +0 -144
  54. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +0 -174
  55. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +0 -25
  56. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +0 -18
  57. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +0 -59
  58. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +0 -56
  59. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +0 -195
  60. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +0 -582
  61. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +0 -25
  62. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +0 -4439
  63. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +0 -570
  64. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +0 -509
  65. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +0 -12
  66. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +0 -108
  67. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +0 -96
  68. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +0 -3646
  69. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +0 -116
  70. package/.agents/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +0 -42
  71. package/.agents/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +0 -50
  72. package/.agents/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +0 -49
  73. package/.agents/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +0 -33
  74. package/.agents/skills/docx/scripts/office/schemas/mce/mc.xsd +0 -75
  75. package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-2010.xsd +0 -560
  76. package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-2012.xsd +0 -67
  77. package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-2018.xsd +0 -14
  78. package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +0 -20
  79. package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +0 -13
  80. package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +0 -4
  81. package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +0 -8
  82. package/.agents/skills/docx/scripts/office/soffice.py +0 -183
  83. package/.agents/skills/docx/scripts/office/unpack.py +0 -132
  84. package/.agents/skills/docx/scripts/office/validate.py +0 -111
  85. package/.agents/skills/docx/scripts/office/validators/__init__.py +0 -15
  86. package/.agents/skills/docx/scripts/office/validators/base.py +0 -847
  87. package/.agents/skills/docx/scripts/office/validators/docx.py +0 -446
  88. package/.agents/skills/docx/scripts/office/validators/pptx.py +0 -275
  89. package/.agents/skills/docx/scripts/office/validators/redlining.py +0 -247
  90. package/.agents/skills/docx/scripts/templates/comments.xml +0 -3
  91. package/.agents/skills/docx/scripts/templates/commentsExtended.xml +0 -3
  92. package/.agents/skills/docx/scripts/templates/commentsExtensible.xml +0 -3
  93. package/.agents/skills/docx/scripts/templates/commentsIds.xml +0 -3
  94. package/.agents/skills/docx/scripts/templates/people.xml +0 -3
  95. package/.agents/skills/evaluation/SKILL.md +0 -253
  96. package/.agents/skills/evaluation/references/metrics.md +0 -339
  97. package/.agents/skills/evaluation/scripts/evaluator.py +0 -627
  98. package/.agents/skills/explain-code/SKILL.md +0 -232
  99. package/.agents/skills/filesystem-context/SKILL.md +0 -289
  100. package/.agents/skills/filesystem-context/references/implementation-patterns.md +0 -549
  101. package/.agents/skills/filesystem-context/scripts/filesystem_context.py +0 -425
  102. package/.agents/skills/find-skills/SKILL.md +0 -144
  103. package/.agents/skills/gh-commit/SKILL.md +0 -245
  104. package/.agents/skills/gh-create-pr/SKILL.md +0 -95
  105. package/.agents/skills/hosted-agents/SKILL.md +0 -262
  106. package/.agents/skills/hosted-agents/references/infrastructure-patterns.md +0 -700
  107. package/.agents/skills/hosted-agents/scripts/sandbox_manager.py +0 -590
  108. package/.agents/skills/impeccable/SKILL.md +0 -178
  109. package/.agents/skills/impeccable/agents/openai.yaml +0 -4
  110. package/.agents/skills/impeccable/reference/adapt.md +0 -190
  111. package/.agents/skills/impeccable/reference/animate.md +0 -175
  112. package/.agents/skills/impeccable/reference/audit.md +0 -134
  113. package/.agents/skills/impeccable/reference/bolder.md +0 -113
  114. package/.agents/skills/impeccable/reference/brand.md +0 -114
  115. package/.agents/skills/impeccable/reference/clarify.md +0 -174
  116. package/.agents/skills/impeccable/reference/cognitive-load.md +0 -106
  117. package/.agents/skills/impeccable/reference/color-and-contrast.md +0 -105
  118. package/.agents/skills/impeccable/reference/colorize.md +0 -154
  119. package/.agents/skills/impeccable/reference/craft.md +0 -193
  120. package/.agents/skills/impeccable/reference/critique.md +0 -213
  121. package/.agents/skills/impeccable/reference/delight.md +0 -302
  122. package/.agents/skills/impeccable/reference/distill.md +0 -111
  123. package/.agents/skills/impeccable/reference/document.md +0 -427
  124. package/.agents/skills/impeccable/reference/extract.md +0 -70
  125. package/.agents/skills/impeccable/reference/harden.md +0 -347
  126. package/.agents/skills/impeccable/reference/heuristics-scoring.md +0 -234
  127. package/.agents/skills/impeccable/reference/interaction-design.md +0 -195
  128. package/.agents/skills/impeccable/reference/layout.md +0 -141
  129. package/.agents/skills/impeccable/reference/live.md +0 -594
  130. package/.agents/skills/impeccable/reference/motion-design.md +0 -109
  131. package/.agents/skills/impeccable/reference/onboard.md +0 -234
  132. package/.agents/skills/impeccable/reference/optimize.md +0 -258
  133. package/.agents/skills/impeccable/reference/overdrive.md +0 -130
  134. package/.agents/skills/impeccable/reference/personas.md +0 -178
  135. package/.agents/skills/impeccable/reference/polish.md +0 -232
  136. package/.agents/skills/impeccable/reference/product.md +0 -62
  137. package/.agents/skills/impeccable/reference/quieter.md +0 -99
  138. package/.agents/skills/impeccable/reference/responsive-design.md +0 -114
  139. package/.agents/skills/impeccable/reference/shape.md +0 -151
  140. package/.agents/skills/impeccable/reference/spatial-design.md +0 -100
  141. package/.agents/skills/impeccable/reference/teach.md +0 -156
  142. package/.agents/skills/impeccable/reference/typeset.md +0 -124
  143. package/.agents/skills/impeccable/reference/typography.md +0 -159
  144. package/.agents/skills/impeccable/reference/ux-writing.md +0 -107
  145. package/.agents/skills/impeccable/scripts/cleanup-deprecated.mjs +0 -284
  146. package/.agents/skills/impeccable/scripts/command-metadata.json +0 -94
  147. package/.agents/skills/impeccable/scripts/design-parser.mjs +0 -820
  148. package/.agents/skills/impeccable/scripts/detect-csp.mjs +0 -198
  149. package/.agents/skills/impeccable/scripts/is-generated.mjs +0 -69
  150. package/.agents/skills/impeccable/scripts/live-accept.mjs +0 -595
  151. package/.agents/skills/impeccable/scripts/live-browser.js +0 -4781
  152. package/.agents/skills/impeccable/scripts/live-inject.mjs +0 -445
  153. package/.agents/skills/impeccable/scripts/live-poll.mjs +0 -186
  154. package/.agents/skills/impeccable/scripts/live-server.mjs +0 -694
  155. package/.agents/skills/impeccable/scripts/live-wrap.mjs +0 -571
  156. package/.agents/skills/impeccable/scripts/live.mjs +0 -247
  157. package/.agents/skills/impeccable/scripts/load-context.mjs +0 -141
  158. package/.agents/skills/impeccable/scripts/modern-screenshot.umd.js +0 -14
  159. package/.agents/skills/impeccable/scripts/pin.mjs +0 -214
  160. package/.agents/skills/init/SKILL.md +0 -140
  161. package/.agents/skills/liteparse/SKILL.md +0 -223
  162. package/.agents/skills/memory-systems/SKILL.md +0 -221
  163. package/.agents/skills/memory-systems/references/implementation.md +0 -551
  164. package/.agents/skills/memory-systems/scripts/memory_store.py +0 -616
  165. package/.agents/skills/multi-agent-patterns/SKILL.md +0 -259
  166. package/.agents/skills/multi-agent-patterns/references/frameworks.md +0 -433
  167. package/.agents/skills/multi-agent-patterns/scripts/coordination.py +0 -613
  168. package/.agents/skills/opentui/SKILL.md +0 -202
  169. package/.agents/skills/opentui/references/animation/REFERENCE.md +0 -431
  170. package/.agents/skills/opentui/references/components/REFERENCE.md +0 -144
  171. package/.agents/skills/opentui/references/components/code-diff.md +0 -672
  172. package/.agents/skills/opentui/references/components/containers.md +0 -417
  173. package/.agents/skills/opentui/references/components/inputs.md +0 -531
  174. package/.agents/skills/opentui/references/components/text-display.md +0 -386
  175. package/.agents/skills/opentui/references/core/REFERENCE.md +0 -145
  176. package/.agents/skills/opentui/references/core/api.md +0 -543
  177. package/.agents/skills/opentui/references/core/configuration.md +0 -168
  178. package/.agents/skills/opentui/references/core/gotchas.md +0 -393
  179. package/.agents/skills/opentui/references/core/patterns.md +0 -449
  180. package/.agents/skills/opentui/references/keyboard/REFERENCE.md +0 -617
  181. package/.agents/skills/opentui/references/layout/REFERENCE.md +0 -337
  182. package/.agents/skills/opentui/references/layout/patterns.md +0 -444
  183. package/.agents/skills/opentui/references/react/REFERENCE.md +0 -174
  184. package/.agents/skills/opentui/references/react/api.md +0 -436
  185. package/.agents/skills/opentui/references/react/configuration.md +0 -302
  186. package/.agents/skills/opentui/references/react/gotchas.md +0 -443
  187. package/.agents/skills/opentui/references/react/patterns.md +0 -501
  188. package/.agents/skills/opentui/references/solid/REFERENCE.md +0 -201
  189. package/.agents/skills/opentui/references/solid/api.md +0 -564
  190. package/.agents/skills/opentui/references/solid/configuration.md +0 -316
  191. package/.agents/skills/opentui/references/solid/gotchas.md +0 -427
  192. package/.agents/skills/opentui/references/solid/patterns.md +0 -560
  193. package/.agents/skills/opentui/references/testing/REFERENCE.md +0 -614
  194. package/.agents/skills/pdf/LICENSE.txt +0 -30
  195. package/.agents/skills/pdf/SKILL.md +0 -316
  196. package/.agents/skills/pdf/forms.md +0 -294
  197. package/.agents/skills/pdf/reference.md +0 -612
  198. package/.agents/skills/pdf/scripts/check_bounding_boxes.py +0 -65
  199. package/.agents/skills/pdf/scripts/check_fillable_fields.py +0 -11
  200. package/.agents/skills/pdf/scripts/convert_pdf_to_images.py +0 -33
  201. package/.agents/skills/pdf/scripts/create_validation_image.py +0 -37
  202. package/.agents/skills/pdf/scripts/extract_form_field_info.py +0 -122
  203. package/.agents/skills/pdf/scripts/extract_form_structure.py +0 -115
  204. package/.agents/skills/pdf/scripts/fill_fillable_fields.py +0 -98
  205. package/.agents/skills/pdf/scripts/fill_pdf_form_with_annotations.py +0 -107
  206. package/.agents/skills/playwright-cli/SKILL.md +0 -390
  207. package/.agents/skills/playwright-cli/references/element-attributes.md +0 -23
  208. package/.agents/skills/playwright-cli/references/playwright-tests.md +0 -39
  209. package/.agents/skills/playwright-cli/references/request-mocking.md +0 -87
  210. package/.agents/skills/playwright-cli/references/running-code.md +0 -241
  211. package/.agents/skills/playwright-cli/references/session-management.md +0 -225
  212. package/.agents/skills/playwright-cli/references/spec-driven-testing.md +0 -305
  213. package/.agents/skills/playwright-cli/references/storage-state.md +0 -275
  214. package/.agents/skills/playwright-cli/references/test-generation.md +0 -134
  215. package/.agents/skills/playwright-cli/references/tracing.md +0 -139
  216. package/.agents/skills/playwright-cli/references/video-recording.md +0 -143
  217. package/.agents/skills/pptx/LICENSE.txt +0 -30
  218. package/.agents/skills/pptx/SKILL.md +0 -234
  219. package/.agents/skills/pptx/editing.md +0 -205
  220. package/.agents/skills/pptx/pptxgenjs.md +0 -420
  221. package/.agents/skills/pptx/scripts/__init__.py +0 -0
  222. package/.agents/skills/pptx/scripts/add_slide.py +0 -195
  223. package/.agents/skills/pptx/scripts/clean.py +0 -286
  224. package/.agents/skills/pptx/scripts/office/helpers/__init__.py +0 -0
  225. package/.agents/skills/pptx/scripts/office/helpers/merge_runs.py +0 -199
  226. package/.agents/skills/pptx/scripts/office/helpers/simplify_redlines.py +0 -197
  227. package/.agents/skills/pptx/scripts/office/pack.py +0 -159
  228. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +0 -1499
  229. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +0 -146
  230. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +0 -1085
  231. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +0 -11
  232. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +0 -3081
  233. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +0 -23
  234. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +0 -185
  235. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +0 -287
  236. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +0 -1676
  237. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +0 -28
  238. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +0 -144
  239. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +0 -174
  240. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +0 -25
  241. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +0 -18
  242. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +0 -59
  243. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +0 -56
  244. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +0 -195
  245. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +0 -582
  246. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +0 -25
  247. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +0 -4439
  248. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +0 -570
  249. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +0 -509
  250. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +0 -12
  251. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +0 -108
  252. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +0 -96
  253. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +0 -3646
  254. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +0 -116
  255. package/.agents/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +0 -42
  256. package/.agents/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +0 -50
  257. package/.agents/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +0 -49
  258. package/.agents/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +0 -33
  259. package/.agents/skills/pptx/scripts/office/schemas/mce/mc.xsd +0 -75
  260. package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-2010.xsd +0 -560
  261. package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-2012.xsd +0 -67
  262. package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-2018.xsd +0 -14
  263. package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +0 -20
  264. package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +0 -13
  265. package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +0 -4
  266. package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +0 -8
  267. package/.agents/skills/pptx/scripts/office/soffice.py +0 -183
  268. package/.agents/skills/pptx/scripts/office/unpack.py +0 -132
  269. package/.agents/skills/pptx/scripts/office/validate.py +0 -111
  270. package/.agents/skills/pptx/scripts/office/validators/__init__.py +0 -15
  271. package/.agents/skills/pptx/scripts/office/validators/base.py +0 -847
  272. package/.agents/skills/pptx/scripts/office/validators/docx.py +0 -446
  273. package/.agents/skills/pptx/scripts/office/validators/pptx.py +0 -275
  274. package/.agents/skills/pptx/scripts/office/validators/redlining.py +0 -247
  275. package/.agents/skills/pptx/scripts/thumbnail.py +0 -289
  276. package/.agents/skills/project-development/SKILL.md +0 -293
  277. package/.agents/skills/project-development/references/case-studies.md +0 -388
  278. package/.agents/skills/project-development/references/pipeline-patterns.md +0 -610
  279. package/.agents/skills/project-development/scripts/pipeline_template.py +0 -796
  280. package/.agents/skills/prompt-engineer/SKILL.md +0 -265
  281. package/.agents/skills/prompt-engineer/references/advanced_patterns.md +0 -271
  282. package/.agents/skills/prompt-engineer/references/core_prompting.md +0 -137
  283. package/.agents/skills/prompt-engineer/references/quality_improvement.md +0 -193
  284. package/.agents/skills/research-codebase/SKILL.md +0 -229
  285. package/.agents/skills/ripgrep/SKILL.md +0 -384
  286. package/.agents/skills/skill-creator/LICENSE.txt +0 -202
  287. package/.agents/skills/skill-creator/SKILL.md +0 -487
  288. package/.agents/skills/skill-creator/agents/analyzer.md +0 -274
  289. package/.agents/skills/skill-creator/agents/comparator.md +0 -202
  290. package/.agents/skills/skill-creator/agents/grader.md +0 -223
  291. package/.agents/skills/skill-creator/assets/eval_review.html +0 -146
  292. package/.agents/skills/skill-creator/eval-viewer/generate_review.py +0 -471
  293. package/.agents/skills/skill-creator/eval-viewer/viewer.html +0 -1325
  294. package/.agents/skills/skill-creator/references/schemas.md +0 -430
  295. package/.agents/skills/skill-creator/scripts/__init__.py +0 -0
  296. package/.agents/skills/skill-creator/scripts/aggregate_benchmark.py +0 -401
  297. package/.agents/skills/skill-creator/scripts/generate_report.py +0 -326
  298. package/.agents/skills/skill-creator/scripts/improve_description.py +0 -247
  299. package/.agents/skills/skill-creator/scripts/package_skill.py +0 -136
  300. package/.agents/skills/skill-creator/scripts/quick_validate.py +0 -103
  301. package/.agents/skills/skill-creator/scripts/run_eval.py +0 -310
  302. package/.agents/skills/skill-creator/scripts/run_loop.py +0 -328
  303. package/.agents/skills/skill-creator/scripts/utils.py +0 -47
  304. package/.agents/skills/sl-commit/SKILL.md +0 -53
  305. package/.agents/skills/sl-submit-diff/SKILL.md +0 -57
  306. package/.agents/skills/tdd/SKILL.md +0 -111
  307. package/.agents/skills/tdd/deep-modules.md +0 -33
  308. package/.agents/skills/tdd/interface-design.md +0 -31
  309. package/.agents/skills/tdd/mocking.md +0 -59
  310. package/.agents/skills/tdd/refactoring.md +0 -10
  311. package/.agents/skills/tdd/tests.md +0 -61
  312. package/.agents/skills/tool-design/SKILL.md +0 -273
  313. package/.agents/skills/tool-design/references/architectural_reduction.md +0 -210
  314. package/.agents/skills/tool-design/references/best_practices.md +0 -176
  315. package/.agents/skills/tool-design/scripts/description_generator.py +0 -528
  316. package/.agents/skills/typescript-advanced-types/SKILL.md +0 -720
  317. package/.agents/skills/typescript-expert/SKILL.md +0 -434
  318. package/.agents/skills/typescript-expert/references/tsconfig-strict.json +0 -92
  319. package/.agents/skills/typescript-expert/references/typescript-cheatsheet.md +0 -383
  320. package/.agents/skills/typescript-expert/references/utility-types.ts +0 -335
  321. package/.agents/skills/typescript-expert/scripts/ts_diagnostic.py +0 -203
  322. package/.agents/skills/typescript-react-reviewer/SKILL.md +0 -201
  323. package/.agents/skills/typescript-react-reviewer/references/antipatterns.md +0 -510
  324. package/.agents/skills/typescript-react-reviewer/references/checklist.md +0 -267
  325. package/.agents/skills/typescript-react-reviewer/references/react19-patterns.md +0 -305
  326. package/.agents/skills/workflow-creator/SKILL.md +0 -553
  327. package/.agents/skills/workflow-creator/references/agent-sessions.md +0 -891
  328. package/.agents/skills/workflow-creator/references/agent-setup-recipe.md +0 -266
  329. package/.agents/skills/workflow-creator/references/computation-and-validation.md +0 -201
  330. package/.agents/skills/workflow-creator/references/control-flow.md +0 -470
  331. package/.agents/skills/workflow-creator/references/failure-modes.md +0 -1014
  332. package/.agents/skills/workflow-creator/references/getting-started.md +0 -392
  333. package/.agents/skills/workflow-creator/references/registry-and-validation.md +0 -141
  334. package/.agents/skills/workflow-creator/references/running-workflows.md +0 -418
  335. package/.agents/skills/workflow-creator/references/session-config.md +0 -431
  336. package/.agents/skills/workflow-creator/references/state-and-data-flow.md +0 -356
  337. package/.agents/skills/workflow-creator/references/user-input.md +0 -234
  338. package/.agents/skills/workflow-creator/references/workflow-inputs.md +0 -392
  339. package/.agents/skills/xlsx/LICENSE.txt +0 -30
  340. package/.agents/skills/xlsx/SKILL.md +0 -294
  341. package/.agents/skills/xlsx/scripts/office/helpers/__init__.py +0 -0
  342. package/.agents/skills/xlsx/scripts/office/helpers/merge_runs.py +0 -199
  343. package/.agents/skills/xlsx/scripts/office/helpers/simplify_redlines.py +0 -197
  344. package/.agents/skills/xlsx/scripts/office/pack.py +0 -159
  345. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +0 -1499
  346. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +0 -146
  347. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +0 -1085
  348. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +0 -11
  349. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +0 -3081
  350. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +0 -23
  351. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +0 -185
  352. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +0 -287
  353. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +0 -1676
  354. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +0 -28
  355. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +0 -144
  356. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +0 -174
  357. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +0 -25
  358. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +0 -18
  359. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +0 -59
  360. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +0 -56
  361. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +0 -195
  362. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +0 -582
  363. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +0 -25
  364. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +0 -4439
  365. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +0 -570
  366. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +0 -509
  367. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +0 -12
  368. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +0 -108
  369. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +0 -96
  370. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +0 -3646
  371. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +0 -116
  372. package/.agents/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +0 -42
  373. package/.agents/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +0 -50
  374. package/.agents/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +0 -49
  375. package/.agents/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +0 -33
  376. package/.agents/skills/xlsx/scripts/office/schemas/mce/mc.xsd +0 -75
  377. package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-2010.xsd +0 -560
  378. package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-2012.xsd +0 -67
  379. package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-2018.xsd +0 -14
  380. package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +0 -20
  381. package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +0 -13
  382. package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +0 -4
  383. package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +0 -8
  384. package/.agents/skills/xlsx/scripts/office/soffice.py +0 -183
  385. package/.agents/skills/xlsx/scripts/office/unpack.py +0 -132
  386. package/.agents/skills/xlsx/scripts/office/validate.py +0 -111
  387. package/.agents/skills/xlsx/scripts/office/validators/__init__.py +0 -15
  388. package/.agents/skills/xlsx/scripts/office/validators/base.py +0 -847
  389. package/.agents/skills/xlsx/scripts/office/validators/docx.py +0 -446
  390. package/.agents/skills/xlsx/scripts/office/validators/pptx.py +0 -275
  391. package/.agents/skills/xlsx/scripts/office/validators/redlining.py +0 -247
  392. package/.agents/skills/xlsx/scripts/recalc.py +0 -184
  393. package/.claude/agents/code-simplifier.md +0 -52
  394. package/.claude/agents/codebase-analyzer.md +0 -166
  395. package/.claude/agents/codebase-locator.md +0 -122
  396. package/.claude/agents/codebase-online-researcher.md +0 -148
  397. package/.claude/agents/codebase-pattern-finder.md +0 -247
  398. package/.claude/agents/codebase-research-analyzer.md +0 -179
  399. package/.claude/agents/codebase-research-locator.md +0 -145
  400. package/.claude/agents/debugger.md +0 -91
  401. package/.claude/agents/orchestrator.md +0 -19
  402. package/.claude/agents/planner.md +0 -295
  403. package/.claude/agents/reviewer.md +0 -98
  404. package/.claude/agents/worker.md +0 -165
  405. package/.claude/settings.json +0 -27
  406. package/.github/agents/code-simplifier.md +0 -52
  407. package/.github/agents/codebase-analyzer.md +0 -166
  408. package/.github/agents/codebase-locator.md +0 -122
  409. package/.github/agents/codebase-online-researcher.md +0 -146
  410. package/.github/agents/codebase-pattern-finder.md +0 -247
  411. package/.github/agents/codebase-research-analyzer.md +0 -179
  412. package/.github/agents/codebase-research-locator.md +0 -145
  413. package/.github/agents/debugger.md +0 -98
  414. package/.github/agents/orchestrator.md +0 -27
  415. package/.github/agents/planner.md +0 -305
  416. package/.github/agents/reviewer.md +0 -95
  417. package/.github/agents/worker.md +0 -237
  418. package/.github/lsp.json +0 -93
  419. package/.mcp.json +0 -20
  420. package/.opencode/agents/code-simplifier.md +0 -62
  421. package/.opencode/agents/codebase-analyzer.md +0 -171
  422. package/.opencode/agents/codebase-locator.md +0 -127
  423. package/.opencode/agents/codebase-online-researcher.md +0 -152
  424. package/.opencode/agents/codebase-pattern-finder.md +0 -252
  425. package/.opencode/agents/codebase-research-analyzer.md +0 -183
  426. package/.opencode/agents/codebase-research-locator.md +0 -149
  427. package/.opencode/agents/debugger.md +0 -99
  428. package/.opencode/agents/orchestrator.md +0 -27
  429. package/.opencode/agents/planner.md +0 -309
  430. package/.opencode/agents/reviewer.md +0 -103
  431. package/.opencode/agents/worker.md +0 -165
  432. package/.opencode/opencode.json +0 -25
  433. package/README.md +0 -1624
  434. package/assets/settings.schema.json +0 -51
  435. package/dist/commands/cli/claude-inflight-hook.d.ts +0 -100
  436. package/dist/commands/cli/claude-inflight-hook.d.ts.map +0 -1
  437. package/dist/commands/cli/claude-stop-hook.d.ts +0 -80
  438. package/dist/commands/cli/claude-stop-hook.d.ts.map +0 -1
  439. package/dist/lib/atomic-temp.d.ts +0 -8
  440. package/dist/lib/atomic-temp.d.ts.map +0 -1
  441. package/dist/lib/path-root-guard.d.ts +0 -4
  442. package/dist/lib/path-root-guard.d.ts.map +0 -1
  443. package/dist/lib/spawn.d.ts +0 -102
  444. package/dist/lib/spawn.d.ts.map +0 -1
  445. package/dist/lib/terminal-env.d.ts +0 -9
  446. package/dist/lib/terminal-env.d.ts.map +0 -1
  447. package/dist/sdk/components/attached-statusline.d.ts +0 -26
  448. package/dist/sdk/components/attached-statusline.d.ts.map +0 -1
  449. package/dist/sdk/components/color-utils.d.ts +0 -4
  450. package/dist/sdk/components/color-utils.d.ts.map +0 -1
  451. package/dist/sdk/components/compact-switcher.d.ts +0 -10
  452. package/dist/sdk/components/compact-switcher.d.ts.map +0 -1
  453. package/dist/sdk/components/connectors.d.ts +0 -16
  454. package/dist/sdk/components/connectors.d.ts.map +0 -1
  455. package/dist/sdk/components/edge.d.ts +0 -4
  456. package/dist/sdk/components/edge.d.ts.map +0 -1
  457. package/dist/sdk/components/error-boundary.d.ts +0 -23
  458. package/dist/sdk/components/error-boundary.d.ts.map +0 -1
  459. package/dist/sdk/components/graph-theme.d.ts +0 -18
  460. package/dist/sdk/components/graph-theme.d.ts.map +0 -1
  461. package/dist/sdk/components/header.d.ts +0 -3
  462. package/dist/sdk/components/header.d.ts.map +0 -1
  463. package/dist/sdk/components/hooks.d.ts +0 -15
  464. package/dist/sdk/components/hooks.d.ts.map +0 -1
  465. package/dist/sdk/components/layout.d.ts +0 -27
  466. package/dist/sdk/components/layout.d.ts.map +0 -1
  467. package/dist/sdk/components/node-card.d.ts +0 -10
  468. package/dist/sdk/components/node-card.d.ts.map +0 -1
  469. package/dist/sdk/components/orchestrator-panel-contexts.d.ts +0 -16
  470. package/dist/sdk/components/orchestrator-panel-contexts.d.ts.map +0 -1
  471. package/dist/sdk/components/orchestrator-panel-store.d.ts +0 -52
  472. package/dist/sdk/components/orchestrator-panel-store.d.ts.map +0 -1
  473. package/dist/sdk/components/orchestrator-panel-types.d.ts +0 -18
  474. package/dist/sdk/components/orchestrator-panel-types.d.ts.map +0 -1
  475. package/dist/sdk/components/orchestrator-panel.d.ts +0 -86
  476. package/dist/sdk/components/orchestrator-panel.d.ts.map +0 -1
  477. package/dist/sdk/components/renderer-background.d.ts +0 -9
  478. package/dist/sdk/components/renderer-background.d.ts.map +0 -1
  479. package/dist/sdk/components/session-graph-panel.d.ts +0 -7
  480. package/dist/sdk/components/session-graph-panel.d.ts.map +0 -1
  481. package/dist/sdk/components/status-helpers.d.ts +0 -6
  482. package/dist/sdk/components/status-helpers.d.ts.map +0 -1
  483. package/dist/sdk/components/statusline.d.ts +0 -5
  484. package/dist/sdk/components/statusline.d.ts.map +0 -1
  485. package/dist/sdk/components/tui-diagnostics.d.ts +0 -56
  486. package/dist/sdk/components/tui-diagnostics.d.ts.map +0 -1
  487. package/dist/sdk/components/workflow-picker-panel.d.ts +0 -126
  488. package/dist/sdk/components/workflow-picker-panel.d.ts.map +0 -1
  489. package/dist/sdk/define-workflow.d.ts +0 -107
  490. package/dist/sdk/define-workflow.d.ts.map +0 -1
  491. package/dist/sdk/errors.d.ts +0 -46
  492. package/dist/sdk/errors.d.ts.map +0 -1
  493. package/dist/sdk/index.d.ts +0 -26
  494. package/dist/sdk/index.d.ts.map +0 -1
  495. package/dist/sdk/primitives/inputs.d.ts +0 -36
  496. package/dist/sdk/primitives/inputs.d.ts.map +0 -1
  497. package/dist/sdk/primitives/metadata.d.ts +0 -40
  498. package/dist/sdk/primitives/metadata.d.ts.map +0 -1
  499. package/dist/sdk/primitives/run.d.ts +0 -57
  500. package/dist/sdk/primitives/run.d.ts.map +0 -1
  501. package/dist/sdk/primitives/sessions.d.ts +0 -128
  502. package/dist/sdk/primitives/sessions.d.ts.map +0 -1
  503. package/dist/sdk/providers/claude.d.ts +0 -392
  504. package/dist/sdk/providers/claude.d.ts.map +0 -1
  505. package/dist/sdk/providers/copilot.d.ts +0 -55
  506. package/dist/sdk/providers/copilot.d.ts.map +0 -1
  507. package/dist/sdk/providers/opencode.d.ts +0 -27
  508. package/dist/sdk/providers/opencode.d.ts.map +0 -1
  509. package/dist/sdk/registry.d.ts +0 -27
  510. package/dist/sdk/registry.d.ts.map +0 -1
  511. package/dist/sdk/runtime/attached-footer.d.ts +0 -31
  512. package/dist/sdk/runtime/attached-footer.d.ts.map +0 -1
  513. package/dist/sdk/runtime/cc-debounce.d.ts +0 -29
  514. package/dist/sdk/runtime/cc-debounce.d.ts.map +0 -1
  515. package/dist/sdk/runtime/executor-env.d.ts +0 -20
  516. package/dist/sdk/runtime/executor-env.d.ts.map +0 -1
  517. package/dist/sdk/runtime/executor.d.ts +0 -265
  518. package/dist/sdk/runtime/executor.d.ts.map +0 -1
  519. package/dist/sdk/runtime/graph-inference.d.ts +0 -35
  520. package/dist/sdk/runtime/graph-inference.d.ts.map +0 -1
  521. package/dist/sdk/runtime/orchestrator-entry.d.ts +0 -26
  522. package/dist/sdk/runtime/orchestrator-entry.d.ts.map +0 -1
  523. package/dist/sdk/runtime/panel.d.ts +0 -9
  524. package/dist/sdk/runtime/panel.d.ts.map +0 -1
  525. package/dist/sdk/runtime/port-discovery.d.ts +0 -71
  526. package/dist/sdk/runtime/port-discovery.d.ts.map +0 -1
  527. package/dist/sdk/runtime/status-writer.d.ts +0 -101
  528. package/dist/sdk/runtime/status-writer.d.ts.map +0 -1
  529. package/dist/sdk/runtime/theme.d.ts +0 -33
  530. package/dist/sdk/runtime/theme.d.ts.map +0 -1
  531. package/dist/sdk/runtime/tmux.d.ts +0 -307
  532. package/dist/sdk/runtime/tmux.d.ts.map +0 -1
  533. package/dist/sdk/runtime/version-compat.d.ts +0 -28
  534. package/dist/sdk/runtime/version-compat.d.ts.map +0 -1
  535. package/dist/sdk/types.d.ts +0 -435
  536. package/dist/sdk/types.d.ts.map +0 -1
  537. package/dist/sdk/worker-shared.d.ts +0 -42
  538. package/dist/sdk/worker-shared.d.ts.map +0 -1
  539. package/dist/sdk/workflows/builtin/deep-research-codebase/claude/index.d.ts +0 -81
  540. package/dist/sdk/workflows/builtin/deep-research-codebase/claude/index.d.ts.map +0 -1
  541. package/dist/sdk/workflows/builtin/deep-research-codebase/copilot/index.d.ts +0 -37
  542. package/dist/sdk/workflows/builtin/deep-research-codebase/copilot/index.d.ts.map +0 -1
  543. package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/batching.d.ts +0 -43
  544. package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/batching.d.ts.map +0 -1
  545. package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/heuristic.d.ts +0 -14
  546. package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/heuristic.d.ts.map +0 -1
  547. package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/prompts.d.ts +0 -136
  548. package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/prompts.d.ts.map +0 -1
  549. package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/scout.d.ts +0 -58
  550. package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/scout.d.ts.map +0 -1
  551. package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/scratch.d.ts +0 -43
  552. package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/scratch.d.ts.map +0 -1
  553. package/dist/sdk/workflows/builtin/deep-research-codebase/opencode/index.d.ts +0 -37
  554. package/dist/sdk/workflows/builtin/deep-research-codebase/opencode/index.d.ts.map +0 -1
  555. package/dist/sdk/workflows/builtin/open-claude-design/claude/index.d.ts +0 -68
  556. package/dist/sdk/workflows/builtin/open-claude-design/claude/index.d.ts.map +0 -1
  557. package/dist/sdk/workflows/builtin/open-claude-design/copilot/index.d.ts +0 -56
  558. package/dist/sdk/workflows/builtin/open-claude-design/copilot/index.d.ts.map +0 -1
  559. package/dist/sdk/workflows/builtin/open-claude-design/helpers/constants.d.ts +0 -72
  560. package/dist/sdk/workflows/builtin/open-claude-design/helpers/constants.d.ts.map +0 -1
  561. package/dist/sdk/workflows/builtin/open-claude-design/helpers/design-system.d.ts +0 -46
  562. package/dist/sdk/workflows/builtin/open-claude-design/helpers/design-system.d.ts.map +0 -1
  563. package/dist/sdk/workflows/builtin/open-claude-design/helpers/export.d.ts +0 -32
  564. package/dist/sdk/workflows/builtin/open-claude-design/helpers/export.d.ts.map +0 -1
  565. package/dist/sdk/workflows/builtin/open-claude-design/helpers/import.d.ts +0 -33
  566. package/dist/sdk/workflows/builtin/open-claude-design/helpers/import.d.ts.map +0 -1
  567. package/dist/sdk/workflows/builtin/open-claude-design/helpers/prompts.d.ts +0 -106
  568. package/dist/sdk/workflows/builtin/open-claude-design/helpers/prompts.d.ts.map +0 -1
  569. package/dist/sdk/workflows/builtin/open-claude-design/helpers/scan.d.ts +0 -50
  570. package/dist/sdk/workflows/builtin/open-claude-design/helpers/scan.d.ts.map +0 -1
  571. package/dist/sdk/workflows/builtin/open-claude-design/helpers/validation.d.ts +0 -12
  572. package/dist/sdk/workflows/builtin/open-claude-design/helpers/validation.d.ts.map +0 -1
  573. package/dist/sdk/workflows/builtin/open-claude-design/opencode/index.d.ts +0 -58
  574. package/dist/sdk/workflows/builtin/open-claude-design/opencode/index.d.ts.map +0 -1
  575. package/dist/sdk/workflows/builtin/ralph/claude/index.d.ts +0 -37
  576. package/dist/sdk/workflows/builtin/ralph/claude/index.d.ts.map +0 -1
  577. package/dist/sdk/workflows/builtin/ralph/copilot/index.d.ts +0 -34
  578. package/dist/sdk/workflows/builtin/ralph/copilot/index.d.ts.map +0 -1
  579. package/dist/sdk/workflows/builtin/ralph/helpers/copilot-reviewer.d.ts +0 -25
  580. package/dist/sdk/workflows/builtin/ralph/helpers/copilot-reviewer.d.ts.map +0 -1
  581. package/dist/sdk/workflows/builtin/ralph/helpers/git.d.ts +0 -69
  582. package/dist/sdk/workflows/builtin/ralph/helpers/git.d.ts.map +0 -1
  583. package/dist/sdk/workflows/builtin/ralph/helpers/prompts.d.ts +0 -266
  584. package/dist/sdk/workflows/builtin/ralph/helpers/prompts.d.ts.map +0 -1
  585. package/dist/sdk/workflows/builtin/ralph/helpers/review.d.ts +0 -24
  586. package/dist/sdk/workflows/builtin/ralph/helpers/review.d.ts.map +0 -1
  587. package/dist/sdk/workflows/builtin/ralph/opencode/index.d.ts +0 -33
  588. package/dist/sdk/workflows/builtin/ralph/opencode/index.d.ts.map +0 -1
  589. package/dist/sdk/workflows/index.d.ts +0 -32
  590. package/dist/sdk/workflows/index.d.ts.map +0 -1
  591. package/dist/services/config/additional-instructions.d.ts +0 -67
  592. package/dist/services/config/additional-instructions.d.ts.map +0 -1
  593. package/dist/services/config/atomic-config.d.ts +0 -42
  594. package/dist/services/config/atomic-config.d.ts.map +0 -1
  595. package/dist/services/config/definitions.d.ts +0 -52
  596. package/dist/services/config/definitions.d.ts.map +0 -1
  597. package/dist/services/config/index.d.ts +0 -7
  598. package/dist/services/config/index.d.ts.map +0 -1
  599. package/dist/services/config/scm-sync.d.ts +0 -37
  600. package/dist/services/config/scm-sync.d.ts.map +0 -1
  601. package/dist/services/config/settings-schema.d.ts +0 -2
  602. package/dist/services/config/settings-schema.d.ts.map +0 -1
  603. package/dist/services/system/copy.d.ts +0 -84
  604. package/dist/services/system/copy.d.ts.map +0 -1
  605. package/dist/services/system/detect.d.ts +0 -75
  606. package/dist/services/system/detect.d.ts.map +0 -1
  607. package/dist/theme/colors.d.ts +0 -35
  608. package/dist/theme/colors.d.ts.map +0 -1
  609. package/src/cli.ts +0 -397
  610. package/src/commands/builtin-registry.ts +0 -37
  611. package/src/commands/cli/chat/index.test.ts +0 -252
  612. package/src/commands/cli/chat/index.ts +0 -430
  613. package/src/commands/cli/chat.ts +0 -8
  614. package/src/commands/cli/claude-ask-hook.test.ts +0 -128
  615. package/src/commands/cli/claude-ask-hook.ts +0 -84
  616. package/src/commands/cli/claude-inflight-hook.test.ts +0 -598
  617. package/src/commands/cli/claude-inflight-hook.ts +0 -359
  618. package/src/commands/cli/claude-session-start-hook.ts +0 -61
  619. package/src/commands/cli/claude-stop-hook.test.ts +0 -317
  620. package/src/commands/cli/claude-stop-hook.ts +0 -441
  621. package/src/commands/cli/completions.ts +0 -24
  622. package/src/commands/cli/config.ts +0 -80
  623. package/src/commands/cli/footer.tsx +0 -248
  624. package/src/commands/cli/init/index.ts +0 -41
  625. package/src/commands/cli/init/onboarding.ts +0 -61
  626. package/src/commands/cli/init.ts +0 -8
  627. package/src/commands/cli/management-commands.ts +0 -112
  628. package/src/commands/cli/session.test.ts +0 -830
  629. package/src/commands/cli/session.ts +0 -447
  630. package/src/commands/cli/workflow-command.test.ts +0 -618
  631. package/src/commands/cli/workflow-inputs.test.ts +0 -353
  632. package/src/commands/cli/workflow-inputs.ts +0 -266
  633. package/src/commands/cli/workflow-list.test.ts +0 -235
  634. package/src/commands/cli/workflow-list.ts +0 -0
  635. package/src/commands/cli/workflow-status.test.ts +0 -451
  636. package/src/commands/cli/workflow-status.ts +0 -330
  637. package/src/commands/cli/workflow.ts +0 -196
  638. package/src/completions/bash.ts +0 -102
  639. package/src/completions/fish.ts +0 -136
  640. package/src/completions/index.ts +0 -7
  641. package/src/completions/powershell.ts +0 -195
  642. package/src/completions/zsh.ts +0 -150
  643. package/src/lib/atomic-temp.test.ts +0 -86
  644. package/src/lib/atomic-temp.ts +0 -62
  645. package/src/lib/common-ignore.ts +0 -46
  646. package/src/lib/merge.ts +0 -103
  647. package/src/lib/path-root-guard.ts +0 -38
  648. package/src/lib/spawn.test.ts +0 -109
  649. package/src/lib/spawn.ts +0 -678
  650. package/src/lib/terminal-env.test.ts +0 -343
  651. package/src/lib/terminal-env.ts +0 -100
  652. package/src/scripts/bump-version.ts +0 -94
  653. package/src/scripts/bundle-configs.ts +0 -116
  654. package/src/scripts/clean-dist.test.ts +0 -53
  655. package/src/scripts/clean-dist.ts +0 -37
  656. package/src/scripts/constants-base.ts +0 -14
  657. package/src/scripts/constants.ts +0 -35
  658. package/src/sdk/components/attached-statusline.tsx +0 -86
  659. package/src/sdk/components/color-utils.ts +0 -20
  660. package/src/sdk/components/compact-switcher.tsx +0 -78
  661. package/src/sdk/components/connectors.test.ts +0 -707
  662. package/src/sdk/components/connectors.ts +0 -160
  663. package/src/sdk/components/edge.tsx +0 -13
  664. package/src/sdk/components/error-boundary.tsx +0 -38
  665. package/src/sdk/components/graph-theme.ts +0 -37
  666. package/src/sdk/components/header.tsx +0 -85
  667. package/src/sdk/components/hooks.ts +0 -21
  668. package/src/sdk/components/layout.test.ts +0 -1245
  669. package/src/sdk/components/layout.ts +0 -223
  670. package/src/sdk/components/node-card.tsx +0 -91
  671. package/src/sdk/components/orchestrator-panel-contexts.ts +0 -35
  672. package/src/sdk/components/orchestrator-panel-store.test.ts +0 -847
  673. package/src/sdk/components/orchestrator-panel-store.ts +0 -187
  674. package/src/sdk/components/orchestrator-panel-types.ts +0 -23
  675. package/src/sdk/components/orchestrator-panel.tsx +0 -262
  676. package/src/sdk/components/renderer-background.ts +0 -49
  677. package/src/sdk/components/session-graph-panel.tsx +0 -471
  678. package/src/sdk/components/status-helpers.ts +0 -33
  679. package/src/sdk/components/statusline.tsx +0 -68
  680. package/src/sdk/components/tui-diagnostics.ts +0 -273
  681. package/src/sdk/components/workflow-picker-panel.tsx +0 -1613
  682. package/src/sdk/define-workflow.test.ts +0 -354
  683. package/src/sdk/define-workflow.ts +0 -275
  684. package/src/sdk/errors.test.ts +0 -83
  685. package/src/sdk/errors.ts +0 -77
  686. package/src/sdk/index.test.ts +0 -92
  687. package/src/sdk/index.ts +0 -101
  688. package/src/sdk/primitives/inputs.ts +0 -48
  689. package/src/sdk/primitives/metadata.ts +0 -63
  690. package/src/sdk/primitives/run.ts +0 -81
  691. package/src/sdk/primitives/sessions.test.ts +0 -594
  692. package/src/sdk/primitives/sessions.ts +0 -328
  693. package/src/sdk/providers/claude.ts +0 -1450
  694. package/src/sdk/providers/copilot.test.ts +0 -365
  695. package/src/sdk/providers/copilot.ts +0 -185
  696. package/src/sdk/providers/headless-hil-policy.test.ts +0 -211
  697. package/src/sdk/providers/opencode.ts +0 -88
  698. package/src/sdk/registry.ts +0 -132
  699. package/src/sdk/runtime/attached-footer.ts +0 -155
  700. package/src/sdk/runtime/cc-debounce.ts +0 -104
  701. package/src/sdk/runtime/executor-env.ts +0 -45
  702. package/src/sdk/runtime/executor.test.ts +0 -1321
  703. package/src/sdk/runtime/executor.ts +0 -2136
  704. package/src/sdk/runtime/graph-inference.ts +0 -50
  705. package/src/sdk/runtime/orchestrator-entry.ts +0 -110
  706. package/src/sdk/runtime/panel.tsx +0 -9
  707. package/src/sdk/runtime/port-discovery.test.ts +0 -573
  708. package/src/sdk/runtime/port-discovery.ts +0 -496
  709. package/src/sdk/runtime/status-writer.test.ts +0 -245
  710. package/src/sdk/runtime/status-writer.ts +0 -201
  711. package/src/sdk/runtime/theme.ts +0 -71
  712. package/src/sdk/runtime/tmux.conf +0 -112
  713. package/src/sdk/runtime/tmux.ts +0 -785
  714. package/src/sdk/runtime/version-compat.ts +0 -68
  715. package/src/sdk/types.ts +0 -548
  716. package/src/sdk/worker-shared.test.ts +0 -163
  717. package/src/sdk/worker-shared.ts +0 -155
  718. package/src/sdk/workflows/builtin/deep-research-codebase/claude/index.ts +0 -569
  719. package/src/sdk/workflows/builtin/deep-research-codebase/copilot/index.ts +0 -481
  720. package/src/sdk/workflows/builtin/deep-research-codebase/helpers/batching.ts +0 -65
  721. package/src/sdk/workflows/builtin/deep-research-codebase/helpers/heuristic.ts +0 -24
  722. package/src/sdk/workflows/builtin/deep-research-codebase/helpers/ignore-by-default.d.ts +0 -8
  723. package/src/sdk/workflows/builtin/deep-research-codebase/helpers/prompts.ts +0 -958
  724. package/src/sdk/workflows/builtin/deep-research-codebase/helpers/scout.ts +0 -505
  725. package/src/sdk/workflows/builtin/deep-research-codebase/helpers/scratch.ts +0 -115
  726. package/src/sdk/workflows/builtin/deep-research-codebase/opencode/index.ts +0 -530
  727. package/src/sdk/workflows/builtin/open-claude-design/claude/index.ts +0 -500
  728. package/src/sdk/workflows/builtin/open-claude-design/copilot/index.ts +0 -508
  729. package/src/sdk/workflows/builtin/open-claude-design/helpers/constants.ts +0 -159
  730. package/src/sdk/workflows/builtin/open-claude-design/helpers/design-system.ts +0 -88
  731. package/src/sdk/workflows/builtin/open-claude-design/helpers/export.ts +0 -193
  732. package/src/sdk/workflows/builtin/open-claude-design/helpers/import.ts +0 -52
  733. package/src/sdk/workflows/builtin/open-claude-design/helpers/prompts.ts +0 -1110
  734. package/src/sdk/workflows/builtin/open-claude-design/helpers/scan.ts +0 -117
  735. package/src/sdk/workflows/builtin/open-claude-design/helpers/validation.ts +0 -38
  736. package/src/sdk/workflows/builtin/open-claude-design/opencode/index.ts +0 -610
  737. package/src/sdk/workflows/builtin/ralph/claude/index.ts +0 -272
  738. package/src/sdk/workflows/builtin/ralph/copilot/index.ts +0 -298
  739. package/src/sdk/workflows/builtin/ralph/helpers/copilot-reviewer.ts +0 -105
  740. package/src/sdk/workflows/builtin/ralph/helpers/git.ts +0 -201
  741. package/src/sdk/workflows/builtin/ralph/helpers/prompts.ts +0 -1108
  742. package/src/sdk/workflows/builtin/ralph/helpers/review.ts +0 -33
  743. package/src/sdk/workflows/builtin/ralph/opencode/index.ts +0 -290
  744. package/src/sdk/workflows/index.ts +0 -116
  745. package/src/services/config/additional-instructions.ts +0 -273
  746. package/src/services/config/atomic-config.ts +0 -210
  747. package/src/services/config/atomic-global-config.ts +0 -348
  748. package/src/services/config/config-path.ts +0 -19
  749. package/src/services/config/definitions.ts +0 -125
  750. package/src/services/config/index.ts +0 -7
  751. package/src/services/config/scm-sync.ts +0 -185
  752. package/src/services/config/settings-schema.ts +0 -2
  753. package/src/services/config/settings.ts +0 -144
  754. package/src/services/system/agents.ts +0 -95
  755. package/src/services/system/auth.test.ts +0 -343
  756. package/src/services/system/auth.ts +0 -140
  757. package/src/services/system/auto-sync.ts +0 -128
  758. package/src/services/system/copy.ts +0 -392
  759. package/src/services/system/detect.ts +0 -161
  760. package/src/services/system/file-lock.ts +0 -289
  761. package/src/services/system/install-ui.ts +0 -296
  762. package/src/services/system/skills.ts +0 -58
  763. package/src/theme/colors.ts +0 -96
  764. package/src/theme/logo.ts +0 -123
  765. package/src/version.ts +0 -7
@@ -1,1108 +0,0 @@
1
- /**
2
- * Ralph Prompt Utilities
3
- *
4
- * Prompts used by the Ralph plan → orchestrate → review loop:
5
- * - buildPlannerPrompt: initial planning OR re-planning from reviewer findings
6
- * - buildOrchestratorPrompt: spawn workers to execute the task list
7
- * - buildInfraDiscoveryPrompts: prompts for parallel sub-agent infrastructure discovery
8
- * - buildReviewPrompt: structured code review with injected changeset + discovery context
9
- *
10
- * Plus Zod schemas for structured output, parsing helpers for the reviewer
11
- * JSON output, and {@link formatReviewForReplan} which renders the merged
12
- * reviewer output as the markdown brief consumed by the next planner
13
- * iteration.
14
- */
15
-
16
- import { z } from "zod";
17
-
18
- // ============================================================================
19
- // RESPONSE STYLE (token reduction)
20
- // ============================================================================
21
-
22
- /**
23
- * Caveman response-style directive injected into every Ralph prompt.
24
- *
25
- * Goal: shrink free-form prose across many loop iterations to cut tokens
26
- * without dropping technical substance. Carve-outs preserve every
27
- * machine-consumed contract (schemas, headers, enums, tool args, code).
28
- *
29
- * Placement: appended via {@link withCaveman} so each builder's strict
30
- * output-format block remains the final instruction the model reads.
31
- */
32
- export const CAVEMAN_INSTRUCTION = `## Response Style — Terse Caveman
33
-
34
- Respond terse like smart caveman. All technical substance stay. Only fluff die.
35
-
36
- ### Persistence
37
- ACTIVE EVERY RESPONSE. No revert after many turns. No filler drift. Still active if unsure.
38
-
39
- ### Rules
40
- Drop: articles (a/an/the), filler (just/really/basically/actually/simply), pleasantries (sure/certainly/of course/happy to), hedging. Fragments OK. Short synonyms (big not extensive, fix not "implement a solution for"). Technical terms exact. Code blocks unchanged. Errors quoted exact.
41
-
42
- Pattern: \`[thing] [action] [reason]. [next step].\`
43
-
44
- Not: "Sure! I'd be happy to help you with that. The issue you're experiencing is likely caused by..."
45
- Yes: "Bug in auth middleware. Token expiry check use \`<\` not \`<=\`. Fix:"
46
-
47
- ### Intensity
48
- Drop articles, fragments OK, short synonyms.
49
-
50
- Example — "Why React component re-render?"
51
- "New object ref each render. Inline object prop = new ref = re-render. Wrap in \`useMemo\`."
52
-
53
- Example — "Explain database connection pooling."
54
- "Pool reuse open DB connections. No new connection per request. Skip handshake overhead."
55
-
56
- ### Auto-Clarity
57
- Drop caveman for: security warnings, irreversible action confirmations, multi-step sequences where fragment order risks misread, user asks to clarify or repeats question. Resume caveman after clear part done.
58
-
59
- Example — destructive op:
60
- > **Warning:** This will permanently delete all rows in the \`users\` table and cannot be undone.
61
- > \`\`\`sql
62
- > DROP TABLE users;
63
- > \`\`\`
64
- > Caveman resume. Verify backup exist first.
65
-
66
- ### Boundaries — caveman MUST NOT touch
67
- Caveman compresses free-form prose only. Leave the following exactly as the prompt or schema specifies:
68
-
69
- - Code blocks, commit messages, PR descriptions: write normal.
70
- - Exact enum / literal strings the schema or prompt specifies (e.g. \`"patch is correct"\`, \`"patch is incorrect"\`, task statuses \`pending\` / \`in_progress\` / \`completed\` / \`error\`).
71
- - Required section headers and template scaffolding (e.g. \`# Debugger Report\`, \`## Issues Identified\`, RFC section names) — verbatim.
72
- - Tool names, tool arguments, JSON keys, schema field names.
73
- - File paths, URLs, command invocations, error text quoted from tools.
74
- - SQL, JSON, Markdown templates: compress prose inside, never the structure.
75
- - Task titles / descriptions persisted via task-management tools: keep them self-contained and unambiguous.
76
- - When the prompt says output ONLY a path / ONLY a fenced block / ONLY a JSON payload, obey that exactly — caveman does not override output contracts.`;
77
-
78
- /**
79
- * Append the caveman style directive after the prompt body but BEFORE any
80
- * trailing strict output-format / schema instructions in the caller. Each
81
- * builder positions the marker so the format contract remains last.
82
- */
83
- function withCaveman(prompt: string): string {
84
- return `${prompt}\n\n${CAVEMAN_INSTRUCTION}`;
85
- }
86
-
87
- // ============================================================================
88
- // STRUCTURED OUTPUT SCHEMAS
89
- // ============================================================================
90
-
91
- /** Zod schema for a single review finding. */
92
- export const ReviewFindingSchema = z.object({
93
- title: z
94
- .string()
95
- .describe(
96
- "Brief title prefixed with priority, e.g. '[P0] Missing null check'",
97
- ),
98
- body: z
99
- .string()
100
- .describe(
101
- "Detailed explanation of the issue, its impact, and a suggested fix",
102
- ),
103
- confidence_score: z
104
- .number()
105
- .min(0)
106
- .max(1)
107
- .optional()
108
- .describe("Confidence in the finding (0.0–1.0)"),
109
- priority: z
110
- .number()
111
- .int()
112
- .min(0)
113
- .max(3)
114
- .optional()
115
- .describe(
116
- "Severity: 0=P0 critical, 1=P1 important, 2=P2 moderate, 3=P3 minor",
117
- ),
118
- code_location: z
119
- .object({
120
- file_path: z
121
- .string()
122
- .describe("Repo-relative path to the file containing the issue"),
123
- line_range: z.object({
124
- start: z.number().int().describe("Start line number"),
125
- end: z.number().int().describe("End line number"),
126
- }),
127
- })
128
- .optional()
129
- .describe("Location of the issue in the codebase"),
130
- });
131
-
132
- /** Zod schema for the full structured review output. */
133
- export const ReviewResultSchema = z.object({
134
- findings: z
135
- .array(ReviewFindingSchema)
136
- .describe("List of review findings, ordered by priority"),
137
- overall_correctness: z
138
- .enum(["patch is correct", "patch is incorrect"])
139
- .describe(
140
- "Exact literal: 'patch is correct' or 'patch is incorrect'. No paraphrase.",
141
- ),
142
- overall_explanation: z
143
- .string()
144
- .describe("Summary of overall quality and correctness"),
145
- overall_confidence_score: z
146
- .number()
147
- .min(0)
148
- .max(1)
149
- .optional()
150
- .describe("Overall confidence in the review (0.0–1.0)"),
151
- });
152
-
153
- /**
154
- * JSON Schema derived from the Zod schema — used by Claude and OpenCode SDKs.
155
- *
156
- * `target: "openapi-3.0"` drops the `$schema` draft URL that Zod stamps
157
- * by default. The Claude Agent SDK's validator silently drops
158
- * `structured_output` when that metadata field is present, so we emit
159
- * the OpenAPI-flavoured variant which matches the hand-written shape in
160
- * the SDK's structured-output guide.
161
- */
162
- export const REVIEW_RESULT_JSON_SCHEMA = z.toJSONSchema(ReviewResultSchema, {
163
- target: "openapi-3.0",
164
- });
165
-
166
- /** Result from a reviewer stage with structured output support. */
167
- export interface StructuredReviewResult {
168
- /** Parsed and filtered review from SDK structured output, or null if unavailable */
169
- structured: ReviewResult | null;
170
- /** Raw text output for fallback parsing and debugger input */
171
- raw: string;
172
- }
173
-
174
- /**
175
- * Merge two parallel reviewer results into one.
176
- *
177
- * Each SDK enforces {@link ReviewResultSchema} at the provider level (Claude
178
- * `outputFormat`, OpenCode `format: json_schema`, Copilot `defineTool`), so a
179
- * non-null `structured` is already a validated {@link ReviewResult}. When
180
- * either reviewer failed to produce validated output we propagate `null` —
181
- * {@link hasActionableFindings} then treats the raw response as actionable so
182
- * the loop keeps iterating instead of silently exiting on a missing reviewer.
183
- */
184
- export function mergeReviewResults(
185
- a: StructuredReviewResult,
186
- b: StructuredReviewResult,
187
- ): StructuredReviewResult {
188
- const rawCombined = [a.raw, b.raw].filter(Boolean).join("\n\n---\n\n");
189
-
190
- // Conservative: any missing structured output → propagate null. Fabricating
191
- // a "patch is correct" default here is how the loop previously exited after
192
- // a single iteration when one reviewer's output failed SDK validation.
193
- if (!a.structured || !b.structured) {
194
- return { structured: null, raw: rawCombined };
195
- }
196
-
197
- const isIncorrect =
198
- a.structured.overall_correctness === "patch is incorrect" ||
199
- b.structured.overall_correctness === "patch is incorrect";
200
-
201
- const explanations = [
202
- a.structured.overall_explanation,
203
- b.structured.overall_explanation,
204
- ].filter((e): e is string => typeof e === "string" && e.length > 0);
205
-
206
- const confidences = [
207
- a.structured.overall_confidence_score,
208
- b.structured.overall_confidence_score,
209
- ].filter((c): c is number => c !== undefined);
210
-
211
- return {
212
- structured: {
213
- findings: [...a.structured.findings, ...b.structured.findings],
214
- overall_correctness: isIncorrect
215
- ? "patch is incorrect"
216
- : "patch is correct",
217
- overall_explanation: explanations.join(" | "),
218
- overall_confidence_score:
219
- confidences.length > 0 ? Math.max(...confidences) : undefined,
220
- },
221
- raw: rawCombined,
222
- };
223
- }
224
-
225
- // ============================================================================
226
- // PLANNER
227
- // ============================================================================
228
-
229
- export interface PlannerContext {
230
- /** 1-indexed loop iteration. Iteration 1 = initial plan; >1 = re-plan. */
231
- iteration: number;
232
- /**
233
- * Markdown rendering of the previous iteration's merged reviewer
234
- * findings. Produced by {@link formatReviewForReplan}. The planner is
235
- * responsible for validating, deduping, and clustering findings into
236
- * shared root causes before revising the RFC — there is no separate
237
- * debugger stage.
238
- */
239
- reviewReport?: string;
240
- }
241
-
242
- /**
243
- * Build the planner prompt. The first iteration authors an RFC from the
244
- * original spec; subsequent iterations revise the RFC using the merged
245
- * reviewer findings from the previous loop iteration.
246
- *
247
- * The planner's deliverable is a filled-in Technical Design Document / RFC
248
- * rendered as markdown text; the orchestrator consumes the RFC as design
249
- * context.
250
- */
251
- export function buildPlannerPrompt(
252
- spec: string,
253
- context: PlannerContext = { iteration: 1 },
254
- ): string {
255
- const reviewReport = context.reviewReport?.trim() ?? "";
256
- const isReplan = context.iteration > 1 && reviewReport.length > 0;
257
-
258
- const header = isReplan
259
- ? `# Technical Design Revision (Iteration ${context.iteration})
260
-
261
- The previous iteration's implementation was flagged by the reviewer.
262
- Investigate the findings, identify shared root causes, and revise the RFC
263
- so it reflects the corrected approach.`
264
- : `# Technical Design (Iteration 1)
265
-
266
- Author a Technical Design Document / RFC for the specification below.`;
267
-
268
- const specBlock = `## Original Specification
269
-
270
- <specification>
271
- ${spec}
272
- </specification>`;
273
-
274
- const reviewBlock = isReplan
275
- ? `
276
-
277
- ## Reviewer Findings (previous iteration)
278
-
279
- <reviewer_findings>
280
- ${reviewReport}
281
- </reviewer_findings>
282
-
283
- ### Triage Before Revising
284
-
285
- The findings above are reviewer hypotheses, not root causes. Before touching
286
- the RFC:
287
-
288
- 1. **Validate** — for each finding, Read the cited file/lines (Grep/Glob/LSP)
289
- and confirm the issue exists. Drop findings that are stale or wrong.
290
- 2. **Dedupe & cluster** — group findings that share a file, module, or
291
- underlying defect. Multiple symptoms often share one root cause.
292
- 3. **Root-cause** — for each cluster, identify the underlying defect (not
293
- the symptom). Note files that must change and any invariants the next
294
- workers must respect.
295
-
296
- ### Revision Focus
297
-
298
- Fold the validated, clustered root causes into the RFC:
299
-
300
- - **Section 5 (Detailed Design)** — specify the corrected approach. Each
301
- root cause should map to a concrete design change.
302
- - **Section 6 (Alternatives Considered)** — if a root cause points to a
303
- better option than the one previously chosen, promote it and demote the
304
- current choice to "rejected" with the new rejection reason.
305
- - **Section 8 (Migration, Rollout, and Testing)** — add validation steps
306
- (tests, lint rules, type checks) that would have caught the regression.
307
- - **Section 9 (Open Questions / Unresolved Issues)** — surface any
308
- uncertainty triage left unresolved.`
309
- : "";
310
-
311
- return withCaveman(`${header}
312
-
313
- ${specBlock}${reviewBlock}
314
-
315
- ${
316
- isReplan
317
- ? `## Step 1: Author a Revised RFC
318
-
319
- This is a re-plan iteration — the validated, clustered findings above MUST
320
- be folded into the design. Always author a revised RFC here, even if the
321
- original specification was a file path. If the spec is a path, Read the
322
- file first to get the original design, then produce a revised RFC that
323
- incorporates the corrected approach. Do NOT short-circuit to just the path
324
- on re-plan.`
325
- : `## Step 1: Spec Path Short-Circuit (do this FIRST)
326
-
327
- The specification above may be either a **file path** to an existing spec
328
- document, or **raw prose** describing a feature.
329
-
330
- Before doing anything else, determine which case you're in:
331
-
332
- - If the specification looks like a path (ends in \`.md\`, \`.txt\`, \`.rst\`,
333
- or similar; starts with \`/\`, \`./\`, or \`~/\`; or contains \`/\` and no
334
- line breaks), attempt to Read it.
335
- - If the Read succeeds, the user has already authored a spec file — there is
336
- **nothing to draft**. Resolve the path to an absolute path (via Bash
337
- \`realpath <path>\` or equivalent) and output ONLY that absolute path as
338
- your final message. Emit nothing else: no RFC, no summary, no commentary.
339
- The orchestrator will read the file itself.
340
- - If Read fails, or the specification is clearly inline prose (multiple
341
- sentences, paragraph structure, no file extension), proceed to Step 2 and
342
- author the full RFC below.
343
-
344
- Do NOT author an RFC when the user has already provided a spec file — just
345
- forward the path. Duplicating the spec wastes tokens and introduces drift.`
346
- }
347
-
348
- ## Step 2: Author the RFC${isReplan ? " (revision)" : " (only if Step 1 did not short-circuit)"}
349
-
350
- 1. **Investigate first.** Use Grep/Glob/Read to ground the RFC in the actual
351
- codebase — the services, modules, data models, and external integrations
352
- this feature will touch. Use Bash for metadata:
353
- - \`git config user.name\` → Author(s)
354
- - \`date '+%Y-%m-%d'\` → Created / Last Updated
355
- 2. **Render the RFC template below as your final message.** Preserve every
356
- section header verbatim and the metadata table exactly. Replace each
357
- \`_Instruction:_\` italicized block and each \`> **Example:**\` blockquote
358
- with real, feature-specific content — the templates are authoring guides,
359
- not final copy.
360
- 3. **Diagrams are load-bearing.** Section 4.1 MUST include a Mermaid System
361
- Architecture diagram grounded in the real components this feature touches.
362
- 4. **Non-goals matter.** Section 3.2 prevents scope creep. Always fill it in
363
- with explicit exclusions — do not leave it generic.
364
- 5. **Alternatives must be real.** Section 6 must list at least two concrete
365
- alternatives (not strawmen) with honest pros, cons, and rejection reasons.
366
- 6. **Surface uncertainty.** Put unresolved decisions in Section 9 with an
367
- owner placeholder (e.g., \`[OWNER: infra team]\`) — do not paper over gaps
368
- with vague language.
369
-
370
- ## Constraints
371
-
372
- - Output nothing else after the RFC (or path) — no meta-commentary, no
373
- summary. The document (or path) stands on its own.
374
- - Match depth to stakes: a greenfield service warrants deep sections 5-7; a
375
- small refactor can abbreviate them, but every section header must be present.`);
376
- }
377
- // ============================================================================
378
- // ORCHESTRATOR
379
- // ============================================================================
380
-
381
- export interface OrchestratorContext {
382
- /**
383
- * The planner's final assistant message. Under the RFC-based Ralph flow,
384
- * this is the authoritative design input — either an absolute path to a
385
- * pre-existing spec file or an inline RFC markdown document. The
386
- * orchestrator decomposes it into the task list using its SDK-specific
387
- * task-persistence tool (`TaskCreate` / `sql` / `todowrite`).
388
- */
389
- plannerNotes?: string;
390
- }
391
-
392
- /**
393
- * Build the orchestrator prompt. The orchestrator decomposes the planner's
394
- * design output (a spec path or inline RFC) into a task list using its
395
- * SDK-specific task-persistence tool, validates the dependency graph, and
396
- * spawns parallel workers.
397
- *
398
- * @param spec - The user's original specification. Used as context/fallback
399
- * when the planner output is missing or ambiguous.
400
- * @param context - Planner handoff (the spec path or RFC markdown).
401
- */
402
- export function buildOrchestratorPrompt(
403
- spec: string,
404
- context: OrchestratorContext = {},
405
- ): string {
406
- const plannerNotes = context.plannerNotes?.trim() ?? "";
407
- const plannerSection =
408
- plannerNotes.length > 0
409
- ? `<planner_output>
410
- ${plannerNotes}
411
- </planner_output>`
412
- : `<planner_output>
413
- (empty — fall back to the Original User Specification below)
414
- </planner_output>`;
415
-
416
- return withCaveman(`You are the workflow orchestrator. You run a three-phase loop:
417
-
418
- 1. **Decompose** the design document into a task list.
419
- 2. **Execute** the tasks by spawning parallel worker sub-agents.
420
- 3. **Report** completion status.
421
-
422
- ## Design Input (authoritative)
423
-
424
- The planner produced the output below. It is in **one of two formats**:
425
- - **A file path** (single line, ends in \`.md\`/\`.txt\`/similar, or starts
426
- with \`/\` / \`./\` / \`~/\`). Read the file to get the spec — its contents
427
- are what you decompose.
428
- - **An inline RFC markdown document** (multi-section, starts with a metadata
429
- table or \`# ... Technical Design Document\` header). Decompose it directly.
430
-
431
- ${plannerSection}
432
-
433
- ## Original User Specification (context / fallback)
434
-
435
- <specification>
436
- ${spec}
437
- </specification>
438
-
439
- ## Phase 1: Decompose the Spec into a Task List
440
-
441
- Read the spec (from the path or the inline RFC) and decompose it into an
442
- ordered, parallelism-friendly list of implementation tasks. For each task,
443
- derive:
444
-
445
- - A short **gerund subject** (e.g., "Implementing auth middleware").
446
- - An **actionable description** (5-10 words, imperative, specific).
447
- - A **blockedBy / dependency list** (IDs of tasks that must complete first).
448
-
449
- **Decomposition guidelines:**
450
-
451
- 1. **Maximize parallelism.** Tasks with empty dependencies form the first
452
- wave and run concurrently. Split independent work streams into separate
453
- tasks rather than chaining them.
454
- 2. **Compartmentalize.** Each task should be self-contained — minimize
455
- shared state and file conflicts. Prefer tasks that touch distinct
456
- modules/files.
457
- 3. **Dependencies only when truly necessary.** Every unnecessary dependency
458
- reduces throughput. Ask: "Can this genuinely not start without the
459
- blocked task?"
460
- 4. **Start with foundations.** Setup, schema, and shared utilities come
461
- before feature code. Tests come after the code they cover.
462
- 5. **Match sections to task categories.** RFC Section 5 (Detailed Design)
463
- typically yields 60-80% of tasks. Sections 8.3 (Test Plan) and 7
464
- (Cross-Cutting) yield validation and infra tasks.
465
-
466
- ### Persist the Task List
467
-
468
- Persist every task using task management tools and encode dependencies. Use your task tools to better manage the status of tasks and mark tasks as complete when their work is done.
469
-
470
- ## Phase 2: Dependency Graph Integrity Check
471
-
472
- BEFORE executing any tasks, validate the graph you just persisted:
473
-
474
- 1. For each task, check that every dependency reference points to a task ID
475
- that actually exists.
476
- 2. Any reference to a non-existent task ID is a **dangling dependency** —
477
- drop it. The task itself is still valid; only the corrupted reference
478
- is removed.
479
- 3. Re-evaluate readiness after cleanup.
480
-
481
- This step is critical. Dangling dependencies will permanently block tasks.
482
-
483
- ## Phase 3: Execute
484
-
485
- ### Readiness Rules
486
-
487
- A task is READY only when:
488
- 1. Its status is \`pending\`.
489
- 2. ALL tasks it depends on are \`completed\`.
490
-
491
- Do NOT spawn a worker for a task whose dependencies are not yet completed.
492
-
493
- ### Execution Loop
494
-
495
- 1. **Identify all ready tasks** — pending tasks whose dependencies are
496
- completed.
497
- 2. **Spawn parallel workers** — for each ready task, dispatch a worker
498
- sub-agent (via \`Agent\`/\`Task\`/\`agent\` tool) with a focused prompt
499
- containing: the task subject + description, relevant context from the
500
- spec/RFC, and instructions to implement and test.
501
- 3. **Monitor completions** — as workers finish, mark tasks \`completed\` and
502
- spawn newly-unblocked tasks IMMEDIATELY.
503
- 4. **Continue until ALL tasks are \`completed\` or \`error\`.** Do NOT stop
504
- early.
505
- 5. **Report a summary** when finished: each task and its final status.
506
-
507
- Spawn ALL ready tasks in parallel — do not serialize when multiple are
508
- ready simultaneously.
509
-
510
- ## Error Handling
511
-
512
- When a worker task FAILS:
513
-
514
- 1. **Diagnose** the error.
515
- 2. **Retry with fix**: spawn a new worker with the error context included.
516
- 3. **Retry limit**: up to 3 retries per task. After that, mark it \`error\`.
517
- 4. **Continue regardless**: do NOT stop. Execute all other unblocked tasks.
518
- 5. **Unblocked tasks proceed**: only direct dependents of an \`error\` task
519
- should be skipped.
520
-
521
- NEVER mark tasks "blocked-by-failure" and stop. Complete as much work as
522
- possible.
523
-
524
- ## Task Status Protocol
525
-
526
- Update statuses **immediately** at every transition via task tool.
527
-
528
- ### Required update sequence per task
529
-
530
- 1. **IMMEDIATELY BEFORE spawning** a worker → mark \`in_progress\`.
531
- 2. **IMMEDIATELY AFTER** the worker returns → mark \`completed\` or
532
- \`error\`.
533
-
534
- ### Timing rules
535
-
536
- - Update status in the same turn as the triggering event. Never batch.
537
- - When multiple workers complete in parallel, issue a SEPARATE update per
538
- task.
539
- - Mark previous tasks \`completed\` before marking new ones
540
- \`in_progress\`.
541
-
542
- ## Worker Sub-Agent Response Style
543
-
544
- When you spawn a worker via \`Agent\` / \`Task\` / \`agent\`, append this exact
545
- clause to its prompt so the worker inherits the terse style:
546
-
547
- > Respond terse like smart caveman. Drop articles, filler, pleasantries,
548
- > hedging. Fragments OK. Technical terms exact. Code blocks unchanged.
549
- > Errors quoted exact. Never compress: tool names, tool args, file paths,
550
- > commit messages, code, exact enum/literal strings, schema field names,
551
- > required section headers, task titles persisted to task tools.
552
-
553
- Do NOT compress the worker's task subject, description, or persisted task
554
- records — those must remain self-contained and unambiguous.`);
555
- }
556
-
557
- // ============================================================================
558
- // CODE SIMPLIFIER
559
- // ============================================================================
560
-
561
- export interface CodeSimplifierContext {
562
- /** Optional planner output (RFC markdown or absolute path to spec). */
563
- plannerNotes?: string;
564
- }
565
-
566
- /**
567
- * Build the code-simplifier prompt. Run by the `code-simplifier` sub-agent
568
- * to inspect only the orchestrator's changes on the current branch and
569
- * refine them for clarity, consistency, and maintainability — without
570
- * altering functionality or test behaviour.
571
- *
572
- * @param spec - The user's original specification, used as context/fallback
573
- * when planner output is missing or ambiguous.
574
- * @param context - Optional planner handoff (spec path or inline RFC markdown).
575
- */
576
- export function buildCodeSimplifierPrompt(
577
- spec: string,
578
- context: CodeSimplifierContext = {},
579
- ): string {
580
- const plannerNotes = context.plannerNotes?.trim() ?? "";
581
- const plannerSection =
582
- plannerNotes.length > 0
583
- ? `<planner_output>
584
- ${plannerNotes}
585
- </planner_output>`
586
- : `<planner_output>
587
- (empty — fall back to the Original User Specification below)
588
- </planner_output>`;
589
-
590
- return withCaveman(`Inspect the orchestrator's changes on the current branch and simplify the implementation for clarity, consistency, and maintainability.
591
-
592
- ## Design Input (authoritative)
593
-
594
- ${plannerSection}
595
-
596
- ## Original User Specification (context / fallback)
597
-
598
- <specification>
599
- ${spec}
600
- </specification>
601
-
602
- ## Instructions
603
-
604
- 1. **Scope to branch changes only.** Run \`git diff\` and \`git status\` to identify every file the orchestrator touched. Do NOT modify files outside that set.
605
- 2. **Simplify and refine.** Within the changed files, improve clarity, consistency, naming, and structure. Remove dead code, unnecessary comments, and redundant abstractions. Prefer simple, direct implementations.
606
- 3. **Preserve all functionality and test behaviour.** No feature regressions, no removed tests, no altered public interfaces unless the change is strictly cosmetic (e.g. rename of an internal variable).
607
- 4. **Keep changes minimal and focused.** No scope creep. Do not rewrite working code that is already clear. Touch only what genuinely benefits from simplification.
608
- 5. **Verify after edits.** Run \`bun typecheck\` and \`bun lint\` from the repository root after all edits are complete. Fix any errors they surface before finishing.`);
609
- }
610
-
611
- // ============================================================================
612
- // INFRASTRUCTURE DISCOVERY
613
- // ============================================================================
614
-
615
- /** Prompts for the three parallel infrastructure-discovery sub-agents. */
616
- export interface InfraDiscoveryPrompts {
617
- /** Prompt for the codebase-locator sub-agent. */
618
- locator: string;
619
- /** Prompt for the codebase-analyzer sub-agent. */
620
- analyzer: string;
621
- /** Prompt for the codebase-pattern-finder sub-agent. */
622
- patternFinder: string;
623
- }
624
-
625
- /**
626
- * Build prompts for three parallel sub-agent stages that discover the
627
- * repository's build, test, lint, and CI infrastructure. Each sub-agent
628
- * explores the codebase dynamically — no hard-coded file lists or patterns.
629
- *
630
- * Inspired by the deep-research-codebase workflow which dispatches
631
- * codebase-locator, codebase-analyzer, and codebase-pattern-finder
632
- * sub-agents in parallel for exploratory research.
633
- */
634
- export function buildInfraDiscoveryPrompts(): InfraDiscoveryPrompts {
635
- return {
636
- locator: withCaveman(`# Locate Build & Test Infrastructure Files
637
-
638
- Find ALL files in this repository that define or configure the build, test,
639
- lint, type-check, and CI/CD infrastructure. Report their paths and a
640
- one-line description of each.
641
-
642
- ## What to look for
643
-
644
- - **Package manifest**: package.json, Cargo.toml, go.mod, pyproject.toml, etc.
645
- - **Lockfiles**: bun.lockb, bun.lock, package-lock.json, yarn.lock, pnpm-lock.yaml, etc.
646
- - **Build config**: tsconfig.json, webpack.config.*, vite.config.*, esbuild.*, rollup.config.*, Makefile, etc.
647
- - **Test config**: jest.config.*, vitest.config.*, playwright.config.*, .mocharc.*, pytest.ini, etc.
648
- - **Lint / format config**: .eslintrc.*, eslint.config.*, biome.json, .prettierrc.*, oxlint.json, etc.
649
- - **CI/CD workflows (REQUIRED)**: .github/workflows/*.yml, .gitlab-ci.yml, Jenkinsfile, .circleci/config.yml, azure-pipelines.yml, etc. List every workflow file separately — reviewers need full coverage.
650
- - **Agent config files**: CLAUDE.md, AGENTS.md, .claude/*, .github/copilot-instructions.md (these often document project commands)
651
-
652
- ## Output format
653
-
654
- Respond with a flat list:
655
-
656
- \`\`\`
657
- <path> — <one-line description>
658
- \`\`\`
659
-
660
- Be exhaustive. Do NOT skip files just because they seem minor — CI configs
661
- and agent instruction files often contain the authoritative command list.
662
- End with a brief trailing summary (1-2 sentences) of what you found.`),
663
-
664
- analyzer: withCaveman(`# Analyze Build & Test Infrastructure
665
-
666
- Examine this repository's build, test, lint, and type-check infrastructure.
667
- Your goal is to produce a concise reference that tells a reviewer exactly
668
- which commands to run to verify an implementation.
669
-
670
- ## Investigation steps
671
-
672
- 1. Read the package manifest (package.json, Cargo.toml, go.mod, etc.) and
673
- list every script/target related to building, testing, linting,
674
- type-checking, or formatting.
675
- 2. Identify the package manager (bun, npm, yarn, pnpm, cargo, go, make)
676
- from lockfiles or config.
677
- 3. Read CI workflow files (.github/workflows/*.yml, etc.) and extract the
678
- key \`run:\` commands — these are the authoritative "what CI actually
679
- executes" list.
680
- 4. Read CLAUDE.md / AGENTS.md if present — they often document the
681
- canonical commands for contributors.
682
- 5. **Audit CI workflows.** When the \`gh\` CLI is available (check via \`command -v gh\`), run:
683
- - \`gh workflow list\` to enumerate active workflows.
684
- - \`gh run list --limit 5\` to see the most recent runs and their statuses.
685
- - \`gh workflow view <name>\` for any workflow whose name suggests it gates merges.
686
- When \`gh\` is unavailable or unauthenticated, fall back to reading the workflow YAML files directly. Capture: workflow names, triggers (push / pull_request / schedule / workflow_dispatch), job names, the exact \`run:\` commands per job, and recent run statuses.
687
- 6. Identify the test framework(s) in use and how to invoke them.
688
-
689
- ## Output format
690
-
691
- \`\`\`
692
- ## Package Manager
693
- <name>
694
-
695
- ## Build Commands
696
- - \`<command>\` — <what it does>
697
-
698
- ## Test Commands
699
- - \`<command>\` — <what it does>
700
-
701
- ## Lint / Type-check Commands
702
- - \`<command>\` — <what it does>
703
-
704
- ## CI Commands (from workflow files)
705
- - \`<command>\` — <source file and context>
706
-
707
- ## CI / GitHub Actions
708
- - Workflow: \`<name>\` — triggers: \`<push|pr|schedule|...>\` — jobs: \`<job names>\`
709
- - Recent runs (when \`gh\` available): \`<conclusion>\` on \`<branch>\` (\`<run id>\`)
710
- \`\`\`
711
-
712
- Be specific — include the exact invocation string (e.g. \`bun test\`, not
713
- just "run tests"). If a command has variants (e.g. test:unit, test:e2e),
714
- list each separately. End with a brief trailing summary.`),
715
-
716
- patternFinder: withCaveman(`# Find Build & Test Patterns
717
-
718
- Search this repository for existing patterns that show how code is built,
719
- tested, and validated. A reviewer needs to know not just WHAT commands exist,
720
- but HOW they are used in practice.
721
-
722
- ## What to find
723
-
724
- 1. **Test file patterns**: Where do tests live? What naming convention
725
- (*.test.ts, *.spec.ts, *_test.go, etc.)? Show 2-3 example paths.
726
- 2. **Test execution patterns**: How are tests actually run? Find examples in
727
- CI configs, scripts, or documentation. Note any environment variables or
728
- flags that are standard (e.g. CLAUDECODE=1, --coverage).
729
- 3. **Build patterns**: How is the project built? Is there a multi-step build
730
- (e.g. codegen → compile → bundle)? What order matters?
731
- 4. **Quality gate patterns**: What checks gate a merge? Look at CI workflows,
732
- pre-commit hooks, and PR check configurations. List the commands in the
733
- order CI runs them.
734
- 5. **Dependency install pattern**: How are dependencies installed before
735
- build/test (e.g. \`bun install\`, \`npm ci\`)?
736
- 6. **CI audit patterns**: Map out the CI structure so reviewers can audit it. Identify matrix builds, job dependencies (\`needs:\`), conditional runs (\`if:\`), required checks, and which jobs gate merges. When \`gh\` is available, surface example commands a reviewer could use:
737
- - \`gh run view <id> --log-failed\` — inspect a failed run.
738
- - \`gh pr checks\` — see check status on the current PR.
739
- - \`gh workflow view <name> --yaml\` — view the canonical workflow definition.
740
-
741
- ## Output format
742
-
743
- For each pattern found, report:
744
- - The pattern name
745
- - The concrete command or file path
746
- - A brief explanation of when/how it's used
747
-
748
- End with a brief trailing summary of the overall build/test workflow order
749
- (e.g. "install → typecheck → lint → test → build"). Also summarise CI workflow order: which workflows fire on what triggers, in what order jobs run within each.`),
750
- };
751
- }
752
-
753
- // ============================================================================
754
- // REVIEWER
755
- // ============================================================================
756
-
757
- /** A single finding from the reviewer sub-agent. */
758
- export interface ReviewFinding {
759
- title: string;
760
- body: string;
761
- confidence_score?: number;
762
- priority?: number;
763
- code_location?: {
764
- file_path: string;
765
- line_range: { start: number; end: number };
766
- };
767
- }
768
-
769
- /** Parsed reviewer JSON output. */
770
- export interface ReviewResult {
771
- findings: ReviewFinding[];
772
- overall_correctness: string;
773
- overall_explanation: string;
774
- overall_confidence_score?: number;
775
- }
776
-
777
- export interface ReviewContext {
778
- /**
779
- * Full branch changeset captured by {@link captureBranchChangeset}.
780
- * Contains diff stat, name-status, and uncommitted changes relative to
781
- * the parent branch — giving the reviewer complete visibility into every
782
- * change this branch introduces.
783
- */
784
- changeset: {
785
- baseBranch: string;
786
- diffStat: string;
787
- uncommitted: string;
788
- nameStatus: string;
789
- errors: string[];
790
- };
791
- /** 1-indexed loop iteration, used in the prompt header. */
792
- iteration?: number;
793
- /**
794
- * When true, instructs the reviewer to call the `submit_review` tool
795
- * instead of outputting JSON directly. Used by the Copilot SDK which
796
- * achieves structured output through tool definitions.
797
- */
798
- useSubmitTool?: boolean;
799
- /**
800
- * Raw output from the parallel infrastructure-discovery sub-agents
801
- * (codebase-locator, codebase-analyzer, codebase-pattern-finder).
802
- * When present, the reviewer uses this to identify and run the
803
- * repository's build/test/lint commands as part of verification.
804
- */
805
- discoveryContext?: string;
806
- }
807
-
808
- /**
809
- * Build the reviewer prompt. Injects a deterministic branch-relative
810
- * changeset so the reviewer sees every file this branch has touched —
811
- * both committed and uncommitted — without expensive tool calls.
812
- */
813
- export function buildReviewPrompt(
814
- spec: string,
815
- context: ReviewContext,
816
- ): string {
817
- const { changeset } = context;
818
- const hasChanges =
819
- changeset.diffStat.length > 0 || changeset.uncommitted.length > 0;
820
- const hasErrors = changeset.errors.length > 0;
821
-
822
- // ── Changeset section ──────────────────────────────────────────────────
823
-
824
- let changesetSection: string;
825
-
826
- if (hasChanges || hasErrors) {
827
- const parts: string[] = [];
828
-
829
- parts.push(`## Branch Changeset (relative to \`${changeset.baseBranch}\`)`);
830
-
831
- // Surface git errors first — the agent needs to know the data is partial
832
- if (hasErrors) {
833
- parts.push(
834
- "",
835
- "### Git Errors",
836
- "",
837
- "The following git commands failed during changeset capture. The data",
838
- "below may be **incomplete**. You should re-run the failed commands",
839
- "yourself to get the full picture, or flag the gap as a finding.",
840
- "",
841
- ...changeset.errors.map((e) => `- ${e}`),
842
- );
843
- }
844
-
845
- if (hasChanges) {
846
- parts.push(
847
- "",
848
- "The following shows every change this branch introduces — both committed",
849
- "and uncommitted. Use this to scope your review. Read the actual file",
850
- "contents for any file that warrants closer inspection.",
851
- );
852
- }
853
-
854
- if (changeset.nameStatus.length > 0) {
855
- parts.push(
856
- "",
857
- "### Changed Files",
858
- "",
859
- "```",
860
- changeset.nameStatus,
861
- "```",
862
- );
863
- }
864
-
865
- if (changeset.diffStat.length > 0) {
866
- parts.push("", "### Diff Summary", "", "```", changeset.diffStat, "```");
867
- }
868
-
869
- if (changeset.uncommitted.length > 0) {
870
- parts.push(
871
- "",
872
- "### Uncommitted Changes (`git status -s`)",
873
- "",
874
- "These changes are in the working tree but not yet committed:",
875
- "",
876
- "```",
877
- changeset.uncommitted,
878
- "```",
879
- );
880
- }
881
-
882
- changesetSection = parts.join("\n");
883
- } else {
884
- changesetSection = `## Branch Changeset (relative to \`${changeset.baseBranch}\`)
885
-
886
- No changes detected relative to \`${changeset.baseBranch}\`. Either nothing
887
- was implemented, all changes were reverted, or you are already on the base
888
- branch. Cross-check the task list to verify whether the implementation ran.`;
889
- }
890
-
891
- // ── Header ─────────────────────────────────────────────────────────────
892
-
893
- const header = context.iteration
894
- ? `# Code Review Request (Iteration ${context.iteration})`
895
- : "# Code Review Request";
896
-
897
- // ── Output instructions ────────────────────────────────────────────────
898
-
899
- const outputSection = context.useSubmitTool
900
- ? `## Output
901
-
902
- You MUST submit your review by calling the \`submit_review\` tool exactly
903
- once with your complete structured review. Do NOT output the review as
904
- plain text — the tool enforces the required schema.`
905
- : `## Output
906
-
907
- Your review output is captured via structured output. The schema is enforced
908
- by the SDK — focus on providing accurate, well-reasoned data for each field.`;
909
-
910
- // ── Discovery context section ────────────────────────────────────────────
911
-
912
- const discoverySection = context.discoveryContext
913
- ? `## Build & Test Infrastructure Discovery
914
-
915
- Three sub-agents explored this repository's build, test, lint, and CI
916
- infrastructure. Their findings are below. Use them to identify the exact
917
- commands you must run to verify the implementation.
918
-
919
- ${context.discoveryContext}
920
- `
921
- : "";
922
-
923
- // ── Full prompt ────────────────────────────────────────────────────────
924
-
925
- return `${header}
926
-
927
- ## Original Specification
928
-
929
- <user_request>
930
- ${spec}
931
- </user_request>
932
-
933
- ${changesetSection}
934
-
935
- ${discoverySection}## Project Conventions
936
-
937
- Use the repository's \`AGENTS.md\` and/or \`CLAUDE.md\` files (if present) for
938
- guidance on style, conventions, testing expectations, and architectural
939
- patterns. Your review should respect these project-level norms — flag
940
- deviations only when they conflict with correctness or security, not personal
941
- preference.
942
-
943
- ## Retrieve Task List
944
-
945
- Call \`TaskList\` to fetch the current task plan and statuses. Use it to:
946
- 1. Identify completed vs incomplete tasks.
947
- 2. Cross-reference the plan against the specification.
948
- 3. Calculate completion metrics.
949
-
950
- ## Verification Step
951
-
952
- **Before writing any findings**, run the build, test, lint, and type-check
953
- commands identified in the "Build & Test Infrastructure Discovery" section
954
- above. Execute them via Bash from the repository root. Run ALL commands even
955
- if earlier ones fail — the goal is a complete picture.
956
-
957
- - Build failures and type errors → P0 finding.
958
- - Test failures → P1 finding.
959
- - Lint violations → P1 finding.
960
-
961
- Include the exact command, exit status, and relevant error output in each
962
- finding's body. If no discovery section is present, attempt to discover
963
- commands yourself by reading package.json, CI configs, or CLAUDE.md.
964
-
965
- ## Review Focus Areas (priority order)
966
-
967
- 1. **Task Completion & Specification Gap Analysis** — HIGHEST priority. Every
968
- task in PENDING / IN_PROGRESS / ERROR status MUST become a P0 finding.
969
- Every spec requirement not covered by any task is a P0 finding. Do NOT
970
- mark the patch correct if any task is incomplete.
971
- 2. **Verification Failures** — Any build, test, lint, or type-check command
972
- that failed during the verification step above is a P0 or P1 finding.
973
- Reference the specific command and error output.
974
- 3. **Correctness of Logic** — does the code implement the requirements?
975
- 4. **Error Handling & Edge Cases** — boundary, empty/null, error paths.
976
- 5. **Security** — injection, secret leakage, auth bypasses.
977
- 6. **Performance** — obvious resource leaks, N+1, hot loops.
978
- 7. **Test Coverage** — critical paths and edge cases tested.
979
-
980
- ## Review Guidelines
981
-
982
- - Be **constructive and helpful** in your feedback. Every finding should
983
- include a clear explanation of the impact and a concrete suggested fix.
984
- - Avoid nitpicks (P3) unless they affect readability or maintainability in
985
- a significant way. The review loop filters out P3 findings.
986
- - When in doubt, give the implementation the benefit of the doubt — flag
987
- genuine issues, not stylistic preferences.
988
-
989
- ${outputSection}
990
-
991
- ### Field Guidance
992
-
993
- - **findings**: Each finding should have:
994
- - \`title\`: Prefix with priority level, e.g. "[P0] Missing null check"
995
- - \`body\`: What's wrong, why it matters, and how to fix it
996
- - \`priority\`: 0 = P0 critical, 1 = P1 important, 2 = P2 moderate, 3 = P3 minor
997
- - \`confidence_score\`: 0.0 – 1.0, how confident you are this is a real issue
998
- - \`code_location\`: repo-relative file path and line range (when applicable)
999
-
1000
- - **overall_correctness**: Set to \`"patch is incorrect"\` whenever there is at
1001
- least one P0 or P1 finding (including incomplete tasks). Use
1002
- \`"patch is correct"\` only when findings are empty or strictly P2/P3.
1003
-
1004
- - **overall_explanation**: Summary of overall quality, correctness, and any
1005
- patterns observed.
1006
-
1007
- Begin your review now.`;
1008
- }
1009
-
1010
- // ============================================================================
1011
- // PARSING & RE-PLAN HELPERS
1012
- // ============================================================================
1013
-
1014
- export function filterActionable(parsed: {
1015
- findings: ReviewFinding[];
1016
- overall_correctness: string;
1017
- overall_explanation?: string;
1018
- overall_confidence_score?: number;
1019
- }): ReviewResult {
1020
- const actionable = parsed.findings.filter(
1021
- (f) => f.priority === undefined || f.priority <= 2,
1022
- );
1023
- return {
1024
- findings: actionable,
1025
- overall_correctness: parsed.overall_correctness,
1026
- overall_explanation: parsed.overall_explanation ?? "",
1027
- overall_confidence_score: parsed.overall_confidence_score,
1028
- };
1029
- }
1030
-
1031
- /**
1032
- * Render the merged reviewer result as the markdown brief consumed by the
1033
- * next iteration's planner.
1034
- *
1035
- * Findings are grouped by file path so the planner sees clusters of related
1036
- * symptoms together (often a hint at a shared root cause). Within each
1037
- * group findings are ordered by ascending priority (P0 first). The
1038
- * `overall_explanation` is included verbatim so the planner has the
1039
- * reviewers' overall narrative.
1040
- *
1041
- * When `parsed === null` (SDK validation failed) the raw transcript is
1042
- * surfaced inside a clearly-labelled fenced block so the planner knows the
1043
- * data is unstructured and must be investigated rather than trusted.
1044
- */
1045
- export function formatReviewForReplan(
1046
- parsed: ReviewResult | null,
1047
- rawText: string,
1048
- ): string {
1049
- if (parsed === null) {
1050
- const trimmed = rawText.trim();
1051
- if (trimmed.length === 0) {
1052
- return "(no reviewer output captured — investigate the previous iteration's branch state directly)";
1053
- }
1054
- return `## Unparseable Reviewer Output
1055
-
1056
- The reviewer's structured output failed schema validation. Raw transcript
1057
- below — investigate the branch state to determine what (if anything) needs
1058
- revision.
1059
-
1060
- \`\`\`
1061
- ${trimmed}
1062
- \`\`\``;
1063
- }
1064
-
1065
- if (parsed.findings.length === 0) {
1066
- return `## Reviewer Verdict
1067
-
1068
- ${parsed.overall_explanation || "No actionable findings, but the reviewers did not sign off."}`;
1069
- }
1070
-
1071
- // Group by file path so clusters of related symptoms surface together.
1072
- const groups = new Map<string, ReviewFinding[]>();
1073
- for (const f of parsed.findings) {
1074
- const key = f.code_location?.file_path ?? "(unspecified location)";
1075
- const bucket = groups.get(key) ?? [];
1076
- bucket.push(f);
1077
- groups.set(key, bucket);
1078
- }
1079
-
1080
- const sections: string[] = [];
1081
-
1082
- if (parsed.overall_explanation && parsed.overall_explanation.length > 0) {
1083
- sections.push(`## Reviewer Summary\n\n${parsed.overall_explanation}`);
1084
- }
1085
-
1086
- sections.push(`## Findings (${parsed.findings.length}, grouped by file)`);
1087
-
1088
- const sortedFiles = Array.from(groups.keys()).sort();
1089
- for (const filePath of sortedFiles) {
1090
- const findings = (groups.get(filePath) ?? []).slice().sort(
1091
- (a, b) => (a.priority ?? 3) - (b.priority ?? 3),
1092
- );
1093
- const lines: string[] = [`### \`${filePath}\``];
1094
- for (const f of findings) {
1095
- const pri = f.priority !== undefined ? `P${f.priority}` : "P2";
1096
- const range = f.code_location
1097
- ? `:${f.code_location.line_range.start}-${f.code_location.line_range.end}`
1098
- : "";
1099
- lines.push(
1100
- `- **[${pri}] ${f.title}**${range ? ` (lines${range})` : ""}`,
1101
- ` ${f.body.replace(/\n/g, "\n ")}`,
1102
- );
1103
- }
1104
- sections.push(lines.join("\n"));
1105
- }
1106
-
1107
- return sections.join("\n\n");
1108
- }