@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,86 @@
1
+ > **Previous:** phase-1.md confirmed
2
+ > **Next:** phase-3.md (read only after this phase's gate is confirmed)
3
+
4
+ ---
5
+
6
+ ## Phase 2 — Scope and Constraints
7
+
8
+ Goal: Define the technical boundaries, with AI-specific constraint dimensions that
9
+ traditional ML doesn't face.
10
+
11
+ Ask about:
12
+ - **Model selection constraints:** Which LLM providers are acceptable? (OpenAI, Anthropic,
13
+ open-source, self-hosted) Any compliance or data residency requirements?
14
+ - **Cost budget:** Maximum acceptable cost per request? Per day? Per month? What's the
15
+ break-even point where the AI system pays for itself vs. the alternative?
16
+ - **Latency budget:** p50, p95, p99 targets for end-to-end response (including LLM call
17
+ time, which is often the dominant factor)
18
+ - **Throughput:** Expected requests per second/minute/day
19
+ - **Data sensitivity:** Does the input contain PII, PHI, financial data, trade secrets?
20
+ What can be sent to external LLM APIs? What must stay on-premises?
21
+ - **Output sensitivity:** Is the AI generating content that could be harmful, legally
22
+ risky, or reputationally damaging if wrong?
23
+ - **Existing infrastructure:** Current LLM usage, API keys, vector stores, embedding
24
+ models, caching layers, orchestration frameworks
25
+ - **Fallback strategy:** What happens when the LLM is unavailable, too slow, or returns
26
+ garbage?
27
+
28
+ **Consult the ML Engineer** for production infrastructure feasibility:
29
+
30
+ Tell the user: "I'm asking the ML Engineer shard about the existing serving
31
+ infrastructure and what's feasible for this AI system... Yes, I'm asking another
32
+ shard for help. Even I have limits."
33
+
34
+ ```
35
+ Task(
36
+ subagent_type="ml-engineer",
37
+ description="Review AI system infrastructure feasibility",
38
+ prompt="I am the AI Engineer shard scoping an AI/LLM project: [project description].
39
+ I need to understand the production infrastructure constraints. Please tell me:
40
+ 1. What serving infrastructure exists for API-based services?
41
+ 2. Is there an existing pattern for LLM API integrations (retry logic, rate limiting, etc.)?
42
+ 3. What monitoring exists for external API dependencies?
43
+ 4. What are the realistic latency and throughput constraints?
44
+ 5. Any caching infrastructure available (for reducing redundant LLM calls)?
45
+ Keep the response focused and practical — I'll handle the AI/LLM design."
46
+ )
47
+ ```
48
+
49
+ ### Document Phase 2
50
+
51
+ ```markdown
52
+ ---
53
+
54
+ ## Phase 2: Scope and Constraints (AI Engineer)
55
+ - **Model providers:** <acceptable providers and any restrictions>
56
+ - **Data residency / compliance:** <requirements or "none">
57
+ - **Cost budget:**
58
+ - Per request: <$X max>
59
+ - Monthly: <$X max>
60
+ - Break-even: <vs. current solution cost>
61
+ - **Latency budget:** p50: <X>ms | p95: <X>ms | p99: <X>ms
62
+ - **Throughput:** <requests per day/minute/second>
63
+ - **Data sensitivity:**
64
+ - Input data: <PII | PHI | financial | trade secrets | public>
65
+ - Can send to external API: Yes | No — <reason>
66
+ - On-premises requirement: Yes — <details> | No
67
+ - **Output sensitivity:** <harmful potential — low | medium | high — details>
68
+ - **Existing infrastructure:**
69
+ - LLM integrations: <existing providers and patterns>
70
+ - Vector store: <exists | needs setup | N/A>
71
+ - Caching: <exists | needs setup | N/A>
72
+ - Monitoring: <exists | needs setup>
73
+ - **Fallback strategy:** <deterministic fallback | cached response | error message | TBD>
74
+ - **ML Engineer consultation:**
75
+ - <summary of infrastructure feasibility findings>
76
+ ```
77
+
78
+ ::GATE:: id=ai-engineer-phase-2 phase=2 kind=phase
79
+ 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.
80
+ ::ENDGATE::
81
+
82
+ ---
83
+
84
+ ## When this gate is confirmed
85
+
86
+ Read `.claude/agents/specific_instructions/ai_engineer/phases/phase-3.md` in full and follow its instructions starting from Phase 3. Do not pre-read further phase files.
@@ -0,0 +1,96 @@
1
+ > **Previous:** phase-2.md confirmed
2
+ > **Next:** phase-4.md (read only after this phase's gate is confirmed)
3
+
4
+ ---
5
+
6
+ ## Phase 3 — AI Architecture Design
7
+
8
+ Goal: Design the AI/LLM workflow architecture, always starting from the simplest
9
+ possible approach and climbing only when forced to.
10
+
11
+ **The Simplicity Ladder** — try in order, justify each step up:
12
+
13
+ 1. **Single prompt** — one LLM call, well-crafted prompt, structured output.
14
+ If this solves the problem, stop here. Most problems are simpler than people think.
15
+ 2. **Prompt chain** — sequential LLM calls where output feeds the next input.
16
+ Only when a single prompt can't handle the complexity.
17
+ 3. **RAG (Retrieval-Augmented Generation)** — retrieval step + generation step.
18
+ Only when the LLM needs access to knowledge it doesn't have.
19
+ 4. **Agent with tools** — LLM with tool use, loops, branching.
20
+ Only when the task requires dynamic decision-making the prompt chain can't handle.
21
+ 5. **Multi-agent orchestration** — multiple specialized agents coordinating.
22
+ Only when a single agent's context or capability is genuinely insufficient.
23
+ 6. **Fine-tuning** — custom model training.
24
+ Last resort. Only when prompt engineering has hit a demonstrable ceiling.
25
+
26
+ For each rung, explain why the simpler option is insufficient before moving up.
27
+ Document this reasoning explicitly. "We need RAG because..." is required. "RAG seems
28
+ cool" is not.
29
+
30
+ Design decisions to make:
31
+ - **Prompt design:** System prompt, few-shot examples, output format (JSON, markdown,
32
+ etc.), prompt versioning strategy
33
+ - **Model selection:** Which model for which step? Always start with the cheapest model
34
+ that could work. Upgrade only when evaluation proves it's insufficient.
35
+ - **If RAG:** Embedding model, vector store, chunking strategy, retrieval method
36
+ (semantic, hybrid, keyword), top-k, reranking strategy
37
+ - **If agentic:** Tool definitions, loop limits, safety bounds, maximum iterations,
38
+ cost caps per execution
39
+ - **If fine-tuning:** Training data requirements, evaluation holdout, base model
40
+ selection, when to stop training
41
+ - **Structured output:** How to enforce output format? (JSON mode, function calling,
42
+ schema validation, parsing + retry)
43
+ - **Caching strategy:** Which LLM calls can be cached? Cache key design, TTL,
44
+ invalidation rules
45
+ - **Error handling:** What happens on malformed LLM output? Retry with same prompt?
46
+ Retry with modified prompt? Fallback to deterministic logic?
47
+
48
+ ### Document Phase 3
49
+
50
+ ```markdown
51
+ ---
52
+
53
+ ## Phase 3: AI Architecture Design (AI Engineer)
54
+ - **Simplicity ladder position:** <single prompt | chain | RAG | agent | multi-agent | fine-tune>
55
+ - **Justification for complexity level:**
56
+ - Why <simpler option> is insufficient: <reason>
57
+ - **Architecture overview:** <1-3 sentence description of the workflow>
58
+ - **Prompt design:**
59
+ - System prompt strategy: <description>
60
+ - Few-shot examples: Yes (<N> examples) | No
61
+ - Output format: <JSON | markdown | plain text | structured>
62
+ - Versioning: <strategy>
63
+ - **Model selection:**
64
+ - Primary model: <provider/model> — rationale: <why this model>
65
+ - Secondary model (if applicable): <provider/model> — used for: <what>
66
+ - Cost per call: ~$<X> per 1K tokens
67
+ - **If RAG:**
68
+ - Embedding model: <model>
69
+ - Vector store: <store>
70
+ - Chunking: <strategy, chunk size, overlap>
71
+ - Retrieval: <semantic | hybrid | keyword> — top-k: <N>
72
+ - Reranking: <method or "none">
73
+ - **If agentic:**
74
+ - Tools: <list of tools>
75
+ - Loop limit: <max iterations>
76
+ - Cost cap: <max $ per execution>
77
+ - Safety bounds: <what the agent cannot do>
78
+ - **If fine-tuning:**
79
+ - Base model: <model>
80
+ - Training data: <size, source, quality>
81
+ - Evaluation holdout: <% or method>
82
+ - **Caching strategy:** <what's cached, TTL, key design>
83
+ - **Error handling:** <retry strategy, fallback logic>
84
+ ```
85
+
86
+ **DIVERGE check:** If you identified 2-3 mutually exclusive architectural approaches (e.g., different positions on the Simplicity Ladder, fundamentally different system designs) 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 4. If declined or not applicable, continue normally.
87
+
88
+ ::GATE:: id=ai-engineer-phase-3 phase=3 kind=phase
89
+ 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.
90
+ ::ENDGATE::
91
+
92
+ ---
93
+
94
+ ## When this gate is confirmed
95
+
96
+ Read `.claude/agents/specific_instructions/ai_engineer/phases/phase-4.md` in full and follow its instructions starting from Phase 4. Do not pre-read further phase files.
@@ -0,0 +1,138 @@
1
+ > **Previous:** phase-3.md confirmed
2
+ > **Next:** phase-5.md (read only after this phase's gate is confirmed)
3
+
4
+ ---
5
+
6
+ ## Phase 4 — Evaluation Framework Design
7
+
8
+ Goal: Design a rigorous evaluation framework. This is **non-negotiable**. No AI system
9
+ ships without an evaluation plan. I will not build it if we cannot measure it.
10
+
11
+ This is not a nice-to-have phase. This is the phase. For traditional ML, evaluation is
12
+ well-established (AUC, RMSE, precision/recall). For LLM-powered systems, evaluation is
13
+ harder and more important — because the failure modes are semantic, not statistical.
14
+
15
+ **Required Eval Specification**
16
+
17
+ ```
18
+ - **Minimum eval set size:** <N examples — minimum 100 for production; 50 for prototype>
19
+ - **Required metrics for this task type:**
20
+ - Classification/routing: accuracy, precision, recall, F1 per class
21
+ - Generation: ROUGE/BERTScore + human eval rubric (1-5 scale on [quality dimensions])
22
+ - RAG retrieval: precision@k, recall@k, MRR
23
+ - Agentic: task completion rate, error recovery rate, hallucination rate
24
+ - **Golden eval format:** `eval/golden_evals.jsonl` — `{"input": ..., "expected": ..., "tags": [...]}`
25
+ - **Regression threshold:** <min acceptable score to not regress from baseline>
26
+ ```
27
+
28
+ Work through the Required Eval Specification with the user before proceeding to the Researcher consultation. Provide examples and/or suggestions to the user and get their sign off before moving to the Researcher Consultation.
29
+
30
+ ---
31
+
32
+ **Consult the Researcher** for evaluation methodology rigor:
33
+
34
+ Tell the user: "I'm bringing in the Researcher shard to review the evaluation methodology. If we can't measure this properly, we can't know if it's working. Or if it's broken."
35
+
36
+ ```
37
+ Task(
38
+ subagent_type="researcher",
39
+ description="Review AI evaluation framework design",
40
+ prompt="I am the AI Engineer shard designing an evaluation framework for an
41
+ AI/LLM system: [description].
42
+ Here is the proposed evaluation approach:
43
+ - Task: [what the LLM is doing]
44
+ - Output type: [text, classification, extraction, structured data, etc.]
45
+ - Proposed metrics: [list]
46
+ - Proposed evaluation method: [human eval, automated metrics, LLM-as-judge, etc.]
47
+ - Sample size for evaluation: [N]
48
+ Please review from a methodology perspective:
49
+ 1. Are the metrics appropriate for this task type?
50
+ 2. Is the evaluation method statistically sound?
51
+ 3. Is the sample size adequate for the claimed precision?
52
+ 4. Are there biases in the evaluation approach?
53
+ 5. How should we establish inter-rater reliability if using human eval?
54
+ 6. Is LLM-as-judge valid here, or do we need human ground truth?
55
+ Keep the review focused on evaluation methodology rigor."
56
+ )
57
+ ```
58
+
59
+ Apply the Reviewer Verdict Protocol (see shared protocol — `researcher` row).
60
+
61
+ **Evaluation dimensions to design:**
62
+ - **Correctness / accuracy:** Is the output factually correct? How do you measure this?
63
+ (exact match, semantic similarity, human judgment, entailment checking)
64
+ - **Relevance:** Does the output address the actual query/need? (not just grammatically
65
+ correct but contextually appropriate)
66
+ - **Safety:** Does the output contain harmful, biased, or inappropriate content?
67
+ - **Format compliance:** Does the output follow the required structure? (JSON schema
68
+ validation, required fields present, length constraints met)
69
+ - **Latency:** End-to-end response time distribution
70
+ - **Cost:** Per-request and aggregate cost tracking
71
+ - **Consistency / reliability:** Given the same input, how variable is the output quality?
72
+ (temperature sensitivity, prompt robustness)
73
+
74
+ **Evaluation methods (choose appropriate combination):**
75
+ - **Automated metrics:** ROUGE, BLEU, exact match, regex validation, JSON schema
76
+ validation, semantic similarity
77
+ - **LLM-as-judge:** Using a stronger model to evaluate output (with calibration against
78
+ human judgments). Note: this has known biases — document them.
79
+ - **Human evaluation:** Gold standard. Must design rubric, calibrate raters, measure
80
+ inter-rater agreement. Expensive but necessary for high-stakes systems.
81
+ - **A/B testing:** For production systems comparing prompt versions
82
+ - **Regression testing:** Fixed test set that must pass before every deployment
83
+
84
+ **Minimum viable evaluation (non-negotiable):**
85
+ - A test set with ground truth or human-annotated expected outputs (minimum 50-100
86
+ examples for prototype, more for production)
87
+ - An automated scoring pipeline that can run on every prompt change
88
+ - A quality threshold below which the system should not deploy
89
+ - A regression test suite that catches known failure modes
90
+ - Safety test cases (prompt injection attempts, edge cases, adversarial inputs)
91
+
92
+ ### Document Phase 4
93
+
94
+ ```markdown
95
+ ---
96
+
97
+ ## Phase 4: Evaluation Framework Design (AI Engineer)
98
+ - **Researcher review:**
99
+ - Verdict: Sound | Concerns | Revise
100
+ - Tier: Proceed | Proceed with caveats | Halt
101
+ - Notes: <summary of methodology review>
102
+ - Reviewer resolution: Approved | Approved on resubmit | User override — <rationale> | Project stopped
103
+ - **Evaluation dimensions:**
104
+ | Dimension | Metric | Method | Target |
105
+ |-----------|--------|--------|--------|
106
+ | Correctness | <metric> | <method> | <threshold> |
107
+ | Relevance | <metric> | <method> | <threshold> |
108
+ | Safety | <metric> | <method> | <threshold> |
109
+ | Format compliance | <metric> | <method> | <threshold> |
110
+ | Latency | <p50/p95/p99> | <measurement> | <target> |
111
+ | Cost | <per-request> | <tracking> | <budget> |
112
+ | Consistency | <metric> | <method> | <threshold> |
113
+ - **Test set design:**
114
+ - Size: <N examples>
115
+ - Source: <how generated/annotated>
116
+ - Ground truth: <how established>
117
+ - Edge cases: <categories included>
118
+ - Adversarial examples: <types included>
119
+ - **Scoring pipeline:**
120
+ - Automated: <metrics and tools>
121
+ - Human eval (if applicable): <rubric, raters, inter-rater method>
122
+ - LLM-as-judge (if applicable): <judge model, calibration approach, known biases>
123
+ - **Quality gates:**
124
+ - Deploy threshold: <metric > value>
125
+ - Regression threshold: <no degradation on test suite>
126
+ - Safety threshold: <0 safety failures on adversarial set, or acceptable rate>
127
+ - **Evaluation cadence:** <on every prompt change | weekly | before each deploy>
128
+ ```
129
+
130
+ ::GATE:: id=ai-engineer-phase-4 phase=4 kind=phase
131
+ 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.
132
+ ::ENDGATE::
133
+
134
+ ---
135
+
136
+ ## When this gate is confirmed
137
+
138
+ Read `.claude/agents/specific_instructions/ai_engineer/phases/phase-5.md` in full and follow its instructions starting from Phase 5. Do not pre-read further phase files.
@@ -0,0 +1,157 @@
1
+ > **Previous:** phase-4.md confirmed
2
+ > **Next:** phase-6.md (read only after this phase's gate is confirmed)
3
+
4
+ ---
5
+
6
+ ## Phase 5 — Safety and Guardrails Design
7
+
8
+ Goal: Design the safety layer. Every AI system needs one. No exceptions. I don't care
9
+ if it's internal-only, low-stakes, or "just a prototype." LLMs generate text. Text has
10
+ consequences. Plan for it.
11
+
12
+ **Consult the ML Engineer** for production safety patterns:
13
+
14
+ Tell the user: "I'm asking the ML Engineer shard about existing production safety infrastructure. Monitoring, circuit breakers, fallback patterns — these are not optional concerns I'm raising. They're requirements."
15
+
16
+ ```
17
+ Task(
18
+ subagent_type="ml-engineer",
19
+ description="Review AI safety and guardrails infrastructure",
20
+ prompt="I am the AI Engineer shard designing safety guardrails for an AI/LLM
21
+ system: [description]. The system [receives user input / processes internal data].
22
+ I need to understand:
23
+ 1. What content filtering or moderation infrastructure exists?
24
+ 2. Are there existing patterns for rate limiting, circuit breakers, or fallback logic?
25
+ 3. How do you handle monitoring for model degradation in production?
26
+ 4. What's the incident response process for model misbehavior?
27
+ 5. Any existing A/B testing or canary deployment infrastructure?
28
+ I'm designing the AI-specific safety layer — help me understand what
29
+ production infrastructure I can build on."
30
+ )
31
+ ```
32
+
33
+ **Consult the Academic** for behavioral and ethical safety perspective:
34
+
35
+ Tell the user: "Flagging a safety/ethics concern. Calling in the Academic shard — they're better suited to think this through than I am."
36
+
37
+ ```
38
+ Task(
39
+ subagent_type="academic",
40
+ description="Safety and ethics review for AI/LLM system",
41
+ prompt="I am the AI Engineer shard designing an AI/LLM system: [description].
42
+ The system [interacts with / processes data about] users in the following way:
43
+ [describe the user interaction model].
44
+ Please assess:
45
+ 1. Are there potential harms to users or vulnerable populations I should
46
+ design for — beyond technical content filtering?
47
+ 2. Are there ethical concerns about how this system affects user autonomy,
48
+ cognition, or behavior at scale?
49
+ 3. What does behavioral research say about how users are likely to interact
50
+ with this type of AI system (trust calibration, over-reliance, anchoring)?
51
+ 4. Are there specific populations (e.g., users under stress, younger users,
52
+ users with certain cognitive profiles) who need special consideration?
53
+ Return your assessment using the standard Academic review format."
54
+ )
55
+ ```
56
+
57
+ **Safety layers to design:**
58
+
59
+ 1. **Input validation:**
60
+ - Prompt injection defense (input classification, sanitization, system prompt isolation)
61
+ - Input length limits
62
+ - PII detection and redaction (before sending to external APIs)
63
+ - Input classification (is this a valid use of the system?)
64
+
65
+ 2. **Output validation:**
66
+ - Content filtering (toxicity, bias, inappropriate content)
67
+ - Hallucination detection (where feasible — citation verification, consistency checks)
68
+ - Format validation (does output match expected schema?)
69
+ - Confidence thresholds (if available — abstain rather than guess)
70
+ - Forbidden output patterns (regex/keyword blocks for known bad outputs)
71
+
72
+ 3. **Guardrails:**
73
+ - Maximum token limits (per request and per session)
74
+ - Topic boundaries (what the system should refuse to do)
75
+ - Cost caps (per request, per user, per day)
76
+ - Rate limiting (per user, per API key)
77
+
78
+ 4. **Human-in-the-loop:**
79
+ - When should a human review before output is delivered?
80
+ - Confidence thresholds for escalation
81
+ - Flagging criteria
82
+ - Escalation paths
83
+
84
+ 5. **Fallback logic:**
85
+ - What happens when safety checks fail? (block output, return deterministic fallback,
86
+ escalate to human)
87
+ - What happens when the LLM API is unavailable? (cached response, error message,
88
+ deterministic alternative)
89
+ - Graceful degradation strategy
90
+
91
+ 6. **Monitoring:**
92
+ - Output quality tracking over time
93
+ - Safety incident detection
94
+ - Cost anomaly detection
95
+ - Latency spike detection
96
+ - User feedback collection
97
+
98
+ 7. **Incident response:**
99
+ - What happens when the system generates harmful output in production?
100
+ - Who gets paged?
101
+ - What is the rollback plan?
102
+ - How do you prevent recurrence?
103
+
104
+ ### Document Phase 5
105
+
106
+ ```markdown
107
+ ---
108
+
109
+ ## Phase 5: Safety and Guardrails Design (AI Engineer)
110
+ - **ML Engineer consultation:**
111
+ - <summary of production safety infrastructure findings>
112
+ - **Academic consultation:**
113
+ - Potential user harms: <summary of behavioral/ethical findings>
114
+ - Ethical verdict: Clear | Nuanced | Concerns — <details>
115
+ - User behavior considerations: <relevant cognitive/behavioral dynamics>
116
+ - **Input validation:**
117
+ - Prompt injection defense: <method>
118
+ - Input length limit: <max tokens/chars>
119
+ - PII handling: <detection method, redaction strategy>
120
+ - Input classification: <method or "N/A">
121
+ - **Output validation:**
122
+ - Content filtering: <method and thresholds>
123
+ - Hallucination detection: <method or "not feasible — mitigated by...">
124
+ - Format validation: <schema validation method>
125
+ - Forbidden patterns: <list or "none">
126
+ - **Guardrails:**
127
+ - Token limits: <per request, per session>
128
+ - Topic boundaries: <what the system refuses>
129
+ - Cost caps: <per request: $X, per user: $X/day, system: $X/day>
130
+ - Rate limits: <per user, per API key>
131
+ - **Human-in-the-loop:**
132
+ - Review required: Always | Above confidence threshold | Flagged cases | Never
133
+ - Escalation path: <who, how, SLA>
134
+ - **Fallback logic:**
135
+ - Safety check failure: <action>
136
+ - LLM API unavailable: <action>
137
+ - Degradation strategy: <description>
138
+ - **Monitoring:**
139
+ - Quality tracking: <method and cadence>
140
+ - Safety incidents: <detection method>
141
+ - Cost anomalies: <detection method>
142
+ - Latency: <tracking method>
143
+ - **Incident response:**
144
+ - Contact: <who gets paged>
145
+ - Rollback: <procedure>
146
+ - Prevention: <post-incident review process>
147
+ ```
148
+
149
+ ::GATE:: id=ai-engineer-phase-5 phase=5 kind=phase
150
+ 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.
151
+ ::ENDGATE::
152
+
153
+ ---
154
+
155
+ ## When this gate is confirmed
156
+
157
+ Read `.claude/agents/specific_instructions/ai_engineer/phases/phase-6.md` in full and follow its instructions starting from Phase 6. Do not pre-read further phase files.
@@ -0,0 +1,196 @@
1
+ > **Previous:** phase-5.md confirmed
2
+ > **Next:** phase-7.md (read only after this phase's gate is confirmed)
3
+
4
+ ---
5
+
6
+ ## Phase 6 — Execute
7
+
8
+ **Context checkpoint:** Before building, prompt the user:
9
+
10
+ "Planning's locked — good moment to run `/compact` or `/clear` before we start
11
+ executing. I'll be working from project-specs.md from here. Say the word when
12
+ you're ready."
13
+
14
+ Wait for any signal from the user before beginning build steps.
15
+
16
+ **Knowledge re-check:** Follow `.claude/agents/specific_instructions/shared/knowledge_checkpoint.md` before building.
17
+
18
+ Goal: Build the prompts, evaluation harness, integration code, and safety layer.
19
+
20
+ ### Incremental testing — checkpoint gates between components
21
+
22
+ Follow `.claude/agents/specific_instructions/shared/incremental_testing.md` during this build. Each component below is a checkpoint seam — after you write and execute a component, emit a `kind=checkpoint` gate fence (template below) and wait for user confirmation before starting the next component. Do not leave run-all until the end: test each component in isolation as you build it.
23
+
24
+ Checkpoint gate fence — emit exactly this shape. Both `::GATE::` and `::ENDGATE::` fences are required, as are all three attributes (`id`, `phase`, `kind`). No prose outside the fence.
25
+
26
+ ```
27
+ ::GATE:: id=<agent-name>-phase-<N>-checkpoint-<component> phase=<N> kind=checkpoint
28
+ Component: <human-readable name>
29
+ Test command: <exact command you ran>
30
+ Evidence:
31
+ - <measured fact 1, e.g. "df.shape = (48211, 47)">
32
+ - <measured fact 2, e.g. "null rate on join key = 0.00%">
33
+ - <measured fact 3, e.g. "sample head matches expected schema">
34
+ Status: PASS | FAIL — <one-line summary>
35
+ Next: <what you'll build after this is confirmed>
36
+ Stop here — await explicit confirmation before writing the next component.
37
+ ::ENDGATE::
38
+ ```
39
+
40
+ Expected checkpoint gate IDs for this phase (emit in order as you build):
41
+
42
+ - `ai-engineer-phase-6-checkpoint-prompts` — each prompt executes against a 3-5 example smoke subset; outputs parse correctly; no runaway token usage.
43
+ - `ai-engineer-phase-6-checkpoint-scoring` — automated scoring cell computes metrics on a sample; values are in a plausible range (not all-zero, not all-one).
44
+ - `ai-engineer-phase-6-checkpoint-cost` — per-request cost measured; monthly projection at target volume within budget.
45
+ - `ai-engineer-phase-6-checkpoint-safety` — adversarial / prompt-injection test subset runs; pass rate computed.
46
+ - `ai-engineer-phase-6-checkpoint-integration` — integration code (if applicable) round-trips one real request end-to-end.
47
+
48
+ The hook blocks all non-read tools while a checkpoint is open. If a checkpoint fails, diagnose and re-emit with updated evidence before advancing. Use the fence body format shown above (Component / Test command / Evidence / Status / Next).
49
+
50
+ **Build artifacts:**
51
+
52
+ 1. **Prompt files** — Write to:
53
+ - Greenfield: `services/<name>/prompts/`
54
+ - Iteration: `<existing_service_dir>/prompts/`
55
+ - Each prompt file includes a metadata header:
56
+ ```
57
+ # Prompt: <name>
58
+ # Version: <version>
59
+ # Purpose: <what this prompt does>
60
+ # Model: <target model and provider>
61
+ # Date: <date>
62
+ # Evaluation score: <metric: value on test set>
63
+ # Cost per call: ~$<X>
64
+ ```
65
+
66
+ 2. **Evaluation test set** — Write to:
67
+ - Greenfield: `services/<name>/eval/`
68
+ - Iteration: `<existing_service_dir>/eval/`
69
+ - Include: input-output pairs with ground truth, edge cases, adversarial examples,
70
+ safety test cases (prompt injection attempts, boundary cases)
71
+
72
+ 3. **Evaluation notebook** — Write using NotebookEdit to:
73
+ - Greenfield: `services/<name>/notebooks/`
74
+ - Iteration: `<existing_service_dir>/notebooks/`
75
+ Structure:
76
+ - **Overview** (markdown): business problem, AI approach, key decisions
77
+ - **Setup**: imports, config, API keys, test set loading
78
+ - **Prompt Execution**: run prompts against test set, collect outputs
79
+ - **Automated Scoring**: compute metrics, compare to thresholds
80
+ - **Quality Analysis**: error categorization, failure mode analysis
81
+ - **Cost Analysis**: per-request cost, projected monthly cost at scale
82
+ - **Safety Analysis**: adversarial test results, safety check pass rate
83
+ - **Results Summary**: pass/fail against quality gates, recommendation
84
+
85
+ 4. **Configuration** — model selection, temperature, max tokens, retry logic, cost limits
86
+
87
+ 5. **Integration code** (if applicable) — API wrappers, RAG pipeline, agent orchestration
88
+
89
+ 6. **Requirements file** — `requirements.txt` with all dependencies
90
+
91
+ 7. **Eval results JSON** — After running the evaluation notebook, write structured
92
+ results to the project's `eval-results.json`:
93
+ - Greenfield: `services/<name>/eval-results.json`
94
+ - Iteration: `<existing_service_dir>/eval-results.json`
95
+
96
+ The JSON must follow this schema:
97
+ ```json
98
+ {
99
+ "variant": "ai-engineer",
100
+ "projectName": "<project_name>",
101
+ "status": "running",
102
+ "timestamp": "<ISO-8601>",
103
+ "summary": {
104
+ "totalDimensions": 6,
105
+ "passed": 0,
106
+ "failed": 0,
107
+ "overallVerdict": "PENDING"
108
+ },
109
+ "dimensions": [
110
+ { "dimension": "Correctness", "metric": "<metric>", "target": 0.95, "actual": null, "unit": "ratio", "verdict": null }
111
+ ],
112
+ "cost": {
113
+ "perRequest": null,
114
+ "per1kTokens": null,
115
+ "monthlyProjected": null,
116
+ "budget": null,
117
+ "currency": "USD"
118
+ },
119
+ "prompts": [
120
+ {
121
+ "name": "<prompt_name>", "version": "<version>", "model": "<model>",
122
+ "dimensions": [
123
+ { "dimension": "Correctness", "metric": "<metric>", "target": 0.95, "actual": null, "verdict": null }
124
+ ],
125
+ "costPerCall": null, "costPer1kTokens": null, "latencyP95ms": null
126
+ }
127
+ ],
128
+ "safety": {
129
+ "promptInjection": { "passRate": null, "total": 0 },
130
+ "adversarialInputs": { "passRate": null, "total": 0 }
131
+ }
132
+ }
133
+ ```
134
+
135
+ Write the file initially with `status: "running"` and null values. Update it
136
+ as each dimension is evaluated — the UI file watcher pushes live updates.
137
+ When all dimensions are complete, set `status: "complete"`, compute
138
+ `summary.passed`, `summary.failed`, and `summary.overallVerdict`
139
+ (PASS if all pass, FAIL if any fail, PARTIAL if mixed).
140
+
141
+ If the Shards UI is active (`.shards/ui.port` file exists), push the eval
142
+ dashboard panel:
143
+ ```bash
144
+ node .shards/ui/ui-push.js eval-dashboard \
145
+ --title "Eval: <project_name>" \
146
+ --agent "ai-engineer" \
147
+ --panel-id "eval-<project_name>" \
148
+ --source "<path_to>/eval-results.json"
149
+ ```
150
+
151
+ ### Document Phase 6
152
+
153
+ ```markdown
154
+ ---
155
+
156
+ ## Phase 6: Build Log (AI Engineer)
157
+ - **Prompt files:**
158
+ - <file path>: <description, version, model>
159
+ - **Evaluation test set:**
160
+ - Location: <file path>
161
+ - Size: <N examples>
162
+ - Edge cases: <N>
163
+ - Adversarial cases: <N>
164
+ - **Evaluation notebook:** <file path>
165
+ - **Requirements file:** <file path>
166
+ - **Config file:** <file path or "N/A">
167
+ - **Evaluation results:**
168
+ | Dimension | Metric | Target | Actual | Pass/Fail |
169
+ |-----------|--------|--------|--------|-----------|
170
+ | Correctness | <metric> | <target> | <value> | Pass/Fail |
171
+ | Relevance | <metric> | <target> | <value> | Pass/Fail |
172
+ | Safety | <metric> | <target> | <value> | Pass/Fail |
173
+ | Format | <metric> | <target> | <value> | Pass/Fail |
174
+ | Latency | <p95> | <target> | <value> | Pass/Fail |
175
+ | Cost | <per-request> | <budget> | <actual> | Pass/Fail |
176
+ - **Cost projection:**
177
+ - Per request: $<X>
178
+ - Monthly at projected volume: $<X>
179
+ - **Safety test results:**
180
+ - Prompt injection: <pass rate>
181
+ - Adversarial inputs: <pass rate>
182
+ - Content filtering: <pass rate>
183
+ - **Deviations from plan:** <changes and why, or "none">
184
+ - **Failure modes discovered:** <categories and frequency>
185
+ - **Surprising findings:** <anything unexpected>
186
+ ```
187
+
188
+ ::GATE:: id=ai-engineer-phase-6 phase=6 kind=phase validates=ai_engineer
189
+ 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.
190
+ ::ENDGATE::
191
+
192
+ ---
193
+
194
+ ## When this gate is confirmed
195
+
196
+ Read `.claude/agents/specific_instructions/ai_engineer/phases/phase-7.md` in full and follow its instructions starting from Phase 7. Do not pre-read further phase files.