@bastani/atomic 0.5.11-0 → 0.5.12-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (506) hide show
  1. package/.agents/skills/adapt/SKILL.md +199 -0
  2. package/.agents/skills/advanced-evaluation/SKILL.md +402 -0
  3. package/.agents/skills/advanced-evaluation/references/bias-mitigation.md +288 -0
  4. package/.agents/skills/advanced-evaluation/references/evaluation-pipeline.md +43 -0
  5. package/.agents/skills/advanced-evaluation/references/implementation-patterns.md +315 -0
  6. package/.agents/skills/advanced-evaluation/references/metrics-guide.md +331 -0
  7. package/.agents/skills/advanced-evaluation/scripts/evaluation_example.py +392 -0
  8. package/.agents/skills/animate/SKILL.md +175 -0
  9. package/.agents/skills/arrange/SKILL.md +124 -0
  10. package/.agents/skills/audit/SKILL.md +148 -0
  11. package/.agents/skills/bdi-mental-states/SKILL.md +311 -0
  12. package/.agents/skills/bdi-mental-states/references/bdi-ontology-core.md +207 -0
  13. package/.agents/skills/bdi-mental-states/references/framework-integration.md +582 -0
  14. package/.agents/skills/bdi-mental-states/references/rdf-examples.md +315 -0
  15. package/.agents/skills/bdi-mental-states/references/sparql-competency.md +420 -0
  16. package/.agents/skills/bolder/SKILL.md +117 -0
  17. package/.agents/skills/bun/SKILL.md +199 -0
  18. package/.agents/skills/clarify/SKILL.md +183 -0
  19. package/.agents/skills/colorize/SKILL.md +143 -0
  20. package/.agents/skills/context-compression/SKILL.md +272 -0
  21. package/.agents/skills/context-compression/references/evaluation-framework.md +213 -0
  22. package/.agents/skills/context-compression/scripts/compression_evaluator.py +862 -0
  23. package/.agents/skills/context-compression/tests/test_compression_evaluator.py +56 -0
  24. package/.agents/skills/context-degradation/SKILL.md +206 -0
  25. package/.agents/skills/context-degradation/references/patterns.md +314 -0
  26. package/.agents/skills/context-degradation/scripts/degradation_detector.py +614 -0
  27. package/.agents/skills/context-fundamentals/SKILL.md +201 -0
  28. package/.agents/skills/context-fundamentals/references/context-components.md +283 -0
  29. package/.agents/skills/context-fundamentals/scripts/context_manager.py +533 -0
  30. package/.agents/skills/context-optimization/SKILL.md +195 -0
  31. package/.agents/skills/context-optimization/references/optimization_techniques.md +272 -0
  32. package/.agents/skills/context-optimization/scripts/compaction.py +562 -0
  33. package/.agents/skills/create-spec/SKILL.md +244 -0
  34. package/.agents/skills/critique/SKILL.md +225 -0
  35. package/.agents/skills/critique/reference/cognitive-load.md +106 -0
  36. package/.agents/skills/critique/reference/heuristics-scoring.md +234 -0
  37. package/.agents/skills/critique/reference/personas.md +178 -0
  38. package/.agents/skills/delight/SKILL.md +304 -0
  39. package/.agents/skills/distill/SKILL.md +122 -0
  40. package/.agents/skills/docx/LICENSE.txt +30 -0
  41. package/.agents/skills/docx/SKILL.md +590 -0
  42. package/.agents/skills/docx/scripts/__init__.py +1 -0
  43. package/.agents/skills/docx/scripts/accept_changes.py +135 -0
  44. package/.agents/skills/docx/scripts/comment.py +318 -0
  45. package/.agents/skills/docx/scripts/office/helpers/__init__.py +0 -0
  46. package/.agents/skills/docx/scripts/office/helpers/merge_runs.py +199 -0
  47. package/.agents/skills/docx/scripts/office/helpers/simplify_redlines.py +197 -0
  48. package/.agents/skills/docx/scripts/office/pack.py +159 -0
  49. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  50. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  51. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  52. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  53. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  54. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  55. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  56. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  57. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  58. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  59. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  60. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  61. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  62. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  63. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  64. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  65. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  66. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  67. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  68. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  69. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  70. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  71. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  72. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  73. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  74. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  75. package/.agents/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  76. package/.agents/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  77. package/.agents/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  78. package/.agents/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  79. package/.agents/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  80. package/.agents/skills/docx/scripts/office/schemas/mce/mc.xsd +75 -0
  81. package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
  82. package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
  83. package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
  84. package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
  85. package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
  86. package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  87. package/.agents/skills/docx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
  88. package/.agents/skills/docx/scripts/office/soffice.py +183 -0
  89. package/.agents/skills/docx/scripts/office/unpack.py +132 -0
  90. package/.agents/skills/docx/scripts/office/validate.py +111 -0
  91. package/.agents/skills/docx/scripts/office/validators/__init__.py +15 -0
  92. package/.agents/skills/docx/scripts/office/validators/base.py +847 -0
  93. package/.agents/skills/docx/scripts/office/validators/docx.py +446 -0
  94. package/.agents/skills/docx/scripts/office/validators/pptx.py +275 -0
  95. package/.agents/skills/docx/scripts/office/validators/redlining.py +247 -0
  96. package/.agents/skills/docx/scripts/templates/comments.xml +3 -0
  97. package/.agents/skills/docx/scripts/templates/commentsExtended.xml +3 -0
  98. package/.agents/skills/docx/scripts/templates/commentsExtensible.xml +3 -0
  99. package/.agents/skills/docx/scripts/templates/commentsIds.xml +3 -0
  100. package/.agents/skills/docx/scripts/templates/people.xml +3 -0
  101. package/.agents/skills/evaluation/SKILL.md +251 -0
  102. package/.agents/skills/evaluation/references/metrics.md +339 -0
  103. package/.agents/skills/evaluation/scripts/evaluator.py +627 -0
  104. package/.agents/skills/explain-code/SKILL.md +230 -0
  105. package/.agents/skills/extract/SKILL.md +91 -0
  106. package/.agents/skills/filesystem-context/SKILL.md +287 -0
  107. package/.agents/skills/filesystem-context/references/implementation-patterns.md +549 -0
  108. package/.agents/skills/filesystem-context/scripts/filesystem_context.py +425 -0
  109. package/.agents/skills/find-skills/SKILL.md +142 -0
  110. package/.agents/skills/frontend-design/SKILL.md +147 -0
  111. package/.agents/skills/frontend-design/reference/color-and-contrast.md +132 -0
  112. package/.agents/skills/frontend-design/reference/interaction-design.md +195 -0
  113. package/.agents/skills/frontend-design/reference/motion-design.md +99 -0
  114. package/.agents/skills/frontend-design/reference/responsive-design.md +114 -0
  115. package/.agents/skills/frontend-design/reference/spatial-design.md +100 -0
  116. package/.agents/skills/frontend-design/reference/typography.md +133 -0
  117. package/.agents/skills/frontend-design/reference/ux-writing.md +107 -0
  118. package/.agents/skills/gh-commit/SKILL.md +243 -0
  119. package/.agents/skills/gh-create-pr/SKILL.md +93 -0
  120. package/.agents/skills/harden/SKILL.md +354 -0
  121. package/.agents/skills/hosted-agents/SKILL.md +260 -0
  122. package/.agents/skills/hosted-agents/references/infrastructure-patterns.md +700 -0
  123. package/.agents/skills/hosted-agents/scripts/sandbox_manager.py +590 -0
  124. package/.agents/skills/impeccable/SKILL.md +365 -0
  125. package/.agents/skills/impeccable/reference/color-and-contrast.md +105 -0
  126. package/.agents/skills/impeccable/reference/craft.md +70 -0
  127. package/.agents/skills/impeccable/reference/extract.md +70 -0
  128. package/.agents/skills/impeccable/reference/interaction-design.md +195 -0
  129. package/.agents/skills/impeccable/reference/motion-design.md +99 -0
  130. package/.agents/skills/impeccable/reference/responsive-design.md +114 -0
  131. package/.agents/skills/impeccable/reference/spatial-design.md +100 -0
  132. package/.agents/skills/impeccable/reference/typography.md +142 -0
  133. package/.agents/skills/impeccable/reference/ux-writing.md +107 -0
  134. package/.agents/skills/impeccable/scripts/cleanup-deprecated.mjs +214 -0
  135. package/.agents/skills/init/SKILL.md +138 -0
  136. package/.agents/skills/layout/SKILL.md +125 -0
  137. package/.agents/skills/liteparse/SKILL.md +222 -0
  138. package/.agents/skills/memory-systems/SKILL.md +219 -0
  139. package/.agents/skills/memory-systems/references/implementation.md +551 -0
  140. package/.agents/skills/memory-systems/scripts/memory_store.py +616 -0
  141. package/.agents/skills/multi-agent-patterns/SKILL.md +257 -0
  142. package/.agents/skills/multi-agent-patterns/references/frameworks.md +433 -0
  143. package/.agents/skills/multi-agent-patterns/scripts/coordination.py +613 -0
  144. package/.agents/skills/normalize/SKILL.md +70 -0
  145. package/.agents/skills/onboard/SKILL.md +245 -0
  146. package/.agents/skills/opentui/SKILL.md +201 -0
  147. package/.agents/skills/opentui/references/animation/REFERENCE.md +431 -0
  148. package/.agents/skills/opentui/references/components/REFERENCE.md +144 -0
  149. package/.agents/skills/opentui/references/components/code-diff.md +672 -0
  150. package/.agents/skills/opentui/references/components/containers.md +417 -0
  151. package/.agents/skills/opentui/references/components/inputs.md +531 -0
  152. package/.agents/skills/opentui/references/components/text-display.md +386 -0
  153. package/.agents/skills/opentui/references/core/REFERENCE.md +145 -0
  154. package/.agents/skills/opentui/references/core/api.md +543 -0
  155. package/.agents/skills/opentui/references/core/configuration.md +168 -0
  156. package/.agents/skills/opentui/references/core/gotchas.md +393 -0
  157. package/.agents/skills/opentui/references/core/patterns.md +449 -0
  158. package/.agents/skills/opentui/references/keyboard/REFERENCE.md +617 -0
  159. package/.agents/skills/opentui/references/layout/REFERENCE.md +337 -0
  160. package/.agents/skills/opentui/references/layout/patterns.md +444 -0
  161. package/.agents/skills/opentui/references/react/REFERENCE.md +174 -0
  162. package/.agents/skills/opentui/references/react/api.md +436 -0
  163. package/.agents/skills/opentui/references/react/configuration.md +302 -0
  164. package/.agents/skills/opentui/references/react/gotchas.md +443 -0
  165. package/.agents/skills/opentui/references/react/patterns.md +501 -0
  166. package/.agents/skills/opentui/references/solid/REFERENCE.md +201 -0
  167. package/.agents/skills/opentui/references/solid/api.md +564 -0
  168. package/.agents/skills/opentui/references/solid/configuration.md +316 -0
  169. package/.agents/skills/opentui/references/solid/gotchas.md +427 -0
  170. package/.agents/skills/opentui/references/solid/patterns.md +560 -0
  171. package/.agents/skills/opentui/references/testing/REFERENCE.md +614 -0
  172. package/.agents/skills/optimize/SKILL.md +266 -0
  173. package/.agents/skills/overdrive/SKILL.md +142 -0
  174. package/.agents/skills/pdf/LICENSE.txt +30 -0
  175. package/.agents/skills/pdf/SKILL.md +314 -0
  176. package/.agents/skills/pdf/forms.md +294 -0
  177. package/.agents/skills/pdf/reference.md +612 -0
  178. package/.agents/skills/pdf/scripts/check_bounding_boxes.py +65 -0
  179. package/.agents/skills/pdf/scripts/check_fillable_fields.py +11 -0
  180. package/.agents/skills/pdf/scripts/convert_pdf_to_images.py +33 -0
  181. package/.agents/skills/pdf/scripts/create_validation_image.py +37 -0
  182. package/.agents/skills/pdf/scripts/extract_form_field_info.py +122 -0
  183. package/.agents/skills/pdf/scripts/extract_form_structure.py +115 -0
  184. package/.agents/skills/pdf/scripts/fill_fillable_fields.py +98 -0
  185. package/.agents/skills/pdf/scripts/fill_pdf_form_with_annotations.py +107 -0
  186. package/.agents/skills/playwright-cli/SKILL.md +344 -0
  187. package/.agents/skills/playwright-cli/references/element-attributes.md +23 -0
  188. package/.agents/skills/playwright-cli/references/playwright-tests.md +39 -0
  189. package/.agents/skills/playwright-cli/references/request-mocking.md +87 -0
  190. package/.agents/skills/playwright-cli/references/running-code.md +231 -0
  191. package/.agents/skills/playwright-cli/references/session-management.md +169 -0
  192. package/.agents/skills/playwright-cli/references/storage-state.md +275 -0
  193. package/.agents/skills/playwright-cli/references/test-generation.md +88 -0
  194. package/.agents/skills/playwright-cli/references/tracing.md +139 -0
  195. package/.agents/skills/playwright-cli/references/video-recording.md +143 -0
  196. package/.agents/skills/polish/SKILL.md +224 -0
  197. package/.agents/skills/pptx/LICENSE.txt +30 -0
  198. package/.agents/skills/pptx/SKILL.md +232 -0
  199. package/.agents/skills/pptx/editing.md +205 -0
  200. package/.agents/skills/pptx/pptxgenjs.md +420 -0
  201. package/.agents/skills/pptx/scripts/__init__.py +0 -0
  202. package/.agents/skills/pptx/scripts/add_slide.py +195 -0
  203. package/.agents/skills/pptx/scripts/clean.py +286 -0
  204. package/.agents/skills/pptx/scripts/office/helpers/__init__.py +0 -0
  205. package/.agents/skills/pptx/scripts/office/helpers/merge_runs.py +199 -0
  206. package/.agents/skills/pptx/scripts/office/helpers/simplify_redlines.py +197 -0
  207. package/.agents/skills/pptx/scripts/office/pack.py +159 -0
  208. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  209. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  210. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  211. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  212. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  213. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  214. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  215. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  216. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  217. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  218. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  219. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  220. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  221. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  222. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  223. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  224. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  225. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  226. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  227. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  228. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  229. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  230. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  231. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  232. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  233. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  234. package/.agents/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  235. package/.agents/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  236. package/.agents/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  237. package/.agents/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  238. package/.agents/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  239. package/.agents/skills/pptx/scripts/office/schemas/mce/mc.xsd +75 -0
  240. package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
  241. package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
  242. package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
  243. package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
  244. package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
  245. package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  246. package/.agents/skills/pptx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
  247. package/.agents/skills/pptx/scripts/office/soffice.py +183 -0
  248. package/.agents/skills/pptx/scripts/office/unpack.py +132 -0
  249. package/.agents/skills/pptx/scripts/office/validate.py +111 -0
  250. package/.agents/skills/pptx/scripts/office/validators/__init__.py +15 -0
  251. package/.agents/skills/pptx/scripts/office/validators/base.py +847 -0
  252. package/.agents/skills/pptx/scripts/office/validators/docx.py +446 -0
  253. package/.agents/skills/pptx/scripts/office/validators/pptx.py +275 -0
  254. package/.agents/skills/pptx/scripts/office/validators/redlining.py +247 -0
  255. package/.agents/skills/pptx/scripts/thumbnail.py +289 -0
  256. package/.agents/skills/project-development/SKILL.md +291 -0
  257. package/.agents/skills/project-development/references/case-studies.md +388 -0
  258. package/.agents/skills/project-development/references/pipeline-patterns.md +610 -0
  259. package/.agents/skills/project-development/scripts/pipeline_template.py +796 -0
  260. package/.agents/skills/prompt-engineer/SKILL.md +263 -0
  261. package/.agents/skills/prompt-engineer/references/advanced_patterns.md +271 -0
  262. package/.agents/skills/prompt-engineer/references/core_prompting.md +137 -0
  263. package/.agents/skills/prompt-engineer/references/quality_improvement.md +193 -0
  264. package/.agents/skills/quieter/SKILL.md +103 -0
  265. package/.agents/skills/research-codebase/SKILL.md +227 -0
  266. package/.agents/skills/shape/SKILL.md +96 -0
  267. package/.agents/skills/skill-creator/LICENSE.txt +202 -0
  268. package/.agents/skills/skill-creator/SKILL.md +485 -0
  269. package/.agents/skills/skill-creator/agents/analyzer.md +274 -0
  270. package/.agents/skills/skill-creator/agents/comparator.md +202 -0
  271. package/.agents/skills/skill-creator/agents/grader.md +223 -0
  272. package/.agents/skills/skill-creator/assets/eval_review.html +146 -0
  273. package/.agents/skills/skill-creator/eval-viewer/generate_review.py +471 -0
  274. package/.agents/skills/skill-creator/eval-viewer/viewer.html +1325 -0
  275. package/.agents/skills/skill-creator/references/schemas.md +430 -0
  276. package/.agents/skills/skill-creator/scripts/__init__.py +0 -0
  277. package/.agents/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
  278. package/.agents/skills/skill-creator/scripts/generate_report.py +326 -0
  279. package/.agents/skills/skill-creator/scripts/improve_description.py +247 -0
  280. package/.agents/skills/skill-creator/scripts/package_skill.py +136 -0
  281. package/.agents/skills/skill-creator/scripts/quick_validate.py +103 -0
  282. package/.agents/skills/skill-creator/scripts/run_eval.py +310 -0
  283. package/.agents/skills/skill-creator/scripts/run_loop.py +328 -0
  284. package/.agents/skills/skill-creator/scripts/utils.py +47 -0
  285. package/.agents/skills/sl-commit/SKILL.md +51 -0
  286. package/.agents/skills/sl-submit-diff/SKILL.md +55 -0
  287. package/.agents/skills/teach-impeccable/SKILL.md +71 -0
  288. package/.agents/skills/test-driven-development/SKILL.md +371 -0
  289. package/.agents/skills/test-driven-development/testing-anti-patterns.md +299 -0
  290. package/.agents/skills/tool-design/SKILL.md +271 -0
  291. package/.agents/skills/tool-design/references/architectural_reduction.md +210 -0
  292. package/.agents/skills/tool-design/references/best_practices.md +176 -0
  293. package/.agents/skills/tool-design/scripts/description_generator.py +528 -0
  294. package/.agents/skills/typescript-advanced-types/SKILL.md +719 -0
  295. package/.agents/skills/typescript-expert/SKILL.md +428 -0
  296. package/.agents/skills/typescript-expert/references/tsconfig-strict.json +92 -0
  297. package/.agents/skills/typescript-expert/references/typescript-cheatsheet.md +383 -0
  298. package/.agents/skills/typescript-expert/references/utility-types.ts +335 -0
  299. package/.agents/skills/typescript-expert/scripts/ts_diagnostic.py +203 -0
  300. package/.agents/skills/typescript-react-reviewer/SKILL.md +200 -0
  301. package/.agents/skills/typescript-react-reviewer/references/antipatterns.md +510 -0
  302. package/.agents/skills/typescript-react-reviewer/references/checklist.md +267 -0
  303. package/.agents/skills/typescript-react-reviewer/references/react19-patterns.md +305 -0
  304. package/.agents/skills/typeset/SKILL.md +116 -0
  305. package/.agents/skills/workflow-creator/SKILL.md +337 -0
  306. package/.agents/skills/workflow-creator/references/agent-sessions.md +789 -0
  307. package/.agents/skills/workflow-creator/references/computation-and-validation.md +224 -0
  308. package/.agents/skills/workflow-creator/references/control-flow.md +450 -0
  309. package/.agents/skills/workflow-creator/references/discovery-and-verification.md +156 -0
  310. package/.agents/skills/workflow-creator/references/failure-modes.md +732 -0
  311. package/.agents/skills/workflow-creator/references/getting-started.md +289 -0
  312. package/.agents/skills/workflow-creator/references/session-config.md +355 -0
  313. package/.agents/skills/workflow-creator/references/state-and-data-flow.md +374 -0
  314. package/.agents/skills/workflow-creator/references/user-input.md +206 -0
  315. package/.agents/skills/workflow-creator/references/workflow-inputs.md +274 -0
  316. package/.agents/skills/xlsx/LICENSE.txt +30 -0
  317. package/.agents/skills/xlsx/SKILL.md +292 -0
  318. package/.agents/skills/xlsx/scripts/office/helpers/__init__.py +0 -0
  319. package/.agents/skills/xlsx/scripts/office/helpers/merge_runs.py +199 -0
  320. package/.agents/skills/xlsx/scripts/office/helpers/simplify_redlines.py +197 -0
  321. package/.agents/skills/xlsx/scripts/office/pack.py +159 -0
  322. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  323. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  324. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  325. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  326. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  327. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  328. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  329. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  330. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  331. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  332. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  333. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  334. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  335. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  336. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  337. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  338. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  339. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  340. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  341. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  342. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  343. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  344. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  345. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  346. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  347. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  348. package/.agents/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  349. package/.agents/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  350. package/.agents/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  351. package/.agents/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  352. package/.agents/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  353. package/.agents/skills/xlsx/scripts/office/schemas/mce/mc.xsd +75 -0
  354. package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
  355. package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
  356. package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
  357. package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
  358. package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
  359. package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  360. package/.agents/skills/xlsx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
  361. package/.agents/skills/xlsx/scripts/office/soffice.py +183 -0
  362. package/.agents/skills/xlsx/scripts/office/unpack.py +132 -0
  363. package/.agents/skills/xlsx/scripts/office/validate.py +111 -0
  364. package/.agents/skills/xlsx/scripts/office/validators/__init__.py +15 -0
  365. package/.agents/skills/xlsx/scripts/office/validators/base.py +847 -0
  366. package/.agents/skills/xlsx/scripts/office/validators/docx.py +446 -0
  367. package/.agents/skills/xlsx/scripts/office/validators/pptx.py +275 -0
  368. package/.agents/skills/xlsx/scripts/office/validators/redlining.py +247 -0
  369. package/.agents/skills/xlsx/scripts/recalc.py +184 -0
  370. package/.claude/agents/reviewer.md +1 -0
  371. package/.github/agents/reviewer.md +1 -0
  372. package/.opencode/agents/reviewer.md +1 -0
  373. package/README.md +274 -169
  374. package/package.json +6 -7
  375. package/src/commands/cli/init/index.ts +2 -2
  376. package/src/commands/cli/init/scm.ts +7 -8
  377. package/src/commands/cli/workflow-command.test.ts +74 -0
  378. package/src/commands/cli/workflow.ts +7 -2
  379. package/src/scripts/bundle-configs.ts +128 -0
  380. package/src/sdk/components/compact-switcher.tsx +1 -1
  381. package/src/sdk/components/orchestrator-panel-store.ts +13 -0
  382. package/src/sdk/components/orchestrator-panel.tsx +10 -0
  383. package/src/sdk/components/statusline.tsx +13 -1
  384. package/src/sdk/providers/claude.ts +42 -0
  385. package/src/sdk/runtime/executor.ts +111 -32
  386. package/src/sdk/types.ts +7 -0
  387. package/src/sdk/workflows/builtin/ralph/claude/index.ts +132 -76
  388. package/src/sdk/workflows/builtin/ralph/copilot/index.ts +129 -71
  389. package/src/sdk/workflows/builtin/ralph/helpers/git.ts +184 -17
  390. package/src/sdk/workflows/builtin/ralph/helpers/prompts.ts +463 -79
  391. package/src/sdk/workflows/builtin/ralph/opencode/index.ts +124 -80
  392. package/src/services/system/auto-sync.ts +31 -51
  393. package/src/services/system/skills.ts +56 -60
  394. package/dist/lib/path-root-guard.d.ts +0 -4
  395. package/dist/lib/path-root-guard.d.ts.map +0 -1
  396. package/dist/sdk/components/color-utils.d.ts +0 -4
  397. package/dist/sdk/components/color-utils.d.ts.map +0 -1
  398. package/dist/sdk/components/compact-switcher.d.ts +0 -10
  399. package/dist/sdk/components/compact-switcher.d.ts.map +0 -1
  400. package/dist/sdk/components/connectors.d.ts +0 -15
  401. package/dist/sdk/components/connectors.d.ts.map +0 -1
  402. package/dist/sdk/components/connectors.test.d.ts +0 -2
  403. package/dist/sdk/components/connectors.test.d.ts.map +0 -1
  404. package/dist/sdk/components/edge.d.ts +0 -4
  405. package/dist/sdk/components/edge.d.ts.map +0 -1
  406. package/dist/sdk/components/error-boundary.d.ts +0 -23
  407. package/dist/sdk/components/error-boundary.d.ts.map +0 -1
  408. package/dist/sdk/components/graph-theme.d.ts +0 -17
  409. package/dist/sdk/components/graph-theme.d.ts.map +0 -1
  410. package/dist/sdk/components/header.d.ts +0 -3
  411. package/dist/sdk/components/header.d.ts.map +0 -1
  412. package/dist/sdk/components/hooks.d.ts +0 -15
  413. package/dist/sdk/components/hooks.d.ts.map +0 -1
  414. package/dist/sdk/components/layout.d.ts +0 -27
  415. package/dist/sdk/components/layout.d.ts.map +0 -1
  416. package/dist/sdk/components/layout.test.d.ts +0 -2
  417. package/dist/sdk/components/layout.test.d.ts.map +0 -1
  418. package/dist/sdk/components/node-card.d.ts +0 -10
  419. package/dist/sdk/components/node-card.d.ts.map +0 -1
  420. package/dist/sdk/components/orchestrator-panel-contexts.d.ts +0 -16
  421. package/dist/sdk/components/orchestrator-panel-contexts.d.ts.map +0 -1
  422. package/dist/sdk/components/orchestrator-panel-store.d.ts +0 -46
  423. package/dist/sdk/components/orchestrator-panel-store.d.ts.map +0 -1
  424. package/dist/sdk/components/orchestrator-panel-store.test.d.ts +0 -2
  425. package/dist/sdk/components/orchestrator-panel-store.test.d.ts.map +0 -1
  426. package/dist/sdk/components/orchestrator-panel-types.d.ts +0 -18
  427. package/dist/sdk/components/orchestrator-panel-types.d.ts.map +0 -1
  428. package/dist/sdk/components/orchestrator-panel.d.ts +0 -52
  429. package/dist/sdk/components/orchestrator-panel.d.ts.map +0 -1
  430. package/dist/sdk/components/session-graph-panel.d.ts +0 -7
  431. package/dist/sdk/components/session-graph-panel.d.ts.map +0 -1
  432. package/dist/sdk/components/status-helpers.d.ts +0 -6
  433. package/dist/sdk/components/status-helpers.d.ts.map +0 -1
  434. package/dist/sdk/components/statusline.d.ts +0 -7
  435. package/dist/sdk/components/statusline.d.ts.map +0 -1
  436. package/dist/sdk/components/workflow-picker-panel.d.ts +0 -123
  437. package/dist/sdk/components/workflow-picker-panel.d.ts.map +0 -1
  438. package/dist/sdk/define-workflow.d.ts +0 -78
  439. package/dist/sdk/define-workflow.d.ts.map +0 -1
  440. package/dist/sdk/define-workflow.test.d.ts +0 -2
  441. package/dist/sdk/define-workflow.test.d.ts.map +0 -1
  442. package/dist/sdk/errors.d.ts +0 -24
  443. package/dist/sdk/errors.d.ts.map +0 -1
  444. package/dist/sdk/errors.test.d.ts +0 -2
  445. package/dist/sdk/errors.test.d.ts.map +0 -1
  446. package/dist/sdk/index.d.ts +0 -13
  447. package/dist/sdk/index.d.ts.map +0 -1
  448. package/dist/sdk/providers/claude.d.ts +0 -170
  449. package/dist/sdk/providers/claude.d.ts.map +0 -1
  450. package/dist/sdk/providers/copilot.d.ts +0 -11
  451. package/dist/sdk/providers/copilot.d.ts.map +0 -1
  452. package/dist/sdk/providers/opencode.d.ts +0 -11
  453. package/dist/sdk/providers/opencode.d.ts.map +0 -1
  454. package/dist/sdk/runtime/discovery.d.ts +0 -86
  455. package/dist/sdk/runtime/discovery.d.ts.map +0 -1
  456. package/dist/sdk/runtime/executor-entry.d.ts +0 -11
  457. package/dist/sdk/runtime/executor-entry.d.ts.map +0 -1
  458. package/dist/sdk/runtime/executor.d.ts +0 -72
  459. package/dist/sdk/runtime/executor.d.ts.map +0 -1
  460. package/dist/sdk/runtime/executor.test.d.ts +0 -2
  461. package/dist/sdk/runtime/executor.test.d.ts.map +0 -1
  462. package/dist/sdk/runtime/graph-inference.d.ts +0 -35
  463. package/dist/sdk/runtime/graph-inference.d.ts.map +0 -1
  464. package/dist/sdk/runtime/loader.d.ts +0 -70
  465. package/dist/sdk/runtime/loader.d.ts.map +0 -1
  466. package/dist/sdk/runtime/panel.d.ts +0 -9
  467. package/dist/sdk/runtime/panel.d.ts.map +0 -1
  468. package/dist/sdk/runtime/theme.d.ts +0 -28
  469. package/dist/sdk/runtime/theme.d.ts.map +0 -1
  470. package/dist/sdk/runtime/tmux.d.ts +0 -297
  471. package/dist/sdk/runtime/tmux.d.ts.map +0 -1
  472. package/dist/sdk/types.d.ts +0 -295
  473. package/dist/sdk/types.d.ts.map +0 -1
  474. package/dist/sdk/workflows/builtin/deep-research-codebase/claude/index.d.ts +0 -62
  475. package/dist/sdk/workflows/builtin/deep-research-codebase/claude/index.d.ts.map +0 -1
  476. package/dist/sdk/workflows/builtin/deep-research-codebase/copilot/index.d.ts +0 -46
  477. package/dist/sdk/workflows/builtin/deep-research-codebase/copilot/index.d.ts.map +0 -1
  478. package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/heuristic.d.ts +0 -26
  479. package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/heuristic.d.ts.map +0 -1
  480. package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/prompts.d.ts +0 -92
  481. package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/prompts.d.ts.map +0 -1
  482. package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/scout.d.ts +0 -57
  483. package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/scout.d.ts.map +0 -1
  484. package/dist/sdk/workflows/builtin/deep-research-codebase/opencode/index.d.ts +0 -49
  485. package/dist/sdk/workflows/builtin/deep-research-codebase/opencode/index.d.ts.map +0 -1
  486. package/dist/sdk/workflows/builtin/ralph/claude/index.d.ts +0 -14
  487. package/dist/sdk/workflows/builtin/ralph/claude/index.d.ts.map +0 -1
  488. package/dist/sdk/workflows/builtin/ralph/copilot/index.d.ts +0 -14
  489. package/dist/sdk/workflows/builtin/ralph/copilot/index.d.ts.map +0 -1
  490. package/dist/sdk/workflows/builtin/ralph/helpers/git.d.ts +0 -17
  491. package/dist/sdk/workflows/builtin/ralph/helpers/git.d.ts.map +0 -1
  492. package/dist/sdk/workflows/builtin/ralph/helpers/prompts.d.ts +0 -119
  493. package/dist/sdk/workflows/builtin/ralph/helpers/prompts.d.ts.map +0 -1
  494. package/dist/sdk/workflows/builtin/ralph/helpers/review.d.ts +0 -20
  495. package/dist/sdk/workflows/builtin/ralph/helpers/review.d.ts.map +0 -1
  496. package/dist/sdk/workflows/builtin/ralph/opencode/index.d.ts +0 -14
  497. package/dist/sdk/workflows/builtin/ralph/opencode/index.d.ts.map +0 -1
  498. package/dist/sdk/workflows/index.d.ts +0 -24
  499. package/dist/sdk/workflows/index.d.ts.map +0 -1
  500. package/dist/services/config/definitions.d.ts +0 -85
  501. package/dist/services/config/definitions.d.ts.map +0 -1
  502. package/dist/services/system/copy.d.ts +0 -77
  503. package/dist/services/system/copy.d.ts.map +0 -1
  504. package/dist/services/system/detect.d.ts +0 -75
  505. package/dist/services/system/detect.d.ts.map +0 -1
  506. package/tsconfig.json +0 -33
@@ -0,0 +1,732 @@
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-sub-agent-messages-pollute-getmessages-stream) | Copilot: sub-agent 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-claudequery-output-includes-tui-scrollback-not-just-the-last-turn) | Claude: `s.session.query()` output includes TUI scrollback, not just the last turn | 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-manual-claude-session-initialization-resolved-by-runtime) | ~~Manual Claude session initialization~~ (resolved by runtime) | Claude | N/A |
44
+ | [F12](#f12-resume-session-tries-to-swap-agents) | Resume session tries to swap agents | Copilot, OpenCode | loud |
45
+ | [F13](#f13-parallel-siblings-read-each-others-transcripts) | Parallel siblings read each other's transcripts | all | loud |
46
+ | [F14](#f14-forgetting-to-await-ctxstage) | Forgetting to `await` `ctx.stage()` | all | silent |
47
+ | [F15](#f15-using-a-pending-sessionhandle-before-completion) | Using a pending `SessionHandle` before completion | all | silent |
48
+ | [F16](#f16-headless-stage-errors-are-invisible-in-the-graph) | Headless stage errors are invisible in the graph | all | silent |
49
+
50
+ ---
51
+
52
+ ## F1. Copilot: `getLastAssistantText` returns empty string
53
+
54
+ **Symptom.** The orchestrator (or any downstream stage) receives an empty
55
+ `plannerNotes` / `reviewerOutput` despite the prior agent running successfully
56
+ and producing visible output in the TUI.
57
+
58
+ **Root cause.** Copilot emits an **empty terminating `assistant.message` event**
59
+ after every turn that included a tool call. The actual prose + toolRequests
60
+ live in the earlier `assistant.message` event; the trailing one has
61
+ `content: ""` and no `toolRequests`. Picking `.at(-1).data.content` reliably
62
+ lands on the empty terminator and throws away the real content.
63
+
64
+ Verified empirically with a toy script against Copilot CLI 1.0.22: a
65
+ single-turn "think then call tool" prompt produced 2 assistant.message
66
+ events, `[{length: 512, toolRequests: 1}, {length: 0, toolRequests: 0}]`.
67
+ The second one is what `.at(-1)` returns.
68
+
69
+ The event type carries both `content: string` and `toolRequests?: [...]` —
70
+ see `node_modules/@github/copilot-sdk/dist/generated/session-events.d.ts:1408-1455`.
71
+
72
+ This means the bug affects **any** stage whose final turn includes a tool
73
+ call — not just tool-calls-only turns. Planner, reviewer, debugger, and
74
+ orchestrator stages all hit it if they end on a tool invocation.
75
+
76
+ **Affected SDKs.** Copilot only.
77
+
78
+ ### ❌ Wrong
79
+
80
+ ```ts
81
+ function getLastAssistantText(messages: SessionEvent[]): string {
82
+ const assistantMessages = messages.filter(
83
+ (m): m is Extract<SessionEvent, { type: "assistant.message" }> =>
84
+ m.type === "assistant.message",
85
+ );
86
+ return assistantMessages.at(-1)?.data.content ?? "";
87
+ }
88
+ ```
89
+
90
+ ### ✅ Right
91
+
92
+ ```ts
93
+ /** Concatenate every top-level assistant turn's non-empty content. */
94
+ function getAssistantText(messages: SessionEvent[]): string {
95
+ return messages
96
+ .filter(
97
+ (m): m is Extract<SessionEvent, { type: "assistant.message" }> =>
98
+ m.type === "assistant.message" && !m.data.parentToolCallId,
99
+ )
100
+ .map((m) => m.data.content)
101
+ .filter((c) => c.length > 0)
102
+ .join("\n\n");
103
+ }
104
+ ```
105
+
106
+ **Detection.** Log the returned text length after every `runAgent` call
107
+ during development. An empty or surprisingly short string for a stage
108
+ that clearly ran is the signature.
109
+
110
+ ---
111
+
112
+ ## F2. Copilot: sub-agent messages pollute `getMessages()` stream
113
+
114
+ **Symptom.** Downstream stages receive a snippet of text that doesn't match
115
+ what the top-level agent said — it looks like a sub-agent's output.
116
+
117
+ **Root cause.** `assistant.message` events carry a `parentToolCallId?: string`
118
+ field, documented as *"Tool call ID of the parent tool invocation when this
119
+ event originates from a sub-agent"*. When the top-level agent delegates,
120
+ `getMessages()` returns **the complete history including sub-agent messages**.
121
+ Filters that don't exclude `parentToolCallId` can pick a sub-agent's final
122
+ message via `.at(-1)`.
123
+
124
+ **Affected SDKs.** Copilot.
125
+
126
+ ### ❌ Wrong
127
+
128
+ ```ts
129
+ messages.filter((m) => m.type === "assistant.message")
130
+ ```
131
+
132
+ ### ✅ Right
133
+
134
+ ```ts
135
+ messages.filter(
136
+ (m) => m.type === "assistant.message" && !m.data.parentToolCallId,
137
+ )
138
+ ```
139
+
140
+ **Detection.** Same as F1 — diff what you extract against the TUI
141
+ scrollback for the top-level agent.
142
+
143
+ ---
144
+
145
+ ## F3. OpenCode: `result.data.parts` contains non-text parts
146
+
147
+ **Symptom.** Concatenated response text contains `[object Object]`,
148
+ truncated content, or swallows tool-call payloads into the prompt.
149
+
150
+ **Root cause.** `client.session.prompt()` returns `result.data.parts: Part[]`
151
+ where parts can be `type: "text" | "tool" | "file" | "reasoning" | ...`.
152
+ Naive `.map(p => p.text).join()` emits `undefined` for non-text parts.
153
+
154
+ **Affected SDKs.** OpenCode.
155
+
156
+ ### ❌ Wrong
157
+
158
+ ```ts
159
+ const text = result.data!.parts.map((p) => p.text).join("\n");
160
+ ```
161
+
162
+ ### ✅ Right
163
+
164
+ ```ts
165
+ function extractResponseText(
166
+ parts: Array<{ type: string; [key: string]: unknown }>,
167
+ ): string {
168
+ return parts
169
+ .filter((p) => p.type === "text")
170
+ .map((p) => (p as { type: string; text: string }).text)
171
+ .join("\n");
172
+ }
173
+ ```
174
+
175
+ **Detection.** Grep extracted text for `[object Object]` or `undefined`.
176
+
177
+ ---
178
+
179
+ ## F4. Claude: `s.session.query()` output includes TUI scrollback, not just the last turn
180
+
181
+ **Symptom.** Parsers matching "the last fenced JSON block" pick up an old
182
+ turn's JSON because the captured output contains multiple turns of scrollback.
183
+
184
+ **Root cause.** `s.session.query()` captures the tmux pane's visible scrollback after output stabilizes — it's not a scoped
185
+ "this call's response only" string. Earlier sub-agent output, prior-turn
186
+ assistant text, and even the user's own prompt echo all end up in
187
+ `result.output`.
188
+
189
+ **Affected SDKs.** Claude (tmux-based query).
190
+
191
+ ### ❌ Wrong
192
+
193
+ ```ts
194
+ // Assumes `output` is only the latest turn's JSON
195
+ const parsed = JSON.parse(reviewResult.output);
196
+ ```
197
+
198
+ ### ✅ Right — extract the LAST fenced block, not the first
199
+
200
+ ```ts
201
+ export function extractLastFencedBlock(
202
+ content: string,
203
+ lang = "json",
204
+ ): string | null {
205
+ const re = new RegExp("```" + lang + "\\s*\\n([\\s\\S]*?)\\n```", "g");
206
+ let last: string | null = null;
207
+ let match: RegExpExecArray | null;
208
+ while ((match = re.exec(content)) !== null) {
209
+ if (match[1]) last = match[1];
210
+ }
211
+ return last;
212
+ }
213
+ ```
214
+
215
+ The ralph helpers in `src/sdk/workflows/builtin/ralph/helpers/prompts.ts`
216
+ (`parseReviewResult`, `extractMarkdownBlock`) use this pattern — always take
217
+ the **last** block, never the first.
218
+
219
+ **Detection.** Run the workflow twice in the same session; if the
220
+ downstream parser returns stale data from the prior iteration, F4 is the
221
+ cause.
222
+
223
+ ---
224
+
225
+ ## F5. Fresh session wipes prior stage context
226
+
227
+ **Symptom.** The orchestrator says "I don't see a task list" or "what
228
+ specification are you referring to?" even though the planner clearly ran.
229
+
230
+ **Root cause.** `client.createSession()` / `client.session.create()` always
231
+ returns a **fresh, empty conversation**. The CLIENT object is just the
232
+ transport — each session is independent. The new session sees only what you
233
+ put in its first prompt.
234
+
235
+ **Affected SDKs.** Copilot, OpenCode. (Claude's tmux pane model is
236
+ different — context accumulates in the same pane, so this failure mode
237
+ does NOT apply to `s.session.query()`.)
238
+
239
+ ### ❌ Wrong
240
+
241
+ ```ts
242
+ await runAgent("planner", buildPlannerPrompt((ctx.inputs.prompt ?? "")));
243
+ // orchestrator is a fresh session — it has no idea what the planner produced
244
+ await runAgent("orchestrator", buildOrchestratorPrompt());
245
+ ```
246
+
247
+ ### ✅ Right — explicit handoff
248
+
249
+ ```ts
250
+ const plannerNotes = await runAgent("planner", buildPlannerPrompt((ctx.inputs.prompt ?? "")));
251
+ await runAgent(
252
+ "orchestrator",
253
+ buildOrchestratorPrompt((ctx.inputs.prompt ?? ""), { plannerNotes }),
254
+ );
255
+ ```
256
+
257
+ Alternatives: write to shared state (`TaskCreate`/`TaskList`, files, git) and
258
+ have the next stage read from there, or keep the follow-up inside the same
259
+ stage callback when it needs the full live conversation. Provider-level resume
260
+ is an advanced same-role escape hatch, not the normal stage-to-stage handoff.
261
+
262
+ **Full write-up.** `agent-sessions.md` §"Critical pitfall: session lifecycle
263
+ controls what context is available".
264
+
265
+ ---
266
+
267
+ ## F6. Planner prompts that don't request trailing commentary produce empty handoffs
268
+
269
+ **Symptom.** F1 / F5 are fixed, extraction is correct — and the orchestrator
270
+ still receives empty `plannerNotes` because the planner's last turn legitimately
271
+ had no prose.
272
+
273
+ **Root cause.** This is a **prompt engineering** bug, not a code bug. When a
274
+ prompt ends with "call `TaskList` to verify" and does not explicitly ask for
275
+ trailing commentary, many models end the turn with just the tool call and
276
+ no text at all. There's nothing in any turn's `content` to extract because
277
+ the model never wrote any.
278
+
279
+ **Affected SDKs.** All three — though Claude's pane scrollback masks it by
280
+ still capturing something visible.
281
+
282
+ ### ❌ Wrong — silent handoff
283
+
284
+ ```ts
285
+ return `# Planning
286
+
287
+ ${spec}
288
+
289
+ Decompose the specification into tasks via TaskCreate. After creating all
290
+ tasks, call TaskList to verify.`;
291
+ ```
292
+
293
+ ### ✅ Right — explicit trailing commentary requirement
294
+
295
+ ```ts
296
+ return `# Planning
297
+
298
+ ${spec}
299
+
300
+ Decompose the specification into tasks via TaskCreate. After creating all
301
+ tasks, call TaskList to verify.
302
+
303
+ ## Final output (required)
304
+
305
+ After the TaskList call, write a short "Handoff Notes" section with:
306
+ - Risks or ambiguities the orchestrator must know about
307
+ - Any assumptions you made that could be wrong
308
+ - Ordering constraints that don't fit into task bodies
309
+
310
+ The orchestrator will run in a fresh session — anything not in your
311
+ TaskCreate calls or this section will be lost.`;
312
+ ```
313
+
314
+ **Pair this fix with F1.** Even with the correct extraction helper, you need
315
+ the model to actually produce text for the helper to extract.
316
+
317
+ **Detection.** Log the extracted handoff text during development. An empty
318
+ string + a correctly-fixed extraction helper = F6.
319
+
320
+ ---
321
+
322
+ ## F7. Continued sessions accumulate state across loop iterations (lost-in-middle)
323
+
324
+ **Symptom.** A review/fix loop works on iterations 1-3 then starts
325
+ producing worse output — misidentifying files, hallucinating line numbers,
326
+ or "forgetting" a requirement that was clearly stated in the original spec.
327
+
328
+ **Root cause.** Each loop iteration adds turns to the same continued
329
+ session, and context grows past the attention window. The model starts
330
+ dropping middle-of-context information (classic lost-in-middle).
331
+
332
+ **Affected SDKs.** All three. Claude's long tmux pane is especially
333
+ vulnerable because the scrollback captures every intermediate turn.
334
+
335
+ ### ❌ Wrong — unbounded loop on a single session
336
+
337
+ ```ts
338
+ await ctx.stage({ name: "review-loop" }, {}, {}, async (s) => {
339
+ for (let i = 0; i < 20; i++) {
340
+ await s.session.query(buildReviewPrompt());
341
+ await s.session.query(buildFixPrompt());
342
+ }
343
+ });
344
+ ```
345
+
346
+ ### ✅ Right — compact or reset between iterations
347
+
348
+ Options, in order of preference:
349
+
350
+ 1. **Compact** — summarize prior turns via the SDK's compaction mechanism
351
+ (Claude's `/compact`, OpenCode's summarizer, a sidecar summarization call
352
+ for Copilot). Keeps decisions and file paths; drops verbose tool output.
353
+ 2. **Offload to files** — write intermediate findings to files and reference
354
+ them by path in the next iteration's prompt (`filesystem-context` skill).
355
+ 3. **Fresh session per iteration with explicit handoff** — see F5's pattern;
356
+ lose the in-session reasoning but gain a clean context window.
357
+
358
+ ```ts
359
+ await ctx.stage({ name: "review-loop" }, {}, {}, async (s) => {
360
+ const MAX_TURNS_BEFORE_COMPACT = 10;
361
+ let turnsSinceCompact = 0;
362
+
363
+ for (let i = 0; i < MAX_ITERATIONS; i++) {
364
+ if (turnsSinceCompact >= MAX_TURNS_BEFORE_COMPACT) {
365
+ await s.session.query("/compact");
366
+ turnsSinceCompact = 0;
367
+ }
368
+ await s.session.query(buildReviewPrompt());
369
+ turnsSinceCompact += 1;
370
+ }
371
+ });
372
+ ```
373
+
374
+ **Consult.** `context-degradation`, `context-compression`, `context-optimization`.
375
+
376
+ **Detection.** Quality-vs-iteration chart. If quality degrades past
377
+ iteration N, N is your safe-turn budget before compaction.
378
+
379
+ ---
380
+
381
+ ## F8. Fenced-block parsers break when the model adds prose
382
+
383
+ **Symptom.** `JSON.parse(content)` throws, or a "matches the first fenced
384
+ block" regex picks up a code example inside prose instead of the actual
385
+ structured output.
386
+
387
+ **Root cause.** A prompt asks for `only JSON inside a single fenced block`
388
+ and the model adds a sentence of explanation, a "# Summary" heading, or
389
+ quotes a snippet of its own reasoning in a code fence earlier in the reply.
390
+
391
+ **Affected SDKs.** All three — this is a model-behavior issue, not
392
+ SDK-specific.
393
+
394
+ ### ❌ Wrong
395
+
396
+ ```ts
397
+ const parsed = JSON.parse(content);
398
+ // or:
399
+ const match = content.match(/```json\n([\s\S]*?)\n```/);
400
+ ```
401
+
402
+ ### ✅ Right — layered fallback: direct parse → last fenced block → last balanced object
403
+
404
+ ```ts
405
+ export function parseReviewResult(content: string): ReviewResult | null {
406
+ // 1. Direct JSON
407
+ try {
408
+ const parsed = JSON.parse(content);
409
+ if (parsed?.findings && parsed?.overall_correctness) return parsed;
410
+ } catch { /* fall through */ }
411
+
412
+ // 2. LAST fenced code block (not the first — prose often quotes examples)
413
+ const blockRe = /```(?:json)?\s*\n([\s\S]*?)\n```/g;
414
+ let lastBlock: string | null = null;
415
+ let m: RegExpExecArray | null;
416
+ while ((m = blockRe.exec(content)) !== null) {
417
+ if (m[1]) lastBlock = m[1];
418
+ }
419
+ if (lastBlock) {
420
+ try {
421
+ const parsed = JSON.parse(lastBlock);
422
+ if (parsed?.findings && parsed?.overall_correctness) return parsed;
423
+ } catch { /* fall through */ }
424
+ }
425
+
426
+ // 3. Last balanced object containing the required key
427
+ // (implementation in src/sdk/workflows/builtin/ralph/helpers/prompts.ts)
428
+ return null;
429
+ }
430
+ ```
431
+
432
+ **Detection.** Fuzz test the parser against real model output captured
433
+ over several runs. If 1 in 20 runs fails to parse, you have F8.
434
+
435
+ ---
436
+
437
+ ## F9. `s.save()` receives the wrong shape
438
+
439
+ **Symptom.** `s.transcript("stage-name")` returns an empty or malformed
440
+ `content` string in the next stage.
441
+
442
+ **Root cause.** Each SDK has a different contract for what `s.save()`
443
+ expects, and the runtime doesn't type-check the argument beyond "anything".
444
+
445
+ **Affected SDKs.** All three — the mistake is in the workflow author's code.
446
+
447
+ ### Correct shapes
448
+
449
+ | SDK | Correct argument |
450
+ |---|---|
451
+ | Claude | `s.save(s.sessionId)` — pass the session ID; the runtime reads the transcript file |
452
+ | Copilot | `s.save(await s.session.getMessages())` — pass `SessionEvent[]` |
453
+ | OpenCode | `s.save(result.data!)` — pass the `{ info, parts }` object |
454
+
455
+ ### ❌ Wrong
456
+
457
+ ```ts
458
+ // Claude — saves the wrong thing
459
+ s.save(result.output);
460
+
461
+ // Copilot — saves an empty array if called before send
462
+ s.save(await s.session.getMessages());
463
+ // Or saves one message object instead of the array
464
+ s.save((await s.session.getMessages()).at(-1));
465
+
466
+ // OpenCode — missing the data unwrap
467
+ s.save(result);
468
+ ```
469
+
470
+ ### ✅ Right
471
+
472
+ See the per-SDK examples in `SKILL.md` §"Write the Workflow File" and the
473
+ `SessionContext` reference table.
474
+
475
+ **Detection.** Read `s.transcript(name).content` in the next stage and
476
+ log the length. A 0-length or JSON-that-isn't-prose signature = F9.
477
+
478
+ ---
479
+
480
+ ## Loud failures (throw, but still worth knowing)
481
+
482
+ ## F10. Copilot: `sendAndWait` default 60s timeout throws
483
+
484
+ **Symptom.** `Timeout after 60000ms waiting for session.idle`. Every
485
+ subsequent `ctx.stage()` call never executes — the throw propagates out of
486
+ `run()` and halts the workflow.
487
+
488
+ **Fix.** Use `send` instead of `sendAndWait` — it has no timeout and avoids
489
+ the problem entirely. Only use `sendAndWait` when the user explicitly
490
+ requests timeout-based waiting, and always pass an explicit timeout (default
491
+ to 5 minutes if the user is unsure).
492
+
493
+ ```ts
494
+ // Default pattern — no timeout, no risk
495
+ await s.session.send({ prompt });
496
+
497
+ // Only when the user explicitly wants timeout-gated waiting
498
+ const SEND_TIMEOUT_MS = 5 * 60 * 1000; // ask the user for a value
499
+ await s.session.sendAndWait({ prompt }, SEND_TIMEOUT_MS);
500
+ ```
501
+
502
+ ---
503
+
504
+ ## F11. ~~Manual Claude session initialization~~ (resolved by runtime)
505
+
506
+ No longer a failure mode. The runtime now auto-initializes `s.client` and `s.session` before the callback runs — just use `s.session.query()` directly.
507
+
508
+ ---
509
+
510
+ ## F12. Provider-level resume tries to swap agents
511
+
512
+ **Symptom.** Resumed Copilot / OpenCode session behaves as the original
513
+ agent instead of the requested new one — or the SDK throws "agent mismatch"
514
+ on resume.
515
+
516
+ **Root cause.** Each session is **bound to one agent at creation time**.
517
+ `resumeSession` reattaches the conversation but does not change the agent.
518
+
519
+ **Fix.** Use provider-level resume only for multi-turn work within the same
520
+ role. To swap agents, create a new session (fresh) and forward context via
521
+ F5's pattern. In normal workflow code, prefer a same-stage multi-turn session
522
+ over trying to reopen a prior stage.
523
+
524
+ ---
525
+
526
+ ## F13. Parallel siblings read each other's transcripts
527
+
528
+ **Symptom.** `s.transcript("sibling-name")` inside a parallel session
529
+ throws or returns empty.
530
+
531
+ **Root cause.** `s.transcript()` only exposes **prior completed sessions** —
532
+ ones whose callback has returned and whose saves have flushed. Sessions
533
+ launched concurrently via `Promise.all([ctx.stage(...), ctx.stage(...)])` run
534
+ at the same time; forward-only data flow is enforced.
535
+
536
+ **Fix.** Restructure to either a linear chain, a "fan-out, then merge"
537
+ pattern where a subsequent session reads both, or use external
538
+ shared state (files, DB) if siblings genuinely need to coordinate.
539
+
540
+ ```ts
541
+ // Fan-out → merge
542
+ await ctx.stage({ name: "describe" }, {}, {}, async (s) => { /* ... */ });
543
+
544
+ await Promise.all([
545
+ ctx.stage({ name: "summarize-a" }, {}, {}, async (s) => {
546
+ const d = await s.transcript("describe"); // OK — prior completed session
547
+ // s.transcript("summarize-b") would fail here — sibling not yet complete
548
+ }),
549
+ ctx.stage({ name: "summarize-b" }, {}, {}, async (s) => {
550
+ const d = await s.transcript("describe"); // OK — prior completed session
551
+ }),
552
+ ]);
553
+
554
+ await ctx.stage({ name: "merge" }, {}, {}, async (s) => {
555
+ const a = await s.transcript("summarize-a"); // OK — prior completed session
556
+ const b = await s.transcript("summarize-b"); // OK — prior completed session
557
+ });
558
+ ```
559
+
560
+ ---
561
+
562
+ ## F14. Forgetting to `await` `ctx.stage()`
563
+
564
+ **Symptom.** A session runs (its tmux window opens, the agent does work)
565
+ but the orchestrator doesn't wait for it. Subsequent sessions that depend
566
+ on its output via `transcript()` or `getMessages()` see empty or missing
567
+ data. The workflow may finish "successfully" before the session's callback
568
+ has returned.
569
+
570
+ **Root cause.** `ctx.stage()` returns a `Promise<SessionHandle<T>>`.
571
+ Without `await`, the session is spawned but the `.run()` callback continues
572
+ immediately. The session's save never reaches the `completedRegistry`
573
+ before downstream code tries to read it.
574
+
575
+ **Affected SDKs.** All three — this is a TypeScript control-flow bug, not
576
+ SDK-specific.
577
+
578
+ ### ❌ Wrong
579
+
580
+ ```ts
581
+ // Missing await — session fires but orchestrator doesn't wait
582
+ ctx.stage({ name: "research" }, {}, {}, async (s) => {
583
+ // ... agent work ...
584
+ s.save(s.sessionId);
585
+ });
586
+
587
+ // This runs before "research" completes
588
+ await ctx.stage({ name: "synthesize" }, {}, {}, async (s) => {
589
+ const r = await s.transcript("research"); // empty or throws
590
+ });
591
+ ```
592
+
593
+ ### ✅ Right
594
+
595
+ ```ts
596
+ await ctx.stage({ name: "research" }, {}, {}, async (s) => {
597
+ // ... agent work ...
598
+ s.save(s.sessionId);
599
+ });
600
+
601
+ await ctx.stage({ name: "synthesize" }, {}, {}, async (s) => {
602
+ const r = await s.transcript("research"); // works
603
+ });
604
+ ```
605
+
606
+ **Detection.** If a session's graph node shows as "running" while
607
+ downstream sessions are already executing, you likely dropped an `await`.
608
+ TypeScript's `@typescript-eslint/no-floating-promises` lint rule catches
609
+ this at compile time.
610
+
611
+ ---
612
+
613
+ ## F15. Using a pending `SessionHandle` before completion
614
+
615
+ **Symptom.** `handle.result` is `undefined` or stale, or
616
+ `s.transcript(handle)` throws / returns empty even though the session
617
+ eventually completes.
618
+
619
+ **Root cause.** `ctx.stage()` returns a `SessionHandle<T>` whose
620
+ `.result` is only populated after the callback returns. If you store the
621
+ promise but access the handle before awaiting it, the result field is
622
+ not yet set and the session is not in the `completedRegistry`.
623
+
624
+ **Affected SDKs.** All three.
625
+
626
+ ### ❌ Wrong
627
+
628
+ ```ts
629
+ // Start both but access handles before awaiting
630
+ const handleA = ctx.stage({ name: "a" }, {}, {}, async (s) => { /* ... */ return 42; });
631
+ const handleB = ctx.stage({ name: "b" }, {}, {}, async (s) => {
632
+ // handleA is a Promise, not a resolved SessionHandle
633
+ const transcript = await s.transcript(handleA); // fails
634
+ });
635
+ ```
636
+
637
+ ### ✅ Right
638
+
639
+ ```ts
640
+ // Await first, then use the resolved handle
641
+ const handleA = await ctx.stage({ name: "a" }, {}, {}, async (s) => { /* ... */ return 42; });
642
+
643
+ await ctx.stage({ name: "b" }, {}, {}, async (s) => {
644
+ const transcript = await s.transcript(handleA); // works — handleA is resolved
645
+ console.log(handleA.result); // 42
646
+ });
647
+ ```
648
+
649
+ For parallel sessions, use `Promise.all()` and access handles only after
650
+ all promises resolve:
651
+
652
+ ```ts
653
+ const [a, b] = await Promise.all([
654
+ ctx.stage({ name: "a" }, {}, {}, async (s) => { /* ... */ return "x"; }),
655
+ ctx.stage({ name: "b" }, {}, {}, async (s) => { /* ... */ return "y"; }),
656
+ ]);
657
+ // a.result === "x", b.result === "y"
658
+ ```
659
+
660
+ **Detection.** TypeScript's type system helps — `ctx.stage()` returns
661
+ `Promise<SessionHandle<T>>`, not `SessionHandle<T>` directly. If you're
662
+ accessing `.result` without awaiting, the type will be `Promise`, not `T`.
663
+
664
+ ---
665
+
666
+ ## F16. Headless stage errors are invisible in the graph
667
+
668
+ **Symptom.** A workflow fails but the graph shows all visible stages as
669
+ completed. The error message references a session name that doesn't appear
670
+ in the graph panel.
671
+
672
+ **Root cause.** Headless stages (`{ headless: true }`) are invisible in the
673
+ workflow graph — they have no graph node, no tmux window, and no pane
674
+ preview. When a headless stage throws, the error is recorded in the
675
+ `failedRegistry` and the workflow halts, but the failure is only visible in
676
+ the orchestrator's error output and the session's `error.txt` file on disk.
677
+
678
+ **Affected SDKs.** All three — this is an executor-level behavior, not
679
+ SDK-specific.
680
+
681
+ ### ❌ Wrong — no error context for headless stages
682
+
683
+ ```ts
684
+ // Headless stage fails silently in the graph
685
+ const [a, b, c] = await Promise.all([
686
+ ctx.stage({ name: "gather-a", headless: true }, {}, {}, async (s) => {
687
+ throw new Error("API key expired"); // Fails — no graph node to show red
688
+ }),
689
+ ctx.stage({ name: "gather-b", headless: true }, {}, {}, async (s) => { /* ... */ }),
690
+ ctx.stage({ name: "gather-c", headless: true }, {}, {}, async (s) => { /* ... */ }),
691
+ ]);
692
+ ```
693
+
694
+ ### ✅ Right — wrap headless stages with descriptive error context
695
+
696
+ ```ts
697
+ const [a, b, c] = await Promise.all([
698
+ ctx.stage({ name: "gather-a", headless: true }, {}, {}, async (s) => {
699
+ try {
700
+ return await doWork(s);
701
+ } catch (error) {
702
+ throw new Error(`[gather-a] ${error instanceof Error ? error.message : String(error)}`);
703
+ }
704
+ }),
705
+ // ... same pattern for b, c
706
+ ]);
707
+ ```
708
+
709
+ **Detection.** If a workflow fails and the graph shows no failed nodes,
710
+ check the orchestrator log (`orchestrator.log` in the session directory)
711
+ and look for `headless-<name>` in the error output. The session directory
712
+ at `~/.atomic/sessions/<run-id>/<name>-<id>/error.txt` contains the
713
+ full error for each failed headless stage.
714
+
715
+ ---
716
+
717
+ ## Design checklist
718
+
719
+ Before shipping a multi-session workflow, walk the list:
720
+
721
+ - [ ] Copilot stages use `s.session.send` by default; `sendAndWait` only with an explicit user-requested timeout (F10)
722
+ - [ ] Every fresh-session handoff forwards context explicitly (F5)
723
+ - [ ] Every prompt whose output feeds a downstream stage explicitly requests trailing commentary (F6)
724
+ - [ ] Response-text extraction uses the per-SDK correct pattern (F1-F4)
725
+ - [ ] Structured-output parsers extract the LAST fenced block, not the first (F8)
726
+ - [ ] `s.save()` receives the per-SDK correct shape — Copilot uses `s.session.getMessages()` (F9)
727
+ - [ ] Loops over 10 iterations have a compaction / reset strategy (F7)
728
+ - [ ] Parallel groups only read from prior completed sessions, never siblings (F13)
729
+ - [ ] Every `ctx.stage()` call is `await`ed (F14)
730
+ - [ ] `SessionHandle` values are only used after the promise resolves (F15)
731
+ - [ ] If provider-level resume/fork is used at all, it stays within the same agent role (F12)
732
+ - [ ] Headless stage callbacks include descriptive error context so failures can be diagnosed without a graph node (F16)