@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.
- package/README.md +475 -0
- package/package.json +37 -0
- package/src/agents/academic.md +276 -0
- package/src/agents/ai-engineer.md +377 -0
- package/src/agents/analytics-engineer.md +364 -0
- package/src/agents/applied-ml-scientist.md +410 -0
- package/src/agents/backend-engineer.md +255 -0
- package/src/agents/bi-engineer.md +333 -0
- package/src/agents/data-analyst.md +343 -0
- package/src/agents/data-engineer.md +260 -0
- package/src/agents/data-modeller.md +386 -0
- package/src/agents/data-scientist.md +366 -0
- package/src/agents/deep-learning-engineer.md +389 -0
- package/src/agents/ml-engineer.md +424 -0
- package/src/agents/mlops-engineer.md +339 -0
- package/src/agents/researcher.md +187 -0
- package/src/agents/specific_instructions/academic/critical_review.md +263 -0
- package/src/agents/specific_instructions/academic/report.md +113 -0
- package/src/agents/specific_instructions/ai_engineer/advise.md +162 -0
- package/src/agents/specific_instructions/ai_engineer/bi_engineer_handoff.md +86 -0
- package/src/agents/specific_instructions/ai_engineer/experiment.md +471 -0
- package/src/agents/specific_instructions/ai_engineer/experiment_ui_mode.md +44 -0
- package/src/agents/specific_instructions/ai_engineer/phases/index.md +45 -0
- package/src/agents/specific_instructions/ai_engineer/phases/phase-1.md +55 -0
- package/src/agents/specific_instructions/ai_engineer/phases/phase-2.md +86 -0
- package/src/agents/specific_instructions/ai_engineer/phases/phase-3.md +96 -0
- package/src/agents/specific_instructions/ai_engineer/phases/phase-4.md +138 -0
- package/src/agents/specific_instructions/ai_engineer/phases/phase-5.md +157 -0
- package/src/agents/specific_instructions/ai_engineer/phases/phase-6.md +196 -0
- package/src/agents/specific_instructions/ai_engineer/phases/phase-7.md +313 -0
- package/src/agents/specific_instructions/ai_engineer/phases.md +1011 -0
- package/src/agents/specific_instructions/ai_engineer/prompt_lab.md +161 -0
- package/src/agents/specific_instructions/ai_engineer/prompt_lab_ui_mode.md +28 -0
- package/src/agents/specific_instructions/ai_engineer/research.md +393 -0
- package/src/agents/specific_instructions/ai_engineer/research_ui_mode.md +66 -0
- package/src/agents/specific_instructions/ai_engineer/review.md +159 -0
- package/src/agents/specific_instructions/ai_engineer/validation_checklist.md +182 -0
- package/src/agents/specific_instructions/analytics_engineer/advise.md +155 -0
- package/src/agents/specific_instructions/analytics_engineer/bi_engineer_handoff.md +91 -0
- package/src/agents/specific_instructions/analytics_engineer/data_analyst_handoff.md +84 -0
- package/src/agents/specific_instructions/analytics_engineer/deep_phases.md +818 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_deep/index.md +24 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-1.md +77 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-2.md +106 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-3.md +93 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-4.md +79 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-5.md +61 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-6.md +45 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-7.md +235 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_deep/phase-8.md +221 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_quick/index.md +19 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_quick/phase-1.md +47 -0
- package/src/agents/specific_instructions/analytics_engineer/phases_quick/phase-2.md +78 -0
- package/src/agents/specific_instructions/analytics_engineer/quick_phases.md +112 -0
- package/src/agents/specific_instructions/analytics_engineer/review.md +167 -0
- package/src/agents/specific_instructions/analytics_engineer/service_mode.md +369 -0
- package/src/agents/specific_instructions/analytics_engineer/ui_mode.md +45 -0
- package/src/agents/specific_instructions/analytics_engineer/update.md +162 -0
- package/src/agents/specific_instructions/analytics_engineer/validation_checklist.md +121 -0
- package/src/agents/specific_instructions/applied_ml_scientist/advise.md +143 -0
- package/src/agents/specific_instructions/applied_ml_scientist/phases/index.md +21 -0
- package/src/agents/specific_instructions/applied_ml_scientist/phases/phase-1.md +51 -0
- package/src/agents/specific_instructions/applied_ml_scientist/phases/phase-2.md +66 -0
- package/src/agents/specific_instructions/applied_ml_scientist/phases/phase-3.md +113 -0
- package/src/agents/specific_instructions/applied_ml_scientist/phases/phase-4.md +104 -0
- package/src/agents/specific_instructions/applied_ml_scientist/phases/phase-5.md +156 -0
- package/src/agents/specific_instructions/applied_ml_scientist/phases.md +428 -0
- package/src/agents/specific_instructions/applied_ml_scientist/research.md +379 -0
- package/src/agents/specific_instructions/applied_ml_scientist/review.md +142 -0
- package/src/agents/specific_instructions/applied_ml_scientist/validation_checklist.md +136 -0
- package/src/agents/specific_instructions/backend_engineer/clean.md +149 -0
- package/src/agents/specific_instructions/backend_engineer/review.md +91 -0
- package/src/agents/specific_instructions/backend_engineer/review_checklist.md +54 -0
- package/src/agents/specific_instructions/backend_engineer/service_mode.md +67 -0
- package/src/agents/specific_instructions/bi_engineer/advise.md +137 -0
- package/src/agents/specific_instructions/bi_engineer/data_analyst_handoff.md +77 -0
- package/src/agents/specific_instructions/bi_engineer/incoming_handoff.md +45 -0
- package/src/agents/specific_instructions/bi_engineer/phases/index.md +20 -0
- package/src/agents/specific_instructions/bi_engineer/phases/phase-1.md +164 -0
- package/src/agents/specific_instructions/bi_engineer/phases/phase-2.md +92 -0
- package/src/agents/specific_instructions/bi_engineer/phases/phase-3.md +121 -0
- package/src/agents/specific_instructions/bi_engineer/phases/phase-4.md +106 -0
- package/src/agents/specific_instructions/bi_engineer/phases.md +451 -0
- package/src/agents/specific_instructions/bi_engineer/review.md +166 -0
- package/src/agents/specific_instructions/bi_engineer/update.md +147 -0
- package/src/agents/specific_instructions/bi_engineer/validation_checklist.md +124 -0
- package/src/agents/specific_instructions/data_analyst/advise.md +138 -0
- package/src/agents/specific_instructions/data_analyst/explain.md +221 -0
- package/src/agents/specific_instructions/data_analyst/incoming_handoff.md +40 -0
- package/src/agents/specific_instructions/data_analyst/phases/index.md +20 -0
- package/src/agents/specific_instructions/data_analyst/phases/phase-1.md +159 -0
- package/src/agents/specific_instructions/data_analyst/phases/phase-2.md +112 -0
- package/src/agents/specific_instructions/data_analyst/phases/phase-3.md +265 -0
- package/src/agents/specific_instructions/data_analyst/phases/phase-4.md +100 -0
- package/src/agents/specific_instructions/data_analyst/phases.md +501 -0
- package/src/agents/specific_instructions/data_analyst/review.md +138 -0
- package/src/agents/specific_instructions/data_analyst/ui_mode.md +26 -0
- package/src/agents/specific_instructions/data_analyst/update.md +144 -0
- package/src/agents/specific_instructions/data_analyst/validation_checklist.md +95 -0
- package/src/agents/specific_instructions/data_engineer/advise.md +137 -0
- package/src/agents/specific_instructions/data_engineer/phases.md +466 -0
- package/src/agents/specific_instructions/data_engineer/phases_deep/index.md +23 -0
- package/src/agents/specific_instructions/data_engineer/phases_deep/phase-1.md +49 -0
- package/src/agents/specific_instructions/data_engineer/phases_deep/phase-2.md +93 -0
- package/src/agents/specific_instructions/data_engineer/phases_deep/phase-3.md +55 -0
- package/src/agents/specific_instructions/data_engineer/phases_deep/phase-4.md +48 -0
- package/src/agents/specific_instructions/data_engineer/phases_deep/phase-5.md +40 -0
- package/src/agents/specific_instructions/data_engineer/phases_deep/phase-6.md +102 -0
- package/src/agents/specific_instructions/data_engineer/phases_deep/phase-7.md +87 -0
- package/src/agents/specific_instructions/data_engineer/phases_quick/index.md +19 -0
- package/src/agents/specific_instructions/data_engineer/phases_quick/phase-1.md +45 -0
- package/src/agents/specific_instructions/data_engineer/phases_quick/phase-2.md +54 -0
- package/src/agents/specific_instructions/data_engineer/review.md +135 -0
- package/src/agents/specific_instructions/data_engineer/validation_checklist.md +136 -0
- package/src/agents/specific_instructions/data_modeller/advise.md +137 -0
- package/src/agents/specific_instructions/data_modeller/phases.md +581 -0
- package/src/agents/specific_instructions/data_modeller/phases_deep/index.md +23 -0
- package/src/agents/specific_instructions/data_modeller/phases_deep/phase-1.md +52 -0
- package/src/agents/specific_instructions/data_modeller/phases_deep/phase-2.md +113 -0
- package/src/agents/specific_instructions/data_modeller/phases_deep/phase-3.md +47 -0
- package/src/agents/specific_instructions/data_modeller/phases_deep/phase-4.md +51 -0
- package/src/agents/specific_instructions/data_modeller/phases_deep/phase-5.md +45 -0
- package/src/agents/specific_instructions/data_modeller/phases_deep/phase-6.md +105 -0
- package/src/agents/specific_instructions/data_modeller/phases_deep/phase-7.md +136 -0
- package/src/agents/specific_instructions/data_modeller/phases_quick/index.md +19 -0
- package/src/agents/specific_instructions/data_modeller/phases_quick/phase-1.md +47 -0
- package/src/agents/specific_instructions/data_modeller/phases_quick/phase-2.md +65 -0
- package/src/agents/specific_instructions/data_modeller/review.md +141 -0
- package/src/agents/specific_instructions/data_modeller/service_mode.md +218 -0
- package/src/agents/specific_instructions/data_modeller/validation_checklist.md +125 -0
- package/src/agents/specific_instructions/data_scientist/advise.md +158 -0
- package/src/agents/specific_instructions/data_scientist/bi_engineer_handoff.md +63 -0
- package/src/agents/specific_instructions/data_scientist/experiment.md +482 -0
- package/src/agents/specific_instructions/data_scientist/experiment_ui_mode.md +44 -0
- package/src/agents/specific_instructions/data_scientist/explain.md +247 -0
- package/src/agents/specific_instructions/data_scientist/greenfield_data.md +35 -0
- package/src/agents/specific_instructions/data_scientist/ml_engineer_handoff.md +52 -0
- package/src/agents/specific_instructions/data_scientist/notebook_walkthrough.md +76 -0
- package/src/agents/specific_instructions/data_scientist/phases/index.md +24 -0
- package/src/agents/specific_instructions/data_scientist/phases/phase-1.md +45 -0
- package/src/agents/specific_instructions/data_scientist/phases/phase-2.md +67 -0
- package/src/agents/specific_instructions/data_scientist/phases/phase-3.md +89 -0
- package/src/agents/specific_instructions/data_scientist/phases/phase-4.md +143 -0
- package/src/agents/specific_instructions/data_scientist/phases/phase-5.md +71 -0
- package/src/agents/specific_instructions/data_scientist/phases/phase-6.md +239 -0
- package/src/agents/specific_instructions/data_scientist/phases/phase-7.md +207 -0
- package/src/agents/specific_instructions/data_scientist/phases.md +651 -0
- package/src/agents/specific_instructions/data_scientist/research.md +345 -0
- package/src/agents/specific_instructions/data_scientist/research_ui_mode.md +52 -0
- package/src/agents/specific_instructions/data_scientist/review.md +136 -0
- package/src/agents/specific_instructions/data_scientist/service_mode.md +247 -0
- package/src/agents/specific_instructions/data_scientist/validation_checklist.md +183 -0
- package/src/agents/specific_instructions/deep_learning_engineer/advise.md +145 -0
- package/src/agents/specific_instructions/deep_learning_engineer/phases/index.md +21 -0
- package/src/agents/specific_instructions/deep_learning_engineer/phases/phase-1.md +74 -0
- package/src/agents/specific_instructions/deep_learning_engineer/phases/phase-2.md +98 -0
- package/src/agents/specific_instructions/deep_learning_engineer/phases/phase-3.md +76 -0
- package/src/agents/specific_instructions/deep_learning_engineer/phases/phase-4.md +128 -0
- package/src/agents/specific_instructions/deep_learning_engineer/phases/phase-5.md +292 -0
- package/src/agents/specific_instructions/deep_learning_engineer/phases.md +567 -0
- package/src/agents/specific_instructions/deep_learning_engineer/research.md +389 -0
- package/src/agents/specific_instructions/deep_learning_engineer/review.md +155 -0
- package/src/agents/specific_instructions/deep_learning_engineer/validation_checklist.md +147 -0
- package/src/agents/specific_instructions/ml_engineer/advise.md +174 -0
- package/src/agents/specific_instructions/ml_engineer/bi_engineer_handoff.md +71 -0
- package/src/agents/specific_instructions/ml_engineer/experiment.md +474 -0
- package/src/agents/specific_instructions/ml_engineer/experiment_ui_mode.md +44 -0
- package/src/agents/specific_instructions/ml_engineer/notebook_walkthrough.md +75 -0
- package/src/agents/specific_instructions/ml_engineer/phases/index.md +25 -0
- package/src/agents/specific_instructions/ml_engineer/phases/phase-1.md +49 -0
- package/src/agents/specific_instructions/ml_engineer/phases/phase-2.md +75 -0
- package/src/agents/specific_instructions/ml_engineer/phases/phase-3.md +124 -0
- package/src/agents/specific_instructions/ml_engineer/phases/phase-4.md +279 -0
- package/src/agents/specific_instructions/ml_engineer/phases/phase-5.md +160 -0
- package/src/agents/specific_instructions/ml_engineer/phases/phase-6-5.md +170 -0
- package/src/agents/specific_instructions/ml_engineer/phases/phase-6.md +295 -0
- package/src/agents/specific_instructions/ml_engineer/phases/phase-7.md +337 -0
- package/src/agents/specific_instructions/ml_engineer/phases.md +1068 -0
- package/src/agents/specific_instructions/ml_engineer/research.md +437 -0
- package/src/agents/specific_instructions/ml_engineer/research_ui_mode.md +71 -0
- package/src/agents/specific_instructions/ml_engineer/review.md +187 -0
- package/src/agents/specific_instructions/ml_engineer/service_mode.md +273 -0
- package/src/agents/specific_instructions/ml_engineer/validation_checklist.md +185 -0
- package/src/agents/specific_instructions/mlops_engineer/advise.md +139 -0
- package/src/agents/specific_instructions/mlops_engineer/phases/index.md +23 -0
- package/src/agents/specific_instructions/mlops_engineer/phases/phase-1.md +52 -0
- package/src/agents/specific_instructions/mlops_engineer/phases/phase-2.md +86 -0
- package/src/agents/specific_instructions/mlops_engineer/phases/phase-3.md +105 -0
- package/src/agents/specific_instructions/mlops_engineer/phases/phase-4.md +128 -0
- package/src/agents/specific_instructions/mlops_engineer/phases/phase-5.md +106 -0
- package/src/agents/specific_instructions/mlops_engineer/phases/phase-6.md +128 -0
- package/src/agents/specific_instructions/mlops_engineer/phases/phase-7.md +144 -0
- package/src/agents/specific_instructions/mlops_engineer/phases.md +671 -0
- package/src/agents/specific_instructions/mlops_engineer/review.md +164 -0
- package/src/agents/specific_instructions/mlops_engineer/service_mode.md +81 -0
- package/src/agents/specific_instructions/mlops_engineer/validation_checklist.md +151 -0
- package/src/agents/specific_instructions/researcher/critical_review.md +292 -0
- package/src/agents/specific_instructions/researcher/review_checklist.md +67 -0
- package/src/agents/specific_instructions/researcher/service_mode.md +224 -0
- package/src/agents/specific_instructions/shared/auto_verify_mode.md +141 -0
- package/src/agents/specific_instructions/shared/autonomous_research.md +1289 -0
- package/src/agents/specific_instructions/shared/behavioral_rules.md +36 -0
- package/src/agents/specific_instructions/shared/diverge_protocol.md +387 -0
- package/src/agents/specific_instructions/shared/engineering_guidelines.md +136 -0
- package/src/agents/specific_instructions/shared/experiment_versioning.md +184 -0
- package/src/agents/specific_instructions/shared/goal_mode.md +187 -0
- package/src/agents/specific_instructions/shared/incremental_testing.md +139 -0
- package/src/agents/specific_instructions/shared/intent_discovery.md +223 -0
- package/src/agents/specific_instructions/shared/join_path_protocol.md +168 -0
- package/src/agents/specific_instructions/shared/knowledge_checkpoint.md +83 -0
- package/src/agents/specific_instructions/shared/knowledge_harvest.md +220 -0
- package/src/agents/specific_instructions/shared/knowledge_retrieval.md +100 -0
- package/src/agents/specific_instructions/shared/notebook_walkthrough_protocol.md +367 -0
- package/src/agents/specific_instructions/shared/reviewer_verdict_protocol.md +74 -0
- package/src/agents/specific_instructions/shared/swarm_protocol.md +97 -0
- package/src/agents/specific_instructions/shared/validation_protocol.md +139 -0
- package/src/agents/specific_instructions/syn/arbiter.md +140 -0
- package/src/agents/specific_instructions/syn/brainstorm.md +550 -0
- package/src/agents/specific_instructions/syn/code_review.md +232 -0
- package/src/agents/specific_instructions/syn/diff.md +239 -0
- package/src/agents/specific_instructions/syn/final_review.md +65 -0
- package/src/agents/specific_instructions/syn/fixer.md +240 -0
- package/src/agents/specific_instructions/syn/free_form.md +130 -0
- package/src/agents/specific_instructions/syn/knowledge.md +468 -0
- package/src/agents/specific_instructions/syn/notebook_walkthrough.md +78 -0
- package/src/agents/specific_instructions/syn/panel_review.md +634 -0
- package/src/agents/specific_instructions/syn/pm.md +453 -0
- package/src/agents/specific_instructions/syn/pr_review.md +255 -0
- package/src/agents/specific_instructions/syn/slides.md +417 -0
- package/src/agents/syn.md +729 -0
- package/src/commands/academic.md +41 -0
- package/src/commands/ai-engineer.md +45 -0
- package/src/commands/analytics-engineer.md +48 -0
- package/src/commands/applied-ml-scientist.md +45 -0
- package/src/commands/backend-engineer.md +35 -0
- package/src/commands/bi-engineer.md +40 -0
- package/src/commands/brainstorm.md +24 -0
- package/src/commands/data-analyst.md +38 -0
- package/src/commands/data-engineer.md +37 -0
- package/src/commands/data-modeller.md +38 -0
- package/src/commands/data-scientist.md +38 -0
- package/src/commands/deep-learning-engineer.md +47 -0
- package/src/commands/end.md +49 -0
- package/src/commands/knowledge.md +24 -0
- package/src/commands/ml-engineer.md +42 -0
- package/src/commands/mlops-engineer.md +47 -0
- package/src/commands/notebook-walkthrough.md +58 -0
- package/src/commands/researcher.md +40 -0
- package/src/commands/resume.md +57 -0
- package/src/commands/review-pr.md +26 -0
- package/src/commands/shards-guide.md +41 -0
- package/src/commands/shards-ui.md +32 -0
- package/src/commands/shards.md +41 -0
- package/src/docs/01-getting-started/concepts.md +109 -0
- package/src/docs/01-getting-started/first-session.md +79 -0
- package/src/docs/01-getting-started/install.md +61 -0
- package/src/docs/02-agents/academic.md +71 -0
- package/src/docs/02-agents/ai-engineer.md +78 -0
- package/src/docs/02-agents/analytics-engineer.md +58 -0
- package/src/docs/02-agents/applied-ml-scientist.md +59 -0
- package/src/docs/02-agents/backend-engineer.md +58 -0
- package/src/docs/02-agents/bi-engineer.md +65 -0
- package/src/docs/02-agents/data-analyst.md +67 -0
- package/src/docs/02-agents/data-engineer.md +57 -0
- package/src/docs/02-agents/data-modeller.md +51 -0
- package/src/docs/02-agents/data-scientist.md +78 -0
- package/src/docs/02-agents/deep-learning-engineer.md +64 -0
- package/src/docs/02-agents/ml-engineer.md +80 -0
- package/src/docs/02-agents/mlops-engineer.md +59 -0
- package/src/docs/02-agents/overview.md +62 -0
- package/src/docs/02-agents/researcher.md +73 -0
- package/src/docs/02-agents/syn.md +88 -0
- package/src/docs/03-protocols/auto-verify.md +82 -0
- package/src/docs/03-protocols/autonomous-research.md +59 -0
- package/src/docs/03-protocols/behavioral-rules.md +35 -0
- package/src/docs/03-protocols/diverge.md +50 -0
- package/src/docs/03-protocols/engineering-guidelines.md +56 -0
- package/src/docs/03-protocols/experiment-versioning.md +38 -0
- package/src/docs/03-protocols/gate-pattern.md +65 -0
- package/src/docs/03-protocols/incremental-testing.md +68 -0
- package/src/docs/03-protocols/join-path.md +46 -0
- package/src/docs/03-protocols/knowledge-ledger.md +70 -0
- package/src/docs/03-protocols/reviewer-verdicts.md +39 -0
- package/src/docs/03-protocols/swarm.md +40 -0
- package/src/docs/03-protocols/validation.md +174 -0
- package/src/docs/04-ui/activity-bar.md +70 -0
- package/src/docs/04-ui/chat-pane.md +80 -0
- package/src/docs/04-ui/code-intel.md +62 -0
- package/src/docs/04-ui/file-editing.md +61 -0
- package/src/docs/04-ui/git.md +54 -0
- package/src/docs/04-ui/keybindings.md +79 -0
- package/src/docs/04-ui/knowledge-map.md +76 -0
- package/src/docs/04-ui/overview.md +93 -0
- package/src/docs/04-ui/panels.md +49 -0
- package/src/docs/04-ui/pinboard-selection.md +66 -0
- package/src/docs/04-ui/quick-open-palette.md +56 -0
- package/src/docs/04-ui/sessions.md +81 -0
- package/src/docs/04-ui/settings-permissions.md +56 -0
- package/src/docs/05-commands/reference.md +59 -0
- package/src/docs/06-outputs/directory-map.md +116 -0
- package/src/docs/07-workflows/ai-eval-first.md +57 -0
- package/src/docs/07-workflows/deep-study-to-production.md +76 -0
- package/src/docs/07-workflows/diverge-exploration.md +77 -0
- package/src/docs/07-workflows/quick-analysis.md +45 -0
- package/src/docs/08-integrations/claude-code-auto-mode.md +191 -0
- package/src/docs/08-integrations/google-slides.md +175 -0
- package/src/docs/README.md +30 -0
- package/src/docs/manifest.json +108 -0
- package/src/templates/analysis-template.md +20 -0
- package/src/templates/branch-report.md +46 -0
- package/src/templates/diff-report.md +88 -0
- package/src/templates/knowledge-index.md +7 -0
- package/src/templates/model-card-schema.json +186 -0
- package/src/templates/model-card-schema.md +88 -0
- package/src/templates/model-card.md +124 -0
- package/src/templates/project-plan.md +47 -0
- package/src/templates/project-specs.md +81 -0
- package/src/templates/report-template.md +43 -0
- package/src/templates/study-template.md +25 -0
- package/src/ui/cc-readonly.js +181 -0
- package/src/ui/chat-session.js +466 -0
- package/src/ui/css/base.css +136 -0
- package/src/ui/css/brainstorm.css +525 -0
- package/src/ui/css/chat.css +1405 -0
- package/src/ui/css/editor.css +546 -0
- package/src/ui/css/eval-dashboard.css +157 -0
- package/src/ui/css/experiment.css +237 -0
- package/src/ui/css/guide.css +186 -0
- package/src/ui/css/knowledge-map.css +383 -0
- package/src/ui/css/layout.css +431 -0
- package/src/ui/css/model-card.css +161 -0
- package/src/ui/css/notebook-walkthrough.css +271 -0
- package/src/ui/css/pr-review.css +403 -0
- package/src/ui/css/prompt-lab.css +325 -0
- package/src/ui/css/sessions.css +258 -0
- package/src/ui/css/sidebar.css +661 -0
- package/src/ui/css/terminal.css +113 -0
- package/src/ui/css/theme-light.css +542 -0
- package/src/ui/index.html +389 -0
- package/src/ui/js/agents.js +32 -0
- package/src/ui/js/bookmarks.js +230 -0
- package/src/ui/js/chat.js +1776 -0
- package/src/ui/js/code-intel.js +328 -0
- package/src/ui/js/command-palette.js +142 -0
- package/src/ui/js/events.js +591 -0
- package/src/ui/js/explorer.js +317 -0
- package/src/ui/js/file-view.js +477 -0
- package/src/ui/js/git.js +536 -0
- package/src/ui/js/guide.js +198 -0
- package/src/ui/js/hud.js +75 -0
- package/src/ui/js/init.js +351 -0
- package/src/ui/js/knowledge-map.js +906 -0
- package/src/ui/js/markdown.js +114 -0
- package/src/ui/js/monaco.js +164 -0
- package/src/ui/js/notebook-walkthrough.js +272 -0
- package/src/ui/js/notebook.js +448 -0
- package/src/ui/js/panels.js +2681 -0
- package/src/ui/js/pinboard.js +186 -0
- package/src/ui/js/quick-open.js +164 -0
- package/src/ui/js/selection-context.js +131 -0
- package/src/ui/js/sessions.js +256 -0
- package/src/ui/js/settings.js +476 -0
- package/src/ui/js/split-view.js +82 -0
- package/src/ui/js/state.js +343 -0
- package/src/ui/js/table.js +161 -0
- package/src/ui/js/tabs.js +284 -0
- package/src/ui/js/tabular.js +125 -0
- package/src/ui/js/terminal.js +354 -0
- package/src/ui/js/timeline.js +137 -0
- package/src/ui/js/utils.js +293 -0
- package/src/ui/notebook-kernel.py +790 -0
- package/src/ui/open-browser.js +55 -0
- package/src/ui/permission-pattern.js +42 -0
- package/src/ui/relay.js +513 -0
- package/src/ui/server.js +3072 -0
- package/src/ui/session-index.js +225 -0
- package/src/ui/shards_icon.png +0 -0
- package/src/ui/spawn-server.js +41 -0
- package/src/ui/symbol-index.js +813 -0
- package/src/ui/ui-push.js +177 -0
- package/tools/gate-hook/VALIDATION_SPEC.md +273 -0
- package/tools/gate-hook/__tests__/auto-verify.test.js +343 -0
- package/tools/gate-hook/auto-allowlist.js +179 -0
- package/tools/gate-hook/auto-state.js +68 -0
- package/tools/gate-hook/classify.js +21 -0
- package/tools/gate-hook/log.js +57 -0
- package/tools/gate-hook/parser.js +205 -0
- package/tools/gate-hook/sql-guard.js +230 -0
- package/tools/gate-hook/state.js +170 -0
- package/tools/gate-hook/sweep.js +139 -0
- package/tools/gate-hook/transcript.js +45 -0
- package/tools/gate-hook/validation.js +321 -0
- package/tools/gate-hook.js +475 -0
- package/tools/install.js +914 -0
- package/tools/shards-gates.js +311 -0
- package/tools/shards-sessions.js +261 -0
- package/tools/shards-ui.js +377 -0
|
@@ -0,0 +1,1068 @@
|
|
|
1
|
+
# ML Engineer — Phased Workflow
|
|
2
|
+
|
|
3
|
+
Phases 1 through 8 for the ML Engineer. Phase 0 (Triage) is already complete.
|
|
4
|
+
Follow every phase, gate, and documentation rule below.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Phase 1 — Business Requirements
|
|
9
|
+
|
|
10
|
+
Goal: Ground the ML system in a business problem, not a technology choice.
|
|
11
|
+
|
|
12
|
+
Ask about:
|
|
13
|
+
- What business problem does this solve? Who benefits?
|
|
14
|
+
- What's the current solution? (rule-based, manual, nothing)
|
|
15
|
+
- What's the decision or action the model output drives?
|
|
16
|
+
- Who are the end users of the model's predictions? (internal system, customer-facing,
|
|
17
|
+
analyst dashboard, API consumer)
|
|
18
|
+
- What's the cost of a wrong prediction? (false positive vs. false negative asymmetry)
|
|
19
|
+
- What's the success metric from the business perspective? (not model metrics —
|
|
20
|
+
business KPIs like conversion rate, revenue, time saved)
|
|
21
|
+
|
|
22
|
+
### Document Phase 1
|
|
23
|
+
|
|
24
|
+
```markdown
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Phase 1: Business Requirements (ML Engineer)
|
|
28
|
+
- **Business problem:** <what this solves>
|
|
29
|
+
- **Current solution:** <rule-based | manual | none | existing ML — describe>
|
|
30
|
+
- **Decision driven by model:** <what action the output triggers>
|
|
31
|
+
- **End users:** <internal system | customer-facing | analyst | API consumer>
|
|
32
|
+
- **Cost of wrong prediction:**
|
|
33
|
+
- False positive: <business impact>
|
|
34
|
+
- False negative: <business impact>
|
|
35
|
+
- **Business success metric:** <KPI and target, not model metrics>
|
|
36
|
+
- **Business priority:** Critical | High | Medium
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
::GATE:: id=specific-instructions-ml-engineer-phases-phase1 phase=1 kind=phase
|
|
40
|
+
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.
|
|
41
|
+
::ENDGATE::
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Phase 2 — Scope and Constraints
|
|
46
|
+
|
|
47
|
+
Goal: Define the technical boundaries and infrastructure realities.
|
|
48
|
+
|
|
49
|
+
Ask about:
|
|
50
|
+
- **Serving mode:** Real-time (synchronous API) | Near-real-time (streaming) |
|
|
51
|
+
Batch (scheduled predictions) | Hybrid
|
|
52
|
+
- **Latency budget:** (for real-time) p50, p95, p99 targets
|
|
53
|
+
- **Throughput:** Expected QPS or batch volume
|
|
54
|
+
- **Memory budget:** Max model size, max feature vector size, concurrent instances
|
|
55
|
+
- **Compute budget:** GPU vs. CPU, cost constraints, cloud vs. on-prem
|
|
56
|
+
- **Existing infrastructure:** Model registry, feature store, serving framework,
|
|
57
|
+
orchestration (Airflow, etc.), monitoring
|
|
58
|
+
- **Data freshness requirements:** How stale can features be at inference time?
|
|
59
|
+
- **Fallback strategy:** What happens when the model is unavailable?
|
|
60
|
+
- **Compliance / fairness:** Any regulatory constraints? Protected attributes?
|
|
61
|
+
Explainability requirements?
|
|
62
|
+
|
|
63
|
+
**Consult the Data Engineer** for pipeline feasibility:
|
|
64
|
+
|
|
65
|
+
Tell the user: "Getting the Data Engineer shard in here — I need to know what the feature pipeline can actually support before I design against a fiction."
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
Task(
|
|
69
|
+
subagent_type="data-engineer",
|
|
70
|
+
description="Review ML pipeline feasibility",
|
|
71
|
+
prompt="I am the ML Engineer shard scoping an ML project: [project description].
|
|
72
|
+
I need to understand the existing data pipeline infrastructure. Please tell me:
|
|
73
|
+
1. What orchestration exists (Airflow, dbt, etc.)?
|
|
74
|
+
2. What's the current pipeline cadence for key tables?
|
|
75
|
+
3. Is there a feature store or any feature serving infrastructure?
|
|
76
|
+
4. What are the realistic constraints for adding new pipeline steps?
|
|
77
|
+
5. Any known bottlenecks or capacity issues?
|
|
78
|
+
Keep the response focused and practical."
|
|
79
|
+
)
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Document Phase 2
|
|
83
|
+
|
|
84
|
+
```markdown
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Phase 2: Scope and Constraints (ML Engineer)
|
|
88
|
+
- **Serving mode:** Real-time | Near-real-time | Batch | Hybrid
|
|
89
|
+
- **Latency budget:** p50: <X>ms | p95: <X>ms | p99: <X>ms (or "N/A — batch")
|
|
90
|
+
- **Throughput:** <QPS or batch volume>
|
|
91
|
+
- **Memory budget:** Model: <X>MB | Features: <X>MB | Instances: <N>
|
|
92
|
+
- **Compute:** GPU | CPU — <constraints>
|
|
93
|
+
- **Existing infrastructure:**
|
|
94
|
+
- Model registry: <exists | needs setup — details>
|
|
95
|
+
- Feature store: <exists | needs setup | N/A>
|
|
96
|
+
- Serving: <framework or "needs design">
|
|
97
|
+
- Orchestration: <tool and cadence>
|
|
98
|
+
- Monitoring: <exists | needs setup>
|
|
99
|
+
- **Data freshness at inference:** <real-time | <X> minutes | <X> hours | daily>
|
|
100
|
+
- **Fallback strategy:** <rule-based default | cached predictions | graceful degradation | TBD>
|
|
101
|
+
- **Compliance / fairness:** <constraints or "none identified">
|
|
102
|
+
- **Data Engineer consultation:**
|
|
103
|
+
- <summary of pipeline feasibility findings>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
::GATE:: id=specific-instructions-ml-engineer-phases-phase2 phase=2 kind=phase
|
|
107
|
+
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.
|
|
108
|
+
::ENDGATE::
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Phase 3 — Data and Feature Discovery
|
|
113
|
+
|
|
114
|
+
Goal: Understand what data is available for features and labels.
|
|
115
|
+
|
|
116
|
+
**If productionization from study:** The Data Scientist has already completed feature
|
|
117
|
+
discovery. Start by reading the study's Phase 2 (Data Discovery) and Phase 4 (Modeling
|
|
118
|
+
Approach) from the study's `project-specs.md`. Present the inherited feature set to the
|
|
119
|
+
user, then focus this phase on the **production-specific gap**:
|
|
120
|
+
- Which study features are available at the required inference latency?
|
|
121
|
+
- Which features need real-time alternatives or pre-computation?
|
|
122
|
+
- Are there features the study used that cannot be productionized?
|
|
123
|
+
Still consult the Data Modeller, but scope the consultation to serving-time data
|
|
124
|
+
availability rather than full discovery.
|
|
125
|
+
|
|
126
|
+
**Otherwise (greenfield or iteration):** proceed as below.
|
|
127
|
+
|
|
128
|
+
**Consult the Data Modeller:**
|
|
129
|
+
|
|
130
|
+
Tell the user: "Pulling in the Data Modeller. Feature definitions have to be grounded in actual data models, not what we hope exists."
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
Task(
|
|
134
|
+
subagent_type="data-modeller",
|
|
135
|
+
description="Explore data model for ML features",
|
|
136
|
+
prompt="I am the ML Engineer shard building an ML system for [purpose]. I need to
|
|
137
|
+
understand the data models that could source features for this system. Specifically:
|
|
138
|
+
1. What tables capture [relevant entities and events]?
|
|
139
|
+
2. What's the grain and freshness of each?
|
|
140
|
+
3. How do they relate to each other (join keys, cardinality)?
|
|
141
|
+
4. Any data quality concerns?
|
|
142
|
+
5. Which tables are available in real-time vs. batch only?
|
|
143
|
+
Focus on: [specific entities, events, or business concepts].
|
|
144
|
+
Since I'll be building feature extraction queries against these tables, please run
|
|
145
|
+
grain validation (PK uniqueness checks) and freshness checks on the key tables."
|
|
146
|
+
)
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
**Greenfield handling:** Applies to greenfield and iteration projects only. If this is
|
|
150
|
+
a productionization from a study, skip — the study is the data source.
|
|
151
|
+
|
|
152
|
+
For greenfield and iteration: check whether the Data Modeller's response contains
|
|
153
|
+
"NO DATA ENVIRONMENT DETECTED".
|
|
154
|
+
|
|
155
|
+
If it does:
|
|
156
|
+
1. Present the Data Modeller's response to the user.
|
|
157
|
+
2. Ask:
|
|
158
|
+
"The Data Modeller found no data assets in this project. For an ML system, data
|
|
159
|
+
is the foundation of every feature and training decision.
|
|
160
|
+
- (a) Feature data exists in your warehouse — tell me what entities and events
|
|
161
|
+
are available. I'll design feature extraction from there.
|
|
162
|
+
- (b) Data exists but schema details aren't available right now — I can design
|
|
163
|
+
the feature architecture and model approach; actual queries and training will wait.
|
|
164
|
+
- (c) No data exists yet — I can produce a full ML architecture design, but
|
|
165
|
+
nothing will train or serve real predictions until data is available.
|
|
166
|
+
Which situation are we in?"
|
|
167
|
+
3. Wait for the user's response before proceeding.
|
|
168
|
+
- (a): proceed with provided context.
|
|
169
|
+
- (b): proceed with caveats. Flag feature availability column in Phase 3 docs as
|
|
170
|
+
"Unverified — user-described." Add:
|
|
171
|
+
`**Data environment:** Feature data exists but inaccessible — candidates user-described, not verified.`
|
|
172
|
+
- (c): tell the user: "This will be an ML architecture design document. I can
|
|
173
|
+
define feature requirements, label definition, model architecture, and
|
|
174
|
+
infrastructure design — but the model cannot train and feature queries cannot
|
|
175
|
+
run until data exists. All feature candidates will be flagged
|
|
176
|
+
[THEORETICAL — DATA NOT AVAILABLE]. Do you want to proceed on that basis?"
|
|
177
|
+
Wait for confirmation. Add:
|
|
178
|
+
`**Data environment:** GREENFIELD — No data assets detected. Theoretical ML design only.`
|
|
179
|
+
|
|
180
|
+
Present findings, then ask:
|
|
181
|
+
- **Label definition:** How is the target variable defined? Where does ground truth come from?
|
|
182
|
+
Is there label delay (e.g., churn only observable 90 days later)?
|
|
183
|
+
- **Feature candidates:** What signals could predict the target? Group by:
|
|
184
|
+
- User/entity attributes (demographic, account-level)
|
|
185
|
+
- Behavioral features (engagement, usage patterns, recency/frequency/monetary)
|
|
186
|
+
- Contextual features (time of day, device, location)
|
|
187
|
+
- Interaction features (user x item, user x content)
|
|
188
|
+
|
|
189
|
+
For each group, also propose 1-2 **novel derived candidates** — e.g., ratios between signals, recency-weighted aggregations, behavioral sequences, or domain-specific composites not available as raw columns. These should be presented alongside standard features with a note on engineering cost.
|
|
190
|
+
- **Feature availability at inference:** For each feature group, is it available
|
|
191
|
+
at the latency required for serving?
|
|
192
|
+
- **Historical depth:** How far back does the data go? Is it sufficient for training?
|
|
193
|
+
- **Known biases:** Selection bias, survivorship bias, feedback loops
|
|
194
|
+
|
|
195
|
+
### Document Phase 3
|
|
196
|
+
|
|
197
|
+
```markdown
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Phase 3: Data and Feature Discovery (ML Engineer)
|
|
201
|
+
- **Data Modeller consultation:**
|
|
202
|
+
- <summary of data model findings>
|
|
203
|
+
- **Label definition:**
|
|
204
|
+
- Target: <variable name and definition>
|
|
205
|
+
- Ground truth source: <table or event>
|
|
206
|
+
- Label delay: <duration or "none">
|
|
207
|
+
- Label quality concerns: <issues or "none">
|
|
208
|
+
- **Feature candidates:**
|
|
209
|
+
| Feature Group | Examples | Source Table(s) | Available at Inference? |
|
|
210
|
+
|--------------|---------|-----------------|----------------------|
|
|
211
|
+
| Entity attributes | <examples> | <tables> | Yes — batch | Yes — real-time | No |
|
|
212
|
+
| Behavioral | <examples> | <tables> | Yes — batch | Yes — real-time | No |
|
|
213
|
+
| Contextual | <examples> | <tables> | Yes — real-time | No |
|
|
214
|
+
| Interaction | <examples> | <tables> | Yes — batch | No |
|
|
215
|
+
- **Historical depth:** <time range available>
|
|
216
|
+
- **Known biases:**
|
|
217
|
+
- <bias type>: <description and mitigation>
|
|
218
|
+
- **Feature-serving gap:** <features available in batch but not real-time, and impact>
|
|
219
|
+
- **Data environment:** <not greenfield | Feature data exists but inaccessible — candidates user-described, not verified | GREENFIELD — No data assets detected. Theoretical ML design only>
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
::GATE:: id=specific-instructions-ml-engineer-phases-phase3 phase=3 kind=phase
|
|
223
|
+
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.
|
|
224
|
+
::ENDGATE::
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## Phase 4 — Model Design
|
|
229
|
+
|
|
230
|
+
Goal: Choose the model architecture, baselines, and candidate approaches.
|
|
231
|
+
|
|
232
|
+
**If productionization from study:** The Data Scientist has already validated the
|
|
233
|
+
model design from a statistical perspective. Start by reading the study's Phase 4
|
|
234
|
+
(Modeling Approach) and Phase 6 (Build Log) from the study's `project-specs.md`.
|
|
235
|
+
The study's candidate model is the starting point, not a blank slate. Focus this phase on:
|
|
236
|
+
- Can the study's best model meet serving constraints (latency, memory, size)?
|
|
237
|
+
- If not, what production-friendly alternatives achieve acceptable performance?
|
|
238
|
+
- What's the production baseline? (the study's baseline may differ from a production baseline)
|
|
239
|
+
Still consult the Data Scientist via Task, but frame the review as "production adaptation
|
|
240
|
+
review" rather than full methodology review.
|
|
241
|
+
|
|
242
|
+
**Otherwise (greenfield or iteration):** proceed as below.
|
|
243
|
+
|
|
244
|
+
Ask about:
|
|
245
|
+
- **Model type preferences:** Any organizational preferences or existing frameworks?
|
|
246
|
+
(scikit-learn, XGBoost, LightGBM, PyTorch, TensorFlow, etc.)
|
|
247
|
+
- **Interpretability vs. performance trade-off:** Where does this sit?
|
|
248
|
+
- **Ensemble acceptable?** Or must it be a single model for serving simplicity?
|
|
249
|
+
- **Online learning needed?** Or batch retrain is sufficient?
|
|
250
|
+
|
|
251
|
+
**Feature Registry check.** If `.shards/knowledge/features/` exists, scan for features
|
|
252
|
+
whose domain tags overlap with this project's data domain (from Phase 3). For each
|
|
253
|
+
relevant feature, present to the user with its SQL snippet, grain, and verification
|
|
254
|
+
metadata. Ask: "Would you like to import any of these into your feature candidates?"
|
|
255
|
+
|
|
256
|
+
If imported, note in feature candidates list: `(imported from Knowledge Ledger —
|
|
257
|
+
verified by <agent> in <source_project>)`
|
|
258
|
+
|
|
259
|
+
**Consult the Data Scientist** for methodology review:
|
|
260
|
+
|
|
261
|
+
Tell the user: "Asking the Data Scientist to review the modeling approach. Statistical rigor isn't optional."
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
```
|
|
265
|
+
Task(
|
|
266
|
+
subagent_type="data-scientist",
|
|
267
|
+
description="Review ML model design for [project]",
|
|
268
|
+
prompt="I am the ML Engineer shard designing an ML system for [purpose].
|
|
269
|
+
Here is the model design:
|
|
270
|
+
- Task: [classification/regression/ranking/etc.]
|
|
271
|
+
- Target: [definition]
|
|
272
|
+
- Features: [summary of feature groups]
|
|
273
|
+
- Baseline: [proposed baseline]
|
|
274
|
+
- Candidates: [proposed candidate models]
|
|
275
|
+
- Evaluation: [proposed metrics]
|
|
276
|
+
Please review from a statistical and methodological perspective:
|
|
277
|
+
1. Is the target definition sound? Any leakage risk?
|
|
278
|
+
2. Are the evaluation metrics appropriate for the business problem?
|
|
279
|
+
3. Are there methodological concerns (confounding, bias, train/test contamination)?
|
|
280
|
+
4. Would you suggest a different approach or additional baselines?
|
|
281
|
+
Keep the review focused — I'll handle the systems/infrastructure side."
|
|
282
|
+
)
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
**If the problem warrants non-standard or cutting-edge methodology** — non-tabular
|
|
286
|
+
data structures (sequences, graphs, point clouds, images), custom objectives,
|
|
287
|
+
architecture search, self-supervised pretraining, multi-task learning, or the user
|
|
288
|
+
explicitly asks about novel approaches — consult the Applied ML Scientist:
|
|
289
|
+
|
|
290
|
+
Tell the user: "This problem has characteristics that warrant a deeper ML science
|
|
291
|
+
review — I'm asking the Applied ML Scientist shard to assess whether more
|
|
292
|
+
cutting-edge approaches should be considered..."
|
|
293
|
+
|
|
294
|
+
```
|
|
295
|
+
Task(
|
|
296
|
+
subagent_type="applied-ml-scientist",
|
|
297
|
+
description="ML methodology review for <system type>",
|
|
298
|
+
prompt="I am the ML Engineer shard designing a <system>. The proposed approach is:
|
|
299
|
+
- Task type: <classification | regression | ranking | etc.>
|
|
300
|
+
- Data: <modality, scale, key characteristics>
|
|
301
|
+
- Proposed model: <architecture or approach>
|
|
302
|
+
- Objective: <loss function / evaluation metric>
|
|
303
|
+
- Constraints: <latency, memory, compute budget, interpretability>
|
|
304
|
+
- Business goal: <what the model output drives>
|
|
305
|
+
|
|
306
|
+
Please review and flag:
|
|
307
|
+
1. Is the problem formulated correctly as an ML problem?
|
|
308
|
+
2. Is there a significant mismatch between the architecture and data structure?
|
|
309
|
+
3. Are there methods from recent literature that would clearly outperform the
|
|
310
|
+
proposed approach for this specific problem?
|
|
311
|
+
4. Any red flags on the loss function or evaluation metric?
|
|
312
|
+
|
|
313
|
+
Context: <key constraints and goals from Phases 1-3>."
|
|
314
|
+
)
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
Apply the Reviewer Verdict Protocol (see shared protocol — `applied-ml-scientist` row).
|
|
318
|
+
|
|
319
|
+
**If the candidate model involves deep learning** — neural networks for image,
|
|
320
|
+
text, audio, point cloud, or graph data, transformer variants, CNNs, RNNs, or any
|
|
321
|
+
multi-layer neural approach — consult the Deep Learning Engineer:
|
|
322
|
+
|
|
323
|
+
Tell the user: "This involves deep learning — I'm asking the Deep Learning Engineer
|
|
324
|
+
shard to review architecture–data alignment, memory footprint, and inference
|
|
325
|
+
feasibility..."
|
|
326
|
+
|
|
327
|
+
```
|
|
328
|
+
Task(
|
|
329
|
+
subagent_type="deep-learning-engineer",
|
|
330
|
+
description="DL architecture and production feasibility review for <project>",
|
|
331
|
+
prompt="I am the ML Engineer shard designing an ML system. I need a deep learning
|
|
332
|
+
architecture and production feasibility review.
|
|
333
|
+
|
|
334
|
+
- Task type: <classification | regression | ranking | generation | etc.>
|
|
335
|
+
- Data modality: <image | text | audio | point cloud | graph | tabular | multi-modal>
|
|
336
|
+
- Proposed architecture: <name or description>
|
|
337
|
+
- Input/output shapes: <input tensor shape> → <output tensor shape>
|
|
338
|
+
- Data scale: <N training examples, sequence length or spatial dims>
|
|
339
|
+
- Hardware: <GPU, VRAM, inference latency budget>
|
|
340
|
+
- Model size budget: <parameter ceiling or 'unconstrained'>
|
|
341
|
+
- Business goal: <what the model output drives>
|
|
342
|
+
|
|
343
|
+
Please review:
|
|
344
|
+
1. Is there a mismatch between the proposed architecture and the data structure
|
|
345
|
+
(inductive bias argument)?
|
|
346
|
+
2. Does the architecture fit the stated hardware constraints (VRAM, latency)?
|
|
347
|
+
3. Are there implementation concerns (numerical instability, known failure modes
|
|
348
|
+
for this architecture class at this data scale)?
|
|
349
|
+
4. Are there superior architectures from recent literature for this exact
|
|
350
|
+
problem type that would be worth considering before committing?
|
|
351
|
+
|
|
352
|
+
Context: <key constraints and goals from Phases 1-3>."
|
|
353
|
+
)
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
Apply the Reviewer Verdict Protocol (see shared protocol — `deep-learning-engineer` row).
|
|
357
|
+
|
|
358
|
+
**If Interpretability is High — consult the Data Analyst:**
|
|
359
|
+
|
|
360
|
+
Tell the user: "Looping in the Data Analyst — they need to validate that these features make business sense before we serve them."
|
|
361
|
+
|
|
362
|
+
```
|
|
363
|
+
Task(
|
|
364
|
+
subagent_type="data-analyst",
|
|
365
|
+
description="Review feature candidates for business sense and interpretability",
|
|
366
|
+
prompt="I am the ML Engineer shard building an ML system for [purpose]. High
|
|
367
|
+
interpretability has been flagged as a requirement. Please review the feature
|
|
368
|
+
candidates to confirm they make business sense for this problem.
|
|
369
|
+
|
|
370
|
+
Feature candidates: [summary of feature groups from Phase 3]
|
|
371
|
+
Target variable: [name and definition]
|
|
372
|
+
End users of model outputs: [from Phase 1 — internal system | customer-facing | analyst | API consumer]
|
|
373
|
+
Business problem: [from Phase 1]
|
|
374
|
+
Cost of wrong predictions: [false positive / false negative impact, from Phase 1]
|
|
375
|
+
|
|
376
|
+
Please review:
|
|
377
|
+
1. Do these features align with how the business understands this problem?
|
|
378
|
+
2. Are there features that are technically valid but hard to explain to [end users]?
|
|
379
|
+
3. Are there obvious business-meaningful features that appear missing?
|
|
380
|
+
4. Any features that could undermine trust in the model if surfaced via SHAP or
|
|
381
|
+
feature importance to stakeholders?
|
|
382
|
+
Focus on interpretability and business alignment — I'll handle the systems side."
|
|
383
|
+
)
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
Apply the Reviewer Verdict Protocol (see shared protocol — `data-analyst` row).
|
|
387
|
+
|
|
388
|
+
**If the evaluation involves statistical inference** — A/B testing, confidence
|
|
389
|
+
intervals, power analysis, significance testing, or experiment design for
|
|
390
|
+
online evaluation — consult the Researcher:
|
|
391
|
+
|
|
392
|
+
Tell the user: "The evaluation plan involves statistical inference — I'm asking
|
|
393
|
+
the Researcher shard to validate the methodology before we commit to it."
|
|
394
|
+
|
|
395
|
+
```
|
|
396
|
+
Task(
|
|
397
|
+
subagent_type="researcher",
|
|
398
|
+
description="Review statistical inference methodology for ML evaluation",
|
|
399
|
+
prompt="I am the ML Engineer shard designing the evaluation strategy for an
|
|
400
|
+
ML system: [description].
|
|
401
|
+
Here is the proposed evaluation approach:
|
|
402
|
+
- Task: [what the model does]
|
|
403
|
+
- Offline metrics: [list]
|
|
404
|
+
- Online evaluation plan: [A/B test design, shadow mode, etc.]
|
|
405
|
+
- Sample size / traffic split: [N or %]
|
|
406
|
+
- Statistical test planned: [t-test, chi-squared, bootstrap, etc. or 'TBD']
|
|
407
|
+
- Confidence level: [95%, 99%, etc. or 'TBD']
|
|
408
|
+
Please review from a statistical methodology perspective:
|
|
409
|
+
1. Is the proposed statistical test appropriate for this metric type?
|
|
410
|
+
2. Is the sample size / traffic split adequate for the expected effect size?
|
|
411
|
+
3. Is the experiment design sound (randomization, control, duration)?
|
|
412
|
+
4. Are there multiple comparison issues or other statistical pitfalls?
|
|
413
|
+
5. What power analysis would you recommend?
|
|
414
|
+
Keep the review focused on statistical inference methodology."
|
|
415
|
+
)
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
Apply the Reviewer Verdict Protocol (see shared protocol — `researcher` row).
|
|
419
|
+
|
|
420
|
+
Define:
|
|
421
|
+
- **Baseline model:** Simple, fast, interpretable. The floor to beat.
|
|
422
|
+
(logistic regression, decision tree, popularity-based, rule-based)
|
|
423
|
+
- **Candidate model(s):** What to try if baseline isn't sufficient.
|
|
424
|
+
- **Evaluation strategy:**
|
|
425
|
+
- Offline metrics: the model metrics (AUC, RMSE, NDCG, MAP, precision@k, etc.)
|
|
426
|
+
- Online metrics: the business metrics (conversion, engagement, revenue)
|
|
427
|
+
- Validation approach: temporal split, k-fold, stratified, group-aware
|
|
428
|
+
- **Model size estimate:** Approximate parameter count, serialized size
|
|
429
|
+
- **Inference cost estimate:** CPU/GPU time per prediction, batch throughput
|
|
430
|
+
|
|
431
|
+
### Document Phase 4
|
|
432
|
+
|
|
433
|
+
```markdown
|
|
434
|
+
---
|
|
435
|
+
|
|
436
|
+
## Phase 4: Model Design (ML Engineer)
|
|
437
|
+
- **Data Scientist review:**
|
|
438
|
+
- Verdict: Approved | Concerns raised
|
|
439
|
+
- Tier: Proceed | Proceed with caveats
|
|
440
|
+
- Notes: <summary of methodology review>
|
|
441
|
+
- Reviewer resolution: Approved | User override — <rationale>
|
|
442
|
+
- **Applied ML Scientist review:** N/A — standard methodology | <summary if consulted>
|
|
443
|
+
- Verdict: Sound | Consider Alternatives | Revise
|
|
444
|
+
- Tier: Proceed | Proceed with caveats | Halt
|
|
445
|
+
- Reviewer resolution: Approved | Approved on resubmit | User override — <rationale> | Project stopped
|
|
446
|
+
- **Deep Learning Engineer review:** N/A — not a DL approach | <summary if consulted>
|
|
447
|
+
- Verdict: DEPLOY | OPTIMIZE | REDESIGN
|
|
448
|
+
- Tier: Proceed | Proceed with caveats | Halt
|
|
449
|
+
- Reviewer resolution: Approved | Approved on resubmit | User override — <rationale> | Project stopped
|
|
450
|
+
- **Data Analyst feature review:** N/A — Interpretability not High | <summary>
|
|
451
|
+
- Verdict: Aligned | Concerns raised
|
|
452
|
+
- Tier: Proceed | Proceed with caveats
|
|
453
|
+
- Reviewer resolution: Approved | User override — <rationale>
|
|
454
|
+
- **Researcher review:** N/A — no statistical inference in evaluation | <summary if consulted>
|
|
455
|
+
- Verdict: Sound | Concerns | Revise
|
|
456
|
+
- Tier: Proceed | Proceed with caveats | Halt
|
|
457
|
+
- Reviewer resolution: Approved | Approved on resubmit | User override — <rationale> | Project stopped
|
|
458
|
+
- **Baseline model:**
|
|
459
|
+
- Type: <model type>
|
|
460
|
+
- Rationale: <why this baseline>
|
|
461
|
+
- Expected performance: <rough estimate>
|
|
462
|
+
- **Candidate model(s):**
|
|
463
|
+
- <model 1>: <type, rationale, trade-offs>
|
|
464
|
+
- <model 2>: <type, rationale, trade-offs>
|
|
465
|
+
- **Evaluation strategy:**
|
|
466
|
+
- Offline metrics: <list with business interpretation>
|
|
467
|
+
- Online metrics: <list — what to measure post-deploy>
|
|
468
|
+
- Validation: <temporal split | k-fold | stratified | group-aware — rationale>
|
|
469
|
+
- Minimum threshold: <metric > value — business justification>
|
|
470
|
+
- **Interpretability approach:** <SHAP | LIME | feature importance | N/A>
|
|
471
|
+
- **Model size estimate:** ~<N> parameters, ~<X>MB serialized
|
|
472
|
+
- **Inference cost:** ~<X>ms per prediction on <CPU/GPU>
|
|
473
|
+
- **Ensemble:** Yes — <strategy> | No — single model
|
|
474
|
+
- **Online learning:** Yes — <strategy> | No — batch retrain
|
|
475
|
+
- **Feature Registry check:** <N> relevant features found | No features found | N/A — no features directory
|
|
476
|
+
- Imported: <title(s)> | None
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
**DIVERGE check:** If you identified 2-3 mutually exclusive model architectures or approaches (e.g., different model families, fundamentally different serving paradigms) 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.
|
|
480
|
+
|
|
481
|
+
::GATE:: id=specific-instructions-ml-engineer-phases-phase4 phase=4 kind=phase
|
|
482
|
+
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.
|
|
483
|
+
::ENDGATE::
|
|
484
|
+
|
|
485
|
+
---
|
|
486
|
+
|
|
487
|
+
## Phase 5 — Infrastructure Design
|
|
488
|
+
|
|
489
|
+
Goal: Design the ML infrastructure — training pipeline, serving, monitoring.
|
|
490
|
+
|
|
491
|
+
**For greenfield projects**, design the full stack:
|
|
492
|
+
|
|
493
|
+
1. **Training pipeline:**
|
|
494
|
+
- Feature extraction (SQL → feature store or flat files)
|
|
495
|
+
- Train/validation/test split strategy
|
|
496
|
+
- Training orchestration (Airflow DAG, manual, CI/CD triggered)
|
|
497
|
+
- Model artifact storage (model registry, S3, etc.)
|
|
498
|
+
- Hyperparameter tuning strategy (grid, random, Bayesian, manual)
|
|
499
|
+
|
|
500
|
+
2. **Serving infrastructure:**
|
|
501
|
+
- Real-time: API framework (FastAPI, Flask, gRPC), containerization, scaling
|
|
502
|
+
- Batch: scheduled job, output format and destination
|
|
503
|
+
- Feature serving: pre-computed features, real-time feature computation, caching
|
|
504
|
+
- Model loading: cold start time, warm-up, model versioning
|
|
505
|
+
|
|
506
|
+
3. **Monitoring:**
|
|
507
|
+
- Model performance monitoring (prediction distribution drift, feature drift)
|
|
508
|
+
- Data quality monitoring (missing features, schema changes, staleness)
|
|
509
|
+
- System monitoring (latency, error rate, throughput, memory)
|
|
510
|
+
- Alerting thresholds and escalation paths
|
|
511
|
+
- Retraining triggers (scheduled, performance-based, drift-based)
|
|
512
|
+
|
|
513
|
+
4. **Rollback and safety:**
|
|
514
|
+
- A/B testing or shadow mode plan
|
|
515
|
+
- Rollback procedure (previous model version, rule-based fallback)
|
|
516
|
+
- Circuit breaker logic
|
|
517
|
+
|
|
518
|
+
**Consult the Data Engineer** for pipeline design review:
|
|
519
|
+
|
|
520
|
+
Tell the user: "Getting the Data Engineer shard to review the pipeline architecture. I need to know if the orchestration and scheduling actually fits before this is finalized."
|
|
521
|
+
|
|
522
|
+
```
|
|
523
|
+
Task(
|
|
524
|
+
subagent_type="data-engineer",
|
|
525
|
+
description="Review ML pipeline infrastructure design for [project]",
|
|
526
|
+
prompt="I am the ML Engineer shard. I've designed the data pipeline
|
|
527
|
+
infrastructure for project [project_name]. Here is the pipeline design:
|
|
528
|
+
- Training pipeline: [feature extraction method, orchestration tool, schedule]
|
|
529
|
+
- Feature serving: [pre-computed vs. real-time, caching strategy]
|
|
530
|
+
- Storage: [artifact storage, feature store, output destinations]
|
|
531
|
+
- Orchestration: [tool, DAG structure, scheduling, dependencies]
|
|
532
|
+
- Monitoring: [data quality checks, alerting, retraining triggers]
|
|
533
|
+
Please review from a data engineering perspective:
|
|
534
|
+
1. Does the orchestration design fit existing Airflow/dbt patterns?
|
|
535
|
+
2. Is the feature extraction pipeline feasible at the designed cadence?
|
|
536
|
+
3. Are the storage choices and capacity realistic?
|
|
537
|
+
4. Does this integrate cleanly with existing data infrastructure?
|
|
538
|
+
5. Any scheduling, dependency, or resource concerns?
|
|
539
|
+
Keep the review focused and practical — I'll handle the ML-specific concerns."
|
|
540
|
+
)
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
**Join path self-check (pipeline design):** Before requesting the Data Modeller
|
|
544
|
+
review, trace the join path for each join in the feature pipeline following
|
|
545
|
+
`.claude/agents/specific_instructions/shared/join_path_protocol.md`. Present the
|
|
546
|
+
trace to the user. Include it in the DM prompt below. Grain errors in feature
|
|
547
|
+
extraction become training set contamination.
|
|
548
|
+
|
|
549
|
+
**Consult the Data Modeller** for pipeline data correctness review with validation:
|
|
550
|
+
|
|
551
|
+
Tell the user: "Pulling in the Data Modeller to verify the pipeline design against the actual data model. Grain errors here become training errors later."
|
|
552
|
+
|
|
553
|
+
```
|
|
554
|
+
Task(
|
|
555
|
+
subagent_type="data-modeller",
|
|
556
|
+
description="Review ML pipeline data correctness for [project]",
|
|
557
|
+
prompt="I am the ML Engineer shard. I've designed the data pipeline for project
|
|
558
|
+
[project_name]. The project specs are at: [services|<existing_dir>]/[project_name]/project-specs.md
|
|
559
|
+
|
|
560
|
+
Here is how data flows through the pipeline:
|
|
561
|
+
- Feature extraction sources: [source tables and how they're used]
|
|
562
|
+
- Join strategy in pipeline: [key joins, grain at each stage]
|
|
563
|
+
- Pipeline stages: [ETL steps from source to training-ready dataset]
|
|
564
|
+
- Feature refresh cadence: [how often each feature group is refreshed]
|
|
565
|
+
- Serving-time data flow: [how features reach the model at inference]
|
|
566
|
+
|
|
567
|
+
Please REVIEW (not just explore) from a data model perspective:
|
|
568
|
+
1. Are the source table choices correct for these features?
|
|
569
|
+
2. Is grain handled correctly at each pipeline stage?
|
|
570
|
+
3. Are the join strategies sound given the entity relationships?
|
|
571
|
+
4. Does the data freshness cadence align with the model's requirements?
|
|
572
|
+
|
|
573
|
+
Run validation queries to verify:
|
|
574
|
+
1. PK uniqueness on each source table I'm using (confirm stated grain)
|
|
575
|
+
2. Null rates on join keys and critical feature columns
|
|
576
|
+
3. Join fan-out: run row counts before/after the key joins in my pipeline
|
|
577
|
+
4. Data freshness on each source table
|
|
578
|
+
|
|
579
|
+
Cross-reference results against the project requirements in project-specs.md
|
|
580
|
+
(especially Phase 3 feature candidates and Phase 2 data freshness requirements).
|
|
581
|
+
Keep the review focused on data correctness — the Data Engineer is reviewing
|
|
582
|
+
orchestration and infrastructure separately.
|
|
583
|
+
Return your full review with query validation results."
|
|
584
|
+
)
|
|
585
|
+
```
|
|
586
|
+
|
|
587
|
+
Address any concerns raised by either review before finalizing the infrastructure design.
|
|
588
|
+
|
|
589
|
+
**For iteration projects**, focus on what's changing and ensure backward compatibility.
|
|
590
|
+
|
|
591
|
+
### Document Phase 5
|
|
592
|
+
|
|
593
|
+
```markdown
|
|
594
|
+
---
|
|
595
|
+
|
|
596
|
+
## Phase 5: Infrastructure Design (ML Engineer)
|
|
597
|
+
- **Training pipeline:**
|
|
598
|
+
- Feature extraction: <method and location>
|
|
599
|
+
- Split strategy: <temporal | random | stratified — rationale>
|
|
600
|
+
- Orchestration: <tool and schedule>
|
|
601
|
+
- Artifact storage: <registry or location>
|
|
602
|
+
- HPO strategy: <grid | random | Bayesian | manual>
|
|
603
|
+
- **Serving infrastructure:**
|
|
604
|
+
- Mode: <real-time API | batch | streaming>
|
|
605
|
+
- Framework: <FastAPI | Flask | gRPC | batch job>
|
|
606
|
+
- Feature serving: <pre-computed | real-time | cache — TTL>
|
|
607
|
+
- Model loading: cold start ~<X>s, model version strategy
|
|
608
|
+
- Scaling: <horizontal | vertical — triggers>
|
|
609
|
+
- **Monitoring:**
|
|
610
|
+
- Model perf: <metrics tracked, drift detection method>
|
|
611
|
+
- Data quality: <what's monitored>
|
|
612
|
+
- System: <latency, error rate, throughput — dashboards>
|
|
613
|
+
- Alerting: <thresholds and escalation>
|
|
614
|
+
- Retraining trigger: <scheduled | performance-based | drift-based — threshold>
|
|
615
|
+
- **Rollback plan:**
|
|
616
|
+
- A/B testing: <plan or "N/A">
|
|
617
|
+
- Shadow mode: <plan or "N/A">
|
|
618
|
+
- Rollback: <procedure>
|
|
619
|
+
- Fallback: <rule-based default | cached predictions | error response>
|
|
620
|
+
- **Data Engineer pipeline review:**
|
|
621
|
+
- Verdict: Approved | Concerns raised
|
|
622
|
+
- Notes: <summary of infrastructure review>
|
|
623
|
+
- Issues addressed: <how resolved or "none raised">
|
|
624
|
+
- **Data Modeller pipeline review:**
|
|
625
|
+
- Verdict: Approved | Concerns raised
|
|
626
|
+
- Notes: <summary of data correctness review>
|
|
627
|
+
- Issues addressed: <how resolved or "none raised">
|
|
628
|
+
- **Iteration-specific (if applicable):**
|
|
629
|
+
- What's changing: <features | model | infra | all>
|
|
630
|
+
- Backward compatibility: <ensured | breaking — migration plan>
|
|
631
|
+
```
|
|
632
|
+
|
|
633
|
+
::GATE:: id=specific-instructions-ml-engineer-phases-phase5 phase=5 kind=phase
|
|
634
|
+
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.
|
|
635
|
+
::ENDGATE::
|
|
636
|
+
|
|
637
|
+
---
|
|
638
|
+
|
|
639
|
+
## Phase 6 — Execute
|
|
640
|
+
|
|
641
|
+
**Context checkpoint:** Before building, prompt the user:
|
|
642
|
+
|
|
643
|
+
"Planning's locked — good moment to run `/compact` or `/clear` before we start
|
|
644
|
+
executing. I'll be working from project-specs.md from here. Say the word when
|
|
645
|
+
you're ready."
|
|
646
|
+
|
|
647
|
+
Wait for any signal from the user before beginning build steps.
|
|
648
|
+
|
|
649
|
+
**Knowledge re-check:** Follow `.claude/agents/specific_instructions/shared/knowledge_checkpoint.md` before building.
|
|
650
|
+
|
|
651
|
+
Goal: Build the feature queries, training notebook, and pipeline artifacts.
|
|
652
|
+
|
|
653
|
+
**Join path self-check (feature queries):** Before requesting the Data Modeller
|
|
654
|
+
review, trace the join path for each feature query following
|
|
655
|
+
`.claude/agents/specific_instructions/shared/join_path_protocol.md`. Present the
|
|
656
|
+
trace to the user. Include it in the DM prompt below.
|
|
657
|
+
|
|
658
|
+
**Then request Data Modeller query review with validation:**
|
|
659
|
+
|
|
660
|
+
Tell the user: "Pulling in the Data Modeller to verify the feature extraction queries. Feature pipeline built on bad grain assumptions is a training set problem. I'm not building until this is confirmed."
|
|
661
|
+
|
|
662
|
+
```
|
|
663
|
+
Task(
|
|
664
|
+
subagent_type="data-modeller",
|
|
665
|
+
description="Review ML feature queries for [project]",
|
|
666
|
+
prompt="I am the ML Engineer shard. I've written feature extraction queries for
|
|
667
|
+
project [name]. The project specs are at: [services|<existing_dir>]/[name]/project-specs.md
|
|
668
|
+
|
|
669
|
+
Here are the queries:
|
|
670
|
+
[include query outlines or key SQL]
|
|
671
|
+
|
|
672
|
+
Please REVIEW (not just explore): Do the joins make sense given the data model
|
|
673
|
+
grain? Are there grain fan-out risks? Am I using the right tables for these
|
|
674
|
+
features?
|
|
675
|
+
|
|
676
|
+
Run validation queries to check:
|
|
677
|
+
1. PK uniqueness on all tables referenced in these queries
|
|
678
|
+
2. Null rates on join keys and key feature source columns
|
|
679
|
+
3. Join fan-out: row counts before/after the joins in my feature queries
|
|
680
|
+
4. Data freshness on the tables feeding features
|
|
681
|
+
|
|
682
|
+
Cross-reference against the project requirements in project-specs.md
|
|
683
|
+
(especially Phase 3 feature candidates and Phase 5 data freshness requirements).
|
|
684
|
+
This is for ML feature engineering — pay special attention to fan-out that would
|
|
685
|
+
silently inflate training examples.
|
|
686
|
+
Return your full review with query validation results."
|
|
687
|
+
)
|
|
688
|
+
```
|
|
689
|
+
|
|
690
|
+
**Then build:**
|
|
691
|
+
|
|
692
|
+
1. **SQL queries** — Write to:
|
|
693
|
+
- Greenfield: `models/<name>/queries/`
|
|
694
|
+
- Iteration: `<existing_service_dir>/queries/`
|
|
695
|
+
- Name files descriptively: `01_label_definition.sql`, `02_user_features.sql`,
|
|
696
|
+
`03_behavioral_features.sql`, `04_training_dataset.sql`
|
|
697
|
+
- Include header comments:
|
|
698
|
+
```sql
|
|
699
|
+
-- Project: <project_name>
|
|
700
|
+
-- Query: <description>
|
|
701
|
+
-- Date: <date>
|
|
702
|
+
-- Feature group: <label | user | behavioral | contextual | interaction>
|
|
703
|
+
-- Dependencies: <upstream tables>
|
|
704
|
+
-- Output grain: one row per <entity>
|
|
705
|
+
```
|
|
706
|
+
|
|
707
|
+
2. **Training notebook** — Write using NotebookEdit to:
|
|
708
|
+
- Greenfield: `models/<name>/notebooks/`
|
|
709
|
+
- Iteration: `<existing_service_dir>/notebooks/`
|
|
710
|
+
Structure:
|
|
711
|
+
- **SQL loading rule** — **Do NOT re-embed SQL as Python strings.** Read `.sql`
|
|
712
|
+
files directly using `Path.read_text()`. Reference files by relative path from
|
|
713
|
+
the notebook location:
|
|
714
|
+
```python
|
|
715
|
+
from pathlib import Path
|
|
716
|
+
sql = Path("../queries/02_user_features.sql").read_text()
|
|
717
|
+
df = pd.read_sql(sql, conn)
|
|
718
|
+
```
|
|
719
|
+
- **Overview** (markdown): business problem, model type, key decisions
|
|
720
|
+
- **Setup**: imports, config, random seeds, data loading
|
|
721
|
+
- **Feature Engineering**: feature computation, transformations, encoding
|
|
722
|
+
- **EDA**: target distribution, feature distributions, correlations, class balance
|
|
723
|
+
- **Baseline Model**: train, evaluate, establish floor
|
|
724
|
+
- **Candidate Model(s)**: train, tune, evaluate, compare to baseline
|
|
725
|
+
- **Model Analysis**: feature importance, SHAP values, error analysis
|
|
726
|
+
- **Infrastructure Readiness**: model size, inference time benchmarks,
|
|
727
|
+
serving requirements check
|
|
728
|
+
- **Results Summary**: final metrics, business interpretation, recommendation
|
|
729
|
+
|
|
730
|
+
3. **Requirements file** — `requirements.txt` with all ML dependencies
|
|
731
|
+
|
|
732
|
+
4. **Config file** (if applicable) — model hyperparameters, feature lists, thresholds
|
|
733
|
+
|
|
734
|
+
5. **Eval results JSON** — After training and evaluating models, write structured
|
|
735
|
+
results to the project's `eval-results.json`:
|
|
736
|
+
- Greenfield: `models/<name>/eval-results.json`
|
|
737
|
+
- Iteration: `<existing_service_dir>/eval-results.json`
|
|
738
|
+
|
|
739
|
+
The JSON must follow this schema:
|
|
740
|
+
```json
|
|
741
|
+
{
|
|
742
|
+
"variant": "ml-engineer",
|
|
743
|
+
"projectName": "<project_name>",
|
|
744
|
+
"status": "running",
|
|
745
|
+
"timestamp": "<ISO-8601>",
|
|
746
|
+
"summary": {
|
|
747
|
+
"totalDimensions": 0,
|
|
748
|
+
"passed": 0,
|
|
749
|
+
"failed": 0,
|
|
750
|
+
"overallVerdict": "PENDING"
|
|
751
|
+
},
|
|
752
|
+
"dimensions": [
|
|
753
|
+
{ "dimension": "<metric_name>", "metric": "<metric>", "target": 0.85, "actual": null, "unit": "ratio", "verdict": null }
|
|
754
|
+
],
|
|
755
|
+
"cost": {
|
|
756
|
+
"perRequest": null,
|
|
757
|
+
"per1kTokens": null,
|
|
758
|
+
"monthlyProjected": null,
|
|
759
|
+
"budget": null,
|
|
760
|
+
"currency": "USD"
|
|
761
|
+
},
|
|
762
|
+
"baseline": {
|
|
763
|
+
"model": "<model_type>",
|
|
764
|
+
"metrics": { "<metric>": null }
|
|
765
|
+
},
|
|
766
|
+
"bestCandidate": {
|
|
767
|
+
"model": "<model_type>",
|
|
768
|
+
"metrics": { "<metric>": null },
|
|
769
|
+
"deltas": { "<metric>": null }
|
|
770
|
+
},
|
|
771
|
+
"infrastructure": [
|
|
772
|
+
{ "dimension": "Model size", "actual": null, "budget": "<Y>MB", "verdict": null },
|
|
773
|
+
{ "dimension": "Inference time", "actual": null, "budget": "<Y>ms", "verdict": null },
|
|
774
|
+
{ "dimension": "Memory usage", "actual": null, "budget": "<Y>MB", "verdict": null }
|
|
775
|
+
]
|
|
776
|
+
}
|
|
777
|
+
```
|
|
778
|
+
|
|
779
|
+
Write the file initially with `status: "running"` and null values. Update it
|
|
780
|
+
as baseline and candidate models are evaluated. When complete, set
|
|
781
|
+
`status: "complete"`, populate all metrics, compute `summary.overallVerdict`
|
|
782
|
+
(PASS if all dimensions pass, FAIL if any fail, PARTIAL if mixed).
|
|
783
|
+
|
|
784
|
+
If the Shards UI is active (`.shards/ui.port` file exists), push the eval
|
|
785
|
+
dashboard panel:
|
|
786
|
+
```bash
|
|
787
|
+
node .shards/ui/ui-push.js eval-dashboard \
|
|
788
|
+
--title "Eval: <project_name>" \
|
|
789
|
+
--agent "ml-engineer" \
|
|
790
|
+
--panel-id "eval-<project_name>" \
|
|
791
|
+
--source "<path_to>/eval-results.json"
|
|
792
|
+
```
|
|
793
|
+
|
|
794
|
+
### Document Phase 6
|
|
795
|
+
|
|
796
|
+
```markdown
|
|
797
|
+
---
|
|
798
|
+
|
|
799
|
+
## Phase 6: Build Log (ML Engineer)
|
|
800
|
+
- **Data Modeller query review:**
|
|
801
|
+
- Verdict: Approved | Concerns raised
|
|
802
|
+
- Notes: <summary>
|
|
803
|
+
- Issues addressed: <how resolved or "none raised">
|
|
804
|
+
- **Query files:**
|
|
805
|
+
- <file path>: <description>
|
|
806
|
+
- **Notebook location:** <file path>
|
|
807
|
+
- **Requirements file:** <file path>
|
|
808
|
+
- **Config file:** <file path or "N/A">
|
|
809
|
+
- **Baseline results:**
|
|
810
|
+
- <metric>: <value>
|
|
811
|
+
- **Best candidate results:**
|
|
812
|
+
- Model: <type>
|
|
813
|
+
- <metric>: <value> (improvement over baseline: <delta>)
|
|
814
|
+
- **Infrastructure readiness:**
|
|
815
|
+
- Model size: <X>MB (budget: <Y>MB) — Pass | Fail
|
|
816
|
+
- Inference time: <X>ms (budget: <Y>ms) — Pass | Fail
|
|
817
|
+
- Memory usage: <X>MB (budget: <Y>MB) — Pass | Fail
|
|
818
|
+
- **Deviations from plan:** <changes and why, or "none">
|
|
819
|
+
- **Surprising findings:** <anything unexpected>
|
|
820
|
+
```
|
|
821
|
+
|
|
822
|
+
::GATE:: id=specific-instructions-ml-engineer-phases-phase6 phase=6 kind=phase
|
|
823
|
+
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.
|
|
824
|
+
::ENDGATE::
|
|
825
|
+
|
|
826
|
+
---
|
|
827
|
+
|
|
828
|
+
## Phase 7 — Review and Handoff
|
|
829
|
+
|
|
830
|
+
**Backend Engineer code review (Python artifacts):**
|
|
831
|
+
|
|
832
|
+
Tell the user: "Before Syn signs off, the Backend Engineer is reviewing the Python
|
|
833
|
+
artifacts. Code quality is not optional."
|
|
834
|
+
|
|
835
|
+
Glob the project directory (`models/<project_name>/`) for `.py` and `.ipynb` files.
|
|
836
|
+
|
|
837
|
+
```
|
|
838
|
+
Task(
|
|
839
|
+
subagent_type="backend-engineer",
|
|
840
|
+
description="Python code review for [project_name]",
|
|
841
|
+
prompt="You are in SERVICE MODE. Review the Python files in the project at
|
|
842
|
+
models/[project_name]/. Read project-specs.md first for context.
|
|
843
|
+
Files to review: [list of .py files found, or 'none found — report N/A']"
|
|
844
|
+
)
|
|
845
|
+
```
|
|
846
|
+
|
|
847
|
+
Append the Backend Engineer's review to project-specs.md.
|
|
848
|
+
|
|
849
|
+
**After appending the Backend Engineer's review, branch on verdict:**
|
|
850
|
+
|
|
851
|
+
- **Clean or Minor Issues** → proceed directly to Syn review.
|
|
852
|
+
- **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.
|
|
853
|
+
- **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."
|
|
854
|
+
|
|
855
|
+
---
|
|
856
|
+
|
|
857
|
+
**MLOps Engineer consultation (serving infrastructure and deployment pipeline):**
|
|
858
|
+
|
|
859
|
+
Tell the user: "Before Syn signs off, I'm asking the MLOps Engineer to validate
|
|
860
|
+
the serving infrastructure and deployment pipeline. They care about what it takes
|
|
861
|
+
to actually operate this model."
|
|
862
|
+
|
|
863
|
+
```
|
|
864
|
+
Task(
|
|
865
|
+
subagent_type="mlops-engineer",
|
|
866
|
+
description="Serving infrastructure review for ML project: [project_name]",
|
|
867
|
+
prompt="I am the ML Engineer shard. I have designed a production ML system for
|
|
868
|
+
project [project_name] and need an infrastructure and operationalization review.
|
|
869
|
+
|
|
870
|
+
Project directory: models/<project_name>/
|
|
871
|
+
Specs: models/<project_name>/project-specs.md
|
|
872
|
+
|
|
873
|
+
Summary:
|
|
874
|
+
- Model type: <final model type from Phase 4>
|
|
875
|
+
- Inference requirements: <latency, throughput from Phase 6>
|
|
876
|
+
- Serving format: <from Phase 6 production considerations>
|
|
877
|
+
- Feature pipeline: <from Phase 6>
|
|
878
|
+
- Retraining trigger: <from Phase 6>
|
|
879
|
+
|
|
880
|
+
Please review:
|
|
881
|
+
1. Is the proposed serving infrastructure appropriate for the latency and
|
|
882
|
+
throughput requirements?
|
|
883
|
+
2. Are there gaps in the CI/CD and model registry design?
|
|
884
|
+
3. Is the monitoring and alerting plan sufficient for production operation?
|
|
885
|
+
4. Are the retraining triggers and automation plan feasible?
|
|
886
|
+
5. What would you need from me to stand up this deployment?
|
|
887
|
+
|
|
888
|
+
Please read project-specs.md for full context."
|
|
889
|
+
)
|
|
890
|
+
```
|
|
891
|
+
|
|
892
|
+
Append MLOps Engineer's review to specs. Present to user.
|
|
893
|
+
|
|
894
|
+
**Before finalizing**, invoke Syn for final review:
|
|
895
|
+
|
|
896
|
+
Tell the user: "I'm asking Syn to review the full project specs before we ship this..."
|
|
897
|
+
|
|
898
|
+
```
|
|
899
|
+
Task(
|
|
900
|
+
subagent_type="syn",
|
|
901
|
+
description="Final review of ML engineering project",
|
|
902
|
+
prompt="I am the ML Engineer shard. I've completed all phases for project
|
|
903
|
+
[project_name]. Please review the project-specs.md at [file_path] and provide
|
|
904
|
+
your final review verdict. This is an ML engineering project — check for:
|
|
905
|
+
business alignment, methodology soundness, infrastructure readiness,
|
|
906
|
+
monitoring plan, and rollback strategy."
|
|
907
|
+
)
|
|
908
|
+
```
|
|
909
|
+
|
|
910
|
+
Append Syn's review to specs. Present to user.
|
|
911
|
+
|
|
912
|
+
**If Syn returns NEEDS REVISION:**
|
|
913
|
+
1. Address the specific issues Syn flagged.
|
|
914
|
+
2. Update project-specs.md with the changes.
|
|
915
|
+
3. Re-gate with the user: "Syn flagged [N] issues. Here's what I changed: [summary]. Confirm to resubmit?"
|
|
916
|
+
4. Resubmit to Syn ONCE more.
|
|
917
|
+
|
|
918
|
+
**If Syn returns NEEDS REVISION a second time:**
|
|
919
|
+
Do not resubmit again. Instead, present to the user:
|
|
920
|
+
"Syn has flagged concerns twice. Here is the current conflict:
|
|
921
|
+
- Syn's concern: [verbatim from Syn's second review]
|
|
922
|
+
- Current state of specs: [summary of what's documented]
|
|
923
|
+
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."
|
|
924
|
+
|
|
925
|
+
Document the outcome in specs:
|
|
926
|
+
**Syn review resolution:** Approved | Approved on resubmit | User override — <rationale> | Project stopped
|
|
927
|
+
|
|
928
|
+
If Syn's review includes a "Code Review" section with `Code artifacts found: Yes`:
|
|
929
|
+
- Tell the user: "Syn spotted [N] code file(s) it can review. Want a code pass? (y/n)"
|
|
930
|
+
- If yes, invoke:
|
|
931
|
+
|
|
932
|
+
```
|
|
933
|
+
Task(
|
|
934
|
+
subagent_type="syn",
|
|
935
|
+
description="Code review and fix for ML engineering project",
|
|
936
|
+
prompt="CODE REVIEW MODE. I am the ML Engineer shard. Project: [project_name].
|
|
937
|
+
Directory: [project_dir]. Please review and fix the code artifacts produced
|
|
938
|
+
in this project. The project-specs.md is at [file_path] for context."
|
|
939
|
+
)
|
|
940
|
+
```
|
|
941
|
+
|
|
942
|
+
Append Syn's code review summary to the specs. Present findings to user.
|
|
943
|
+
|
|
944
|
+
Then:
|
|
945
|
+
|
|
946
|
+
1. **Generate Model Card** — Assemble a structured model card for stakeholder
|
|
947
|
+
sharing. Read `project-specs.md` to extract: ML system type and description
|
|
948
|
+
(Phase 1), data sources (Phase 3), model design and evaluation strategy
|
|
949
|
+
(Phase 4), feature engineering (Phase 5), build results (Phase 6), review
|
|
950
|
+
verdicts (Phase 7). Read `eval-results.json` for quantitative metrics.
|
|
951
|
+
|
|
952
|
+
Consult the Academic shard for ethical considerations:
|
|
953
|
+
|
|
954
|
+
```
|
|
955
|
+
Task(
|
|
956
|
+
subagent_type="academic",
|
|
957
|
+
description="Ethical considerations for model card",
|
|
958
|
+
prompt="I am the ML Engineer shard generating a model card for project
|
|
959
|
+
[project_name]. The model is: [1-2 sentence description from Phase 1].
|
|
960
|
+
End users of the model's output: [from Phase 1]. Model type: [from Phase 4].
|
|
961
|
+
Training data: [summary from Phase 3].
|
|
962
|
+
Please provide 2-4 ethical considerations and recommended mitigations
|
|
963
|
+
for the model card's Ethical Considerations section. Be specific to
|
|
964
|
+
this model's use case. Keep it concise — bullet points preferred."
|
|
965
|
+
)
|
|
966
|
+
```
|
|
967
|
+
|
|
968
|
+
If the Academic shard is unavailable, populate ethical considerations based
|
|
969
|
+
on the fairness and bias considerations from the model design phase and note
|
|
970
|
+
that a formal ethics review was not completed.
|
|
971
|
+
|
|
972
|
+
Write `model-card.json` to:
|
|
973
|
+
- Greenfield: `models/<name>/model-card.json`
|
|
974
|
+
- Iteration: `<existing_service_dir>/model-card.json`
|
|
975
|
+
|
|
976
|
+
The JSON must conform to the schema defined in
|
|
977
|
+
`templates/model-card-schema.json` (JSON Schema, draft 2020-12).
|
|
978
|
+
See `templates/model-card-schema.md` for an annotated example and
|
|
979
|
+
field notes.
|
|
980
|
+
|
|
981
|
+
ML-engineer-specific overrides:
|
|
982
|
+
- `generatedBy`: `"ml-engineer"`.
|
|
983
|
+
- `evalSummary.cost.per1kTokens`: `null` unless the model is an LLM.
|
|
984
|
+
- `modelDetails.type`: e.g. `"LightGBM classifier"`, `"XGBoost regressor"`,
|
|
985
|
+
`"scikit-learn pipeline"`.
|
|
986
|
+
|
|
987
|
+
If the Shards UI is active (`.shards/ui.port` file exists), push the model
|
|
988
|
+
card panel:
|
|
989
|
+
```bash
|
|
990
|
+
node .shards/ui/ui-push.js model-card \
|
|
991
|
+
--title "Model Card: <project_name>" \
|
|
992
|
+
--agent "ml-engineer" \
|
|
993
|
+
--panel-id "mc-<project_name>" \
|
|
994
|
+
--source "<path_to>/model-card.json"
|
|
995
|
+
```
|
|
996
|
+
|
|
997
|
+
2. **Write a report** to:
|
|
998
|
+
- Greenfield: `models/<name>/report.md`
|
|
999
|
+
- Iteration: `<existing_service_dir>/report.md`
|
|
1000
|
+
- Executive summary: business problem, solution, key results
|
|
1001
|
+
- Model performance: baseline vs. final, with business interpretation
|
|
1002
|
+
- Infrastructure plan: serving, monitoring, rollback
|
|
1003
|
+
- Deployment checklist: what needs to happen to go live
|
|
1004
|
+
- Risks and mitigations
|
|
1005
|
+
|
|
1006
|
+
2. Summarize top findings in 3-5 bullet points
|
|
1007
|
+
3. Present deployment checklist
|
|
1008
|
+
4. Flag risks, open questions, and dependencies
|
|
1009
|
+
5. Confirm the deliverable meets the definition of done
|
|
1010
|
+
|
|
1011
|
+
**MLOps handoff:** If the user wants to proceed to deployment, tell them:
|
|
1012
|
+
"To deploy and operate this model, run `/mlops-engineer` and reference
|
|
1013
|
+
`models/<project_name>/` as the model handoff directory."
|
|
1014
|
+
|
|
1015
|
+
**BI monitoring dashboard handoff:** See `.claude/agents/specific_instructions/ml_engineer/bi_engineer_handoff.md` for the full handoff instructions (Phase 7 section).
|
|
1016
|
+
|
|
1017
|
+
**Knowledge harvest.** Before closing, extract reusable knowledge from this project.
|
|
1018
|
+
Read `.claude/agents/specific_instructions/shared/knowledge_harvest.md` and follow
|
|
1019
|
+
the protocol. Present candidates to the user for confirmation before writing.
|
|
1020
|
+
|
|
1021
|
+
### Document Phase 7
|
|
1022
|
+
|
|
1023
|
+
```markdown
|
|
1024
|
+
---
|
|
1025
|
+
|
|
1026
|
+
## Phase 7: Review and Handoff (ML Engineer)
|
|
1027
|
+
- **Backend Engineer Review:** <summary or N/A — list files reviewed, overall verdict>
|
|
1028
|
+
- **MLOps Engineer Review:**
|
|
1029
|
+
- Verdict: Approved | Concerns | Redesign needed
|
|
1030
|
+
- Notes: <summary of infrastructure feedback>
|
|
1031
|
+
- **Syn Review:** <included above>
|
|
1032
|
+
- **Syn review resolution:** Approved | Approved on resubmit | User override — <rationale> | Project stopped
|
|
1033
|
+
- **Model card:** <file path to model-card.json>
|
|
1034
|
+
- **Report location:** <file path>
|
|
1035
|
+
- **Model summary:**
|
|
1036
|
+
- Type: <final model type>
|
|
1037
|
+
- Key metric: <metric> = <value> (business interpretation)
|
|
1038
|
+
- Model size: <X>MB | Inference: <X>ms
|
|
1039
|
+
- **Deployment checklist:**
|
|
1040
|
+
- [ ] Training pipeline deployed and tested
|
|
1041
|
+
- [ ] Model registered in model registry
|
|
1042
|
+
- [ ] Serving endpoint deployed (shadow mode first)
|
|
1043
|
+
- [ ] Monitoring dashboards configured
|
|
1044
|
+
- [ ] Alerting thresholds set
|
|
1045
|
+
- [ ] Rollback procedure documented and tested
|
|
1046
|
+
- [ ] A/B test or shadow mode plan approved
|
|
1047
|
+
- [ ] Feature pipeline SLA confirmed
|
|
1048
|
+
- **Risks:**
|
|
1049
|
+
- <risk>: <mitigation>
|
|
1050
|
+
- **Dependencies:**
|
|
1051
|
+
- <dependency>: <owner and status>
|
|
1052
|
+
- **Open questions:**
|
|
1053
|
+
- <question>
|
|
1054
|
+
- **Original request fulfilled:** Yes | Partially | No — <explanation>
|
|
1055
|
+
- **BI dashboard handoff:** Yes — models/<project_name>/bi_engineer_handoff.md | No
|
|
1056
|
+
- **Knowledge harvested:**
|
|
1057
|
+
- <title> → .shards/knowledge/<type>/<filename>.md
|
|
1058
|
+
- Or: None — project did not produce reusable knowledge
|
|
1059
|
+
- **Status:** Complete
|
|
1060
|
+
```
|
|
1061
|
+
|
|
1062
|
+
Update specs header status to `Complete`.
|
|
1063
|
+
|
|
1064
|
+
::GATE:: id=specific-instructions-ml-engineer-phases-phase7 phase=7 kind=final
|
|
1065
|
+
Read this final section back to the user. Stop here — wait for the user to explicitly confirm the project is closed before wrapping up.
|
|
1066
|
+
::ENDGATE::
|
|
1067
|
+
|
|
1068
|
+
---
|