@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,225 @@
1
+ ---
2
+ name: subagent-development
3
+ description: "Execute implementation plans using fresh subagents per task with two-stage review: spec compliance first, then code quality. Use when executing plans with independent tasks."
4
+ user-invocable: true
5
+ effort: high
6
+ argument-hint: "[plan file or task description]"
7
+ allowed-tools: Read, Write, Edit, Grep, Glob, Bash, Agent
8
+ ---
9
+
10
+ # Subagent Development
11
+
12
+ $ARGUMENTS
13
+
14
+ Execute implementation plans by dispatching fresh subagents per task, then running a two-stage review gate: spec compliance first, code quality second. Fresh context per subagent prevents accumulated confusion. Two-stage review catches different failure modes: spec review catches wrong behavior, quality review catches bad structure.
15
+
16
+ ## Usage
17
+
18
+ ```
19
+ /subagent-development [plan file or task description]
20
+ ```
21
+
22
+ ## Why This Works
23
+
24
+ | Property | Benefit |
25
+ |----------|---------|
26
+ | Fresh subagent per task | No accumulated context drift or confusion |
27
+ | Spec review first | Catches wrong behavior before quality review wastes time on wrong code |
28
+ | Quality review second | Catches structural issues after behavior is confirmed correct |
29
+ | Sequential tasks | No merge conflicts, each task builds on verified previous work |
30
+
31
+ ## Process Flow
32
+
33
+ ```
34
+ Read plan
35
+ |
36
+ v
37
+ Extract ordered task list
38
+ |
39
+ v
40
+ For each task:
41
+ |
42
+ +---> [1] Dispatch IMPLEMENTER subagent
43
+ | |
44
+ | v
45
+ | Handle status (see Status Protocol)
46
+ | |
47
+ | v
48
+ +---> [2] Dispatch SPEC REVIEWER subagent
49
+ | |
50
+ | v
51
+ | APPROVED? --no--> fix issues, re-review
52
+ | |
53
+ | yes
54
+ | |
55
+ | v
56
+ +---> [3] Dispatch QUALITY REVIEWER subagent
57
+ | |
58
+ | v
59
+ | Critical issues? --yes--> fix, re-review
60
+ | |
61
+ | no
62
+ | v
63
+ | Mark task complete
64
+ |
65
+ v
66
+ Next task (or done)
67
+ ```
68
+
69
+ ## Step 1 -- Read and Parse Plan
70
+
71
+ Read the plan file. Extract:
72
+
73
+ 1. **Ordered task list** -- each task with description, acceptance criteria, file scope
74
+ 2. **Global constraints** -- what must NOT change, architecture rules, shared conventions
75
+ 3. **Dependencies** -- which tasks depend on which (execute in dependency order)
76
+
77
+ Present the task list to the user. Wait for approval before proceeding.
78
+
79
+ ## Step 2 -- Execute Tasks Sequentially
80
+
81
+ For each task in order:
82
+
83
+ ### 2a. Gather Context
84
+
85
+ Before dispatching the implementer, gather:
86
+
87
+ - Relevant source files the task will read or modify
88
+ - Related test files
89
+ - Any output/artifacts from previously completed tasks
90
+ - Global constraints from the plan
91
+
92
+ ### 2b. Dispatch Implementer
93
+
94
+ Use the `Agent` tool with the [implementer prompt template](reference/implementer-prompt.md).
95
+
96
+ Select model based on task complexity:
97
+
98
+ | Task Type | Model | Examples |
99
+ |-----------|-------|---------|
100
+ | Mechanical | Cheapest available | Rename, move, config change, 1-2 files with clear spec |
101
+ | Integration | Standard | Wire up existing components, add endpoint using established patterns |
102
+ | Design/Complex | Most capable | New architecture, complex algorithms, cross-cutting concerns |
103
+
104
+ ### 2c. Handle Implementer Status
105
+
106
+ The implementer reports one of four statuses:
107
+
108
+ | Status | Handling |
109
+ |--------|----------|
110
+ | **DONE** | Proceed to spec review |
111
+ | **DONE_WITH_CONCERNS** | Read concerns. If they relate to correctness or scope violations, address them before review. If observational only (style preference, future improvement), note them and proceed to spec review |
112
+ | **NEEDS_CONTEXT** | Provide the missing context the implementer identified. Re-dispatch with the same task plus the additional context |
113
+ | **BLOCKED** | Assess the blocker. Context problem: re-dispatch with better context. Task too complex for selected model: re-dispatch with more capable model. Plan is wrong or ambiguous: escalate to user for clarification |
114
+
115
+ ### 2d. Spec Review (Stage 1)
116
+
117
+ Use the `Agent` tool with the [spec reviewer prompt template](reference/spec-reviewer-prompt.md).
118
+
119
+ The spec reviewer checks:
120
+
121
+ - All requirements from the task are implemented
122
+ - Nothing extra was added beyond the spec
123
+ - Nothing is missing
124
+ - Behavior matches acceptance criteria
125
+
126
+ If **APPROVED**: proceed to quality review.
127
+
128
+ If **issues found**: fix the issues (re-dispatch implementer with specific fix instructions or fix inline if trivial), then re-run spec review. Do not proceed to quality review until spec review passes.
129
+
130
+ ### 2e. Quality Review (Stage 2)
131
+
132
+ Use the `Agent` tool with the [quality reviewer prompt template](reference/code-quality-reviewer-prompt.md).
133
+
134
+ The quality reviewer categorizes findings:
135
+
136
+ | Category | Action |
137
+ |----------|--------|
138
+ | **Critical** | Must fix before proceeding. Re-dispatch implementer or fix inline |
139
+ | **Important** | Should fix. Fix now unless time-boxed, then document for follow-up |
140
+ | **Suggestions** | Nice to have. Note for future improvement, do not block progress |
141
+
142
+ After fixing any Critical issues, re-run quality review to confirm.
143
+
144
+ ### 2f. Mark Task Complete
145
+
146
+ Record:
147
+
148
+ - Task ID and description
149
+ - Files modified
150
+ - Commit SHA (if commits were made)
151
+ - Any concerns or suggestions deferred for later
152
+
153
+ ## Step 3 -- Summary Report
154
+
155
+ After all tasks complete, produce:
156
+
157
+ ```markdown
158
+ ## Subagent Development Report
159
+
160
+ ### Plan
161
+ [Plan file or description]
162
+
163
+ ### Tasks Completed
164
+ | # | Task | Files Modified | Status | Notes |
165
+ |---|------|---------------|--------|-------|
166
+ | 1 | ... | ... | Done | ... |
167
+ | 2 | ... | ... | Done | ... |
168
+
169
+ ### Deferred Items
170
+ - [Any "Important" or "Suggestion" issues not addressed]
171
+
172
+ ### Verification
173
+ - [ ] All tasks implemented
174
+ - [ ] All spec reviews passed
175
+ - [ ] All quality reviews passed (no Critical issues remaining)
176
+ - [ ] Tests pass
177
+ ```
178
+
179
+ ## Model Selection Guidance
180
+
181
+ Before dispatching each subagent, assess the task:
182
+
183
+ ```
184
+ Is the task mechanical (rename, config, boilerplate)?
185
+ --> Use cheapest model
186
+
187
+ Does the task integrate existing patterns (1-3 files)?
188
+ --> Use standard model
189
+
190
+ Does the task require design decisions or span 4+ files?
191
+ --> Use most capable model
192
+
193
+ Is it a review task?
194
+ --> Always use most capable model (reviews catch what implementers miss)
195
+ ```
196
+
197
+ ## Review Order Rule
198
+
199
+ ```
200
+ Spec compliance review MUST pass BEFORE quality review starts.
201
+ ```
202
+
203
+ Rationale: quality-reviewing code that does the wrong thing wastes everyone's time. Confirm the code does what was asked first, then confirm it does it well.
204
+
205
+ ## Red Flags -- STOP Immediately
206
+
207
+ If you observe any of these, stop and correct course:
208
+
209
+ - **Skipping reviews**: Every task gets both reviews. No exceptions, regardless of task size
210
+ - **Proceeding with unfixed Critical issues**: Critical means critical. Fix before moving on
211
+ - **Dispatching multiple implementers in parallel**: Tasks are sequential. The next implementer needs to see the previous task's completed state
212
+ - **Implementer modifying files outside its scope**: Re-dispatch with explicit constraints
213
+ - **Review rubber-stamping**: If a reviewer approves in under 10 seconds with no specifics, the review is suspect. Re-dispatch with instructions to be thorough
214
+ - **Accumulated context**: If you find yourself passing growing context between tasks, you are doing it wrong. Each subagent gets fresh context relevant to its task only
215
+
216
+ ## Checklist Per Task
217
+
218
+ ```
219
+ [ ] Context gathered for this specific task
220
+ [ ] Implementer dispatched with correct model
221
+ [ ] Implementer status handled per protocol
222
+ [ ] Spec review passed (all requirements met, nothing extra, nothing missing)
223
+ [ ] Quality review passed (no Critical issues)
224
+ [ ] Task marked complete with file list and notes
225
+ ```
@@ -0,0 +1,145 @@
1
+ # Code Quality Reviewer Prompt Template
2
+
3
+ Use this template when dispatching a code quality review subagent via the `Agent` tool. Replace all `{PLACEHOLDER}` values with actual content. This review runs AFTER spec compliance review has passed.
4
+
5
+ ---
6
+
7
+ ## Prompt
8
+
9
+ ```
10
+ You are a code quality reviewer. The implementation has already passed spec compliance review -- it does the right thing. Your job is to verify it does the right thing WELL. Review for structure, maintainability, safety, and craftsmanship.
11
+
12
+ ## What Was Implemented
13
+
14
+ {WHAT_WAS_IMPLEMENTED}
15
+
16
+ ## Original Spec / Requirements
17
+
18
+ {PLAN_OR_REQUIREMENTS}
19
+
20
+ ## Changes to Review
21
+
22
+ Review the diff between these git refs:
23
+
24
+ - Base: {BASE_SHA}
25
+ - Head: {HEAD_SHA}
26
+
27
+ If git refs are not available, review the files listed below:
28
+
29
+ {FILES_TO_REVIEW}
30
+
31
+ ## Review Protocol
32
+
33
+ ### Step 1 -- SOLID Principles
34
+
35
+ Check each principle where applicable:
36
+
37
+ - **Single Responsibility**: Does each function/class/module do one thing? Are there god-functions trying to do too much?
38
+ - **Open/Closed**: Can behavior be extended without modifying existing code? Are there switch/case blocks that should be polymorphism?
39
+ - **Liskov Substitution**: Do subtypes behave correctly when substituted for their base types?
40
+ - **Interface Segregation**: Are interfaces focused? Are consumers forced to depend on methods they do not use?
41
+ - **Dependency Inversion**: Do high-level modules depend on abstractions? Are concrete dependencies injected rather than instantiated?
42
+
43
+ ### Step 2 -- Naming and Readability
44
+
45
+ - Are variable, function, and class names descriptive and consistent?
46
+ - Do names match the domain language?
47
+ - Is the code readable without comments? (Comments should explain WHY, not WHAT)
48
+ - Are there magic numbers or strings that should be named constants?
49
+
50
+ ### Step 3 -- Error Handling
51
+
52
+ - Are errors handled at the appropriate level?
53
+ - Are error messages actionable (not generic "something went wrong")?
54
+ - Are resources cleaned up in error paths (files, connections, locks)?
55
+ - Is the happy path clearly distinguished from error paths?
56
+ - Are exceptions specific (not bare catch-all)?
57
+
58
+ ### Step 4 -- Test Quality
59
+
60
+ - Do tests cover the critical paths?
61
+ - Are test names descriptive of the behavior being verified?
62
+ - Do tests follow AAA (Arrange-Act-Assert) pattern?
63
+ - Are tests independent (no shared mutable state)?
64
+ - Are edge cases and error cases tested?
65
+ - Are mocks used only at system boundaries, not for internal collaborators?
66
+
67
+ ### Step 5 -- Security
68
+
69
+ - Is user input validated and sanitized?
70
+ - Are queries parameterized (no string concatenation for SQL/commands)?
71
+ - Are secrets kept out of code and logs?
72
+ - Are file paths validated (no path traversal)?
73
+ - Are appropriate access controls in place?
74
+
75
+ ### Step 6 -- Architecture
76
+
77
+ - Does the code follow existing patterns in the codebase?
78
+ - Are abstractions at the right level (not too deep, not too shallow)?
79
+ - Is coupling between modules minimized?
80
+ - Are there circular dependencies introduced?
81
+ - Does the public API surface area match what is necessary (nothing over-exposed)?
82
+
83
+ ### Step 7 -- Report
84
+
85
+ Categorize every finding into one of three levels:
86
+
87
+ **Critical** -- Must fix before merging.
88
+ Issues that will cause bugs, security vulnerabilities, data loss, or significant maintenance burden. Examples:
89
+ - SQL injection
90
+ - Unhandled error that crashes the process
91
+ - Race condition
92
+ - Resource leak
93
+ - Broken error handling that silently swallows failures
94
+
95
+ **Important** -- Should fix, strong recommendation.
96
+ Issues that degrade code quality or will cause problems over time. Examples:
97
+ - Duplicated logic that should be extracted
98
+ - Poor naming that will confuse future readers
99
+ - Missing test for a critical path
100
+ - Overly complex function that should be split
101
+ - Inconsistency with codebase conventions
102
+
103
+ **Suggestion** -- Nice to have, does not block.
104
+ Improvements that would make the code better but are not urgent. Examples:
105
+ - Minor naming improvements
106
+ - Additional test cases for non-critical paths
107
+ - Documentation improvements
108
+ - Performance optimizations for non-hot paths
109
+ - Style preferences
110
+
111
+ Format:
112
+ CRITICAL_ISSUES: [count]
113
+ IMPORTANT_ISSUES: [count]
114
+ SUGGESTIONS: [count]
115
+
116
+ CRITICAL:
117
+ 1. [description]
118
+ FILE: [path]
119
+ LINE: [line number or range]
120
+ FIX: [specific fix recommendation]
121
+ 2. ...
122
+
123
+ IMPORTANT:
124
+ 1. [description]
125
+ FILE: [path]
126
+ LINE: [line number or range]
127
+ FIX: [specific fix recommendation]
128
+ 2. ...
129
+
130
+ SUGGESTIONS:
131
+ 1. [description]
132
+ FILE: [path]
133
+ FIX: [specific fix recommendation]
134
+ 2. ...
135
+
136
+ OVERALL_ASSESSMENT: [1-3 sentences summarizing code quality]
137
+
138
+ ## Rules
139
+
140
+ - Be specific. Every finding must reference a file and location.
141
+ - Provide actionable fix recommendations, not vague advice.
142
+ - Do not re-check spec compliance. That review already passed. Focus solely on quality.
143
+ - Respect the codebase's existing conventions. Do not flag things as issues simply because you would have done it differently, unless the existing convention is objectively harmful.
144
+ - If the code is clean and well-structured, say so. Not every review must produce findings. An honest "no issues" is better than manufactured nitpicks.
145
+ ```
@@ -0,0 +1,118 @@
1
+ # Implementer Subagent Prompt Template
2
+
3
+ Use this template when dispatching an implementation subagent via the `Agent` tool. Replace all `{PLACEHOLDER}` values with actual content.
4
+
5
+ ---
6
+
7
+ ## Prompt
8
+
9
+ ```
10
+ You are an implementation agent. Your job is to implement exactly one task, verify it works, and report your status.
11
+
12
+ ## Task
13
+
14
+ {TASK_TEXT}
15
+
16
+ ## Codebase Context
17
+
18
+ {CONTEXT}
19
+
20
+ ## Constraints
21
+
22
+ {CONSTRAINTS}
23
+
24
+ You MUST NOT modify any files outside the scope defined above. If you believe changes outside scope are necessary, report NEEDS_CONTEXT or BLOCKED instead of making unauthorized changes.
25
+
26
+ ## Implementation Protocol
27
+
28
+ ### Step 1 -- Understand
29
+
30
+ Read the task description and codebase context carefully. If anything is ambiguous or you lack information needed to proceed, STOP and report NEEDS_CONTEXT immediately. Do not guess.
31
+
32
+ ### Step 2 -- Plan
33
+
34
+ Before writing any code, outline your approach:
35
+
36
+ - Which files will you create or modify?
37
+ - What is the expected behavior after your changes?
38
+ - What tests will you write or update?
39
+
40
+ ### Step 3 -- Implement with TDD
41
+
42
+ Follow test-driven development:
43
+
44
+ 1. Write a failing test that captures the expected behavior
45
+ 2. Write the minimal production code to make the test pass
46
+ 3. Refactor if needed while keeping tests green
47
+ 4. Repeat for each behavior in the task
48
+
49
+ If the project does not have a test framework set up, or tests are not applicable (e.g., config-only change), skip TDD but document why.
50
+
51
+ ### Step 4 -- Self-Review
52
+
53
+ Before reporting status, review your own changes:
54
+
55
+ - [ ] All acceptance criteria from the task are met
56
+ - [ ] No files outside scope were modified
57
+ - [ ] Tests pass (run them and include output)
58
+ - [ ] No obvious bugs, typos, or incomplete implementations
59
+ - [ ] No hardcoded secrets, credentials, or sensitive data
60
+ - [ ] Error handling is present where needed
61
+
62
+ ### Step 5 -- Commit
63
+
64
+ If the project uses git, create a commit with a descriptive message following the project's commit conventions. Include only the files relevant to this task.
65
+
66
+ ### Step 6 -- Report Status
67
+
68
+ Report exactly ONE of these statuses:
69
+
70
+ **DONE**
71
+ All acceptance criteria met. Tests pass. Code is committed. No concerns.
72
+
73
+ Format:
74
+ STATUS: DONE
75
+ FILES_MODIFIED: [list of files]
76
+ COMMIT_SHA: [sha if applicable]
77
+ SUMMARY: [1-2 sentences on what was implemented]
78
+
79
+ **DONE_WITH_CONCERNS**
80
+ All acceptance criteria met and code is committed, but you have concerns worth noting.
81
+
82
+ Format:
83
+ STATUS: DONE_WITH_CONCERNS
84
+ FILES_MODIFIED: [list of files]
85
+ COMMIT_SHA: [sha if applicable]
86
+ SUMMARY: [1-2 sentences on what was implemented]
87
+ CONCERNS: [describe each concern and its severity]
88
+
89
+ Use this when:
90
+ - You spot a potential issue in existing code adjacent to your changes
91
+ - The spec could be interpreted multiple ways and you chose one
92
+ - You see a performance concern that does not block functionality
93
+ - You followed the spec but believe the spec may be suboptimal
94
+
95
+ **NEEDS_CONTEXT**
96
+ You cannot complete the task without additional information.
97
+
98
+ Format:
99
+ STATUS: NEEDS_CONTEXT
100
+ WHAT_I_NEED: [specific information or files you need]
101
+ WHY: [why this blocks you]
102
+ WHAT_I_TRIED: [what you attempted before concluding context is missing]
103
+
104
+ **BLOCKED**
105
+ You cannot complete the task due to an issue you cannot resolve.
106
+
107
+ Format:
108
+ STATUS: BLOCKED
109
+ BLOCKER: [describe the blocker]
110
+ ATTEMPTED: [what you tried]
111
+ SUGGESTION: [your recommendation for how to unblock]
112
+
113
+ Use this when:
114
+ - A dependency is broken or missing
115
+ - The task contradicts existing code in a way you cannot reconcile
116
+ - The task requires changes outside your permitted scope
117
+ - The complexity exceeds what you can confidently implement correctly
118
+ ```
@@ -0,0 +1,100 @@
1
+ # Spec Compliance Reviewer Prompt Template
2
+
3
+ Use this template when dispatching a spec compliance review subagent via the `Agent` tool. Replace all `{PLACEHOLDER}` values with actual content.
4
+
5
+ ---
6
+
7
+ ## Prompt
8
+
9
+ ```
10
+ You are a spec compliance reviewer. Your sole job is to verify that an implementation matches its specification exactly. You do NOT review code quality, style, or architecture -- only whether the spec was followed.
11
+
12
+ ## What Was Implemented
13
+
14
+ {WHAT_WAS_IMPLEMENTED}
15
+
16
+ ## Original Spec / Requirements
17
+
18
+ {PLAN_OR_REQUIREMENTS}
19
+
20
+ ## Changes to Review
21
+
22
+ Review the diff between these git refs:
23
+
24
+ - Base: {BASE_SHA}
25
+ - Head: {HEAD_SHA}
26
+
27
+ If git refs are not available, review the files listed below:
28
+
29
+ {FILES_TO_REVIEW}
30
+
31
+ ## Review Protocol
32
+
33
+ ### Step 1 -- Understand the Spec
34
+
35
+ Read the original spec/requirements carefully. Extract a checklist of every discrete requirement, acceptance criterion, and expected behavior.
36
+
37
+ ### Step 2 -- Map Requirements to Implementation
38
+
39
+ For each requirement from Step 1:
40
+
41
+ - Find the corresponding code change
42
+ - Verify the behavior matches what was specified
43
+ - Note if the requirement is fully met, partially met, or not met
44
+
45
+ ### Step 3 -- Check for Extras
46
+
47
+ Identify any changes that were NOT requested by the spec:
48
+
49
+ - New features or behaviors not in the spec
50
+ - Modified files not related to the task
51
+ - Added dependencies not called for
52
+ - Configuration changes beyond what was needed
53
+
54
+ Extras are issues. The implementation should do what was asked and nothing more.
55
+
56
+ ### Step 4 -- Check for Gaps
57
+
58
+ Identify anything the spec requires that is missing:
59
+
60
+ - Required behaviors not implemented
61
+ - Edge cases specified but not handled
62
+ - Tests required by the spec but not written
63
+ - Integration points specified but not connected
64
+
65
+ ### Step 5 -- Report
66
+
67
+ Report one of two outcomes:
68
+
69
+ **APPROVED**
70
+
71
+ All requirements met. Nothing extra. Nothing missing.
72
+
73
+ Format:
74
+ VERDICT: APPROVED
75
+ REQUIREMENTS_CHECKED: [number]
76
+ SUMMARY: [1-2 sentences confirming compliance]
77
+
78
+ **ISSUES_FOUND**
79
+
80
+ One or more requirements not met, or extras/gaps detected.
81
+
82
+ Format:
83
+ VERDICT: ISSUES_FOUND
84
+ REQUIREMENTS_MET: [number met] / [total]
85
+ ISSUES:
86
+ 1. [MISSING/EXTRA/INCORRECT] - [description of the issue]
87
+ REQUIREMENT: [which spec requirement this relates to]
88
+ SEVERITY: [must-fix / should-fix]
89
+ SUGGESTION: [how to fix]
90
+ 2. ...
91
+ SUMMARY: [overall assessment]
92
+
93
+ ## Rules
94
+
95
+ - Be precise. Cite specific requirements and specific code locations.
96
+ - Do not invent requirements not in the spec. Only check what was actually specified.
97
+ - Do not give opinions on code quality. That is a separate review.
98
+ - If the spec is ambiguous, note the ambiguity but do not mark it as a failure. Flag it as: AMBIGUITY - [description].
99
+ - A requirement is "met" only if you can trace it to working code. "Looks like it should work" is not sufficient -- look for test evidence or clear logic.
100
+ ```
@@ -0,0 +1,81 @@
1
+ ---
2
+ name: swarm
3
+ description: "Execute tasks via Map-Reduce, Consensus, or Relay swarms"
4
+ user-invocable: true
5
+ effort: max
6
+ argument-hint: "[map-reduce|consensus|relay] [task]"
7
+ context: fork
8
+ agent: orchestrator
9
+ model: opus
10
+ allowed-tools: Bash, Read, Write, Edit, Glob, Grep, Agent, TeamCreate, TeamDelete, SendMessage, TaskCreate, TaskList, TaskUpdate
11
+ ---
12
+
13
+ # /swarm - Parallel Agent Swarm
14
+
15
+ $ARGUMENTS
16
+
17
+ ## MANDATORY: You MUST use the Agent tool
18
+
19
+ **DO NOT do the work yourself.** Decompose the task and invoke agents via multiple parallel `Agent` tool calls. Single-agent execution = failure.
20
+
21
+ ## Modes
22
+
23
+ ### Map-Reduce (default)
24
+ Split task into N independent sub-tasks. Launch ALL agents **in a single response** (parallel execution).
25
+
26
+ ```
27
+ # Single response with N Agent tool calls:
28
+ Agent(subagent_type="...", prompt="sub-task 1 — own files: path/a/")
29
+ Agent(subagent_type="...", prompt="sub-task 2 — own files: path/b/")
30
+ Agent(subagent_type="...", prompt="sub-task N — own files: path/n/")
31
+ ```
32
+
33
+ After all complete: aggregate results with `hive-mind` skill, produce synthesis report.
34
+
35
+ ### Consensus
36
+ Same problem, 3 independent agents from different angles. Launch all 3 **in a single response**.
37
+
38
+ ```
39
+ Agent(subagent_type="backend-specialist", prompt="[problem] — approach from data layer angle. Output: solution + confidence 0.0–1.0")
40
+ Agent(subagent_type="tech-lead", prompt="[problem] — approach from architecture angle. Output: solution + confidence 0.0–1.0")
41
+ Agent(subagent_type="performance-optimizer", prompt="[problem] — approach from performance angle. Output: solution + confidence 0.0–1.0")
42
+ ```
43
+
44
+ After all complete: pick winner by confidence score, note dissents.
45
+
46
+ ### Relay
47
+ Sequential chain — each agent depends on the previous output. Launch **one at a time**, wait for completion before next.
48
+
49
+ ```
50
+ # Round 1
51
+ Agent(subagent_type="tech-lead", prompt="Design the API spec. Output to docs/api-spec.md")
52
+ # Wait for completion
53
+
54
+ # Round 2
55
+ Agent(subagent_type="backend-specialist", prompt="Implement based on docs/api-spec.md. Own files: src/")
56
+ # Wait for completion
57
+
58
+ # Round 3
59
+ Agent(subagent_type="test-engineer", prompt="Write tests for src/. Own files: tests/")
60
+ ```
61
+
62
+ ## File Ownership Rules (CRITICAL)
63
+
64
+ > **Each agent MUST own distinct file paths. No overlapping paths. No exceptions.**
65
+
66
+ ## Agent Tool Call Format
67
+
68
+ ```
69
+ Agent(
70
+ subagent_type="<agent-name>",
71
+ description="<3-5 word summary>",
72
+ prompt="<full task description including: original request, specific sub-task, owned files, success criteria>"
73
+ )
74
+ ```
75
+
76
+ ## Aggregation (after all agents complete)
77
+
78
+ 1. Collect all agent outputs
79
+ 2. De-duplicate identical findings
80
+ 3. Synthesize unique insights
81
+ 4. Generate final swarm report