claude-turing 4.6.0 → 4.8.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 (333) hide show
  1. package/.claude-plugin/plugin.json +2 -2
  2. package/README.md +1 -1
  3. package/commands/ablate.md +0 -1
  4. package/commands/annotate.md +0 -1
  5. package/commands/archive.md +0 -1
  6. package/commands/audit.md +0 -1
  7. package/commands/baseline.md +0 -1
  8. package/commands/brief.md +0 -1
  9. package/commands/budget.md +0 -1
  10. package/commands/calibrate.md +0 -1
  11. package/commands/card.md +0 -1
  12. package/commands/changelog.md +0 -1
  13. package/commands/checkpoint.md +0 -1
  14. package/commands/cite.md +0 -1
  15. package/commands/compare.md +0 -1
  16. package/commands/counterfactual.md +0 -1
  17. package/commands/curriculum.md +0 -1
  18. package/commands/design.md +0 -1
  19. package/commands/diagnose.md +0 -1
  20. package/commands/diff.md +0 -1
  21. package/commands/distill.md +0 -1
  22. package/commands/doctor.md +0 -1
  23. package/commands/ensemble.md +0 -1
  24. package/commands/explore.md +0 -1
  25. package/commands/export.md +0 -1
  26. package/commands/feature.md +0 -1
  27. package/commands/flashback.md +0 -1
  28. package/commands/fork.md +0 -1
  29. package/commands/frontier.md +0 -1
  30. package/commands/init.md +0 -1
  31. package/commands/leak.md +0 -1
  32. package/commands/lit.md +0 -1
  33. package/commands/logbook.md +0 -1
  34. package/commands/merge.md +0 -1
  35. package/commands/mode.md +0 -1
  36. package/commands/onboard.md +0 -1
  37. package/commands/paper.md +0 -1
  38. package/commands/plan.md +0 -1
  39. package/commands/poster.md +0 -1
  40. package/commands/postmortem.md +0 -1
  41. package/commands/preflight.md +0 -1
  42. package/commands/present.md +0 -1
  43. package/commands/profile.md +0 -1
  44. package/commands/prune.md +0 -1
  45. package/commands/quantize.md +0 -1
  46. package/commands/queue.md +0 -1
  47. package/commands/registry.md +0 -1
  48. package/commands/regress.md +0 -1
  49. package/commands/replay.md +0 -1
  50. package/commands/report.md +0 -1
  51. package/commands/reproduce.md +0 -1
  52. package/commands/retry.md +0 -1
  53. package/commands/review.md +0 -1
  54. package/commands/sanity.md +0 -1
  55. package/commands/scale.md +0 -1
  56. package/commands/search.md +0 -1
  57. package/commands/seed.md +0 -1
  58. package/commands/sensitivity.md +0 -1
  59. package/commands/share.md +0 -1
  60. package/commands/simulate.md +0 -1
  61. package/commands/status.md +0 -1
  62. package/commands/stitch.md +0 -1
  63. package/commands/suggest.md +0 -1
  64. package/commands/surgery.md +0 -1
  65. package/commands/sweep.md +0 -1
  66. package/commands/template.md +0 -1
  67. package/commands/train.md +0 -1
  68. package/commands/transfer.md +0 -1
  69. package/commands/trend.md +0 -1
  70. package/commands/try.md +0 -1
  71. package/commands/turing.md +3 -3
  72. package/commands/update.md +0 -1
  73. package/commands/validate.md +0 -1
  74. package/commands/warm.md +0 -1
  75. package/commands/watch.md +0 -1
  76. package/commands/whatif.md +0 -1
  77. package/commands/xray.md +0 -1
  78. package/config/commands.yaml +74 -74
  79. package/package.json +10 -3
  80. package/skills/turing/SKILL.md +180 -0
  81. package/skills/turing/ablate/SKILL.md +46 -0
  82. package/skills/turing/annotate/SKILL.md +22 -0
  83. package/skills/turing/archive/SKILL.md +22 -0
  84. package/skills/turing/audit/SKILL.md +55 -0
  85. package/skills/turing/baseline/SKILL.md +44 -0
  86. package/skills/turing/brief/SKILL.md +94 -0
  87. package/skills/turing/budget/SKILL.md +51 -0
  88. package/skills/turing/calibrate/SKILL.md +46 -0
  89. package/skills/turing/card/SKILL.md +35 -0
  90. package/skills/turing/changelog/SKILL.md +21 -0
  91. package/skills/turing/checkpoint/SKILL.md +46 -0
  92. package/skills/turing/cite/SKILL.md +22 -0
  93. package/skills/turing/compare/SKILL.md +23 -0
  94. package/skills/turing/counterfactual/SKILL.md +26 -0
  95. package/skills/turing/curriculum/SKILL.md +42 -0
  96. package/skills/turing/design/SKILL.md +96 -0
  97. package/skills/turing/diagnose/SKILL.md +51 -0
  98. package/skills/turing/diff/SKILL.md +47 -0
  99. package/skills/turing/distill/SKILL.md +55 -0
  100. package/skills/turing/doctor/SKILL.md +30 -0
  101. package/skills/turing/ensemble/SKILL.md +53 -0
  102. package/skills/turing/explore/SKILL.md +106 -0
  103. package/skills/turing/export/SKILL.md +47 -0
  104. package/skills/turing/feature/SKILL.md +41 -0
  105. package/skills/turing/flashback/SKILL.md +21 -0
  106. package/skills/turing/fork/SKILL.md +39 -0
  107. package/skills/turing/frontier/SKILL.md +44 -0
  108. package/skills/turing/init/SKILL.md +153 -0
  109. package/skills/turing/leak/SKILL.md +46 -0
  110. package/skills/turing/lit/SKILL.md +46 -0
  111. package/skills/turing/logbook/SKILL.md +50 -0
  112. package/skills/turing/merge/SKILL.md +23 -0
  113. package/skills/turing/mode/SKILL.md +42 -0
  114. package/skills/turing/onboard/SKILL.md +19 -0
  115. package/skills/turing/paper/SKILL.md +43 -0
  116. package/skills/turing/plan/SKILL.md +26 -0
  117. package/skills/turing/poster/SKILL.md +88 -0
  118. package/skills/turing/postmortem/SKILL.md +27 -0
  119. package/skills/turing/preflight/SKILL.md +74 -0
  120. package/skills/turing/present/SKILL.md +22 -0
  121. package/skills/turing/profile/SKILL.md +42 -0
  122. package/skills/turing/prune/SKILL.md +25 -0
  123. package/skills/turing/quantize/SKILL.md +23 -0
  124. package/skills/turing/queue/SKILL.md +47 -0
  125. package/skills/turing/registry/SKILL.md +30 -0
  126. package/skills/turing/regress/SKILL.md +52 -0
  127. package/skills/turing/replay/SKILL.md +22 -0
  128. package/skills/turing/report/SKILL.md +96 -0
  129. package/skills/turing/reproduce/SKILL.md +47 -0
  130. package/skills/turing/retry/SKILL.md +40 -0
  131. package/skills/turing/review/SKILL.md +19 -0
  132. package/skills/turing/rules/loop-protocol.md +91 -0
  133. package/skills/turing/sanity/SKILL.md +47 -0
  134. package/skills/turing/scale/SKILL.md +54 -0
  135. package/skills/turing/search/SKILL.md +21 -0
  136. package/skills/turing/seed/SKILL.md +46 -0
  137. package/skills/turing/sensitivity/SKILL.md +40 -0
  138. package/skills/turing/share/SKILL.md +19 -0
  139. package/skills/turing/simulate/SKILL.md +27 -0
  140. package/skills/turing/status/SKILL.md +23 -0
  141. package/skills/turing/stitch/SKILL.md +48 -0
  142. package/skills/turing/suggest/SKILL.md +158 -0
  143. package/skills/turing/surgery/SKILL.md +26 -0
  144. package/skills/turing/sweep/SKILL.md +44 -0
  145. package/skills/turing/template/SKILL.md +21 -0
  146. package/skills/turing/train/SKILL.md +74 -0
  147. package/skills/turing/transfer/SKILL.md +53 -0
  148. package/skills/turing/trend/SKILL.md +20 -0
  149. package/skills/turing/try/SKILL.md +62 -0
  150. package/skills/turing/update/SKILL.md +26 -0
  151. package/skills/turing/validate/SKILL.md +33 -0
  152. package/skills/turing/warm/SKILL.md +52 -0
  153. package/skills/turing/watch/SKILL.md +59 -0
  154. package/skills/turing/whatif/SKILL.md +30 -0
  155. package/skills/turing/xray/SKILL.md +42 -0
  156. package/src/command-registry.js +21 -0
  157. package/src/install.js +4 -3
  158. package/src/sync-commands-layout.js +149 -0
  159. package/src/sync-skills-layout.js +20 -0
  160. package/templates/__pycache__/evaluate.cpython-312.pyc +0 -0
  161. package/templates/__pycache__/evaluate.cpython-314.pyc +0 -0
  162. package/templates/__pycache__/prepare.cpython-312.pyc +0 -0
  163. package/templates/__pycache__/prepare.cpython-314.pyc +0 -0
  164. package/templates/features/__pycache__/__init__.cpython-312.pyc +0 -0
  165. package/templates/features/__pycache__/__init__.cpython-314.pyc +0 -0
  166. package/templates/features/__pycache__/featurizers.cpython-312.pyc +0 -0
  167. package/templates/features/__pycache__/featurizers.cpython-314.pyc +0 -0
  168. package/templates/scripts/__pycache__/__init__.cpython-312.pyc +0 -0
  169. package/templates/scripts/__pycache__/__init__.cpython-314.pyc +0 -0
  170. package/templates/scripts/__pycache__/ablation_study.cpython-312.pyc +0 -0
  171. package/templates/scripts/__pycache__/ablation_study.cpython-314.pyc +0 -0
  172. package/templates/scripts/__pycache__/architecture_surgery.cpython-312.pyc +0 -0
  173. package/templates/scripts/__pycache__/architecture_surgery.cpython-314.pyc +0 -0
  174. package/templates/scripts/__pycache__/budget_manager.cpython-312.pyc +0 -0
  175. package/templates/scripts/__pycache__/budget_manager.cpython-314.pyc +0 -0
  176. package/templates/scripts/__pycache__/build_ensemble.cpython-312.pyc +0 -0
  177. package/templates/scripts/__pycache__/build_ensemble.cpython-314.pyc +0 -0
  178. package/templates/scripts/__pycache__/calibration.cpython-312.pyc +0 -0
  179. package/templates/scripts/__pycache__/calibration.cpython-314.pyc +0 -0
  180. package/templates/scripts/__pycache__/check_convergence.cpython-312.pyc +0 -0
  181. package/templates/scripts/__pycache__/check_convergence.cpython-314.pyc +0 -0
  182. package/templates/scripts/__pycache__/checkpoint_manager.cpython-312.pyc +0 -0
  183. package/templates/scripts/__pycache__/checkpoint_manager.cpython-314.pyc +0 -0
  184. package/templates/scripts/__pycache__/citation_manager.cpython-312.pyc +0 -0
  185. package/templates/scripts/__pycache__/citation_manager.cpython-314.pyc +0 -0
  186. package/templates/scripts/__pycache__/cost_frontier.cpython-312.pyc +0 -0
  187. package/templates/scripts/__pycache__/cost_frontier.cpython-314.pyc +0 -0
  188. package/templates/scripts/__pycache__/counterfactual_explanation.cpython-312.pyc +0 -0
  189. package/templates/scripts/__pycache__/counterfactual_explanation.cpython-314.pyc +0 -0
  190. package/templates/scripts/__pycache__/critique_hypothesis.cpython-312.pyc +0 -0
  191. package/templates/scripts/__pycache__/critique_hypothesis.cpython-314.pyc +0 -0
  192. package/templates/scripts/__pycache__/curriculum_optimizer.cpython-312.pyc +0 -0
  193. package/templates/scripts/__pycache__/curriculum_optimizer.cpython-314.pyc +0 -0
  194. package/templates/scripts/__pycache__/diagnose_errors.cpython-312.pyc +0 -0
  195. package/templates/scripts/__pycache__/diagnose_errors.cpython-314.pyc +0 -0
  196. package/templates/scripts/__pycache__/draft_paper_sections.cpython-312.pyc +0 -0
  197. package/templates/scripts/__pycache__/draft_paper_sections.cpython-314.pyc +0 -0
  198. package/templates/scripts/__pycache__/equivalence_checker.cpython-312.pyc +0 -0
  199. package/templates/scripts/__pycache__/equivalence_checker.cpython-314.pyc +0 -0
  200. package/templates/scripts/__pycache__/experiment_annotations.cpython-312.pyc +0 -0
  201. package/templates/scripts/__pycache__/experiment_annotations.cpython-314.pyc +0 -0
  202. package/templates/scripts/__pycache__/experiment_archive.cpython-312.pyc +0 -0
  203. package/templates/scripts/__pycache__/experiment_archive.cpython-314.pyc +0 -0
  204. package/templates/scripts/__pycache__/experiment_diff.cpython-312.pyc +0 -0
  205. package/templates/scripts/__pycache__/experiment_diff.cpython-314.pyc +0 -0
  206. package/templates/scripts/__pycache__/experiment_index.cpython-312.pyc +0 -0
  207. package/templates/scripts/__pycache__/experiment_index.cpython-314.pyc +0 -0
  208. package/templates/scripts/__pycache__/experiment_queue.cpython-312.pyc +0 -0
  209. package/templates/scripts/__pycache__/experiment_queue.cpython-314.pyc +0 -0
  210. package/templates/scripts/__pycache__/experiment_replay.cpython-312.pyc +0 -0
  211. package/templates/scripts/__pycache__/experiment_replay.cpython-314.pyc +0 -0
  212. package/templates/scripts/__pycache__/experiment_search.cpython-312.pyc +0 -0
  213. package/templates/scripts/__pycache__/experiment_search.cpython-314.pyc +0 -0
  214. package/templates/scripts/__pycache__/experiment_simulator.cpython-312.pyc +0 -0
  215. package/templates/scripts/__pycache__/experiment_simulator.cpython-314.pyc +0 -0
  216. package/templates/scripts/__pycache__/experiment_templates.cpython-312.pyc +0 -0
  217. package/templates/scripts/__pycache__/experiment_templates.cpython-314.pyc +0 -0
  218. package/templates/scripts/__pycache__/export_card.cpython-312.pyc +0 -0
  219. package/templates/scripts/__pycache__/export_card.cpython-314.pyc +0 -0
  220. package/templates/scripts/__pycache__/export_formats.cpython-312.pyc +0 -0
  221. package/templates/scripts/__pycache__/export_formats.cpython-314.pyc +0 -0
  222. package/templates/scripts/__pycache__/failure_postmortem.cpython-312.pyc +0 -0
  223. package/templates/scripts/__pycache__/failure_postmortem.cpython-314.pyc +0 -0
  224. package/templates/scripts/__pycache__/feature_intelligence.cpython-312.pyc +0 -0
  225. package/templates/scripts/__pycache__/feature_intelligence.cpython-314.pyc +0 -0
  226. package/templates/scripts/__pycache__/fork_experiment.cpython-312.pyc +0 -0
  227. package/templates/scripts/__pycache__/fork_experiment.cpython-314.pyc +0 -0
  228. package/templates/scripts/__pycache__/generate_baselines.cpython-312.pyc +0 -0
  229. package/templates/scripts/__pycache__/generate_baselines.cpython-314.pyc +0 -0
  230. package/templates/scripts/__pycache__/generate_brief.cpython-312.pyc +0 -0
  231. package/templates/scripts/__pycache__/generate_brief.cpython-314.pyc +0 -0
  232. package/templates/scripts/__pycache__/generate_changelog.cpython-312.pyc +0 -0
  233. package/templates/scripts/__pycache__/generate_changelog.cpython-314.pyc +0 -0
  234. package/templates/scripts/__pycache__/generate_figures.cpython-312.pyc +0 -0
  235. package/templates/scripts/__pycache__/generate_figures.cpython-314.pyc +0 -0
  236. package/templates/scripts/__pycache__/generate_logbook.cpython-312.pyc +0 -0
  237. package/templates/scripts/__pycache__/generate_logbook.cpython-314.pyc +0 -0
  238. package/templates/scripts/__pycache__/generate_model_card.cpython-312.pyc +0 -0
  239. package/templates/scripts/__pycache__/generate_model_card.cpython-314.pyc +0 -0
  240. package/templates/scripts/__pycache__/generate_onboarding.cpython-312.pyc +0 -0
  241. package/templates/scripts/__pycache__/generate_onboarding.cpython-314.pyc +0 -0
  242. package/templates/scripts/__pycache__/harness_doctor.cpython-312.pyc +0 -0
  243. package/templates/scripts/__pycache__/harness_doctor.cpython-314.pyc +0 -0
  244. package/templates/scripts/__pycache__/incremental_update.cpython-312.pyc +0 -0
  245. package/templates/scripts/__pycache__/incremental_update.cpython-314.pyc +0 -0
  246. package/templates/scripts/__pycache__/knowledge_transfer.cpython-312.pyc +0 -0
  247. package/templates/scripts/__pycache__/knowledge_transfer.cpython-314.pyc +0 -0
  248. package/templates/scripts/__pycache__/latency_benchmark.cpython-312.pyc +0 -0
  249. package/templates/scripts/__pycache__/latency_benchmark.cpython-314.pyc +0 -0
  250. package/templates/scripts/__pycache__/leakage_detector.cpython-312.pyc +0 -0
  251. package/templates/scripts/__pycache__/leakage_detector.cpython-314.pyc +0 -0
  252. package/templates/scripts/__pycache__/literature_search.cpython-312.pyc +0 -0
  253. package/templates/scripts/__pycache__/literature_search.cpython-314.pyc +0 -0
  254. package/templates/scripts/__pycache__/log_experiment.cpython-312.pyc +0 -0
  255. package/templates/scripts/__pycache__/log_experiment.cpython-314.pyc +0 -0
  256. package/templates/scripts/__pycache__/manage_hypotheses.cpython-312.pyc +0 -0
  257. package/templates/scripts/__pycache__/manage_hypotheses.cpython-314.pyc +0 -0
  258. package/templates/scripts/__pycache__/methodology_audit.cpython-312.pyc +0 -0
  259. package/templates/scripts/__pycache__/methodology_audit.cpython-314.pyc +0 -0
  260. package/templates/scripts/__pycache__/model_distiller.cpython-312.pyc +0 -0
  261. package/templates/scripts/__pycache__/model_distiller.cpython-314.pyc +0 -0
  262. package/templates/scripts/__pycache__/model_lifecycle.cpython-312.pyc +0 -0
  263. package/templates/scripts/__pycache__/model_lifecycle.cpython-314.pyc +0 -0
  264. package/templates/scripts/__pycache__/model_merger.cpython-312.pyc +0 -0
  265. package/templates/scripts/__pycache__/model_merger.cpython-314.pyc +0 -0
  266. package/templates/scripts/__pycache__/model_pruning.cpython-312.pyc +0 -0
  267. package/templates/scripts/__pycache__/model_pruning.cpython-314.pyc +0 -0
  268. package/templates/scripts/__pycache__/model_quantization.cpython-312.pyc +0 -0
  269. package/templates/scripts/__pycache__/model_quantization.cpython-314.pyc +0 -0
  270. package/templates/scripts/__pycache__/model_xray.cpython-312.pyc +0 -0
  271. package/templates/scripts/__pycache__/model_xray.cpython-314.pyc +0 -0
  272. package/templates/scripts/__pycache__/novelty_guard.cpython-312.pyc +0 -0
  273. package/templates/scripts/__pycache__/novelty_guard.cpython-314.pyc +0 -0
  274. package/templates/scripts/__pycache__/package_experiments.cpython-312.pyc +0 -0
  275. package/templates/scripts/__pycache__/package_experiments.cpython-314.pyc +0 -0
  276. package/templates/scripts/__pycache__/pareto_frontier.cpython-312.pyc +0 -0
  277. package/templates/scripts/__pycache__/pareto_frontier.cpython-314.pyc +0 -0
  278. package/templates/scripts/__pycache__/parse_metrics.cpython-312.pyc +0 -0
  279. package/templates/scripts/__pycache__/parse_metrics.cpython-314.pyc +0 -0
  280. package/templates/scripts/__pycache__/pipeline_manager.cpython-312.pyc +0 -0
  281. package/templates/scripts/__pycache__/pipeline_manager.cpython-314.pyc +0 -0
  282. package/templates/scripts/__pycache__/profile_training.cpython-312.pyc +0 -0
  283. package/templates/scripts/__pycache__/profile_training.cpython-314.pyc +0 -0
  284. package/templates/scripts/__pycache__/regression_gate.cpython-312.pyc +0 -0
  285. package/templates/scripts/__pycache__/regression_gate.cpython-314.pyc +0 -0
  286. package/templates/scripts/__pycache__/reproduce_experiment.cpython-312.pyc +0 -0
  287. package/templates/scripts/__pycache__/reproduce_experiment.cpython-314.pyc +0 -0
  288. package/templates/scripts/__pycache__/research_planner.cpython-312.pyc +0 -0
  289. package/templates/scripts/__pycache__/research_planner.cpython-314.pyc +0 -0
  290. package/templates/scripts/__pycache__/sanity_checks.cpython-312.pyc +0 -0
  291. package/templates/scripts/__pycache__/sanity_checks.cpython-314.pyc +0 -0
  292. package/templates/scripts/__pycache__/scaffold.cpython-312.pyc +0 -0
  293. package/templates/scripts/__pycache__/scaffold.cpython-314.pyc +0 -0
  294. package/templates/scripts/__pycache__/scaling_estimator.cpython-312.pyc +0 -0
  295. package/templates/scripts/__pycache__/scaling_estimator.cpython-314.pyc +0 -0
  296. package/templates/scripts/__pycache__/seed_runner.cpython-312.pyc +0 -0
  297. package/templates/scripts/__pycache__/seed_runner.cpython-314.pyc +0 -0
  298. package/templates/scripts/__pycache__/sensitivity_analysis.cpython-312.pyc +0 -0
  299. package/templates/scripts/__pycache__/sensitivity_analysis.cpython-314.pyc +0 -0
  300. package/templates/scripts/__pycache__/session_flashback.cpython-312.pyc +0 -0
  301. package/templates/scripts/__pycache__/session_flashback.cpython-314.pyc +0 -0
  302. package/templates/scripts/__pycache__/show_experiment_tree.cpython-312.pyc +0 -0
  303. package/templates/scripts/__pycache__/show_experiment_tree.cpython-314.pyc +0 -0
  304. package/templates/scripts/__pycache__/show_families.cpython-312.pyc +0 -0
  305. package/templates/scripts/__pycache__/show_families.cpython-314.pyc +0 -0
  306. package/templates/scripts/__pycache__/simulate_review.cpython-312.pyc +0 -0
  307. package/templates/scripts/__pycache__/simulate_review.cpython-314.pyc +0 -0
  308. package/templates/scripts/__pycache__/smart_retry.cpython-312.pyc +0 -0
  309. package/templates/scripts/__pycache__/smart_retry.cpython-314.pyc +0 -0
  310. package/templates/scripts/__pycache__/statistical_compare.cpython-312.pyc +0 -0
  311. package/templates/scripts/__pycache__/statistical_compare.cpython-314.pyc +0 -0
  312. package/templates/scripts/__pycache__/suggest_next.cpython-312.pyc +0 -0
  313. package/templates/scripts/__pycache__/suggest_next.cpython-314.pyc +0 -0
  314. package/templates/scripts/__pycache__/sweep.cpython-312.pyc +0 -0
  315. package/templates/scripts/__pycache__/sweep.cpython-314.pyc +0 -0
  316. package/templates/scripts/__pycache__/synthesize_decision.cpython-312.pyc +0 -0
  317. package/templates/scripts/__pycache__/synthesize_decision.cpython-314.pyc +0 -0
  318. package/templates/scripts/__pycache__/training_monitor.cpython-312.pyc +0 -0
  319. package/templates/scripts/__pycache__/training_monitor.cpython-314.pyc +0 -0
  320. package/templates/scripts/__pycache__/treequest_suggest.cpython-312.pyc +0 -0
  321. package/templates/scripts/__pycache__/treequest_suggest.cpython-314.pyc +0 -0
  322. package/templates/scripts/__pycache__/trend_analysis.cpython-312.pyc +0 -0
  323. package/templates/scripts/__pycache__/trend_analysis.cpython-314.pyc +0 -0
  324. package/templates/scripts/__pycache__/turing_io.cpython-312.pyc +0 -0
  325. package/templates/scripts/__pycache__/turing_io.cpython-314.pyc +0 -0
  326. package/templates/scripts/__pycache__/update_state.cpython-312.pyc +0 -0
  327. package/templates/scripts/__pycache__/update_state.cpython-314.pyc +0 -0
  328. package/templates/scripts/__pycache__/verify_placeholders.cpython-312.pyc +0 -0
  329. package/templates/scripts/__pycache__/verify_placeholders.cpython-314.pyc +0 -0
  330. package/templates/scripts/__pycache__/warm_start.cpython-312.pyc +0 -0
  331. package/templates/scripts/__pycache__/warm_start.cpython-314.pyc +0 -0
  332. package/templates/scripts/__pycache__/whatif_engine.cpython-312.pyc +0 -0
  333. package/templates/scripts/__pycache__/whatif_engine.cpython-314.pyc +0 -0
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: train
3
+ description: Run the autonomous ML experiment loop. Iteratively hypothesizes, trains, evaluates, and decides — keeping only improvements. Implements the autoresearch pattern with formal convergence detection and git-disciplined rollback.
4
+ argument-hint: "[max_iterations]"
5
+ allowed-tools: Read, Write, Edit, Bash(python train.py:*, python scripts/*:*, git:*, source .venv/bin/activate:*, pip:*), Grep, Glob
6
+ ---
7
+
8
+ You are an autonomous ML researcher. Your goal: iteratively improve a model by following the experiment loop protocol — the scientific method applied to machine learning.
9
+
10
+ Read `program.md` in the ML project directory for the complete protocol. Follow it exactly.
11
+
12
+ ## Arguments
13
+
14
+ `$ARGUMENTS` — accepts a project path (e.g., `ml/coding`), a number for max_iterations, or both (e.g., `ml/coding 10`). If no number, run until convergence (as defined in `config.yaml` convergence settings).
15
+
16
+ ## Bootstrap Sequence
17
+
18
+ 0. **Detect project directory:**
19
+ - If `$ARGUMENTS` contains a path (e.g., `ml/coding`), use that as the project directory
20
+ - Else if cwd contains `config.yaml` and `train.py`, use cwd
21
+ - Else search for `ml/*/` subdirectories containing `config.yaml`
22
+ - If exactly one found, use it
23
+ - If multiple found, list them and ask the user which to target
24
+ - All subsequent commands run from the detected project directory
25
+ - Memory path: `.claude/agent-memory/ml-researcher-{project_name}/MEMORY.md`
26
+
27
+ 1. **Restore memory:** Read `.claude/agent-memory/ml-researcher-{project_name}/MEMORY.md` for prior observations and best results.
28
+ 2. **Read protocol:** Read `program.md` completely — it defines the experiment loop, constraints, and output format.
29
+ 3. **Bootstrap data:** Check for training data at `config.yaml` → `data.source`. If no splits exist, run `python prepare.py`.
30
+ 4. **Bootstrap venv:** `test -d .venv || (python3 -m venv .venv && source .venv/bin/activate && pip install -r requirements.txt)`
31
+ 5. **Assess state:** `source .venv/bin/activate && python scripts/show_metrics.py --last 5`
32
+ 6. **Begin the loop** from program.md.
33
+
34
+ ## The Loop
35
+
36
+ Each iteration follows the experiment lifecycle (`config/lifecycle.toml`):
37
+
38
+ ```
39
+ proposed -> running -> evaluating -> kept/discarded -> (next iteration)
40
+ ```
41
+
42
+ The agent proposes a hypothesis, executes it, measures the result against the immutable evaluation harness, and decides whether to keep or discard. Only improvements survive in git history.
43
+
44
+ ## Delegation
45
+
46
+ Use `@ml-evaluator` for analysis tasks. It is read-only (no Write/Edit) and cannot accidentally modify the pipeline.
47
+
48
+ ## Context Management
49
+
50
+ - Redirect all training output: `python train.py > run.log 2>&1`
51
+ - Parse metrics with grep, never read full output
52
+ - Persist observations to MEMORY.md after each experiment
53
+
54
+ ## Convergence
55
+
56
+ - Stop after `max_iterations` if provided
57
+ - Otherwise, stop after N consecutive non-improvements (`config.yaml` → `convergence.patience`)
58
+ - Report final best experiment and recommend next steps
59
+
60
+ ## /loop Integration
61
+
62
+ For fully hands-off training:
63
+ ```
64
+ /loop 5m /turing:train
65
+ ```
66
+
67
+ The Stop hook automatically detects convergence and halts the loop. Recommended intervals:
68
+ - `3m` — fast iterations, small datasets
69
+ - `5m` — standard training runs
70
+ - `10m` — deep training with large models
71
+
72
+ ## Rules
73
+
74
+ See `rules/loop-protocol.md` for safety constraints governing the experiment loop.
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: transfer
3
+ description: Cross-project knowledge transfer — find similar prior projects and surface what worked. Builds institutional ML memory.
4
+ argument-hint: "[--from project-path] [--auto]"
5
+ allowed-tools: Read, Bash(*), Grep, Glob
6
+ ---
7
+
8
+ Find similar prior projects and surface what worked. "Last time you had tabular classification with class imbalance, LightGBM beat everything by 3%."
9
+
10
+ ## Steps
11
+
12
+ 1. **Activate environment:**
13
+ ```bash
14
+ source .venv/bin/activate
15
+ ```
16
+
17
+ 2. **Parse arguments from `$ARGUMENTS`:**
18
+ - `--from ~/projects/fraud-detection` — transfer from a specific project
19
+ - `--auto` — auto-queue hypotheses from recommendations
20
+ - `--index ~/.turing/project_index.yaml` — custom index path
21
+ - `--json` — raw JSON output
22
+
23
+ 3. **Run knowledge transfer:**
24
+ ```bash
25
+ python scripts/knowledge_transfer.py $ARGUMENTS
26
+ ```
27
+
28
+ 4. **Report includes:**
29
+ - Similar prior projects ranked by similarity score
30
+ - Per project: task type, winner model, key insights
31
+ - Suggested hypotheses from winning strategies
32
+ - Auto-queued hypotheses (with `--auto`)
33
+
34
+ 5. **Similarity matching** uses:
35
+ - Task type (classification/regression) — highest weight
36
+ - Dataset size (log-scale comparison)
37
+ - Feature types (tabular/image/text)
38
+ - Class balance characteristics
39
+ - Dimensionality
40
+
41
+ 6. **Project index** at `~/.turing/project_index.yaml` — local only, never uploaded
42
+
43
+ 7. **If no similar projects found:** suggest running on more projects first or specifying one with `--from`
44
+
45
+ 8. **Saved output:** report in `experiments/transfers/transfer-*.yaml`
46
+
47
+ ## Examples
48
+
49
+ ```
50
+ /turing:transfer # Search index for similar projects
51
+ /turing:transfer --from ~/projects/fraud-detection # Transfer from specific project
52
+ /turing:transfer --auto # Auto-queue hypotheses
53
+ ```
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: trend
3
+ description: Long-term trend analysis — improvement velocity, family ROI, diminishing returns detection, strategic research direction.
4
+ argument-hint: "[--window 30d] [--metric accuracy]"
5
+ allowed-tools: Read, Bash(*), Grep, Glob
6
+ ---
7
+
8
+ See the arc of your research, not just the latest results. Strategic view over 100+ experiments.
9
+
10
+ ## Steps
11
+ 1. **Activate environment:** `source .venv/bin/activate`
12
+ 2. **Run:** `python scripts/trend_analysis.py $ARGUMENTS`
13
+ 3. **Report:** improvement velocity over time windows, family ROI ranking, diminishing returns prediction, phase transitions
14
+ 4. **Saved output:** `experiments/trends/trend-*.yaml`
15
+
16
+ ## Examples
17
+ ```
18
+ /turing:trend # Full trend analysis
19
+ /turing:trend --window 14d # Last 2 weeks
20
+ ```
@@ -0,0 +1,62 @@
1
+ ---
2
+ name: try
3
+ description: Inject a hypothesis into the agent's experiment queue. This is how research taste reaches the agent — the human selects which coins to flip, the agent flips them.
4
+ argument-hint: "<hypothesis description>"
5
+ allowed-tools: Read, Write, Edit, Bash(python scripts/*:*, source .venv/bin/activate:*), Grep, Glob
6
+ ---
7
+
8
+ Inject a human hypothesis into the experiment queue for the next `/turing:train` iteration.
9
+
10
+ This is the taste-leverage mechanism: you provide judgment about what's worth trying, the agent provides disciplined execution.
11
+
12
+ ## Steps
13
+
14
+ 1. **Parse the hypothesis** from `$ARGUMENTS`. If empty, ask the user what they want the agent to try.
15
+
16
+ 2. **Check for archetype syntax.** If the argument starts with `archetype:`, expand it:
17
+ ```bash
18
+ source .venv/bin/activate && python scripts/manage_hypotheses.py add --archetype <name> --priority high --source human
19
+ ```
20
+
21
+ Otherwise, use the raw description:
22
+ ```bash
23
+ source .venv/bin/activate && python scripts/manage_hypotheses.py add "$ARGUMENTS" --priority high --source human
24
+ ```
25
+
26
+ 3. **Confirm** with the hypothesis ID and instructions:
27
+ - "Queued as hyp-NNN (high priority, human-injected)"
28
+ - "The agent will prioritize this on the next `/turing:train` iteration"
29
+ - Show current queue: `python scripts/manage_hypotheses.py list --status queued`
30
+
31
+ ## Examples
32
+
33
+ ```
34
+ # Free-text hypotheses
35
+ /turing:try switch to LightGBM with dart boosting and lower learning rate
36
+ /turing:try add polynomial features for the numeric columns
37
+ /turing:try increase regularization, the train/val gap suggests overfitting
38
+
39
+ # Archetype-based structured strategies
40
+ /turing:try archetype:model_comparison
41
+ /turing:try archetype:feature_sweep
42
+ /turing:try archetype:ensemble_construction
43
+ /turing:try archetype:regularization_search
44
+ /turing:try archetype:ablation_study
45
+ ```
46
+
47
+ ## Available Archetypes
48
+
49
+ | Archetype | What it does | Expected experiments |
50
+ |-----------|-------------|---------------------|
51
+ | `model_comparison` | Compare XGBoost, LightGBM, RF, LR, MLP with statistical tests | ~5 |
52
+ | `hyperparameter_sweep` | Grid search with multi-seed validation | 15-36 |
53
+ | `feature_sweep` | Add/remove feature transforms one at a time | 6-10 |
54
+ | `regularization_search` | Binary search for optimal regularization | 4-6 |
55
+ | `ensemble_construction` | Voting, stacking, blending of top models | 4-6 |
56
+ | `learning_rate_schedule` | lr vs n_estimators tradeoff | 4-5 |
57
+ | `data_quality_audit` | Class balance, label noise, leakage checks | 3-5 |
58
+ | `ablation_study` | Remove features one at a time to measure importance | N+1 |
59
+
60
+ ## How It Connects
61
+
62
+ The `/turing:train` loop checks `hypotheses.yaml` during the OBSERVE step. Human-injected hypotheses (high priority) are tried before the agent generates its own. After testing, the hypothesis is marked as `tested`, `promising`, or `dead-end` with a link to the resulting experiment.
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: update
3
+ description: Incremental model update — add new data without full retraining, with forgetting detection.
4
+ argument-hint: "<exp-id> --new-data <path> [--replay-ratio 0.1] [--tolerance 0.005]"
5
+ allowed-tools: Read, Bash(*), Grep, Glob
6
+ ---
7
+
8
+ Add new data to an existing model without starting from scratch. Detects catastrophic forgetting.
9
+
10
+ ## Steps
11
+ 1. `source .venv/bin/activate`
12
+ 2. `python scripts/incremental_update.py $ARGUMENTS`
13
+ 3. **Saved:** `experiments/updates/`
14
+
15
+ ## Model-specific strategies
16
+ - **XGBoost/LightGBM:** continued boosting with additional rounds
17
+ - **Neural networks:** fine-tune with reduced LR + replay buffer from old data
18
+ - **scikit-learn:** partial_fit() or warm_start=True
19
+
20
+ ## Examples
21
+ ```
22
+ /turing:update exp-089 --new-data data/new_batch.csv
23
+ /turing:update exp-089 --new-data data/new.csv --replay-ratio 0.2
24
+ /turing:update exp-089 --new-data data/new.csv --tolerance 0.01
25
+ /turing:update exp-089 --new-data data/new.csv --json
26
+ ```
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: validate
3
+ description: Run stability validation on the current experiment configuration. Executes N runs to measure metric variance and auto-configures multi-run evaluation if variance is too high.
4
+ argument-hint: "[--auto]"
5
+ allowed-tools: Read, Bash(*), Grep, Glob
6
+ ---
7
+
8
+ Validate the stability of the current ML pipeline by running it multiple times and measuring variance.
9
+
10
+ ## Steps
11
+
12
+ 1. **Activate environment:**
13
+ ```bash
14
+ source .venv/bin/activate
15
+ ```
16
+
17
+ 2. **Run stability check:**
18
+ ```bash
19
+ python scripts/validate_stability.py
20
+ ```
21
+
22
+ 3. **If `$ARGUMENTS` contains `--auto`:**
23
+ ```bash
24
+ python scripts/validate_stability.py --auto
25
+ ```
26
+ This auto-writes `evaluation.n_runs: 3` to `config.yaml` if CV > 5%.
27
+
28
+ 4. **Report results:**
29
+ - **Stable (CV < 5%):** metric is reliable, single-run evaluation is sufficient
30
+ - **Unstable (CV >= 5%):** metric has high variance, multi-run with median is recommended
31
+ - If `--auto` was used, report what was changed in config.yaml
32
+
33
+ 5. **If no training pipeline exists:** suggest `/turing:init` first.
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: warm
3
+ description: Warm-start from a prior model — load checkpoint, optionally freeze layers, adjust learning rate, and continue training.
4
+ argument-hint: "<exp-id> [--freeze-layers encoder] [--unfreeze-after 5]"
5
+ allowed-tools: Read, Bash(*), Grep, Glob
6
+ ---
7
+
8
+ Take a trained checkpoint and use it as initialization for a new experiment. Automates the "start from here but change X" pattern.
9
+
10
+ ## Steps
11
+
12
+ 1. **Activate environment:**
13
+ ```bash
14
+ source .venv/bin/activate
15
+ ```
16
+
17
+ 2. **Parse arguments from `$ARGUMENTS`:**
18
+ - First argument is the source experiment ID (required)
19
+ - `--freeze-layers encoder decoder` — layer names to freeze (neural only)
20
+ - `--unfreeze-after 5` — unfreeze all layers after N epochs (gradual unfreezing)
21
+ - `--lr-factor 0.1` — learning rate reduction factor (default: 0.1x)
22
+ - `--json` — raw JSON output
23
+
24
+ 3. **Run warm-start planner:**
25
+ ```bash
26
+ python scripts/warm_start.py $ARGUMENTS
27
+ ```
28
+
29
+ 4. **Report results:**
30
+ - Model type detection (tree, neural, sklearn)
31
+ - Strategy: continue_boosting, load_weights, or warm_start_param
32
+ - Numbered step-by-step instructions
33
+ - Config changes to apply
34
+ - Checkpoint info (path, format, size)
35
+
36
+ 5. **Strategies by model type:**
37
+ - **Tree models (XGBoost/LightGBM):** continue boosting from existing trees with more estimators
38
+ - **Neural networks:** load weights, optionally freeze layers, reset optimizer, reduce LR
39
+ - **scikit-learn:** use `warm_start=True` parameter for incremental learning
40
+
41
+ 6. **If no checkpoint found:** plan is still generated, but warns that checkpoint is needed
42
+
43
+ 7. **Saved output:** report written to `experiments/warm_starts/warm-<exp-id>.yaml`
44
+
45
+ ## Examples
46
+
47
+ ```
48
+ /turing:warm exp-042 # Auto-detect strategy
49
+ /turing:warm exp-042 --freeze-layers encoder # Freeze encoder layers
50
+ /turing:warm exp-042 --freeze-layers encoder --unfreeze-after 5 # Gradual unfreezing
51
+ /turing:warm exp-042 --lr-factor 0.01 # Very small fine-tuning LR
52
+ ```
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: watch
3
+ description: Live training monitor with early-warning alerts for loss spikes, NaN, overfitting, and metric plateaus.
4
+ argument-hint: "[--alerts] [--interval 10] [--analyze run.log]"
5
+ allowed-tools: Read, Bash(*), Grep, Glob
6
+ ---
7
+
8
+ Stream metrics during training with early-warning alerts. Catches problems mid-run instead of at the end.
9
+
10
+ ## Steps
11
+
12
+ 1. **Activate environment:**
13
+ ```bash
14
+ source .venv/bin/activate
15
+ ```
16
+
17
+ 2. **Parse arguments from `$ARGUMENTS`:**
18
+ - `--analyze run.log` — post-hoc analysis of a completed log (non-blocking)
19
+ - `--alerts` — show only alert lines, suppress normal output
20
+ - `--interval 10` — check interval in seconds (default: 10)
21
+ - `--alerts-config config/watch_alerts.yaml` — custom alert rules
22
+ - `--json` — raw JSON output (for `--analyze` mode)
23
+
24
+ 3. **For post-hoc analysis:**
25
+ ```bash
26
+ python scripts/training_monitor.py --analyze run.log
27
+ ```
28
+
29
+ 4. **For live monitoring (inform user):**
30
+ Live monitoring requires a running training process. Suggest the user run in a separate terminal:
31
+ ```bash
32
+ python scripts/training_monitor.py --log run.log --interval 10
33
+ ```
34
+
35
+ 5. **Alert types:**
36
+ - **Loss spike:** loss > 3x rolling mean (configurable multiplier)
37
+ - **NaN detected:** any metric is NaN — CRITICAL, suggests pausing
38
+ - **Overfitting onset:** train/val gap widening for 3+ consecutive epochs
39
+ - **Plateau:** metric improvement < 0.001 for 5+ consecutive epochs
40
+
41
+ 6. **Dashboard line format:**
42
+ ```
43
+ Epoch 23/100 | loss: 0.342 ↓ | acc: 0.865 ↑ | gap: 0.018 | ⚠ plateau
44
+ ```
45
+
46
+ 7. **Alert config:** rules are in `config/watch_alerts.yaml` — users can customize thresholds.
47
+
48
+ 8. **Saved output:** analysis report written to `experiments/monitors/analysis-*.yaml`
49
+
50
+ 9. **If no training log exists:** suggest running `/turing:train` first.
51
+
52
+ ## Examples
53
+
54
+ ```
55
+ /turing:watch --analyze run.log # Analyze completed training
56
+ /turing:watch --analyze run.log --json # JSON output for scripting
57
+ /turing:watch --alerts # Live: show only alerts
58
+ /turing:watch --interval 5 # Live: check every 5 seconds
59
+ ```
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: whatif
3
+ description: What-if analysis — answer hypotheticals from existing experiment data without running new experiments.
4
+ argument-hint: "\"<question>\" [--json]"
5
+ allowed-tools: Read, Bash(*), Grep, Glob
6
+ ---
7
+
8
+ Answer "what if?" questions using existing experiment data. Routes to the right estimator automatically.
9
+
10
+ ## Steps
11
+ 1. `source .venv/bin/activate`
12
+ 2. `python scripts/whatif_engine.py $ARGUMENTS`
13
+ 3. **Saved:** `experiments/whatif/`
14
+
15
+ ## Supported question types
16
+ - **Data scaling:** "what if I had 2x more data" → scaling law extrapolation
17
+ - **Ablation:** "what if I removed class 3" → ablation study data
18
+ - **Pipeline stitch:** "what if I combined exp-031 with exp-042" → stitch estimation
19
+ - **Hyperparameters:** "what if learning_rate was 0.01" → sensitivity interpolation
20
+ - **Ensemble:** "what if I ensembled the top models" → correlation analysis
21
+ - **Pruning:** "what if I pruned to 50% sparsity" → pruning sweep interpolation
22
+ - **Budget:** "what if I spent my budget on X vs Y" → budget allocation
23
+
24
+ ## Examples
25
+ ```
26
+ /turing:whatif "what if I had 2x more data"
27
+ /turing:whatif "what if I removed class 3"
28
+ /turing:whatif "what if I combined exp-031 with exp-042"
29
+ /turing:whatif "what if learning_rate was 0.01" --json
30
+ ```
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: xray
3
+ description: Internal model diagnostics — gradient flow, dead neurons, activation stats, weight distributions, tree depth analysis.
4
+ argument-hint: "[exp-id] [--layer encoder.layer.2] [--compare exp-a exp-b]"
5
+ allowed-tools: Read, Bash(*), Grep, Glob
6
+ ---
7
+
8
+ See inside the model. When it underperforms, the fix depends on *why*.
9
+
10
+ ## Steps
11
+
12
+ 1. **Activate environment:**
13
+ ```bash
14
+ source .venv/bin/activate
15
+ ```
16
+
17
+ 2. **Parse arguments from `$ARGUMENTS`:**
18
+ - Optional experiment ID
19
+ - `--layer "name"` — focus on specific layer
20
+ - `--compare exp-a exp-b` — side-by-side diagnostics
21
+ - `--json` — raw JSON output
22
+
23
+ 3. **Run model diagnostics:**
24
+ ```bash
25
+ python scripts/model_xray.py $ARGUMENTS
26
+ ```
27
+
28
+ 4. **Diagnostics by model type:**
29
+ - **Neural networks:** gradient magnitudes, activation stats, dead neuron %, weight distributions, gradient-to-weight ratio
30
+ - **Tree models:** depth utilization, leaf purity, feature split dominance
31
+ - **scikit-learn:** coefficient magnitudes, feature importance concentration
32
+
33
+ 5. **Issues detected:** dead gradients, vanishing/exploding gradients, dead neurons, sparse weights, feature dominance, overfitting risk
34
+
35
+ 6. **Saved output:** report in `experiments/xrays/<exp-id>-xray.yaml`
36
+
37
+ ## Examples
38
+
39
+ ```
40
+ /turing:xray exp-042 # Full diagnostics
41
+ /turing:xray # Best experiment
42
+ ```
@@ -140,11 +140,32 @@ export async function getCommandNames(registryPath) {
140
140
  return registry.commandNames;
141
141
  }
142
142
 
143
+ // Installed public layout under .claude/commands/turing.
143
144
  export async function getExpectedCommandPaths(registryPath) {
144
145
  const names = await getCommandNames(registryPath);
145
146
  return ['SKILL.md', ...names.map((name) => `${name}/SKILL.md`)];
146
147
  }
147
148
 
149
+ // Editable repository source layout.
150
+ export async function getExpectedSkillSourcePaths(registryPath) {
151
+ const names = await getCommandNames(registryPath);
152
+ return [
153
+ 'skills/turing/SKILL.md',
154
+ ...names.map((name) => `skills/turing/${name}/SKILL.md`),
155
+ 'skills/turing/rules/loop-protocol.md',
156
+ ];
157
+ }
158
+
159
+ // Generated repository compatibility layout.
160
+ export async function getExpectedLegacyCommandCompatPaths(registryPath) {
161
+ const names = await getCommandNames(registryPath);
162
+ return [
163
+ 'commands/turing.md',
164
+ ...names.map((name) => `commands/${name}.md`),
165
+ 'commands/rules/loop-protocol.md',
166
+ ];
167
+ }
168
+
148
169
  export async function getConfigFiles(registryPath) {
149
170
  const registry = await loadCommandRegistry(registryPath);
150
171
  return registry.configFiles;
package/src/install.js CHANGED
@@ -18,6 +18,7 @@ import { getCommandNames, getConfigFiles } from "./command-registry.js";
18
18
 
19
19
  const __dirname = dirname(fileURLToPath(import.meta.url));
20
20
  const PLUGIN_ROOT = join(__dirname, "..");
21
+ const SKILL_SOURCE_ROOT = join(PLUGIN_ROOT, "skills", "turing");
21
22
 
22
23
 
23
24
  export async function install(opts = {}) {
@@ -37,7 +38,7 @@ export async function install(opts = {}) {
37
38
 
38
39
  // Copy root command (router) as SKILL.md
39
40
  await copyFile(
40
- join(PLUGIN_ROOT, "commands", "turing.md"),
41
+ join(SKILL_SOURCE_ROOT, "SKILL.md"),
41
42
  join(paths.commands, "SKILL.md"),
42
43
  );
43
44
  console.log(" Router -> SKILL.md");
@@ -45,7 +46,7 @@ export async function install(opts = {}) {
45
46
  // Copy sub-commands as <name>/SKILL.md
46
47
  for (const cmd of subCommands) {
47
48
  await copyFile(
48
- join(PLUGIN_ROOT, "commands", `${cmd}.md`),
49
+ join(SKILL_SOURCE_ROOT, cmd, "SKILL.md"),
49
50
  join(paths.commands, cmd, "SKILL.md"),
50
51
  );
51
52
  }
@@ -53,7 +54,7 @@ export async function install(opts = {}) {
53
54
 
54
55
  // Copy rules
55
56
  await copyFile(
56
- join(PLUGIN_ROOT, "commands", "rules", "loop-protocol.md"),
57
+ join(SKILL_SOURCE_ROOT, "rules", "loop-protocol.md"),
57
58
  join(paths.commands, "rules", "loop-protocol.md"),
58
59
  );
59
60
  console.log(" Rules installed");
@@ -0,0 +1,149 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Synchronize the legacy commands/ compatibility tree from skills/turing/.
4
+ *
5
+ * Usage:
6
+ * node src/sync-commands-layout.js [--check]
7
+ */
8
+
9
+ import { mkdir, readdir, readFile, rm, writeFile } from "fs/promises";
10
+ import { dirname, join, relative } from "path";
11
+ import { fileURLToPath } from "url";
12
+ import { getCommandNames } from "./command-registry.js";
13
+
14
+ const __dirname = dirname(fileURLToPath(import.meta.url));
15
+ const PLUGIN_ROOT = join(__dirname, "..");
16
+ const SKILLS_DIR = join(PLUGIN_ROOT, "skills", "turing");
17
+ const COMMANDS_DIR = join(PLUGIN_ROOT, "commands");
18
+
19
+ async function readUtf8(path) {
20
+ return readFile(path, "utf8");
21
+ }
22
+
23
+ async function copyTextFile(source, target) {
24
+ await mkdir(dirname(target), { recursive: true });
25
+ await writeFile(target, await readUtf8(source));
26
+ }
27
+
28
+ async function compatibilityEntries() {
29
+ const names = await getCommandNames();
30
+ return [
31
+ {
32
+ source: join(SKILLS_DIR, "SKILL.md"),
33
+ target: join(COMMANDS_DIR, "turing.md"),
34
+ },
35
+ ...names.map((name) => ({
36
+ source: join(SKILLS_DIR, name, "SKILL.md"),
37
+ target: join(COMMANDS_DIR, `${name}.md`),
38
+ })),
39
+ {
40
+ source: join(SKILLS_DIR, "rules", "loop-protocol.md"),
41
+ target: join(COMMANDS_DIR, "rules", "loop-protocol.md"),
42
+ },
43
+ ];
44
+ }
45
+
46
+ async function existingCompatibilityEntries(dir = COMMANDS_DIR) {
47
+ let entries;
48
+ try {
49
+ entries = await readdir(dir, { withFileTypes: true });
50
+ } catch (error) {
51
+ if (error.code === "ENOENT") {
52
+ return [];
53
+ }
54
+ throw error;
55
+ }
56
+
57
+ const paths = [];
58
+ for (const entry of entries) {
59
+ const path = join(dir, entry.name);
60
+ paths.push(path);
61
+ if (entry.isDirectory()) {
62
+ paths.push(...await existingCompatibilityEntries(path));
63
+ }
64
+ }
65
+ return paths;
66
+ }
67
+
68
+ async function findDrift() {
69
+ const entries = await compatibilityEntries();
70
+ const expectedTargets = new Set(entries.map(({ target }) => target));
71
+ const expectedPaths = new Set([COMMANDS_DIR]);
72
+ for (const target of expectedTargets) {
73
+ let current = target;
74
+ while (current.startsWith(COMMANDS_DIR)) {
75
+ expectedPaths.add(current);
76
+ if (current === COMMANDS_DIR) {
77
+ break;
78
+ }
79
+ current = dirname(current);
80
+ }
81
+ }
82
+ const issues = [];
83
+
84
+ for (const { source, target } of entries) {
85
+ let sourceText;
86
+ try {
87
+ sourceText = await readUtf8(source);
88
+ } catch (error) {
89
+ issues.push(`missing source ${relative(PLUGIN_ROOT, source)}: ${error.message}`);
90
+ continue;
91
+ }
92
+
93
+ let targetText;
94
+ try {
95
+ targetText = await readUtf8(target);
96
+ } catch (error) {
97
+ if (error.code === "ENOENT") {
98
+ issues.push(`missing compatibility file ${relative(PLUGIN_ROOT, target)}`);
99
+ } else {
100
+ issues.push(`cannot read compatibility file ${relative(PLUGIN_ROOT, target)}: ${error.message}`);
101
+ }
102
+ continue;
103
+ }
104
+
105
+ if (targetText !== sourceText) {
106
+ issues.push(`diverged compatibility file ${relative(PLUGIN_ROOT, target)}`);
107
+ }
108
+ }
109
+
110
+ for (const path of await existingCompatibilityEntries()) {
111
+ if (!expectedPaths.has(path)) {
112
+ issues.push(`stale compatibility path ${relative(PLUGIN_ROOT, path)}`);
113
+ }
114
+ }
115
+
116
+ return issues;
117
+ }
118
+
119
+ export async function syncCommandsLayout({ check = false } = {}) {
120
+ if (check) {
121
+ const issues = await findDrift();
122
+ if (issues.length > 0) {
123
+ for (const issue of issues) {
124
+ console.error(issue);
125
+ }
126
+ process.exitCode = 1;
127
+ return;
128
+ }
129
+ console.log("commands compatibility tree is in sync");
130
+ return;
131
+ }
132
+
133
+ await rm(COMMANDS_DIR, { recursive: true, force: true });
134
+ for (const { source, target } of await compatibilityEntries()) {
135
+ await copyTextFile(source, target);
136
+ }
137
+ console.log("commands compatibility tree synchronized");
138
+ }
139
+
140
+ const isDirectRun =
141
+ process.argv[1] &&
142
+ fileURLToPath(import.meta.url).endsWith(process.argv[1].replace(/^.*\//, ""));
143
+
144
+ if (isDirectRun) {
145
+ syncCommandsLayout({ check: process.argv.includes("--check") }).catch((error) => {
146
+ console.error(error.message);
147
+ process.exitCode = 1;
148
+ });
149
+ }