specweave 0.4.1 → 0.6.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 (392) hide show
  1. package/.claude-plugin/README.md +325 -0
  2. package/.claude-plugin/marketplace.json +210 -0
  3. package/CLAUDE.md +871 -596
  4. package/README.md +188 -137
  5. package/bin/install-agents.sh +1 -1
  6. package/bin/install-commands.sh +66 -14
  7. package/bin/install-hooks.sh +1 -1
  8. package/bin/install-skills.sh +1 -1
  9. package/bin/specweave.js +2 -0
  10. package/dist/adapters/claude/adapter.d.ts +49 -11
  11. package/dist/adapters/claude/adapter.d.ts.map +1 -1
  12. package/dist/adapters/claude/adapter.js +175 -42
  13. package/dist/adapters/claude/adapter.js.map +1 -1
  14. package/dist/adapters/copilot/adapter.d.ts +20 -2
  15. package/dist/adapters/copilot/adapter.d.ts.map +1 -1
  16. package/dist/adapters/copilot/adapter.js +117 -7
  17. package/dist/adapters/copilot/adapter.js.map +1 -1
  18. package/dist/adapters/cursor/adapter.d.ts +18 -0
  19. package/dist/adapters/cursor/adapter.d.ts.map +1 -1
  20. package/dist/adapters/cursor/adapter.js +55 -3
  21. package/dist/adapters/cursor/adapter.js.map +1 -1
  22. package/dist/adapters/generic/adapter.d.ts +18 -0
  23. package/dist/adapters/generic/adapter.d.ts.map +1 -1
  24. package/dist/adapters/generic/adapter.js +55 -3
  25. package/dist/adapters/generic/adapter.js.map +1 -1
  26. package/dist/cli/commands/init.d.ts +1 -0
  27. package/dist/cli/commands/init.d.ts.map +1 -1
  28. package/dist/cli/commands/init.js +346 -124
  29. package/dist/cli/commands/init.js.map +1 -1
  30. package/dist/cli/commands/install.d.ts +2 -0
  31. package/dist/cli/commands/install.d.ts.map +1 -1
  32. package/dist/cli/commands/install.js +28 -25
  33. package/dist/cli/commands/install.js.map +1 -1
  34. package/dist/cli/commands/list.d.ts +2 -0
  35. package/dist/cli/commands/list.d.ts.map +1 -1
  36. package/dist/cli/commands/list.js +26 -24
  37. package/dist/cli/commands/list.js.map +1 -1
  38. package/dist/cli/commands/plugin.d.ts +7 -1
  39. package/dist/cli/commands/plugin.d.ts.map +1 -1
  40. package/dist/cli/commands/plugin.js +72 -61
  41. package/dist/cli/commands/plugin.js.map +1 -1
  42. package/dist/core/i18n/language-detector.d.ts +29 -0
  43. package/dist/core/i18n/language-detector.d.ts.map +1 -0
  44. package/dist/core/i18n/language-detector.js +143 -0
  45. package/dist/core/i18n/language-detector.js.map +1 -0
  46. package/dist/core/i18n/language-manager.d.ts +101 -0
  47. package/dist/core/i18n/language-manager.d.ts.map +1 -0
  48. package/dist/core/i18n/language-manager.js +232 -0
  49. package/dist/core/i18n/language-manager.js.map +1 -0
  50. package/dist/core/i18n/language-registry.d.ts +44 -0
  51. package/dist/core/i18n/language-registry.d.ts.map +1 -0
  52. package/dist/core/i18n/language-registry.js +234 -0
  53. package/dist/core/i18n/language-registry.js.map +1 -0
  54. package/dist/core/i18n/locale-manager.d.ts +62 -0
  55. package/dist/core/i18n/locale-manager.d.ts.map +1 -0
  56. package/dist/core/i18n/locale-manager.js +137 -0
  57. package/dist/core/i18n/locale-manager.js.map +1 -0
  58. package/dist/core/i18n/system-prompt-injector.d.ts +33 -0
  59. package/dist/core/i18n/system-prompt-injector.d.ts.map +1 -0
  60. package/dist/core/i18n/system-prompt-injector.js +131 -0
  61. package/dist/core/i18n/system-prompt-injector.js.map +1 -0
  62. package/dist/core/i18n/types.d.ts +151 -0
  63. package/dist/core/i18n/types.d.ts.map +1 -0
  64. package/dist/core/i18n/types.js +11 -0
  65. package/dist/core/i18n/types.js.map +1 -0
  66. package/dist/core/increment-status.d.ts +72 -0
  67. package/dist/core/increment-status.d.ts.map +1 -0
  68. package/dist/core/increment-status.js +227 -0
  69. package/dist/core/increment-status.js.map +1 -0
  70. package/dist/core/plugin-loader.d.ts +33 -13
  71. package/dist/core/plugin-loader.d.ts.map +1 -1
  72. package/dist/core/plugin-loader.js +145 -43
  73. package/dist/core/plugin-loader.js.map +1 -1
  74. package/dist/core/types/config.d.ts +51 -0
  75. package/dist/core/types/config.d.ts.map +1 -0
  76. package/dist/core/types/config.js +21 -0
  77. package/dist/core/types/config.js.map +1 -0
  78. package/dist/core/types/plugin.d.ts +73 -42
  79. package/dist/core/types/plugin.d.ts.map +1 -1
  80. package/dist/core/types/plugin.js +4 -3
  81. package/dist/core/types/plugin.js.map +1 -1
  82. package/dist/hooks/lib/sync-living-docs.d.ts +27 -0
  83. package/dist/hooks/lib/sync-living-docs.d.ts.map +1 -0
  84. package/dist/hooks/lib/sync-living-docs.js +116 -0
  85. package/dist/hooks/lib/sync-living-docs.js.map +1 -0
  86. package/dist/hooks/lib/translate-living-docs.d.ts +13 -0
  87. package/dist/hooks/lib/translate-living-docs.d.ts.map +1 -0
  88. package/dist/hooks/lib/translate-living-docs.js +166 -0
  89. package/dist/hooks/lib/translate-living-docs.js.map +1 -0
  90. package/dist/hooks/lib/update-tasks-md.d.ts +29 -0
  91. package/dist/hooks/lib/update-tasks-md.d.ts.map +1 -0
  92. package/dist/hooks/lib/update-tasks-md.js +203 -0
  93. package/dist/hooks/lib/update-tasks-md.js.map +1 -0
  94. package/dist/integrations/jira/jira-incremental-mapper.js.map +1 -1
  95. package/dist/integrations/jira/jira-mapper.js.map +1 -1
  96. package/dist/locales/de/.gitkeep +0 -0
  97. package/dist/locales/de/cli.json +108 -0
  98. package/dist/locales/en/cli.json +269 -0
  99. package/dist/locales/en/errors.json +7 -0
  100. package/dist/locales/en/templates.json +6 -0
  101. package/dist/locales/es/.gitkeep +0 -0
  102. package/dist/locales/es/cli.json +41 -0
  103. package/dist/locales/fr/.gitkeep +0 -0
  104. package/dist/locales/fr/cli.json +108 -0
  105. package/dist/locales/ja/.gitkeep +0 -0
  106. package/dist/locales/ja/cli.json +108 -0
  107. package/dist/locales/ko/.gitkeep +0 -0
  108. package/dist/locales/ko/cli.json +108 -0
  109. package/dist/locales/pt/.gitkeep +0 -0
  110. package/dist/locales/pt/cli.json +108 -0
  111. package/dist/locales/ru/.gitkeep +0 -0
  112. package/dist/locales/ru/cli.json +269 -0
  113. package/dist/locales/zh/.gitkeep +0 -0
  114. package/dist/locales/zh/cli.json +108 -0
  115. package/dist/plugins/specweave-github/lib/github-client.d.ts +86 -0
  116. package/dist/plugins/specweave-github/lib/github-client.d.ts.map +1 -0
  117. package/dist/plugins/specweave-github/lib/github-client.js +275 -0
  118. package/dist/plugins/specweave-github/lib/github-client.js.map +1 -0
  119. package/dist/plugins/specweave-github/lib/index.d.ts +10 -0
  120. package/dist/plugins/specweave-github/lib/index.d.ts.map +1 -0
  121. package/dist/plugins/specweave-github/lib/index.js +10 -0
  122. package/dist/plugins/specweave-github/lib/index.js.map +1 -0
  123. package/dist/plugins/specweave-github/lib/subtask-sync.d.ts +51 -0
  124. package/dist/plugins/specweave-github/lib/subtask-sync.d.ts.map +1 -0
  125. package/dist/plugins/specweave-github/lib/subtask-sync.js +147 -0
  126. package/dist/plugins/specweave-github/lib/subtask-sync.js.map +1 -0
  127. package/dist/plugins/specweave-github/lib/task-parser.d.ts +37 -0
  128. package/dist/plugins/specweave-github/lib/task-parser.d.ts.map +1 -0
  129. package/dist/plugins/specweave-github/lib/task-parser.js +211 -0
  130. package/dist/plugins/specweave-github/lib/task-parser.js.map +1 -0
  131. package/dist/plugins/specweave-github/lib/task-sync.d.ts +51 -0
  132. package/dist/plugins/specweave-github/lib/task-sync.d.ts.map +1 -0
  133. package/dist/plugins/specweave-github/lib/task-sync.js +332 -0
  134. package/dist/plugins/specweave-github/lib/task-sync.js.map +1 -0
  135. package/dist/plugins/specweave-github/lib/types.d.ts +80 -0
  136. package/dist/plugins/specweave-github/lib/types.d.ts.map +1 -0
  137. package/dist/plugins/specweave-github/lib/types.js +5 -0
  138. package/dist/plugins/specweave-github/lib/types.js.map +1 -0
  139. package/dist/utils/agents-md-compiler.d.ts +68 -0
  140. package/dist/utils/agents-md-compiler.d.ts.map +1 -0
  141. package/dist/utils/agents-md-compiler.js +420 -0
  142. package/dist/utils/agents-md-compiler.js.map +1 -0
  143. package/dist/utils/generate-skills-index.js +4 -4
  144. package/dist/utils/generate-skills-index.js.map +1 -1
  145. package/package.json +12 -13
  146. package/plugins/specweave-ado/.claude-plugin/plugin.json +8 -0
  147. package/plugins/specweave-alternatives/.claude-plugin/plugin.json +8 -0
  148. package/plugins/specweave-alternatives/skills/bmad-method-expert/SKILL.md +626 -0
  149. package/plugins/specweave-alternatives/skills/bmad-method-expert/scripts/analyze-project.js +318 -0
  150. package/plugins/specweave-alternatives/skills/bmad-method-expert/scripts/check-setup.js +208 -0
  151. package/plugins/specweave-alternatives/skills/bmad-method-expert/scripts/generate-template.js +1149 -0
  152. package/plugins/specweave-alternatives/skills/bmad-method-expert/scripts/validate-documents.js +340 -0
  153. package/plugins/specweave-alternatives/skills/spec-kit-expert/SKILL.md +1010 -0
  154. package/plugins/specweave-backend/.claude-plugin/plugin.json +8 -0
  155. package/plugins/specweave-core/.claude-plugin/plugin.json +25 -0
  156. package/{src → plugins/specweave-core}/agents/pm/AGENT.md +80 -0
  157. package/plugins/specweave-core/agents/translator/AGENT.md +282 -0
  158. package/{src → plugins/specweave-core}/commands/README.md +11 -11
  159. package/{src → plugins/specweave-core}/commands/specweave.costs.md +7 -7
  160. package/{src → plugins/specweave-core}/commands/specweave.do.md +34 -7
  161. package/{src → plugins/specweave-core}/commands/specweave.increment.md +83 -18
  162. package/{src → plugins/specweave-core}/commands/specweave.md +49 -17
  163. package/{src → plugins/specweave-core}/commands/specweave.sync-docs.md +5 -5
  164. package/plugins/specweave-core/commands/specweave.translate.md +425 -0
  165. package/{src → plugins/specweave-core}/commands/specweave.validate.md +1 -1
  166. package/plugins/specweave-core/hooks/hooks.json +13 -0
  167. package/plugins/specweave-core/hooks/post-task-completion.sh +265 -0
  168. package/plugins/specweave-core/skills/SKILLS-INDEX.md +229 -0
  169. package/{src → plugins/specweave-core}/skills/brownfield-analyzer/SKILL.md +66 -24
  170. package/{src → plugins/specweave-core}/skills/context-loader/SKILL.md +1 -1
  171. package/plugins/specweave-core/skills/context-optimizer/SKILL.md +588 -0
  172. package/plugins/specweave-core/skills/docs-updater/SKILL.md +0 -0
  173. package/{src → plugins/specweave-core}/skills/increment-planner/SKILL.md +81 -4
  174. package/plugins/specweave-core/skills/plugin-detector/SKILL.md +211 -0
  175. package/{src → plugins/specweave-core}/skills/project-kickstarter/SKILL.md +7 -7
  176. package/plugins/specweave-core/skills/rfc-generator/SKILL.md +369 -0
  177. package/{src → plugins/specweave-core}/skills/specweave-detector/SKILL.md +2 -2
  178. package/plugins/specweave-core/skills/specweave-framework/SKILL.md +498 -0
  179. package/plugins/specweave-core/skills/specweave-framework/test-cases/test-1-increment-naming.yaml +11 -0
  180. package/plugins/specweave-core/skills/specweave-framework/test-cases/test-2-source-of-truth.yaml +11 -0
  181. package/plugins/specweave-core/skills/specweave-framework/test-cases/test-3-increment-discipline.yaml +12 -0
  182. package/plugins/specweave-core/skills/specweave-framework/test-cases/test-4-file-placement.yaml +11 -0
  183. package/{src → plugins/specweave-core}/skills/tdd-workflow/SKILL.md +20 -20
  184. package/plugins/specweave-core/skills/translator/SKILL.md +172 -0
  185. package/plugins/specweave-cost-optimizer/.claude-plugin/plugin.json +8 -0
  186. package/plugins/specweave-diagrams/.claude-plugin/plugin.json +8 -0
  187. package/plugins/specweave-docs/.claude-plugin/plugin.json +8 -0
  188. package/plugins/specweave-docs/skills/docusaurus/SKILL.md +526 -0
  189. package/plugins/specweave-figma/.claude-plugin/.mcp.json +12 -0
  190. package/plugins/specweave-figma/.claude-plugin/plugin.json +8 -0
  191. package/plugins/specweave-figma/ARCHITECTURE.md +453 -0
  192. package/plugins/specweave-figma/README.md +728 -0
  193. package/plugins/specweave-figma/skills/figma-to-code/SKILL.md +632 -0
  194. package/plugins/specweave-figma/skills/figma-to-code/test-1-token-generation.yaml +29 -0
  195. package/plugins/specweave-figma/skills/figma-to-code/test-2-component-generation.yaml +27 -0
  196. package/plugins/specweave-figma/skills/figma-to-code/test-3-typescript-generation.yaml +28 -0
  197. package/plugins/specweave-frontend/.claude-plugin/plugin.json +8 -0
  198. package/plugins/specweave-github/.claude-plugin/plugin.json +8 -0
  199. package/plugins/specweave-github/agents/github-manager/AGENT.md +651 -0
  200. package/plugins/specweave-github/commands/github-close-issue.md +418 -0
  201. package/plugins/specweave-github/commands/github-create-issue.md +307 -0
  202. package/plugins/specweave-github/commands/github-status.md +533 -0
  203. package/plugins/specweave-github/commands/github-sync-tasks.md +530 -0
  204. package/plugins/specweave-github/commands/github-sync.md +443 -0
  205. package/plugins/specweave-github/lib/github-client.ts +330 -0
  206. package/plugins/specweave-github/lib/index.ts +10 -0
  207. package/plugins/specweave-github/lib/subtask-sync.ts +225 -0
  208. package/plugins/specweave-github/lib/task-parser.ts +246 -0
  209. package/plugins/specweave-github/lib/task-sync.ts +402 -0
  210. package/plugins/specweave-github/lib/types.ts +86 -0
  211. package/plugins/specweave-github/skills/github-issue-tracker/SKILL.md +497 -0
  212. package/plugins/specweave-github/skills/github-sync/SKILL.md +461 -0
  213. package/plugins/specweave-infrastructure/.claude-plugin/plugin.json +8 -0
  214. package/plugins/specweave-jira/.claude-plugin/plugin.json +8 -0
  215. package/{src → plugins/specweave-jira}/commands/specweave.sync-jira.md +18 -18
  216. package/plugins/specweave-kubernetes/.claude-plugin/plugin.json +8 -0
  217. package/plugins/specweave-ml/.claude-plugin/plugin.json +39 -0
  218. package/plugins/specweave-ml/README.md +885 -0
  219. package/plugins/specweave-ml/agents/ml-engineer/AGENT.md +402 -0
  220. package/plugins/specweave-ml/commands/ml-deploy.md +116 -0
  221. package/plugins/specweave-ml/commands/ml-evaluate.md +87 -0
  222. package/plugins/specweave-ml/commands/ml-explain.md +83 -0
  223. package/plugins/specweave-ml/skills/anomaly-detector/SKILL.md +559 -0
  224. package/plugins/specweave-ml/skills/automl-optimizer/SKILL.md +485 -0
  225. package/plugins/specweave-ml/skills/cv-pipeline-builder/SKILL.md +157 -0
  226. package/plugins/specweave-ml/skills/data-visualizer/SKILL.md +521 -0
  227. package/plugins/specweave-ml/skills/experiment-tracker/SKILL.md +535 -0
  228. package/plugins/specweave-ml/skills/feature-engineer/SKILL.md +566 -0
  229. package/plugins/specweave-ml/skills/ml-deployment-helper/SKILL.md +345 -0
  230. package/plugins/specweave-ml/skills/ml-pipeline-orchestrator/SKILL.md +518 -0
  231. package/plugins/specweave-ml/skills/model-evaluator/SKILL.md +155 -0
  232. package/plugins/specweave-ml/skills/model-explainer/SKILL.md +227 -0
  233. package/plugins/specweave-ml/skills/model-registry/SKILL.md +541 -0
  234. package/plugins/specweave-ml/skills/nlp-pipeline-builder/SKILL.md +180 -0
  235. package/plugins/specweave-ml/skills/time-series-forecaster/SKILL.md +569 -0
  236. package/plugins/specweave-payments/.claude-plugin/plugin.json +8 -0
  237. package/plugins/specweave-testing/.claude-plugin/plugin.json +8 -0
  238. package/plugins/specweave-tooling/.claude-plugin/plugin.json +8 -0
  239. package/plugins/specweave-ui/.claude-plugin/plugin.json +106 -0
  240. package/plugins/specweave-ui/.mcp.json +14 -0
  241. package/plugins/specweave-ui/README.md +386 -0
  242. package/src/adapters/claude/adapter.ts +193 -46
  243. package/src/adapters/copilot/adapter.ts +132 -7
  244. package/src/adapters/cursor/adapter.ts +62 -3
  245. package/src/adapters/generic/adapter.ts +62 -3
  246. package/src/templates/AGENTS.md.template +170 -1
  247. package/src/templates/CLAUDE.md.template +122 -24
  248. package/src/templates/tasks.md.template +261 -0
  249. package/src/agents/ml-engineer/AGENT.md +0 -150
  250. package/src/commands/specweave.sync-github.md +0 -269
  251. package/src/hooks/post-task-completion.sh +0 -121
  252. package/src/skills/SKILLS-INDEX.md +0 -444
  253. package/src/skills/github-sync/SKILL.md +0 -234
  254. /package/{src → plugins/specweave-ado}/skills/ado-sync/README.md +0 -0
  255. /package/{src → plugins/specweave-ado}/skills/ado-sync/SKILL.md +0 -0
  256. /package/{src → plugins/specweave-ado}/skills/specweave-ado-mapper/SKILL.md +0 -0
  257. /package/{src → plugins/specweave-backend}/agents/database-optimizer/AGENT.md +0 -0
  258. /package/{src → plugins/specweave-backend}/skills/dotnet-backend/SKILL.md +0 -0
  259. /package/{src → plugins/specweave-backend}/skills/nodejs-backend/SKILL.md +0 -0
  260. /package/{src → plugins/specweave-backend}/skills/python-backend/SKILL.md +0 -0
  261. /package/{src → plugins/specweave-core}/agents/architect/AGENT.md +0 -0
  262. /package/{src → plugins/specweave-core}/agents/code-reviewer.md +0 -0
  263. /package/{src → plugins/specweave-core}/agents/docs-writer/AGENT.md +0 -0
  264. /package/{src → plugins/specweave-core}/agents/performance/AGENT.md +0 -0
  265. /package/{src → plugins/specweave-core}/agents/qa-lead/AGENT.md +0 -0
  266. /package/{src → plugins/specweave-core}/agents/security/AGENT.md +0 -0
  267. /package/{src → plugins/specweave-core}/agents/tdd-orchestrator/AGENT.md +0 -0
  268. /package/{src → plugins/specweave-core}/agents/tech-lead/AGENT.md +0 -0
  269. /package/{src → plugins/specweave-core}/commands/specweave.done.md +0 -0
  270. /package/{src → plugins/specweave-core}/commands/specweave.inc.md +0 -0
  271. /package/{src → plugins/specweave-core}/commands/specweave.list-increments.md +0 -0
  272. /package/{src → plugins/specweave-core}/commands/specweave.next.md +0 -0
  273. /package/{src → plugins/specweave-core}/commands/specweave.progress.md +0 -0
  274. /package/{src → plugins/specweave-core}/commands/specweave.tdd-cycle.md +0 -0
  275. /package/{src → plugins/specweave-core}/commands/specweave.tdd-green.md +0 -0
  276. /package/{src → plugins/specweave-core}/commands/specweave.tdd-red.md +0 -0
  277. /package/{src → plugins/specweave-core}/commands/specweave.tdd-refactor.md +0 -0
  278. /package/{src → plugins/specweave-core}/hooks/README.md +0 -0
  279. /package/{src → plugins/specweave-core}/hooks/docs-changed.sh +0 -0
  280. /package/{src → plugins/specweave-core}/hooks/human-input-required.sh +0 -0
  281. /package/{src → plugins/specweave-core}/hooks/post-increment-plugin-detect.sh +0 -0
  282. /package/{src → plugins/specweave-core}/hooks/pre-implementation.sh +0 -0
  283. /package/{src → plugins/specweave-core}/hooks/pre-task-plugin-detect.sh +0 -0
  284. /package/{src → plugins/specweave-core}/skills/brownfield-onboarder/SKILL.md +0 -0
  285. /package/{src → plugins/specweave-core}/skills/docs-updater/README.md +0 -0
  286. /package/{src → plugins/specweave-core}/skills/increment-planner/scripts/feature-utils.js +0 -0
  287. /package/{src → plugins/specweave-core}/skills/increment-quality-judge/SKILL.md +0 -0
  288. /package/{src → plugins/specweave-core}/skills/project-kickstarter/test-cases/test-1-high-confidence-full-product.yaml +0 -0
  289. /package/{src → plugins/specweave-core}/skills/project-kickstarter/test-cases/test-2-medium-confidence-partial.yaml +0 -0
  290. /package/{src → plugins/specweave-core}/skills/project-kickstarter/test-cases/test-3-low-confidence-technical-question.yaml +0 -0
  291. /package/{src → plugins/specweave-core}/skills/project-kickstarter/test-cases/test-4-opt-out-explicit.yaml +0 -0
  292. /package/{src → plugins/specweave-core}/skills/role-orchestrator/README.md +0 -0
  293. /package/{src → plugins/specweave-core}/skills/role-orchestrator/SKILL.md +0 -0
  294. /package/{src → plugins/specweave-core}/skills/task-builder/README.md +0 -0
  295. /package/{src → plugins/specweave-cost-optimizer}/skills/cost-optimizer/SKILL.md +0 -0
  296. /package/{src → plugins/specweave-diagrams}/agents/diagrams-architect/AGENT.md +0 -0
  297. /package/{src → plugins/specweave-diagrams}/agents/diagrams-architect/templates/c4-component-template.mmd +0 -0
  298. /package/{src → plugins/specweave-diagrams}/agents/diagrams-architect/templates/c4-container-template.mmd +0 -0
  299. /package/{src → plugins/specweave-diagrams}/agents/diagrams-architect/templates/c4-context-template.mmd +0 -0
  300. /package/{src → plugins/specweave-diagrams}/agents/diagrams-architect/templates/deployment-template.mmd +0 -0
  301. /package/{src → plugins/specweave-diagrams}/agents/diagrams-architect/templates/er-diagram-template.mmd +0 -0
  302. /package/{src → plugins/specweave-diagrams}/agents/diagrams-architect/templates/sequence-template.mmd +0 -0
  303. /package/{src → plugins/specweave-diagrams}/agents/diagrams-architect/test-cases/test-1-c4-context.yaml +0 -0
  304. /package/{src → plugins/specweave-diagrams}/agents/diagrams-architect/test-cases/test-2-sequence.yaml +0 -0
  305. /package/{src → plugins/specweave-diagrams}/agents/diagrams-architect/test-cases/test-3-er-diagram.yaml +0 -0
  306. /package/{src → plugins/specweave-diagrams}/skills/diagrams-architect/SKILL.md +0 -0
  307. /package/{src → plugins/specweave-diagrams}/skills/diagrams-generator/SKILL.md +0 -0
  308. /package/{src → plugins/specweave-docs}/skills/spec-driven-brainstorming/README.md +0 -0
  309. /package/{src → plugins/specweave-docs}/skills/spec-driven-brainstorming/SKILL.md +0 -0
  310. /package/{src → plugins/specweave-docs}/skills/spec-driven-debugging/README.md +0 -0
  311. /package/{src → plugins/specweave-docs}/skills/spec-driven-debugging/SKILL.md +0 -0
  312. /package/{src → plugins/specweave-frontend}/skills/design-system-architect/SKILL.md +0 -0
  313. /package/{src → plugins/specweave-frontend}/skills/frontend/SKILL.md +0 -0
  314. /package/{src → plugins/specweave-frontend}/skills/nextjs/SKILL.md +0 -0
  315. /package/{src → plugins/specweave-infrastructure}/agents/devops/AGENT.md +0 -0
  316. /package/{src → plugins/specweave-infrastructure}/agents/network-engineer/AGENT.md +0 -0
  317. /package/{src → plugins/specweave-infrastructure}/agents/observability-engineer/AGENT.md +0 -0
  318. /package/{src → plugins/specweave-infrastructure}/agents/performance-engineer/AGENT.md +0 -0
  319. /package/{src → plugins/specweave-infrastructure}/agents/sre/AGENT.md +0 -0
  320. /package/{src → plugins/specweave-infrastructure}/agents/sre/modules/backend-diagnostics.md +0 -0
  321. /package/{src → plugins/specweave-infrastructure}/agents/sre/modules/database-diagnostics.md +0 -0
  322. /package/{src → plugins/specweave-infrastructure}/agents/sre/modules/infrastructure.md +0 -0
  323. /package/{src → plugins/specweave-infrastructure}/agents/sre/modules/monitoring.md +0 -0
  324. /package/{src → plugins/specweave-infrastructure}/agents/sre/modules/security-incidents.md +0 -0
  325. /package/{src → plugins/specweave-infrastructure}/agents/sre/modules/ui-diagnostics.md +0 -0
  326. /package/{src → plugins/specweave-infrastructure}/agents/sre/playbooks/01-high-cpu-usage.md +0 -0
  327. /package/{src → plugins/specweave-infrastructure}/agents/sre/playbooks/02-database-deadlock.md +0 -0
  328. /package/{src → plugins/specweave-infrastructure}/agents/sre/playbooks/03-memory-leak.md +0 -0
  329. /package/{src → plugins/specweave-infrastructure}/agents/sre/playbooks/04-slow-api-response.md +0 -0
  330. /package/{src → plugins/specweave-infrastructure}/agents/sre/playbooks/05-ddos-attack.md +0 -0
  331. /package/{src → plugins/specweave-infrastructure}/agents/sre/playbooks/06-disk-full.md +0 -0
  332. /package/{src → plugins/specweave-infrastructure}/agents/sre/playbooks/07-service-down.md +0 -0
  333. /package/{src → plugins/specweave-infrastructure}/agents/sre/playbooks/08-data-corruption.md +0 -0
  334. /package/{src → plugins/specweave-infrastructure}/agents/sre/playbooks/09-cascade-failure.md +0 -0
  335. /package/{src → plugins/specweave-infrastructure}/agents/sre/playbooks/10-rate-limit-exceeded.md +0 -0
  336. /package/{src → plugins/specweave-infrastructure}/agents/sre/scripts/health-check.sh +0 -0
  337. /package/{src → plugins/specweave-infrastructure}/agents/sre/scripts/log-analyzer.py +0 -0
  338. /package/{src → plugins/specweave-infrastructure}/agents/sre/scripts/metrics-collector.sh +0 -0
  339. /package/{src → plugins/specweave-infrastructure}/agents/sre/scripts/trace-analyzer.js +0 -0
  340. /package/{src → plugins/specweave-infrastructure}/agents/sre/templates/incident-report.md +0 -0
  341. /package/{src → plugins/specweave-infrastructure}/agents/sre/templates/mitigation-plan.md +0 -0
  342. /package/{src → plugins/specweave-infrastructure}/agents/sre/templates/post-mortem.md +0 -0
  343. /package/{src → plugins/specweave-infrastructure}/agents/sre/templates/runbook-template.md +0 -0
  344. /package/{src → plugins/specweave-infrastructure}/commands/specweave.monitor-setup.md +0 -0
  345. /package/{src → plugins/specweave-infrastructure}/commands/specweave.slo-implement.md +0 -0
  346. /package/{src → plugins/specweave-infrastructure}/skills/distributed-tracing/SKILL.md +0 -0
  347. /package/{src → plugins/specweave-infrastructure}/skills/grafana-dashboards/SKILL.md +0 -0
  348. /package/{src → plugins/specweave-infrastructure}/skills/hetzner-provisioner/README.md +0 -0
  349. /package/{src → plugins/specweave-infrastructure}/skills/hetzner-provisioner/SKILL.md +0 -0
  350. /package/{src → plugins/specweave-infrastructure}/skills/prometheus-configuration/SKILL.md +0 -0
  351. /package/{src → plugins/specweave-infrastructure}/skills/slo-implementation/SKILL.md +0 -0
  352. /package/{src → plugins/specweave-jira}/skills/jira-sync/README.md +0 -0
  353. /package/{src → plugins/specweave-jira}/skills/jira-sync/SKILL.md +0 -0
  354. /package/{src → plugins/specweave-jira}/skills/specweave-jira-mapper/SKILL.md +0 -0
  355. /package/{src → plugins/specweave-kubernetes}/agents/kubernetes-architect/AGENT.md +0 -0
  356. /package/{src → plugins/specweave-kubernetes}/skills/gitops-workflow/SKILL.md +0 -0
  357. /package/{src → plugins/specweave-kubernetes}/skills/gitops-workflow/references/argocd-setup.md +0 -0
  358. /package/{src → plugins/specweave-kubernetes}/skills/gitops-workflow/references/sync-policies.md +0 -0
  359. /package/{src → plugins/specweave-kubernetes}/skills/helm-chart-scaffolding/SKILL.md +0 -0
  360. /package/{src → plugins/specweave-kubernetes}/skills/helm-chart-scaffolding/assets/Chart.yaml.template +0 -0
  361. /package/{src → plugins/specweave-kubernetes}/skills/helm-chart-scaffolding/assets/values.yaml.template +0 -0
  362. /package/{src → plugins/specweave-kubernetes}/skills/helm-chart-scaffolding/references/chart-structure.md +0 -0
  363. /package/{src → plugins/specweave-kubernetes}/skills/helm-chart-scaffolding/scripts/validate-chart.sh +0 -0
  364. /package/{src → plugins/specweave-kubernetes}/skills/k8s-manifest-generator/SKILL.md +0 -0
  365. /package/{src → plugins/specweave-kubernetes}/skills/k8s-manifest-generator/assets/configmap-template.yaml +0 -0
  366. /package/{src → plugins/specweave-kubernetes}/skills/k8s-manifest-generator/assets/deployment-template.yaml +0 -0
  367. /package/{src → plugins/specweave-kubernetes}/skills/k8s-manifest-generator/assets/service-template.yaml +0 -0
  368. /package/{src → plugins/specweave-kubernetes}/skills/k8s-manifest-generator/references/deployment-spec.md +0 -0
  369. /package/{src → plugins/specweave-kubernetes}/skills/k8s-manifest-generator/references/service-spec.md +0 -0
  370. /package/{src → plugins/specweave-kubernetes}/skills/k8s-security-policies/SKILL.md +0 -0
  371. /package/{src → plugins/specweave-kubernetes}/skills/k8s-security-policies/assets/network-policy-template.yaml +0 -0
  372. /package/{src → plugins/specweave-kubernetes}/skills/k8s-security-policies/references/rbac-patterns.md +0 -0
  373. /package/{src → plugins/specweave-ml}/agents/data-scientist/AGENT.md +0 -0
  374. /package/{src → plugins/specweave-ml}/agents/mlops-engineer/AGENT.md +0 -0
  375. /package/{src → plugins/specweave-ml}/commands/specweave.ml-pipeline.md +0 -0
  376. /package/{src → plugins/specweave-ml}/skills/ml-pipeline-workflow/SKILL.md +0 -0
  377. /package/{src → plugins/specweave-payments}/agents/payment-integration/AGENT.md +0 -0
  378. /package/{src → plugins/specweave-payments}/skills/billing-automation/SKILL.md +0 -0
  379. /package/{src → plugins/specweave-payments}/skills/paypal-integration/SKILL.md +0 -0
  380. /package/{src → plugins/specweave-payments}/skills/pci-compliance/SKILL.md +0 -0
  381. /package/{src → plugins/specweave-payments}/skills/stripe-integration/SKILL.md +0 -0
  382. /package/{src → plugins/specweave-testing}/skills/e2e-playwright/README.md +0 -0
  383. /package/{src → plugins/specweave-testing}/skills/e2e-playwright/SKILL.md +0 -0
  384. /package/{src → plugins/specweave-testing}/skills/e2e-playwright/execute.js +0 -0
  385. /package/{src → plugins/specweave-testing}/skills/e2e-playwright/lib/utils.js +0 -0
  386. /package/{src → plugins/specweave-testing}/skills/e2e-playwright/package.json +0 -0
  387. /package/{src → plugins/specweave-tooling}/skills/skill-creator/LICENSE.txt +0 -0
  388. /package/{src → plugins/specweave-tooling}/skills/skill-creator/SKILL.md +0 -0
  389. /package/{src → plugins/specweave-tooling}/skills/skill-creator/scripts/init_skill.py +0 -0
  390. /package/{src → plugins/specweave-tooling}/skills/skill-creator/scripts/package_skill.py +0 -0
  391. /package/{src → plugins/specweave-tooling}/skills/skill-creator/scripts/quick_validate.py +0 -0
  392. /package/{src → plugins/specweave-tooling}/skills/skill-router/SKILL.md +0 -0
@@ -0,0 +1,885 @@
1
+ # SpecWeave ML Plugin
2
+
3
+ **Complete ML/AI workflow integration for SpecWeave - From experiment tracking to production deployment**
4
+
5
+ Transform chaotic ML experimentation into disciplined, reproducible ML engineering using SpecWeave's increment-based workflow.
6
+
7
+ ---
8
+
9
+ ## 🎯 What This Plugin Does
10
+
11
+ Brings the same engineering discipline to ML that SpecWeave brings to software:
12
+
13
+ - ✅ **ML as Increments**: Every ML feature is a spec → plan → tasks → implement workflow
14
+ - ✅ **Experiment Tracking**: All experiments logged, versioned, and tied to increments
15
+ - ✅ **Reproducibility**: Reproduce any experiment from any increment
16
+ - ✅ **Living Documentation**: ML decisions captured in architecture docs
17
+ - ✅ **Production Ready**: Deployment artifacts, monitoring, A/B testing built-in
18
+
19
+ **The Problem**: ML development is often chaotic—Jupyter notebooks with no version control, experiments without documentation, models deployed with no reproducibility.
20
+
21
+ **The Solution**: SpecWeave ML plugin brings software engineering discipline to data science.
22
+
23
+ ---
24
+
25
+ ## 🚀 Quick Start
26
+
27
+ ### Installation
28
+
29
+ ```bash
30
+ # Install SpecWeave ML plugin
31
+ /plugin install specweave-ml@specweave
32
+
33
+ # Verify installation
34
+ /plugin list
35
+ # Should show: specweave-ml (13 skills, 1 agent, 3 commands)
36
+ ```
37
+
38
+ ### Your First ML Increment
39
+
40
+ ```bash
41
+ # Create ML increment
42
+ /specweave:inc "build recommendation model"
43
+
44
+ # The ml-pipeline-orchestrator skill activates and creates:
45
+ # .specweave/increments/0042-recommendation-model/
46
+ # ├── spec.md # ML requirements, success metrics
47
+ # ├── plan.md # Pipeline architecture
48
+ # ├── tasks.md # Implementation tasks
49
+ # ├── tests.md # Evaluation criteria
50
+ # ├── experiments/ # Experiment tracking
51
+ # ├── data/ # Data samples, schemas
52
+ # ├── models/ # Trained models
53
+ # └── notebooks/ # Exploratory notebooks
54
+
55
+ # Execute ML tasks
56
+ /specweave:do
57
+
58
+ # The skill guides you through:
59
+ # 1. Data exploration
60
+ # 2. Feature engineering
61
+ # 3. Baseline models (mandatory!)
62
+ # 4. Candidate models (3-5 algorithms)
63
+ # 5. Hyperparameter tuning
64
+ # 6. Comprehensive evaluation
65
+ # 7. Model explainability
66
+ # 8. Deployment preparation
67
+ ```
68
+
69
+ ---
70
+
71
+ ## 🧠 Thirteen Comprehensive Skills
72
+
73
+ ### Core ML Lifecycle (5 skills)
74
+
75
+ #### 1. **ml-pipeline-orchestrator**
76
+
77
+ Orchestrates complete ML pipelines within SpecWeave increments.
78
+
79
+ **Activates for**: "ML pipeline", "train model", "build ML system"
80
+
81
+ **What it does**:
82
+ - Creates ML-specific increment structure
83
+ - Generates ML spec (problem definition, success metrics, data requirements)
84
+ - Guides through data → train → eval → deploy workflow
85
+ - Auto-tracks all experiments to increment folder
86
+ - Ensures baseline comparison, cross-validation, explainability
87
+
88
+ **Example**:
89
+ ```bash
90
+ User: "Build a fraud detection model"
91
+
92
+ Skill creates increment 0051-fraud-detection:
93
+ - spec.md: Binary classification, 99% precision target
94
+ - plan.md: Imbalanced data handling, threshold tuning
95
+ - tasks.md: EDA → baseline → XGBoost/LightGBM → SHAP → deploy
96
+ - experiments/: Tracks all model attempts
97
+ ```
98
+
99
+ ### 2. **experiment-tracker**
100
+
101
+ Manages ML experiment tracking with MLflow, W&B, or built-in tracking.
102
+
103
+ **Activates for**: "track experiments", "MLflow", "wandb", "compare experiments"
104
+
105
+ **What it does**:
106
+ - Auto-configures tracking tools to log to increment folders
107
+ - Tracks params, metrics, artifacts for every experiment
108
+ - Generates experiment comparison reports
109
+ - Syncs experiment findings to living docs
110
+
111
+ **Example**:
112
+ ```python
113
+ from specweave import track_experiment
114
+
115
+ # Automatically logs to: .specweave/increments/0042.../experiments/
116
+ with track_experiment("xgboost-v1") as exp:
117
+ model.fit(X_train, y_train)
118
+ exp.log_metric("accuracy", 0.87)
119
+ exp.save_model(model, "model.pkl")
120
+
121
+ # Creates:
122
+ # - params.json
123
+ # - metrics.json
124
+ # - model.pkl
125
+ # - metadata.yaml
126
+ ```
127
+
128
+ ### 3. **model-evaluator**
129
+
130
+ Comprehensive model evaluation with multiple metrics and statistical testing.
131
+
132
+ **Activates for**: "evaluate model", "model metrics", "compare models"
133
+
134
+ **What it does**:
135
+ - Computes classification/regression/ranking metrics
136
+ - Generates confusion matrices, ROC curves, residual plots
137
+ - Performs cross-validation with confidence intervals
138
+ - Compares models statistically (vs baseline, vs previous version)
139
+
140
+ **Example**:
141
+ ```python
142
+ from specweave import ModelEvaluator
143
+
144
+ evaluator = ModelEvaluator(model, X_test, y_test, increment="0042")
145
+ report = evaluator.evaluate_all()
146
+
147
+ # Generates:
148
+ # - evaluation-report.md
149
+ # - confusion_matrix.png
150
+ # - roc_curve.png
151
+ # - comparison.md (vs baseline)
152
+ ```
153
+
154
+ ### 4. **model-explainer**
155
+
156
+ Model interpretability using SHAP, LIME, and feature importance.
157
+
158
+ **Activates for**: "explain model", "SHAP", "feature importance"
159
+
160
+ **What it does**:
161
+ - Generates global explanations (feature importance, partial dependence)
162
+ - Generates local explanations (SHAP/LIME for individual predictions)
163
+ - Creates human-readable explanation reports
164
+ - Critical for trust, debugging, regulatory compliance
165
+
166
+ **Example**:
167
+ ```python
168
+ from specweave import ModelExplainer
169
+
170
+ explainer = ModelExplainer(model, X_train, increment="0042")
171
+ explainer.generate_all_reports()
172
+
173
+ # Creates:
174
+ # - feature-importance.png
175
+ # - shap-summary.png
176
+ # - pdp-plots/
177
+ # - local-explanations/
178
+ # - explainability-report.md
179
+ ```
180
+
181
+ #### 5. **ml-deployment-helper**
182
+
183
+ Prepares models for production with APIs, containers, monitoring, A/B testing.
184
+
185
+ **Activates for**: "deploy model", "production deployment", "model API"
186
+
187
+ **What it does**:
188
+ - Generates FastAPI endpoints for model serving
189
+ - Creates Dockerfiles for containerization
190
+ - Sets up Prometheus/Grafana monitoring
191
+ - Configures A/B testing infrastructure
192
+ - Load tests models before deployment
193
+
194
+ **Example**:
195
+ ```python
196
+ from specweave import create_model_api
197
+
198
+ api = create_model_api(
199
+ model_path="models/model-v3.pkl",
200
+ increment="0042",
201
+ framework="fastapi"
202
+ )
203
+
204
+ # Creates:
205
+ # - api/main.py
206
+ # - api/models.py
207
+ # - Dockerfile
208
+ # - requirements.txt
209
+ # - monitoring/
210
+ # - ab-test/
211
+ ```
212
+
213
+ ### ML Engineering (2 skills)
214
+
215
+ #### 6. **feature-engineer**
216
+
217
+ Comprehensive feature engineering: data quality assessment, feature creation, selection, transformation, and validation.
218
+
219
+ **Activates for**: "feature engineering", "create features", "data preprocessing", "encode categorical"
220
+
221
+ **What it does**:
222
+ - **Phase 1**: Data quality assessment (missing values, outliers, data types)
223
+ - **Phase 2**: Feature creation (temporal, aggregation, interaction, ratio, binning, text features)
224
+ - **Phase 3**: Feature selection (correlation, variance, statistical, model-based, RFE)
225
+ - **Phase 4**: Feature transformation (scaling, encoding, log transform, power transform)
226
+ - **Phase 5**: Feature validation (data leakage detection, distribution drift, missing/invalid values)
227
+
228
+ #### 7. **automl-optimizer**
229
+
230
+ Automated machine learning with intelligent hyperparameter optimization and model selection.
231
+
232
+ **Activates for**: "automl", "hyperparameter tuning", "optimize hyperparameters", "neural architecture search"
233
+
234
+ **What it does**:
235
+ - Bayesian hyperparameter optimization (Optuna, Hyperopt)
236
+ - Automated algorithm selection (tries multiple models)
237
+ - Neural architecture search for deep learning
238
+ - Intelligent search space exploration
239
+ - Multi-objective optimization (accuracy + speed)
240
+
241
+ ### Domain-Specific Pipelines (2 skills)
242
+
243
+ #### 8. **cv-pipeline-builder**
244
+
245
+ Computer vision ML pipelines for images: classification, object detection, segmentation.
246
+
247
+ **Activates for**: "computer vision", "image classification", "object detection", "CNN", "YOLO"
248
+
249
+ **What it does**:
250
+ - Image preprocessing and data augmentation
251
+ - CNN architectures (ResNet, EfficientNet, Vision Transformer)
252
+ - Transfer learning from ImageNet
253
+ - Object detection (YOLO, Faster R-CNN)
254
+ - Semantic segmentation (U-Net, DeepLab)
255
+
256
+ #### 9. **nlp-pipeline-builder**
257
+
258
+ Natural language processing pipelines: text classification, NER, sentiment analysis, generation.
259
+
260
+ **Activates for**: "nlp", "text classification", "sentiment analysis", "BERT", "transformers"
261
+
262
+ **What it does**:
263
+ - Text preprocessing and tokenization
264
+ - Transformer models (BERT, RoBERTa, GPT)
265
+ - Fine-tuning on custom datasets
266
+ - Named entity recognition
267
+ - Text generation
268
+ - Sentiment analysis
269
+
270
+ ### Additional Domain-Specific Skills (4 skills) ✨ NEW
271
+
272
+ #### 10. **time-series-forecaster**
273
+
274
+ Time series forecasting with ARIMA, Prophet, LSTM, and statistical methods.
275
+
276
+ **Activates for**: "time series", "forecasting", "predict future", "ARIMA", "Prophet", "sales forecast"
277
+
278
+ **What it does**:
279
+ - Statistical methods (ARIMA, seasonal decomposition, stationarity testing)
280
+ - Prophet (Facebook) - Handles multiple seasonality + holidays
281
+ - Deep learning (LSTM, GRU) - Complex patterns, multivariate forecasting
282
+ - Multivariate forecasting (VAR) - Multiple related time series
283
+ - Time series-specific validation (no data leakage, temporal split)
284
+
285
+ #### 11. **anomaly-detector**
286
+
287
+ Anomaly and outlier detection using Isolation Forest, One-Class SVM, autoencoders.
288
+
289
+ **Activates for**: "anomaly detection", "fraud detection", "outlier detection", "intrusion detection"
290
+
291
+ **What it does**:
292
+ - Statistical methods (Z-score, IQR)
293
+ - Isolation Forest (general purpose, high-dimensional)
294
+ - One-Class SVM (trained on normal data only)
295
+ - Autoencoders (deep learning, complex patterns)
296
+ - LOF (Local Outlier Factor) - Density-based anomalies
297
+
298
+ #### 12. **data-visualizer**
299
+
300
+ Automated data visualization for EDA, model performance, and business reporting.
301
+
302
+ **Activates for**: "visualize data", "EDA", "create plots", "confusion matrix", "ROC curve"
303
+
304
+ **What it does**:
305
+ - EDA visualizations (distributions, correlations, missing values, outliers)
306
+ - Model performance (confusion matrix, ROC curve, learning curves, calibration)
307
+ - Feature analysis (importance, SHAP, partial dependence)
308
+ - Time series plots (decomposition, ACF/PACF, forecast with intervals)
309
+ - Interactive dashboards (Plotly, Grafana)
310
+
311
+ #### 13. **model-registry**
312
+
313
+ Centralized model versioning, staging, and lifecycle management.
314
+
315
+ **Activates for**: "model registry", "model versioning", "deploy to production", "rollback model"
316
+
317
+ **What it does**:
318
+ - Model versioning (semantic versioning: major.minor.patch)
319
+ - Staging pipeline (dev → staging → production → archived)
320
+ - Model metadata tracking (performance, hyperparameters, lineage)
321
+ - Model lineage (data → features → training → deployment)
322
+ - Safe rollback (one-command revert to stable version)
323
+
324
+ ---
325
+
326
+ ## 🤖 ML Engineer Agent
327
+
328
+ Specialized agent for ML system design and implementation.
329
+
330
+ **When to use**: Complex ML decisions, architecture reviews, best practices guidance
331
+
332
+ **Expertise**:
333
+ - Algorithm selection (when to use XGBoost vs neural nets)
334
+ - Hyperparameter tuning strategies
335
+ - Preventing ML anti-patterns (data leakage, overfitting, class imbalance)
336
+ - Production ML architecture
337
+ - MLOps best practices
338
+
339
+ **Example**:
340
+ ```bash
341
+ User: "My model has 95% train accuracy but 65% test accuracy"
342
+
343
+ ML Engineer Agent:
344
+ "Classic overfitting. Here's the fix:
345
+ 1. Reduce model complexity (max_depth, layers)
346
+ 2. Add regularization (L1/L2, dropout)
347
+ 3. More training data if possible
348
+ 4. Feature selection (remove noisy features)
349
+
350
+ For XGBoost:
351
+ params = {
352
+ 'max_depth': 3, # Reduce from default 6
353
+ 'min_child_weight': 5,
354
+ 'gamma': 0.1,
355
+ 'subsample': 0.8
356
+ }
357
+
358
+ Track experiments in increment 0042 so we see what works."
359
+ ```
360
+
361
+ ---
362
+
363
+ ## 🎓 Commands
364
+
365
+ ### `/ml:evaluate <increment_id>`
366
+
367
+ Evaluate ML model with comprehensive metrics.
368
+
369
+ ```bash
370
+ /ml:evaluate 0042
371
+
372
+ # Generates:
373
+ # - evaluation-report.md
374
+ # - Confusion matrix, ROC curves
375
+ # - Cross-validation results
376
+ # - Baseline comparison
377
+ # - Statistical significance tests
378
+ ```
379
+
380
+ ### `/ml:explain <increment_id>`
381
+
382
+ Generate model explainability reports.
383
+
384
+ ```bash
385
+ /ml:explain 0042
386
+
387
+ # Generates:
388
+ # - feature-importance.png
389
+ # - shap-summary.png
390
+ # - pdp-plots/
391
+ # - local-explanations/
392
+ # - explainability-report.md
393
+ ```
394
+
395
+ ### `/ml:deploy <increment_id>`
396
+
397
+ Generate deployment artifacts.
398
+
399
+ ```bash
400
+ /ml:deploy 0042
401
+
402
+ # Generates:
403
+ # - FastAPI app (api/)
404
+ # - Dockerfile
405
+ # - Monitoring (monitoring/)
406
+ # - A/B test infrastructure (ab-test/)
407
+ # - Load test results
408
+ # - DEPLOYMENT.md runbook
409
+ ```
410
+
411
+ ---
412
+
413
+ ## 💡 Complete ML Workflow Example
414
+
415
+ ### Step 1: Create ML Increment
416
+
417
+ ```bash
418
+ /specweave:inc "build product recommendation model"
419
+ ```
420
+
421
+ **What happens**:
422
+ - ml-pipeline-orchestrator skill activates
423
+ - Creates increment: `0042-product-recommendation-model`
424
+ - Generates ML-specific spec.md, plan.md, tasks.md
425
+
426
+ **Generated spec.md**:
427
+ ```markdown
428
+ ## ML Problem Definition
429
+ - Problem type: Ranking (collaborative filtering)
430
+ - Input: User behavior history (clicks, purchases)
431
+ - Output: Top-10 product recommendations
432
+ - Success metrics: Precision@10 > 0.25, NDCG@10 > 0.30
433
+
434
+ ## Data Requirements
435
+ - Training data: 6 months user interactions
436
+ - Validation: Last month (time-based split)
437
+ - Features: User profile, product attributes, interaction history
438
+
439
+ ## Model Requirements
440
+ - Latency: <100ms inference
441
+ - Throughput: 1000 req/sec
442
+ - Explainability: Show why products recommended
443
+ ```
444
+
445
+ ### Step 2: Execute ML Tasks
446
+
447
+ ```bash
448
+ /specweave:do
449
+ ```
450
+
451
+ **Guided workflow**:
452
+
453
+ **Task 1: Data Exploration**
454
+ ```python
455
+ # Auto-generated EDA template
456
+ from specweave import track_experiment
457
+
458
+ with track_experiment("exp-001-eda", increment="0042") as exp:
459
+ df = pd.read_csv("data/interactions.csv")
460
+
461
+ exp.log_param("dataset_size", len(df))
462
+ exp.log_metric("unique_users", df["user_id"].nunique())
463
+ exp.log_metric("unique_products", df["product_id"].nunique())
464
+
465
+ # Auto-generates: eda-summary.md
466
+ ```
467
+
468
+ **Task 3: Train Baseline**
469
+ ```python
470
+ # Baseline models (mandatory!)
471
+ baselines = ["random", "popularity"]
472
+
473
+ for strategy in baselines:
474
+ with track_experiment(f"baseline-{strategy}", increment="0042") as exp:
475
+ model = BaselineRecommender(strategy=strategy)
476
+ model.fit(interactions)
477
+
478
+ precision_10 = evaluate_recommendations(model, test_users)
479
+ exp.log_metric("precision@10", precision_10)
480
+ ```
481
+
482
+ **Task 4: Train Candidate Models**
483
+ ```python
484
+ # Try multiple algorithms
485
+ candidates = {
486
+ "collaborative-filtering": CollaborativeFiltering(),
487
+ "matrix-factorization": MatrixFactorization(factors=50),
488
+ "neural-cf": NeuralCollaborativeFiltering(layers=[64, 32])
489
+ }
490
+
491
+ for name, model in candidates.items():
492
+ with track_experiment(name, increment="0042") as exp:
493
+ model.fit(train_interactions)
494
+
495
+ metrics = evaluate_model(model, test_users)
496
+ exp.log_metrics(metrics)
497
+ exp.save_model(model, f"{name}.pkl")
498
+ ```
499
+
500
+ **Task 6: Model Evaluation**
501
+ ```python
502
+ # Comprehensive evaluation
503
+ evaluator = ModelEvaluator(
504
+ model=best_model,
505
+ test_data=test_users,
506
+ increment="0042"
507
+ )
508
+
509
+ report = evaluator.evaluate_all()
510
+ # Generates: evaluation-report.md with all metrics
511
+ ```
512
+
513
+ **Task 7: Model Explainability**
514
+ ```python
515
+ # Generate SHAP explanations
516
+ explainer = ModelExplainer(best_model, train_data, increment="0042")
517
+ explainer.generate_all_reports()
518
+
519
+ # Creates:
520
+ # - feature-importance.png
521
+ # - shap-summary.png
522
+ # - example-recommendations-explained.md
523
+ ```
524
+
525
+ ### Step 3: Validate Increment
526
+
527
+ ```bash
528
+ /specweave:validate 0042
529
+ ```
530
+
531
+ **Checks**:
532
+ - ✅ All experiments logged
533
+ - ✅ Best model saved (matrix-factorization)
534
+ - ✅ Evaluation metrics documented
535
+ - ✅ Model meets success criteria (precision@10=0.28 > 0.25 target)
536
+ - ✅ Explainability artifacts present
537
+
538
+ ### Step 4: Complete Increment
539
+
540
+ ```bash
541
+ /specweave:done 0042
542
+ ```
543
+
544
+ **Generates COMPLETION-SUMMARY.md**:
545
+ ```markdown
546
+ ## Product Recommendation Model - COMPLETE
547
+
548
+ ### Experiments Run: 5
549
+ 1. baseline-random: precision@10=0.05
550
+ 2. baseline-popularity: precision@10=0.12
551
+ 3. collaborative-filtering: precision@10=0.22
552
+ 4. matrix-factorization: precision@10=0.28 ✅ BEST
553
+ 5. neural-cf: precision@10=0.26
554
+
555
+ ### Best Model
556
+ - Algorithm: Matrix Factorization (50 factors)
557
+ - Metrics: precision@10=0.28, ndcg@10=0.32
558
+ - Training time: 12 min
559
+ - Model size: 8 MB
560
+ - Inference latency: 35ms (target: <100ms)
561
+
562
+ ### Deployment Ready
563
+ - ✅ Meets accuracy target (precision@10 > 0.25)
564
+ - ✅ Latency acceptable (<100ms)
565
+ - ✅ Explainability: Top factors computed
566
+ - ✅ A/B test plan documented
567
+ ```
568
+
569
+ ### Step 5: Deploy to Production
570
+
571
+ ```bash
572
+ # Create deployment increment
573
+ /specweave:inc "0043-deploy-recommendation-model"
574
+
575
+ # Generate deployment artifacts
576
+ /ml:deploy 0042
577
+
578
+ # Creates:
579
+ # - api/ (FastAPI app)
580
+ # - Dockerfile
581
+ # - monitoring/ (Grafana dashboards)
582
+ # - ab-test/ (10% traffic to new model)
583
+ # - load-tests/ (benchmarked at 1000 RPS)
584
+ ```
585
+
586
+ ### Step 6: Sync Living Docs
587
+
588
+ ```bash
589
+ /specweave:sync-docs update
590
+ ```
591
+
592
+ **Updates**:
593
+ ```markdown
594
+ <!-- .specweave/docs/internal/architecture/ml-models.md -->
595
+
596
+ ## Recommendation Model (Increment 0042)
597
+
598
+ ### Algorithm
599
+ Matrix Factorization with 50 latent factors
600
+
601
+ ### Performance
602
+ - Precision@10: 0.28 (44% better than popularity baseline)
603
+ - NDCG@10: 0.32
604
+ - Inference: 35ms
605
+
606
+ ### Why This Model?
607
+ - Tried 5 approaches (random, popularity, CF, MF, neural)
608
+ - MF best balance of accuracy and speed
609
+ - Neural CF only 2% better but 10x slower
610
+
611
+ ### Deployment
612
+ - Deployed: 2024-01-15
613
+ - A/B test: 10% traffic
614
+ - Monitoring: Grafana dashboard (link)
615
+ ```
616
+
617
+ ---
618
+
619
+ ## 🏆 ML Best Practices (Enforced)
620
+
621
+ ### 1. Always Compare to Baseline
622
+
623
+ ```python
624
+ # The skill REQUIRES baseline models
625
+ baselines = ["random", "majority", "popularity", "rule-based"]
626
+
627
+ # New model must beat best baseline by significant margin (20%+)
628
+ if new_model_accuracy < baseline_accuracy * 1.2:
629
+ warn("New model not significantly better than baseline")
630
+ ```
631
+
632
+ ### 2. Always Use Cross-Validation
633
+
634
+ ```python
635
+ # Never trust single train/test split
636
+ cv_scores = cross_val_score(model, X, y, cv=5)
637
+
638
+ if cv_scores.std() > 0.1:
639
+ warn("High variance - model unstable across folds")
640
+ ```
641
+
642
+ ### 3. Always Track Experiments
643
+
644
+ ```python
645
+ # Every experiment logged, no exceptions
646
+ with track_experiment("xgboost-v1", increment="0042") as exp:
647
+ exp.log_params(params)
648
+ exp.log_metrics(metrics)
649
+ exp.save_model(model)
650
+ exp.log_note("Why this configuration")
651
+ ```
652
+
653
+ ### 4. Always Explain Models
654
+
655
+ ```python
656
+ # Production models MUST be explainable
657
+ explainer = ModelExplainer(model, X_train)
658
+ explainer.generate_all_reports(increment="0042")
659
+
660
+ # No "black boxes" in production
661
+ ```
662
+
663
+ ### 5. Always Load Test Before Production
664
+
665
+ ```python
666
+ # Benchmark performance before deploying
667
+ load_test_results = load_test_model(
668
+ api_url=api_url,
669
+ target_rps=100,
670
+ duration=60
671
+ )
672
+
673
+ if load_test_results["p95_latency"] > 100: # ms
674
+ raise DeploymentError("Latency too high")
675
+ ```
676
+
677
+ ---
678
+
679
+ ## 🔧 Configuration
680
+
681
+ ### MLflow Integration
682
+
683
+ ```python
684
+ # Auto-configured to log to increment
685
+ import mlflow
686
+ from specweave import configure_mlflow
687
+
688
+ configure_mlflow(increment="0042")
689
+
690
+ # All MLflow logs → .specweave/increments/0042.../experiments/
691
+ ```
692
+
693
+ ### Weights & Biases Integration
694
+
695
+ ```python
696
+ import wandb
697
+ from specweave import configure_wandb
698
+
699
+ configure_wandb(increment="0042")
700
+
701
+ # W&B project = increment ID
702
+ # Logs both to W&B dashboard + local increment folder
703
+ ```
704
+
705
+ ### Custom Tracking Backend
706
+
707
+ ```python
708
+ from specweave import register_tracking_backend
709
+
710
+ # Use your own tracking system
711
+ register_tracking_backend(MyCustomTracker)
712
+ ```
713
+
714
+ ---
715
+
716
+ ## 📊 Integration with SpecWeave
717
+
718
+ ### With Increments
719
+
720
+ All ML work is an increment:
721
+ ```
722
+ 0042-recommendation-model # ML feature development
723
+ 0043-deploy-recommendation # Deployment
724
+ 0044-retrain-with-q1-data # Model retraining
725
+ ```
726
+
727
+ ### With Living Docs
728
+
729
+ ML decisions captured in docs:
730
+ ```
731
+ .specweave/docs/internal/
732
+ ├── architecture/
733
+ │ ├── ml-models.md # All models documented
734
+ │ ├── adr/
735
+ │ │ └── 0015-use-matrix-factorization.md
736
+ │ └── diagrams/
737
+ │ └── ml-pipeline.mmd
738
+ └── delivery/
739
+ └── runbooks/
740
+ └── model-retraining.md
741
+ ```
742
+
743
+ ### With GitHub Integration
744
+
745
+ ```bash
746
+ # ML increments sync to GitHub issues
747
+ /specweave:github:sync
748
+
749
+ # Creates issue: "0042: Build recommendation model"
750
+ # Tracks: experiments, model versions, deployment
751
+ ```
752
+
753
+ ---
754
+
755
+ ## 🎯 When to Use This Plugin
756
+
757
+ **Use specweave-ml when you need to**:
758
+
759
+ - ✅ Build ML features with same discipline as software
760
+ - ✅ Track experiments systematically (not scattered notebooks)
761
+ - ✅ Ensure reproducibility (anyone can recreate results)
762
+ - ✅ Maintain team knowledge (living docs capture decisions)
763
+ - ✅ Deploy ML models to production (APIs, monitoring, A/B tests)
764
+ - ✅ Comply with regulations (explainability, audit trails)
765
+
766
+ **Don't use if**:
767
+
768
+ - Quick exploratory analysis (use notebooks directly)
769
+ - One-off experiments (no need for increment overhead)
770
+ - Non-production ML (prototypes, research)
771
+
772
+ ---
773
+
774
+ ## 🚀 Advanced Features
775
+
776
+ ### Multi-Stage ML Pipelines
777
+
778
+ ```python
779
+ from specweave import ExperimentPipeline
780
+
781
+ pipeline = ExperimentPipeline("recommendation-full-pipeline")
782
+
783
+ # Stage 1: Preprocessing
784
+ with pipeline.stage("preprocessing") as stage:
785
+ df_clean = preprocess(df)
786
+ stage.log_metric("rows_after_cleaning", len(df_clean))
787
+
788
+ # Stage 2: Feature engineering
789
+ with pipeline.stage("features") as stage:
790
+ features = engineer_features(df_clean)
791
+ stage.log_metric("num_features", features.shape[1])
792
+
793
+ # Stage 3: Model training
794
+ with pipeline.stage("training") as stage:
795
+ model = train_model(features)
796
+ stage.log_metric("accuracy", accuracy)
797
+
798
+ # Logs entire pipeline with stage dependencies
799
+ ```
800
+
801
+ ### Model Registry
802
+
803
+ ```python
804
+ from specweave import ModelRegistry
805
+
806
+ # Register model versions
807
+ registry = ModelRegistry()
808
+
809
+ registry.register(
810
+ model_path="models/model-v3.pkl",
811
+ name="recommendation-model",
812
+ version="0042-v3",
813
+ metadata={"accuracy": 0.87, "training_date": "2024-01-15"}
814
+ )
815
+
816
+ # Production deployment
817
+ registry.promote_to_production("0042-v3")
818
+
819
+ # Rollback if needed
820
+ registry.rollback_to("0042-v2")
821
+ ```
822
+
823
+ ### Feature Store Integration
824
+
825
+ ```python
826
+ from specweave import FeatureStore
827
+
828
+ # Define features in increment
829
+ features = FeatureStore(increment="0042")
830
+
831
+ features.register(
832
+ name="user_7day_purchase_count",
833
+ definition="COUNT(purchases) WHERE date >= NOW() - 7 days",
834
+ type="int",
835
+ category="user"
836
+ )
837
+
838
+ # Use features across increments
839
+ features_df = features.get_features(["user_7day_purchase_count"])
840
+ ```
841
+
842
+ ---
843
+
844
+ ## 📖 Resources
845
+
846
+ - **SpecWeave Docs**: https://spec-weave.com
847
+ - **ML Plugin Guide**: https://spec-weave.com/plugins/ml
848
+ - **Example Increments**: [examples/ml/](/examples/ml/)
849
+ - **Community**: https://github.com/anton-abyzov/specweave/discussions
850
+
851
+ ---
852
+
853
+ ## 🤝 Contributing
854
+
855
+ Want to improve the ML plugin?
856
+
857
+ ```bash
858
+ # Clone SpecWeave
859
+ git clone https://github.com/anton-abyzov/specweave
860
+
861
+ # Navigate to ML plugin
862
+ cd plugins/specweave-ml
863
+
864
+ # Make improvements
865
+ vim skills/ml-pipeline-orchestrator/SKILL.md
866
+
867
+ # Test
868
+ npm test
869
+
870
+ # Submit PR
871
+ git push && create PR
872
+ ```
873
+
874
+ ---
875
+
876
+ ## 📝 License
877
+
878
+ MIT License - See [LICENSE](../../LICENSE)
879
+
880
+ ---
881
+
882
+ **Transform ML chaos into ML discipline with SpecWeave ML Plugin** 🤖📊✨
883
+
884
+ **Version**: 1.0.0
885
+ **Last Updated**: 2024-01-15