@softspark/ai-toolkit 1.0.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 (327) hide show
  1. package/AGENTS.md +412 -0
  2. package/CHANGELOG.md +68 -0
  3. package/LICENSE +21 -0
  4. package/README.md +632 -0
  5. package/action.yml +53 -0
  6. package/app/.claude-plugin/plugin.json +44 -0
  7. package/app/ARCHITECTURE.md +306 -0
  8. package/app/CLAUDE.md.template +23 -0
  9. package/app/agents/ai-engineer.md +128 -0
  10. package/app/agents/backend-specialist.md +193 -0
  11. package/app/agents/business-intelligence.md +54 -0
  12. package/app/agents/chaos-monkey.md +67 -0
  13. package/app/agents/chief-of-staff.md +51 -0
  14. package/app/agents/code-archaeologist.md +127 -0
  15. package/app/agents/code-reviewer.md +184 -0
  16. package/app/agents/command-expert.md +131 -0
  17. package/app/agents/data-analyst.md +205 -0
  18. package/app/agents/data-scientist.md +151 -0
  19. package/app/agents/database-architect.md +317 -0
  20. package/app/agents/debugger.md +238 -0
  21. package/app/agents/devops-implementer.md +194 -0
  22. package/app/agents/documenter.md +364 -0
  23. package/app/agents/explorer-agent.md +145 -0
  24. package/app/agents/fact-checker.md +172 -0
  25. package/app/agents/frontend-specialist.md +209 -0
  26. package/app/agents/game-developer.md +216 -0
  27. package/app/agents/incident-responder.md +226 -0
  28. package/app/agents/infrastructure-architect.md +127 -0
  29. package/app/agents/infrastructure-validator.md +247 -0
  30. package/app/agents/llm-ops-engineer.md +237 -0
  31. package/app/agents/mcp-expert.md +228 -0
  32. package/app/agents/mcp-server-architect.md +195 -0
  33. package/app/agents/mcp-testing-engineer.md +292 -0
  34. package/app/agents/meta-architect.md +58 -0
  35. package/app/agents/ml-engineer.md +136 -0
  36. package/app/agents/mobile-developer.md +190 -0
  37. package/app/agents/night-watchman.md +55 -0
  38. package/app/agents/nlp-engineer.md +154 -0
  39. package/app/agents/orchestrator.md +437 -0
  40. package/app/agents/performance-optimizer.md +254 -0
  41. package/app/agents/predictive-analyst.md +57 -0
  42. package/app/agents/product-manager.md +194 -0
  43. package/app/agents/project-planner.md +287 -0
  44. package/app/agents/prompt-engineer.md +103 -0
  45. package/app/agents/qa-automation-engineer.md +182 -0
  46. package/app/agents/rag-engineer.md +201 -0
  47. package/app/agents/research-synthesizer.md +138 -0
  48. package/app/agents/search-specialist.md +101 -0
  49. package/app/agents/security-architect.md +62 -0
  50. package/app/agents/security-auditor.md +293 -0
  51. package/app/agents/seo-specialist.md +111 -0
  52. package/app/agents/system-governor.md +57 -0
  53. package/app/agents/tech-lead.md +62 -0
  54. package/app/agents/technical-researcher.md +103 -0
  55. package/app/agents/test-engineer.md +264 -0
  56. package/app/constitution.md +38 -0
  57. package/app/hooks/_profile-check.sh +11 -0
  58. package/app/hooks/guard-destructive.sh +74 -0
  59. package/app/hooks/guard-path.sh +73 -0
  60. package/app/hooks/post-tool-use.sh +35 -0
  61. package/app/hooks/pre-compact.sh +31 -0
  62. package/app/hooks/quality-check.sh +22 -0
  63. package/app/hooks/quality-gate.sh +49 -0
  64. package/app/hooks/save-session.sh +24 -0
  65. package/app/hooks/session-end.sh +37 -0
  66. package/app/hooks/session-start.sh +29 -0
  67. package/app/hooks/subagent-start.sh +16 -0
  68. package/app/hooks/subagent-stop.sh +16 -0
  69. package/app/hooks/track-usage.sh +50 -0
  70. package/app/hooks/user-prompt-submit.sh +25 -0
  71. package/app/hooks.json +178 -0
  72. package/app/mcp-defaults.json +23 -0
  73. package/app/output-styles/golden-rules.md +43 -0
  74. package/app/plugins/README.md +19 -0
  75. package/app/plugins/csharp-pack/README.md +11 -0
  76. package/app/plugins/csharp-pack/plugin.json +18 -0
  77. package/app/plugins/enterprise-pack/README.md +16 -0
  78. package/app/plugins/enterprise-pack/hooks/output-style.sh +6 -0
  79. package/app/plugins/enterprise-pack/hooks/status-line.sh +8 -0
  80. package/app/plugins/enterprise-pack/plugin.json +24 -0
  81. package/app/plugins/frontend-pack/README.md +14 -0
  82. package/app/plugins/frontend-pack/plugin.json +22 -0
  83. package/app/plugins/java-pack/README.md +11 -0
  84. package/app/plugins/java-pack/plugin.json +18 -0
  85. package/app/plugins/kotlin-pack/README.md +11 -0
  86. package/app/plugins/kotlin-pack/plugin.json +18 -0
  87. package/app/plugins/memory-pack/README.md +24 -0
  88. package/app/plugins/memory-pack/hooks/observation-capture.sh +67 -0
  89. package/app/plugins/memory-pack/hooks/session-summary.sh +71 -0
  90. package/app/plugins/memory-pack/plugin.json +22 -0
  91. package/app/plugins/memory-pack/scripts/init_db.py +81 -0
  92. package/app/plugins/memory-pack/scripts/strip_private.py +22 -0
  93. package/app/plugins/memory-pack/skills/mem-search/SKILL.md +70 -0
  94. package/app/plugins/research-pack/README.md +14 -0
  95. package/app/plugins/research-pack/plugin.json +22 -0
  96. package/app/plugins/ruby-pack/README.md +11 -0
  97. package/app/plugins/ruby-pack/plugin.json +18 -0
  98. package/app/plugins/rust-pack/README.md +11 -0
  99. package/app/plugins/rust-pack/plugin.json +18 -0
  100. package/app/plugins/security-pack/README.md +15 -0
  101. package/app/plugins/security-pack/plugin.json +23 -0
  102. package/app/plugins/swift-pack/README.md +11 -0
  103. package/app/plugins/swift-pack/plugin.json +18 -0
  104. package/app/rules/claude-toolkit-rules.md +21 -0
  105. package/app/rules/git-conventions.md +5 -0
  106. package/app/rules/quality-gates.md +10 -0
  107. package/app/skills/_lib/__init__.py +1 -0
  108. package/app/skills/_lib/detect_utils.py +150 -0
  109. package/app/skills/agent-creator/SKILL.md +82 -0
  110. package/app/skills/analyze/SKILL.md +92 -0
  111. package/app/skills/analyze/scripts/complexity.py +165 -0
  112. package/app/skills/api-patterns/SKILL.md +305 -0
  113. package/app/skills/app-builder/SKILL.md +187 -0
  114. package/app/skills/architecture-audit/SKILL.md +141 -0
  115. package/app/skills/architecture-decision/SKILL.md +55 -0
  116. package/app/skills/architecture-decision/templates/adr-template.md +36 -0
  117. package/app/skills/biz-scan/SKILL.md +30 -0
  118. package/app/skills/briefing/SKILL.md +27 -0
  119. package/app/skills/build/SKILL.md +97 -0
  120. package/app/skills/build/scripts/detect-build.py +151 -0
  121. package/app/skills/chaos/SKILL.md +32 -0
  122. package/app/skills/ci/SKILL.md +77 -0
  123. package/app/skills/ci/scripts/ci-detect.py +135 -0
  124. package/app/skills/ci/templates/github-actions-node.yml +38 -0
  125. package/app/skills/ci/templates/github-actions-python.yml +42 -0
  126. package/app/skills/ci-cd-patterns/SKILL.md +299 -0
  127. package/app/skills/clean-code/SKILL.md +110 -0
  128. package/app/skills/clean-code/reference/dart.md +18 -0
  129. package/app/skills/clean-code/reference/go.md +23 -0
  130. package/app/skills/clean-code/reference/php.md +32 -0
  131. package/app/skills/clean-code/reference/python.md +180 -0
  132. package/app/skills/clean-code/reference/typescript.md +26 -0
  133. package/app/skills/command-creator/SKILL.md +83 -0
  134. package/app/skills/commit/SKILL.md +98 -0
  135. package/app/skills/commit/scripts/pre-commit-check.py +87 -0
  136. package/app/skills/commit/templates/conventional-commit.md +52 -0
  137. package/app/skills/csharp-patterns/SKILL.md +450 -0
  138. package/app/skills/database-patterns/SKILL.md +297 -0
  139. package/app/skills/debug/SKILL.md +154 -0
  140. package/app/skills/debug/scripts/error-parser.py +187 -0
  141. package/app/skills/debugging-tactics/SKILL.md +136 -0
  142. package/app/skills/deploy/SKILL.md +130 -0
  143. package/app/skills/deploy/scripts/pre_deploy_check.py +171 -0
  144. package/app/skills/deploy/templates/deployment-checklist.md +31 -0
  145. package/app/skills/design-an-interface/SKILL.md +105 -0
  146. package/app/skills/design-engineering/SKILL.md +260 -0
  147. package/app/skills/docker-devops/SKILL.md +303 -0
  148. package/app/skills/docs/SKILL.md +145 -0
  149. package/app/skills/docs/scripts/doc-inventory.py +176 -0
  150. package/app/skills/docs/templates/adr-template.md +36 -0
  151. package/app/skills/docs/templates/readme-template.md +67 -0
  152. package/app/skills/documentation-standards/SKILL.md +191 -0
  153. package/app/skills/ecommerce-patterns/SKILL.md +209 -0
  154. package/app/skills/evaluate/SKILL.md +132 -0
  155. package/app/skills/evolve/SKILL.md +27 -0
  156. package/app/skills/explain/SKILL.md +54 -0
  157. package/app/skills/explain/scripts/dependency-graph.py +215 -0
  158. package/app/skills/explore/SKILL.md +112 -0
  159. package/app/skills/explore/scripts/visualize.py +117 -0
  160. package/app/skills/fix/SKILL.md +78 -0
  161. package/app/skills/fix/scripts/error-classifier.py +191 -0
  162. package/app/skills/flutter-patterns/SKILL.md +254 -0
  163. package/app/skills/git-mastery/SKILL.md +70 -0
  164. package/app/skills/grill-me/SKILL.md +38 -0
  165. package/app/skills/health/SKILL.md +91 -0
  166. package/app/skills/health/scripts/health_check.py +162 -0
  167. package/app/skills/hive-mind/SKILL.md +56 -0
  168. package/app/skills/hook-creator/SKILL.md +107 -0
  169. package/app/skills/index/SKILL.md +74 -0
  170. package/app/skills/instinct-review/SKILL.md +77 -0
  171. package/app/skills/java-patterns/SKILL.md +442 -0
  172. package/app/skills/kotlin-patterns/SKILL.md +446 -0
  173. package/app/skills/lint/SKILL.md +103 -0
  174. package/app/skills/lint/scripts/detect-linters.py +112 -0
  175. package/app/skills/mcp-patterns/SKILL.md +270 -0
  176. package/app/skills/mem-search/SKILL.md +70 -0
  177. package/app/skills/migrate/SKILL.md +90 -0
  178. package/app/skills/migrate/scripts/migration-status.py +195 -0
  179. package/app/skills/migration-patterns/SKILL.md +260 -0
  180. package/app/skills/night-watch/SKILL.md +28 -0
  181. package/app/skills/observability-patterns/SKILL.md +203 -0
  182. package/app/skills/onboard/SKILL.md +76 -0
  183. package/app/skills/orchestrate/SKILL.md +86 -0
  184. package/app/skills/panic/SKILL.md +30 -0
  185. package/app/skills/performance-profiling/SKILL.md +59 -0
  186. package/app/skills/plan/SKILL.md +110 -0
  187. package/app/skills/plan/templates/plan-template.md +40 -0
  188. package/app/skills/plan-writing/SKILL.md +201 -0
  189. package/app/skills/plugin-creator/SKILL.md +78 -0
  190. package/app/skills/pr/SKILL.md +129 -0
  191. package/app/skills/pr/scripts/pr-summary.py +175 -0
  192. package/app/skills/prd-to-issues/SKILL.md +108 -0
  193. package/app/skills/prd-to-plan/SKILL.md +120 -0
  194. package/app/skills/predict/SKILL.md +30 -0
  195. package/app/skills/qa-session/SKILL.md +110 -0
  196. package/app/skills/rag-patterns/SKILL.md +203 -0
  197. package/app/skills/refactor/SKILL.md +124 -0
  198. package/app/skills/refactor/scripts/refactor-scan.py +210 -0
  199. package/app/skills/refactor-plan/SKILL.md +112 -0
  200. package/app/skills/repeat/SKILL.md +149 -0
  201. package/app/skills/research-mastery/SKILL.md +56 -0
  202. package/app/skills/review/SKILL.md +141 -0
  203. package/app/skills/review/scripts/diff-analyzer.py +170 -0
  204. package/app/skills/rollback/SKILL.md +87 -0
  205. package/app/skills/rollback/scripts/rollback_info.py +149 -0
  206. package/app/skills/ruby-patterns/SKILL.md +454 -0
  207. package/app/skills/rust-patterns/SKILL.md +446 -0
  208. package/app/skills/search/SKILL.md +64 -0
  209. package/app/skills/security-patterns/SKILL.md +91 -0
  210. package/app/skills/security-patterns/reference/authentication.md +37 -0
  211. package/app/skills/security-patterns/reference/authorization.md +22 -0
  212. package/app/skills/security-patterns/reference/input-validation.md +30 -0
  213. package/app/skills/security-patterns/reference/oauth-csrf-audit.md +131 -0
  214. package/app/skills/skill-creator/SKILL.md +154 -0
  215. package/app/skills/skill-creator/templates/dashboard/index.html +130 -0
  216. package/app/skills/skill-creator/templates/reasoning-engine/assets/example.json +12 -0
  217. package/app/skills/skill-creator/templates/reasoning-engine/search.py +110 -0
  218. package/app/skills/subagent-development/SKILL.md +225 -0
  219. package/app/skills/subagent-development/reference/code-quality-reviewer-prompt.md +145 -0
  220. package/app/skills/subagent-development/reference/implementer-prompt.md +118 -0
  221. package/app/skills/subagent-development/reference/spec-reviewer-prompt.md +100 -0
  222. package/app/skills/swarm/SKILL.md +81 -0
  223. package/app/skills/swift-patterns/SKILL.md +500 -0
  224. package/app/skills/tdd/SKILL.md +174 -0
  225. package/app/skills/tdd/reference/deep-modules.md +32 -0
  226. package/app/skills/tdd/reference/interface-design.md +32 -0
  227. package/app/skills/tdd/reference/mocking.md +52 -0
  228. package/app/skills/tdd/reference/refactoring.md +10 -0
  229. package/app/skills/tdd/reference/tests.md +59 -0
  230. package/app/skills/teams/SKILL.md +101 -0
  231. package/app/skills/test/SKILL.md +107 -0
  232. package/app/skills/test/scripts/detect-runner.py +113 -0
  233. package/app/skills/testing-patterns/SKILL.md +73 -0
  234. package/app/skills/testing-patterns/reference/flutter-testing.md +33 -0
  235. package/app/skills/testing-patterns/reference/go-testing.md +52 -0
  236. package/app/skills/testing-patterns/reference/php-phpunit.md +39 -0
  237. package/app/skills/testing-patterns/reference/python-pytest.md +228 -0
  238. package/app/skills/testing-patterns/reference/typescript-vitest.md +50 -0
  239. package/app/skills/triage-issue/SKILL.md +120 -0
  240. package/app/skills/typescript-patterns/SKILL.md +256 -0
  241. package/app/skills/ubiquitous-language/SKILL.md +74 -0
  242. package/app/skills/verification-before-completion/SKILL.md +108 -0
  243. package/app/skills/workflow/SKILL.md +250 -0
  244. package/app/skills/write-a-prd/SKILL.md +129 -0
  245. package/app/skills/write-a-prd/reference/visual-companion.md +78 -0
  246. package/app/skills/write-a-prd/scripts/frame-template.html +111 -0
  247. package/app/skills/write-a-prd/scripts/visual-server.cjs +79 -0
  248. package/app/templates/skill/generator/SKILL.md.template +40 -0
  249. package/app/templates/skill/knowledge/SKILL.md.template +52 -0
  250. package/app/templates/skill/linter/SKILL.md.template +34 -0
  251. package/app/templates/skill/reviewer/SKILL.md.template +51 -0
  252. package/app/templates/skill/workflow/SKILL.md.template +49 -0
  253. package/benchmarks/README.md +111 -0
  254. package/benchmarks/ecosystem-dashboard.json +148 -0
  255. package/benchmarks/ecosystem-harvest.json +148 -0
  256. package/benchmarks/results.json +38 -0
  257. package/benchmarks/run.py +351 -0
  258. package/bin/ai-toolkit.js +345 -0
  259. package/kb/best-practices/README.md +11 -0
  260. package/kb/howto/README.md +11 -0
  261. package/kb/procedures/maintenance-sop.md +306 -0
  262. package/kb/reference/agents-catalog.md +124 -0
  263. package/kb/reference/anti-pattern-registry-format.md +221 -0
  264. package/kb/reference/architecture-overview.md +232 -0
  265. package/kb/reference/benchmark-config.md +62 -0
  266. package/kb/reference/ci-integration.md +66 -0
  267. package/kb/reference/claude-ecosystem-benchmark-snapshot.md +80 -0
  268. package/kb/reference/claude-ecosystem-expansion-foundations.md +102 -0
  269. package/kb/reference/commands-catalog.md +21 -0
  270. package/kb/reference/distribution-model.md +63 -0
  271. package/kb/reference/global-install-model.md +56 -0
  272. package/kb/reference/hierarchical-override-pattern.md +200 -0
  273. package/kb/reference/hooks-catalog.md +306 -0
  274. package/kb/reference/integrations.md +88 -0
  275. package/kb/reference/language-packs.md +52 -0
  276. package/kb/reference/merge-friendly-install-model.md +58 -0
  277. package/kb/reference/plugin-pack-conventions.md +151 -0
  278. package/kb/reference/quick-wins-implementation-summary.md +70 -0
  279. package/kb/reference/skill-templates.md +50 -0
  280. package/kb/reference/skills-catalog.md +215 -0
  281. package/kb/reference/skills-unification.md +57 -0
  282. package/kb/reference/stats.md +69 -0
  283. package/kb/reference/sync.md +76 -0
  284. package/kb/troubleshooting/README.md +11 -0
  285. package/llms-full.txt +3068 -0
  286. package/llms.txt +39 -0
  287. package/package.json +75 -0
  288. package/scripts/_common.py +160 -0
  289. package/scripts/add_rule.py +50 -0
  290. package/scripts/benchmark_config.py +127 -0
  291. package/scripts/benchmark_ecosystem.py +288 -0
  292. package/scripts/check_deps.py +260 -0
  293. package/scripts/create_skill.py +118 -0
  294. package/scripts/doctor.py +504 -0
  295. package/scripts/eject.py +113 -0
  296. package/scripts/emission.py +256 -0
  297. package/scripts/evaluate_skills.py +260 -0
  298. package/scripts/frontmatter.py +58 -0
  299. package/scripts/generate_agents_md.py +91 -0
  300. package/scripts/generate_aider_conf.py +51 -0
  301. package/scripts/generate_cline.py +35 -0
  302. package/scripts/generate_copilot.py +30 -0
  303. package/scripts/generate_cursor_rules.py +35 -0
  304. package/scripts/generate_gemini.py +28 -0
  305. package/scripts/generate_llms_txt.py +164 -0
  306. package/scripts/generate_roo_modes.py +80 -0
  307. package/scripts/generate_windsurf.py +35 -0
  308. package/scripts/generator_base.py +140 -0
  309. package/scripts/harvest_ecosystem.py +50 -0
  310. package/scripts/inject_rule_cli.py +101 -0
  311. package/scripts/inject_section_cli.py +47 -0
  312. package/scripts/injection.py +180 -0
  313. package/scripts/install.py +236 -0
  314. package/scripts/install_git_hooks.py +71 -0
  315. package/scripts/install_steps/__init__.py +5 -0
  316. package/scripts/install_steps/ai_tools.py +261 -0
  317. package/scripts/install_steps/hooks.py +90 -0
  318. package/scripts/install_steps/markers.py +79 -0
  319. package/scripts/install_steps/symlinks.py +87 -0
  320. package/scripts/merge-hooks.py +192 -0
  321. package/scripts/plugin.py +642 -0
  322. package/scripts/plugin_schema.py +138 -0
  323. package/scripts/remove_rule.py +58 -0
  324. package/scripts/stats.py +81 -0
  325. package/scripts/sync.py +215 -0
  326. package/scripts/uninstall.py +292 -0
  327. package/scripts/validate.py +700 -0
@@ -0,0 +1,345 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const { execFileSync, spawnSync, execSync } = require('child_process');
5
+ const path = require('path');
6
+ const fs = require('fs');
7
+
8
+ const TOOLKIT_DIR = path.dirname(__dirname);
9
+ const CWD = process.cwd();
10
+
11
+ // ---------------------------------------------------------------------------
12
+ // Generator map: command name -> { script, dest, mkdir? }
13
+ // Used by individual generator commands, `generate-all`, and the default case.
14
+ // ---------------------------------------------------------------------------
15
+
16
+ /** @type {Record<string, { script: string, dest: string, mkdir?: string }>} */
17
+ const GENERATORS = {
18
+ 'cursor-rules': { script: 'generate_cursor_rules.py', dest: '.cursorrules' },
19
+ 'windsurf-rules': { script: 'generate_windsurf.py', dest: '.windsurfrules' },
20
+ 'copilot-instructions': { script: 'generate_copilot.py', dest: path.join('.github', 'copilot-instructions.md'), mkdir: '.github' },
21
+ 'gemini-md': { script: 'generate_gemini.py', dest: 'GEMINI.md' },
22
+ 'cline-rules': { script: 'generate_cline.py', dest: '.clinerules' },
23
+ 'roo-modes': { script: 'generate_roo_modes.py', dest: '.roomodes' },
24
+ 'aider-conf': { script: 'generate_aider_conf.py', dest: '.aider.conf.yml' },
25
+ 'agents-md': { script: 'generate_agents_md.py', dest: 'AGENTS.md' },
26
+ };
27
+
28
+ // ---------------------------------------------------------------------------
29
+ // Simple script dispatch table: command -> { script, toolkitCwd? }
30
+ // Commands listed here are dispatched generically via `runScript()`.
31
+ // ---------------------------------------------------------------------------
32
+
33
+ /**
34
+ * @type {Record<string, { script: string, toolkitCwd?: boolean }>}
35
+ */
36
+ const SCRIPT_COMMANDS = {
37
+ 'install': { script: 'install.py' },
38
+ 'update': { script: 'install.py' },
39
+ 'uninstall': { script: 'uninstall.py' },
40
+ 'validate': { script: 'validate.py', toolkitCwd: true },
41
+ 'doctor': { script: 'doctor.py', toolkitCwd: true },
42
+ 'eject': { script: 'eject.py' },
43
+ 'benchmark-ecosystem': { script: 'benchmark_ecosystem.py', toolkitCwd: true },
44
+ 'evaluate': { script: 'evaluate_skills.py', toolkitCwd: true },
45
+ 'stats': { script: 'stats.py' },
46
+ };
47
+
48
+ // ---------------------------------------------------------------------------
49
+ // Help text: every available command with a short description.
50
+ // ---------------------------------------------------------------------------
51
+
52
+ /** @type {Record<string, string>} */
53
+ const COMMANDS = {
54
+ install: 'First-time global install into ~/.claude/ (use --local to also set up project configs)',
55
+ update: 'Re-apply toolkit after npm update (use --local to also refresh project configs)',
56
+ reset: 'Wipe and recreate project-local configs from scratch (requires --local)',
57
+ uninstall: 'Remove ai-toolkit from ~/.claude/',
58
+ 'add-rule': 'Register a rule file in ~/.ai-toolkit/rules/ (applied on every install/update)',
59
+ 'remove-rule': 'Unregister a rule from ~/.ai-toolkit/rules/ and remove its block from CLAUDE.md',
60
+ validate: 'Verify toolkit integrity',
61
+ doctor: 'Check install health, hooks, and artifact drift',
62
+ eject: 'Export standalone config (no symlinks, no toolkit dependency)',
63
+ benchmark: 'Benchmark toolkit (--my-config to compare your setup vs defaults vs ecosystem)',
64
+ 'benchmark-ecosystem': 'Generate ecosystem benchmark snapshot (GitHub metadata + offline fallback)',
65
+ evaluate: 'Run skill evaluation suite',
66
+ stats: 'Show skill usage statistics (--reset to clear, --json for raw output)',
67
+ create: 'Scaffold new skill from template (e.g. create skill my-lint --template=linter)',
68
+ plugin: 'Manage plugin packs (install, remove, update, clean, list, status)',
69
+ sync: 'Sync config to/from GitHub Gist (--export, --push, --pull, --import)',
70
+ 'cursor-rules': 'Generate .cursorrules for Cursor IDE',
71
+ 'windsurf-rules': 'Generate .windsurfrules for Windsurf',
72
+ 'copilot-instructions': 'Generate .github/copilot-instructions.md',
73
+ 'gemini-md': 'Generate GEMINI.md for Gemini CLI',
74
+ 'cline-rules': 'Generate .clinerules for Cline',
75
+ 'roo-modes': 'Generate .roomodes for Roo Code',
76
+ 'aider-conf': 'Generate .aider.conf.yml for Aider',
77
+ 'agents-md': 'Regenerate AGENTS.md from agent definitions',
78
+ 'llms-txt': 'Generate llms.txt and llms-full.txt',
79
+ 'generate-all': 'Generate all platform configs at once (agents, cursor, windsurf, copilot, gemini, cline, roo, aider, llms)',
80
+ help: 'Show this help message',
81
+ };
82
+
83
+ // ---------------------------------------------------------------------------
84
+ // Core execution helpers
85
+ // ---------------------------------------------------------------------------
86
+
87
+ /**
88
+ * Resolve the absolute path to a script inside the toolkit's scripts/ dir.
89
+ * @param {string} scriptName - Filename within scripts/ (e.g. "install.sh")
90
+ * @returns {string} Absolute path
91
+ */
92
+ function scriptPath(scriptName) {
93
+ return path.join(TOOLKIT_DIR, 'scripts', scriptName);
94
+ }
95
+
96
+ /**
97
+ * Execute a generator script synchronously via python3, returning its stdout.
98
+ * Exits the process on failure.
99
+ * @param {string} scriptName - Generator script filename in scripts/
100
+ * @param {string[]} [extraArgs=[]] - Additional CLI arguments
101
+ * @returns {Buffer} stdout output
102
+ */
103
+ function runGenerator(scriptName, extraArgs = []) {
104
+ try {
105
+ return execFileSync('python3', [scriptPath(scriptName), ...extraArgs], { cwd: TOOLKIT_DIR });
106
+ } catch (err) {
107
+ console.error(`Error running ${scriptName}: ${err.stderr ? err.stderr.toString().trim() : err.message}`);
108
+ process.exit(1);
109
+ }
110
+ }
111
+
112
+ /**
113
+ * Spawn a script with inherited stdio (interactive). Exits on non-zero status.
114
+ * @param {string} script - Absolute path to the script
115
+ * @param {string[]} [args=[]] - CLI arguments
116
+ * @param {{ cwd?: string }} [opts={}] - Options (cwd override)
117
+ */
118
+ function run(script, args = [], opts = {}) {
119
+ const result = spawnSync('python3', [script, ...args], {
120
+ stdio: 'inherit',
121
+ cwd: opts.cwd || CWD,
122
+ env: { ...process.env },
123
+ });
124
+ if (result.status !== 0) {
125
+ process.exit(result.status || 1);
126
+ }
127
+ }
128
+
129
+ /**
130
+ * Generic dispatcher for SCRIPT_COMMANDS entries.
131
+ * Resolves the script path and selects the correct cwd.
132
+ * @param {string} command - Command name (key in SCRIPT_COMMANDS)
133
+ * @param {string[]} args - CLI arguments to forward
134
+ */
135
+ function runScript(command, args) {
136
+ const entry = SCRIPT_COMMANDS[command];
137
+ const opts = entry.toolkitCwd ? { cwd: TOOLKIT_DIR } : {};
138
+ run(scriptPath(entry.script), args, opts);
139
+ }
140
+
141
+ /**
142
+ * Write generator output to a destination file, creating parent dirs if needed.
143
+ * @param {{ script: string, dest: string, mkdir?: string }} gen - Generator entry
144
+ */
145
+ function writeGeneratorOutput(gen) {
146
+ if (gen.mkdir) {
147
+ const dir = path.join(CWD, gen.mkdir);
148
+ if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
149
+ }
150
+ const output = runGenerator(gen.script);
151
+ fs.writeFileSync(path.join(CWD, gen.dest), output);
152
+ console.log(`Generated: ${gen.dest}`);
153
+ }
154
+
155
+ /**
156
+ * Generate llms.txt and llms-full.txt in the current working directory.
157
+ */
158
+ function generateLlmsTxt() {
159
+ fs.writeFileSync(path.join(CWD, 'llms.txt'), runGenerator('generate_llms_txt.py'));
160
+ fs.writeFileSync(path.join(CWD, 'llms-full.txt'), runGenerator('generate_llms_txt.py', ['--full']));
161
+ console.log('Generated: llms.txt, llms-full.txt');
162
+ }
163
+
164
+ // ---------------------------------------------------------------------------
165
+ // Help
166
+ // ---------------------------------------------------------------------------
167
+
168
+ /**
169
+ * Print CLI usage information to stdout.
170
+ */
171
+ function showHelp() {
172
+ console.log('\nai-toolkit v' + require('../package.json').version);
173
+ console.log('\nUsage: ai-toolkit <command> [options]\n');
174
+ console.log('Commands:');
175
+ for (const [cmd, desc] of Object.entries(COMMANDS)) {
176
+ console.log(` ${cmd.padEnd(16)} ${desc}`);
177
+ }
178
+ console.log('\nOptions for install / update:');
179
+ console.log(' --only <list> Apply only listed components (e.g. agents,hooks,cursor,windsurf,gemini)');
180
+ console.log(' --skip <list> Skip listed components');
181
+ console.log(' --local Also set up project-local configs (CLAUDE.md, settings, constitution, copilot, cline, roo, aider, git hooks)');
182
+ console.log(' --profile <p> Install profile: minimal (agents+skills), standard (default), strict (all+git hooks)');
183
+ console.log(' --list, --dry-run Dry-run: show what would be applied');
184
+ console.log('\nOptions for create:');
185
+ console.log(' skill <name> --template=<type> Scaffold skill (types: linter, reviewer, generator, workflow, knowledge)');
186
+ console.log(' --description "..." Override default description');
187
+ console.log('\nOptions for sync:');
188
+ console.log(' --export Export config snapshot as JSON to stdout');
189
+ console.log(' --push Push config to GitHub Gist (requires gh CLI)');
190
+ console.log(' --pull [gist-id] Pull config from Gist and apply');
191
+ console.log(' --import <file|url> Import config from local file or URL');
192
+ console.log('\nOptions for reset:');
193
+ console.log(' --local Required. Wipe and recreate all project-local configs from scratch');
194
+ console.log('\nOptions for remove-rule:');
195
+ console.log(' <rule-name> Name of rule to unregister (filename without .md)');
196
+ console.log(' [target-dir] Target dir containing .claude/CLAUDE.md (default: $HOME)');
197
+ console.log('\nOptions for add-rule:');
198
+ console.log(' <rule-file> Path to .md rule file to register globally');
199
+ console.log(' [rule-name] Override rule name (default: filename without .md)');
200
+ console.log('\nOptions for plugin:');
201
+ console.log(' install <name> Install a plugin pack (copies hooks, links skills/agents)');
202
+ console.log(' install --all Install all available plugin packs');
203
+ console.log(' update <name> Update a plugin pack (remove + reinstall)');
204
+ console.log(' update --all Update all installed plugin packs');
205
+ console.log(' clean <name> Prune old data (e.g. memory-pack --days 30)');
206
+ console.log(' remove <name> Remove a plugin pack');
207
+ console.log(' remove --all Remove all installed plugins');
208
+ console.log(' list Show available plugin packs with install status');
209
+ console.log(' status Show currently installed plugins with data stats');
210
+ console.log('\nOptions for doctor:');
211
+ console.log(' --fix Auto-repair detected issues');
212
+ console.log('\nOptions for eject:');
213
+ console.log(' [target-dir] Target directory (default: current directory)');
214
+ console.log('');
215
+ }
216
+
217
+ // ---------------------------------------------------------------------------
218
+ // Special-case command handlers
219
+ // Each receives the CLI args array and contains command-specific logic that
220
+ // cannot be expressed through the generic SCRIPT_COMMANDS dispatch table.
221
+ // ---------------------------------------------------------------------------
222
+
223
+ /**
224
+ * Handle `ai-toolkit reset` -- requires --local, transforms args for install.sh.
225
+ * @param {string[]} args
226
+ */
227
+ function handleReset(args) {
228
+ if (!args.includes('--local')) {
229
+ console.error('Error: ai-toolkit reset requires --local flag');
230
+ console.error('Usage: ai-toolkit reset --local');
231
+ process.exit(1);
232
+ }
233
+ run(scriptPath('install.py'), ['--local', '--reset', ...args.filter(a => a !== '--local')]);
234
+ }
235
+
236
+ /**
237
+ * Handle `ai-toolkit benchmark` -- branches on --my-config flag.
238
+ * @param {string[]} args
239
+ */
240
+ function handleBenchmark(args) {
241
+ if (args.includes('--my-config')) {
242
+ run(scriptPath('benchmark_config.py'), [TOOLKIT_DIR]);
243
+ } else {
244
+ run(scriptPath('benchmark_ecosystem.py'), args, { cwd: TOOLKIT_DIR });
245
+ }
246
+ }
247
+
248
+ /**
249
+ * Handle `ai-toolkit create` -- validates subcommand before dispatch.
250
+ * @param {string[]} args
251
+ */
252
+ function handleCreate(args) {
253
+ if (args[0] === 'skill') {
254
+ run(scriptPath('create_skill.py'), args.slice(1), { cwd: TOOLKIT_DIR });
255
+ } else {
256
+ console.error('Usage: ai-toolkit create skill <name> --template=<type>');
257
+ console.error('Templates: linter, reviewer, generator, workflow, knowledge');
258
+ process.exit(1);
259
+ }
260
+ }
261
+
262
+ /**
263
+ * Handle `ai-toolkit sync` -- validates that at least one flag is provided.
264
+ * @param {string[]} args
265
+ */
266
+ function handleSync(args) {
267
+ if (args.length === 0) {
268
+ console.error('Usage: ai-toolkit sync [--export|--push|--pull <gist-id>|--import <file>]');
269
+ process.exit(1);
270
+ }
271
+ run(scriptPath('sync.py'), args);
272
+ }
273
+
274
+ /**
275
+ * Handle `ai-toolkit remove-rule` -- validates rule name, resolves target dir.
276
+ * @param {string[]} args
277
+ */
278
+ function handleRemoveRule(args) {
279
+ const ruleName = args[0];
280
+ if (!ruleName) {
281
+ console.error('Usage: ai-toolkit remove-rule <rule-name> [target-dir]');
282
+ process.exit(1);
283
+ }
284
+ const targetDir = args[1] || process.env.HOME;
285
+ run(scriptPath('remove_rule.py'), [ruleName, targetDir]);
286
+ }
287
+
288
+ /**
289
+ * Handle `ai-toolkit add-rule` -- validates rule file, resolves absolute path.
290
+ * @param {string[]} args
291
+ */
292
+ function handleAddRule(args) {
293
+ const ruleFile = args[0];
294
+ if (!ruleFile) {
295
+ console.error('Usage: ai-toolkit add-rule <rule-file> [rule-name]');
296
+ process.exit(1);
297
+ }
298
+ const absRuleFile = path.resolve(CWD, ruleFile);
299
+ const ruleName = args[1];
300
+ run(scriptPath('add_rule.py'), ruleName ? [absRuleFile, ruleName] : [absRuleFile]);
301
+ }
302
+
303
+ /**
304
+ * Handle `ai-toolkit generate-all` -- runs every generator plus llms-txt.
305
+ * @param {string[]} _args - Unused, kept for signature consistency
306
+ */
307
+ function handleGenerateAll(_args) {
308
+ for (const gen of Object.values(GENERATORS)) {
309
+ writeGeneratorOutput(gen);
310
+ }
311
+ generateLlmsTxt();
312
+ }
313
+
314
+ /** @type {Record<string, (args: string[]) => void>} */
315
+ const SPECIAL_HANDLERS = {
316
+ 'reset': handleReset,
317
+ 'benchmark': handleBenchmark,
318
+ 'create': handleCreate,
319
+ 'sync': handleSync,
320
+ 'plugin': (args) => run(scriptPath('plugin.py'), args),
321
+ 'remove-rule': handleRemoveRule,
322
+ 'add-rule': handleAddRule,
323
+ 'llms-txt': (_args) => generateLlmsTxt(),
324
+ 'generate-all': handleGenerateAll,
325
+ };
326
+
327
+ // ---------------------------------------------------------------------------
328
+ // Main dispatch
329
+ // ---------------------------------------------------------------------------
330
+
331
+ const [,, command, ...args] = process.argv;
332
+
333
+ if (!command || command === 'help' || command === '--help' || command === '-h') {
334
+ showHelp();
335
+ } else if (SPECIAL_HANDLERS[command]) {
336
+ SPECIAL_HANDLERS[command](args);
337
+ } else if (SCRIPT_COMMANDS[command]) {
338
+ runScript(command, args);
339
+ } else if (GENERATORS[command]) {
340
+ writeGeneratorOutput(GENERATORS[command]);
341
+ } else {
342
+ console.error(`Unknown command: ${command}`);
343
+ showHelp();
344
+ process.exit(1);
345
+ }
@@ -0,0 +1,11 @@
1
+ ---
2
+ title: "Best Practices"
3
+ service: ai-toolkit
4
+ category: best-practices
5
+ tags: [best-practices, guidelines]
6
+ last_updated: "2026-03-25"
7
+ ---
8
+
9
+ # Best Practices
10
+
11
+ Guidelines and recommendations. Guides will be added here as they are created.
@@ -0,0 +1,11 @@
1
+ ---
2
+ title: "How-To Guides"
3
+ service: ai-toolkit
4
+ category: howto
5
+ tags: [howto, guides]
6
+ last_updated: "2026-03-25"
7
+ ---
8
+
9
+ # How-To Guides
10
+
11
+ Step-by-step guides for common tasks. Guides will be added here as they are created.
@@ -0,0 +1,306 @@
1
+ ---
2
+ title: "SOP: Claude Toolkit Maintenance"
3
+ category: procedures
4
+ service: ai-toolkit
5
+ tags: [sop, maintenance, agents, skills, install]
6
+ version: "1.0.0"
7
+ created: "2026-03-23"
8
+ last_updated: "2026-04-02"
9
+ description: "Standard operating procedures for installing, maintaining, and evolving the ai-toolkit."
10
+ ---
11
+
12
+ # SOP: Claude Toolkit Maintenance
13
+
14
+ ## Init Repository (New Project)
15
+
16
+ Use this when starting a new project that should use the toolkit.
17
+
18
+ **Prerequisites:** toolkit installed globally (`ai-toolkit install` already done once).
19
+
20
+ ```bash
21
+ cd /path/to/new-project
22
+ ai-toolkit install --local
23
+ ```
24
+
25
+ This creates/updates:
26
+ - `CLAUDE.md` — project-specific rules template (only if missing)
27
+ - `.claude/settings.local.json` — MCP servers, env vars, permissions (only if missing, initialized with MCP defaults)
28
+ - `.claude/constitution.md` — toolkit constitution **injected** via markers (preserves user content)
29
+ - `.github/copilot-instructions.md` — GitHub Copilot rules (marker-injected)
30
+ - `.clinerules` — Cline rules (marker-injected)
31
+ - `.roomodes` — Roo Code custom modes (generated)
32
+ - `.aider.conf.yml` — Aider configuration (generated)
33
+ - `.git/hooks/pre-commit` — Safety fallback for quality gates (generated)
34
+
35
+ **Note:** Hooks are global-only — merged into `~/.claude/settings.json` by `ai-toolkit install`. Project-local `--local` does not install hooks; any legacy `.claude/hooks.json` is removed automatically.
36
+
37
+ Then edit `CLAUDE.md`:
38
+ ```markdown
39
+ # My Project
40
+
41
+ ## Overview
42
+ What this project does.
43
+
44
+ ## Tech Stack
45
+ - Language: TypeScript
46
+ - Framework: Next.js
47
+ - Database: PostgreSQL
48
+
49
+ ## Commands
50
+ # Dev: npm run dev
51
+ # Test: npm test
52
+ # Build: npm run build
53
+ ```
54
+
55
+ ---
56
+
57
+ ## Install Toolkit Globally
58
+
59
+ Run once per machine. Installs into `~/.claude/` — available in all projects.
60
+
61
+ ```bash
62
+ npm install -g @softspark/ai-toolkit # once per machine
63
+ ai-toolkit install # sets up ~/.claude/
64
+ ```
65
+
66
+ What `install` and `update` do (merge-friendly — user content never overwritten):
67
+
68
+ | Component | Strategy | User collision |
69
+ |-----------|----------|---------------|
70
+ | `agents/*.md` | Per-file symlinks into `~/.claude/agents/` | User file with same name preserved (toolkit skipped) |
71
+ | `skills/*/` | Per-directory symlinks into `~/.claude/skills/` | User dir with same name preserved |
72
+ | `settings.json` hooks | JSON merge via `merge-hooks.py` | User hooks + settings preserved, toolkit entries tagged `_source: ai-toolkit` |
73
+ | `constitution.md` | Marker injection via `inject_section_cli.py` | User content outside `<!-- TOOLKIT:* -->` markers untouched |
74
+ | `ARCHITECTURE.md` | Marker injection via `inject_section_cli.py` | Same as above |
75
+ | `CLAUDE.md` | Marker injection of `app/rules/*.md` via `inject_rule_cli.py` | User content outside markers untouched |
76
+
77
+ Re-running updates only toolkit content. Old whole-directory symlinks are auto-upgraded to per-file on next run.
78
+
79
+ ---
80
+
81
+ ## Update Toolkit
82
+
83
+ After a new npm release:
84
+
85
+ ```bash
86
+ npm install -g @softspark/ai-toolkit@latest
87
+ ai-toolkit update
88
+ ```
89
+
90
+ `update` is a semantic alias for `install` — use it for all re-apply flows. Supports the same flags:
91
+
92
+ ```bash
93
+ ai-toolkit update --only agents,hooks # re-apply only specific components
94
+ ai-toolkit update --local # also refresh project-local Copilot + Cline + Roo + Aider
95
+ ai-toolkit update --list # dry-run: show what would change
96
+ ```
97
+
98
+ ---
99
+
100
+ ## Register a Rule from Another Repo
101
+
102
+ Third-party repos (jira-mcp, rag-mcp, etc.) can register their own rules globally:
103
+
104
+ ```bash
105
+ ai-toolkit add-rule ./my-project-rules.md
106
+ # → copies to ~/.ai-toolkit/rules/my-project-rules.md
107
+
108
+ ai-toolkit update
109
+ # → injects the rule into ~/.claude/CLAUDE.md, ~/.cursor/rules, Windsurf, Gemini
110
+ ```
111
+
112
+ To unregister (removes from registry **and** strips the block from CLAUDE.md):
113
+
114
+ ```bash
115
+ ai-toolkit remove-rule my-project-rules
116
+ ```
117
+
118
+ Rule names derive from the filename (`my-project-rules.md` → marker `TOOLKIT:my-project-rules`).
119
+
120
+ ---
121
+
122
+ ## Adding a New Agent
123
+
124
+ 1. Create `app/agents/<agent-name>.md` with YAML frontmatter:
125
+ ```yaml
126
+ ---
127
+ name: agent-name
128
+ description: "When to use this agent. Triggers: keyword1, keyword2."
129
+ tools: Read, Write, Edit, Bash
130
+ model: opus
131
+ skills: skill-1, skill-2
132
+ ---
133
+ ```
134
+ 2. Write agent instructions below frontmatter
135
+ 3. Update `kb/reference/agents-catalog.md`
136
+ 4. Update `app/ARCHITECTURE.md` counts
137
+ 5. Run `scripts/validate.py`
138
+ 6. Regenerate: `scripts/generate_agents_md.py > AGENTS.md`
139
+
140
+ ## Adding a New Skill
141
+
142
+ 1. Create `app/skills/<skill-name>/SKILL.md` with frontmatter:
143
+ ```yaml
144
+ ---
145
+ name: skill-name
146
+ description: "Third-person description. Max 1024 chars."
147
+ effort: medium
148
+ disable-model-invocation: true # task skill
149
+ user-invocable: false # knowledge skill
150
+ ---
151
+ ```
152
+ 2. Update `kb/reference/skills-catalog.md` and `app/ARCHITECTURE.md`
153
+ 3. Run `scripts/validate.py`
154
+
155
+ ## Adding a New Hook
156
+
157
+ Preferred path:
158
+
159
+ ```bash
160
+ /hook-creator [event or hook description]
161
+ ```
162
+
163
+ Manual path:
164
+
165
+ 1. Create `app/hooks/<hook-name>.sh`
166
+ 2. Register the hook under `app/hooks.json`
167
+ 3. Run `scripts/validate.py`
168
+ 4. Run `scripts/doctor.py`
169
+ 5. Update `kb/reference/hooks-catalog.md`, `README.md`, and any affected architecture docs
170
+
171
+ Use `PreToolUse` for blocking validations, `PostToolUse` for non-blocking feedback, `UserPromptSubmit` for prompt governance, and `PreCompact` / `SessionEnd` for context preservation and handoff.
172
+
173
+ ## Managing Plugins
174
+
175
+ ```bash
176
+ ai-toolkit plugin list # show available packs
177
+ ai-toolkit plugin install <name> # install a single pack
178
+ ai-toolkit plugin install --all # install all 11 packs
179
+ ai-toolkit plugin update <name> # update a pack (preserves data)
180
+ ai-toolkit plugin update --all # update all installed packs
181
+ ai-toolkit plugin clean <name> # prune data older than 90 days
182
+ ai-toolkit plugin clean <name> --days 30 # custom retention
183
+ ai-toolkit plugin remove <name> # remove a pack
184
+ ai-toolkit plugin status # show installed packs with data stats
185
+ ```
186
+
187
+ Install copies hooks/scripts, verifies agents+skills are linked, merges hooks into `settings.json`, and runs init scripts. Update removes and reinstalls from current source (data preserved). Clean prunes old plugin data. Remove reverses install but leaves data intact. Core agents/skills are never removed.
188
+
189
+ Memory-pack auto-prunes observations older than 90 days on every session end (configurable via `MEMORY_RETENTION_DAYS`).
190
+
191
+ State tracked in `~/.ai-toolkit/plugins.json`.
192
+
193
+ ## Adding a KB Document
194
+
195
+ Follow the `documentation-standards` knowledge skill (`app/skills/documentation-standards/SKILL.md`) for full spec. Quick checklist:
196
+
197
+ 1. **Choose category directory:** `kb/reference/`, `kb/howto/`, `kb/procedures/`, `kb/troubleshooting/`, or `kb/best-practices/`
198
+ 2. **Create file:** kebab-case name, no dates in filename
199
+ 3. **Add frontmatter** with all 7 required fields: `title`, `category`, `service`, `tags`, `created`, `last_updated`, `description`
200
+ 4. **Write in English**
201
+ 5. **Validate:** `scripts/validate.py` (checks all `kb/**/*.md` frontmatter)
202
+
203
+ **Documents without valid frontmatter will fail `validate.py` and block CI.**
204
+
205
+ ## Adding Scripts to Skills
206
+
207
+ 1. Create `app/skills/<skill-name>/scripts/<script>.py` (stdlib only, JSON output)
208
+ 2. `chmod +x` the script
209
+ 3. Reference: `` python3 ${CLAUDE_SKILL_DIR}/scripts/script.py . ``
210
+
211
+ ## Quality Checks
212
+
213
+ ```bash
214
+ scripts/validate.py # agents, skills, hooks, core files, metadata counts
215
+ scripts/doctor.py # install health, hooks, benchmark freshness, artifact drift diagnostics
216
+ scripts/benchmark_ecosystem.py --offline # ecosystem benchmark snapshot
217
+ scripts/benchmark_ecosystem.py --dashboard-json --out benchmarks/ecosystem-dashboard.json
218
+ scripts/harvest_ecosystem.py --offline # refresh machine-readable ecosystem harvest
219
+ scripts/evaluate_skills.py # skill classification report
220
+ npm test # bats test suite (all workstreams)
221
+ ```
222
+
223
+ Or via CLI:
224
+
225
+ ```bash
226
+ ai-toolkit validate # integrity check
227
+ ai-toolkit doctor # install health diagnostics
228
+ ai-toolkit benchmark-ecosystem --offline # benchmark snapshot
229
+ ```
230
+
231
+ ## Modifying Components
232
+
233
+ Changes propagate instantly to all machines via symlinks. After any change:
234
+
235
+ ```bash
236
+ scripts/validate.py # must pass before commit
237
+ npm test # must pass before commit
238
+ ```
239
+
240
+ If you added/removed agents or skills, also regenerate derived artifacts:
241
+
242
+ ```bash
243
+ npm run generate:all # regenerates AGENTS.md, llms.txt, all platform configs
244
+ ```
245
+
246
+ ## Release Checklist
247
+
248
+ Follow this sequence before every `npm publish` / `git tag`:
249
+
250
+ ### 1. Bump version
251
+
252
+ ```bash
253
+ # Edit package.json version field (semver: X.Y.Z)
254
+ # Add entry to CHANGELOG.md
255
+ ```
256
+
257
+ ### 2. Regenerate all artifacts
258
+
259
+ ```bash
260
+ npm run generate:all
261
+ ```
262
+
263
+ ### 3. Validate and test
264
+
265
+ ```bash
266
+ npm run validate # scripts/validate.py — agents, skills, counts
267
+ npm test # full bats suite including metadata contracts and CLI tests
268
+ ```
269
+
270
+ ### 4. Verify counts are in sync
271
+
272
+ The metadata contract tests (`tests/test_metadata_contracts.bats`) catch drift
273
+ automatically. If they fail, fix the stale numbers before continuing.
274
+
275
+ ### 5. Commit and tag
276
+
277
+ ```bash
278
+ git add -A
279
+ git commit -m "chore: release vX.Y.Z"
280
+ git tag vX.Y.Z
281
+ git push origin main --tags
282
+ ```
283
+
284
+ The publish workflow (`.github/workflows/publish.yml`) picks up the tag, runs full
285
+ validation + tests, regenerates AGENTS.md + llms.txt, and publishes to npm.
286
+
287
+ ## Model Tiers
288
+
289
+ | Agent Type | Model | Examples |
290
+ |-----------|-------|---------|
291
+ | Complex reasoning | opus | orchestrator, backend-specialist, security-auditor |
292
+ | Pattern-following | sonnet | documenter, explorer-agent, data-analyst |
293
+
294
+ ## Uninstall
295
+
296
+ ```bash
297
+ ai-toolkit uninstall # strips toolkit components from ~/.claude/
298
+ ```
299
+
300
+ What `uninstall` does:
301
+ - Removes per-file agent symlinks (user agents preserved)
302
+ - Removes per-directory skill symlinks (user skills preserved)
303
+ - Strips toolkit hook entries from `settings.json` (user hooks + settings preserved)
304
+ - Strips toolkit markers from `constitution.md` and `ARCHITECTURE.md` (user content preserved; empty files removed)
305
+ - `~/.claude/CLAUDE.md` preserved (contains your custom rules + toolkit rule markers)
306
+ - Empty `agents/` and `skills/` directories cleaned up