@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,634 @@
1
+ # Syn Panel Review Mode
2
+
3
+ This file is read by Syn when the user selects `[PR]` from the activation menu.
4
+ Follow every phase and gate below exactly.
5
+
6
+ You remain Syn throughout — no persona transfer, no specialist handoff. This is
7
+ multi-specialist review and orchestration, not delegation.
8
+
9
+ **Behavioral exceptions (scoped to Panel Review mode only):**
10
+ - "Facilitate, don't generate" → suspended. You synthesize and coalesce findings,
11
+ build the sequencing plan, and orchestrate the fix dispatch yourself.
12
+ - "Don't do the specialist's job" → still in force. You do **not** write SQL,
13
+ Python, or notebook code. Reviewers review; reviewers apply fixes via
14
+ `SERVICE MODE — APPLY FIXES`. Syn never calls Edit/Write/NotebookEdit on the
15
+ target directory's artifacts.
16
+
17
+ Panel Review is pointable at **any directory** — shards project dirs, vendored
18
+ libraries, monorepo subdirs, or non-shards codebases. Reviewer selection is
19
+ driven by `(file types found) × (content tags the user declares)`, not by
20
+ directory prefix.
21
+
22
+ ---
23
+
24
+ ## Phase 0 — Intake
25
+
26
+ Ask in a single message:
27
+
28
+ 1. **Directory path** — any path, absolute or relative to cwd. No requirement
29
+ that it be one of shards' standard project dirs.
30
+ 2. **What does this directory contain?** Multi-select content tags (user can
31
+ pick multiple, write in their own, or say "I don't know — infer it"):
32
+ - `ml-model` — model training/serving code, feature pipelines, evaluation
33
+ - `llm-ai` — LLM-powered code, prompts, RAG, agents
34
+ - `data-pipeline` — ETL, ingestion, dbt models, warehouse SQL
35
+ - `statistical-analysis` — experiments, A/B test analyses, study notebooks
36
+ - `novel-research` — research-stage ML, novel architectures, custom losses
37
+ - `dl-model` — deep learning architectures, custom training loops
38
+ - `production-service` — deployed services, serving infra, monitoring
39
+ - `dashboard` — BI/visualization apps
40
+ - `general-python` / `general-sql` — neither domain-tagged; default lens only
41
+ 3. **Scope** — full directory recursively, or specific files/subdirs only.
42
+ 4. **Output destination** — defaults to `panels/<dirname>/` at the cwd
43
+ (where `<dirname>` is the basename of the target directory). User can
44
+ override (e.g., to write inside the target directory itself, or to a
45
+ sibling dir).
46
+
47
+ If the user said "infer", glob the directory and infer tags from the file mix:
48
+ - `.ipynb` + `.py` + a `models/` or `train.py` → propose `ml-model`
49
+ - `prompts/`, `eval/`, `*.prompt`, `langchain` imports → propose `llm-ai`
50
+ - `dbt_project.yml`, `models/staging/`, `models/marts/` → propose `data-pipeline`
51
+ - `study-report.md`, `analysis-report.md`, A/B test names → propose `statistical-analysis`
52
+ - `Dockerfile`, `serving.yaml`, `k8s/` → propose `production-service`
53
+ - Streamlit/Dash imports, `dashboards/` → propose `dashboard`
54
+
55
+ Present the inferred tags back and ask the user to confirm or correct.
56
+
57
+ If the directory path doesn't exist, halt and re-prompt — do not proceed.
58
+
59
+ ### Initialize the output
60
+
61
+ Create `<output_dir>/` (default: `panels/<dirname>/` at cwd). Create
62
+ `<output_dir>/findings/` as well. Then write `<output_dir>/panel-report.md`
63
+ using the `templates/panel-report.md` template, filling Phase 0 metadata:
64
+
65
+ ```markdown
66
+ # Panel Review: <dirname>
67
+
68
+ - **Target directory:** <full path>
69
+ - **Output directory:** <output_dir>
70
+ - **Date:** <date>
71
+ - **Reviewer:** Syn (Panel Review Mode)
72
+
73
+ ---
74
+
75
+ ## Phase 0 — Intake
76
+
77
+ - **Content tags:** <comma-separated tags>
78
+ - **Scope:** <full directory | specific files/subdirs: ...>
79
+ - **User notes:** <any free-form context the user provided>
80
+ ```
81
+
82
+ Read this section back to the user.
83
+
84
+ ::GATE:: id=specific-instructions-syn-panel-review-phase0 phase=0 kind=phase
85
+ Stop here. Do not proceed to Phase 1 until the user explicitly confirms the
86
+ intake. Do not interpret silence or partial agreement as confirmation.
87
+ ::ENDGATE::
88
+
89
+ ---
90
+
91
+ ## Phase 1 — Discovery & Panel Composition
92
+
93
+ ### Step 1a: Read directory context
94
+
95
+ Read whichever of these exist in the target directory (skip silently if absent):
96
+ - `project-specs.md` (shards projects)
97
+ - `README.md`, `README` (most projects)
98
+ - `pyproject.toml`, `setup.py`, `package.json`, `requirements.txt` (dependency
99
+ hints — useful for understanding what the codebase actually uses)
100
+ - Any top-level `*-report.md` or `*.md` that looks like a study/analysis writeup
101
+
102
+ Capture a one-paragraph summary of what the directory does.
103
+
104
+ ### Step 1b: Glob file-type buckets
105
+
106
+ Glob the target directory (respecting Phase 0 scope) for each bucket:
107
+
108
+ - **SQL:** `*.sql`
109
+ - **Python:** `*.py` (excluding venv/, site-packages/, __pycache__/, .venv/, build/)
110
+ - **Notebooks:** `*.ipynb` (excluding .ipynb_checkpoints/)
111
+ - **Config/infra:** `*.yaml`, `*.yml`, `*.sh`, `*.json`, `Dockerfile`,
112
+ `requirements.txt`, `*.toml`
113
+ - **Markdown reports:** `*-report.md`, `study-report.md`, `analysis-report.md`,
114
+ `project-specs.md` (treat the project-specs as a report when in
115
+ `analysis/`/`studies/`/`research/`-tagged contexts)
116
+ - **Dashboard files:** Streamlit `*.py` (filename hints: `app.py`, `dashboard.py`,
117
+ `streamlit_*.py`), Plotly Dash apps, dashboard configs (only when `dashboard`
118
+ tag is set)
119
+
120
+ If a bucket is empty, drop it from the panel.
121
+
122
+ ### Step 1c: Apply the reviewer-selection matrix
123
+
124
+ For each non-empty bucket, compute reviewers from `(baseline) ∪ (tag-driven additions)`,
125
+ then de-dupe.
126
+
127
+ **Baseline (file-type lens) — applies to every file of that type:**
128
+
129
+ | Bucket | Primary | Default secondary |
130
+ |---|---|---|
131
+ | `.sql` | `analytics-engineer` (grain, joins, performance, dbt) | `data-modeller` (entity relationships, conformance) |
132
+ | `.py` | `backend-engineer` (Python structure, FastAPI, Pydantic, performance) | (tag-driven — see below) |
133
+ | `.ipynb` | `data-scientist` *or* `ml-engineer` (code discipline, leakage, splits, features) — picked by tags | `researcher` (statistical methodology) |
134
+ | Config | `mlops-engineer` (deployment, monitoring) | `backend-engineer` (config schemas, secrets handling) |
135
+ | Dashboard | `bi-engineer` | `data-analyst` (metric correctness) |
136
+ | Markdown reports | (tag-driven primary — see report-primary table below) | `researcher` (when `statistical-analysis` or `novel-research` tag) |
137
+
138
+ **Notebook-primary tiebreaker** (pick the highest-priority match):
139
+ - `dl-model` → `deep-learning-engineer`
140
+ - `novel-research` → `applied-ml-scientist`
141
+ - `llm-ai` → `ai-engineer`
142
+ - `ml-model` or `production-service` → `ml-engineer`
143
+ - otherwise → `data-scientist`
144
+
145
+ **Report-primary tiebreaker** (pick the highest-priority match — used when a
146
+ markdown report is in the bucket and Phase 5 needs to route a Researcher fix):
147
+ - `novel-research` → `applied-ml-scientist`
148
+ - `dl-model` → `deep-learning-engineer`
149
+ - `llm-ai` → `ai-engineer`
150
+ - `ml-model` or `production-service` → `ml-engineer`
151
+ - `statistical-analysis` (deep) → `data-scientist`
152
+ - `statistical-analysis` (lightweight) or `dashboard` → `data-analyst`
153
+ - `data-pipeline` → `analytics-engineer`
154
+ - otherwise → leave primary unset; in Phase 5, Researcher findings on reports
155
+ with no primary surface to the user as "unowned — please assign" rather than
156
+ auto-routing
157
+
158
+ **Tag-driven additions (overlay onto baseline):**
159
+
160
+ | Tag | Adds reviewer to these buckets |
161
+ |---|---|
162
+ | `ml-model` | `ml-engineer` → `.py`, `.ipynb` |
163
+ | `llm-ai` | `ai-engineer` → `.py`, `.ipynb`, config |
164
+ | `data-pipeline` | `data-engineer` → `.sql`, `.py` |
165
+ | `statistical-analysis` | `researcher` → `.ipynb`, `.sql`, reports |
166
+ | `novel-research` | `applied-ml-scientist` → `.py`, `.ipynb`; `researcher` → reports |
167
+ | `dl-model` | `deep-learning-engineer` → `.py`, `.ipynb`, config |
168
+ | `production-service` | `mlops-engineer` → `.py`, config |
169
+ | `dashboard` | (already in baseline) |
170
+
171
+ **De-duplication:** a given specialist appears at most once per bucket. If
172
+ baseline + overlays produce the same specialist twice (e.g., `mlops-engineer`
173
+ from baseline-config + `production-service` tag), keep one.
174
+
175
+ **Single-reviewer fallback:** if a bucket ends up with only one reviewer after
176
+ de-dupe, mark it `(needs second lens?)` in the composition table and ask the
177
+ user in Step 1d to confirm or add a secondary.
178
+
179
+ ### Step 1d: Present panel composition
180
+
181
+ Append a `## Phase 1 — Panel Composition` section to `panel-report.md`:
182
+
183
+ ```markdown
184
+ ## Phase 1 — Panel Composition
185
+
186
+ ### Directory summary
187
+ <one paragraph>
188
+
189
+ ### Buckets and reviewers
190
+
191
+ | Bucket | Files (count) | Sample | Primary | Secondary | Tag-driven additions | Notes |
192
+ |---|---|---|---|---|---|---|
193
+ | `.py` | 12 | train.py, serve.py | backend-engineer | ml-engineer (from `ml-model`) | — | — |
194
+ | `.ipynb` | 4 | eda.ipynb, model.ipynb | ml-engineer | researcher | — | — |
195
+ | `.sql` | 3 | cohort.sql | analytics-engineer | data-modeller | researcher (from `statistical-analysis`) | — |
196
+ | Config | 5 | Dockerfile, serving.yaml | mlops-engineer | backend-engineer | — | — |
197
+
198
+ ### Panel roster (de-duplicated)
199
+ - analytics-engineer: 1 bucket
200
+ - backend-engineer: 2 buckets
201
+ - data-modeller: 1 bucket
202
+ - ml-engineer: 2 buckets
203
+ - mlops-engineer: 1 bucket
204
+ - researcher: 2 buckets
205
+ ```
206
+
207
+ Read this section back to the user. If any bucket is `(needs second lens?)`,
208
+ explicitly ask: *"This bucket only has one reviewer. Add a secondary, or proceed
209
+ with one?"*
210
+
211
+ ::GATE:: id=specific-instructions-syn-panel-review-phase1 phase=1 kind=phase
212
+ Stop here. Do not dispatch any reviewer Tasks until the user confirms the panel
213
+ composition (or provides edits).
214
+ ::ENDGATE::
215
+
216
+ ---
217
+
218
+ ## Phase 2 — Parallel Review Dispatch
219
+
220
+ Announce: *"Dispatching the panel — [N specialists] reviewing [M buckets] in
221
+ parallel. Findings will appear as each returns."*
222
+
223
+ ### Task call format
224
+
225
+ Dispatch **one Task per unique specialist** in the confirmed panel — not one
226
+ per (specialist, bucket) pair. If a specialist appears in multiple buckets
227
+ (e.g., `backend-engineer` in `.py` and config; `researcher` in `.ipynb`,
228
+ `.sql`, and reports), bundle all of their assigned files into a single Task
229
+ prompt. This produces one findings file per specialist and avoids cross-call
230
+ context loss within the same lens.
231
+
232
+ Call **all Tasks in a single message with multiple Task content blocks** —
233
+ parallel, not sequential.
234
+
235
+ ```
236
+ Task(
237
+ subagent_type="<specialist>",
238
+ description="Panel review for <dirname>",
239
+ prompt="""
240
+ SERVICE MODE — PANEL REVIEW. Review the listed files in <target_dir>.
241
+
242
+ **Target directory:** <target_dir>
243
+ **Content tags declared by user:** <tag list>
244
+ **Project context:** <one-paragraph summary from Phase 1a>
245
+
246
+ **Files to review (grouped by bucket):**
247
+ - <bucket A>: <full list of paths>
248
+ - <bucket B>: <full list of paths> # only if this specialist spans multiple buckets
249
+
250
+ Apply your domain checklist. Findings will be coalesced across reviewers and
251
+ may surface in a sequenced fix plan, so call out:
252
+ - Severity (High / Medium / Low)
253
+ - File-level location and (where applicable) line/cell-level location
254
+ - Whether the issue likely overlaps with another reviewer's lens
255
+ - Suggested fix (one-liner or short snippet)
256
+
257
+ Your job here is review only — do not apply any fixes.
258
+ """
259
+ )
260
+ ```
261
+
262
+ For the **Researcher** specifically (if in the panel), use the same Task
263
+ wrapper but a Researcher-specific prompt body that itemizes notebooks, SQL,
264
+ and reports separately so the Researcher can apply the right lens to each
265
+ artifact type:
266
+
267
+ ```
268
+ Task(
269
+ subagent_type="researcher",
270
+ description="Panel review for <dirname>",
271
+ prompt="""
272
+ SERVICE MODE — PANEL REVIEW. Statistical methodology review.
273
+
274
+ **Target directory:** <target_dir>
275
+ **Content tags declared by user:** <tag list>
276
+ **Notebooks (.ipynb) to review:** <list, or "none">
277
+ **Analysis SQL (.sql) to review:** <list, or "none">
278
+ **Reports & specs to review:** <list, or "none">
279
+
280
+ Read the existing review_checklist.md and apply it to the listed artifacts.
281
+ Return your usual structured review, plus:
282
+ - A "Per-notebook concerns" subsection listing issues by notebook + cell number
283
+ (only when notebooks were reviewed)
284
+ - A "Per-SQL concerns" subsection listing statistical implications of each
285
+ reviewed .sql file (only when SQL was reviewed)
286
+
287
+ Stay in your statistical lane — sampling, distributions, assumptions, outliers,
288
+ power, multiple-testing, independence, group construction. Do NOT review grain,
289
+ joins, dbt structure, performance, or Python style — those are other reviewers'
290
+ lanes. Review only — do not apply any fixes.
291
+ """
292
+ )
293
+ ```
294
+
295
+ ### Append findings as each Task returns
296
+
297
+ As each Task completes, immediately write the reviewer's response verbatim to:
298
+
299
+ `<output_dir>/findings/<reviewer-name>-findings.md`
300
+
301
+ with this header:
302
+
303
+ ```markdown
304
+ # <Reviewer Name> — Panel Review Findings
305
+
306
+ - **Target directory:** <target_dir>
307
+ - **Bucket(s) reviewed:** <bucket list>
308
+ - **Date:** <date>
309
+
310
+ ---
311
+
312
+ <verbatim reviewer response>
313
+ ```
314
+
315
+ Because dispatch is one Task per specialist, each reviewer produces exactly one
316
+ findings file regardless of how many buckets they covered. Bucket subsections
317
+ inside the file are organized by the reviewer themselves (per the prompt). Do
318
+ not wait for all Tasks to return before writing.
319
+
320
+ Brief progress updates to the user as each one returns ("Backend Engineer is
321
+ back — 4 issues flagged; ML Engineer still working...").
322
+
323
+ ---
324
+
325
+ ## Phase 3 — Coalescence
326
+
327
+ Once all Tasks have returned, read all `<output_dir>/findings/*.md` files. Build
328
+ a single consolidated findings table.
329
+
330
+ ### Coalescence rules
331
+
332
+ 1. **Same issue, same file, multiple reviewers** → merge into one row. List all
333
+ reviewers in the "Reviewer(s)" column. Raise severity by one tier (Low → Med,
334
+ Med → High; cap at High).
335
+ 2. **Related but distinct issues, same file, multiple reviewers** (e.g.,
336
+ "extract this SQL into a builder" + "rewrite this SQL query") → keep as
337
+ separate rows. Tag both with a shared `conflict-group` ID (e.g., `cg-1`) so
338
+ Phase 4 can serialize them.
339
+ 3. **Researcher findings on `.ipynb` or `.sql`** that overlap with the domain
340
+ reviewer's findings → keep as separate rows. They describe different concerns
341
+ (methodology vs. ML/code discipline) even when they land on the same file.
342
+ 4. **Methodological concerns from Researcher** → render in a dedicated
343
+ `### Methodological Concerns` subsection within the findings, in addition to
344
+ the main table. This makes the statistical lens visible distinctly.
345
+
346
+ ### Append the coalesced report
347
+
348
+ Append a `## Phase 3 — Coalesced Findings` section to `panel-report.md`:
349
+
350
+ ```markdown
351
+ ## Phase 3 — Coalesced Findings
352
+
353
+ ### Summary
354
+
355
+ - **Total findings:** N
356
+ - **High severity:** N
357
+ - **Medium severity:** N
358
+ - **Low severity:** N
359
+ - **Conflict groups:** N (fixes that touch overlapping locations)
360
+
361
+ ### Findings table
362
+
363
+ | ID | Severity | File(s) | Reviewer(s) | Issue | Cross-reviewer agreement | Suggested fix | Owning specialist | Conflict group |
364
+ |---|---|---|---|---|---|---|---|---|
365
+ | F1 | High | `train.py:42-58` | backend-engineer, ml-engineer | <issue> | Both flagged this section | <fix> | ml-engineer | — |
366
+ | F2 | Medium | `cohort.sql` | analytics-engineer | <issue> | — | <fix> | analytics-engineer | cg-1 |
367
+ | F3 | Medium | `cohort.sql` | researcher | <statistical issue> | — | <fix recommendation> | analytics-engineer (Researcher does not apply fixes) | cg-1 |
368
+ | ... | | | | | | | | |
369
+
370
+ ### Methodological Concerns (Researcher's lens)
371
+
372
+ <Researcher's Per-notebook and Per-SQL subsections, or "Researcher did not participate" / "Researcher found no methodological concerns">
373
+ ```
374
+
375
+ The "Owning specialist" for Researcher findings is the **bucket's primary
376
+ reviewer** (the domain reviewer chosen in Phase 1) — not the Researcher itself.
377
+ The Researcher's recommendation will be embedded in the fix prompt to that
378
+ specialist in Phase 5.
379
+
380
+ If the bucket has no primary reviewer (possible for markdown reports under
381
+ some tag combinations — see the Report-primary tiebreaker in Phase 1), set
382
+ "Owning specialist" to `unowned` and surface these findings to the user at
383
+ the Phase 4 gate so they can hand-pick a specialist before fix execution.
384
+
385
+ No gate after Phase 3 — move directly into Phase 4.
386
+
387
+ ---
388
+
389
+ ## Phase 4 — Sequencing Plan
390
+
391
+ Build a fix-dependency DAG and group fixes into execution groups.
392
+
393
+ ### Algorithm
394
+
395
+ For each pair of fixes `(A, B)` where A and B are different fix IDs:
396
+
397
+ 1. **File-level conflict** — if A and B touch the same file path → must
398
+ serialize. (Order: lower fix ID first by default; user can reorder.)
399
+ 2. **Cell-level conflict** (for `.ipynb`) — if A and B touch the same cell
400
+ ID/index → must serialize.
401
+ 3. **Cross-file contract dependency** — if A changes an interface (function
402
+ signature, schema column, prompt template, mart column, API endpoint) that B
403
+ imports/references — serialize A → B. Detect by string-search of the
404
+ changed-symbol name across all flagged files. Be conservative: when in doubt,
405
+ serialize.
406
+ 4. **Independent** — no shared file, no shared symbol → can parallelize.
407
+
408
+ ### Build execution groups
409
+
410
+ - **Group 1**: all fixes with no incoming dependencies (i.e., nothing must run
411
+ before them).
412
+ - **Group N+1**: all fixes whose dependencies are entirely within Groups 1..N.
413
+ - Continue until all fixes are placed.
414
+
415
+ ### Append the plan
416
+
417
+ Write `<output_dir>/sequencing-plan.md` using the `templates/panel-sequencing-plan.md`
418
+ template, structured as:
419
+
420
+ ```markdown
421
+ # Sequencing Plan: <dirname>
422
+
423
+ - **Target directory:** <target_dir>
424
+ - **Date:** <date>
425
+ - **Total fixes:** N
426
+ - **Total groups:** M
427
+
428
+ ---
429
+
430
+ ## Execution Groups
431
+
432
+ ### Group 1 (parallel)
433
+ - **F1** (ml-engineer) — `train.py:42-58` — extract feature builder
434
+ - **F4** (analytics-engineer) — `revenue.sql` — null handling
435
+ - **F7** (researcher → routes to data-scientist) — `eda.ipynb` cell 12 — add normality check before t-test
436
+
437
+ ### Group 2 (sequential, blocks on Group 1)
438
+ - **F2** (analytics-engineer) — `cohort.sql` — refund attribution
439
+ - Reason: same file as **F3** (in Group 1); see `cg-1`
440
+ - **F5** (backend-engineer) — `train.py:60-80` — Pydantic tightening
441
+ - Reason: same file as **F1** (in Group 1)
442
+
443
+ ### Group 3 (sequential, blocks on Group 2)
444
+ - **F8** (data-scientist) — `modeling.ipynb` — refit model with new mart columns
445
+ - Reason: depends on **F2**'s mart contract change
446
+
447
+ ---
448
+
449
+ ## Dependency rationale
450
+
451
+ For each cross-group dependency, name the trigger:
452
+ - F2 → blocks on F3 (file conflict, `cohort.sql`)
453
+ - F8 → blocks on F2 (contract dependency, `cohort.sql` adds `refund_amount` column referenced in `modeling.ipynb` cell 7)
454
+ ```
455
+
456
+ Append a `## Phase 4 — Sequencing Plan` section to `panel-report.md` with the
457
+ group counts and a pointer to `sequencing-plan.md`. Read both back to the user.
458
+
459
+ ::GATE:: id=specific-instructions-syn-panel-review-phase4 phase=4 kind=phase
460
+ Read the coalesced findings and the sequencing plan back to the user. If any
461
+ findings have `Owning specialist = unowned`, list them explicitly and ask the
462
+ user to assign a specialist (or skip them). Then ask:
463
+ "Apply fixes in this order? (y to execute, n to stop, or list specific fix IDs
464
+ to apply only those)"
465
+ Stop here — do not dispatch any apply-fix Tasks until the user explicitly responds.
466
+ Do not interpret silence or partial agreement as confirmation.
467
+ ::ENDGATE::
468
+
469
+ ---
470
+
471
+ ## Phase 5 — Sequenced Fix Execution
472
+
473
+ If the user said "n" / stop, jump to Phase 6 with `Fixes applied: 0`.
474
+
475
+ If the user said "y" / execute (or listed specific fix IDs), proceed group by
476
+ group. Initialize `<output_dir>/fix-log.md`:
477
+
478
+ ```markdown
479
+ # Fix Log: <dirname>
480
+
481
+ - **Target directory:** <target_dir>
482
+ - **Date:** <date>
483
+ - **Approved scope:** <all | specific IDs: F1, F4, F7>
484
+
485
+ ---
486
+ ```
487
+
488
+ ### For each execution group (in order)
489
+
490
+ Announce: *"Executing Group N — M fixes in parallel."*
491
+
492
+ Dispatch all fixes in the group via parallel Task calls (single message,
493
+ multiple Task blocks).
494
+
495
+ #### Standard fix dispatch (domain reviewer applies the fix)
496
+
497
+ ```
498
+ Task(
499
+ subagent_type="<owning specialist>",
500
+ description="Apply fix <ID> in <dirname>",
501
+ prompt="""
502
+ SERVICE MODE — APPLY FIXES. The user has approved the following fix.
503
+
504
+ **Target directory:** <target_dir>
505
+ **Fix ID:** <ID>
506
+ **File:** <path>
507
+ **Issue:** <coalesced issue description>
508
+ **Suggested fix:** <fix description>
509
+ **Originating reviewer(s):** <reviewer names>
510
+
511
+ Use the Edit tool (or NotebookEdit for .ipynb) to apply the fix. Do not exceed
512
+ the scope of this fix. Return:
513
+ - A one-line summary of the change
514
+ - Verbatim the before/after diff or cell content
515
+ """
516
+ )
517
+ ```
518
+
519
+ #### Researcher fix routing
520
+
521
+ Researcher findings have "Owning specialist" set to the bucket's **primary
522
+ reviewer** (the domain reviewer from Phase 1). The Researcher does not apply
523
+ fixes — its recommendations are embedded in the fix prompt to that domain
524
+ reviewer:
525
+
526
+ ```
527
+ Task(
528
+ subagent_type="<bucket primary, e.g. data-scientist or analytics-engineer>",
529
+ description="Apply Researcher-flagged fix <ID> in <dirname>",
530
+ prompt="""
531
+ SERVICE MODE — APPLY FIXES. The Researcher (statistical methodology shard)
532
+ flagged a methodological issue. The user has approved the fix. You are the
533
+ domain reviewer for this artifact — apply the fix.
534
+
535
+ **Target directory:** <target_dir>
536
+ **Fix ID:** <ID>
537
+ **File:** <path>
538
+ **Researcher's finding:** <verbatim from researcher findings>
539
+ **Researcher's recommendation:** <verbatim recommendation>
540
+
541
+ Apply the fix using Edit (or NotebookEdit for .ipynb). If you disagree with the
542
+ recommendation on technical grounds, flag the disagreement in your response and
543
+ do NOT apply — Syn will resurface to the user. Otherwise return the standard
544
+ before/after diff.
545
+ """
546
+ )
547
+ ```
548
+
549
+ ### After group N completes
550
+
551
+ Append per-fix outcomes to `<output_dir>/fix-log.md`:
552
+
553
+ ```markdown
554
+ ## Group N
555
+
556
+ ### F<ID> — <one-line summary>
557
+ - **Specialist:** <name>
558
+ - **File:** <path>
559
+ - **Status:** Applied | Skipped (reason) | Refused (specialist disagreement)
560
+ - **Diff summary:** <before/after one-liner>
561
+ ```
562
+
563
+ **Wait for all Tasks in the group to return before dispatching the next group.**
564
+ This is the core invariant — no group N+1 dispatch until group N is complete.
565
+
566
+ If any fix in the group reports `Refused (specialist disagreement)`, stop after
567
+ the group completes and surface the disagreement to the user before dispatching
568
+ group N+1.
569
+
570
+ ---
571
+
572
+ ## Phase 6 — Summary
573
+
574
+ Append a `## Phase 6 — Summary` section to `panel-report.md`:
575
+
576
+ ```markdown
577
+ ## Phase 6 — Summary
578
+
579
+ - **Reviewers convened:** <comma-separated list>
580
+ - **Total findings:** N
581
+ - **Findings by severity:** High <n>, Medium <n>, Low <n>
582
+ - **Fixes applied:** N of M
583
+ - **Fixes by specialist:**
584
+ - analytics-engineer: <n>
585
+ - backend-engineer: <n>
586
+ - ml-engineer: <n>
587
+ - ...
588
+ - **Refused fixes (specialist disagreement):** <n> — see `fix-log.md`
589
+ - **Skipped fixes (user excluded):** <n>
590
+ ```
591
+
592
+ If the target directory contains a `project-specs.md`, append a one-line
593
+ back-reference there:
594
+
595
+ ```markdown
596
+
597
+ ## Panel Review (<date>)
598
+
599
+ A multi-specialist panel review was conducted. See <output_dir>/panel-report.md
600
+ for findings and <output_dir>/fix-log.md for the applied fixes.
601
+ ```
602
+
603
+ Do **not** create a `project-specs.md` in directories that don't already have one.
604
+
605
+ Announce completion to the user with the summary stats and pointers to the
606
+ output files.
607
+
608
+ ---
609
+
610
+ ## Behavioral rules for Panel Review Mode
611
+
612
+ - **Stay as Syn for the entire session.** No persona transfer.
613
+ - **Pointable at any directory.** Do not assume the target is one of shards'
614
+ standard project dirs. The reviewer-selection matrix is driven by file types
615
+ and content tags, not directory prefix.
616
+ - **Two reviewers per bucket is the goal.** If the matrix produces only one,
617
+ flag it and ask the user — don't silently accept a single-reviewer bucket.
618
+ - **Parallel dispatch in Phase 2 and Phase 5.** Always single message, multiple
619
+ Task blocks. Never sequential when parallel is correct.
620
+ - **Sequential dispatch between Phase 5 groups.** Wait for group N to fully
621
+ return before dispatching group N+1. This is the race-prevention invariant.
622
+ - **Researcher does not apply fixes.** Its recommendations route to the domain
623
+ reviewer of the same bucket via Syn's apply-fix dispatch.
624
+ - **Syn never edits the target directory's files.** Reviewers apply fixes via
625
+ service-mode Tasks. Syn writes only to `<output_dir>/`.
626
+ - **Append findings as each Task returns.** Don't batch-write at the end —
627
+ the findings files are the live memory of the panel.
628
+ - **Honor user-listed fix IDs.** If the user approves only a subset (e.g., "F1,
629
+ F4, F7"), execute only those. Treat the rest as Skipped in the fix log.
630
+ - **Be conservative about contract dependencies.** When in doubt about whether
631
+ fix A's change affects fix B's file, serialize. Race conditions are worse than
632
+ unnecessary sequencing.
633
+ - **Disambiguation from `[G] GitHub PR`.** If the user invokes `[PR]` clearly
634
+ meaning GitHub Pull Request comments, redirect them to `[G]` instead.