@bastani/atomic 0.6.8 → 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,958 +0,0 @@
1
- /**
2
- * Prompt builders for the deep-research-codebase workflow.
3
- *
4
- * Each builder produces a focused, single-responsibility prompt for one
5
- * specialist sub-agent. The sub-agents themselves are dispatched as separate
6
- * `ctx.stage(...)` calls via the provider SDK's native `agent` parameter
7
- * (Claude SDK options, Copilot sessionOpts, OpenCode session.prompt). Because
8
- * each sub-agent already carries a detailed system prompt in `.claude/agents/`,
9
- * `.opencode/agents/`, and `.github/agents/`, these user-prompts are intentionally
10
- * short — they only supply the topic, the scope, and the output shape the
11
- * downstream synthesizer expects.
12
- *
13
- * Context-engineering principles applied throughout:
14
- *
15
- * • Position-aware framing: the research question is repeated at the TOP
16
- * and BOTTOM of every prompt. Long-context recall is strongest at the
17
- * edges of the context window (see `context-fundamentals`).
18
- *
19
- * • Informativity over exhaustiveness: each per-partition prompt embeds
20
- * ONLY that partition's directories — never the full file list. This
21
- * keeps token cost roughly constant in N rather than O(N²).
22
- *
23
- * • Forward-only data flow: the analyzer prompt embeds the locator's
24
- * output verbatim; the online-researcher prompt does the same. No
25
- * sub-agent has to re-discover what its sibling already produced.
26
- *
27
- * • Trailing-prose guarantee (failure-modes F6): every prompt asks for a
28
- * short prose recap as the final assistant turn so downstream stages
29
- * reading via `transcript()` never get an empty string when the agent
30
- * ends on a tool call.
31
- *
32
- * • Documentarian framing: every prompt explicitly forbids critique or
33
- * improvement suggestions. We are recording what EXISTS.
34
- *
35
- * • File-based handoff (filesystem-context skill): explorer findings are
36
- * written deterministically to a scratch file by TypeScript (no extra
37
- * LLM "synthesizer" stage) and the aggregator reads them by path.
38
- */
39
-
40
- import type { PartitionUnit } from "./scout.ts";
41
-
42
- const DOCUMENTARIAN_DISCLAIMER =
43
- "You are a documentarian, not a critic. Document what EXISTS — do not " +
44
- "propose improvements, identify issues, or suggest refactors. Focus on " +
45
- "concrete file paths, line numbers, and how things actually work.";
46
-
47
- const TRAILING_PROSE_REMINDER =
48
- "End your turn with a short prose paragraph summarising what you produced. " +
49
- "Do NOT end the turn on a tool call — downstream stages read your assistant " +
50
- "transcript and will see nothing if the final message is a tool invocation.";
51
-
52
- const AST_GREP_ENV_NOTICE =
53
- "You are operating in an environment where ast-grep is installed. For any " +
54
- "code search that requires understanding of syntax or code structure, you " +
55
- "should default to using `ast-grep --lang [language] -p '<pattern>'`. Rely " +
56
- "on your ast-grep skill for best practices. Adjust the --lang flag as " +
57
- "needed for the specific programming language. Avoid using text-only " +
58
- "search tools unless a plain-text search is explicitly requested.";
59
-
60
- /** Slugify the user's prompt for use in the final research filename. */
61
- export function slugifyPrompt(prompt: string): string {
62
- const slug = prompt
63
- .toLowerCase()
64
- .replace(/[^a-z0-9\s-]/g, "")
65
- .split(/\s+/)
66
- .filter(Boolean)
67
- .slice(0, 6)
68
- .join("-")
69
- .substring(0, 60);
70
- return slug || "research";
71
- }
72
-
73
- /** Render a partition's directory list as repo-relative paths with file/LOC counts. */
74
- function renderPartitionAssignment(partition: PartitionUnit[]): string {
75
- return partition
76
- .map(
77
- (u) =>
78
- ` - \`${u.path}/\` (${u.fileCount} files, ${u.loc.toLocaleString()} LOC)`,
79
- )
80
- .join("\n");
81
- }
82
-
83
- /** Comma-separated repo-relative directory list (for inline grep/glob scope hints). */
84
- function renderPartitionDirs(partition: PartitionUnit[]): string {
85
- return partition.map((u) => `\`${u.path}/\``).join(", ");
86
- }
87
-
88
- // ─────────────────────────────────────────────────────────────────────────────
89
- // Stage 1a — codebase-scout + query planner (single LLM call)
90
- // ─────────────────────────────────────────────────────────────────────────────
91
- //
92
- // The scout produces both a ≤300-word architectural orientation AND a list of
93
- // per-partition ast-grep query seeds. The combined output is embedded verbatim
94
- // into each specialist sub-agent's prompt as a single <ARCHITECTURAL_ORIENTATION>
95
- // block — no JSON envelope, no deterministic parser. Specialists locate "their"
96
- // partition's seeds by searching for the matching section header inside the
97
- // block and treat them as starting points, not commands.
98
-
99
- export function buildScoutPrompt(opts: {
100
- question: string;
101
- tree: string;
102
- totalLoc: number;
103
- totalFiles: number;
104
- explorerCount: number;
105
- partitionPreview: PartitionUnit[][];
106
- }): string {
107
- const partitionPreview = opts.partitionPreview
108
- .map((bin, i) => {
109
- const dirs = bin.map((u) => `\`${u.path}/\``).join(", ");
110
- const loc = bin.reduce((s, u) => s + u.loc, 0);
111
- return ` ${i + 1}. ${dirs} — ${loc.toLocaleString()} LOC`;
112
- })
113
- .join("\n");
114
-
115
- return [
116
- `<RESEARCH_QUESTION>`,
117
- opts.question,
118
- `</RESEARCH_QUESTION>`,
119
- ``,
120
- `<CONTEXT>`,
121
- `You are the codebase scout AND query planner for the deep-research-codebase`,
122
- `workflow. The workflow has already computed the codebase layout`,
123
- `deterministically:`,
124
- ``,
125
- `- Total source files: ${opts.totalFiles.toLocaleString()}`,
126
- `- Total LOC: ${opts.totalLoc.toLocaleString()}`,
127
- `- Partitions to investigate: ${opts.explorerCount} (chosen by LOC heuristic)`,
128
- ``,
129
- `Pre-computed partition assignments (${opts.explorerCount} partitions):`,
130
- partitionPreview,
131
- ``,
132
- `Compact directory tree (depth 3, ≤200 entries):`,
133
- "```",
134
- opts.tree,
135
- "```",
136
- `</CONTEXT>`,
137
- ``,
138
- `<TOOLING>`,
139
- AST_GREP_ENV_NOTICE,
140
- `Consult https://ast-grep.github.io/reference/languages.html for the`,
141
- `canonical language list, and https://ast-grep.github.io/llms-full.txt for`,
142
- `the full rule reference, when you need them.`,
143
- `</TOOLING>`,
144
- ``,
145
- `<TASK>`,
146
- `Produce TWO sections — both will be embedded verbatim into the specialist`,
147
- `sub-agents' prompts. Use the markdown headers shown so specialists can`,
148
- `find their partition's seeds.`,
149
- ``,
150
- `## Orientation`,
151
- `In ≤300 words, cover:`,
152
- ` 1. The repo's overall shape (monorepo vs single package, polyglot or not)`,
153
- ` 2. The 3-5 most important top-level directories and what each contains`,
154
- ` 3. Architectural boundaries / layering visible from the tree`,
155
- ` 4. Where entry points or main modules likely live`,
156
- ``,
157
- `## Query Seeds`,
158
- `For each of the ${opts.explorerCount} partitions, suggest 2-4 ast-grep`,
159
- `query seeds the specialists could start from. Format each seed as:`,
160
- ``,
161
- `### Partition <n>`,
162
- `- Query: \`ast-grep --lang <language> -p '<pattern>'\``,
163
- ` Why: <one sentence>`,
164
- ``,
165
- `For structural rules (kind + has/inside), use a fenced YAML block instead`,
166
- `of the \`-p\` form, with the same Why line.`,
167
- ``,
168
- `Seeds are starting points, not commands — specialists adapt as they find`,
169
- `things. If a partition is clearly irrelevant to the question, write a`,
170
- `single-line note explaining why and skip its seeds.`,
171
- `</TASK>`,
172
- ``,
173
- `<CONSTRAINTS>`,
174
- DOCUMENTARIAN_DISCLAIMER,
175
- `Do NOT investigate the codebase to answer the question yourself — your`,
176
- `job is orientation + seeding, not investigation. You may use Read/Glob/`,
177
- `Grep/ast-grep sparingly to verify guesses about a few key files or to`,
178
- `confirm a pattern parses, but keep output focused.`,
179
- `Stay under 300 words for the Orientation section. Plain markdown only —`,
180
- `no JSON envelope, no structured output.`,
181
- TRAILING_PROSE_REMINDER,
182
- `</CONSTRAINTS>`,
183
- ``,
184
- `<RESEARCH_QUESTION_REMINDER>`,
185
- opts.question,
186
- `</RESEARCH_QUESTION_REMINDER>`,
187
- ].join("\n");
188
- }
189
-
190
- // ─────────────────────────────────────────────────────────────────────────────
191
- // Stage 2 — per-partition specialist sub-agents
192
- // ─────────────────────────────────────────────────────────────────────────────
193
- //
194
- // Four specialists run per partition, dispatched as separate headless stages
195
- // via the provider SDK's native `agent` parameter. Two layers of parallelism:
196
- //
197
- // Layer 1 (independent searches): locator ∥ pattern-finder
198
- // Layer 2 (depend on locator): analyzer ∥ online-researcher
199
- //
200
- // The deterministic synthesis step (helpers/scratch.ts) then concatenates
201
- // the four outputs into the explorer scratch file the aggregator will read.
202
-
203
- /** codebase-locator — find files in the partition relevant to the question. */
204
- export function buildLocatorPrompt(opts: {
205
- question: string;
206
- partition: PartitionUnit[];
207
- scoutOverview: string;
208
- index: number;
209
- total: number;
210
- }): string {
211
- const assignment = renderPartitionAssignment(opts.partition);
212
- const dirs = renderPartitionDirs(opts.partition);
213
- const orientation =
214
- opts.scoutOverview.trim().length > 0
215
- ? opts.scoutOverview.trim()
216
- : "(scout overview unavailable — proceed without)";
217
-
218
- return [
219
- `<RESEARCH_QUESTION>`,
220
- opts.question,
221
- `</RESEARCH_QUESTION>`,
222
- ``,
223
- `<MISSION>`,
224
- `You are the codebase-locator for partition ${opts.index} of ${opts.total} in a`,
225
- `deep-research workflow. Find every file inside the SCOPE below that`,
226
- `relates to the research question, and return a categorized index.`,
227
- `</MISSION>`,
228
- ``,
229
- `<TOOLING>`,
230
- AST_GREP_ENV_NOTICE,
231
- `</TOOLING>`,
232
- ``,
233
- `<ARCHITECTURAL_ORIENTATION>`,
234
- `The briefing below contains both a high-level orientation AND per-partition`,
235
- `ast-grep query seeds. Find the **Partition ${opts.index}** section for the`,
236
- `seeds scoped to your investigation — treat them as starting points, not`,
237
- `commands. Adapt or skip seeds that don't fit what you actually find.`,
238
- ``,
239
- orientation,
240
- `</ARCHITECTURAL_ORIENTATION>`,
241
- ``,
242
- `<SCOPE>`,
243
- `Search ONLY within these directories. Other partitions cover the rest of`,
244
- `the codebase — do NOT wander outside your scope:`,
245
- ``,
246
- assignment,
247
- ``,
248
- `(Quick comma-separated form for tool args: ${dirs})`,
249
- `</SCOPE>`,
250
- ``,
251
- `<OUTPUT_FORMAT>`,
252
- `Return a markdown report with this exact structure:`,
253
- ``,
254
- `### Implementation`,
255
- `- \`<repo-relative path>\` — 1-line note on relevance`,
256
- ``,
257
- `### Tests`,
258
- `- ...`,
259
- ``,
260
- `### Types / Interfaces`,
261
- `- ...`,
262
- ``,
263
- `### Configuration`,
264
- `- ...`,
265
- ``,
266
- `### Examples / Fixtures`,
267
- `- ...`,
268
- ``,
269
- `### Documentation`,
270
- `- ...`,
271
- ``,
272
- `### Notable Clusters`,
273
- `- \`<repo-relative dir>/\` — N files, why it's a cluster`,
274
- ``,
275
- `Omit any section that has no entries (do not write "(none)" placeholders).`,
276
- `Use repo-relative paths. Do NOT read file contents — your job is location only.`,
277
- `</OUTPUT_FORMAT>`,
278
- ``,
279
- `<CONSTRAINTS>`,
280
- DOCUMENTARIAN_DISCLAIMER,
281
- `Restrict every grep/glob to the SCOPE above.`,
282
- `Do not analyse implementations — siblings (analyzer, pattern-finder) cover that.`,
283
- TRAILING_PROSE_REMINDER,
284
- `</CONSTRAINTS>`,
285
- ``,
286
- `<RESEARCH_QUESTION_REMINDER>`,
287
- opts.question,
288
- `</RESEARCH_QUESTION_REMINDER>`,
289
- ].join("\n");
290
- }
291
-
292
- /** codebase-pattern-finder — surface concrete reusable code patterns. */
293
- export function buildPatternFinderPrompt(opts: {
294
- question: string;
295
- partition: PartitionUnit[];
296
- scoutOverview: string;
297
- index: number;
298
- total: number;
299
- }): string {
300
- const assignment = renderPartitionAssignment(opts.partition);
301
- const dirs = renderPartitionDirs(opts.partition);
302
- const orientation =
303
- opts.scoutOverview.trim().length > 0
304
- ? opts.scoutOverview.trim()
305
- : "(scout overview unavailable — proceed without)";
306
-
307
- return [
308
- `<RESEARCH_QUESTION>`,
309
- opts.question,
310
- `</RESEARCH_QUESTION>`,
311
- ``,
312
- `<MISSION>`,
313
- `You are the codebase-pattern-finder for partition ${opts.index} of ${opts.total}.`,
314
- `Find concrete code patterns inside the SCOPE that demonstrate how the`,
315
- `topic of the research question is currently expressed in the codebase.`,
316
- `Return runnable-looking snippets, not abstract descriptions.`,
317
- `</MISSION>`,
318
- ``,
319
- `<TOOLING>`,
320
- AST_GREP_ENV_NOTICE,
321
- `</TOOLING>`,
322
- ``,
323
- `<ARCHITECTURAL_ORIENTATION>`,
324
- `The briefing below contains both a high-level orientation AND per-partition`,
325
- `ast-grep query seeds. Find the **Partition ${opts.index}** section for the`,
326
- `seeds scoped to your investigation — treat them as starting points, not`,
327
- `commands. Adapt or skip seeds that don't fit what you actually find.`,
328
- ``,
329
- orientation,
330
- `</ARCHITECTURAL_ORIENTATION>`,
331
- ``,
332
- `<SCOPE>`,
333
- assignment,
334
- ``,
335
- `(Quick comma-separated form for tool args: ${dirs})`,
336
- `</SCOPE>`,
337
- ``,
338
- `<OUTPUT_FORMAT>`,
339
- `For each distinct pattern you find, output:`,
340
- ``,
341
- `#### Pattern: <short name>`,
342
- `**Where:** \`<repo-relative path>:<line>\``,
343
- `**What:** 1-sentence description.`,
344
- "```<language>",
345
- `<5-30 lines of actual code from the file>`,
346
- "```",
347
- `**Variations / call-sites:** other \`file.ts:line\` references using the same pattern.`,
348
- ``,
349
- `Aim for 3-7 distinct patterns. Skip anything tangential to the question.`,
350
- `</OUTPUT_FORMAT>`,
351
- ``,
352
- `<CONSTRAINTS>`,
353
- DOCUMENTARIAN_DISCLAIMER,
354
- `Restrict every grep/glob to the SCOPE above.`,
355
- `Quote code verbatim — never paraphrase a snippet.`,
356
- `Use file:line references for every claim.`,
357
- TRAILING_PROSE_REMINDER,
358
- `</CONSTRAINTS>`,
359
- ``,
360
- `<RESEARCH_QUESTION_REMINDER>`,
361
- opts.question,
362
- `</RESEARCH_QUESTION_REMINDER>`,
363
- ].join("\n");
364
- }
365
-
366
- /** codebase-analyzer — document HOW the most relevant impl files work. */
367
- export function buildAnalyzerPrompt(opts: {
368
- question: string;
369
- partition: PartitionUnit[];
370
- locatorOutput: string;
371
- scoutOverview: string;
372
- index: number;
373
- total: number;
374
- }): string {
375
- const assignment = renderPartitionAssignment(opts.partition);
376
- const orientation =
377
- opts.scoutOverview.trim().length > 0
378
- ? opts.scoutOverview.trim()
379
- : "(scout overview unavailable — proceed without)";
380
- const locator =
381
- opts.locatorOutput.trim().length > 0
382
- ? opts.locatorOutput.trim()
383
- : "(locator returned no files — analyse the partition directly)";
384
-
385
- return [
386
- `<RESEARCH_QUESTION>`,
387
- opts.question,
388
- `</RESEARCH_QUESTION>`,
389
- ``,
390
- `<MISSION>`,
391
- `You are the codebase-analyzer for partition ${opts.index} of ${opts.total}.`,
392
- `The codebase-locator (your sibling) has already enumerated the files in`,
393
- `your partition that touch this topic. Your job is to read the 5-10 MOST`,
394
- `relevant IMPLEMENTATION files and document how they actually work, with`,
395
- `precise \`file.ts:line\` references throughout.`,
396
- `</MISSION>`,
397
- ``,
398
- `<TOOLING>`,
399
- AST_GREP_ENV_NOTICE,
400
- `</TOOLING>`,
401
- ``,
402
- `<ARCHITECTURAL_ORIENTATION>`,
403
- `The briefing below contains both a high-level orientation AND per-partition`,
404
- `ast-grep query seeds. Find the **Partition ${opts.index}** section for the`,
405
- `seeds scoped to your investigation — treat them as starting points, not`,
406
- `commands. Adapt or skip seeds that don't fit what you actually find.`,
407
- ``,
408
- orientation,
409
- `</ARCHITECTURAL_ORIENTATION>`,
410
- ``,
411
- `<SCOPE>`,
412
- assignment,
413
- `</SCOPE>`,
414
- ``,
415
- `<LOCATOR_FINDINGS>`,
416
- `Verbatim output from the codebase-locator sibling for this partition —`,
417
- `pick the implementation files to read from the "Implementation" section:`,
418
- ``,
419
- locator,
420
- `</LOCATOR_FINDINGS>`,
421
- ``,
422
- `<METHOD>`,
423
- `1. From the locator findings above, choose 5-10 implementation files most`,
424
- ` central to the research question. Prefer files that look like the`,
425
- ` primary entry points or data-flow hubs.`,
426
- `2. Read each chosen file in full (no offset / no limit).`,
427
- `3. For each file, document:`,
428
- ` • Its role (1 sentence)`,
429
- ` • Key exported symbols with \`file.ts:line\` refs`,
430
- ` • Control flow tied to the research question`,
431
- ` • Data flow (what comes in, what goes out, where state lives)`,
432
- ` • External dependencies it imports (libraries, sibling modules)`,
433
- `4. After per-file documentation, write a short cross-cutting synthesis`,
434
- ` (≤200 words) describing how these files compose to address the topic.`,
435
- `5. List any files OUTSIDE this partition that you noticed are referenced`,
436
- ` from your reads (so the aggregator can stitch findings across`,
437
- ` partitions). One file per line: \`<repo-relative path>\` — 1-line reason.`,
438
- `</METHOD>`,
439
- ``,
440
- `<OUTPUT_FORMAT>`,
441
- `Use this structure (omit empty sections):`,
442
- ``,
443
- `### Files Analysed`,
444
- `<bullet list of the 5-10 files you read, repo-relative paths>`,
445
- ``,
446
- `### Per-File Notes`,
447
- `#### \`<repo-relative path>\``,
448
- `- **Role:** ...`,
449
- `- **Key symbols:** \`name\` (\`file.ts:line\`), ...`,
450
- `- **Control flow:** ...`,
451
- `- **Data flow:** ...`,
452
- `- **Dependencies:** ...`,
453
- ``,
454
- `### Cross-Cutting Synthesis`,
455
- `<≤200 words on how these files compose to address the topic>`,
456
- ``,
457
- `### Out-of-Partition References`,
458
- `- \`<repo-relative path>\` — 1-line note on why it matters`,
459
- `</OUTPUT_FORMAT>`,
460
- ``,
461
- `<CONSTRAINTS>`,
462
- DOCUMENTARIAN_DISCLAIMER,
463
- `Use file:line references for every concrete claim — never abstract prose.`,
464
- `Read files in full; do not paginate via offset/limit unless a file is enormous.`,
465
- `Do NOT analyse files outside your partition — only LIST them as cross-refs.`,
466
- TRAILING_PROSE_REMINDER,
467
- `</CONSTRAINTS>`,
468
- ``,
469
- `<RESEARCH_QUESTION_REMINDER>`,
470
- opts.question,
471
- `</RESEARCH_QUESTION_REMINDER>`,
472
- ].join("\n");
473
- }
474
-
475
- /** codebase-online-researcher — focused external doc fetch when libs are central. */
476
- export function buildOnlineResearcherPrompt(opts: {
477
- question: string;
478
- partition: PartitionUnit[];
479
- locatorOutput: string;
480
- index: number;
481
- total: number;
482
- }): string {
483
- const assignment = renderPartitionAssignment(opts.partition);
484
- const locator =
485
- opts.locatorOutput.trim().length > 0
486
- ? opts.locatorOutput.trim()
487
- : "(locator returned no files)";
488
-
489
- return [
490
- `<RESEARCH_QUESTION>`,
491
- opts.question,
492
- `</RESEARCH_QUESTION>`,
493
- ``,
494
- `<MISSION>`,
495
- `You are the codebase-online-researcher for partition ${opts.index} of ${opts.total}.`,
496
- `Decide whether external library / framework documentation is CENTRAL to`,
497
- `answering the research question for this partition. If yes, fetch focused`,
498
- `excerpts and tie them back to the partition's files. If no, output a`,
499
- `single-line "(no external research applicable)" and stop.`,
500
- `</MISSION>`,
501
- ``,
502
- `<SCOPE>`,
503
- assignment,
504
- `</SCOPE>`,
505
- ``,
506
- `<LOCATOR_FINDINGS>`,
507
- `Use this list to identify which third-party libraries / frameworks the`,
508
- `partition imports. If nothing relevant surfaces, return early.`,
509
- ``,
510
- locator,
511
- `</LOCATOR_FINDINGS>`,
512
- ``,
513
- `<METHOD>`,
514
- `1. Skim the locator output and any package manifests in the partition`,
515
- ` (package.json, go.mod, requirements.txt, Cargo.toml, etc.) to identify`,
516
- ` external dependencies that are LIKELY central to the research question.`,
517
- `2. If none qualify, output exactly:`,
518
- ` (no external research applicable)`,
519
- ` and end the turn with a one-sentence prose explanation of why.`,
520
- `3. If at least one qualifies, follow the token-efficient fetch order from`,
521
- ` your system prompt (llms.txt → Markdown for Agents → playwright-cli)`,
522
- ` to pull focused documentation excerpts.`,
523
- `4. For each library you researched, return:`,
524
- ` • Library name + version (if discoverable)`,
525
- ` • Key doc URLs you fetched`,
526
- ` • The specific behavior that bears on the research question`,
527
- ` • Where in the partition that behavior is exercised (\`file.ts:line\`)`,
528
- `</METHOD>`,
529
- ``,
530
- `<OUTPUT_FORMAT>`,
531
- `If you skipped:`,
532
- ``,
533
- `(no external research applicable)`,
534
- ``,
535
- `<one-sentence justification>`,
536
- ``,
537
- `If you researched, repeat per library:`,
538
- ``,
539
- `#### <Library> (vX.Y)`,
540
- `**Docs:** <url>, <url>`,
541
- `**Relevant behaviour:** ...`,
542
- `**Where used:** \`<repo-relative path>:<line>\` — 1-line note`,
543
- `</OUTPUT_FORMAT>`,
544
- ``,
545
- `<CONSTRAINTS>`,
546
- DOCUMENTARIAN_DISCLAIMER,
547
- `Skipping is the correct answer when nothing is central — do NOT pad with`,
548
- `tutorials or general guides.`,
549
- `Quote URLs verbatim. Do NOT invent or paraphrase doc URLs.`,
550
- TRAILING_PROSE_REMINDER,
551
- `</CONSTRAINTS>`,
552
- ``,
553
- `<RESEARCH_QUESTION_REMINDER>`,
554
- opts.question,
555
- `</RESEARCH_QUESTION_REMINDER>`,
556
- ].join("\n");
557
- }
558
-
559
- // ─────────────────────────────────────────────────────────────────────────────
560
- // Stage 1b — research-history specialists
561
- // ─────────────────────────────────────────────────────────────────────────────
562
-
563
- /** codebase-research-locator — find prior research docs about the topic. */
564
- export function buildHistoryLocatorPrompt(opts: {
565
- question: string;
566
- }): string {
567
- return [
568
- `<RESEARCH_QUESTION>`,
569
- opts.question,
570
- `</RESEARCH_QUESTION>`,
571
- ``,
572
- `<MISSION>`,
573
- `You are the codebase-research-locator. Surface prior research documents`,
574
- `about this topic from the project's research/ directory so the analyzer`,
575
- `(your sibling) can extract insights from them.`,
576
- `</MISSION>`,
577
- ``,
578
- `<SCOPE>`,
579
- `Primary: \`research/\` (and standard subdirs: docs/, tickets/, notes/).`,
580
- `Secondary: any sibling research directories at the repository root that match`,
581
- `\`*research*\`, \`*adr*\`, \`*rfc*\`, or \`specs\`.`,
582
- ``,
583
- `If no research directory exists at all, return a single section:`,
584
- ``,
585
- `### No Prior Research`,
586
- `(briefly note what you checked)`,
587
- `</SCOPE>`,
588
- ``,
589
- `<OUTPUT_FORMAT>`,
590
- `Group by document type. Within each group, sort newest first by filename.`,
591
- ``,
592
- `### Docs`,
593
- `- \`<repo-relative path>\` — 1-line title-derived summary`,
594
- ``,
595
- `### Tickets`,
596
- `- ...`,
597
- ``,
598
- `### Notes`,
599
- `- ...`,
600
- ``,
601
- `### Specs / ADRs / RFCs`,
602
- `- ...`,
603
- ``,
604
- `Omit empty sections.`,
605
- `</OUTPUT_FORMAT>`,
606
- ``,
607
- `<CONSTRAINTS>`,
608
- DOCUMENTARIAN_DISCLAIMER,
609
- `Do NOT read file contents in depth — your sibling does that.`,
610
- `Do NOT investigate live source files — that's the explorers' job.`,
611
- TRAILING_PROSE_REMINDER,
612
- `</CONSTRAINTS>`,
613
- ``,
614
- `<RESEARCH_QUESTION_REMINDER>`,
615
- opts.question,
616
- `</RESEARCH_QUESTION_REMINDER>`,
617
- ].join("\n");
618
- }
619
-
620
- /** codebase-research-analyzer — synthesize insights from located research docs. */
621
- export function buildHistoryAnalyzerPrompt(opts: {
622
- question: string;
623
- locatorOutput: string;
624
- }): string {
625
- const locator =
626
- opts.locatorOutput.trim().length > 0
627
- ? opts.locatorOutput.trim()
628
- : "(no prior research surfaced)";
629
-
630
- return [
631
- `<RESEARCH_QUESTION>`,
632
- opts.question,
633
- `</RESEARCH_QUESTION>`,
634
- ``,
635
- `<MISSION>`,
636
- `You are the codebase-research-analyzer. Extract HIGH-VALUE insights from`,
637
- `the prior research documents your sibling located, and produce a tight`,
638
- `synthesis the aggregator can fold in as supplementary context.`,
639
- `</MISSION>`,
640
- ``,
641
- `<LOCATOR_FINDINGS>`,
642
- locator,
643
- `</LOCATOR_FINDINGS>`,
644
- ``,
645
- `<METHOD>`,
646
- `1. Pick the 3-5 MOST relevant documents from the locator output.`,
647
- `2. Read each in full.`,
648
- `3. For each, capture:`,
649
- ` • Prior decisions on related topics (and what was actually shipped)`,
650
- ` • Completed investigations and their conclusions`,
651
- ` • Open questions / unresolved threads still in flight`,
652
- `4. Filter aggressively — drop tangential mentions and outdated context.`,
653
- `5. Synthesize into a single ≤400-word block. Cite document paths inline.`,
654
- `</METHOD>`,
655
- ``,
656
- `<OUTPUT_FORMAT>`,
657
- `### Documents Reviewed`,
658
- `- \`<repo-relative path>\` — 1-line takeaway`,
659
- ``,
660
- `### Synthesis`,
661
- `<≤400 words covering decisions, conclusions, and open questions, with`,
662
- `inline path citations like (\`research/docs/2025-…md\`)>`,
663
- ``,
664
- `If no relevant prior research exists, output a single sentence saying so.`,
665
- `</OUTPUT_FORMAT>`,
666
- ``,
667
- `<CONSTRAINTS>`,
668
- DOCUMENTARIAN_DISCLAIMER,
669
- `Stay under 400 words in the Synthesis section.`,
670
- `Do NOT investigate live source files — that's the explorers' job.`,
671
- `Do NOT write any new files — your output is consumed via session transcript.`,
672
- TRAILING_PROSE_REMINDER,
673
- `</CONSTRAINTS>`,
674
- ``,
675
- `<RESEARCH_QUESTION_REMINDER>`,
676
- opts.question,
677
- `</RESEARCH_QUESTION_REMINDER>`,
678
- ].join("\n");
679
- }
680
-
681
- // ─────────────────────────────────────────────────────────────────────────────
682
- // Stage 3 — aggregator
683
- // ─────────────────────────────────────────────────────────────────────────────
684
-
685
- export function buildAggregatorPrompt(opts: {
686
- question: string;
687
- totalLoc: number;
688
- totalFiles: number;
689
- explorerCount: number;
690
- explorerFiles: {
691
- index: number;
692
- scratchPath: string;
693
- partition: PartitionUnit[];
694
- }[];
695
- finalPath: string;
696
- scoutOverview: string;
697
- historyOverview: string;
698
- }): string {
699
- const explorerSummary = opts.explorerFiles
700
- .map((e) => {
701
- const dirs = e.partition.map((u) => `\`${u.path}/\``).join(", ");
702
- return `- **Partition ${e.index}** → \`${e.scratchPath}\`\n Covered: ${dirs}`;
703
- })
704
- .join("\n");
705
-
706
- const orientation =
707
- opts.scoutOverview.trim().length > 0
708
- ? opts.scoutOverview.trim()
709
- : "(scout overview unavailable)";
710
-
711
- const history =
712
- opts.historyOverview.trim().length > 0
713
- ? opts.historyOverview.trim()
714
- : "(no historical research surfaced)";
715
-
716
- return [
717
- `<RESEARCH_QUESTION>`,
718
- opts.question,
719
- `</RESEARCH_QUESTION>`,
720
- ``,
721
- `<MISSION>`,
722
- `You are the aggregator. ${opts.explorerCount} parallel partitions of the`,
723
- `codebase (${opts.totalLoc.toLocaleString()} LOC across ${opts.totalFiles.toLocaleString()} source files)`,
724
- `have each been investigated by four specialist sub-agents — codebase-locator,`,
725
- `codebase-pattern-finder, codebase-analyzer, and codebase-online-researcher`,
726
- `— dispatched directly via the agent SDK. The deterministic synthesis step`,
727
- `wrote one markdown findings file per partition. A separate research-history`,
728
- `pipeline (codebase-research-locator → codebase-research-analyzer) surveyed`,
729
- `the project's prior research documents. Your job: synthesise everything`,
730
- `into a single comprehensive research document.`,
731
- `</MISSION>`,
732
- ``,
733
- `<ARCHITECTURAL_ORIENTATION>`,
734
- orientation,
735
- `</ARCHITECTURAL_ORIENTATION>`,
736
- ``,
737
- `<HISTORICAL_CONTEXT>`,
738
- `Use as supplementary context — live findings take precedence:`,
739
- ``,
740
- history,
741
- `</HISTORICAL_CONTEXT>`,
742
- ``,
743
- `<EXPLORER_REPORTS>`,
744
- `Each file below has the same structure (Scope / Files in Scope / How It`,
745
- `Works / Patterns / External References / Out-of-Partition References).`,
746
- `These are LIVE evidence from the specialist sub-agents and take precedence`,
747
- `over historical context.`,
748
- ``,
749
- explorerSummary,
750
- `</EXPLORER_REPORTS>`,
751
- ``,
752
- `<METHOD>`,
753
- `1. Read EVERY explorer findings file in full using the Read tool with no`,
754
- ` offset or limit — these are not optional.`,
755
- `2. Cross-reference: stitch findings together across partitions using each`,
756
- ` file's "Out-of-Partition References" section.`,
757
- `3. Resolve contradictions by re-reading the underlying source files`,
758
- ` directly — do not paper over disagreements.`,
759
- `4. Integrate historical context where it adds value, but trust live`,
760
- ` findings when they conflict with history.`,
761
- `5. Write the final research document to: \`${opts.finalPath}\``,
762
- `6. After writing the file, output a ≤200-word executive summary as your`,
763
- ` final prose response so this transcript has content.`,
764
- `</METHOD>`,
765
- ``,
766
- `<OUTPUT_FORMAT>`,
767
- `The file at \`${opts.finalPath}\` must follow this structure:`,
768
- ``,
769
- "```markdown",
770
- `---`,
771
- `date: <today's date YYYY-MM-DD HH:MM:SS TZ — run \`date '+%Y-%m-%d %H:%M:%S %Z'\`>`,
772
- `researcher: deep-research-codebase workflow`,
773
- `git_commit: <run \`git rev-parse --verify HEAD\`>`,
774
- `branch: <run \`git branch --show-current\`>`,
775
- `repository: <repo name from \`basename \\$(git rev-parse --show-toplevel)\`>`,
776
- `topic: "<the original research question>"`,
777
- `tags: [research, codebase, deep-research]`,
778
- `status: complete`,
779
- `last_updated: <today's date YYYY-MM-DD>`,
780
- `---`,
781
- ``,
782
- `# Research: <short title>`,
783
- ``,
784
- `## Research Question`,
785
- `<verbatim original question>`,
786
- ``,
787
- `## Executive Summary`,
788
- `3-5 paragraph high-level answer with concrete evidence.`,
789
- ``,
790
- `## Detailed Findings`,
791
- ``,
792
- `### <Component / Area 1>`,
793
- `Description with file:line references.`,
794
- ``,
795
- `### <Component / Area 2>`,
796
- `...`,
797
- ``,
798
- `## Architecture & Patterns`,
799
- `Cross-cutting patterns observed across multiple partitions.`,
800
- ``,
801
- `## Code References`,
802
- `- \`path/to/file.ts:123\` — what's there`,
803
- ``,
804
- `## Historical Context (from research/)`,
805
- `Relevant insights from prior research, with paths. Omit if no history.`,
806
- ``,
807
- `## Open Questions`,
808
- `Areas needing further investigation.`,
809
- ``,
810
- `## Methodology`,
811
- `Generated by the deep-research-codebase workflow with ${opts.explorerCount} partitions`,
812
- `covering ${opts.totalFiles.toLocaleString()} source files (${opts.totalLoc.toLocaleString()} LOC).`,
813
- `Each partition was investigated by four specialist sub-agents dispatched`,
814
- `directly via the provider SDK's native agent parameter:`,
815
- `codebase-locator, codebase-pattern-finder, codebase-analyzer, and`,
816
- `codebase-online-researcher. A separate research-history pipeline ran`,
817
- `codebase-research-locator → codebase-research-analyzer over the project's`,
818
- `prior research documents.`,
819
- "```",
820
- `</OUTPUT_FORMAT>`,
821
- ``,
822
- `<CONSTRAINTS>`,
823
- DOCUMENTARIAN_DISCLAIMER,
824
- `Prefer concrete file:line references over abstract descriptions.`,
825
- `Do NOT skim explorer reports — read each one in full.`,
826
- `If two partitions contradict each other, re-read the underlying source files.`,
827
- `End with the required ≤200-word executive summary AFTER writing the file.`,
828
- `</CONSTRAINTS>`,
829
- ``,
830
- `<RESEARCH_QUESTION_REMINDER>`,
831
- opts.question,
832
- `</RESEARCH_QUESTION_REMINDER>`,
833
- ].join("\n");
834
- }
835
-
836
- // ─────────────────────────────────────────────────────────────────────────────
837
- // Stage 2 — batched specialist dispatch (Task-tool fan-out)
838
- // ─────────────────────────────────────────────────────────────────────────────
839
- //
840
- // To cap parallel SDK subprocesses, specialist invocations are grouped into
841
- // "batch sessions" (see helpers/batching.ts). Each batch session is a single
842
- // Claude Agent SDK call whose main thread dispatches up to N sub-agents via
843
- // the Task tool. The sub-agents write their verbatim findings to per-task
844
- // scratch files and reply with a single confirmation token, so the
845
- // orchestrator's context grows by N short lines rather than N transcripts
846
- // (filesystem-context skill).
847
-
848
- /**
849
- * Wrap a specialist prompt with the "write to file, reply with token only"
850
- * envelope. The envelope is what the orchestrator hands to the Task tool's
851
- * `prompt` parameter — the inner specialist prompt is built by the existing
852
- * `buildLocatorPrompt` / `buildPatternFinderPrompt` / etc. and embedded
853
- * verbatim so prompt semantics stay identical to the unbatched workflow.
854
- */
855
- export function wrapPromptForTaskDispatch(opts: {
856
- specialistPrompt: string;
857
- outputPath: string;
858
- agentLabel: string;
859
- }): string {
860
- return [
861
- `<TASK_OUTPUT_CONTRACT>`,
862
- `Write your COMPLETE response — the verbatim markdown findings exactly as`,
863
- `the prompt below specifies — to this absolute path using the Write tool:`,
864
- ``,
865
- ` ${opts.outputPath}`,
866
- ``,
867
- `Then reply with exactly the single token "DONE" and nothing else. Your`,
868
- `parent only needs confirmation; the file is the real output. Do NOT`,
869
- `inline your findings into your reply, do NOT add commentary, do NOT`,
870
- `summarise — just write the file, then reply "DONE".`,
871
- ``,
872
- `If you cannot produce useful findings (e.g. the partition has nothing`,
873
- `relevant to the question), write a one-line sentinel to the file`,
874
- `explaining why, then still reply "DONE". Reply with`,
875
- `"FAILED: <one-line reason>" only if you could not even write the file.`,
876
- `</TASK_OUTPUT_CONTRACT>`,
877
- ``,
878
- `<${opts.agentLabel}_TASK>`,
879
- opts.specialistPrompt,
880
- `</${opts.agentLabel}_TASK>`,
881
- ].join("\n");
882
- }
883
-
884
- /**
885
- * Build the orchestrator prompt for a batch session. The orchestrator's job
886
- * is purely deterministic dispatch — fire one Task tool call per task in
887
- * **a single assistant message** so they execute in parallel, then report a
888
- * one-line tally. It must NOT inline sub-agent findings, paraphrase the
889
- * embedded prompts, or retry failures — siblings still run and synthesis
890
- * tolerates missing files.
891
- */
892
- export function buildBatchOrchestratorPrompt(opts: {
893
- wave: 1 | 2;
894
- batchIndex: number;
895
- totalBatches: number;
896
- tasks: Array<{
897
- subagentType: string;
898
- prompt: string;
899
- outputPath: string;
900
- }>;
901
- }): string {
902
- const taskBlocks = opts.tasks
903
- .map((t, i) =>
904
- [
905
- `### Task ${i + 1} of ${opts.tasks.length} — \`${t.subagentType}\``,
906
- `Output path the sub-agent will write to: \`${t.outputPath}\``,
907
- ``,
908
- `Verbatim prompt to pass as the Task tool's \`prompt\` parameter:`,
909
- ``,
910
- "````",
911
- t.prompt,
912
- "````",
913
- ``,
914
- ].join("\n"),
915
- )
916
- .join("\n");
917
-
918
- return [
919
- `<BATCH_DISPATCH_MISSION>`,
920
- `You are the deterministic dispatcher for batch ${opts.batchIndex} of`,
921
- `${opts.totalBatches} in wave ${opts.wave} of the deep-research-codebase`,
922
- `workflow. Your sole job is to spawn the ${opts.tasks.length} sub-agent`,
923
- `task${opts.tasks.length === 1 ? "" : "s"} listed below using the Task tool.`,
924
- `</BATCH_DISPATCH_MISSION>`,
925
- ``,
926
- `<DISPATCH_RULES>`,
927
- `1. Issue ALL ${opts.tasks.length} Task tool calls in a SINGLE assistant`,
928
- ` message (parallel tool use), not sequentially across multiple turns.`,
929
- ` Parallel dispatch is the only reason this batch exists — sequential`,
930
- ` calls defeat its purpose.`,
931
- `2. For each task: set \`subagent_type\` to the value shown, set \`prompt\``,
932
- ` to the verbatim text inside the fenced block (no paraphrasing,`,
933
- ` truncating, or added framing), and set \`description\` to a short`,
934
- ` 3–5 word label.`,
935
- `3. Dispatch every task even if some look similar to others. Tasks here`,
936
- ` cover DIFFERENT codebase partitions or DIFFERENT specialist roles —`,
937
- ` apparent overlap is not real overlap. Do NOT merge, skip, or combine.`,
938
- `4. Do NOT inline any sub-agent's findings into your reply. The sub-agents`,
939
- ` write their output to disk; downstream stages read those files.`,
940
- `5. Do NOT retry failed sub-agents. Siblings still run and the synthesis`,
941
- ` step tolerates missing files.`,
942
- `</DISPATCH_RULES>`,
943
- ``,
944
- `<FINAL_REPLY_FORMAT>`,
945
- `After all sub-agents complete, your final assistant message must be`,
946
- `exactly one line of the form:`,
947
- ``,
948
- ` BATCH ${opts.batchIndex} COMPLETE: <ok>/${opts.tasks.length} ok, <failed> failed`,
949
- ``,
950
- `where <ok> is the count that replied "DONE" and <failed> is the count`,
951
- `that replied "FAILED" or otherwise did not produce a file.`,
952
- `</FINAL_REPLY_FORMAT>`,
953
- ``,
954
- `---`,
955
- ``,
956
- taskBlocks,
957
- ].join("\n");
958
- }