@proflandrigan/shards 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (397) hide show
  1. package/README.md +475 -0
  2. package/package.json +37 -0
  3. package/src/agents/academic.md +276 -0
  4. package/src/agents/ai-engineer.md +377 -0
  5. package/src/agents/analytics-engineer.md +364 -0
  6. package/src/agents/applied-ml-scientist.md +410 -0
  7. package/src/agents/backend-engineer.md +255 -0
  8. package/src/agents/bi-engineer.md +333 -0
  9. package/src/agents/data-analyst.md +343 -0
  10. package/src/agents/data-engineer.md +260 -0
  11. package/src/agents/data-modeller.md +386 -0
  12. package/src/agents/data-scientist.md +366 -0
  13. package/src/agents/deep-learning-engineer.md +389 -0
  14. package/src/agents/ml-engineer.md +424 -0
  15. package/src/agents/mlops-engineer.md +339 -0
  16. package/src/agents/researcher.md +187 -0
  17. package/src/agents/specific_instructions/academic/critical_review.md +263 -0
  18. package/src/agents/specific_instructions/academic/report.md +113 -0
  19. package/src/agents/specific_instructions/ai_engineer/advise.md +162 -0
  20. package/src/agents/specific_instructions/ai_engineer/bi_engineer_handoff.md +86 -0
  21. package/src/agents/specific_instructions/ai_engineer/experiment.md +471 -0
  22. package/src/agents/specific_instructions/ai_engineer/experiment_ui_mode.md +44 -0
  23. package/src/agents/specific_instructions/ai_engineer/phases/index.md +45 -0
  24. package/src/agents/specific_instructions/ai_engineer/phases/phase-1.md +55 -0
  25. package/src/agents/specific_instructions/ai_engineer/phases/phase-2.md +86 -0
  26. package/src/agents/specific_instructions/ai_engineer/phases/phase-3.md +96 -0
  27. package/src/agents/specific_instructions/ai_engineer/phases/phase-4.md +138 -0
  28. package/src/agents/specific_instructions/ai_engineer/phases/phase-5.md +157 -0
  29. package/src/agents/specific_instructions/ai_engineer/phases/phase-6.md +196 -0
  30. package/src/agents/specific_instructions/ai_engineer/phases/phase-7.md +313 -0
  31. package/src/agents/specific_instructions/ai_engineer/phases.md +1011 -0
  32. package/src/agents/specific_instructions/ai_engineer/prompt_lab.md +161 -0
  33. package/src/agents/specific_instructions/ai_engineer/prompt_lab_ui_mode.md +28 -0
  34. package/src/agents/specific_instructions/ai_engineer/research.md +393 -0
  35. package/src/agents/specific_instructions/ai_engineer/research_ui_mode.md +66 -0
  36. package/src/agents/specific_instructions/ai_engineer/review.md +159 -0
  37. package/src/agents/specific_instructions/ai_engineer/validation_checklist.md +182 -0
  38. package/src/agents/specific_instructions/analytics_engineer/advise.md +155 -0
  39. package/src/agents/specific_instructions/analytics_engineer/bi_engineer_handoff.md +91 -0
  40. package/src/agents/specific_instructions/analytics_engineer/data_analyst_handoff.md +84 -0
  41. package/src/agents/specific_instructions/analytics_engineer/deep_phases.md +818 -0
  42. package/src/agents/specific_instructions/analytics_engineer/phases_deep/index.md +24 -0
  43. package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-1.md +77 -0
  44. package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-2.md +106 -0
  45. package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-3.md +93 -0
  46. package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-4.md +79 -0
  47. package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-5.md +61 -0
  48. package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-6.md +45 -0
  49. package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-7.md +235 -0
  50. package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-8.md +221 -0
  51. package/src/agents/specific_instructions/analytics_engineer/phases_quick/index.md +19 -0
  52. package/src/agents/specific_instructions/analytics_engineer/phases_quick/phase-1.md +47 -0
  53. package/src/agents/specific_instructions/analytics_engineer/phases_quick/phase-2.md +78 -0
  54. package/src/agents/specific_instructions/analytics_engineer/quick_phases.md +112 -0
  55. package/src/agents/specific_instructions/analytics_engineer/review.md +167 -0
  56. package/src/agents/specific_instructions/analytics_engineer/service_mode.md +369 -0
  57. package/src/agents/specific_instructions/analytics_engineer/ui_mode.md +45 -0
  58. package/src/agents/specific_instructions/analytics_engineer/update.md +162 -0
  59. package/src/agents/specific_instructions/analytics_engineer/validation_checklist.md +121 -0
  60. package/src/agents/specific_instructions/applied_ml_scientist/advise.md +143 -0
  61. package/src/agents/specific_instructions/applied_ml_scientist/phases/index.md +21 -0
  62. package/src/agents/specific_instructions/applied_ml_scientist/phases/phase-1.md +51 -0
  63. package/src/agents/specific_instructions/applied_ml_scientist/phases/phase-2.md +66 -0
  64. package/src/agents/specific_instructions/applied_ml_scientist/phases/phase-3.md +113 -0
  65. package/src/agents/specific_instructions/applied_ml_scientist/phases/phase-4.md +104 -0
  66. package/src/agents/specific_instructions/applied_ml_scientist/phases/phase-5.md +156 -0
  67. package/src/agents/specific_instructions/applied_ml_scientist/phases.md +428 -0
  68. package/src/agents/specific_instructions/applied_ml_scientist/research.md +379 -0
  69. package/src/agents/specific_instructions/applied_ml_scientist/review.md +142 -0
  70. package/src/agents/specific_instructions/applied_ml_scientist/validation_checklist.md +136 -0
  71. package/src/agents/specific_instructions/backend_engineer/clean.md +149 -0
  72. package/src/agents/specific_instructions/backend_engineer/review.md +91 -0
  73. package/src/agents/specific_instructions/backend_engineer/review_checklist.md +54 -0
  74. package/src/agents/specific_instructions/backend_engineer/service_mode.md +67 -0
  75. package/src/agents/specific_instructions/bi_engineer/advise.md +137 -0
  76. package/src/agents/specific_instructions/bi_engineer/data_analyst_handoff.md +77 -0
  77. package/src/agents/specific_instructions/bi_engineer/incoming_handoff.md +45 -0
  78. package/src/agents/specific_instructions/bi_engineer/phases/index.md +20 -0
  79. package/src/agents/specific_instructions/bi_engineer/phases/phase-1.md +164 -0
  80. package/src/agents/specific_instructions/bi_engineer/phases/phase-2.md +92 -0
  81. package/src/agents/specific_instructions/bi_engineer/phases/phase-3.md +121 -0
  82. package/src/agents/specific_instructions/bi_engineer/phases/phase-4.md +106 -0
  83. package/src/agents/specific_instructions/bi_engineer/phases.md +451 -0
  84. package/src/agents/specific_instructions/bi_engineer/review.md +166 -0
  85. package/src/agents/specific_instructions/bi_engineer/update.md +147 -0
  86. package/src/agents/specific_instructions/bi_engineer/validation_checklist.md +124 -0
  87. package/src/agents/specific_instructions/data_analyst/advise.md +138 -0
  88. package/src/agents/specific_instructions/data_analyst/explain.md +221 -0
  89. package/src/agents/specific_instructions/data_analyst/incoming_handoff.md +40 -0
  90. package/src/agents/specific_instructions/data_analyst/phases/index.md +20 -0
  91. package/src/agents/specific_instructions/data_analyst/phases/phase-1.md +159 -0
  92. package/src/agents/specific_instructions/data_analyst/phases/phase-2.md +112 -0
  93. package/src/agents/specific_instructions/data_analyst/phases/phase-3.md +265 -0
  94. package/src/agents/specific_instructions/data_analyst/phases/phase-4.md +100 -0
  95. package/src/agents/specific_instructions/data_analyst/phases.md +501 -0
  96. package/src/agents/specific_instructions/data_analyst/review.md +138 -0
  97. package/src/agents/specific_instructions/data_analyst/ui_mode.md +26 -0
  98. package/src/agents/specific_instructions/data_analyst/update.md +144 -0
  99. package/src/agents/specific_instructions/data_analyst/validation_checklist.md +95 -0
  100. package/src/agents/specific_instructions/data_engineer/advise.md +137 -0
  101. package/src/agents/specific_instructions/data_engineer/phases.md +466 -0
  102. package/src/agents/specific_instructions/data_engineer/phases_deep/index.md +23 -0
  103. package/src/agents/specific_instructions/data_engineer/phases_deep/phase-1.md +49 -0
  104. package/src/agents/specific_instructions/data_engineer/phases_deep/phase-2.md +93 -0
  105. package/src/agents/specific_instructions/data_engineer/phases_deep/phase-3.md +55 -0
  106. package/src/agents/specific_instructions/data_engineer/phases_deep/phase-4.md +48 -0
  107. package/src/agents/specific_instructions/data_engineer/phases_deep/phase-5.md +40 -0
  108. package/src/agents/specific_instructions/data_engineer/phases_deep/phase-6.md +102 -0
  109. package/src/agents/specific_instructions/data_engineer/phases_deep/phase-7.md +87 -0
  110. package/src/agents/specific_instructions/data_engineer/phases_quick/index.md +19 -0
  111. package/src/agents/specific_instructions/data_engineer/phases_quick/phase-1.md +45 -0
  112. package/src/agents/specific_instructions/data_engineer/phases_quick/phase-2.md +54 -0
  113. package/src/agents/specific_instructions/data_engineer/review.md +135 -0
  114. package/src/agents/specific_instructions/data_engineer/validation_checklist.md +136 -0
  115. package/src/agents/specific_instructions/data_modeller/advise.md +137 -0
  116. package/src/agents/specific_instructions/data_modeller/phases.md +581 -0
  117. package/src/agents/specific_instructions/data_modeller/phases_deep/index.md +23 -0
  118. package/src/agents/specific_instructions/data_modeller/phases_deep/phase-1.md +52 -0
  119. package/src/agents/specific_instructions/data_modeller/phases_deep/phase-2.md +113 -0
  120. package/src/agents/specific_instructions/data_modeller/phases_deep/phase-3.md +47 -0
  121. package/src/agents/specific_instructions/data_modeller/phases_deep/phase-4.md +51 -0
  122. package/src/agents/specific_instructions/data_modeller/phases_deep/phase-5.md +45 -0
  123. package/src/agents/specific_instructions/data_modeller/phases_deep/phase-6.md +105 -0
  124. package/src/agents/specific_instructions/data_modeller/phases_deep/phase-7.md +136 -0
  125. package/src/agents/specific_instructions/data_modeller/phases_quick/index.md +19 -0
  126. package/src/agents/specific_instructions/data_modeller/phases_quick/phase-1.md +47 -0
  127. package/src/agents/specific_instructions/data_modeller/phases_quick/phase-2.md +65 -0
  128. package/src/agents/specific_instructions/data_modeller/review.md +141 -0
  129. package/src/agents/specific_instructions/data_modeller/service_mode.md +218 -0
  130. package/src/agents/specific_instructions/data_modeller/validation_checklist.md +125 -0
  131. package/src/agents/specific_instructions/data_scientist/advise.md +158 -0
  132. package/src/agents/specific_instructions/data_scientist/bi_engineer_handoff.md +63 -0
  133. package/src/agents/specific_instructions/data_scientist/experiment.md +482 -0
  134. package/src/agents/specific_instructions/data_scientist/experiment_ui_mode.md +44 -0
  135. package/src/agents/specific_instructions/data_scientist/explain.md +247 -0
  136. package/src/agents/specific_instructions/data_scientist/greenfield_data.md +35 -0
  137. package/src/agents/specific_instructions/data_scientist/ml_engineer_handoff.md +52 -0
  138. package/src/agents/specific_instructions/data_scientist/notebook_walkthrough.md +76 -0
  139. package/src/agents/specific_instructions/data_scientist/phases/index.md +24 -0
  140. package/src/agents/specific_instructions/data_scientist/phases/phase-1.md +45 -0
  141. package/src/agents/specific_instructions/data_scientist/phases/phase-2.md +67 -0
  142. package/src/agents/specific_instructions/data_scientist/phases/phase-3.md +89 -0
  143. package/src/agents/specific_instructions/data_scientist/phases/phase-4.md +143 -0
  144. package/src/agents/specific_instructions/data_scientist/phases/phase-5.md +71 -0
  145. package/src/agents/specific_instructions/data_scientist/phases/phase-6.md +239 -0
  146. package/src/agents/specific_instructions/data_scientist/phases/phase-7.md +207 -0
  147. package/src/agents/specific_instructions/data_scientist/phases.md +651 -0
  148. package/src/agents/specific_instructions/data_scientist/research.md +345 -0
  149. package/src/agents/specific_instructions/data_scientist/research_ui_mode.md +52 -0
  150. package/src/agents/specific_instructions/data_scientist/review.md +136 -0
  151. package/src/agents/specific_instructions/data_scientist/service_mode.md +247 -0
  152. package/src/agents/specific_instructions/data_scientist/validation_checklist.md +183 -0
  153. package/src/agents/specific_instructions/deep_learning_engineer/advise.md +145 -0
  154. package/src/agents/specific_instructions/deep_learning_engineer/phases/index.md +21 -0
  155. package/src/agents/specific_instructions/deep_learning_engineer/phases/phase-1.md +74 -0
  156. package/src/agents/specific_instructions/deep_learning_engineer/phases/phase-2.md +98 -0
  157. package/src/agents/specific_instructions/deep_learning_engineer/phases/phase-3.md +76 -0
  158. package/src/agents/specific_instructions/deep_learning_engineer/phases/phase-4.md +128 -0
  159. package/src/agents/specific_instructions/deep_learning_engineer/phases/phase-5.md +292 -0
  160. package/src/agents/specific_instructions/deep_learning_engineer/phases.md +567 -0
  161. package/src/agents/specific_instructions/deep_learning_engineer/research.md +389 -0
  162. package/src/agents/specific_instructions/deep_learning_engineer/review.md +155 -0
  163. package/src/agents/specific_instructions/deep_learning_engineer/validation_checklist.md +147 -0
  164. package/src/agents/specific_instructions/ml_engineer/advise.md +174 -0
  165. package/src/agents/specific_instructions/ml_engineer/bi_engineer_handoff.md +71 -0
  166. package/src/agents/specific_instructions/ml_engineer/experiment.md +474 -0
  167. package/src/agents/specific_instructions/ml_engineer/experiment_ui_mode.md +44 -0
  168. package/src/agents/specific_instructions/ml_engineer/notebook_walkthrough.md +75 -0
  169. package/src/agents/specific_instructions/ml_engineer/phases/index.md +25 -0
  170. package/src/agents/specific_instructions/ml_engineer/phases/phase-1.md +49 -0
  171. package/src/agents/specific_instructions/ml_engineer/phases/phase-2.md +75 -0
  172. package/src/agents/specific_instructions/ml_engineer/phases/phase-3.md +124 -0
  173. package/src/agents/specific_instructions/ml_engineer/phases/phase-4.md +279 -0
  174. package/src/agents/specific_instructions/ml_engineer/phases/phase-5.md +160 -0
  175. package/src/agents/specific_instructions/ml_engineer/phases/phase-6-5.md +170 -0
  176. package/src/agents/specific_instructions/ml_engineer/phases/phase-6.md +295 -0
  177. package/src/agents/specific_instructions/ml_engineer/phases/phase-7.md +337 -0
  178. package/src/agents/specific_instructions/ml_engineer/phases.md +1068 -0
  179. package/src/agents/specific_instructions/ml_engineer/research.md +437 -0
  180. package/src/agents/specific_instructions/ml_engineer/research_ui_mode.md +71 -0
  181. package/src/agents/specific_instructions/ml_engineer/review.md +187 -0
  182. package/src/agents/specific_instructions/ml_engineer/service_mode.md +273 -0
  183. package/src/agents/specific_instructions/ml_engineer/validation_checklist.md +185 -0
  184. package/src/agents/specific_instructions/mlops_engineer/advise.md +139 -0
  185. package/src/agents/specific_instructions/mlops_engineer/phases/index.md +23 -0
  186. package/src/agents/specific_instructions/mlops_engineer/phases/phase-1.md +52 -0
  187. package/src/agents/specific_instructions/mlops_engineer/phases/phase-2.md +86 -0
  188. package/src/agents/specific_instructions/mlops_engineer/phases/phase-3.md +105 -0
  189. package/src/agents/specific_instructions/mlops_engineer/phases/phase-4.md +128 -0
  190. package/src/agents/specific_instructions/mlops_engineer/phases/phase-5.md +106 -0
  191. package/src/agents/specific_instructions/mlops_engineer/phases/phase-6.md +128 -0
  192. package/src/agents/specific_instructions/mlops_engineer/phases/phase-7.md +144 -0
  193. package/src/agents/specific_instructions/mlops_engineer/phases.md +671 -0
  194. package/src/agents/specific_instructions/mlops_engineer/review.md +164 -0
  195. package/src/agents/specific_instructions/mlops_engineer/service_mode.md +81 -0
  196. package/src/agents/specific_instructions/mlops_engineer/validation_checklist.md +151 -0
  197. package/src/agents/specific_instructions/researcher/critical_review.md +292 -0
  198. package/src/agents/specific_instructions/researcher/review_checklist.md +67 -0
  199. package/src/agents/specific_instructions/researcher/service_mode.md +224 -0
  200. package/src/agents/specific_instructions/shared/auto_verify_mode.md +141 -0
  201. package/src/agents/specific_instructions/shared/autonomous_research.md +1289 -0
  202. package/src/agents/specific_instructions/shared/behavioral_rules.md +36 -0
  203. package/src/agents/specific_instructions/shared/diverge_protocol.md +387 -0
  204. package/src/agents/specific_instructions/shared/engineering_guidelines.md +136 -0
  205. package/src/agents/specific_instructions/shared/experiment_versioning.md +184 -0
  206. package/src/agents/specific_instructions/shared/goal_mode.md +187 -0
  207. package/src/agents/specific_instructions/shared/incremental_testing.md +139 -0
  208. package/src/agents/specific_instructions/shared/intent_discovery.md +223 -0
  209. package/src/agents/specific_instructions/shared/join_path_protocol.md +168 -0
  210. package/src/agents/specific_instructions/shared/knowledge_checkpoint.md +83 -0
  211. package/src/agents/specific_instructions/shared/knowledge_harvest.md +220 -0
  212. package/src/agents/specific_instructions/shared/knowledge_retrieval.md +100 -0
  213. package/src/agents/specific_instructions/shared/notebook_walkthrough_protocol.md +367 -0
  214. package/src/agents/specific_instructions/shared/reviewer_verdict_protocol.md +74 -0
  215. package/src/agents/specific_instructions/shared/swarm_protocol.md +97 -0
  216. package/src/agents/specific_instructions/shared/validation_protocol.md +139 -0
  217. package/src/agents/specific_instructions/syn/arbiter.md +140 -0
  218. package/src/agents/specific_instructions/syn/brainstorm.md +550 -0
  219. package/src/agents/specific_instructions/syn/code_review.md +232 -0
  220. package/src/agents/specific_instructions/syn/diff.md +239 -0
  221. package/src/agents/specific_instructions/syn/final_review.md +65 -0
  222. package/src/agents/specific_instructions/syn/fixer.md +240 -0
  223. package/src/agents/specific_instructions/syn/free_form.md +130 -0
  224. package/src/agents/specific_instructions/syn/knowledge.md +468 -0
  225. package/src/agents/specific_instructions/syn/notebook_walkthrough.md +78 -0
  226. package/src/agents/specific_instructions/syn/panel_review.md +634 -0
  227. package/src/agents/specific_instructions/syn/pm.md +453 -0
  228. package/src/agents/specific_instructions/syn/pr_review.md +255 -0
  229. package/src/agents/specific_instructions/syn/slides.md +417 -0
  230. package/src/agents/syn.md +729 -0
  231. package/src/commands/academic.md +41 -0
  232. package/src/commands/ai-engineer.md +45 -0
  233. package/src/commands/analytics-engineer.md +48 -0
  234. package/src/commands/applied-ml-scientist.md +45 -0
  235. package/src/commands/backend-engineer.md +35 -0
  236. package/src/commands/bi-engineer.md +40 -0
  237. package/src/commands/brainstorm.md +24 -0
  238. package/src/commands/data-analyst.md +38 -0
  239. package/src/commands/data-engineer.md +37 -0
  240. package/src/commands/data-modeller.md +38 -0
  241. package/src/commands/data-scientist.md +38 -0
  242. package/src/commands/deep-learning-engineer.md +47 -0
  243. package/src/commands/end.md +49 -0
  244. package/src/commands/knowledge.md +24 -0
  245. package/src/commands/ml-engineer.md +42 -0
  246. package/src/commands/mlops-engineer.md +47 -0
  247. package/src/commands/notebook-walkthrough.md +58 -0
  248. package/src/commands/researcher.md +40 -0
  249. package/src/commands/resume.md +57 -0
  250. package/src/commands/review-pr.md +26 -0
  251. package/src/commands/shards-guide.md +41 -0
  252. package/src/commands/shards-ui.md +32 -0
  253. package/src/commands/shards.md +41 -0
  254. package/src/docs/01-getting-started/concepts.md +109 -0
  255. package/src/docs/01-getting-started/first-session.md +79 -0
  256. package/src/docs/01-getting-started/install.md +61 -0
  257. package/src/docs/02-agents/academic.md +71 -0
  258. package/src/docs/02-agents/ai-engineer.md +78 -0
  259. package/src/docs/02-agents/analytics-engineer.md +58 -0
  260. package/src/docs/02-agents/applied-ml-scientist.md +59 -0
  261. package/src/docs/02-agents/backend-engineer.md +58 -0
  262. package/src/docs/02-agents/bi-engineer.md +65 -0
  263. package/src/docs/02-agents/data-analyst.md +67 -0
  264. package/src/docs/02-agents/data-engineer.md +57 -0
  265. package/src/docs/02-agents/data-modeller.md +51 -0
  266. package/src/docs/02-agents/data-scientist.md +78 -0
  267. package/src/docs/02-agents/deep-learning-engineer.md +64 -0
  268. package/src/docs/02-agents/ml-engineer.md +80 -0
  269. package/src/docs/02-agents/mlops-engineer.md +59 -0
  270. package/src/docs/02-agents/overview.md +62 -0
  271. package/src/docs/02-agents/researcher.md +73 -0
  272. package/src/docs/02-agents/syn.md +88 -0
  273. package/src/docs/03-protocols/auto-verify.md +82 -0
  274. package/src/docs/03-protocols/autonomous-research.md +59 -0
  275. package/src/docs/03-protocols/behavioral-rules.md +35 -0
  276. package/src/docs/03-protocols/diverge.md +50 -0
  277. package/src/docs/03-protocols/engineering-guidelines.md +56 -0
  278. package/src/docs/03-protocols/experiment-versioning.md +38 -0
  279. package/src/docs/03-protocols/gate-pattern.md +65 -0
  280. package/src/docs/03-protocols/incremental-testing.md +68 -0
  281. package/src/docs/03-protocols/join-path.md +46 -0
  282. package/src/docs/03-protocols/knowledge-ledger.md +70 -0
  283. package/src/docs/03-protocols/reviewer-verdicts.md +39 -0
  284. package/src/docs/03-protocols/swarm.md +40 -0
  285. package/src/docs/03-protocols/validation.md +174 -0
  286. package/src/docs/04-ui/activity-bar.md +70 -0
  287. package/src/docs/04-ui/chat-pane.md +80 -0
  288. package/src/docs/04-ui/code-intel.md +62 -0
  289. package/src/docs/04-ui/file-editing.md +61 -0
  290. package/src/docs/04-ui/git.md +54 -0
  291. package/src/docs/04-ui/keybindings.md +79 -0
  292. package/src/docs/04-ui/knowledge-map.md +76 -0
  293. package/src/docs/04-ui/overview.md +93 -0
  294. package/src/docs/04-ui/panels.md +49 -0
  295. package/src/docs/04-ui/pinboard-selection.md +66 -0
  296. package/src/docs/04-ui/quick-open-palette.md +56 -0
  297. package/src/docs/04-ui/sessions.md +81 -0
  298. package/src/docs/04-ui/settings-permissions.md +56 -0
  299. package/src/docs/05-commands/reference.md +59 -0
  300. package/src/docs/06-outputs/directory-map.md +116 -0
  301. package/src/docs/07-workflows/ai-eval-first.md +57 -0
  302. package/src/docs/07-workflows/deep-study-to-production.md +76 -0
  303. package/src/docs/07-workflows/diverge-exploration.md +77 -0
  304. package/src/docs/07-workflows/quick-analysis.md +45 -0
  305. package/src/docs/08-integrations/claude-code-auto-mode.md +191 -0
  306. package/src/docs/08-integrations/google-slides.md +175 -0
  307. package/src/docs/README.md +30 -0
  308. package/src/docs/manifest.json +108 -0
  309. package/src/templates/analysis-template.md +20 -0
  310. package/src/templates/branch-report.md +46 -0
  311. package/src/templates/diff-report.md +88 -0
  312. package/src/templates/knowledge-index.md +7 -0
  313. package/src/templates/model-card-schema.json +186 -0
  314. package/src/templates/model-card-schema.md +88 -0
  315. package/src/templates/model-card.md +124 -0
  316. package/src/templates/project-plan.md +47 -0
  317. package/src/templates/project-specs.md +81 -0
  318. package/src/templates/report-template.md +43 -0
  319. package/src/templates/study-template.md +25 -0
  320. package/src/ui/cc-readonly.js +181 -0
  321. package/src/ui/chat-session.js +466 -0
  322. package/src/ui/css/base.css +136 -0
  323. package/src/ui/css/brainstorm.css +525 -0
  324. package/src/ui/css/chat.css +1405 -0
  325. package/src/ui/css/editor.css +546 -0
  326. package/src/ui/css/eval-dashboard.css +157 -0
  327. package/src/ui/css/experiment.css +237 -0
  328. package/src/ui/css/guide.css +186 -0
  329. package/src/ui/css/knowledge-map.css +383 -0
  330. package/src/ui/css/layout.css +431 -0
  331. package/src/ui/css/model-card.css +161 -0
  332. package/src/ui/css/notebook-walkthrough.css +271 -0
  333. package/src/ui/css/pr-review.css +403 -0
  334. package/src/ui/css/prompt-lab.css +325 -0
  335. package/src/ui/css/sessions.css +258 -0
  336. package/src/ui/css/sidebar.css +661 -0
  337. package/src/ui/css/terminal.css +113 -0
  338. package/src/ui/css/theme-light.css +542 -0
  339. package/src/ui/index.html +389 -0
  340. package/src/ui/js/agents.js +32 -0
  341. package/src/ui/js/bookmarks.js +230 -0
  342. package/src/ui/js/chat.js +1776 -0
  343. package/src/ui/js/code-intel.js +328 -0
  344. package/src/ui/js/command-palette.js +142 -0
  345. package/src/ui/js/events.js +591 -0
  346. package/src/ui/js/explorer.js +317 -0
  347. package/src/ui/js/file-view.js +477 -0
  348. package/src/ui/js/git.js +536 -0
  349. package/src/ui/js/guide.js +198 -0
  350. package/src/ui/js/hud.js +75 -0
  351. package/src/ui/js/init.js +351 -0
  352. package/src/ui/js/knowledge-map.js +906 -0
  353. package/src/ui/js/markdown.js +114 -0
  354. package/src/ui/js/monaco.js +164 -0
  355. package/src/ui/js/notebook-walkthrough.js +272 -0
  356. package/src/ui/js/notebook.js +448 -0
  357. package/src/ui/js/panels.js +2681 -0
  358. package/src/ui/js/pinboard.js +186 -0
  359. package/src/ui/js/quick-open.js +164 -0
  360. package/src/ui/js/selection-context.js +131 -0
  361. package/src/ui/js/sessions.js +256 -0
  362. package/src/ui/js/settings.js +476 -0
  363. package/src/ui/js/split-view.js +82 -0
  364. package/src/ui/js/state.js +343 -0
  365. package/src/ui/js/table.js +161 -0
  366. package/src/ui/js/tabs.js +284 -0
  367. package/src/ui/js/tabular.js +125 -0
  368. package/src/ui/js/terminal.js +354 -0
  369. package/src/ui/js/timeline.js +137 -0
  370. package/src/ui/js/utils.js +293 -0
  371. package/src/ui/notebook-kernel.py +790 -0
  372. package/src/ui/open-browser.js +55 -0
  373. package/src/ui/permission-pattern.js +42 -0
  374. package/src/ui/relay.js +513 -0
  375. package/src/ui/server.js +3072 -0
  376. package/src/ui/session-index.js +225 -0
  377. package/src/ui/shards_icon.png +0 -0
  378. package/src/ui/spawn-server.js +41 -0
  379. package/src/ui/symbol-index.js +813 -0
  380. package/src/ui/ui-push.js +177 -0
  381. package/tools/gate-hook/VALIDATION_SPEC.md +273 -0
  382. package/tools/gate-hook/__tests__/auto-verify.test.js +343 -0
  383. package/tools/gate-hook/auto-allowlist.js +179 -0
  384. package/tools/gate-hook/auto-state.js +68 -0
  385. package/tools/gate-hook/classify.js +21 -0
  386. package/tools/gate-hook/log.js +57 -0
  387. package/tools/gate-hook/parser.js +205 -0
  388. package/tools/gate-hook/sql-guard.js +230 -0
  389. package/tools/gate-hook/state.js +170 -0
  390. package/tools/gate-hook/sweep.js +139 -0
  391. package/tools/gate-hook/transcript.js +45 -0
  392. package/tools/gate-hook/validation.js +321 -0
  393. package/tools/gate-hook.js +475 -0
  394. package/tools/install.js +914 -0
  395. package/tools/shards-gates.js +311 -0
  396. package/tools/shards-sessions.js +261 -0
  397. package/tools/shards-ui.js +377 -0
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: shared-behavioral-rules
3
+ description: Core gate pattern behavioral rules shared across all specialist agents
4
+ type: reference
5
+ ---
6
+
7
+ These rules apply to all specialist agents. They are referenced from each agent's Behavioral Rules section to avoid duplication.
8
+
9
+ - **Document before advancing.** Non-negotiable.
10
+ - **One phase at a time. Wait.** Every phase ends with a `::GATE:: ... ::ENDGATE::` fence. When you emit that fence, you MUST end your turn immediately. Output nothing after `::ENDGATE::`. The fence is parsed by a harness hook that will block all subsequent tool calls until the user explicitly confirms. Never combine multiple phases in a single response. Do not interpret silence, questions, or partial agreement as confirmation.
11
+ - **Announce cross-agent reviews.** Always tell the user when consulting another shard.
12
+ - **Facilitate, don't generate.** Guide structured discovery. The user provides domain knowledge and business context, you provide structure.
13
+ - **Escalation Brief format.** When scope grows beyond the current agent's boundary, write the following section to `project-specs.md` before handing off:
14
+
15
+ ```markdown
16
+ ---
17
+
18
+ ## Escalation Brief
19
+ - **Originating agent:** <agent name>
20
+ - **Target agent:** <recommended agent>
21
+ - **Trigger:** <what caused the escalation — be specific>
22
+ - **Findings so far:** <bullet list of what was discovered, queries run, results obtained>
23
+ - **Open questions:** <what the target agent should investigate next>
24
+ - **Relevant files/tables:** <any artifacts, queries, or data sources already identified>
25
+ - **Recommended command:** `/<target-agent-command>`
26
+ ```
27
+
28
+ The target agent should check for an Escalation Brief in `project-specs.md` on startup and treat it as prior context — skip re-asking questions that are already answered.
29
+
30
+ - **Gate fence format.** Gate fences look like:
31
+ `::GATE:: id=<unique-slug> phase=<n> kind=<phase|confirm|handoff|execute|final>`
32
+ followed by the human-readable prompt, closed with `::ENDGATE::`. Never fabricate, duplicate, or nest gate ids. Never put tool calls, code blocks, or next-phase content after `::ENDGATE::` in the same turn.
33
+
34
+ - **Trace join paths before writing SQL.** Before writing or running any query that joins tables, trace the join path: state each table's grain, each join's relationship type, and the predicted output grain. Scale the trace to query complexity. Read `.claude/agents/specific_instructions/shared/join_path_protocol.md` for the full protocol.
35
+ - **Validate before closing the gate on any artifact-producing phase.** Any phase that writes, modifies, or regenerates a durable artifact (mart, model, notebook, service, pipeline, dashboard, data model, feature table) must populate a `## Validation` section in `project-specs.md` before emitting its gate fence. Evidence — measured values, test results, artifact paths — not assertions. Read `.claude/agents/specific_instructions/shared/validation_protocol.md` for the schema and contract, and your own `.claude/agents/specific_instructions/<agent>/validation_checklist.md` for the domain-specific checks. Gate fences on validation-eligible phases must include the `validates=<agent_name>` attribute so the hook can enforce the schema.
36
+ - **DIVERGE is opt-in and user-gated.** When you identify multiple viable but mutually exclusive approaches, you may propose a Time-Travel fork. The user must explicitly confirm before any branches spawn. Never auto-fork. Fork only (a) during planning phases where mutually exclusive approach choices exist, or (b) at the start of an `[AR]` (Autonomous Research) session per `autonomous_research.md` Section H. Never mid-loop once an `[AR]` session is executing. Read `.claude/agents/specific_instructions/shared/diverge_protocol.md` for the full protocol and `.claude/agents/specific_instructions/shared/autonomous_research.md` Section H for the AR fan-out composition.
@@ -0,0 +1,387 @@
1
+ ---
2
+ name: diverge-protocol
3
+ description: >
4
+ Time-Travel branching protocol for parallel experimentation. Defines the full
5
+ fork-execute-converge lifecycle: when to propose DIVERGE, how to spawn parallel
6
+ branch Tasks, how branches produce reports, how Syn arbitrates, and how the
7
+ winning branch is promoted back to the main project directory.
8
+ type: reference
9
+ ---
10
+
11
+ # DIVERGE Protocol — Time-Travel Branching
12
+
13
+ This protocol governs parallel experimentation in Shards. It is referenced by
14
+ DIVERGE-capable specialists during planning phases when multiple viable approaches
15
+ are identified.
16
+
17
+ ---
18
+
19
+ ## A. When to Propose DIVERGE
20
+
21
+ DIVERGE is appropriate when ALL of the following are true:
22
+
23
+ 1. You are in an **allowed phase**:
24
+ - (a) A **planning phase** (methodology, architecture, or model design), or
25
+ - (b) The **start of an `[AR]` (Autonomous Research) session** — specifically before the Phase 1 research-brief gate, per `autonomous_research.md` Section H. DIVERGE inside an already-executing AR loop is forbidden; only at AR session start.
26
+ 2. You have identified **2-3 mutually exclusive approaches** that are genuinely viable.
27
+ 3. **No single approach is clearly superior.** If one approach dominates on every dimension (accuracy, complexity, interpretability, cost), just pick it. DIVERGE is for genuine uncertainty.
28
+ 4. The approaches are **fundamentally different** — different model families, different analytical methodologies, different architectural paradigms. Not minor hyperparameter variations (that is Experiment Mode or the inner AR loop).
29
+
30
+ **Do NOT propose DIVERGE when:**
31
+ - One approach is clearly better — just pick it
32
+ - The difference is a tuning choice (learning rate, regularization) — use Experiment Mode or let AR's own loop explore it
33
+ - The user has already expressed a strong preference for one approach
34
+ - The project is in an execution phase **other than** the allowed AR-session start — DIVERGE is never mid-loop
35
+
36
+ **Gate ID namespace for AR-initiated DIVERGE:**
37
+ Use the ID prefix `specific-instructions-shared-diverge-protocol-ar-<project>`
38
+ to avoid collision with planning-phase DIVERGE gates (which use
39
+ `specific-instructions-shared-diverge-protocol-phase0`). See Section B.
40
+
41
+ ---
42
+
43
+ ## B. DIVERGE Proposal Gate
44
+
45
+ Present the fork to the user. Do not spawn any branches until the user explicitly confirms.
46
+
47
+ **Proposal format:**
48
+
49
+ ```
50
+ **DIVERGE PROPOSED — Time-Travel Fork**
51
+
52
+ I've identified [N] viable but mutually exclusive approaches for this project.
53
+ Rather than committing to one and hoping it works, I can run them in parallel
54
+ as isolated branches, then compare results side by side.
55
+
56
+ | Branch | Approach | Rationale | Risk |
57
+ |--------|----------|-----------|------|
58
+ | `<branch-slug-1>` | <approach summary> | <why this is viable> | <Low/Med/High> |
59
+ | `<branch-slug-2>` | <approach summary> | <why this is viable> | <Low/Med/High> |
60
+
61
+ **What this means:** Each branch runs autonomously in its own directory,
62
+ produces artifacts and a branch report, then Syn compares them as an arbiter
63
+ so you can pick the winner.
64
+
65
+ **Proceed with DIVERGE, or pick one approach and go straight?**
66
+ ```
67
+
68
+ **Branch slug rules:** lowercase, hyphenated, descriptive. Examples: `xgboost-raw-features`, `linear-pca-transformed`, `transformer-architecture`, `rule-based-baseline`.
69
+
70
+ **Gate to emit:**
71
+
72
+ - **Planning-phase DIVERGE:** emit with ID
73
+ `specific-instructions-shared-diverge-protocol-phase0`.
74
+ - **AR-session-start DIVERGE:** emit with ID
75
+ `specific-instructions-shared-diverge-protocol-ar-<project>` (substitute
76
+ the project slug). This is required to avoid collision with planning-phase
77
+ IDs when both DIVERGE forms occur in the same project's state file.
78
+
79
+ Example (planning-phase form):
80
+
81
+ ::GATE:: id=specific-instructions-shared-diverge-protocol-phase0 phase=0 kind=phase
82
+
83
+ ::ENDGATE::
84
+
85
+ The user must explicitly confirm DIVERGE. If they pick a single approach, proceed with the standard phased workflow — no fork. If they confirm DIVERGE, continue to Section C.
86
+
87
+ ---
88
+
89
+ ## C. Branch Directory Setup
90
+
91
+ For each confirmed branch, create the directory:
92
+
93
+ ```
94
+ <project_dir>/.shards/branches/<branch-slug>/
95
+ ```
96
+
97
+ Branches do NOT get their own `project-specs.md`. They produce a `branch-report.md` instead. The main `project-specs.md` remains the single source of truth for the project.
98
+
99
+ ---
100
+
101
+ ## D. Document DIVERGE to project-specs.md
102
+
103
+ Before spawning any branch Tasks, append the following to the main `project-specs.md`:
104
+
105
+ ```markdown
106
+ ---
107
+
108
+ ## DIVERGE: Time-Travel Fork
109
+
110
+ - **Specialist:** <agent name>
111
+ - **Fork point:** After Phase <N>
112
+ - **Trigger:** <why you proposed forking — what made the approaches equally viable>
113
+ - **Branches:**
114
+ - `<branch-slug-1>`: <approach summary>
115
+ - `<branch-slug-2>`: <approach summary>
116
+ - **Branch directories:**
117
+ - `<project_dir>/.shards/branches/<branch-slug-1>/`
118
+ - `<project_dir>/.shards/branches/<branch-slug-2>/`
119
+ - **Status:** Spawning
120
+ ```
121
+
122
+ ---
123
+
124
+ ## E. Branch Task Calls
125
+
126
+ Spawn one Task per branch. **All branch Tasks must be called in parallel** — do not run them sequentially.
127
+
128
+ **Specialist type across branches:**
129
+ - A fork initiated by a specialist typically spawns branches of the same specialist type (a data-scientist fork spawns data-scientist branches).
130
+ - **AR fan-out explicitly allows multiple branches of the same specialist type**, each constrained to a different approach family. Example slugs for an ML Engineer AR fan-out: `ml-xgboost`, `ml-neural-net`, `ml-linear-baseline`. The `subagent_type` repeats across the parallel Task calls — that is expected and correct.
131
+ - A Syn-initiated fork may mix specialist types across branches (e.g., one `ml-engineer` branch + one `ai-engineer` branch, each with its own approach). Arbitration (Section F) handles mixed-type comparison by reading `branch-report.md` files regardless of which specialist produced them.
132
+
133
+ **Branch slug conventions:**
134
+ - Lowercase, hyphenated, descriptive.
135
+ - AR fan-out slugs should reflect the approach family, not the specialist type (since multiple branches share the specialist). Examples: `xgboost-raw-features`, `transformer-architecture`, `rule-based-baseline`, `ml-linear-baseline`, `ml-neural-net`.
136
+
137
+ ```python
138
+ Task(
139
+ subagent_type="<your specialist type>",
140
+ description="Time-Travel branch: <branch-slug>",
141
+ prompt="""
142
+ You are in BRANCH MODE — an isolated Time-Travel branch execution.
143
+
144
+ **Branch name:** <branch-slug>
145
+ **Branch directory:** <project_dir>/.shards/branches/<branch-slug>/
146
+ **Approach to execute:** <detailed description of the specific approach this branch must implement>
147
+
148
+ ## Project Context (from completed planning phases)
149
+
150
+ <Insert the full text of all completed phase sections from project-specs.md here,
151
+ verbatim — every phase from Phase 0 through Phase N (the fork point). Include
152
+ documented decisions, reviewer verdicts, and data discovery findings. Do NOT
153
+ include the DIVERGE section itself or any brainstorm transcripts.>
154
+
155
+ ## Your Task
156
+
157
+ Execute the approach described above through a condensed autonomous workflow.
158
+ You are autonomous within this branch — no user gates, no phase-by-phase
159
+ confirmation. Work efficiently and produce results.
160
+
161
+ 1. **Implement** — write all code, queries, configs, and notebooks to the branch
162
+ directory. Do NOT write to the main project directory or any other branch's
163
+ directory.
164
+ 2. **Evaluate** — run training, evaluation, or analysis and collect metrics.
165
+ Use the best proxy available for the primary success metric.
166
+ 3. **Write branch-report.md** — produce `<branch_dir>/branch-report.md` using
167
+ the template below. This is the artifact Syn will read during arbitration.
168
+
169
+ ## Branch Report Template
170
+
171
+ ```markdown
172
+ # Branch Report: <branch-slug>
173
+
174
+ - **Specialist:** <agent name>
175
+ - **Approach:** <one-line summary>
176
+ - **Branch directory:** <path>
177
+ - **Date:** <date>
178
+
179
+ ## Approach Description
180
+ <2-3 paragraphs: what was done and why this approach was chosen>
181
+
182
+ ## Implementation
183
+ | File | Description |
184
+ |------|-------------|
185
+ | `<filename>` | <what it does> |
186
+
187
+ ## Metrics
188
+ | Metric | Value | Notes |
189
+ |--------|-------|-------|
190
+ | **<primary metric>** | **<value>** | <context> |
191
+ | <secondary metric> | <value> | <context> |
192
+
193
+ ## Strengths
194
+ <bulleted list — what went well, what this approach excels at>
195
+
196
+ ## Weaknesses
197
+ <bulleted list — limitations, failure modes, concerns>
198
+
199
+ ## Artifacts Summary
200
+ <list of all files in the branch directory with paths>
201
+ ```
202
+ """
203
+ )
204
+ ```
205
+
206
+ After spawning all branch Tasks, wait for all of them to complete before proceeding.
207
+
208
+ ### Concurrent git strategy for parallel branches
209
+
210
+ When branches run in parallel they all commit to the same repo. Naive usage of
211
+ `experiment_versioning.md` Section B (shared by AR Section B.9) will race on
212
+ the git index lock, collide on tag names, and produce interleaved history.
213
+
214
+ **Each branch MUST select one strategy at spawn time** and record it in
215
+ `results.json.branchContext.gitStrategy`. The initiating specialist must name
216
+ the chosen strategy in each branch's Task prompt.
217
+
218
+ - **`branch-local` (default for AR fan-out):** before Phase 2 starts, the
219
+ branch runs `git checkout -b ar/<branch-slug>` and commits exclusively on
220
+ its own git branch. Tags are namespaced
221
+ `research/<project>/<branch-slug>/<N>-<name>` (AR) or
222
+ `exp/<project>/<branch-slug>/<N>-<name>` (planning-phase). No cross-branch
223
+ collisions. Promotion (Section G) merges the winner's ref into the main
224
+ working branch. Losing branches remain as refs for reference; deletion
225
+ requires explicit user confirmation.
226
+
227
+ - **`lockfile`:** branches share the same working ref but serialize all git
228
+ operations via a file lock at `.shards/branches/.git-lock` (file-creation
229
+ with `O_EXCL`; retry-with-backoff on contention — default 5 retries,
230
+ 100ms-1s exponential backoff). Acceptable for small K (≤2); degrades under
231
+ contention. Tag namespace includes the branch slug to prevent collisions
232
+ even on a shared ref: `research/<project>/<branch-slug>/<N>-<name>`.
233
+
234
+ - **`no-vcs`:** branches disable Section B checkpoint calls entirely and rely
235
+ solely on per-iteration markdown + `results.json` for lineage. A single
236
+ consolidation commit is made at promotion time. Fallback only, when git is
237
+ unavailable or intentionally disabled.
238
+
239
+ The chosen strategy is included in each branch's Task prompt above (the AR
240
+ fan-out prompt in `autonomous_research.md` Section H.3 already includes a
241
+ `Git strategy:` field). Planning-phase DIVERGE with parallel implementation
242
+ work should also pick a strategy explicitly rather than relying on the shared
243
+ ref.
244
+
245
+ Solo (non-fanned-out) AR and planning-phase DIVERGE with sequential branch
246
+ execution use the main working ref directly — no branch-local ref required.
247
+
248
+ ---
249
+
250
+ ## F. Post-Branch Convergence
251
+
252
+ After ALL branch Tasks have completed:
253
+
254
+ 1. Update the DIVERGE section in `project-specs.md`:
255
+ ```markdown
256
+ - **Status:** Converged — awaiting arbiter
257
+ ```
258
+
259
+ 2. Call Syn in Arbiter Mode:
260
+
261
+ ```python
262
+ Task(
263
+ subagent_type="syn",
264
+ description="ARBITER MODE: Time-Travel branch comparison",
265
+ prompt="""
266
+ ARBITER MODE
267
+
268
+ Compare the following Time-Travel branches for project: <project_name>
269
+
270
+ **Project specs:** <path to project-specs.md>
271
+ **Branch reports:**
272
+ - `<project_dir>/.shards/branches/<branch-slug-1>/branch-report.md`
273
+ - `<project_dir>/.shards/branches/<branch-slug-2>/branch-report.md`
274
+
275
+ Read all branch reports and the project-specs.md, then follow your Arbiter Mode
276
+ instructions to produce a leaderboard and comparison.
277
+ """
278
+ )
279
+ ```
280
+
281
+ 3. Present Syn's leaderboard and recommendation to the user.
282
+
283
+ 4. Ask the user to select the winning branch:
284
+ ```
285
+ **Time-Travel complete.** Syn has compared the branches.
286
+
287
+ <present leaderboard summary>
288
+
289
+ Which branch do you want to promote? Or would you like to:
290
+ (a) Pick a winner and continue
291
+ (b) Run additional branches
292
+ (c) Abandon the fork and pick a different approach entirely
293
+ ```
294
+
295
+ **Gate to emit (convergence/arbitration):**
296
+
297
+ - **Planning-phase DIVERGE:** emit with ID
298
+ `specific-instructions-shared-diverge-protocol-phase0-2`.
299
+ - **AR-session-start DIVERGE:** emit with ID
300
+ `specific-instructions-shared-diverge-protocol-ar-<project>-converge` to
301
+ avoid collision with the planning-phase convergence ID.
302
+
303
+ Example (planning-phase form):
304
+
305
+ ::GATE:: id=specific-instructions-shared-diverge-protocol-phase0-2 phase=0 kind=final
306
+
307
+ ::ENDGATE::
308
+
309
+ Wait for user to select a winner before proceeding.
310
+
311
+ ---
312
+
313
+ ## G. Promotion Protocol
314
+
315
+ When the user selects a winning branch:
316
+
317
+ 1. **Handle the git strategy** recorded in the winning branch's
318
+ `results.json.branchContext.gitStrategy`:
319
+ - **`branch-local`:** run `git merge --squash ar/<winning-branch>` onto the
320
+ main working ref. Create a consolidation commit:
321
+ ```bash
322
+ git commit -m "research: converge <winning-branch> — <metric>: <baseline> -> <final>"
323
+ git tag -a "research/<project>/converged/<winning-branch>" -m "Converged from AR fan-out"
324
+ ```
325
+ Losing branches remain as refs (e.g., `ar/<losing-branch>`) for reference. **Do
326
+ NOT delete losing refs** without explicit user confirmation.
327
+ - **`lockfile`:** artifacts and tags already live on the main ref under the
328
+ branch-slug-prefixed tag namespace. No merge needed. Still create the
329
+ consolidation tag:
330
+ ```bash
331
+ git tag -a "research/<project>/converged/<winning-branch>" -m "Converged from AR fan-out (lockfile strategy)"
332
+ ```
333
+ - **`no-vcs`:** make the single consolidation commit now, staging the
334
+ promoted artifacts (step 2):
335
+ ```bash
336
+ git add <promoted paths>
337
+ git commit -m "research: converge <winning-branch> — <metric>: <baseline> -> <final>"
338
+ ```
339
+ (If git itself is unavailable, skip the commit and tag — record in
340
+ `project-specs.md` that no VCS artifacts were produced.)
341
+
342
+ 2. **Copy artifacts** from `<project_dir>/.shards/branches/<winning-branch>/` to the
343
+ appropriate locations in the main project directory. Place files where they would
344
+ have been produced in a normal phased run (e.g., queries in `queries/`, notebooks
345
+ in `notebooks/`, code files at project root). For AR fan-out, copy the
346
+ `experiments/` contents (brief, results.json, iteration files,
347
+ history_summary.md) to `<project_dir>/experiments/`.
348
+
349
+ 3. **Do NOT copy `branch-report.md`** to the main directory — it stays in the branch
350
+ directory as historical record.
351
+
352
+ 4. **Preserve all branch directories** — do not delete losing branches. They remain
353
+ in `.shards/branches/` for future reference.
354
+
355
+ 5. **Document CONVERGE** in `project-specs.md`:
356
+
357
+ ```markdown
358
+ ---
359
+
360
+ ## CONVERGE: Time-Travel Resolution
361
+
362
+ - **Winner:** `<winning-branch-slug>`
363
+ - **Approach:** <winning approach summary>
364
+ - **Key metrics:**
365
+ | Metric | Value |
366
+ |--------|-------|
367
+ | <primary metric> | <value> |
368
+ - **Runners-up:**
369
+ - `<branch-slug>`: <approach> — <primary metric value> — <one-line why not chosen>
370
+ - **Arbiter leaderboard:** `.shards/branches/leaderboard.md`
371
+ - **Artifacts promoted to:** <main project directory paths>
372
+ - **Date:** <date>
373
+ ```
374
+
375
+ 6. **Update DIVERGE status:**
376
+ ```markdown
377
+ - **Status:** Resolved — winner: `<winning-branch-slug>`
378
+ ```
379
+
380
+ 7. **Resume normal workflow** at the phase after the fork point. The winning branch's
381
+ artifacts are now in place as if they had been produced by the standard phased
382
+ workflow. Continue with remaining phases (output format, review, handoff, etc.)
383
+ using the promoted artifacts.
384
+
385
+ For AR fan-out specifically, the parent specialist continues at AR Phase 3
386
+ (see `autonomous_research.md` Section I) and runs knowledge harvest at that
387
+ point (not during the branch loops — see Section H.10 of that protocol).
@@ -0,0 +1,136 @@
1
+ ---
2
+ name: shared-engineering-guidelines
3
+ description: Cross-cutting code-craft rules applied when writing or editing code, SQL, notebooks, or configuration artifacts
4
+ type: reference
5
+ ---
6
+
7
+ # Engineering Guidelines
8
+
9
+ These rules apply whenever you write or modify a durable artifact — code, SQL,
10
+ notebooks, dbt models, configuration, pipeline definitions, dashboard code.
11
+ They address the most common failure modes when an agent moves from planning
12
+ into execution: overcomplication, speculative scope, drifting into adjacent
13
+ edits, and shipping work without verifying it.
14
+
15
+ **Tradeoff:** These guidelines bias toward caution over speed. For trivial
16
+ edits (a typo, a one-line config tweak, a label change), use judgment — don't
17
+ perform ceremony where none is warranted.
18
+
19
+ ## 1. Think Before Coding
20
+
21
+ **Don't assume. Don't hide confusion. Surface tradeoffs.**
22
+
23
+ Before implementing:
24
+
25
+ - State your assumptions explicitly. If uncertain, ask.
26
+ - If multiple interpretations of the request exist, present them — don't pick
27
+ silently.
28
+ - If a simpler approach exists, say so. Push back when warranted.
29
+ - If something is unclear, stop. Name what's confusing. Ask.
30
+
31
+ **Composition with Shards workflow.** Phase 0 triage and the gate pattern
32
+ already enforce this at the project level. These guidelines extend it to the
33
+ line level inside build and execute phases — every non-trivial code decision
34
+ deserves the same discipline as a phase decision. If a build choice is opaque
35
+ or contentious enough to need user input, raise it in chat before writing it,
36
+ not after.
37
+
38
+ ## 2. Simplicity First
39
+
40
+ **Minimum code that solves the problem. Nothing speculative.**
41
+
42
+ - No features beyond what was asked.
43
+ - No abstractions for single-use code.
44
+ - No "flexibility" or "configurability" that wasn't requested.
45
+ - No error handling for impossible scenarios.
46
+ - If you write 200 lines and it could be 50, rewrite it.
47
+
48
+ Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes,
49
+ simplify.
50
+
51
+ **Domain extensions:**
52
+
53
+ - **SQL:** no CTEs you don't reference, no joins that don't tighten the
54
+ result, no defensive `COALESCE` against nulls that can't occur, no
55
+ `DISTINCT` slapped on to hide a join-path mistake (trace the join path
56
+ instead — see `join_path_protocol.md`).
57
+ - **Notebooks:** no exploratory cells left in a "final" notebook; no helper
58
+ functions used once that could be inline; no `try/except` swallowing
59
+ errors the user should see.
60
+ - **Pipelines / dbt models:** no models that wrap a single `SELECT *`; no
61
+ configuration knobs nobody will turn; no incremental strategies on tables
62
+ small enough to refresh fully.
63
+ - **Services:** no parameters with default values that no caller will ever
64
+ override; no fallback paths for branches the surrounding code makes
65
+ unreachable.
66
+
67
+ ## 3. Surgical Changes
68
+
69
+ **Touch only what you must. Clean up only your own mess.**
70
+
71
+ When editing existing code:
72
+
73
+ - Don't "improve" adjacent code, comments, or formatting.
74
+ - Don't refactor things that aren't broken.
75
+ - Match existing style, even if you'd do it differently.
76
+ - If you notice unrelated dead code, *mention it* — don't delete it.
77
+
78
+ When your changes create orphans:
79
+
80
+ - Remove imports, variables, or functions that **your** changes made unused.
81
+ - Don't remove pre-existing dead code unless asked.
82
+
83
+ **The test:** every changed line should trace directly to the user's
84
+ request.
85
+
86
+ **Especially relevant in:** iteration mode (ML / AI / AE), Fixer mode
87
+ (`syn/fixer.md`), Panel Review mode, and any phase that edits an
88
+ existing artifact rather than producing a greenfield one. Iteration's
89
+ defining failure mode is the agent that "just cleans up while it's in
90
+ there" and silently rewrites work that wasn't on the table.
91
+
92
+ **Surfacing unrelated issues.** If you notice dead code, an obvious smell,
93
+ or a real bug adjacent to your change, record it in the `Open Issues`
94
+ section of `project-specs.md` (or raise it in chat for review-only and
95
+ fixer flows). Do not silently fix it. Visibility is the obligation; the fix
96
+ is the user's call.
97
+
98
+ ## 4. Goal-Driven Execution
99
+
100
+ **Define success criteria. Loop until verified.**
101
+
102
+ Transform tasks into verifiable goals:
103
+
104
+ - "Add validation" → "Write tests for invalid inputs, then make them pass"
105
+ - "Fix the bug" → "Write a test that reproduces it, then make it pass"
106
+ - "Refactor X" → "Ensure tests pass before and after"
107
+ - "Optimize the query" → "Measure baseline runtime, change, measure again"
108
+
109
+ For multi-step tasks, state a brief plan before you start:
110
+
111
+ ```
112
+ 1. [Step] → verify: [check]
113
+ 2. [Step] → verify: [check]
114
+ 3. [Step] → verify: [check]
115
+ ```
116
+
117
+ Strong success criteria let you loop independently. Weak criteria ("make it
118
+ work") require constant clarification — and produce work that nobody can
119
+ confidently sign off on.
120
+
121
+ **Composition with Shards protocols:**
122
+
123
+ - `validation_protocol.md` is the gate-level expression of this rule —
124
+ evidence over assertion before closing any artifact-producing phase.
125
+ - `incremental_testing.md` is the build-loop expression — test each
126
+ component as you write it; don't batch failures to the end.
127
+ - This rule covers the gap between them: at the individual-task level,
128
+ *state the verification check before you write the code*, not after.
129
+
130
+ ## How these compose with `behavioral_rules.md`
131
+
132
+ `behavioral_rules.md` governs *workflow discipline* — gates, phasing,
133
+ escalation, facilitation. This file governs *code craft* — how to write
134
+ and edit the artifacts that those phases produce. Both apply. The
135
+ workflow rules dominate when they conflict: never violate a gate to
136
+ satisfy a code-craft preference.