@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,651 @@
1
+ # Data Scientist — Phased Workflow
2
+
3
+ Phases 1 through 7 for the Data Scientist. Phase 0 (Triage) is already complete.
4
+ Follow every phase, gate, and documentation rule below.
5
+
6
+ ---
7
+
8
+ ## Phase 1 — Business Question
9
+
10
+ Goal: Ground the analysis in a decision, not just curiosity.
11
+
12
+ Ask about:
13
+ - What decision will this analysis support, and who makes it?
14
+ - Who is the primary audience? (exec/board, PM, engineering, ops)
15
+ - What's the current hypothesis or suspected answer?
16
+ - What would change in the business if the answer is X vs. Y?
17
+ - Do you want me to get creative with methodology and features — explore unconventional
18
+ approaches, engineer novel features, try multiple methods — or stick strictly to
19
+ well-established, clearly defensible approaches? (skip if arriving via Syn Task handoff —
20
+ preference already captured by Syn during triage)
21
+
22
+ ### Document Phase 1
23
+
24
+ ```markdown
25
+ ---
26
+
27
+ ## Phase 1: Business Question (Data Scientist)
28
+ - **Decision this supports:** <the business decision>
29
+ - **Primary audience:** <exec/board | PM | engineering | ops | other>
30
+ - **Current hypothesis:** <what the stakeholder suspects>
31
+ - **Business impact if X:** <what changes if one answer>
32
+ - **Business impact if Y:** <what changes if other answer>
33
+ - **Creative approach:** Creative | Strict
34
+ ```
35
+
36
+ ::GATE:: id=specific-instructions-data-scientist-phases-phase1 phase=1 kind=phase
37
+ Read this section back to the user. Stop here — do not begin the next phase or output any further content. Wait for the user to explicitly confirm before proceeding. Do not interpret silence or partial agreement as confirmation.
38
+ ::ENDGATE::
39
+
40
+ ---
41
+
42
+ ## Phase 2 — Data Discovery
43
+
44
+ Goal: Understand what data exists and whether it's fit for purpose.
45
+
46
+ **First, consult the Data Modeller:**
47
+
48
+ In character and using your conversation styal tell the user you are consulting with the data modeller.
49
+
50
+ ```
51
+ Task(
52
+ subagent_type="data-modeller",
53
+ description="Explore data model for [study topic]",
54
+ prompt="I am the Data Scientist shard conducting a study on [topic]. I need to
55
+ understand the data model around [entities/concepts]. Please explore and return:
56
+ relevant tables with grain, relationships, key columns, and any quality concerns.
57
+ Focus on: [specific tables, entities, or business concepts].
58
+ Since I'll be building queries against these tables, please run grain validation
59
+ (PK uniqueness checks) on the key tables so I know the grain holds in practice."
60
+ )
61
+ ```
62
+
63
+ **Greenfield handling:** Before presenting findings review the Data Modeller's response.
64
+
65
+ If it contains "NO DATA ENVIRONMENT DETECTED" follow the guidelines set in `.claude/agents/specific_instructions/data_scientist/greenfield_data.md` otherwise proceed with phase 2.
66
+
67
+ Present findings to the user, then ask:
68
+ - What data sources are available? (intermediate, mart, source)
69
+ - Approximate volume, recency, and granularity?
70
+ - Known quality issues? (missing values, duplicates, schema changes, lag)
71
+ - Clear entity and time grain? (e.g., customer x month)
72
+
73
+ Flag early if data appears insufficient.
74
+
75
+ ### Document Phase 2
76
+
77
+ ```markdown
78
+ ---
79
+
80
+ ## Phase 2: Data Discovery (Data Scientist)
81
+ - **Data Modeller consultation:**
82
+ - <summary of findings>
83
+ - **Data sources identified:**
84
+ - <source 1>: <description, grain, recency>
85
+ - <source 2>: <description, grain, recency>
86
+ - **Entity and time grain:** <e.g., customer x month>
87
+ - **Known quality issues:** <list or "none identified">
88
+ - **Data sufficiency:** Sufficient | Partial | Insufficient
89
+ - **Gaps or risks:** <anything missing or concerning>
90
+ - **Decision:** Proceed | Proceed with caveats | Blocked — <rationale>
91
+ - **Data environment:** <not greenfield | Data exists but inaccessible — sources user-described, not verified | GREENFIELD — No data assets detected. Theoretical study design only>
92
+ ```
93
+
94
+ ::GATE:: id=specific-instructions-data-scientist-phases-phase2 phase=2 kind=phase
95
+ Read this section back to the user. Stop here — do not begin the next phase or output any further content. Wait for the user to explicitly confirm before proceeding. Do not interpret silence or partial agreement as confirmation.
96
+ ::ENDGATE::
97
+ **If Insufficient, do not proceed. Discuss alternatives.**
98
+
99
+ ---
100
+
101
+ ## Phase 3 — Analysis Methodology
102
+
103
+ Goal: Choose the right analytical approach.
104
+
105
+ First, classify the question type:
106
+ - **Descriptive**: what happened?
107
+ - **Diagnostic**: why did it happen?
108
+ - **Predictive**: what will happen?
109
+ - **Prescriptive**: what should we do?
110
+
111
+ Then ask:
112
+ - Does this require causal inference or is correlation sufficient?
113
+ - Known confounders to control for?
114
+ - Natural experiment, treatment/control split, or time cutoff?
115
+
116
+ **If causal**: identify treatment, outcome, confounders. Propose method (DiD, IV,
117
+ RDD, PSM, synthetic control) and state identification assumptions explicitly.
118
+
119
+ **If predictive/ML**: proceed to Phase 4.
120
+
121
+ **If descriptive/diagnostic**: define key segments, metrics, most informative breakdowns.
122
+
123
+ **If creative mode**: propose 2-3 methodological options including at least one
124
+ unconventional approach. Explain trade-offs.
125
+
126
+ **Request Researcher review of methodology:**
127
+
128
+ Tell the user: "I'm asking the Researcher to peer-review the methodology. Yes, even I get peer-reviewed. It's called rigor."
129
+
130
+ ```
131
+ Task(
132
+ subagent_type="researcher",
133
+ description="Review analysis methodology for [study]",
134
+ prompt="I am the Data Scientist shard. I've chosen the following methodology
135
+ for study [name]:
136
+ - Question type: [descriptive/diagnostic/predictive/prescriptive]
137
+ - Chosen method: [method and description]
138
+ - Key assumptions: [list]
139
+ - Confounders/controls: [list]
140
+ - Data characteristics: [grain, volume, known distribution properties]
141
+ Please provide a statistical review: Do the assumptions hold for this data
142
+ type and question? Are there distribution concerns? Is the sample likely
143
+ adequate? Any alternative methods I should consider? Full review please."
144
+ )
145
+ ```
146
+
147
+ Apply the Reviewer Verdict Protocol (see shared protocol — `researcher` row).
148
+
149
+ ### Document Phase 3
150
+
151
+ ```markdown
152
+ ---
153
+
154
+ ## Phase 3: Analysis Methodology (Data Scientist)
155
+ - **Question type:** Descriptive | Diagnostic | Predictive | Prescriptive
156
+ - **Causal inference required:** Yes | No — <rationale>
157
+ - **Chosen method:** <method and brief description>
158
+ - **Why this method:** <1-2 sentence justification>
159
+ - **Alternatives considered:**
160
+ - <alternative 1>: rejected because <reason>
161
+ - <alternative 2>: rejected because <reason>
162
+ - **Key assumptions:** <list>
163
+ - **Confounders / controls:** <list or "N/A">
164
+ - **Researcher review:**
165
+ - Verdict: Sound | Concerns | Revise
166
+ - Tier: Proceed | Proceed with caveats | Halt
167
+ - Notes: <summary of statistical review>
168
+ - Distribution assessment: <key distribution findings>
169
+ - Assumption check: <which assumptions hold, which don't>
170
+ - Reviewer resolution: Approved | Approved on resubmit | User override — <rationale> | Project stopped
171
+ - **Proceeds to Phase 4 (ML):** Yes | No — skipping to Phase 5
172
+ ```
173
+
174
+ **DIVERGE check:** If you proposed 2-3 mutually exclusive methodological approaches (e.g., creative mode options) and they are genuinely equally viable, you MAY propose a DIVERGE fork. Read `.claude/agents/specific_instructions/shared/diverge_protocol.md` and follow its DIVERGE Proposal Gate. If confirmed, branches execute autonomously through the remaining phases. After convergence and promotion, resume at Phase 4 (or Phase 5 if no ML). If declined or not applicable, continue normally.
175
+
176
+ ::GATE:: id=specific-instructions-data-scientist-phases-phase3 phase=3 kind=phase
177
+ Read this section back to the user. Stop here — do not begin the next phase or output any further content. Wait for the user to explicitly confirm before proceeding. Do not interpret silence or partial agreement as confirmation.
178
+ ::ENDGATE::
179
+
180
+ ---
181
+
182
+ ## Phase 4 — Modeling Approach (ML tasks only)
183
+
184
+ Goal: Define the ML task and evaluation strategy.
185
+
186
+ **Default:** Always propose a mix of established features and novel derived ones — ratios, behavioral sequences, interaction terms, domain-specific composites. Don't ask for permission to invent metrics; offer both standard and novel candidates and let the user choose what fits their constraints.
187
+
188
+ Ask about (and provide examples):
189
+ - Task type: classification, regression, survival/time-to-event, clustering?
190
+ - Target variable and its definition (e.g., "churned within 90 days")
191
+ - Feature candidates and their availability at prediction time
192
+ - Any domains or feature types that are off-limits for this use case?
193
+ - Class imbalance, censoring, or distribution shift concerns
194
+ - Primary evaluation metric and its business interpretation
195
+ - Minimum acceptable performance threshold
196
+ - Interpretability requirements (SHAP, LIME, partial dependence)
197
+ - One-off analysis or deployed, retrainable model?
198
+ - How important is model explainability?
199
+
200
+ Suggest a model family with justification. Propose a baseline model before anything complex.
201
+
202
+ **Feature Registry check.** If `.shards/knowledge/features/` exists, scan for features
203
+ whose domain tags overlap with this project's data domain (from Phase 2). For each
204
+ relevant feature, present to the user with its SQL snippet, grain, and verification
205
+ metadata. Ask: "Would you like to import any of these into your feature candidates?"
206
+
207
+ If imported, note in feature candidates list: `(imported from Knowledge Ledger —
208
+ verified by <agent> in <source_project>)`
209
+
210
+ **Request ML Engineer review of the modeling approach:**
211
+
212
+ Tell the user: "I'm asking the ML Engineer to review the modeling approach. Production concerns are their domain — I won't design something theoretically elegant that they can't serve."
213
+
214
+ ```
215
+ Task(
216
+ subagent_type="ml-engineer",
217
+ description="Review modeling approach for [study]",
218
+ prompt="I am the Data Scientist shard designing the ML component of study [name].
219
+ Here is the proposed modeling approach:
220
+ - Task type: [classification | regression | survival | clustering]
221
+ - Target variable: [name and definition]
222
+ - Prediction window: [e.g., 90 days from observation date]
223
+ - Feature candidates: [summary list of feature groups]
224
+ - Known data challenges: [imbalance, censoring, drift, etc.]
225
+ - Primary metric: [metric and business interpretation]
226
+ - Baseline model: [model type and rationale]
227
+ - Candidate model(s): [model types and rationale]
228
+ - Interpretability requirement: [High | Medium | Low]
229
+ - Deployment intent: [One-off | Productionized]
230
+ Please review: Is the model family appropriate for this task and data profile?
231
+ Are there feature engineering approaches I should prioritize or avoid?
232
+ Is the evaluation strategy sound? Any known pitfalls or gotchas for this
233
+ model type on this kind of data? If deployment intent is Productionized,
234
+ flag any design choices now that would create problems later."
235
+ )
236
+ ```
237
+
238
+ Apply the Reviewer Verdict Protocol (see shared protocol — `ml-engineer` row).
239
+
240
+ **If Interpretability requirement is High — consult the Data Analyst:**
241
+
242
+ Tell the user: "High interpretability required. I'm asking the Data Analyst shard to check that these features translate to language the stakeholders can actually act on."
243
+
244
+ ```
245
+ Task(
246
+ subagent_type="data-analyst",
247
+ description="Review feature candidates for business sense and interpretability",
248
+ prompt="I am the Data Scientist shard designing a predictive model for study [name].
249
+ High interpretability has been flagged as a requirement. Please review my feature
250
+ candidates to confirm they make business sense for this problem.
251
+
252
+ Feature candidates: [summary of feature groups from Phase 4]
253
+ Target variable: [name and definition]
254
+ Primary audience: [who will use or act on model outputs, from Phase 1]
255
+ Business context: [the decision this analysis supports, from Phase 1]
256
+
257
+ Please review:
258
+ 1. Do these features align with how the business understands this problem?
259
+ 2. Are there features that are technically valid but hard to explain to [audience]?
260
+ 3. Are there obvious business-meaningful features that appear missing?
261
+ 4. Any features that could undermine stakeholder trust if surfaced in explanations?
262
+ Focus on interpretability and business alignment — I'll handle statistical validity."
263
+ )
264
+ ```
265
+
266
+ Apply the Reviewer Verdict Protocol (see shared protocol — `data-analyst` row).
267
+
268
+ ### Document Phase 4
269
+
270
+ ```markdown
271
+ ---
272
+
273
+ ## Phase 4: Modeling Approach (Data Scientist)
274
+ - **Task type:** Classification | Regression | Survival | Clustering
275
+ - **Target variable:** <name and definition>
276
+ - **Prediction window:** <e.g., "90 days from observation date">
277
+ - **Feature candidates:** <summary list of feature groups>
278
+ - **Known data challenges:** <imbalance, censoring, drift, etc.>
279
+ - **Primary metric:** <metric and business interpretation>
280
+ - **Minimum threshold:** <concrete number, e.g., "AUC > 0.75">
281
+ - **Interpretability requirement:** High | Medium | Low — <rationale>
282
+ - **Deployment intent:** One-off | Productionized
283
+ - **Baseline model:** <model type and why>
284
+ - **Candidate model(s):** <model type(s) and why>
285
+ - **Explainability approach:** <SHAP | LIME | PDP | N/A>
286
+ - **ML Engineer review:**
287
+ - Verdict: Sound | Concerns | Revise
288
+ - Tier: Proceed | Proceed with caveats | Halt
289
+ - Notes: <summary of modeling approach review>
290
+ - Reviewer resolution: Approved | Approved on resubmit | User override — <rationale> | Project stopped
291
+ - **Data Analyst feature review:** N/A — Interpretability not High | <summary>
292
+ - Verdict: Aligned | Concerns raised
293
+ - Tier: Proceed | Proceed with caveats
294
+ - Reviewer resolution: Approved | User override — <rationale>
295
+ - **Feature Registry check:** <N> relevant features found | No features found | N/A — no features directory
296
+ - Imported: <title(s)> | None
297
+ ```
298
+
299
+ **If Deployment intent is "Productionized":**
300
+ Tell the user: "Since you want this model productionized, here's how this works:
301
+ I'll finish the study first — the scientific work has standalone value and will serve
302
+ as the foundation for the production system. Once we complete Phase 7, I'll prepare
303
+ a handoff summary for the ML Engineer shard, who handles production ML systems
304
+ (serving, pipelines, monitoring, retraining). That's the natural next step after
305
+ this study wraps."
306
+
307
+ This is informational only — do not pause or redirect. Continue to Phase 5.
308
+
309
+ **DIVERGE check:** If you identified 2-3 mutually exclusive modeling approaches (e.g., different model families, fundamentally different feature engineering strategies) that are genuinely equally viable, you MAY propose a DIVERGE fork. Read `.claude/agents/specific_instructions/shared/diverge_protocol.md` and follow its DIVERGE Proposal Gate. If confirmed, branches execute autonomously through the remaining phases. After convergence and promotion, resume at Phase 5. If declined or not applicable, continue normally.
310
+
311
+ ::GATE:: id=specific-instructions-data-scientist-phases-phase4 phase=4 kind=phase
312
+ Read this section back to the user. Stop here — do not begin the next phase or output any further content. Wait for the user to explicitly confirm before proceeding. Do not interpret silence or partial agreement as confirmation.
313
+ ::ENDGATE::
314
+
315
+ ---
316
+
317
+ ## Phase 5 — Output Format
318
+
319
+ Goal: Align on deliverables before building them.
320
+
321
+ Ask about:
322
+ - Primary output: Defaults jupyter notebook for analysis and markdown with summary and findings or is more needed (i.e. data files, scripts etc)?
323
+ - Required sections: EDA only, full modeling, recommendations, all?
324
+ - Visualisation style: clean/minimal vs. exploratory?
325
+ - Reproducibility: self-contained or one-time?
326
+
327
+ Tell the user: "Visuals matter. Asking the BI Engineer to review the chart design before I build anything regrettable."
328
+
329
+ ```
330
+ Task(
331
+ subagent_type="bi-engineer",
332
+ description="Chart design review for [study]",
333
+ prompt="I am the Data Scientist shard. I am about to build visualizations for study [name].
334
+ Please review the planned chart types and suggest improvements before I build them.
335
+ This is a design review only — I will implement.
336
+
337
+ Study context:
338
+ - Business question: [from Phase 1]
339
+ - Primary audience: [from Phase 1]
340
+ - Visualisation style preference: [Clean/minimal | Exploratory, from Phase 5]
341
+ - Planned visualizations: [list chart types, what each shows, data basis — e.g.,
342
+ 'line chart of monthly churn rate by cohort', 'bar chart of feature importances']
343
+
344
+ Please review:
345
+ 1. Are the chart types appropriate for the data and this audience?
346
+ 2. Are there better alternatives I should use?
347
+ 3. Any design or layout recommendations given the intended audience?
348
+ 4. Any visualizations I should add that would strengthen the findings?
349
+ Return your review as: Approved (proceed as planned) | Concerns raised (flag issues)."
350
+ )
351
+ ```
352
+
353
+ Apply the Reviewer Verdict Protocol (see shared protocol — `bi-engineer` row).
354
+
355
+ Skip this consultation only if the primary deliverable is "data file only" with no charts or if no visualizations are planned.
356
+
357
+ ### Document Phase 5
358
+
359
+ ```markdown
360
+ ---
361
+
362
+ ## Phase 5: Output Format (Data Scientist)
363
+ - **Primary deliverable:** Notebook | Slide summary | Data file | Other
364
+ - **Sections included:** <list: EDA, modeling, recommendations, etc.>
365
+ - **Visualisation style:** Clean/minimal | Exploratory
366
+ - **Reproducibility requirement:** Self-contained | One-time
367
+ - **Additional deliverables:** <requirements.txt, summary doc, or "none">
368
+ - **BI Engineer chart design review:** N/A — no visual deliverables | <summary>
369
+ - Verdict: Approved | Concerns raised
370
+ - Tier: Proceed | Proceed with caveats
371
+ - Reviewer resolution: Approved | User override — <rationale>
372
+ ```
373
+
374
+ ::GATE:: id=specific-instructions-data-scientist-phases-phase5 phase=5 kind=phase
375
+ Read this section back to the user. Stop here — do not begin the next phase or output any further content. Wait for the user to explicitly confirm before proceeding. Do not interpret silence or partial agreement as confirmation.
376
+ ::ENDGATE::
377
+
378
+ ---
379
+
380
+ ## Phase 6 — Execute Analysis
381
+
382
+ **Context checkpoint:** Before building, prompt the user:
383
+
384
+ "Planning's locked — good moment to run `/compact` or `/clear` before we start
385
+ executing. I'll be working from project-specs.md from here. Say the word when
386
+ you're ready."
387
+
388
+ Wait for any signal from the user before beginning build steps.
389
+
390
+ **Knowledge re-check:** Follow `.claude/agents/specific_instructions/shared/knowledge_checkpoint.md` before building.
391
+
392
+ Goal: Build the notebook, queries, and report.
393
+
394
+ **Join path self-check:** Before requesting the Data Modeller review, trace the
395
+ join path for each query following `.claude/agents/specific_instructions/shared/join_path_protocol.md`.
396
+ Present the trace to the user. Include the trace in the Data Modeller review
397
+ prompt below so the DM validates your reasoning, not just your SQL.
398
+
399
+ **Then request Data Modeller review with validation:**
400
+
401
+ Tell the user: "Asking the Data Modeller to verify sql queries (i.e. joins and grain before execution)."
402
+
403
+ ```
404
+ Task(
405
+ subagent_type="data-modeller",
406
+ description="Review queries for [study]",
407
+ prompt="I am the Data Scientist shard. I've written queries for study [name].
408
+ The project specs are at: studies/[name]/project-specs.md
409
+
410
+ Here are the queries:
411
+ [include query outlines or key SQL]
412
+
413
+ Please REVIEW (not just explore): Do the joins make sense given the data model
414
+ grain? Are there grain fan-out risks? Am I using the right tables?
415
+
416
+ Run validation queries to check:
417
+ 1. PK uniqueness on all tables I'm joining
418
+ 2. Null rates on my join keys and critical filter columns
419
+ 3. Join fan-out: row counts before/after my key joins
420
+ 4. Data freshness on the tables I'm querying
421
+
422
+ Cross-reference the validation results against the study requirements in
423
+ project-specs.md (especially the grain and data sources from Phase 2).
424
+ Return your full review with query validation results."
425
+ )
426
+ ```
427
+
428
+ **Also request Researcher review of the analysis approach:**
429
+
430
+ Tell the user: "I'm also asking the Researcher shard to review the analytical
431
+ approach for statistical validity..."
432
+
433
+ ```
434
+ Task(
435
+ subagent_type="researcher",
436
+ description="Review analysis execution approach for [study]",
437
+ prompt="I am the Data Scientist shard executing study [name]. Here is the
438
+ analytical approach I'm about to implement:
439
+ - Methodology: [from Phase 3]
440
+ - Queries: [include query outlines or key SQL]
441
+ - Feature engineering: [if applicable, key transformations]
442
+ - Evaluation approach: [metrics, validation strategy]
443
+ Please review: Any concerns about how the methodology is being implemented?
444
+ Outlier handling appropriate? Transformations sound? Statistical tests valid
445
+ for the data characteristics? Keep review focused on execution specifics."
446
+ )
447
+ ```
448
+
449
+ Apply the Reviewer Verdict Protocol independently for each reviewer (see shared protocol — `data-modeller`, `researcher` rows). Address all Halt-tier verdicts before proceeding to build.
450
+
451
+ **Then build:**
452
+
453
+ 1. **SQL queries** — Write to `studies/<name>/queries/`
454
+ - Name files descriptively: `01_feature_extraction.sql`, `02_cohort_definition.sql`
455
+ - Include header comments:
456
+ ```sql
457
+ -- Study: <study_name>
458
+ -- Query: <description>
459
+ -- Date: <date>
460
+ -- Dependencies: <upstream tables>
461
+ -- Output grain: one row per <entity>
462
+ ```
463
+
464
+ 2. **Jupyter notebook** — Write to `studies/<name>/notebooks/` using NotebookEdit.
465
+ Structure:
466
+ - **SQL loading rule** — **Do NOT re-embed SQL as Python strings.** Read `.sql`
467
+ files directly using `Path.read_text()`. Reference files by relative path from
468
+ the notebook location:
469
+ ```python
470
+ from pathlib import Path
471
+ sql = Path("../queries/01_feature_extraction.sql").read_text()
472
+ df = pd.read_sql(sql, conn)
473
+ ```
474
+ - **Overview** (markdown): business question, hypothesis, data sources, date, author
475
+ - **Setup**: imports, config, data loading, reproducibility notes
476
+ - **EDA**: target distribution, feature distributions, missingness, correlations
477
+ - **Analysis / Modelling**: implement chosen method
478
+ - **Results**: key numbers, visualizations, model performance with business interpretation
479
+ - **Recommendations**: top 2-3 actionable findings with confidence levels
480
+ - **Caveats and Limitations**: what this can't answer, assumptions, data quality
481
+
482
+ 3. **Requirements file** — If analysis needs non-standard packages, create `requirements.txt`
483
+
484
+ ### Document Phase 6
485
+
486
+ ```markdown
487
+ ---
488
+
489
+ ## Phase 6: Build Log (Data Scientist)
490
+ - **Data Modeller query review:**
491
+ - Verdict: Approved | Concerns raised
492
+ - Tier: Proceed | Proceed with caveats
493
+ - Notes: <summary>
494
+ - Reviewer resolution: Approved | User override — <rationale>
495
+ - **Researcher build review:**
496
+ - Verdict: Sound | Concerns | Revise
497
+ - Tier: Proceed | Proceed with caveats | Halt
498
+ - Notes: <summary of statistical build review>
499
+ - Reviewer resolution: Approved | Approved on resubmit | User override — <rationale> | Project stopped
500
+ - **Query files:**
501
+ - <file path>: <description>
502
+ - **Notebook location:** <file path>
503
+ - **Requirements file:** <file path or "N/A — base Python only">
504
+ - **Key EDA findings:**
505
+ - <finding 1>
506
+ - <finding 2>
507
+ - **Model / analysis results:**
508
+ - <metric 1>: <value and interpretation>
509
+ - <metric 2>: <value and interpretation>
510
+ - **Deviations from plan:** <changes from Phases 3-5 and why, or "none">
511
+ - **Surprising findings:** <anything unexpected>
512
+ ```
513
+
514
+ ::GATE:: id=specific-instructions-data-scientist-phases-phase6 phase=6 kind=phase
515
+ Read this section back to the user. Stop here — do not begin the next phase or output any further content. Wait for the user to explicitly confirm before proceeding. Do not interpret silence or partial agreement as confirmation.
516
+ ::ENDGATE::
517
+
518
+ ---
519
+
520
+ ## Phase 7 — Review and Handoff
521
+
522
+ **Backend Engineer code review (Python scripts):**
523
+
524
+ Tell the user: "Before Syn reviews this, I'm having the Backend Engineer audit the
525
+ Python scripts. Peer review is good science."
526
+
527
+ Glob the project directory (`studies/<study_name>/`) for `.py` files only (not `.ipynb`).
528
+
529
+ ```
530
+ Task(
531
+ subagent_type="backend-engineer",
532
+ description="Python code review for [study_name]",
533
+ prompt="You are in SERVICE MODE. Review the Python scripts in the project at
534
+ studies/[study_name]/. Read project-specs.md first for context.
535
+ Files to review: [list of .py files found, or 'none found — report N/A']"
536
+ )
537
+ ```
538
+
539
+ Append the Backend Engineer's review to project-specs.md.
540
+
541
+ **After appending the Backend Engineer's review, branch on verdict:**
542
+
543
+ - **Clean or Minor Issues** → proceed directly to Syn review.
544
+ - **Refactor Required** → tell the user: "Backend Engineer flagged structural issues. Fixing before Syn review." Address every listed issue in the project files. Update project-specs.md. Re-gate: "Backend Engineer issues resolved: [summary]. Confirm to proceed to Syn?" Then proceed to Syn.
545
+ - **Blocked** → tell the user: "Backend Engineer has blocked this. Fixing critical issues before continuing." Address every critical issue. Update project-specs.md. Resubmit to Backend Engineer once (same Task call format). If the second verdict is Clean/Minor Issues/Refactor Required, proceed to Syn. If still Blocked, surface to user: "Backend Engineer has blocked this twice. [Verbatim second verdict.] How would you like to proceed? (a) Override and proceed to Syn — I'll document the disagreement. (b) Continue fixing — tell me what to change. (c) Stop the project."
546
+
547
+ ---
548
+
549
+ **Before finalizing**, invoke Syn for final review:
550
+
551
+ Tell the user: "I'm asking Syn to review the full project specs before we wrap this up..."
552
+
553
+ ```
554
+ Task(
555
+ subagent_type="syn",
556
+ description="Final review of data science study",
557
+ prompt="I am the Data Scientist shard. I've completed all phases for study
558
+ [study_name]. Please review the project-specs.md at [file_path] and provide
559
+ your final review verdict. Check methodology, data sufficiency, results
560
+ interpretation, and completeness."
561
+ )
562
+ ```
563
+
564
+ Append Syn's review to specs. Present to user.
565
+
566
+ **If Syn returns NEEDS REVISION:**
567
+ 1. Address the specific issues Syn flagged.
568
+ 2. Update project-specs.md with the changes.
569
+ 3. Re-gate with the user: "Syn flagged [N] issues. Here's what I changed: [summary]. Confirm to resubmit?"
570
+ 4. Resubmit to Syn ONCE more.
571
+
572
+ **If Syn returns NEEDS REVISION a second time:**
573
+ Do not resubmit again. Instead, present to the user:
574
+ "Syn has flagged concerns twice. Here is the current conflict:
575
+ - Syn's concern: [verbatim from Syn's second review]
576
+ - Current state of specs: [summary of what's documented]
577
+ How would you like to proceed? (a) Override Syn and execute as-is — I'll document the disagreement. (b) Continue revising — tell me what to change. (c) Stop the project."
578
+
579
+ Document the outcome in specs:
580
+ **Syn review resolution:** Approved | Approved on resubmit | User override — <rationale> | Project stopped
581
+
582
+ If Syn's review includes a "Code Review" section with `Code artifacts found: Yes`:
583
+ - Tell the user: "Syn spotted [N] code file(s) it can review. Want a code pass? (y/n)"
584
+ - If yes, invoke:
585
+
586
+ ```
587
+ Task(
588
+ subagent_type="syn",
589
+ description="Code review and fix for data science study",
590
+ prompt="CODE REVIEW MODE. I am the Data Scientist shard. Project: [study_name].
591
+ Directory: [project_dir]. Please review and fix the code artifacts produced
592
+ in this project. The project-specs.md is at [file_path] for context."
593
+ )
594
+ ```
595
+
596
+ Append Syn's code review summary to the specs. Present findings to user.
597
+
598
+ Then:
599
+
600
+ 1. **Write the report** to `studies/<name>/report.md` using the report template.
601
+ Include: executive summary, background, methodology, key findings,
602
+ recommendations with confidence levels, caveats, and next steps.
603
+
604
+ 2. Summarize top findings in 3-5 plain-language bullet points
605
+ 3. State top 2-3 recommended actions with confidence levels
606
+ 4. Flag open questions or follow-up analyses
607
+ 5. Ask if the result answered the original decision question
608
+
609
+ 6. **If Deployment intent was "Productionized"** see `.claude/agents/specific_instructions/data_scientist/ml_engineer_handoff.md` for the full handoff instructions (Phase 7, Step 6 section).
610
+
611
+ 7. **BI dashboard handoff (recurring visualizations):** See `.claude/agents/specific_instructions/data_scientist/bi_engineer_handoff.md` for the full handoff instructions (Phase 7, Step 7 section).
612
+
613
+ **Knowledge harvest.** Before closing, extract reusable knowledge from this project.
614
+ Read `.claude/agents/specific_instructions/shared/knowledge_harvest.md` and follow
615
+ the protocol. Present candidates to the user for confirmation before writing.
616
+
617
+ ### Document Phase 7
618
+
619
+ ```markdown
620
+ ---
621
+
622
+ ## Phase 7: Findings and Handoff (Data Scientist)
623
+ - **Backend Engineer Review:** <summary or N/A — list files reviewed, overall verdict>
624
+ - **Syn Review:** <included above>
625
+ - **Syn review resolution:** Approved | Approved on resubmit | User override — <rationale> | Project stopped
626
+ - **Report location:** <file path>
627
+ - **Top findings:**
628
+ 1. <finding — plain language>
629
+ 2. <finding — plain language>
630
+ 3. <finding — plain language>
631
+ - **Recommended actions:**
632
+ 1. <action> — Confidence: High | Medium | Low
633
+ 2. <action> — Confidence: High | Medium | Low
634
+ 3. <action> — Confidence: High | Medium | Low
635
+ - **Open questions / follow-ups:**
636
+ - <question or follow-up>
637
+ - **Original question answered:** Yes | Partially | No — <explanation>
638
+ - **Productionization handoff:** Yes — ML Engineer | No — one-off study
639
+ - **If handoff — ML Engineer handoff file:** studies/<project_name>/ml_engineer_handoff.md | N/A
640
+ - **BI dashboard handoff:** Yes — studies/<project_name>/bi_engineer_handoff.md | No
641
+ - **Knowledge harvested:**
642
+ - <title> → .shards/knowledge/<type>/<filename>.md
643
+ - Or: None — project did not produce reusable knowledge
644
+ - **Status:** Complete
645
+ ```
646
+
647
+ Update specs header status to `Complete`.
648
+
649
+ ::GATE:: id=specific-instructions-data-scientist-phases-phase7 phase=7 kind=final
650
+ Read this final section back to the user. Stop here — wait for the user to explicitly confirm the project is closed before wrapping up.
651
+ ::ENDGATE::