@bastani/atomic 0.6.8-0 → 0.7.0-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (765) hide show
  1. package/bin/atomic +65 -0
  2. package/package.json +17 -82
  3. package/postinstall.mjs +47 -0
  4. package/.agents/skills/ado-commit/SKILL.md +0 -94
  5. package/.agents/skills/ado-create-pr/SKILL.md +0 -211
  6. package/.agents/skills/advanced-evaluation/SKILL.md +0 -404
  7. package/.agents/skills/advanced-evaluation/references/bias-mitigation.md +0 -288
  8. package/.agents/skills/advanced-evaluation/references/evaluation-pipeline.md +0 -43
  9. package/.agents/skills/advanced-evaluation/references/implementation-patterns.md +0 -315
  10. package/.agents/skills/advanced-evaluation/references/metrics-guide.md +0 -331
  11. package/.agents/skills/advanced-evaluation/scripts/evaluation_example.py +0 -392
  12. package/.agents/skills/ast-grep/SKILL.md +0 -325
  13. package/.agents/skills/ast-grep/references/rule_reference.md +0 -297
  14. package/.agents/skills/bdi-mental-states/SKILL.md +0 -313
  15. package/.agents/skills/bdi-mental-states/references/bdi-ontology-core.md +0 -207
  16. package/.agents/skills/bdi-mental-states/references/framework-integration.md +0 -582
  17. package/.agents/skills/bdi-mental-states/references/rdf-examples.md +0 -315
  18. package/.agents/skills/bdi-mental-states/references/sparql-competency.md +0 -420
  19. package/.agents/skills/bun/SKILL.md +0 -233
  20. package/.agents/skills/context-compression/SKILL.md +0 -274
  21. package/.agents/skills/context-compression/references/evaluation-framework.md +0 -213
  22. package/.agents/skills/context-compression/scripts/compression_evaluator.py +0 -862
  23. package/.agents/skills/context-compression/tests/test_compression_evaluator.py +0 -56
  24. package/.agents/skills/context-degradation/SKILL.md +0 -208
  25. package/.agents/skills/context-degradation/references/patterns.md +0 -314
  26. package/.agents/skills/context-degradation/scripts/degradation_detector.py +0 -614
  27. package/.agents/skills/context-fundamentals/SKILL.md +0 -203
  28. package/.agents/skills/context-fundamentals/references/context-components.md +0 -283
  29. package/.agents/skills/context-fundamentals/scripts/context_manager.py +0 -533
  30. package/.agents/skills/context-optimization/SKILL.md +0 -197
  31. package/.agents/skills/context-optimization/references/optimization_techniques.md +0 -272
  32. package/.agents/skills/context-optimization/scripts/compaction.py +0 -562
  33. package/.agents/skills/create-spec/SKILL.md +0 -249
  34. package/.agents/skills/docx/LICENSE.txt +0 -30
  35. package/.agents/skills/docx/SKILL.md +0 -592
  36. package/.agents/skills/docx/scripts/__init__.py +0 -1
  37. package/.agents/skills/docx/scripts/accept_changes.py +0 -135
  38. package/.agents/skills/docx/scripts/comment.py +0 -318
  39. package/.agents/skills/docx/scripts/office/helpers/__init__.py +0 -0
  40. package/.agents/skills/docx/scripts/office/helpers/merge_runs.py +0 -199
  41. package/.agents/skills/docx/scripts/office/helpers/simplify_redlines.py +0 -197
  42. package/.agents/skills/docx/scripts/office/pack.py +0 -159
  43. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +0 -1499
  44. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +0 -146
  45. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +0 -1085
  46. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +0 -11
  47. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +0 -3081
  48. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +0 -23
  49. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +0 -185
  50. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +0 -287
  51. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +0 -1676
  52. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +0 -28
  53. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +0 -144
  54. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +0 -174
  55. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +0 -25
  56. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +0 -18
  57. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +0 -59
  58. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +0 -56
  59. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +0 -195
  60. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +0 -582
  61. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +0 -25
  62. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +0 -4439
  63. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +0 -570
  64. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +0 -509
  65. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +0 -12
  66. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +0 -108
  67. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +0 -96
  68. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +0 -3646
  69. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +0 -116
  70. package/.agents/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +0 -42
  71. package/.agents/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +0 -50
  72. package/.agents/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +0 -49
  73. package/.agents/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +0 -33
  74. package/.agents/skills/docx/scripts/office/schemas/mce/mc.xsd +0 -75
  75. package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-2010.xsd +0 -560
  76. package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-2012.xsd +0 -67
  77. package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-2018.xsd +0 -14
  78. package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +0 -20
  79. package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +0 -13
  80. package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +0 -4
  81. package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +0 -8
  82. package/.agents/skills/docx/scripts/office/soffice.py +0 -183
  83. package/.agents/skills/docx/scripts/office/unpack.py +0 -132
  84. package/.agents/skills/docx/scripts/office/validate.py +0 -111
  85. package/.agents/skills/docx/scripts/office/validators/__init__.py +0 -15
  86. package/.agents/skills/docx/scripts/office/validators/base.py +0 -847
  87. package/.agents/skills/docx/scripts/office/validators/docx.py +0 -446
  88. package/.agents/skills/docx/scripts/office/validators/pptx.py +0 -275
  89. package/.agents/skills/docx/scripts/office/validators/redlining.py +0 -247
  90. package/.agents/skills/docx/scripts/templates/comments.xml +0 -3
  91. package/.agents/skills/docx/scripts/templates/commentsExtended.xml +0 -3
  92. package/.agents/skills/docx/scripts/templates/commentsExtensible.xml +0 -3
  93. package/.agents/skills/docx/scripts/templates/commentsIds.xml +0 -3
  94. package/.agents/skills/docx/scripts/templates/people.xml +0 -3
  95. package/.agents/skills/evaluation/SKILL.md +0 -253
  96. package/.agents/skills/evaluation/references/metrics.md +0 -339
  97. package/.agents/skills/evaluation/scripts/evaluator.py +0 -627
  98. package/.agents/skills/explain-code/SKILL.md +0 -232
  99. package/.agents/skills/filesystem-context/SKILL.md +0 -289
  100. package/.agents/skills/filesystem-context/references/implementation-patterns.md +0 -549
  101. package/.agents/skills/filesystem-context/scripts/filesystem_context.py +0 -425
  102. package/.agents/skills/find-skills/SKILL.md +0 -144
  103. package/.agents/skills/gh-commit/SKILL.md +0 -245
  104. package/.agents/skills/gh-create-pr/SKILL.md +0 -95
  105. package/.agents/skills/hosted-agents/SKILL.md +0 -262
  106. package/.agents/skills/hosted-agents/references/infrastructure-patterns.md +0 -700
  107. package/.agents/skills/hosted-agents/scripts/sandbox_manager.py +0 -590
  108. package/.agents/skills/impeccable/SKILL.md +0 -178
  109. package/.agents/skills/impeccable/agents/openai.yaml +0 -4
  110. package/.agents/skills/impeccable/reference/adapt.md +0 -190
  111. package/.agents/skills/impeccable/reference/animate.md +0 -175
  112. package/.agents/skills/impeccable/reference/audit.md +0 -134
  113. package/.agents/skills/impeccable/reference/bolder.md +0 -113
  114. package/.agents/skills/impeccable/reference/brand.md +0 -114
  115. package/.agents/skills/impeccable/reference/clarify.md +0 -174
  116. package/.agents/skills/impeccable/reference/cognitive-load.md +0 -106
  117. package/.agents/skills/impeccable/reference/color-and-contrast.md +0 -105
  118. package/.agents/skills/impeccable/reference/colorize.md +0 -154
  119. package/.agents/skills/impeccable/reference/craft.md +0 -193
  120. package/.agents/skills/impeccable/reference/critique.md +0 -213
  121. package/.agents/skills/impeccable/reference/delight.md +0 -302
  122. package/.agents/skills/impeccable/reference/distill.md +0 -111
  123. package/.agents/skills/impeccable/reference/document.md +0 -427
  124. package/.agents/skills/impeccable/reference/extract.md +0 -70
  125. package/.agents/skills/impeccable/reference/harden.md +0 -347
  126. package/.agents/skills/impeccable/reference/heuristics-scoring.md +0 -234
  127. package/.agents/skills/impeccable/reference/interaction-design.md +0 -195
  128. package/.agents/skills/impeccable/reference/layout.md +0 -141
  129. package/.agents/skills/impeccable/reference/live.md +0 -594
  130. package/.agents/skills/impeccable/reference/motion-design.md +0 -109
  131. package/.agents/skills/impeccable/reference/onboard.md +0 -234
  132. package/.agents/skills/impeccable/reference/optimize.md +0 -258
  133. package/.agents/skills/impeccable/reference/overdrive.md +0 -130
  134. package/.agents/skills/impeccable/reference/personas.md +0 -178
  135. package/.agents/skills/impeccable/reference/polish.md +0 -232
  136. package/.agents/skills/impeccable/reference/product.md +0 -62
  137. package/.agents/skills/impeccable/reference/quieter.md +0 -99
  138. package/.agents/skills/impeccable/reference/responsive-design.md +0 -114
  139. package/.agents/skills/impeccable/reference/shape.md +0 -151
  140. package/.agents/skills/impeccable/reference/spatial-design.md +0 -100
  141. package/.agents/skills/impeccable/reference/teach.md +0 -156
  142. package/.agents/skills/impeccable/reference/typeset.md +0 -124
  143. package/.agents/skills/impeccable/reference/typography.md +0 -159
  144. package/.agents/skills/impeccable/reference/ux-writing.md +0 -107
  145. package/.agents/skills/impeccable/scripts/cleanup-deprecated.mjs +0 -284
  146. package/.agents/skills/impeccable/scripts/command-metadata.json +0 -94
  147. package/.agents/skills/impeccable/scripts/design-parser.mjs +0 -820
  148. package/.agents/skills/impeccable/scripts/detect-csp.mjs +0 -198
  149. package/.agents/skills/impeccable/scripts/is-generated.mjs +0 -69
  150. package/.agents/skills/impeccable/scripts/live-accept.mjs +0 -595
  151. package/.agents/skills/impeccable/scripts/live-browser.js +0 -4781
  152. package/.agents/skills/impeccable/scripts/live-inject.mjs +0 -445
  153. package/.agents/skills/impeccable/scripts/live-poll.mjs +0 -186
  154. package/.agents/skills/impeccable/scripts/live-server.mjs +0 -694
  155. package/.agents/skills/impeccable/scripts/live-wrap.mjs +0 -571
  156. package/.agents/skills/impeccable/scripts/live.mjs +0 -247
  157. package/.agents/skills/impeccable/scripts/load-context.mjs +0 -141
  158. package/.agents/skills/impeccable/scripts/modern-screenshot.umd.js +0 -14
  159. package/.agents/skills/impeccable/scripts/pin.mjs +0 -214
  160. package/.agents/skills/init/SKILL.md +0 -140
  161. package/.agents/skills/liteparse/SKILL.md +0 -223
  162. package/.agents/skills/memory-systems/SKILL.md +0 -221
  163. package/.agents/skills/memory-systems/references/implementation.md +0 -551
  164. package/.agents/skills/memory-systems/scripts/memory_store.py +0 -616
  165. package/.agents/skills/multi-agent-patterns/SKILL.md +0 -259
  166. package/.agents/skills/multi-agent-patterns/references/frameworks.md +0 -433
  167. package/.agents/skills/multi-agent-patterns/scripts/coordination.py +0 -613
  168. package/.agents/skills/opentui/SKILL.md +0 -202
  169. package/.agents/skills/opentui/references/animation/REFERENCE.md +0 -431
  170. package/.agents/skills/opentui/references/components/REFERENCE.md +0 -144
  171. package/.agents/skills/opentui/references/components/code-diff.md +0 -672
  172. package/.agents/skills/opentui/references/components/containers.md +0 -417
  173. package/.agents/skills/opentui/references/components/inputs.md +0 -531
  174. package/.agents/skills/opentui/references/components/text-display.md +0 -386
  175. package/.agents/skills/opentui/references/core/REFERENCE.md +0 -145
  176. package/.agents/skills/opentui/references/core/api.md +0 -543
  177. package/.agents/skills/opentui/references/core/configuration.md +0 -168
  178. package/.agents/skills/opentui/references/core/gotchas.md +0 -393
  179. package/.agents/skills/opentui/references/core/patterns.md +0 -449
  180. package/.agents/skills/opentui/references/keyboard/REFERENCE.md +0 -617
  181. package/.agents/skills/opentui/references/layout/REFERENCE.md +0 -337
  182. package/.agents/skills/opentui/references/layout/patterns.md +0 -444
  183. package/.agents/skills/opentui/references/react/REFERENCE.md +0 -174
  184. package/.agents/skills/opentui/references/react/api.md +0 -436
  185. package/.agents/skills/opentui/references/react/configuration.md +0 -302
  186. package/.agents/skills/opentui/references/react/gotchas.md +0 -443
  187. package/.agents/skills/opentui/references/react/patterns.md +0 -501
  188. package/.agents/skills/opentui/references/solid/REFERENCE.md +0 -201
  189. package/.agents/skills/opentui/references/solid/api.md +0 -564
  190. package/.agents/skills/opentui/references/solid/configuration.md +0 -316
  191. package/.agents/skills/opentui/references/solid/gotchas.md +0 -427
  192. package/.agents/skills/opentui/references/solid/patterns.md +0 -560
  193. package/.agents/skills/opentui/references/testing/REFERENCE.md +0 -614
  194. package/.agents/skills/pdf/LICENSE.txt +0 -30
  195. package/.agents/skills/pdf/SKILL.md +0 -316
  196. package/.agents/skills/pdf/forms.md +0 -294
  197. package/.agents/skills/pdf/reference.md +0 -612
  198. package/.agents/skills/pdf/scripts/check_bounding_boxes.py +0 -65
  199. package/.agents/skills/pdf/scripts/check_fillable_fields.py +0 -11
  200. package/.agents/skills/pdf/scripts/convert_pdf_to_images.py +0 -33
  201. package/.agents/skills/pdf/scripts/create_validation_image.py +0 -37
  202. package/.agents/skills/pdf/scripts/extract_form_field_info.py +0 -122
  203. package/.agents/skills/pdf/scripts/extract_form_structure.py +0 -115
  204. package/.agents/skills/pdf/scripts/fill_fillable_fields.py +0 -98
  205. package/.agents/skills/pdf/scripts/fill_pdf_form_with_annotations.py +0 -107
  206. package/.agents/skills/playwright-cli/SKILL.md +0 -390
  207. package/.agents/skills/playwright-cli/references/element-attributes.md +0 -23
  208. package/.agents/skills/playwright-cli/references/playwright-tests.md +0 -39
  209. package/.agents/skills/playwright-cli/references/request-mocking.md +0 -87
  210. package/.agents/skills/playwright-cli/references/running-code.md +0 -241
  211. package/.agents/skills/playwright-cli/references/session-management.md +0 -225
  212. package/.agents/skills/playwright-cli/references/spec-driven-testing.md +0 -305
  213. package/.agents/skills/playwright-cli/references/storage-state.md +0 -275
  214. package/.agents/skills/playwright-cli/references/test-generation.md +0 -134
  215. package/.agents/skills/playwright-cli/references/tracing.md +0 -139
  216. package/.agents/skills/playwright-cli/references/video-recording.md +0 -143
  217. package/.agents/skills/pptx/LICENSE.txt +0 -30
  218. package/.agents/skills/pptx/SKILL.md +0 -234
  219. package/.agents/skills/pptx/editing.md +0 -205
  220. package/.agents/skills/pptx/pptxgenjs.md +0 -420
  221. package/.agents/skills/pptx/scripts/__init__.py +0 -0
  222. package/.agents/skills/pptx/scripts/add_slide.py +0 -195
  223. package/.agents/skills/pptx/scripts/clean.py +0 -286
  224. package/.agents/skills/pptx/scripts/office/helpers/__init__.py +0 -0
  225. package/.agents/skills/pptx/scripts/office/helpers/merge_runs.py +0 -199
  226. package/.agents/skills/pptx/scripts/office/helpers/simplify_redlines.py +0 -197
  227. package/.agents/skills/pptx/scripts/office/pack.py +0 -159
  228. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +0 -1499
  229. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +0 -146
  230. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +0 -1085
  231. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +0 -11
  232. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +0 -3081
  233. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +0 -23
  234. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +0 -185
  235. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +0 -287
  236. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +0 -1676
  237. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +0 -28
  238. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +0 -144
  239. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +0 -174
  240. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +0 -25
  241. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +0 -18
  242. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +0 -59
  243. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +0 -56
  244. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +0 -195
  245. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +0 -582
  246. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +0 -25
  247. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +0 -4439
  248. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +0 -570
  249. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +0 -509
  250. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +0 -12
  251. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +0 -108
  252. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +0 -96
  253. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +0 -3646
  254. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +0 -116
  255. package/.agents/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +0 -42
  256. package/.agents/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +0 -50
  257. package/.agents/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +0 -49
  258. package/.agents/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +0 -33
  259. package/.agents/skills/pptx/scripts/office/schemas/mce/mc.xsd +0 -75
  260. package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-2010.xsd +0 -560
  261. package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-2012.xsd +0 -67
  262. package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-2018.xsd +0 -14
  263. package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +0 -20
  264. package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +0 -13
  265. package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +0 -4
  266. package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +0 -8
  267. package/.agents/skills/pptx/scripts/office/soffice.py +0 -183
  268. package/.agents/skills/pptx/scripts/office/unpack.py +0 -132
  269. package/.agents/skills/pptx/scripts/office/validate.py +0 -111
  270. package/.agents/skills/pptx/scripts/office/validators/__init__.py +0 -15
  271. package/.agents/skills/pptx/scripts/office/validators/base.py +0 -847
  272. package/.agents/skills/pptx/scripts/office/validators/docx.py +0 -446
  273. package/.agents/skills/pptx/scripts/office/validators/pptx.py +0 -275
  274. package/.agents/skills/pptx/scripts/office/validators/redlining.py +0 -247
  275. package/.agents/skills/pptx/scripts/thumbnail.py +0 -289
  276. package/.agents/skills/project-development/SKILL.md +0 -293
  277. package/.agents/skills/project-development/references/case-studies.md +0 -388
  278. package/.agents/skills/project-development/references/pipeline-patterns.md +0 -610
  279. package/.agents/skills/project-development/scripts/pipeline_template.py +0 -796
  280. package/.agents/skills/prompt-engineer/SKILL.md +0 -265
  281. package/.agents/skills/prompt-engineer/references/advanced_patterns.md +0 -271
  282. package/.agents/skills/prompt-engineer/references/core_prompting.md +0 -137
  283. package/.agents/skills/prompt-engineer/references/quality_improvement.md +0 -193
  284. package/.agents/skills/research-codebase/SKILL.md +0 -229
  285. package/.agents/skills/ripgrep/SKILL.md +0 -384
  286. package/.agents/skills/skill-creator/LICENSE.txt +0 -202
  287. package/.agents/skills/skill-creator/SKILL.md +0 -487
  288. package/.agents/skills/skill-creator/agents/analyzer.md +0 -274
  289. package/.agents/skills/skill-creator/agents/comparator.md +0 -202
  290. package/.agents/skills/skill-creator/agents/grader.md +0 -223
  291. package/.agents/skills/skill-creator/assets/eval_review.html +0 -146
  292. package/.agents/skills/skill-creator/eval-viewer/generate_review.py +0 -471
  293. package/.agents/skills/skill-creator/eval-viewer/viewer.html +0 -1325
  294. package/.agents/skills/skill-creator/references/schemas.md +0 -430
  295. package/.agents/skills/skill-creator/scripts/__init__.py +0 -0
  296. package/.agents/skills/skill-creator/scripts/aggregate_benchmark.py +0 -401
  297. package/.agents/skills/skill-creator/scripts/generate_report.py +0 -326
  298. package/.agents/skills/skill-creator/scripts/improve_description.py +0 -247
  299. package/.agents/skills/skill-creator/scripts/package_skill.py +0 -136
  300. package/.agents/skills/skill-creator/scripts/quick_validate.py +0 -103
  301. package/.agents/skills/skill-creator/scripts/run_eval.py +0 -310
  302. package/.agents/skills/skill-creator/scripts/run_loop.py +0 -328
  303. package/.agents/skills/skill-creator/scripts/utils.py +0 -47
  304. package/.agents/skills/sl-commit/SKILL.md +0 -53
  305. package/.agents/skills/sl-submit-diff/SKILL.md +0 -57
  306. package/.agents/skills/tdd/SKILL.md +0 -111
  307. package/.agents/skills/tdd/deep-modules.md +0 -33
  308. package/.agents/skills/tdd/interface-design.md +0 -31
  309. package/.agents/skills/tdd/mocking.md +0 -59
  310. package/.agents/skills/tdd/refactoring.md +0 -10
  311. package/.agents/skills/tdd/tests.md +0 -61
  312. package/.agents/skills/tool-design/SKILL.md +0 -273
  313. package/.agents/skills/tool-design/references/architectural_reduction.md +0 -210
  314. package/.agents/skills/tool-design/references/best_practices.md +0 -176
  315. package/.agents/skills/tool-design/scripts/description_generator.py +0 -528
  316. package/.agents/skills/typescript-advanced-types/SKILL.md +0 -720
  317. package/.agents/skills/typescript-expert/SKILL.md +0 -434
  318. package/.agents/skills/typescript-expert/references/tsconfig-strict.json +0 -92
  319. package/.agents/skills/typescript-expert/references/typescript-cheatsheet.md +0 -383
  320. package/.agents/skills/typescript-expert/references/utility-types.ts +0 -335
  321. package/.agents/skills/typescript-expert/scripts/ts_diagnostic.py +0 -203
  322. package/.agents/skills/typescript-react-reviewer/SKILL.md +0 -201
  323. package/.agents/skills/typescript-react-reviewer/references/antipatterns.md +0 -510
  324. package/.agents/skills/typescript-react-reviewer/references/checklist.md +0 -267
  325. package/.agents/skills/typescript-react-reviewer/references/react19-patterns.md +0 -305
  326. package/.agents/skills/workflow-creator/SKILL.md +0 -553
  327. package/.agents/skills/workflow-creator/references/agent-sessions.md +0 -891
  328. package/.agents/skills/workflow-creator/references/agent-setup-recipe.md +0 -266
  329. package/.agents/skills/workflow-creator/references/computation-and-validation.md +0 -201
  330. package/.agents/skills/workflow-creator/references/control-flow.md +0 -470
  331. package/.agents/skills/workflow-creator/references/failure-modes.md +0 -1014
  332. package/.agents/skills/workflow-creator/references/getting-started.md +0 -392
  333. package/.agents/skills/workflow-creator/references/registry-and-validation.md +0 -141
  334. package/.agents/skills/workflow-creator/references/running-workflows.md +0 -418
  335. package/.agents/skills/workflow-creator/references/session-config.md +0 -431
  336. package/.agents/skills/workflow-creator/references/state-and-data-flow.md +0 -356
  337. package/.agents/skills/workflow-creator/references/user-input.md +0 -234
  338. package/.agents/skills/workflow-creator/references/workflow-inputs.md +0 -392
  339. package/.agents/skills/xlsx/LICENSE.txt +0 -30
  340. package/.agents/skills/xlsx/SKILL.md +0 -294
  341. package/.agents/skills/xlsx/scripts/office/helpers/__init__.py +0 -0
  342. package/.agents/skills/xlsx/scripts/office/helpers/merge_runs.py +0 -199
  343. package/.agents/skills/xlsx/scripts/office/helpers/simplify_redlines.py +0 -197
  344. package/.agents/skills/xlsx/scripts/office/pack.py +0 -159
  345. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +0 -1499
  346. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +0 -146
  347. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +0 -1085
  348. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +0 -11
  349. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +0 -3081
  350. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +0 -23
  351. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +0 -185
  352. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +0 -287
  353. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +0 -1676
  354. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +0 -28
  355. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +0 -144
  356. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +0 -174
  357. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +0 -25
  358. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +0 -18
  359. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +0 -59
  360. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +0 -56
  361. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +0 -195
  362. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +0 -582
  363. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +0 -25
  364. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +0 -4439
  365. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +0 -570
  366. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +0 -509
  367. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +0 -12
  368. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +0 -108
  369. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +0 -96
  370. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +0 -3646
  371. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +0 -116
  372. package/.agents/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +0 -42
  373. package/.agents/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +0 -50
  374. package/.agents/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +0 -49
  375. package/.agents/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +0 -33
  376. package/.agents/skills/xlsx/scripts/office/schemas/mce/mc.xsd +0 -75
  377. package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-2010.xsd +0 -560
  378. package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-2012.xsd +0 -67
  379. package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-2018.xsd +0 -14
  380. package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +0 -20
  381. package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +0 -13
  382. package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +0 -4
  383. package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +0 -8
  384. package/.agents/skills/xlsx/scripts/office/soffice.py +0 -183
  385. package/.agents/skills/xlsx/scripts/office/unpack.py +0 -132
  386. package/.agents/skills/xlsx/scripts/office/validate.py +0 -111
  387. package/.agents/skills/xlsx/scripts/office/validators/__init__.py +0 -15
  388. package/.agents/skills/xlsx/scripts/office/validators/base.py +0 -847
  389. package/.agents/skills/xlsx/scripts/office/validators/docx.py +0 -446
  390. package/.agents/skills/xlsx/scripts/office/validators/pptx.py +0 -275
  391. package/.agents/skills/xlsx/scripts/office/validators/redlining.py +0 -247
  392. package/.agents/skills/xlsx/scripts/recalc.py +0 -184
  393. package/.claude/agents/code-simplifier.md +0 -52
  394. package/.claude/agents/codebase-analyzer.md +0 -166
  395. package/.claude/agents/codebase-locator.md +0 -122
  396. package/.claude/agents/codebase-online-researcher.md +0 -148
  397. package/.claude/agents/codebase-pattern-finder.md +0 -247
  398. package/.claude/agents/codebase-research-analyzer.md +0 -179
  399. package/.claude/agents/codebase-research-locator.md +0 -145
  400. package/.claude/agents/debugger.md +0 -91
  401. package/.claude/agents/orchestrator.md +0 -19
  402. package/.claude/agents/planner.md +0 -295
  403. package/.claude/agents/reviewer.md +0 -98
  404. package/.claude/agents/worker.md +0 -165
  405. package/.claude/settings.json +0 -27
  406. package/.github/agents/code-simplifier.md +0 -52
  407. package/.github/agents/codebase-analyzer.md +0 -166
  408. package/.github/agents/codebase-locator.md +0 -122
  409. package/.github/agents/codebase-online-researcher.md +0 -146
  410. package/.github/agents/codebase-pattern-finder.md +0 -247
  411. package/.github/agents/codebase-research-analyzer.md +0 -179
  412. package/.github/agents/codebase-research-locator.md +0 -145
  413. package/.github/agents/debugger.md +0 -98
  414. package/.github/agents/orchestrator.md +0 -27
  415. package/.github/agents/planner.md +0 -305
  416. package/.github/agents/reviewer.md +0 -95
  417. package/.github/agents/worker.md +0 -237
  418. package/.github/lsp.json +0 -93
  419. package/.mcp.json +0 -20
  420. package/.opencode/agents/code-simplifier.md +0 -62
  421. package/.opencode/agents/codebase-analyzer.md +0 -171
  422. package/.opencode/agents/codebase-locator.md +0 -127
  423. package/.opencode/agents/codebase-online-researcher.md +0 -152
  424. package/.opencode/agents/codebase-pattern-finder.md +0 -252
  425. package/.opencode/agents/codebase-research-analyzer.md +0 -183
  426. package/.opencode/agents/codebase-research-locator.md +0 -149
  427. package/.opencode/agents/debugger.md +0 -99
  428. package/.opencode/agents/orchestrator.md +0 -27
  429. package/.opencode/agents/planner.md +0 -309
  430. package/.opencode/agents/reviewer.md +0 -103
  431. package/.opencode/agents/worker.md +0 -165
  432. package/.opencode/opencode.json +0 -25
  433. package/README.md +0 -1624
  434. package/assets/settings.schema.json +0 -51
  435. package/dist/commands/cli/claude-inflight-hook.d.ts +0 -100
  436. package/dist/commands/cli/claude-inflight-hook.d.ts.map +0 -1
  437. package/dist/commands/cli/claude-stop-hook.d.ts +0 -80
  438. package/dist/commands/cli/claude-stop-hook.d.ts.map +0 -1
  439. package/dist/lib/atomic-temp.d.ts +0 -8
  440. package/dist/lib/atomic-temp.d.ts.map +0 -1
  441. package/dist/lib/path-root-guard.d.ts +0 -4
  442. package/dist/lib/path-root-guard.d.ts.map +0 -1
  443. package/dist/lib/spawn.d.ts +0 -102
  444. package/dist/lib/spawn.d.ts.map +0 -1
  445. package/dist/lib/terminal-env.d.ts +0 -9
  446. package/dist/lib/terminal-env.d.ts.map +0 -1
  447. package/dist/sdk/components/attached-statusline.d.ts +0 -26
  448. package/dist/sdk/components/attached-statusline.d.ts.map +0 -1
  449. package/dist/sdk/components/color-utils.d.ts +0 -4
  450. package/dist/sdk/components/color-utils.d.ts.map +0 -1
  451. package/dist/sdk/components/compact-switcher.d.ts +0 -10
  452. package/dist/sdk/components/compact-switcher.d.ts.map +0 -1
  453. package/dist/sdk/components/connectors.d.ts +0 -16
  454. package/dist/sdk/components/connectors.d.ts.map +0 -1
  455. package/dist/sdk/components/edge.d.ts +0 -4
  456. package/dist/sdk/components/edge.d.ts.map +0 -1
  457. package/dist/sdk/components/error-boundary.d.ts +0 -23
  458. package/dist/sdk/components/error-boundary.d.ts.map +0 -1
  459. package/dist/sdk/components/graph-theme.d.ts +0 -18
  460. package/dist/sdk/components/graph-theme.d.ts.map +0 -1
  461. package/dist/sdk/components/header.d.ts +0 -3
  462. package/dist/sdk/components/header.d.ts.map +0 -1
  463. package/dist/sdk/components/hooks.d.ts +0 -15
  464. package/dist/sdk/components/hooks.d.ts.map +0 -1
  465. package/dist/sdk/components/layout.d.ts +0 -27
  466. package/dist/sdk/components/layout.d.ts.map +0 -1
  467. package/dist/sdk/components/node-card.d.ts +0 -10
  468. package/dist/sdk/components/node-card.d.ts.map +0 -1
  469. package/dist/sdk/components/orchestrator-panel-contexts.d.ts +0 -16
  470. package/dist/sdk/components/orchestrator-panel-contexts.d.ts.map +0 -1
  471. package/dist/sdk/components/orchestrator-panel-store.d.ts +0 -52
  472. package/dist/sdk/components/orchestrator-panel-store.d.ts.map +0 -1
  473. package/dist/sdk/components/orchestrator-panel-types.d.ts +0 -18
  474. package/dist/sdk/components/orchestrator-panel-types.d.ts.map +0 -1
  475. package/dist/sdk/components/orchestrator-panel.d.ts +0 -86
  476. package/dist/sdk/components/orchestrator-panel.d.ts.map +0 -1
  477. package/dist/sdk/components/renderer-background.d.ts +0 -9
  478. package/dist/sdk/components/renderer-background.d.ts.map +0 -1
  479. package/dist/sdk/components/session-graph-panel.d.ts +0 -7
  480. package/dist/sdk/components/session-graph-panel.d.ts.map +0 -1
  481. package/dist/sdk/components/status-helpers.d.ts +0 -6
  482. package/dist/sdk/components/status-helpers.d.ts.map +0 -1
  483. package/dist/sdk/components/statusline.d.ts +0 -5
  484. package/dist/sdk/components/statusline.d.ts.map +0 -1
  485. package/dist/sdk/components/tui-diagnostics.d.ts +0 -56
  486. package/dist/sdk/components/tui-diagnostics.d.ts.map +0 -1
  487. package/dist/sdk/components/workflow-picker-panel.d.ts +0 -126
  488. package/dist/sdk/components/workflow-picker-panel.d.ts.map +0 -1
  489. package/dist/sdk/define-workflow.d.ts +0 -107
  490. package/dist/sdk/define-workflow.d.ts.map +0 -1
  491. package/dist/sdk/errors.d.ts +0 -46
  492. package/dist/sdk/errors.d.ts.map +0 -1
  493. package/dist/sdk/index.d.ts +0 -26
  494. package/dist/sdk/index.d.ts.map +0 -1
  495. package/dist/sdk/primitives/inputs.d.ts +0 -36
  496. package/dist/sdk/primitives/inputs.d.ts.map +0 -1
  497. package/dist/sdk/primitives/metadata.d.ts +0 -40
  498. package/dist/sdk/primitives/metadata.d.ts.map +0 -1
  499. package/dist/sdk/primitives/run.d.ts +0 -57
  500. package/dist/sdk/primitives/run.d.ts.map +0 -1
  501. package/dist/sdk/primitives/sessions.d.ts +0 -128
  502. package/dist/sdk/primitives/sessions.d.ts.map +0 -1
  503. package/dist/sdk/providers/claude.d.ts +0 -392
  504. package/dist/sdk/providers/claude.d.ts.map +0 -1
  505. package/dist/sdk/providers/copilot.d.ts +0 -55
  506. package/dist/sdk/providers/copilot.d.ts.map +0 -1
  507. package/dist/sdk/providers/opencode.d.ts +0 -27
  508. package/dist/sdk/providers/opencode.d.ts.map +0 -1
  509. package/dist/sdk/registry.d.ts +0 -27
  510. package/dist/sdk/registry.d.ts.map +0 -1
  511. package/dist/sdk/runtime/attached-footer.d.ts +0 -31
  512. package/dist/sdk/runtime/attached-footer.d.ts.map +0 -1
  513. package/dist/sdk/runtime/cc-debounce.d.ts +0 -29
  514. package/dist/sdk/runtime/cc-debounce.d.ts.map +0 -1
  515. package/dist/sdk/runtime/executor-env.d.ts +0 -20
  516. package/dist/sdk/runtime/executor-env.d.ts.map +0 -1
  517. package/dist/sdk/runtime/executor.d.ts +0 -265
  518. package/dist/sdk/runtime/executor.d.ts.map +0 -1
  519. package/dist/sdk/runtime/graph-inference.d.ts +0 -35
  520. package/dist/sdk/runtime/graph-inference.d.ts.map +0 -1
  521. package/dist/sdk/runtime/orchestrator-entry.d.ts +0 -26
  522. package/dist/sdk/runtime/orchestrator-entry.d.ts.map +0 -1
  523. package/dist/sdk/runtime/panel.d.ts +0 -9
  524. package/dist/sdk/runtime/panel.d.ts.map +0 -1
  525. package/dist/sdk/runtime/port-discovery.d.ts +0 -71
  526. package/dist/sdk/runtime/port-discovery.d.ts.map +0 -1
  527. package/dist/sdk/runtime/status-writer.d.ts +0 -101
  528. package/dist/sdk/runtime/status-writer.d.ts.map +0 -1
  529. package/dist/sdk/runtime/theme.d.ts +0 -33
  530. package/dist/sdk/runtime/theme.d.ts.map +0 -1
  531. package/dist/sdk/runtime/tmux.d.ts +0 -307
  532. package/dist/sdk/runtime/tmux.d.ts.map +0 -1
  533. package/dist/sdk/runtime/version-compat.d.ts +0 -28
  534. package/dist/sdk/runtime/version-compat.d.ts.map +0 -1
  535. package/dist/sdk/types.d.ts +0 -435
  536. package/dist/sdk/types.d.ts.map +0 -1
  537. package/dist/sdk/worker-shared.d.ts +0 -42
  538. package/dist/sdk/worker-shared.d.ts.map +0 -1
  539. package/dist/sdk/workflows/builtin/deep-research-codebase/claude/index.d.ts +0 -81
  540. package/dist/sdk/workflows/builtin/deep-research-codebase/claude/index.d.ts.map +0 -1
  541. package/dist/sdk/workflows/builtin/deep-research-codebase/copilot/index.d.ts +0 -37
  542. package/dist/sdk/workflows/builtin/deep-research-codebase/copilot/index.d.ts.map +0 -1
  543. package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/batching.d.ts +0 -43
  544. package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/batching.d.ts.map +0 -1
  545. package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/heuristic.d.ts +0 -14
  546. package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/heuristic.d.ts.map +0 -1
  547. package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/prompts.d.ts +0 -136
  548. package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/prompts.d.ts.map +0 -1
  549. package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/scout.d.ts +0 -58
  550. package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/scout.d.ts.map +0 -1
  551. package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/scratch.d.ts +0 -43
  552. package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/scratch.d.ts.map +0 -1
  553. package/dist/sdk/workflows/builtin/deep-research-codebase/opencode/index.d.ts +0 -37
  554. package/dist/sdk/workflows/builtin/deep-research-codebase/opencode/index.d.ts.map +0 -1
  555. package/dist/sdk/workflows/builtin/open-claude-design/claude/index.d.ts +0 -68
  556. package/dist/sdk/workflows/builtin/open-claude-design/claude/index.d.ts.map +0 -1
  557. package/dist/sdk/workflows/builtin/open-claude-design/copilot/index.d.ts +0 -56
  558. package/dist/sdk/workflows/builtin/open-claude-design/copilot/index.d.ts.map +0 -1
  559. package/dist/sdk/workflows/builtin/open-claude-design/helpers/constants.d.ts +0 -72
  560. package/dist/sdk/workflows/builtin/open-claude-design/helpers/constants.d.ts.map +0 -1
  561. package/dist/sdk/workflows/builtin/open-claude-design/helpers/design-system.d.ts +0 -46
  562. package/dist/sdk/workflows/builtin/open-claude-design/helpers/design-system.d.ts.map +0 -1
  563. package/dist/sdk/workflows/builtin/open-claude-design/helpers/export.d.ts +0 -32
  564. package/dist/sdk/workflows/builtin/open-claude-design/helpers/export.d.ts.map +0 -1
  565. package/dist/sdk/workflows/builtin/open-claude-design/helpers/import.d.ts +0 -33
  566. package/dist/sdk/workflows/builtin/open-claude-design/helpers/import.d.ts.map +0 -1
  567. package/dist/sdk/workflows/builtin/open-claude-design/helpers/prompts.d.ts +0 -106
  568. package/dist/sdk/workflows/builtin/open-claude-design/helpers/prompts.d.ts.map +0 -1
  569. package/dist/sdk/workflows/builtin/open-claude-design/helpers/scan.d.ts +0 -50
  570. package/dist/sdk/workflows/builtin/open-claude-design/helpers/scan.d.ts.map +0 -1
  571. package/dist/sdk/workflows/builtin/open-claude-design/helpers/validation.d.ts +0 -12
  572. package/dist/sdk/workflows/builtin/open-claude-design/helpers/validation.d.ts.map +0 -1
  573. package/dist/sdk/workflows/builtin/open-claude-design/opencode/index.d.ts +0 -58
  574. package/dist/sdk/workflows/builtin/open-claude-design/opencode/index.d.ts.map +0 -1
  575. package/dist/sdk/workflows/builtin/ralph/claude/index.d.ts +0 -37
  576. package/dist/sdk/workflows/builtin/ralph/claude/index.d.ts.map +0 -1
  577. package/dist/sdk/workflows/builtin/ralph/copilot/index.d.ts +0 -34
  578. package/dist/sdk/workflows/builtin/ralph/copilot/index.d.ts.map +0 -1
  579. package/dist/sdk/workflows/builtin/ralph/helpers/copilot-reviewer.d.ts +0 -25
  580. package/dist/sdk/workflows/builtin/ralph/helpers/copilot-reviewer.d.ts.map +0 -1
  581. package/dist/sdk/workflows/builtin/ralph/helpers/git.d.ts +0 -69
  582. package/dist/sdk/workflows/builtin/ralph/helpers/git.d.ts.map +0 -1
  583. package/dist/sdk/workflows/builtin/ralph/helpers/prompts.d.ts +0 -266
  584. package/dist/sdk/workflows/builtin/ralph/helpers/prompts.d.ts.map +0 -1
  585. package/dist/sdk/workflows/builtin/ralph/helpers/review.d.ts +0 -24
  586. package/dist/sdk/workflows/builtin/ralph/helpers/review.d.ts.map +0 -1
  587. package/dist/sdk/workflows/builtin/ralph/opencode/index.d.ts +0 -33
  588. package/dist/sdk/workflows/builtin/ralph/opencode/index.d.ts.map +0 -1
  589. package/dist/sdk/workflows/index.d.ts +0 -32
  590. package/dist/sdk/workflows/index.d.ts.map +0 -1
  591. package/dist/services/config/additional-instructions.d.ts +0 -67
  592. package/dist/services/config/additional-instructions.d.ts.map +0 -1
  593. package/dist/services/config/atomic-config.d.ts +0 -42
  594. package/dist/services/config/atomic-config.d.ts.map +0 -1
  595. package/dist/services/config/definitions.d.ts +0 -52
  596. package/dist/services/config/definitions.d.ts.map +0 -1
  597. package/dist/services/config/index.d.ts +0 -7
  598. package/dist/services/config/index.d.ts.map +0 -1
  599. package/dist/services/config/scm-sync.d.ts +0 -37
  600. package/dist/services/config/scm-sync.d.ts.map +0 -1
  601. package/dist/services/config/settings-schema.d.ts +0 -2
  602. package/dist/services/config/settings-schema.d.ts.map +0 -1
  603. package/dist/services/system/copy.d.ts +0 -84
  604. package/dist/services/system/copy.d.ts.map +0 -1
  605. package/dist/services/system/detect.d.ts +0 -75
  606. package/dist/services/system/detect.d.ts.map +0 -1
  607. package/dist/theme/colors.d.ts +0 -35
  608. package/dist/theme/colors.d.ts.map +0 -1
  609. package/src/cli.ts +0 -397
  610. package/src/commands/builtin-registry.ts +0 -37
  611. package/src/commands/cli/chat/index.test.ts +0 -252
  612. package/src/commands/cli/chat/index.ts +0 -430
  613. package/src/commands/cli/chat.ts +0 -8
  614. package/src/commands/cli/claude-ask-hook.test.ts +0 -128
  615. package/src/commands/cli/claude-ask-hook.ts +0 -84
  616. package/src/commands/cli/claude-inflight-hook.test.ts +0 -598
  617. package/src/commands/cli/claude-inflight-hook.ts +0 -359
  618. package/src/commands/cli/claude-session-start-hook.ts +0 -61
  619. package/src/commands/cli/claude-stop-hook.test.ts +0 -317
  620. package/src/commands/cli/claude-stop-hook.ts +0 -441
  621. package/src/commands/cli/completions.ts +0 -24
  622. package/src/commands/cli/config.ts +0 -80
  623. package/src/commands/cli/footer.tsx +0 -248
  624. package/src/commands/cli/init/index.ts +0 -41
  625. package/src/commands/cli/init/onboarding.ts +0 -61
  626. package/src/commands/cli/init.ts +0 -8
  627. package/src/commands/cli/management-commands.ts +0 -112
  628. package/src/commands/cli/session.test.ts +0 -830
  629. package/src/commands/cli/session.ts +0 -447
  630. package/src/commands/cli/workflow-command.test.ts +0 -618
  631. package/src/commands/cli/workflow-inputs.test.ts +0 -353
  632. package/src/commands/cli/workflow-inputs.ts +0 -266
  633. package/src/commands/cli/workflow-list.test.ts +0 -235
  634. package/src/commands/cli/workflow-list.ts +0 -0
  635. package/src/commands/cli/workflow-status.test.ts +0 -451
  636. package/src/commands/cli/workflow-status.ts +0 -330
  637. package/src/commands/cli/workflow.ts +0 -196
  638. package/src/completions/bash.ts +0 -102
  639. package/src/completions/fish.ts +0 -136
  640. package/src/completions/index.ts +0 -7
  641. package/src/completions/powershell.ts +0 -195
  642. package/src/completions/zsh.ts +0 -150
  643. package/src/lib/atomic-temp.test.ts +0 -86
  644. package/src/lib/atomic-temp.ts +0 -62
  645. package/src/lib/common-ignore.ts +0 -46
  646. package/src/lib/merge.ts +0 -103
  647. package/src/lib/path-root-guard.ts +0 -38
  648. package/src/lib/spawn.test.ts +0 -109
  649. package/src/lib/spawn.ts +0 -678
  650. package/src/lib/terminal-env.test.ts +0 -343
  651. package/src/lib/terminal-env.ts +0 -100
  652. package/src/scripts/bump-version.ts +0 -94
  653. package/src/scripts/bundle-configs.ts +0 -116
  654. package/src/scripts/clean-dist.test.ts +0 -53
  655. package/src/scripts/clean-dist.ts +0 -37
  656. package/src/scripts/constants-base.ts +0 -14
  657. package/src/scripts/constants.ts +0 -35
  658. package/src/sdk/components/attached-statusline.tsx +0 -86
  659. package/src/sdk/components/color-utils.ts +0 -20
  660. package/src/sdk/components/compact-switcher.tsx +0 -78
  661. package/src/sdk/components/connectors.test.ts +0 -707
  662. package/src/sdk/components/connectors.ts +0 -160
  663. package/src/sdk/components/edge.tsx +0 -13
  664. package/src/sdk/components/error-boundary.tsx +0 -38
  665. package/src/sdk/components/graph-theme.ts +0 -37
  666. package/src/sdk/components/header.tsx +0 -85
  667. package/src/sdk/components/hooks.ts +0 -21
  668. package/src/sdk/components/layout.test.ts +0 -1245
  669. package/src/sdk/components/layout.ts +0 -223
  670. package/src/sdk/components/node-card.tsx +0 -91
  671. package/src/sdk/components/orchestrator-panel-contexts.ts +0 -35
  672. package/src/sdk/components/orchestrator-panel-store.test.ts +0 -847
  673. package/src/sdk/components/orchestrator-panel-store.ts +0 -187
  674. package/src/sdk/components/orchestrator-panel-types.ts +0 -23
  675. package/src/sdk/components/orchestrator-panel.tsx +0 -262
  676. package/src/sdk/components/renderer-background.ts +0 -49
  677. package/src/sdk/components/session-graph-panel.tsx +0 -471
  678. package/src/sdk/components/status-helpers.ts +0 -33
  679. package/src/sdk/components/statusline.tsx +0 -68
  680. package/src/sdk/components/tui-diagnostics.ts +0 -273
  681. package/src/sdk/components/workflow-picker-panel.tsx +0 -1613
  682. package/src/sdk/define-workflow.test.ts +0 -354
  683. package/src/sdk/define-workflow.ts +0 -275
  684. package/src/sdk/errors.test.ts +0 -83
  685. package/src/sdk/errors.ts +0 -77
  686. package/src/sdk/index.test.ts +0 -92
  687. package/src/sdk/index.ts +0 -101
  688. package/src/sdk/primitives/inputs.ts +0 -48
  689. package/src/sdk/primitives/metadata.ts +0 -63
  690. package/src/sdk/primitives/run.ts +0 -81
  691. package/src/sdk/primitives/sessions.test.ts +0 -594
  692. package/src/sdk/primitives/sessions.ts +0 -328
  693. package/src/sdk/providers/claude.ts +0 -1450
  694. package/src/sdk/providers/copilot.test.ts +0 -365
  695. package/src/sdk/providers/copilot.ts +0 -185
  696. package/src/sdk/providers/headless-hil-policy.test.ts +0 -211
  697. package/src/sdk/providers/opencode.ts +0 -88
  698. package/src/sdk/registry.ts +0 -132
  699. package/src/sdk/runtime/attached-footer.ts +0 -155
  700. package/src/sdk/runtime/cc-debounce.ts +0 -104
  701. package/src/sdk/runtime/executor-env.ts +0 -45
  702. package/src/sdk/runtime/executor.test.ts +0 -1321
  703. package/src/sdk/runtime/executor.ts +0 -2136
  704. package/src/sdk/runtime/graph-inference.ts +0 -50
  705. package/src/sdk/runtime/orchestrator-entry.ts +0 -110
  706. package/src/sdk/runtime/panel.tsx +0 -9
  707. package/src/sdk/runtime/port-discovery.test.ts +0 -573
  708. package/src/sdk/runtime/port-discovery.ts +0 -496
  709. package/src/sdk/runtime/status-writer.test.ts +0 -245
  710. package/src/sdk/runtime/status-writer.ts +0 -201
  711. package/src/sdk/runtime/theme.ts +0 -71
  712. package/src/sdk/runtime/tmux.conf +0 -112
  713. package/src/sdk/runtime/tmux.ts +0 -785
  714. package/src/sdk/runtime/version-compat.ts +0 -68
  715. package/src/sdk/types.ts +0 -548
  716. package/src/sdk/worker-shared.test.ts +0 -163
  717. package/src/sdk/worker-shared.ts +0 -155
  718. package/src/sdk/workflows/builtin/deep-research-codebase/claude/index.ts +0 -569
  719. package/src/sdk/workflows/builtin/deep-research-codebase/copilot/index.ts +0 -481
  720. package/src/sdk/workflows/builtin/deep-research-codebase/helpers/batching.ts +0 -65
  721. package/src/sdk/workflows/builtin/deep-research-codebase/helpers/heuristic.ts +0 -24
  722. package/src/sdk/workflows/builtin/deep-research-codebase/helpers/ignore-by-default.d.ts +0 -8
  723. package/src/sdk/workflows/builtin/deep-research-codebase/helpers/prompts.ts +0 -958
  724. package/src/sdk/workflows/builtin/deep-research-codebase/helpers/scout.ts +0 -505
  725. package/src/sdk/workflows/builtin/deep-research-codebase/helpers/scratch.ts +0 -115
  726. package/src/sdk/workflows/builtin/deep-research-codebase/opencode/index.ts +0 -530
  727. package/src/sdk/workflows/builtin/open-claude-design/claude/index.ts +0 -500
  728. package/src/sdk/workflows/builtin/open-claude-design/copilot/index.ts +0 -508
  729. package/src/sdk/workflows/builtin/open-claude-design/helpers/constants.ts +0 -159
  730. package/src/sdk/workflows/builtin/open-claude-design/helpers/design-system.ts +0 -88
  731. package/src/sdk/workflows/builtin/open-claude-design/helpers/export.ts +0 -193
  732. package/src/sdk/workflows/builtin/open-claude-design/helpers/import.ts +0 -52
  733. package/src/sdk/workflows/builtin/open-claude-design/helpers/prompts.ts +0 -1110
  734. package/src/sdk/workflows/builtin/open-claude-design/helpers/scan.ts +0 -117
  735. package/src/sdk/workflows/builtin/open-claude-design/helpers/validation.ts +0 -38
  736. package/src/sdk/workflows/builtin/open-claude-design/opencode/index.ts +0 -610
  737. package/src/sdk/workflows/builtin/ralph/claude/index.ts +0 -272
  738. package/src/sdk/workflows/builtin/ralph/copilot/index.ts +0 -298
  739. package/src/sdk/workflows/builtin/ralph/helpers/copilot-reviewer.ts +0 -105
  740. package/src/sdk/workflows/builtin/ralph/helpers/git.ts +0 -201
  741. package/src/sdk/workflows/builtin/ralph/helpers/prompts.ts +0 -1108
  742. package/src/sdk/workflows/builtin/ralph/helpers/review.ts +0 -33
  743. package/src/sdk/workflows/builtin/ralph/opencode/index.ts +0 -290
  744. package/src/sdk/workflows/index.ts +0 -116
  745. package/src/services/config/additional-instructions.ts +0 -273
  746. package/src/services/config/atomic-config.ts +0 -210
  747. package/src/services/config/atomic-global-config.ts +0 -348
  748. package/src/services/config/config-path.ts +0 -19
  749. package/src/services/config/definitions.ts +0 -125
  750. package/src/services/config/index.ts +0 -7
  751. package/src/services/config/scm-sync.ts +0 -185
  752. package/src/services/config/settings-schema.ts +0 -2
  753. package/src/services/config/settings.ts +0 -144
  754. package/src/services/system/agents.ts +0 -95
  755. package/src/services/system/auth.test.ts +0 -343
  756. package/src/services/system/auth.ts +0 -140
  757. package/src/services/system/auto-sync.ts +0 -128
  758. package/src/services/system/copy.ts +0 -392
  759. package/src/services/system/detect.ts +0 -161
  760. package/src/services/system/file-lock.ts +0 -289
  761. package/src/services/system/install-ui.ts +0 -296
  762. package/src/services/system/skills.ts +0 -58
  763. package/src/theme/colors.ts +0 -96
  764. package/src/theme/logo.ts +0 -123
  765. package/src/version.ts +0 -7
@@ -1,1014 +0,0 @@
1
- # Failure Modes
2
-
3
- Common, **silent** ways workflows break across Claude Code, Copilot CLI, and
4
- OpenCode — and the wrong-vs-right patterns to avoid them.
5
-
6
- **Read this before you ship a multi-session workflow.** Most failures here
7
- don't throw — they produce degraded output that looks plausible, which is
8
- the hardest kind of bug to catch in review.
9
-
10
- ## When to consult
11
-
12
- - Before writing a planner → orchestrator → reviewer handoff (Copilot / OpenCode)
13
- - When a stage receives context from a prior stage and the output smells off
14
- - When a review/fix loop works on small inputs but drifts on large ones
15
- - When a JSON/markdown parser in a helper stops matching the model's output
16
- - When you cannot explain where a particular sentence in a downstream prompt came from
17
-
18
- ## Silent vs. loud
19
-
20
- | Severity | What happens | Detection |
21
- |---|---|---|
22
- | **Silent** | Wrong output, no exception. Downstream stages consume garbage. | Requires end-to-end observation. Easy to miss in review. |
23
- | **Loud** | Exception thrown, stage aborts. | Stack trace surfaces in logs. |
24
-
25
- Silent failures are catalogued first below. Loud failures are grouped at the end.
26
-
27
- ---
28
-
29
- ## Quick reference
30
-
31
- | # | Failure | Affected | Silent? |
32
- |---|---|---|---|
33
- | [F1](#f1-copilot-getlastassistanttext-returns-empty-string) | Copilot: `getLastAssistantText` returns empty string | Copilot | silent |
34
- | [F2](#f2-copilot-subagent-messages-pollute-getmessages-stream) | Copilot: subagent messages pollute `getMessages()` stream | Copilot | silent |
35
- | [F3](#f3-opencode-result-parts-contain-non-text-parts) | OpenCode: `result.data.parts` contains non-text parts | OpenCode | silent |
36
- | [F4](#f4-claude-ssessionquery-returns-sessionmessage-extract-text-with-extractassistanttext) | Claude: `s.session.query()` returns `SessionMessage[]` — extract text with `extractAssistantText(result, 0)` | Claude | silent |
37
- | [F5](#f5-fresh-session-wipes-prior-stage-context) | Fresh session wipes prior stage context | Copilot, OpenCode | silent |
38
- | [F6](#f6-planner-prompts-that-dont-request-trailing-commentary-produce-empty-handoffs) | Planner prompts that don't request trailing commentary produce empty handoffs | all | silent |
39
- | [F7](#f7-continued-sessions-accumulate-state-across-loop-iterations) | Continued sessions accumulate state across loop iterations (lost-in-middle) | all | silent |
40
- | [F8](#f8-fenced-block-parsers-break-when-the-model-adds-prose) | Fenced-block parsers break when the model adds prose before/after | all | silent |
41
- | [F9](#f9-ssave-receives-the-wrong-shape) | `s.save()` receives the wrong shape for the SDK | all | silent |
42
- | [F10](#f10-copilot-sendandwait-default-60s-timeout-throws) | Copilot: `sendAndWait` default 60s timeout throws (use `send` by default) | Copilot | loud |
43
- | [F11](#f11-provider-level-resume-tries-to-swap-agents) | Provider-level resume tries to swap agents | Copilot, OpenCode | loud |
44
- | [F12](#f12-parallel-siblings-read-each-others-transcripts) | Parallel siblings read each other's transcripts | all | loud |
45
- | [F13](#f13-forgetting-to-await-ctxstage) | Forgetting to `await` `ctx.stage()` | all | silent |
46
- | [F14](#f14-using-a-pending-sessionhandle-before-completion) | Using a pending `SessionHandle` before completion | all | silent |
47
- | [F15](#f15-headless-stage-errors-are-invisible-in-the-graph) | Headless stage errors are invisible in the graph | all | silent |
48
- | [F16](#f16-claude-importing-sdk-query-inside-a-non-headless-stage) | Claude: importing the SDK `query()` inside a non-headless stage (anti-pattern) | Claude | silent |
49
- | [F17](#f17-duplicate-registration-throws-at-composition-root) | Duplicate registration throws at composition root | all | loud |
50
- | [F22](#f22-ctxstage-with-no-llm-query-spawns-an-empty-idle-pane) | `ctx.stage()` with no LLM query spawns an empty, idle pane | all | silent |
51
-
52
- ---
53
-
54
- ## Silent failures
55
-
56
- ### F1. Copilot: `getLastAssistantText` returns empty string
57
-
58
- **Symptom.** The orchestrator (or any downstream stage) receives an empty
59
- `plannerNotes` / `reviewerOutput` despite the prior agent running successfully
60
- and producing visible output in the TUI.
61
-
62
- **Root cause.** Copilot emits an **empty terminating `assistant.message` event**
63
- after every turn that included a tool call. The actual prose + toolRequests
64
- live in the earlier `assistant.message` event; the trailing one has
65
- `content: ""` and no `toolRequests`. Picking `.at(-1).data.content` reliably
66
- lands on the empty terminator and throws away the real content.
67
-
68
- Verified empirically with a toy script against Copilot CLI 1.0.22: a
69
- single-turn "think then call tool" prompt produced 2 assistant.message
70
- events, `[{length: 512, toolRequests: 1}, {length: 0, toolRequests: 0}]`.
71
- The second one is what `.at(-1)` returns.
72
-
73
- The event type carries both `content: string` and `toolRequests?: [...]` —
74
- see `node_modules/@github/copilot-sdk/dist/generated/session-events.d.ts:1408-1455`.
75
-
76
- This means the bug affects **any** stage whose final turn includes a tool
77
- call — not just tool-calls-only turns. Planner, reviewer, debugger, and
78
- orchestrator stages all hit it if they end on a tool invocation.
79
-
80
- **Affected SDKs.** Copilot only.
81
-
82
- ### ❌ Wrong
83
-
84
- ```ts
85
- function getLastAssistantText(messages: SessionEvent[]): string {
86
- const assistantMessages = messages.filter(
87
- (m): m is Extract<SessionEvent, { type: "assistant.message" }> =>
88
- m.type === "assistant.message",
89
- );
90
- return assistantMessages.at(-1)?.data.content ?? "";
91
- }
92
- ```
93
-
94
- ### ✅ Right
95
-
96
- ```ts
97
- /** Concatenate every top-level assistant turn's non-empty content. */
98
- function getAssistantText(messages: SessionEvent[]): string {
99
- return messages
100
- .filter(
101
- (m): m is Extract<SessionEvent, { type: "assistant.message" }> =>
102
- m.type === "assistant.message" && !m.data.parentToolCallId,
103
- )
104
- .map((m) => m.data.content)
105
- .filter((c) => c.length > 0)
106
- .join("\n\n");
107
- }
108
- ```
109
-
110
- **Detection.** Log the returned text length after every `getAssistantText`
111
- call during development. An empty or surprisingly short string for a stage
112
- that clearly ran is the signature.
113
-
114
- ---
115
-
116
- ### F2. Copilot: subagent messages pollute `getMessages()` stream
117
-
118
- **Symptom.** Downstream stages receive a snippet of text that doesn't match
119
- what the top-level agent said — it looks like a subagent's output.
120
-
121
- **Root cause.** `assistant.message` events carry a `parentToolCallId?: string`
122
- field, documented as *"Tool call ID of the parent tool invocation when this
123
- event originates from a subagent"*. When the top-level agent delegates,
124
- `getMessages()` returns **the complete history including subagent messages**.
125
- Filters that don't exclude `parentToolCallId` can pick a subagent's final
126
- message via `.at(-1)`.
127
-
128
- **Affected SDKs.** Copilot.
129
-
130
- ### ❌ Wrong
131
-
132
- ```ts
133
- messages.filter((m) => m.type === "assistant.message")
134
- ```
135
-
136
- ### ✅ Right
137
-
138
- ```ts
139
- messages.filter(
140
- (m) => m.type === "assistant.message" && !m.data.parentToolCallId,
141
- )
142
- ```
143
-
144
- **Detection.** Same as F1 — diff what you extract against the TUI
145
- scrollback for the top-level agent.
146
-
147
- ---
148
-
149
- ### F3. OpenCode: `result.data.parts` contains non-text parts
150
-
151
- **Symptom.** Concatenated response text contains `[object Object]`,
152
- truncated content, or swallows tool-call payloads into the prompt.
153
-
154
- **Root cause.** `client.session.prompt()` returns `result.data.parts: Part[]`
155
- where parts can be `type: "text" | "tool" | "file" | "reasoning" | ...`.
156
- Naive `.map(p => p.text).join()` emits `undefined` for non-text parts.
157
-
158
- **Affected SDKs.** OpenCode.
159
-
160
- ### ❌ Wrong
161
-
162
- ```ts
163
- const text = result.data!.parts.map((p) => p.text).join("\n");
164
- ```
165
-
166
- ### ✅ Right
167
-
168
- ```ts
169
- function extractResponseText(
170
- parts: Array<{ type: string; [key: string]: unknown }>,
171
- ): string {
172
- return parts
173
- .filter((p) => p.type === "text")
174
- .map((p) => (p as { type: string; text: string }).text)
175
- .join("\n");
176
- }
177
- ```
178
-
179
- **Detection.** Grep extracted text for `[object Object]` or `undefined`.
180
-
181
- ---
182
-
183
- ### F4. Claude: `s.session.query()` returns `SessionMessage[]` — extract text with `extractAssistantText`
184
-
185
- **Symptom.** Workflow code tries to access `.output` or `.text` on the
186
- result of `s.session.query()` and gets `undefined`, or passes the result
187
- directly to a string parser that throws.
188
-
189
- **Root cause.** `s.session.query()` returns `SessionMessage[]` — the native
190
- Claude Agent SDK type. It does NOT return a `{ output: string }` object or a
191
- raw TUI scrollback string. The assistant's text lives inside structured content
192
- blocks within those messages and must be extracted explicitly.
193
-
194
- **Affected SDKs.** Claude.
195
-
196
- ### ❌ Wrong
197
-
198
- ```ts
199
- // result is SessionMessage[], not { output: string }
200
- const result = await s.session.query(prompt);
201
- const parsed = JSON.parse(result.output); // TypeError: result.output is undefined
202
- ```
203
-
204
- ### ✅ Right — use `extractAssistantText(result, 0)`
205
-
206
- ```ts
207
- import { extractAssistantText } from "@bastani/atomic/workflows";
208
-
209
- const result = await s.session.query(prompt);
210
- const text = extractAssistantText(result, 0);
211
- // Now `text` is the concatenated assistant prose for this turn
212
- ```
213
-
214
- `extractAssistantText(msgs, afterIndex)` walks `SessionMessage[]` from
215
- `afterIndex` forward, pulls `TextBlock.text` from each `assistant` message's
216
- content array, and joins them with newlines.
217
-
218
- The ralph helpers in `src/sdk/workflows/builtin/ralph/helpers/prompts.ts`
219
- (`parseReviewResult`, `extractMarkdownBlock`) use this pattern — always
220
- extract text first, then parse.
221
-
222
- **Detection.** Log `typeof result` after `s.session.query()`. If it's
223
- `object` (an array), you need `extractAssistantText`. Accessing `.output`
224
- on an array returns `undefined`.
225
-
226
- ---
227
-
228
- ### F5. Fresh session wipes prior stage context
229
-
230
- **Symptom.** The orchestrator says "I don't see a task list" or "what
231
- specification are you referring to?" even though the planner clearly ran.
232
-
233
- **Root cause.** `client.createSession()` / `client.session.create()` always
234
- returns a **fresh, empty conversation**. The CLIENT object is just the
235
- transport — each session is independent. The new session sees only what you
236
- put in its first prompt.
237
-
238
- **Affected SDKs.** Copilot, OpenCode. (Claude's session model is
239
- different — context accumulates within the same SDK session, so this failure
240
- mode does NOT apply to `s.session.query()`.)
241
-
242
- ### ❌ Wrong
243
-
244
- ```ts
245
- await ctx.stage({ name: "planner" }, {}, { agent: "planner" }, async (s) => {
246
- await s.session.send({ prompt: buildPlannerPrompt((s.inputs.prompt ?? "")) });
247
- s.save(await s.session.getMessages());
248
- });
249
- // orchestrator is a fresh session — it has no idea what the planner produced
250
- await ctx.stage({ name: "orchestrator" }, {}, { agent: "orchestrator" }, async (s) => {
251
- await s.session.send({ prompt: buildOrchestratorPrompt() });
252
- s.save(await s.session.getMessages());
253
- });
254
- ```
255
-
256
- ### ✅ Right — explicit handoff
257
-
258
- ```ts
259
- const plannerHandle = await ctx.stage(
260
- { name: "planner" },
261
- {},
262
- { agent: "planner" },
263
- async (s) => {
264
- await s.session.send({ prompt: buildPlannerPrompt((s.inputs.prompt ?? "")) });
265
- const messages = await s.session.getMessages();
266
- s.save(messages);
267
- return getAssistantText(messages); // see F1 for getAssistantText
268
- },
269
- );
270
-
271
- await ctx.stage(
272
- { name: "orchestrator" },
273
- {},
274
- { agent: "orchestrator" },
275
- async (s) => {
276
- await s.session.send({
277
- prompt: buildOrchestratorPrompt(
278
- (s.inputs.prompt ?? ""),
279
- { plannerNotes: plannerHandle.result },
280
- ),
281
- });
282
- s.save(await s.session.getMessages());
283
- },
284
- );
285
- ```
286
-
287
- Alternatives: write to shared state (`TaskCreate`/`TaskList`, files, git) and
288
- have the next stage read from there, or keep the follow-up inside the same
289
- stage callback when it needs the full live conversation. Provider-level resume
290
- is an advanced same-role escape hatch, not the normal stage-to-stage handoff.
291
-
292
- **Full write-up.** `agent-sessions.md` §"Critical pitfall: session lifecycle
293
- controls what context is available".
294
-
295
- ---
296
-
297
- ### F6. Planner prompts that don't request trailing commentary produce empty handoffs
298
-
299
- **Symptom.** F1 / F5 are fixed, extraction is correct — and the orchestrator
300
- still receives empty `plannerNotes` because the planner's last turn legitimately
301
- had no prose.
302
-
303
- **Root cause.** This is a **prompt engineering** bug, not a code bug. When a
304
- prompt ends with "call `TaskList` to verify" and does not explicitly ask for
305
- trailing commentary, many models end the turn with just the tool call and
306
- no text at all. There's nothing in any turn's `content` to extract because
307
- the model never wrote any.
308
-
309
- **Affected SDKs.** All three — though Claude's pane scrollback masks it by
310
- still capturing something visible.
311
-
312
- ### ❌ Wrong — silent handoff
313
-
314
- ```ts
315
- return `# Planning
316
-
317
- ${spec}
318
-
319
- Decompose the specification into tasks via TaskCreate. After creating all
320
- tasks, call TaskList to verify.`;
321
- ```
322
-
323
- ### ✅ Right — explicit trailing commentary requirement
324
-
325
- ```ts
326
- return `# Planning
327
-
328
- ${spec}
329
-
330
- Decompose the specification into tasks via TaskCreate. After creating all
331
- tasks, call TaskList to verify.
332
-
333
- ## Final output (required)
334
-
335
- After the TaskList call, write a short "Handoff Notes" section with:
336
- - Risks or ambiguities the orchestrator must know about
337
- - Any assumptions you made that could be wrong
338
- - Ordering constraints that don't fit into task bodies
339
-
340
- The orchestrator will run in a fresh session — anything not in your
341
- TaskCreate calls or this section will be lost.`;
342
- ```
343
-
344
- **Pair this fix with F1.** Even with the correct extraction helper, you need
345
- the model to actually produce text for the helper to extract.
346
-
347
- **Detection.** Log the extracted handoff text during development. An empty
348
- string + a correctly-fixed extraction helper = F6.
349
-
350
- ---
351
-
352
- ### F7. Continued sessions accumulate state across loop iterations (lost-in-middle)
353
-
354
- **Symptom.** A review/fix loop works on iterations 1-3 then starts
355
- producing worse output — misidentifying files, hallucinating line numbers,
356
- or "forgetting" a requirement that was clearly stated in the original spec.
357
-
358
- **Root cause.** Each loop iteration adds turns to the same continued
359
- session, and context grows past the attention window. The model starts
360
- dropping middle-of-context information (classic lost-in-middle).
361
-
362
- **Affected SDKs.** All three. Claude's session transcript accumulates every
363
- intermediate turn, so long loops grow the context window substantially.
364
-
365
- ### ❌ Wrong — unbounded loop on a single session
366
-
367
- ```ts
368
- await ctx.stage({ name: "review-loop" }, {}, {}, async (s) => {
369
- for (let i = 0; i < 20; i++) {
370
- await s.session.query(buildReviewPrompt());
371
- await s.session.query(buildFixPrompt());
372
- }
373
- });
374
- ```
375
-
376
- ### ✅ Right — compact or reset between iterations
377
-
378
- Options, in order of preference:
379
-
380
- 1. **Compact** — summarize prior turns via the SDK's compaction mechanism
381
- (Claude's `/compact`, OpenCode's summarizer, a sidecar summarization call
382
- for Copilot). Keeps decisions and file paths; drops verbose tool output.
383
- 2. **Offload to files** — write intermediate findings to files and reference
384
- them by path in the next iteration's prompt (`filesystem-context` skill).
385
- 3. **Fresh session per iteration with explicit handoff** — see F5's pattern;
386
- lose the in-session reasoning but gain a clean context window.
387
-
388
- ```ts
389
- await ctx.stage({ name: "review-loop" }, {}, {}, async (s) => {
390
- const MAX_TURNS_BEFORE_COMPACT = 10;
391
- let turnsSinceCompact = 0;
392
-
393
- for (let i = 0; i < MAX_ITERATIONS; i++) {
394
- if (turnsSinceCompact >= MAX_TURNS_BEFORE_COMPACT) {
395
- await s.session.query("/compact");
396
- turnsSinceCompact = 0;
397
- }
398
- await s.session.query(buildReviewPrompt());
399
- turnsSinceCompact += 1;
400
- }
401
- });
402
- ```
403
-
404
- **Consult.** `context-degradation`, `context-compression`, `context-optimization`.
405
-
406
- **Detection.** Quality-vs-iteration chart. If quality degrades past
407
- iteration N, N is your safe-turn budget before compaction.
408
-
409
- ---
410
-
411
- ### F8. Fenced-block parsers break when the model adds prose
412
-
413
- **Symptom.** `JSON.parse(content)` throws, or a "matches the first fenced
414
- block" regex picks up a code example inside prose instead of the actual
415
- structured output.
416
-
417
- **Root cause.** A prompt asks for `only JSON inside a single fenced block`
418
- and the model adds a sentence of explanation, a "# Summary" heading, or
419
- quotes a snippet of its own reasoning in a code fence earlier in the reply.
420
-
421
- **Affected SDKs.** All three — this is a model-behavior issue, not
422
- SDK-specific.
423
-
424
- ### ❌ Wrong
425
-
426
- ```ts
427
- const parsed = JSON.parse(content);
428
- // or:
429
- const match = content.match(/```json\n([\s\S]*?)\n```/);
430
- ```
431
-
432
- ### ✅ Right — layered fallback: direct parse → last fenced block → last balanced object
433
-
434
- ```ts
435
- export function parseReviewResult(content: string): ReviewResult | null {
436
- // 1. Direct JSON
437
- try {
438
- const parsed = JSON.parse(content);
439
- if (parsed?.findings && parsed?.overall_correctness) return parsed;
440
- } catch { /* fall through */ }
441
-
442
- // 2. LAST fenced code block (not the first — prose often quotes examples)
443
- const blockRe = /```(?:json)?\s*\n([\s\S]*?)\n```/g;
444
- let lastBlock: string | null = null;
445
- let m: RegExpExecArray | null;
446
- while ((m = blockRe.exec(content)) !== null) {
447
- if (m[1]) lastBlock = m[1];
448
- }
449
- if (lastBlock) {
450
- try {
451
- const parsed = JSON.parse(lastBlock);
452
- if (parsed?.findings && parsed?.overall_correctness) return parsed;
453
- } catch { /* fall through */ }
454
- }
455
-
456
- // 3. Last balanced object containing the required key
457
- // (implementation in src/sdk/workflows/builtin/ralph/helpers/prompts.ts)
458
- return null;
459
- }
460
- ```
461
-
462
- **Detection.** Fuzz test the parser against real model output captured
463
- over several runs. If 1 in 20 runs fails to parse, you have F8.
464
-
465
- ---
466
-
467
- ### F9. `s.save()` receives the wrong shape
468
-
469
- **Symptom.** `s.transcript("stage-name")` returns an empty or malformed
470
- `content` string in the next stage.
471
-
472
- **Root cause.** Each SDK has a different contract for what `s.save()`
473
- expects, and the runtime doesn't type-check the argument beyond "anything".
474
-
475
- **Affected SDKs.** All three — the mistake is in the workflow author's code.
476
-
477
- ### Correct shapes
478
-
479
- | SDK | Correct argument |
480
- |---|---|
481
- | Claude | `s.save(s.sessionId)` — pass the session ID; the runtime reads the transcript file |
482
- | Copilot | `s.save(await s.session.getMessages())` — pass `SessionEvent[]` |
483
- | OpenCode | `s.save(result.data!)` — pass the `{ info, parts }` object |
484
-
485
- ### ❌ Wrong
486
-
487
- ```ts
488
- // Claude — saves the wrong thing (result is SessionMessage[], not { output: string })
489
- s.save(result.output); // TypeError: result.output is undefined; use s.save(s.sessionId)
490
-
491
- // Copilot — calling getMessages() BEFORE send() returns an empty array
492
- const earlyMessages = await s.session.getMessages(); // [] — no turns yet
493
- s.save(earlyMessages);
494
-
495
- // Copilot — saving a single message instead of the full array
496
- s.save((await s.session.getMessages()).at(-1));
497
-
498
- // OpenCode — missing the data unwrap
499
- s.save(result);
500
- ```
501
-
502
- ### ✅ Right
503
-
504
- See the per-SDK examples in `SKILL.md` §"Write the Workflow File" and the
505
- `SessionContext` reference table.
506
-
507
- **Detection.** Read `s.transcript(name).content` in the next stage and
508
- log the length. A 0-length or JSON-that-isn't-prose signature = F9.
509
-
510
- ---
511
-
512
- ## Loud failures (throw, but still worth knowing)
513
-
514
- ### F10. Copilot: `sendAndWait` default 60s timeout throws
515
-
516
- **Symptom.** `Timeout after 60000ms waiting for session.idle`. Every
517
- subsequent `ctx.stage()` call never executes — the throw propagates out of
518
- `run()` and halts the workflow.
519
-
520
- **Root cause.** The raw Copilot SDK's `sendAndWait(options, timeout?)`
521
- defaults to a 60-second timeout that throws on expiry. Real agent work
522
- (planners, reviewers, orchestrators) routinely exceeds this.
523
-
524
- **Fix.** Use `send` instead. Inside an Atomic stage the runtime wraps
525
- `s.session.send()` so it blocks until `session.idle` with **no timeout** —
526
- the same blocking semantics as Claude's `query()` and OpenCode's
527
- `session.prompt()`. The wrapper lives in `wrapCopilotSend`
528
- (`src/sdk/runtime/executor.ts`) and is installed per-stage.
529
-
530
- ```ts
531
- // Correct: send() in an Atomic stage blocks until idle, no timeout.
532
- await s.session.send({ prompt });
533
- const messages = await s.session.getMessages(); // safe to read
534
- ```
535
-
536
- **Do not reach for `sendAndWait` with a larger explicit timeout.** `send`
537
- already waits for idle; `sendAndWait` just adds a throw-on-timeout failure
538
- mode on top. If you catch yourself writing `sendAndWait(..., 5 * 60 * 1000)`
539
- to "be safe", you want `send`.
540
-
541
- ---
542
-
543
- ### F11. Provider-level resume tries to swap agents
544
-
545
- **Symptom.** Resumed Copilot / OpenCode session behaves as the original
546
- agent instead of the requested new one — or the SDK throws "agent mismatch"
547
- on resume.
548
-
549
- **Root cause.** Each session is **bound to one agent at creation time**.
550
- `resumeSession` reattaches the conversation but does not change the agent.
551
-
552
- **Fix.** Use provider-level resume only for multi-turn work within the same
553
- role. To swap agents, create a new session (fresh) and forward context via
554
- F5's pattern. In normal workflow code, prefer a same-stage multi-turn session
555
- over trying to reopen a prior stage.
556
-
557
- ---
558
-
559
- ### F12. Parallel siblings read each other's transcripts
560
-
561
- **Symptom.** `s.transcript("sibling-name")` inside a parallel session
562
- throws or returns empty.
563
-
564
- **Root cause.** `s.transcript()` only exposes **prior completed sessions** —
565
- ones whose callback has returned and whose saves have flushed. Sessions
566
- launched concurrently via `Promise.all([ctx.stage(...), ctx.stage(...)])` run
567
- at the same time; forward-only data flow is enforced.
568
-
569
- **Fix.** Restructure to either a linear chain, a "fan-out, then merge"
570
- pattern where a subsequent session reads both, or use external
571
- shared state (files, DB) if siblings genuinely need to coordinate.
572
-
573
- ```ts
574
- // Fan-out → merge
575
- // Strings used here for brevity; prefer handles (s.transcript(handle)) when one is in scope.
576
- const describe = await ctx.stage({ name: "describe" }, {}, {}, async (s) => { /* ... */ });
577
-
578
- const [summarizeA, summarizeB] = await Promise.all([
579
- ctx.stage({ name: "summarize-a" }, {}, {}, async (s) => {
580
- const d = await s.transcript(describe); // OK — prior completed session (handle-based, preferred)
581
- // s.transcript("summarize-b") would fail here — sibling not yet complete
582
- }),
583
- ctx.stage({ name: "summarize-b" }, {}, {}, async (s) => {
584
- const d = await s.transcript(describe); // OK — prior completed session
585
- }),
586
- ]);
587
-
588
- await ctx.stage({ name: "merge" }, {}, {}, async (s) => {
589
- const a = await s.transcript(summarizeA); // OK — handle-based, preferred over "summarize-a"
590
- const b = await s.transcript(summarizeB);
591
- });
592
- ```
593
-
594
- ---
595
-
596
- ### F13. Forgetting to `await` `ctx.stage()`
597
-
598
- **Symptom.** A session runs (its tmux window opens, the agent does work)
599
- but the orchestrator doesn't wait for it. Subsequent sessions that depend
600
- on its output via `transcript()` or `getMessages()` see empty or missing
601
- data. The workflow may finish "successfully" before the session's callback
602
- has returned.
603
-
604
- **Root cause.** `ctx.stage()` returns a `Promise<SessionHandle<T>>`.
605
- Without `await`, the session is spawned but the `.run()` callback continues
606
- immediately. The session's save never reaches the `completedRegistry`
607
- before downstream code tries to read it.
608
-
609
- **Affected SDKs.** All three — this is a TypeScript control-flow bug, not
610
- SDK-specific.
611
-
612
- ### ❌ Wrong
613
-
614
- ```ts
615
- // Missing await — session fires but orchestrator doesn't wait
616
- ctx.stage({ name: "research" }, {}, {}, async (s) => {
617
- // ... agent work ...
618
- s.save(s.sessionId);
619
- });
620
-
621
- // This runs before "research" completes
622
- await ctx.stage({ name: "synthesize" }, {}, {}, async (s) => {
623
- const r = await s.transcript("research"); // empty or throws
624
- });
625
- ```
626
-
627
- ### ✅ Right
628
-
629
- ```ts
630
- await ctx.stage({ name: "research" }, {}, {}, async (s) => {
631
- // ... agent work ...
632
- s.save(s.sessionId);
633
- });
634
-
635
- await ctx.stage({ name: "synthesize" }, {}, {}, async (s) => {
636
- const r = await s.transcript("research"); // works
637
- });
638
- ```
639
-
640
- **Detection.** If a session's graph node shows as "running" while
641
- downstream sessions are already executing, you likely dropped an `await`.
642
- TypeScript's `@typescript-eslint/no-floating-promises` lint rule catches
643
- this at compile time.
644
-
645
- ---
646
-
647
- ### F14. Using a pending `SessionHandle` before completion
648
-
649
- **Symptom.** `handle.result` is `undefined` or stale, or
650
- `s.transcript(handle)` throws / returns empty even though the session
651
- eventually completes.
652
-
653
- **Root cause.** `ctx.stage()` returns a `SessionHandle<T>` whose
654
- `.result` is only populated after the callback returns. If you store the
655
- promise but access the handle before awaiting it, the result field is
656
- not yet set and the session is not in the `completedRegistry`.
657
-
658
- **Affected SDKs.** All three.
659
-
660
- ### ❌ Wrong
661
-
662
- ```ts
663
- // Start both but access handles before awaiting
664
- const handleA = ctx.stage({ name: "a" }, {}, {}, async (s) => { /* ... */ return 42; });
665
- const handleB = ctx.stage({ name: "b" }, {}, {}, async (s) => {
666
- // handleA is a Promise, not a resolved SessionHandle
667
- const transcript = await s.transcript(handleA); // fails
668
- });
669
- ```
670
-
671
- ### ✅ Right
672
-
673
- ```ts
674
- // Await first, then use the resolved handle
675
- const handleA = await ctx.stage({ name: "a" }, {}, {}, async (s) => { /* ... */ return 42; });
676
-
677
- await ctx.stage({ name: "b" }, {}, {}, async (s) => {
678
- const transcript = await s.transcript(handleA); // works — handleA is resolved
679
- console.log(handleA.result); // 42
680
- });
681
- ```
682
-
683
- For parallel sessions, use `Promise.all()` and access handles only after
684
- all promises resolve:
685
-
686
- ```ts
687
- const [a, b] = await Promise.all([
688
- ctx.stage({ name: "a" }, {}, {}, async (s) => { /* ... */ return "x"; }),
689
- ctx.stage({ name: "b" }, {}, {}, async (s) => { /* ... */ return "y"; }),
690
- ]);
691
- // a.result === "x", b.result === "y"
692
- ```
693
-
694
- **Detection.** TypeScript's type system helps — `ctx.stage()` returns
695
- `Promise<SessionHandle<T>>`, not `SessionHandle<T>` directly. If you're
696
- accessing `.result` without awaiting, the type will be `Promise`, not `T`.
697
-
698
- ---
699
-
700
- ### F15. Headless stage errors are invisible in the graph
701
-
702
- **Symptom.** A workflow fails but the graph shows all visible stages as
703
- completed. The error message references a session name that doesn't appear
704
- in the graph panel.
705
-
706
- **Root cause.** Headless stages (`{ headless: true }`) are invisible in the
707
- workflow graph — they have no graph node, no tmux window, and no pane
708
- preview. When a headless stage throws, the error is recorded in the
709
- `failedRegistry` and the workflow halts, but the failure is only visible in
710
- the orchestrator's error output and the session's `error.txt` file on disk.
711
-
712
- **Affected SDKs.** All three — this is an executor-level behavior, not
713
- SDK-specific.
714
-
715
- ### ❌ Wrong — no error context for headless stages
716
-
717
- ```ts
718
- // Headless stage fails silently in the graph
719
- const [a, b, c] = await Promise.all([
720
- ctx.stage({ name: "gather-a", headless: true }, {}, {}, async (s) => {
721
- throw new Error("API key expired"); // Fails — no graph node to show red
722
- }),
723
- ctx.stage({ name: "gather-b", headless: true }, {}, {}, async (s) => { /* ... */ }),
724
- ctx.stage({ name: "gather-c", headless: true }, {}, {}, async (s) => { /* ... */ }),
725
- ]);
726
- ```
727
-
728
- ### ✅ Right — wrap headless stages with descriptive error context
729
-
730
- ```ts
731
- const [a, b, c] = await Promise.all([
732
- ctx.stage({ name: "gather-a", headless: true }, {}, {}, async (s) => {
733
- try {
734
- return await doWork(s);
735
- } catch (error) {
736
- throw new Error(`[gather-a] ${error instanceof Error ? error.message : String(error)}`);
737
- }
738
- }),
739
- // ... same pattern for b, c
740
- ]);
741
- ```
742
-
743
- **Detection.** If a workflow fails and the graph shows no failed nodes,
744
- check the orchestrator log (`orchestrator.log` in the session directory)
745
- and look for `headless-<name>` in the error output. The session directory
746
- at `~/.atomic/sessions/<run-id>/<name>-<id>/error.txt` contains the
747
- full error for each failed headless stage.
748
-
749
- ---
750
-
751
- ### F16. Claude: importing the SDK `query()` inside a non-headless stage
752
-
753
- **Symptom.** A reviewer / extractor / structured-output stage shows up in
754
- the workflow graph as a tmux pane, but the pane sits idle on the Claude
755
- welcome screen for the entire stage duration. The stage still produces a
756
- result — but the visible session never moved. CPU and token cost double:
757
- two Claude processes ran, one in the pane (idle) and one in-process (the
758
- SDK call that actually did the work).
759
-
760
- **Root cause.** The stage was registered without `headless: true`, so the
761
- runtime spawned an interactive Claude TUI in a tmux pane and bound
762
- `s.session` to it. The callback ignored that and called
763
- `query()` from `@anthropic-ai/claude-agent-sdk` directly:
764
-
765
- ```ts
766
- import { query } from "@anthropic-ai/claude-agent-sdk";
767
- // ...
768
- ctx.stage({ name: "review" }, {}, {}, async (s) => {
769
- for await (const msg of query({ prompt, options: { outputFormat: ... } })) { /* ... */ }
770
- });
771
- ```
772
-
773
- That import bypasses `s.session` entirely. The runtime cannot route the
774
- SDK call through the TUI it just started, so:
775
-
776
- 1. The visible pane never receives a prompt — the user sees a blank Claude
777
- session in the graph.
778
- 2. A second Claude process spins up in the orchestrator process to service
779
- the SDK call. Both processes count against rate limits and token spend.
780
- 3. Idle detection on the pane never fires because no prompt was ever sent;
781
- the runtime relies on session-state events that won't arrive, and stage
782
- completion happens only because the callback returned (not because the
783
- pane finished work).
784
-
785
- The runtime exposes exactly two routes for an SDK feature:
786
-
787
- | You want to use… | Stage shape | Code in callback |
788
- |---|---|---|
789
- | `outputFormat`, custom `agents`, `maxBudgetUsd`, etc. **without** a visible pane | `{ headless: true }` | `s.session.query(prompt, sdkOptions)` — wraps `HeadlessClaudeSessionWrapper.query()` which forwards `options` to the SDK |
790
- | The visible TUI with a subagent | omit `headless` and pass `chatFlags: ["--agent", "<name>", ...]` | `s.session.query(prompt)` — sends through tmux send-keys |
791
-
792
- The one option that does **not** exist is "visible pane + in-process SDK call".
793
- That combination is always wrong — pick one route or the other.
794
-
795
- **Affected SDKs.** Claude only. Copilot and OpenCode don't expose a
796
- parallel "import the bare SDK" foot-gun in this codebase.
797
-
798
- ### ❌ Wrong — visible pane + bypassed-SDK call
799
-
800
- ```ts
801
- import { query as claudeSdkQuery } from "@anthropic-ai/claude-agent-sdk";
802
-
803
- await ctx.stage({ name: "review" }, {}, {}, async (s) => {
804
- // Visible TUI was started, but we're ignoring it.
805
- for await (const msg of claudeSdkQuery({
806
- prompt: reviewPrompt,
807
- options: {
808
- outputFormat: { type: "json_schema", schema: REVIEW_SCHEMA },
809
- },
810
- })) {
811
- if (msg.type === "result") { /* ... */ }
812
- }
813
- s.save(s.sessionId);
814
- });
815
- ```
816
-
817
- ### ✅ Right (a) — visible TUI with subagent + chatFlags
818
-
819
- When you want the user to watch the review happen, run the subagent in
820
- the pane via `--agent` and parse JSON out of the assistant text. The
821
- prompt should enumerate the schema fields so the model emits matching
822
- JSON; a tolerant parser (last-fenced-block + last-balanced-object
823
- fallback, F8) handles any prose the model adds:
824
-
825
- ```ts
826
- await ctx.stage(
827
- { name: "review" },
828
- { chatFlags: ["--agent", "reviewer", "--allow-dangerously-skip-permissions", "--dangerously-skip-permissions"] },
829
- {},
830
- async (s) => {
831
- const messages = await s.session.query(reviewPrompt);
832
- s.save(s.sessionId);
833
- return parseReviewResult(extractAssistantText(messages, 0));
834
- },
835
- );
836
- ```
837
-
838
- This is the pattern used by `src/sdk/workflows/builtin/ralph/claude/index.ts`
839
- for its planner, orchestrator, reviewer, and debugger stages.
840
-
841
- ### ✅ Right (b) — headless stage with SDK options via `s.session.query()`
842
-
843
- When you don't need the pane (e.g. background data gathering), set
844
- `headless: true` and pass SDK options as the second argument to
845
- `s.session.query()`. The runtime uses `HeadlessClaudeSessionWrapper`,
846
- which calls the SDK's `query()` in-process and exposes the full options
847
- surface (`agent`, `outputFormat`, `permissionMode`, `maxBudgetUsd`, etc.):
848
-
849
- ```ts
850
- await ctx.stage(
851
- { name: "review", headless: true },
852
- {}, {},
853
- async (s) => {
854
- const messages = await s.session.query(reviewPrompt, {
855
- agent: "reviewer",
856
- permissionMode: "bypassPermissions",
857
- allowDangerouslySkipPermissions: true,
858
- });
859
- s.save(s.sessionId);
860
- return extractAssistantText(messages, 0);
861
- },
862
- );
863
- ```
864
-
865
- > **Note on `--json-schema`.** The CLI's `--json-schema` flag requires
866
- > `-p` (print mode) and therefore can't be passed via `chatFlags` to the
867
- > interactive TUI. If you need SDK-validated structured output, use route
868
- > (b) — set `headless: true` and pass `outputFormat: { type: "json_schema", schema }`
869
- > in the `s.session.query()` options. Pair (a)'s visible TUI with a
870
- > tolerant JSON parser instead. (Note: `s.session.query()`'s headless
871
- > wrapper currently returns `SessionMessage[]` and discards the SDK
872
- > result event's `structured_output` field — for now, parse JSON out of
873
- > the assistant text either way.)
874
-
875
- **Detection.**
876
- 1. Grep your workflow for `from "@anthropic-ai/claude-agent-sdk"` —
877
- `query`, `tool`, `createSdkMcpServer` and similar imports inside a
878
- `.run()` callback are the smell. Workflow code should import from
879
- `@bastani/atomic/workflows` and access the SDK exclusively through
880
- `s.client` and `s.session`.
881
- 2. Watch the workflow run. If a visible pane shows the Claude welcome
882
- screen for the entire duration of a stage and never receives a prompt,
883
- you have F16.
884
- 3. Cost monitoring. F16 roughly doubles the Claude process count — if
885
- stage spend looks 2× a single run, audit imports.
886
-
887
- ---
888
-
889
- ## Design checklist
890
-
891
- Before shipping a multi-session workflow, walk the list:
892
-
893
- - [ ] Copilot stages use `s.session.send` by default; `sendAndWait` only with an explicit user-requested timeout (F10)
894
- - [ ] Every fresh-session handoff forwards context explicitly (F5)
895
- - [ ] Every prompt whose output feeds a downstream stage explicitly requests trailing commentary (F6)
896
- - [ ] Response-text extraction uses the per-SDK correct pattern (F1-F4)
897
- - [ ] Structured-output parsers extract the LAST fenced block, not the first (F8)
898
- - [ ] `s.save()` receives the per-SDK correct shape — Copilot uses `s.session.getMessages()` (F9)
899
- - [ ] Loops over 10 iterations have a compaction / reset strategy (F7)
900
- - [ ] Parallel groups only read from prior completed sessions, never siblings (F12)
901
- - [ ] Every `ctx.stage()` call is `await`ed (F13)
902
- - [ ] `SessionHandle` values are only used after the promise resolves (F14)
903
- - [ ] If provider-level resume/fork is used at all, it stays within the same agent role (F11)
904
- - [ ] Headless stage callbacks include descriptive error context so failures can be diagnosed without a graph node (F15)
905
- - [ ] Claude stages never import `query` (or other entry points) from `@anthropic-ai/claude-agent-sdk` directly — go through `s.session.query()` so the runtime routes to the TUI (interactive) or the SDK (headless) consistently (F16)
906
- - [ ] No duplicate `${agent}/${name}` registrations in the composition root (F17)
907
- - [ ] Every `ctx.stage()` callback contains at least one LLM call (`s.session.query` / `s.session.send` / `s.client.session.prompt`); stages that are pure deterministic code have been demoted to plain TypeScript in `.run()` (F22)
908
-
909
- ---
910
-
911
- ### F17. Duplicate registration throws at composition root
912
-
913
- **Symptom.** `createRegistry().register(wf)` throws immediately when
914
- `wf` has the same `${agent}/${name}` key as an already-registered workflow:
915
-
916
- ```
917
- [atomic] Duplicate workflow registration: "claude/my-workflow" is already registered.
918
- Each (agent, name) pair must be unique.
919
- ```
920
-
921
- **Fix.** Ensure each `(agent, name)` pair appears exactly once in the
922
- composition root. Two cross-agent variants of the same logical workflow
923
- (`"claude/ralph"` + `"copilot/ralph"`) are distinct keys — register both
924
- without conflict.
925
-
926
- ---
927
-
928
- ### F22. `ctx.stage()` with no LLM query spawns an empty, idle pane
929
-
930
- **Symptom.** A stage in the workflow graph opens a tmux window, the agent
931
- CLI boots up, and then the pane just... sits there. No prompt ever gets
932
- sent; the pane shows the Claude / Copilot / OpenCode welcome screen for
933
- the entire stage duration. Users watching the graph see a completed stage
934
- node whose pane was visibly empty, ask "why didn't it do anything?", and
935
- lose trust in the workflow.
936
-
937
- **Root cause.** A `ctx.stage()` callback that contains only deterministic
938
- TypeScript — file I/O, `fetch()`, `child_process.exec`, `JSON.parse`, a
939
- git command, a helper function — but no `s.session.query()` /
940
- `s.session.send()` / `s.client.session.prompt()` call. The runtime sees
941
- the stage as a valid unit of work (it spins up the pane, creates the SDK
942
- session, runs the callback, tears everything down), but the session
943
- itself never receives a prompt. Token cost is near-zero but the UX cost is
944
- high: the empty pane is indistinguishable from a broken stage.
945
-
946
- **Affected SDKs.** All three. The symptom is most obvious with Claude
947
- because the pane is a full interactive TUI; Copilot and OpenCode show a
948
- similarly idle welcome screen.
949
-
950
- ### ❌ Wrong — pure-TS work wrapped in a stage
951
-
952
- ```ts
953
- // The previous stage returned a plan object. We want to write it to disk
954
- // and set up some scratch directories before the next LLM call.
955
- await ctx.stage({ name: "prepare-workspace" }, {}, {}, async (s) => {
956
- await fs.mkdir(".atomic/scratch", { recursive: true });
957
- await fs.writeFile(".atomic/scratch/plan.json", JSON.stringify(plan.result));
958
- execSync("git checkout -b ralph/wip");
959
- // ⚠️ No LLM call. A tmux pane opens, Claude boots, nothing ever
960
- // gets typed into it, the stage "completes", pane tears down.
961
- });
962
- ```
963
-
964
- ### ✅ Right (a) — lift pure-TS work into `.run()` directly
965
-
966
- ```ts
967
- // Run deterministic setup at the orchestrator level, outside any stage.
968
- // No pane, no graph node, no confusion.
969
- await fs.mkdir(".atomic/scratch", { recursive: true });
970
- await fs.writeFile(".atomic/scratch/plan.json", JSON.stringify(plan.result));
971
- execSync("git checkout -b ralph/wip");
972
-
973
- // Next stage actually uses the LLM — a pane here makes sense.
974
- await ctx.stage({ name: "implement" }, {}, {}, async (s) => {
975
- await s.session.query("Implement the plan in .atomic/scratch/plan.json.");
976
- s.save(s.sessionId);
977
- });
978
- ```
979
-
980
- ### ✅ Right (b) — bundle deterministic work into the nearest LLM stage
981
-
982
- When the TS logic is conceptually bound to a specific LLM call (e.g.
983
- validating the query's response, writing a derived artifact from the
984
- assistant text), put it inside the same callback:
985
-
986
- ```ts
987
- await ctx.stage({ name: "plan" }, {}, {}, async (s) => {
988
- const messages = await s.session.query("Produce a plan as JSON.");
989
- const text = extractAssistantText(messages, 0);
990
- const plan = parsePlan(text); // deterministic — fine here
991
- validatePlan(plan); // deterministic — fine here
992
- await fs.writeFile("plan.json", JSON.stringify(plan)); // fine here
993
- s.save(plan);
994
- return plan;
995
- });
996
- ```
997
-
998
- **Detection.**
999
-
1000
- 1. Grep every `ctx.stage()` callback for at least one of:
1001
- `s.session.query`, `s.session.send`, `s.client.session.prompt`. A
1002
- callback with none is an F22 candidate.
1003
- 2. Watch the workflow run in the TUI. If a stage's pane shows only the
1004
- agent welcome banner for the whole duration and closes without ever
1005
- echoing a prompt, you have F22.
1006
- 3. Any stage whose only callback statements are `await fs.*`,
1007
- `execSync`, `fetch`, `await s.save(...)`, or pure data manipulation
1008
- is almost certainly F22 — there's no reason to pay for a pane just to
1009
- run TypeScript the orchestrator could run directly.
1010
-
1011
- **Legitimate exception.** Stages that spawn subordinate LLM work via
1012
- `s.stage()` (nested sub-sessions) are fine — the child stages carry the
1013
- LLM calls and the parent acts as a grouping scope. This pattern is rare
1014
- and usually better expressed with headless fan-out + `Promise.all`.