@c0x12c/ai-toolkit 1.15.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 (255) hide show
  1. package/.claude-plugin/marketplace.json +16 -0
  2. package/.claude-plugin/plugin.json +12 -0
  3. package/README.md +439 -0
  4. package/VERSION +1 -0
  5. package/agents/design-critic.md +127 -0
  6. package/agents/idea-killer.md +72 -0
  7. package/agents/infrastructure-expert.md +49 -0
  8. package/agents/micronaut-backend-expert.md +45 -0
  9. package/agents/phase-reviewer.md +150 -0
  10. package/agents/research-planner.md +70 -0
  11. package/agents/solution-architect-cto.md +49 -0
  12. package/agents/sre-architect.md +49 -0
  13. package/agents/team-coordinator.md +111 -0
  14. package/bin/cli.js +780 -0
  15. package/claude-md/00-header.md +39 -0
  16. package/claude-md/01-core.md +105 -0
  17. package/claude-md/05-database.md +20 -0
  18. package/claude-md/11-backend-micronaut.md +19 -0
  19. package/claude-md/20-frontend-react.md +44 -0
  20. package/claude-md/25-ux-design.md +56 -0
  21. package/claude-md/30-infrastructure.md +24 -0
  22. package/claude-md/30-project-mgmt.md +119 -0
  23. package/claude-md/40-product.md +39 -0
  24. package/claude-md/50-ops.md +34 -0
  25. package/claude-md/60-research.md +27 -0
  26. package/claude-md/90-footer.md +21 -0
  27. package/commands/spartan/brainstorm.md +134 -0
  28. package/commands/spartan/brownfield.md +157 -0
  29. package/commands/spartan/build.md +435 -0
  30. package/commands/spartan/careful.md +94 -0
  31. package/commands/spartan/commit-message.md +112 -0
  32. package/commands/spartan/content.md +17 -0
  33. package/commands/spartan/context-save.md +161 -0
  34. package/commands/spartan/contribute.md +140 -0
  35. package/commands/spartan/daily.md +42 -0
  36. package/commands/spartan/debug.md +308 -0
  37. package/commands/spartan/deep-dive.md +55 -0
  38. package/commands/spartan/deploy.md +207 -0
  39. package/commands/spartan/e2e.md +264 -0
  40. package/commands/spartan/env-setup.md +166 -0
  41. package/commands/spartan/epic.md +199 -0
  42. package/commands/spartan/fe-review.md +181 -0
  43. package/commands/spartan/figma-to-code.md +260 -0
  44. package/commands/spartan/forensics.md +46 -0
  45. package/commands/spartan/freeze.md +84 -0
  46. package/commands/spartan/fundraise.md +53 -0
  47. package/commands/spartan/gate-review.md +229 -0
  48. package/commands/spartan/gsd-upgrade.md +376 -0
  49. package/commands/spartan/guard.md +42 -0
  50. package/commands/spartan/init-project.md +178 -0
  51. package/commands/spartan/init-rules.md +298 -0
  52. package/commands/spartan/interview.md +154 -0
  53. package/commands/spartan/kickoff.md +73 -0
  54. package/commands/spartan/kotlin-service.md +109 -0
  55. package/commands/spartan/lean-canvas.md +222 -0
  56. package/commands/spartan/lint-rules.md +122 -0
  57. package/commands/spartan/map-codebase.md +124 -0
  58. package/commands/spartan/migration.md +82 -0
  59. package/commands/spartan/next-app.md +317 -0
  60. package/commands/spartan/next-feature.md +212 -0
  61. package/commands/spartan/onboard.md +326 -0
  62. package/commands/spartan/outreach.md +16 -0
  63. package/commands/spartan/phase.md +142 -0
  64. package/commands/spartan/pitch.md +18 -0
  65. package/commands/spartan/plan.md +210 -0
  66. package/commands/spartan/pr-ready.md +202 -0
  67. package/commands/spartan/project.md +106 -0
  68. package/commands/spartan/qa.md +222 -0
  69. package/commands/spartan/research.md +254 -0
  70. package/commands/spartan/review.md +132 -0
  71. package/commands/spartan/scan-rules.md +173 -0
  72. package/commands/spartan/sessions.md +143 -0
  73. package/commands/spartan/spec.md +131 -0
  74. package/commands/spartan/startup.md +257 -0
  75. package/commands/spartan/team.md +570 -0
  76. package/commands/spartan/teardown.md +161 -0
  77. package/commands/spartan/testcontainer.md +97 -0
  78. package/commands/spartan/tf-cost.md +123 -0
  79. package/commands/spartan/tf-deploy.md +116 -0
  80. package/commands/spartan/tf-drift.md +100 -0
  81. package/commands/spartan/tf-import.md +107 -0
  82. package/commands/spartan/tf-module.md +121 -0
  83. package/commands/spartan/tf-plan.md +100 -0
  84. package/commands/spartan/tf-review.md +106 -0
  85. package/commands/spartan/tf-scaffold.md +109 -0
  86. package/commands/spartan/tf-security.md +147 -0
  87. package/commands/spartan/think.md +221 -0
  88. package/commands/spartan/unfreeze.md +13 -0
  89. package/commands/spartan/update.md +134 -0
  90. package/commands/spartan/ux.md +1233 -0
  91. package/commands/spartan/validate.md +193 -0
  92. package/commands/spartan/web-to-prd.md +706 -0
  93. package/commands/spartan/workstreams.md +109 -0
  94. package/commands/spartan/write.md +16 -0
  95. package/commands/spartan.md +386 -0
  96. package/frameworks/00-framework-comparison-guide.md +317 -0
  97. package/frameworks/01-lean-canvas.md +196 -0
  98. package/frameworks/02-design-sprint.md +304 -0
  99. package/frameworks/03-foundation-sprint.md +337 -0
  100. package/frameworks/04-business-model-canvas.md +391 -0
  101. package/frameworks/05-customer-development.md +426 -0
  102. package/frameworks/06-jobs-to-be-done.md +358 -0
  103. package/frameworks/07-mom-test.md +392 -0
  104. package/frameworks/08-value-proposition-canvas.md +488 -0
  105. package/frameworks/09-javelin-board.md +428 -0
  106. package/frameworks/10-build-measure-learn.md +467 -0
  107. package/frameworks/11-mvp-approaches.md +533 -0
  108. package/frameworks/think-before-build.md +593 -0
  109. package/lib/assembler.js +197 -0
  110. package/lib/assembler.test.js +159 -0
  111. package/lib/detector.js +166 -0
  112. package/lib/detector.test.js +221 -0
  113. package/lib/packs.js +16 -0
  114. package/lib/resolver.js +272 -0
  115. package/lib/resolver.test.js +298 -0
  116. package/lib/worktree.sh +104 -0
  117. package/package.json +50 -0
  118. package/packs/backend-micronaut.yaml +35 -0
  119. package/packs/backend-nodejs.yaml +15 -0
  120. package/packs/backend-python.yaml +15 -0
  121. package/packs/core.yaml +37 -0
  122. package/packs/database.yaml +21 -0
  123. package/packs/frontend-react.yaml +24 -0
  124. package/packs/infrastructure.yaml +40 -0
  125. package/packs/ops.yaml +16 -0
  126. package/packs/packs.compiled.json +371 -0
  127. package/packs/product.yaml +22 -0
  128. package/packs/project-mgmt.yaml +24 -0
  129. package/packs/research.yaml +39 -0
  130. package/packs/shared-backend.yaml +14 -0
  131. package/packs/ux-design.yaml +21 -0
  132. package/rules/backend-micronaut/API_DESIGN.md +313 -0
  133. package/rules/backend-micronaut/BATCH_PROCESSING.md +92 -0
  134. package/rules/backend-micronaut/CONTROLLERS.md +388 -0
  135. package/rules/backend-micronaut/KOTLIN.md +414 -0
  136. package/rules/backend-micronaut/RETROFIT_PLACEMENT.md +290 -0
  137. package/rules/backend-micronaut/SERVICES_AND_BEANS.md +325 -0
  138. package/rules/core/NAMING_CONVENTIONS.md +208 -0
  139. package/rules/core/SKILL_AUTHORING.md +174 -0
  140. package/rules/core/TIMEZONE.md +316 -0
  141. package/rules/database/ORM_AND_REPO.md +289 -0
  142. package/rules/database/SCHEMA.md +146 -0
  143. package/rules/database/TRANSACTIONS.md +311 -0
  144. package/rules/frontend-react/FRONTEND.md +344 -0
  145. package/rules/infrastructure/MODULES.md +260 -0
  146. package/rules/infrastructure/NAMING.md +196 -0
  147. package/rules/infrastructure/PROVIDERS.md +309 -0
  148. package/rules/infrastructure/SECURITY.md +310 -0
  149. package/rules/infrastructure/STATE_AND_BACKEND.md +237 -0
  150. package/rules/infrastructure/STRUCTURE.md +234 -0
  151. package/rules/infrastructure/VARIABLES.md +285 -0
  152. package/rules/shared-backend/ARCHITECTURE.md +46 -0
  153. package/rules/ux-design/DESIGN_PROCESS.md +176 -0
  154. package/skills/api-endpoint-creator/SKILL.md +455 -0
  155. package/skills/api-endpoint-creator/error-handling-guide.md +244 -0
  156. package/skills/api-endpoint-creator/examples.md +522 -0
  157. package/skills/api-endpoint-creator/testing-patterns.md +302 -0
  158. package/skills/article-writing/SKILL.md +109 -0
  159. package/skills/article-writing/examples.md +59 -0
  160. package/skills/backend-api-design/SKILL.md +84 -0
  161. package/skills/backend-api-design/code-patterns.md +138 -0
  162. package/skills/brainstorm/SKILL.md +95 -0
  163. package/skills/browser-qa/SKILL.md +87 -0
  164. package/skills/browser-qa/playwright-snippets.md +110 -0
  165. package/skills/ci-cd-patterns/SKILL.md +108 -0
  166. package/skills/ci-cd-patterns/workflows.md +149 -0
  167. package/skills/competitive-teardown/SKILL.md +93 -0
  168. package/skills/competitive-teardown/example-analysis.md +50 -0
  169. package/skills/content-engine/SKILL.md +131 -0
  170. package/skills/content-engine/examples.md +72 -0
  171. package/skills/database-patterns/SKILL.md +72 -0
  172. package/skills/database-patterns/code-templates.md +114 -0
  173. package/skills/database-table-creator/SKILL.md +141 -0
  174. package/skills/database-table-creator/examples.md +552 -0
  175. package/skills/database-table-creator/kotlin-templates.md +400 -0
  176. package/skills/database-table-creator/migration-template.sql +68 -0
  177. package/skills/database-table-creator/validation-checklist.md +337 -0
  178. package/skills/deep-research/SKILL.md +80 -0
  179. package/skills/design-intelligence/SKILL.md +268 -0
  180. package/skills/design-workflow/SKILL.md +127 -0
  181. package/skills/design-workflow/checklists.md +45 -0
  182. package/skills/idea-validation/SKILL.md +129 -0
  183. package/skills/idea-validation/example-report.md +50 -0
  184. package/skills/investor-materials/SKILL.md +122 -0
  185. package/skills/investor-materials/example-outline.md +70 -0
  186. package/skills/investor-outreach/SKILL.md +112 -0
  187. package/skills/investor-outreach/examples.md +76 -0
  188. package/skills/kotlin-best-practices/SKILL.md +58 -0
  189. package/skills/kotlin-best-practices/code-patterns.md +132 -0
  190. package/skills/market-research/SKILL.md +99 -0
  191. package/skills/security-checklist/SKILL.md +65 -0
  192. package/skills/security-checklist/audit-reference.md +95 -0
  193. package/skills/service-debugging/SKILL.md +116 -0
  194. package/skills/service-debugging/common-issues.md +65 -0
  195. package/skills/startup-pipeline/SKILL.md +152 -0
  196. package/skills/terraform-best-practices/SKILL.md +244 -0
  197. package/skills/terraform-module-creator/SKILL.md +284 -0
  198. package/skills/terraform-review/SKILL.md +222 -0
  199. package/skills/terraform-security-audit/SKILL.md +280 -0
  200. package/skills/terraform-service-scaffold/SKILL.md +574 -0
  201. package/skills/testing-strategies/SKILL.md +116 -0
  202. package/skills/testing-strategies/examples.md +103 -0
  203. package/skills/testing-strategies/integration-test-setup.md +71 -0
  204. package/skills/ui-ux-pro-max/SKILL.md +238 -0
  205. package/skills/ui-ux-pro-max/data/charts.csv +26 -0
  206. package/skills/ui-ux-pro-max/data/colors.csv +97 -0
  207. package/skills/ui-ux-pro-max/data/icons.csv +101 -0
  208. package/skills/ui-ux-pro-max/data/landing.csv +31 -0
  209. package/skills/ui-ux-pro-max/data/products.csv +97 -0
  210. package/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  211. package/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  212. package/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  213. package/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  214. package/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  215. package/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  216. package/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  217. package/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  218. package/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  219. package/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  220. package/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  221. package/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  222. package/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  223. package/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  224. package/skills/ui-ux-pro-max/data/styles.csv +68 -0
  225. package/skills/ui-ux-pro-max/data/typography.csv +58 -0
  226. package/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  227. package/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  228. package/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
  229. package/skills/ui-ux-pro-max/python-setup.md +146 -0
  230. package/skills/ui-ux-pro-max/scripts/core.py +253 -0
  231. package/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
  232. package/skills/ui-ux-pro-max/scripts/search.py +114 -0
  233. package/skills/web-to-prd/SKILL.md +478 -0
  234. package/templates/build-config.yaml +44 -0
  235. package/templates/commands-config.yaml +55 -0
  236. package/templates/competitor-analysis.md +60 -0
  237. package/templates/content/AGENT_TEMPLATE.md +47 -0
  238. package/templates/content/COMMAND_TEMPLATE.md +27 -0
  239. package/templates/content/RULE_TEMPLATE.md +40 -0
  240. package/templates/content/SKILL_TEMPLATE.md +41 -0
  241. package/templates/design-config.md +105 -0
  242. package/templates/design-doc.md +207 -0
  243. package/templates/epic.md +100 -0
  244. package/templates/feature-spec.md +181 -0
  245. package/templates/idea-canvas.md +47 -0
  246. package/templates/implementation-plan.md +159 -0
  247. package/templates/prd-template.md +86 -0
  248. package/templates/preamble.md +89 -0
  249. package/templates/project-readme.md +35 -0
  250. package/templates/quality-gates.md +230 -0
  251. package/templates/spartan-config.yaml +164 -0
  252. package/templates/user-interview.md +69 -0
  253. package/templates/validation-checklist.md +108 -0
  254. package/templates/workflow-backend-micronaut.md +409 -0
  255. package/templates/workflow-frontend-react.md +233 -0
@@ -0,0 +1,570 @@
1
+ ---
2
+ name: spartan:team
3
+ description: Manage Claude Code Agent Teams — coordinate multi-agent work with shared tasks, messaging, and parallel execution. Bridges wave-based planning with native agent teams.
4
+ argument-hint: "[create | status | wave | review | research | build | clean]"
5
+ preamble-tier: 3
6
+ ---
7
+
8
+ # Agent Teams: {{ args[0] | default: "create" }}
9
+
10
+ You are managing **Claude Code Agent Teams** — multiple Claude Code sessions working together with shared task lists, direct messaging, and coordinated parallel execution.
11
+
12
+ **What are Agent Teams?** Native Claude Code feature where one session (team lead) coordinates multiple teammate sessions. Each teammate has its own context window, works independently, and communicates via messages. Unlike subagents, teammates can talk to each other directly.
13
+
14
+ ---
15
+
16
+ ## Prerequisites Check (always run first)
17
+
18
+ Before any sub-action, check that Agent Teams is enabled:
19
+
20
+ ```bash
21
+ echo "${CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS:-not_set}"
22
+ ```
23
+
24
+ **If `not_set`**, stop and tell the user:
25
+
26
+ > Agent Teams needs to be enabled first. Add this to your settings:
27
+ >
28
+ > **Option A — settings.json** (in `~/.claude/settings.json` or `.claude/settings.json`):
29
+ > ```json
30
+ > {
31
+ > "env": {
32
+ > "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
33
+ > }
34
+ > }
35
+ > ```
36
+ >
37
+ > **Option B — shell** (temporary, current session only):
38
+ > ```bash
39
+ > export CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
40
+ > ```
41
+ >
42
+ > Then run `/spartan:team` again.
43
+
44
+ **If enabled**, proceed to the routed sub-action below.
45
+
46
+ ---
47
+
48
+ ## Route by argument
49
+
50
+ {% if args[0] == "create" or args[0] == nil %}
51
+ ## Create Team
52
+
53
+ Create a new agent team for coordinated parallel work.
54
+
55
+ ### Step 1: Understand the task
56
+
57
+ Ask the user (if not already clear from context):
58
+
59
+ > What's the goal for this team?
60
+ >
61
+ > I'd go with **A** — most tasks fit a small focused team.
62
+ >
63
+ > - **A) Small team (2-3 agents)** — fast coordination, low token cost, good for most tasks
64
+ > - **B) Medium team (4-5 agents)** — parallel research or multi-module builds
65
+ > - **C) Custom** — you tell me the roles
66
+
67
+ ### Step 2: Design the team
68
+
69
+ Based on the task, decide:
70
+ - **Team name** — kebab-case, descriptive (e.g., `auth-refactor`, `api-review`, `market-research`)
71
+ - **Teammate roles** — what each agent does (e.g., "backend-impl", "frontend-impl", "test-writer")
72
+ - **Agent types** — pick the right `subagent_type` for each role:
73
+ - `general-purpose` — for implementation work (has all tools including Edit/Write)
74
+ - `Explore` — for read-only research and codebase exploration
75
+ - `Plan` — for architecture and planning (read-only, no edits)
76
+ - Custom agents from `~/.claude/agents/` — for specialized work (e.g., `phase-reviewer`)
77
+
78
+ ### Step 3: Create the team
79
+
80
+ Use `TeamCreate` with the team name and description:
81
+
82
+ ```
83
+ TeamCreate:
84
+ team_name: "{descriptive-kebab-name}"
85
+ description: "Brief description of what the team is doing"
86
+ ```
87
+
88
+ ### Step 4: Create tasks
89
+
90
+ Use `TaskCreate` for each work item. Set up dependencies with `addBlockedBy` where needed.
91
+
92
+ Good tasks are:
93
+ - **Specific** — "Implement user authentication endpoint" not "do backend work"
94
+ - **Self-contained** — one agent can finish it without waiting on others
95
+ - **Sized right** — 15-60 min of work each. 5-6 tasks per teammate is ideal.
96
+
97
+ ### Step 5: Spawn teammates
98
+
99
+ For each teammate, use the `Agent` tool with `team_name` and `name` parameters:
100
+
101
+ ```
102
+ Agent:
103
+ team_name: "{team-name}"
104
+ name: "{teammate-role}"
105
+ subagent_type: "{agent-type}"
106
+ prompt: |
107
+ You are {role description}.
108
+
109
+ Your tasks are in the shared task list. Check TaskList, claim unassigned
110
+ tasks with TaskUpdate (set owner to your name), and work through them.
111
+
112
+ Context:
113
+ - Project: {brief project context}
114
+ - Your focus: {what this agent should work on}
115
+ - Key files: {relevant file paths}
116
+
117
+ When done with a task, mark it completed and check TaskList for next work.
118
+ Message the team lead if you're blocked or need input.
119
+ ```
120
+
121
+ **Key rules for spawn prompts:**
122
+ - Tell the agent to check `TaskList` and self-claim tasks
123
+ - Give file paths, not inline content (saves context)
124
+ - Reference `.memory/` and `.planning/` if they exist
125
+ - Use `isolation: "worktree"` when agents edit overlapping files
126
+
127
+ ### Step 6: Monitor and coordinate
128
+
129
+ After spawning:
130
+ - Messages from teammates come in automatically — no polling needed
131
+ - Use `SendMessage` to redirect or give feedback
132
+ - Teammates go idle between turns — this is normal, send them a message to wake them up
133
+ - When all tasks are done, proceed to cleanup
134
+
135
+ Tell the user: "Team `{name}` is running with {N} teammates. I'll coordinate and report back as they finish."
136
+
137
+ {% elif args[0] == "status" %}
138
+ ## Team Status
139
+
140
+ Show the current state of the active team.
141
+
142
+ ### Step 1: Find active teams
143
+
144
+ ```bash
145
+ ls -la ~/.claude/teams/ 2>/dev/null || echo "NO_TEAMS_DIR"
146
+ ```
147
+
148
+ If no teams directory or empty, tell user: "No active teams. Run `/spartan:team create` to start one."
149
+
150
+ ### Step 2: Read team config
151
+
152
+ For each team found, read the config:
153
+
154
+ ```bash
155
+ cat ~/.claude/teams/*/config.json 2>/dev/null
156
+ ```
157
+
158
+ ### Step 3: Show task progress
159
+
160
+ Use `TaskList` to show all tasks and their status.
161
+
162
+ Display as a table:
163
+
164
+ ```
165
+ ## Team: {team-name}
166
+ | # | Task | Owner | Status |
167
+ |---|------|-------|--------|
168
+ | 1 | Implement auth endpoint | backend-dev | completed |
169
+ | 2 | Write auth tests | test-writer | in_progress |
170
+ | 3 | Add login page | frontend-dev | pending |
171
+ ```
172
+
173
+ **Summary:** X of Y tasks done. Teammates: {list with idle/active state}.
174
+
175
+ Suggest next actions:
176
+ - All done? → "Run `/spartan:team clean` to shut down"
177
+ - Some stuck? → "I can message {teammate} to check on task #{N}"
178
+ - Need more work? → "I can add more tasks with TaskCreate"
179
+
180
+ {% elif args[0] == "wave" %}
181
+ ## Wave Execution with Agent Teams
182
+
183
+ Execute a GSD wave plan using Agent Teams instead of manual multi-tab work.
184
+
185
+ ### Step 1: Find the wave plan
186
+
187
+ ```bash
188
+ # Look for the current phase plan
189
+ ls .planning/milestones/*/phases/*/PLAN.md 2>/dev/null
190
+ ls .planning/PLAN.md 2>/dev/null
191
+ ```
192
+
193
+ If no plan found:
194
+ > No wave plan found. Run `/spartan:phase plan N` first to create a plan with wave decomposition.
195
+ > Or run `/spartan:team create` to build a team from scratch.
196
+
197
+ If found, read the plan and look for wave structure (sections like "Wave 1", "Wave 2", or work units with dependency info).
198
+
199
+ ### Step 2: Parse waves
200
+
201
+ From the plan, extract:
202
+ - **Work units (WUs)** — each atomic task
203
+ - **Wave assignments** — which WUs can run in parallel (Wave 1), which depend on earlier waves
204
+ - **File paths** — what each WU touches
205
+
206
+ ### Step 3: Create team for current wave
207
+
208
+ Identify which wave to execute (usually the first incomplete one).
209
+
210
+ Use `TeamCreate`:
211
+ ```
212
+ team_name: "{milestone}-wave-{N}"
213
+ description: "Wave {N} execution: {list of WU names}"
214
+ ```
215
+
216
+ ### Step 4: Create tasks from WUs
217
+
218
+ For each WU in the current wave, `TaskCreate` with:
219
+ - Subject from WU name
220
+ - Description from WU spec + acceptance criteria
221
+ - For Wave 2+ WUs, set `addBlockedBy` pointing to Wave 1 task IDs
222
+
223
+ ### Step 5: Spawn one agent per WU
224
+
225
+ Each agent gets:
226
+ - A worktree (`isolation: "worktree"`) for safe parallel edits
227
+ - The WU spec as its prompt
228
+ - References to `.memory/` for project context
229
+ - The specific file paths it should touch
230
+
231
+ ```
232
+ Agent:
233
+ team_name: "{team-name}"
234
+ name: "wu-{N}-{short-slug}"
235
+ subagent_type: "general-purpose"
236
+ isolation: "worktree"
237
+ prompt: |
238
+ You are implementing Work Unit {N}: {WU title}.
239
+
240
+ Spec: {WU description from plan}
241
+ Files to touch: {file list}
242
+ Acceptance criteria: {from plan}
243
+
244
+ Read .memory/index.md for project context.
245
+ Follow TDD: write test first, then implement, then verify.
246
+
247
+ When done, mark your task completed and message the lead.
248
+ ```
249
+
250
+ ### Step 6: Monitor wave completion
251
+
252
+ Wait for all Wave N agents to complete. Between waves:
253
+
254
+ 1. Verify all tests pass:
255
+ ```bash
256
+ # Run the project's test command
257
+ ./gradlew test 2>&1 | tail -20 # or npm test, etc.
258
+ ```
259
+
260
+ 2. If tests pass → advance to Wave N+1 (create new tasks, spawn new agents)
261
+ 3. If tests fail → message the relevant agent to fix, or handle it yourself
262
+
263
+ ### Step 7: Complete
264
+
265
+ After all waves finish:
266
+ - Run full test suite
267
+ - Tell user: "All {N} waves complete. {X} work units done. Tests: {pass/fail}."
268
+ - Suggest: "Run `/spartan:team clean` to shut down, then `/spartan:pr-ready` to ship."
269
+
270
+ {% elif args[0] == "review" %}
271
+ ## Quick Spawn: Review Team
272
+
273
+ Spin up a parallel review team for a PR or set of changes.
274
+
275
+ ### Step 1: Identify what to review
276
+
277
+ Check for a PR number in args, or detect changes:
278
+ ```bash
279
+ git diff --stat main...HEAD 2>/dev/null || git diff --stat HEAD~3..HEAD
280
+ ```
281
+
282
+ ### Step 2: Create review team
283
+
284
+ ```
285
+ TeamCreate:
286
+ team_name: "review-{branch-or-pr}"
287
+ description: "Parallel code review"
288
+ ```
289
+
290
+ ### Step 3: Create review tasks
291
+
292
+ Create 2-3 focused review tasks:
293
+ 1. **Code quality** — design, SOLID, clean code, stack conventions
294
+ 2. **Test coverage** — are tests adequate, edge cases covered, test quality
295
+ 3. **Security** (if applicable) — auth, input validation, data handling
296
+
297
+ ### Step 4: Spawn reviewers — MUST use `team_name` + `name` params
298
+
299
+ ```
300
+ Agent(
301
+ team_name: "review-{branch-or-pr}",
302
+ name: "quality-reviewer",
303
+ subagent_type: "phase-reviewer",
304
+ prompt: "Review code design, SOLID, clean code, stack conventions.
305
+ Changed files: {list}. Check TaskList, claim your task.
306
+ Output: ACCEPT or NEEDS CHANGES with file:line, rule, severity, fix."
307
+ )
308
+
309
+ Agent(
310
+ team_name: "review-{branch-or-pr}",
311
+ name: "test-reviewer",
312
+ subagent_type: "general-purpose",
313
+ prompt: "Review test coverage, edge cases, test quality.
314
+ Changed files: {list}. Check TaskList, claim your task.
315
+ Output: ACCEPT or NEEDS CHANGES."
316
+ )
317
+
318
+ Agent(
319
+ team_name: "review-{branch-or-pr}",
320
+ name: "security-reviewer",
321
+ subagent_type: "general-purpose",
322
+ prompt: "Review auth, input validation, data exposure, injection.
323
+ Changed files: {list}. Check TaskList, claim your task.
324
+ Output: ACCEPT or NEEDS CHANGES."
325
+ )
326
+ ```
327
+
328
+ ### Step 5: Synthesize
329
+
330
+ When all reviewers report back:
331
+ - Combine findings into one review summary
332
+ - Deduplicate overlapping issues
333
+ - Prioritize: HIGH (must fix) → MEDIUM (should fix) → LOW (nice to have)
334
+ - Give verdict: **ACCEPT** or **NEEDS CHANGES**
335
+
336
+ {% elif args[0] == "research" %}
337
+ ## Quick Spawn: Research Team
338
+
339
+ Spin up a research swarm to explore a topic from multiple angles.
340
+
341
+ ### Step 1: Get the topic
342
+
343
+ Use `{{ args[1] }}` if provided, otherwise ask the user what to research.
344
+
345
+ ### Step 2: Create research team
346
+
347
+ ```
348
+ TeamCreate:
349
+ team_name: "research-{topic-slug}"
350
+ description: "Research: {topic}"
351
+ ```
352
+
353
+ ### Step 3: Design research angles
354
+
355
+ Create 2-3 complementary research tasks:
356
+ 1. **Breadth search** — survey the landscape, find key sources, map the space
357
+ 2. **Depth analysis** — go deep on the most promising findings from breadth
358
+ 3. **Contrarian view** (optional) — find counterarguments, risks, things that could go wrong
359
+
360
+ ### Step 4: Spawn researchers — MUST use `team_name` + `name` params
361
+
362
+ ```
363
+ Agent(
364
+ team_name: "research-{topic-slug}",
365
+ name: "surveyor",
366
+ subagent_type: "general-purpose",
367
+ prompt: "Broad survey of: {topic}. Find 8-15 sources, map the landscape.
368
+ Track sources with credibility scores (1-5). Check TaskList, claim your task."
369
+ )
370
+
371
+ Agent(
372
+ team_name: "research-{topic-slug}",
373
+ name: "analyst",
374
+ subagent_type: "general-purpose",
375
+ prompt: "Deep analysis of top sources for: {topic}.
376
+ Cross-reference claims, extract data. Check TaskList, claim your task."
377
+ )
378
+
379
+ Agent(
380
+ team_name: "research-{topic-slug}",
381
+ name: "contrarian",
382
+ subagent_type: "general-purpose",
383
+ prompt: "Challenge assumptions about: {topic}. Find counterarguments, risks, failures.
384
+ Play devil's advocate. Check TaskList, claim your task."
385
+ )
386
+ ```
387
+
388
+ ### Step 5: Synthesize
389
+
390
+ Combine into a structured report:
391
+ - Key findings (agreed across agents)
392
+ - Disagreements (where agents had different conclusions)
393
+ - Recommendations
394
+ - Sources and confidence levels
395
+
396
+ Save to `.planning/research/{topic-slug}.md` if in a project context.
397
+
398
+ {% elif args[0] == "build" %}
399
+ ## Quick Spawn: Build Team
400
+
401
+ Spin up a parallel implementation team for a feature.
402
+
403
+ ### Step 1: Understand the feature
404
+
405
+ Check for existing artifacts:
406
+ ```bash
407
+ ls .planning/specs/ .planning/PLAN.md 2>/dev/null
408
+ ls .planning/designs/*.md 2>/dev/null
409
+ ```
410
+
411
+ If no spec exists, tell user: "No spec found. Run `/spartan:spec` first, or describe the feature and I'll split it into parallel work."
412
+
413
+ If a design doc exists, note its path — you'll pass it to frontend/UI agents in Step 5.
414
+
415
+ ### Step 2: Detect stack and split work
416
+
417
+ ```bash
418
+ ls build.gradle.kts package.json next.config.* 2>/dev/null
419
+ ```
420
+
421
+ Split strategy:
422
+ - **Full-stack** → one backend agent + one frontend agent
423
+ - **Backend only** → split by service boundaries or layers (API + data + tests)
424
+ - **Frontend only** → split by pages/components + tests
425
+
426
+ ### Step 3: Create build team
427
+
428
+ ```
429
+ TeamCreate:
430
+ team_name: "build-{feature-slug}"
431
+ description: "Building: {feature name}"
432
+ ```
433
+
434
+ ### Step 4: Create implementation tasks
435
+
436
+ From the spec/plan, create tasks for each parallel track. Set `addBlockedBy` for tasks that depend on earlier ones (e.g., frontend depends on API being done).
437
+
438
+ ### Step 5: Spawn builders — MUST use `team_name` + `name` params
439
+
440
+ ```
441
+ Agent(
442
+ team_name: "build-{feature-slug}",
443
+ name: "backend-dev",
444
+ subagent_type: "general-purpose",
445
+ isolation: "worktree",
446
+ prompt: "Backend implementation for {feature}.
447
+ Read .memory/index.md for context. Rules: ~/.claude/rules/backend-micronaut/.
448
+ Follow TDD. Check TaskList, claim backend tasks."
449
+ )
450
+
451
+ Agent(
452
+ team_name: "build-{feature-slug}",
453
+ name: "frontend-dev",
454
+ subagent_type: "general-purpose",
455
+ isolation: "worktree",
456
+ prompt: "Frontend implementation for {feature}.
457
+ Read design doc at .planning/designs/{feature}.md FIRST — follow it exactly.
458
+ Rules: ~/.claude/rules/frontend-react/. Follow TDD.
459
+ Check TaskList, claim frontend tasks."
460
+ )
461
+ ```
462
+
463
+ Each builder teammate gets:
464
+ - Worktree isolation (`isolation: "worktree"`)
465
+ - Their track's tasks and file paths
466
+ - Instructions to follow TDD
467
+ - References to relevant rules from installed packs
468
+ - `.memory/` context
469
+ - **Design doc path** (if `.planning/designs/*.md` exists) — frontend/UI teammates MUST read the design doc before building.
470
+
471
+ ### Step 6: Integration
472
+
473
+ After parallel tracks complete:
474
+ 1. Merge worktree changes
475
+ 2. Run full test suite
476
+ 3. Fix any integration issues
477
+ 4. Report results to user
478
+
479
+ {% elif args[0] == "clean" %}
480
+ ## Clean Up Team
481
+
482
+ Shut down all teammates and clean up team resources.
483
+
484
+ ### Step 1: Find active teams
485
+
486
+ ```bash
487
+ ls ~/.claude/teams/ 2>/dev/null || echo "NO_TEAMS"
488
+ ```
489
+
490
+ If no teams, tell user: "No active teams to clean up."
491
+
492
+ ### Step 2: Check for active teammates
493
+
494
+ Read team config to find members. For each active teammate, send a shutdown request:
495
+
496
+ ```
497
+ SendMessage:
498
+ to: "{teammate-name}"
499
+ message:
500
+ type: "shutdown_request"
501
+ reason: "Team work complete, shutting down"
502
+ ```
503
+
504
+ Wait for shutdown responses. If a teammate rejects, tell the user why.
505
+
506
+ ### Step 3: Delete team
507
+
508
+ After all teammates are shut down, use `TeamDelete` to clean up:
509
+
510
+ ```
511
+ TeamDelete: {}
512
+ ```
513
+
514
+ This removes:
515
+ - `~/.claude/teams/{team-name}/`
516
+ - `~/.claude/tasks/{team-name}/`
517
+
518
+ ### Step 4: Report
519
+
520
+ Tell user: "Team `{name}` cleaned up. {N} teammates shut down, task list removed."
521
+
522
+ If there were orphaned tmux sessions:
523
+ ```bash
524
+ tmux ls 2>/dev/null | grep -i "{team-name}" || echo "no orphaned sessions"
525
+ ```
526
+
527
+ If found, suggest: `tmux kill-session -t {session-name}`
528
+
529
+ {% else %}
530
+ ## Unknown argument: {{ args[0] }}
531
+
532
+ Available options:
533
+ - `/spartan:team` — Create a new agent team (default)
534
+ - `/spartan:team create` — Create a team with smart defaults
535
+ - `/spartan:team status` — Show team progress and teammate states
536
+ - `/spartan:team wave` — Execute a GSD wave plan using Agent Teams
537
+ - `/spartan:team review` — Quick-spawn: parallel review team
538
+ - `/spartan:team research` — Quick-spawn: research swarm
539
+ - `/spartan:team build` — Quick-spawn: parallel build team
540
+ - `/spartan:team clean` — Shut down teammates and clean up
541
+ {% endif %}
542
+
543
+ ---
544
+
545
+ ## Best Practices (applies to all sub-actions)
546
+
547
+ ### Team Size
548
+ - **2-3 agents** for most tasks. Start small.
549
+ - **4-5 agents** only when work is truly independent (no shared files).
550
+ - More agents = more tokens. Each agent has its own context window.
551
+
552
+ ### Task Design
553
+ - 5-6 tasks per teammate keeps everyone productive.
554
+ - Each task should be 15-60 min of work.
555
+ - Set `addBlockedBy` for real dependencies. Don't block unnecessarily.
556
+
557
+ ### Isolation
558
+ - Use `isolation: "worktree"` when agents might edit the same files.
559
+ - Without worktrees, agents work in the same repo — last write wins.
560
+
561
+ ### Communication
562
+ - Messages are delivered automatically. Don't poll.
563
+ - Teammates go idle between turns — send a message to wake them up.
564
+ - Use `SendMessage` with `to: "*"` sparingly — it costs tokens for every teammate.
565
+
566
+ ### Integration with Spartan Workflow
567
+ - **After team work** → `/spartan:pr-ready` for the full pre-PR checklist
568
+ - **Wave execution** → `/spartan:team wave` replaces manual multi-tab work from GSD v5
569
+ - **Review teams** → works alongside `/spartan:gate-review` for dual-agent reviews
570
+ - **Research teams** → feeds into `/spartan:research` report format