@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,1233 @@
1
+ ---
2
+ name: spartan:ux
3
+ description: "UX design workflow — research, define, ideate, design system, prototype, test, handoff, QA"
4
+ argument-hint: "[research|define|ideate|system|prototype|test|handoff|qa|audit]"
5
+ preamble-tier: 4
6
+ ---
7
+
8
+ # UX: {{ args[0] | default: "smart router" }}
9
+
10
+ You are the **UX design workflow leader** — the full pipeline from user research to developer handoff and design QA.
11
+
12
+ This command covers the whole UX process. Each sub-command is a phase. You can run them in order, or jump to any phase if you already have the upstream artifacts.
13
+
14
+ ```
15
+ FULL UX PIPELINE:
16
+
17
+ Research → Define → Ideate → System → Prototype → Test → Handoff → QA
18
+ │ │ │ │ │ │ │ │
19
+ insights brief flows tokens screens+gate results specs checklist
20
+ │ │ │ │ │ │ │ │
21
+ .planning/design/research/ definition/ ideation/ system/ screens/ test-results.md
22
+ ```
23
+
24
+ **Quick paths:**
25
+ - New project, starting fresh → run phases in order
26
+ - Existing project, need screens → jump to `prototype`
27
+ - Design system setup only → run `system`
28
+ - Check what's done → run with no args (smart router)
29
+ - Check gaps mid-stream → run `audit`
30
+
31
+ ---
32
+
33
+ {% if args[0] == null or args[0] == "" %}
34
+
35
+ ## Smart Router
36
+
37
+ Let me check what exists and figure out where you are.
38
+
39
+ ```bash
40
+ ls .planning/design/ 2>/dev/null
41
+ ls .planning/design/research/ 2>/dev/null
42
+ ls .planning/design/definition/ 2>/dev/null
43
+ ls .planning/design/ideation/ 2>/dev/null
44
+ ls .planning/design/system/ 2>/dev/null
45
+ ls .planning/design/screens/ 2>/dev/null
46
+ ls .planning/design/test-results.md 2>/dev/null
47
+ ls .planning/design-config.md .claude/design-config.md 2>/dev/null
48
+ ```
49
+
50
+ ### If no `.planning/design/` directory exists
51
+
52
+ This is a fresh start. Ask the user what size project this is:
53
+
54
+ > "No design artifacts found. What size is this project?"
55
+ >
56
+ > - **A) Quick track** — Small feature. Skip research/define, go straight to system + prototype. (1 session)
57
+ > - **B) Standard track** — New feature with some UI. Research + define + prototype. (2-3 sessions)
58
+ > - **C) Full track** — New product or big redesign. All phases, start to finish. (3-5 sessions)
59
+ >
60
+ > I'd pick **A** for most single-feature work.
61
+
62
+ After user picks:
63
+ - **Quick** → Run `system` then `prototype`
64
+ - **Standard** → Run `research` then `define` then `prototype`
65
+ - **Full** → Run all phases in order
66
+
67
+ ### If `.planning/design/` exists
68
+
69
+ Scan the artifacts and show status:
70
+
71
+ ```markdown
72
+ ## UX Pipeline Status
73
+
74
+ | Phase | Status | Artifact |
75
+ |-------|--------|----------|
76
+ | Research | [done/missing] | .planning/design/research/insights.md |
77
+ | Define | [done/missing] | .planning/design/definition/brief.md |
78
+ | Ideate | [done/missing] | .planning/design/ideation/flows.md |
79
+ | System | [done/missing] | .planning/design/system/tokens.md |
80
+ | Prototype | [done/missing] | .planning/design/screens/*.md |
81
+ | Test | [done/missing] | .planning/design/test-results.md |
82
+ | Handoff | [done/missing] | (notes added to screen files) |
83
+ | QA | [done/missing] | .planning/design/qa-checklist.md |
84
+ ```
85
+
86
+ Then suggest:
87
+ > "Next step: `/spartan:ux [next missing phase]`"
88
+
89
+ {% elif args[0] == "research" %}
90
+
91
+ ## Phase 1: User Research
92
+
93
+ Goal: Understand the users, their problems, and the space. Save findings to `.planning/design/research/insights.md`.
94
+
95
+ ```bash
96
+ mkdir -p .planning/design/research
97
+ ```
98
+
99
+ ### Step 1: Pick a research method
100
+
101
+ > "How do you want to research?"
102
+ >
103
+ > - **A) Interview script** — I'll write questions you can ask real users (best for early-stage)
104
+ > - **B) Data synthesis** — You paste user data (surveys, support tickets, analytics) and I'll find patterns
105
+ > - **C) Competitive research** — I'll look at how competitors solve this problem
106
+ > - **D) All of the above** — Full research (takes longer, better results)
107
+ >
108
+ > I'd pick **A** if you have access to users, **C** if you don't.
109
+
110
+ ### Step 2: Interview script (if A or D)
111
+
112
+ Generate 5-7 open-ended interview questions. Follow the Mom Test rules — ask about their life, not your idea.
113
+
114
+ **Question format:**
115
+ - Start with behavior: "Tell me about the last time you..."
116
+ - Ask about frequency: "How often do you..."
117
+ - Ask about pain: "What's the hardest part about..."
118
+ - Ask about current solutions: "How do you handle... today?"
119
+ - Ask about stakes: "What happens when this goes wrong?"
120
+
121
+ **Do NOT ask:**
122
+ - "Would you use a tool that..." (leading)
123
+ - "Do you like..." (yes/no, useless)
124
+ - "What features would you want?" (users can't design)
125
+
126
+ Save the script to `.planning/design/research/interview-script.md`.
127
+
128
+ ### Step 3: Data synthesis (if B or D)
129
+
130
+ If the user pastes data (survey results, support tickets, analytics, user feedback):
131
+
132
+ 1. Read all the data
133
+ 2. Group findings into themes (3-5 themes max)
134
+ 3. For each theme: what users said, how many mentioned it, severity
135
+ 4. Pull out direct quotes that show the pain
136
+ 5. Flag anything surprising or contradictory
137
+
138
+ ### Step 4: Competitive research (if C or D)
139
+
140
+ Use WebSearch to find 3-5 competitors or similar products. For each:
141
+
142
+ | Competitor | What they do well | What they do poorly | Gap we can fill |
143
+ |-----------|------------------|--------------------|--------------------|
144
+ | [name] | [strength] | [weakness] | [our angle] |
145
+
146
+ Look at their UX patterns: navigation, onboarding, key flows, empty states, error handling.
147
+
148
+ ### Step 5: Empathy map
149
+
150
+ From all research, build an empathy map:
151
+
152
+ ```markdown
153
+ ## Empathy Map: [User Type]
154
+
155
+ ### Says
156
+ - "[direct quote or paraphrase]"
157
+
158
+ ### Thinks
159
+ - [what they're worried about]
160
+
161
+ ### Does
162
+ - [current behavior and workarounds]
163
+
164
+ ### Feels
165
+ - [emotions: frustrated, confused, anxious, etc.]
166
+ ```
167
+
168
+ ### Step 6: How Might We questions
169
+
170
+ Generate 5-8 "How Might We" questions from the research:
171
+
172
+ ```markdown
173
+ ## How Might We...
174
+
175
+ 1. HMW make [pain point] less painful for [user type]?
176
+ 2. HMW help [user type] when [specific situation]?
177
+ 3. HMW reduce the time it takes to [task]?
178
+ ...
179
+ ```
180
+
181
+ ### Step 7: Save
182
+
183
+ Save everything to `.planning/design/research/insights.md`. Include:
184
+ - Research method(s) used
185
+ - Key findings (grouped by theme)
186
+ - Empathy map
187
+ - HMW questions
188
+ - Competitive landscape (if researched)
189
+
190
+ > "Research saved to `.planning/design/research/insights.md`."
191
+ >
192
+ > **Next:** `/spartan:ux define {{ args[1] | default: "" }}` to turn insights into a design brief.
193
+
194
+ {% elif args[0] == "define" %}
195
+
196
+ ## Phase 2: Problem Definition
197
+
198
+ Goal: Turn research into a clear problem statement, personas, and success metrics. Save to `.planning/design/definition/brief.md`.
199
+
200
+ ```bash
201
+ mkdir -p .planning/design/definition
202
+ ```
203
+
204
+ ### Step 1: Read upstream artifacts
205
+
206
+ ```bash
207
+ cat .planning/design/research/insights.md 2>/dev/null
208
+ cat .planning/specs/*.md 2>/dev/null
209
+ ```
210
+
211
+ If research exists, use it. If not, ask the user to describe the problem and users.
212
+
213
+ ### Step 2: Problem statement
214
+
215
+ Guide the user to fill this format:
216
+
217
+ > **[User type] needs [need] because [insight].**
218
+
219
+ Example: "Sales managers need a way to see which deals are stalling because they currently check 3 different tools and still miss at-risk deals."
220
+
221
+ Ask:
222
+ > "Let's write the problem statement. Fill in:"
223
+ >
224
+ > - **Who** is the user? (job title, not demographics)
225
+ > - **What** do they need to do?
226
+ > - **Why** is this hard today?
227
+ >
228
+ > I'll combine these into a clear problem statement.
229
+
230
+ ### Step 3: Personas (2-3 max)
231
+
232
+ Build behavior-based personas. NOT demographic profiles. Focus on what they do and what gets in their way.
233
+
234
+ ```markdown
235
+ ## Persona: [Name] — [Role]
236
+
237
+ **Goal:** [what they're trying to do]
238
+ **Behavior:** [how they work today]
239
+ **Frustration:** [what blocks them]
240
+ **Trigger:** [when they'd reach for this product]
241
+ **Success looks like:** [how they'd know it worked]
242
+ ```
243
+
244
+ Keep to 2-3 personas. More than that means the scope is too wide.
245
+
246
+ ### Step 4: User journey map
247
+
248
+ Map the current experience (before your solution):
249
+
250
+ ```markdown
251
+ ## Journey: [Main task]
252
+
253
+ | Stage | Action | Thinking | Feeling | Pain point |
254
+ |-------|--------|----------|---------|------------|
255
+ | [stage] | [what they do] | [what they wonder] | [emotion] | [what's broken] |
256
+ ```
257
+
258
+ Mark the worst pain points with severity: High / Medium / Low.
259
+
260
+ ### Step 5: Success metrics
261
+
262
+ Define 3-5 measurable outcomes:
263
+
264
+ ```markdown
265
+ ## Success Metrics
266
+
267
+ | Metric | Current | Target | How to measure |
268
+ |--------|---------|--------|----------------|
269
+ | [metric] | [baseline or "unknown"] | [goal] | [measurement method] |
270
+ ```
271
+
272
+ ### Step 6: Scope
273
+
274
+ Draw a clear line around v1:
275
+
276
+ ```markdown
277
+ ## Scope
278
+
279
+ ### IN for v1
280
+ - [what we'll build]
281
+ - [what we'll build]
282
+
283
+ ### OUT for v1 (maybe later)
284
+ - [what we won't build yet]
285
+ - [what we won't build yet]
286
+
287
+ ### Hard constraints
288
+ - [tech limits, timeline, etc.]
289
+ ```
290
+
291
+ ### Step 7: Save
292
+
293
+ Save to `.planning/design/definition/brief.md`.
294
+
295
+ > "Brief saved to `.planning/design/definition/brief.md`."
296
+ >
297
+ > **Next:** `/spartan:ux ideate {{ args[1] | default: "" }}` to explore solutions.
298
+
299
+ {% elif args[0] == "ideate" %}
300
+
301
+ ## Phase 3: Solution Exploration
302
+
303
+ Goal: Generate ideas, pick the best, and sketch user flows. Save to `.planning/design/ideation/flows.md`.
304
+
305
+ ```bash
306
+ mkdir -p .planning/design/ideation
307
+ ```
308
+
309
+ ### Step 1: Read upstream artifacts
310
+
311
+ ```bash
312
+ cat .planning/design/definition/brief.md 2>/dev/null
313
+ cat .planning/design/research/insights.md 2>/dev/null
314
+ ```
315
+
316
+ If brief exists, use the problem statement and personas as input. If not, ask the user to describe what they're solving.
317
+
318
+ ### Step 2: Crazy 8s — generate ideas
319
+
320
+ Generate 8-12 solution ideas. Each idea gets one line. Mix safe and wild ideas.
321
+
322
+ ```markdown
323
+ ## Ideas
324
+
325
+ 1. [safe, obvious approach]
326
+ 2. [variation on #1]
327
+ 3. [different angle]
328
+ 4. [what if we removed X?]
329
+ 5. [what if we automated Y?]
330
+ 6. [copy what [competitor] does but better]
331
+ 7. [wild idea — probably too much but interesting]
332
+ 8. [simplest possible version]
333
+ 9. [what would [reference app] do?]
334
+ 10. [combine #3 and #8]
335
+ ...
336
+ ```
337
+
338
+ For each idea, add a one-line gut check: time to build (days), risk (low/med/high), user value (low/med/high).
339
+
340
+ ### Step 3: Pick top 3
341
+
342
+ > "Here are the ideas ranked by value-to-effort ratio. My top 3:"
343
+ >
344
+ > 1. **[idea]** — [why it's good]
345
+ > 2. **[idea]** — [why it's good]
346
+ > 3. **[idea]** — [why it's good]
347
+ >
348
+ > Which ones do you want to explore? Pick 1-3.
349
+ >
350
+ > I'd go with **#1** for v1.
351
+
352
+ ### Step 4: User flows for top picks
353
+
354
+ For each picked idea, sketch the full user flow:
355
+
356
+ ```markdown
357
+ ## Flow: [Idea name]
358
+
359
+ **Entry point:** [how user gets here]
360
+ **Happy path:**
361
+
362
+ 1. User [action] → sees [result]
363
+ 2. User [action] → sees [result]
364
+ 3. User [action] → sees [result]
365
+ 4. Done → [outcome]
366
+
367
+ **Error paths:**
368
+ - If [condition] → show [error state]
369
+ - If [condition] → redirect to [fallback]
370
+
371
+ **Edge cases:**
372
+ - Empty data → [what happens]
373
+ - Too much data → [what happens]
374
+ - Offline / slow connection → [what happens]
375
+ ```
376
+
377
+ ### Step 5: Information architecture
378
+
379
+ Map out where things live:
380
+
381
+ ```markdown
382
+ ## Information Architecture
383
+
384
+ ### Navigation
385
+ - [section 1]
386
+ - [page A]
387
+ - [page B]
388
+ - [section 2]
389
+ - [page C]
390
+
391
+ ### Data relationships
392
+ - [entity] has many [entity]
393
+ - [entity] belongs to [entity]
394
+
395
+ ### Key screens
396
+ 1. [screen name] — [what it shows]
397
+ 2. [screen name] — [what it shows]
398
+ ...
399
+ ```
400
+
401
+ ### Step 6: Save
402
+
403
+ Save to `.planning/design/ideation/flows.md`.
404
+
405
+ > "Flows saved to `.planning/design/ideation/flows.md`."
406
+ >
407
+ > **Next:** `/spartan:ux system {{ args[1] | default: "" }}` to set up design tokens, or `/spartan:ux prototype {{ args[1] | default: "" }}` if you already have a design system.
408
+
409
+ {% elif args[0] == "system" %}
410
+
411
+ ## Phase 4: Design System Setup
412
+
413
+ Goal: Create design tokens and a component inventory. Save to `.planning/design/system/`.
414
+
415
+ ```bash
416
+ mkdir -p .planning/design/system
417
+ ```
418
+
419
+ ### Step 1: Load the design-intelligence skill
420
+
421
+ Load the `design-intelligence` skill. This has the databases for palettes, typography, and component patterns.
422
+
423
+ ### Step 2: Check for existing config
424
+
425
+ ```bash
426
+ cat .planning/design-config.md 2>/dev/null
427
+ cat .claude/design-config.md 2>/dev/null
428
+ ```
429
+
430
+ If design-config exists, use it as input. If not, ask these questions one at a time:
431
+
432
+ 1. **"What industry is this for?"** (SaaS, fintech, healthcare, ecommerce, social, dev tools, etc.)
433
+ 2. **"What's the brand personality?"**
434
+ - A) Clean + professional (like Linear, Stripe)
435
+ - B) Warm + friendly (like Notion, Slack)
436
+ - C) Bold + energetic (like Vercel, Figma)
437
+ - D) Minimal + serious (like Bloomberg, Terminal)
438
+ - I'd pick **A** for most B2B tools.
439
+ 3. **"Primary brand color?"** (give a hex code, or pick from a category and I'll suggest options)
440
+ 4. **"Light theme, dark theme, or both?"**
441
+ 5. **"Any reference apps for look and feel?"** (optional)
442
+
443
+ ### Step 3: Generate tokens
444
+
445
+ Generate design tokens in 3 formats:
446
+
447
+ #### Token reference doc
448
+
449
+ ```markdown
450
+ ## Design Tokens
451
+
452
+ ### Colors
453
+ | Token | Value | Usage |
454
+ |-------|-------|-------|
455
+ | --color-primary | #[hex] | CTAs, active states, links |
456
+ | --color-primary-hover | #[hex] | Hover state for primary |
457
+ | --color-bg | #[hex] | Page background |
458
+ | --color-bg-secondary | #[hex] | Card/section background |
459
+ | --color-text | #[hex] | Body text |
460
+ | --color-text-secondary | #[hex] | Secondary/muted text |
461
+ | --color-border | #[hex] | Borders and dividers |
462
+ | --color-success | #[hex] | Success states |
463
+ | --color-warning | #[hex] | Warning states |
464
+ | --color-error | #[hex] | Error states |
465
+
466
+ ### Typography
467
+ | Token | Value | Usage |
468
+ |-------|-------|-------|
469
+ | --font-family | [font] | Body text |
470
+ | --font-family-heading | [font] | Headings (if different) |
471
+ | --font-size-xs | [size] | Small labels |
472
+ | --font-size-sm | [size] | Secondary text |
473
+ | --font-size-base | [size] | Body text |
474
+ | --font-size-lg | [size] | Subheadings |
475
+ | --font-size-xl | [size] | Section headings |
476
+ | --font-size-2xl | [size] | Page headings |
477
+ | --font-size-3xl | [size] | Hero text |
478
+
479
+ ### Spacing
480
+ | Token | Value | Usage |
481
+ |-------|-------|-------|
482
+ | --space-1 | 4px | Tight spacing |
483
+ | --space-2 | 8px | Between related items |
484
+ | --space-3 | 12px | Default gap |
485
+ | --space-4 | 16px | Between sections |
486
+ | --space-6 | 24px | Section padding |
487
+ | --space-8 | 32px | Large spacing |
488
+ | --space-12 | 48px | Page sections |
489
+ | --space-16 | 64px | Major sections |
490
+
491
+ ### Radius
492
+ | Token | Value | Usage |
493
+ |-------|-------|-------|
494
+ | --radius-sm | [value] | Inputs, small elements |
495
+ | --radius-md | [value] | Cards, buttons |
496
+ | --radius-lg | [value] | Modals, large containers |
497
+ | --radius-full | 9999px | Avatars, pills |
498
+
499
+ ### Shadows
500
+ | Token | Value | Usage |
501
+ |-------|-------|-------|
502
+ | --shadow-sm | [value] | Subtle elevation |
503
+ | --shadow-md | [value] | Cards, dropdowns |
504
+ | --shadow-lg | [value] | Modals, dialogs |
505
+ ```
506
+
507
+ #### Tailwind config snippet
508
+
509
+ ```javascript
510
+ // tailwind.config.js — extend section
511
+ {
512
+ colors: {
513
+ primary: { DEFAULT: '#[hex]', hover: '#[hex]', ... },
514
+ // ...
515
+ },
516
+ fontFamily: {
517
+ sans: ['[font]', ...defaultTheme.fontFamily.sans],
518
+ },
519
+ // ...
520
+ }
521
+ ```
522
+
523
+ #### CSS variables
524
+
525
+ ```css
526
+ :root {
527
+ --color-primary: #[hex];
528
+ --color-primary-hover: #[hex];
529
+ /* ... all tokens ... */
530
+ }
531
+ ```
532
+
533
+ ### Step 4: Component inventory
534
+
535
+ Based on the project type and flows (if they exist), list the components needed:
536
+
537
+ ```markdown
538
+ ## Component Inventory
539
+
540
+ ### Core (every project needs these)
541
+ - [ ] Button (primary, secondary, ghost, danger)
542
+ - [ ] Input (text, email, password, search)
543
+ - [ ] Select / Dropdown
544
+ - [ ] Checkbox / Toggle
545
+ - [ ] Avatar
546
+ - [ ] Badge / Tag
547
+ - [ ] Toast / Notification
548
+ - [ ] Modal / Dialog
549
+ - [ ] Loading spinner / Skeleton
550
+
551
+ ### Navigation
552
+ - [ ] Sidebar
553
+ - [ ] Top bar / Header
554
+ - [ ] Breadcrumbs
555
+ - [ ] Tabs
556
+
557
+ ### Data display
558
+ - [ ] Table (sortable, filterable)
559
+ - [ ] Card
560
+ - [ ] List
561
+ - [ ] Empty state
562
+ - [ ] Error state
563
+ - [ ] Stats / Metric card
564
+
565
+ ### Project-specific
566
+ - [ ] [component based on flows/ideation]
567
+ - [ ] [component based on flows/ideation]
568
+ ```
569
+
570
+ ### Step 5: Save
571
+
572
+ Save tokens to `.planning/design/system/tokens.md`.
573
+ Save component inventory to `.planning/design/system/components.md`.
574
+ If no design-config existed, save it to `.planning/design-config.md` too.
575
+
576
+ > "Design system saved to `.planning/design/system/`."
577
+ >
578
+ > **Next:** `/spartan:ux prototype {{ args[1] | default: "" }}` to design the screens.
579
+
580
+ {% elif args[0] == "prototype" %}
581
+
582
+ ## Phase 5: Screen Design (Prototype)
583
+
584
+ Goal: Design all screens with states, responsive layouts, and accessibility. Get them approved by the design critic. Save to `.planning/design/screens/`.
585
+
586
+ This phase handles screen design with dual-agent review. Same quality bar as the original design workflow.
587
+
588
+ ```bash
589
+ mkdir -p .planning/design/screens
590
+ ```
591
+
592
+ ### Step 1: Read upstream artifacts
593
+
594
+ ```bash
595
+ cat .planning/design/definition/brief.md 2>/dev/null
596
+ cat .planning/design/ideation/flows.md 2>/dev/null
597
+ cat .planning/design/system/tokens.md 2>/dev/null
598
+ cat .planning/design/system/components.md 2>/dev/null
599
+ cat .planning/design-config.md 2>/dev/null
600
+ cat .planning/specs/*.md 2>/dev/null
601
+ ```
602
+
603
+ Use whatever exists. If nothing exists, ask the user to describe what screens they need.
604
+
605
+ ### Load skills
606
+
607
+ Load the `design-workflow` skill for anti-AI-generic rules. Apply these throughout.
608
+ If the `design-intelligence` skill is available, load it for palette and typography reference.
609
+
610
+ ### Step 2: Screen inventory
611
+
612
+ List all screens needed. For each screen, note its states:
613
+
614
+ ```markdown
615
+ ## Screen Inventory
616
+
617
+ | # | Screen | States | Priority |
618
+ |---|--------|--------|----------|
619
+ | 1 | [screen name] | default, loading, empty, error | must-have |
620
+ | 2 | [screen name] | default, editing, saving | must-have |
621
+ | 3 | [screen name] | default, filtered, empty results | nice-to-have |
622
+ ```
623
+
624
+ > "Here are the screens I think we need. Anything to add or remove?"
625
+ >
626
+ > **Auto mode on?** → Show the list, continue without waiting.
627
+
628
+ ### Step 3: Design each screen
629
+
630
+ For each screen (in priority order):
631
+
632
+ #### Wireframe
633
+
634
+ ASCII wireframe showing the layout:
635
+
636
+ ```
637
+ +--------------------------------------------------+
638
+ | [header / nav] |
639
+ +--------------------------------------------------+
640
+ | [sidebar] | [main content] |
641
+ | | |
642
+ | | [section 1] |
643
+ | | [component] [component] |
644
+ | | |
645
+ | | [section 2] |
646
+ | | [component] |
647
+ +--------------------------------------------------+
648
+ ```
649
+
650
+ #### Layout details
651
+
652
+ ```markdown
653
+ ### [Screen Name]
654
+
655
+ **URL:** /[path]
656
+ **Layout:** [sidebar + main / full-width / centered / split]
657
+
658
+ #### Components used
659
+ - [component] — [what data it shows]
660
+ - [component] — [what it does]
661
+
662
+ #### States
663
+ | State | What the user sees | Trigger |
664
+ |-------|-------------------|---------|
665
+ | Default | [description] | Page load with data |
666
+ | Loading | Skeleton placeholders | Initial fetch |
667
+ | Empty | Illustration + message + CTA | No data yet |
668
+ | Error | Error message + retry button | API failure |
669
+ | Success | Toast + updated data | After save/action |
670
+ | [edge case] | [description] | [condition] |
671
+ ```
672
+
673
+ #### Responsive behavior
674
+
675
+ ```markdown
676
+ #### Responsive
677
+
678
+ | Breakpoint | Layout change |
679
+ |-----------|---------------|
680
+ | 375px (mobile) | [what changes — stack columns, hide sidebar, etc.] |
681
+ | 768px (tablet) | [what changes] |
682
+ | 1440px (desktop) | [full layout as wireframed] |
683
+ ```
684
+
685
+ If design tokens exist, use them for colors, spacing, and typography. Don't invent new values.
686
+
687
+ ### Step 4: Motion plan
688
+
689
+ For the whole feature, define what moves and when:
690
+
691
+ ```markdown
692
+ ## Motion Plan
693
+
694
+ | Element | Animation | Trigger | Duration | Easing |
695
+ |---------|-----------|---------|----------|--------|
696
+ | Page content | Fade in | Route change | 200ms | ease-out |
697
+ | Modal | Scale up + fade | Open | 200ms | ease-out |
698
+ | Modal backdrop | Fade in | Open | 150ms | ease-out |
699
+ | Toast | Slide in from top | Action complete | 300ms | ease-out |
700
+ | List items | Stagger fade | Data load | 100ms + 50ms delay | ease-out |
701
+ | Skeleton | Pulse | Loading | 1.5s loop | ease-in-out |
702
+
703
+ **Reduced motion:** All animations replaced with instant show/hide when `prefers-reduced-motion` is set.
704
+ ```
705
+
706
+ ### Step 5: Accessibility checklist
707
+
708
+ Before calling the critic, check:
709
+
710
+ - [ ] Color contrast meets WCAG AA (4.5:1 text, 3:1 large text)
711
+ - [ ] All buttons and links are keyboard accessible
712
+ - [ ] Focus order follows visual layout
713
+ - [ ] Tab navigation hits every interactive element
714
+ - [ ] All images have alt text
715
+ - [ ] Form inputs have visible labels (not just placeholders)
716
+ - [ ] Error messages are tied to the input (aria-describedby)
717
+ - [ ] Animations respect `prefers-reduced-motion`
718
+ - [ ] Touch targets are at least 44x44px on mobile
719
+ - [ ] No info conveyed by color alone (use icons or text too)
720
+
721
+ ### Step 6: Self-check (before calling critic)
722
+
723
+ Run through these yourself:
724
+
725
+ 1. **Does it look like a real app, or a generic AI template?**
726
+ 2. **Is there clear visual hierarchy?** Can you tell what's most important?
727
+ 3. **Does the accent color draw the eye to CTAs?**
728
+ 4. **Is there enough whitespace?**
729
+ 5. **Does the text use specific language, not generic marketing fluff?**
730
+ 6. **Does it match the design personality from design-config?**
731
+ 7. **Are ALL states covered?** (not just the happy path)
732
+
733
+ Fix anything that fails before calling the critic.
734
+
735
+ ### Step 7: Spawn design critic (Design Gate)
736
+
737
+ Spawn the `design-critic` agent as a subagent. Give it:
738
+
739
+ 1. **The screen designs** you wrote
740
+ 2. **The design tokens** (if they exist)
741
+ 3. **The design-config** (if it exists)
742
+ 4. **The spec** (if it exists)
743
+ 5. **Your self-check results** from Step 6
744
+
745
+ **Prompt for the critic:**
746
+ > "Review these screen designs for the Design Gate. Screens: [content]. Tokens: [path or 'none']. Design-config: [path or 'none']. Spec: [path or 'none']. Check for: AI-generic patterns, brand compliance, missing states, responsive gaps, accessibility, visual hierarchy. Give your verdict: ACCEPT or NEEDS CHANGES."
747
+
748
+ ### Discussion
749
+
750
+ - If critic says **ACCEPT** -> Design Gate passed
751
+ - If critic says **NEEDS CHANGES** -> fix issues, re-submit
752
+ - Max 3 rounds of back-and-forth
753
+ - If still stuck after 3 rounds, ask the user to decide
754
+
755
+ ### Step 8: Save
756
+
757
+ Save each screen to `.planning/design/screens/{{ args[1] | default: "feature-name" }}.md`.
758
+
759
+ Add metadata at the top:
760
+
761
+ ```markdown
762
+ **Date**: [today]
763
+ **Status**: approved
764
+ **Designer**: Claude (main agent)
765
+ **Critic**: design-critic agent
766
+ **Verdict**: PASSED
767
+ ```
768
+
769
+ > "Screens saved to `.planning/design/screens/` — Design Gate passed."
770
+ >
771
+ > **Next steps:**
772
+ > - Ready to build? -> `/spartan:plan {{ args[1] | default: "" }}` then `/spartan:build frontend {{ args[1] | default: "" }}`
773
+ > - Want to test with users first? -> `/spartan:ux test {{ args[1] | default: "" }}`
774
+ > - Need developer handoff details? -> `/spartan:ux handoff {{ args[1] | default: "" }}`
775
+
776
+ {% elif args[0] == "test" %}
777
+
778
+ ## Phase 6: Usability Testing
779
+
780
+ Goal: Create a test plan, and if results come in, analyze them. Save to `.planning/design/test-results.md`.
781
+
782
+ ```bash
783
+ mkdir -p .planning/design
784
+ ```
785
+
786
+ ### Step 1: Read upstream artifacts
787
+
788
+ ```bash
789
+ cat .planning/design/screens/*.md 2>/dev/null
790
+ cat .planning/design/ideation/flows.md 2>/dev/null
791
+ cat .planning/design/definition/brief.md 2>/dev/null
792
+ ```
793
+
794
+ If screens exist, build tasks from them. If not, ask the user what flows to test.
795
+
796
+ ### Step 2: Generate test script
797
+
798
+ Create a usability test script with 5-7 tasks. Each task tests a main flow.
799
+
800
+ ```markdown
801
+ ## Usability Test Script
802
+
803
+ **Product:** [name]
804
+ **Date:** [today]
805
+ **Duration:** 30-45 minutes per session
806
+ **Participants:** [target: 5 users matching personas]
807
+
808
+ ### Intro (2 min)
809
+ "Thanks for helping us test this. There are no wrong answers — we're testing the design, not you. Think out loud as you go. If something confuses you, say so."
810
+
811
+ ### Warm-up (3 min)
812
+ - "Tell me about your role and what you do day-to-day."
813
+ - "How do you currently handle [relevant task]?"
814
+
815
+ ### Tasks
816
+
817
+ #### Task 1: [Name] — [what flow it tests]
818
+ **Scenario:** "Imagine you just [context]. You want to [goal]."
819
+ **Success criteria:** User completes [action] within [time/clicks].
820
+ **Watch for:** [specific behaviors or confusion points]
821
+
822
+ #### Task 2: [Name]
823
+ ...
824
+
825
+ #### Task 3: [Name]
826
+ ...
827
+
828
+ (5-7 tasks total, covering the main flows)
829
+
830
+ ### Wrap-up (5 min)
831
+ - "What was the easiest part?"
832
+ - "What was the hardest part?"
833
+ - "Anything you expected to find but couldn't?"
834
+ - "On a scale of 1-5, how confident were you while using this?"
835
+ ```
836
+
837
+ ### Step 3: Define pass/fail criteria
838
+
839
+ ```markdown
840
+ ## Pass/Fail Criteria
841
+
842
+ | Task | Pass | Partial | Fail |
843
+ |------|------|---------|------|
844
+ | Task 1 | Completes in < 30s, no help | Completes with 1 hint | Can't complete or > 2 min |
845
+ | Task 2 | ... | ... | ... |
846
+
847
+ **Overall pass rate target:** 80% of users pass each task.
848
+ **Red flag:** If 3+ users fail the same task, that flow needs a redesign.
849
+ ```
850
+
851
+ ### Step 4: Analyze results (if user provides them)
852
+
853
+ If the user pastes or describes test results:
854
+
855
+ 1. **Rate each finding by severity:**
856
+
857
+ | Severity | Meaning | Action |
858
+ |----------|---------|--------|
859
+ | Critical | Blocks the task. User can't complete it. | Must fix before launch. |
860
+ | Major | User completes but with big confusion or frustration. | Fix before launch if possible. |
861
+ | Minor | Small annoyance. User still completes fine. | Fix later. |
862
+
863
+ 2. **Group findings by screen/flow**
864
+ 3. **For each finding:**
865
+ - What happened
866
+ - How many users hit it
867
+ - Severity
868
+ - Suggested design change
869
+ 4. **Summary:** overall pass rate, biggest wins, biggest problems
870
+
871
+ ### Step 5: Save
872
+
873
+ Save to `.planning/design/test-results.md`.
874
+
875
+ > "Test plan saved to `.planning/design/test-results.md`."
876
+ >
877
+ > If results were analyzed:
878
+ > "Found [N] issues: [X] critical, [Y] major, [Z] minor. Update screens with `/spartan:ux prototype {{ args[1] | default: "" }}` to fix the critical/major ones."
879
+ >
880
+ > **Next:** `/spartan:ux handoff {{ args[1] | default: "" }}` when designs are final.
881
+
882
+ {% elif args[0] == "handoff" %}
883
+
884
+ ## Phase 7: Developer Handoff
885
+
886
+ Goal: Compile all design decisions into a format developers can build from. Update screen files with handoff notes.
887
+
888
+ ### Step 1: Read all design artifacts
889
+
890
+ ```bash
891
+ cat .planning/design/system/tokens.md 2>/dev/null
892
+ cat .planning/design/system/components.md 2>/dev/null
893
+ cat .planning/design/screens/*.md 2>/dev/null
894
+ cat .planning/design/ideation/flows.md 2>/dev/null
895
+ cat .planning/design/definition/brief.md 2>/dev/null
896
+ cat .planning/design-config.md 2>/dev/null
897
+ ```
898
+
899
+ If tokens or screens don't exist, warn:
900
+ > "No design tokens or screen designs found. Run `/spartan:ux system` and `/spartan:ux prototype` first."
901
+
902
+ ### Step 2: Implementation checklist per screen
903
+
904
+ For each screen in `.planning/design/screens/`:
905
+
906
+ ```markdown
907
+ ## Handoff: [Screen Name]
908
+
909
+ ### Files to create/edit
910
+ - [ ] `src/app/[path]/page.tsx` — page component
911
+ - [ ] `src/components/[name].tsx` — [component]
912
+ - [ ] `src/components/[name].tsx` — [component]
913
+ - [ ] `src/api/[name].ts` — API client (if new endpoints)
914
+ - [ ] `src/types/[name].ts` — TypeScript types
915
+
916
+ ### Token reference
917
+ | Design element | Token | Value |
918
+ |---------------|-------|-------|
919
+ | Page background | --color-bg | [value] |
920
+ | Card background | --color-bg-secondary | [value] |
921
+ | Primary button | --color-primary | [value] |
922
+ | Body text | --font-size-base / --color-text | [values] |
923
+ | Card spacing | --space-4 | [value] |
924
+ | Card radius | --radius-md | [value] |
925
+ ```
926
+
927
+ ### Step 3: State matrix
928
+
929
+ For each component that has multiple states:
930
+
931
+ ```markdown
932
+ ### State Matrix: [Component Name]
933
+
934
+ | State | Visual | Data | Interaction |
935
+ |-------|--------|------|-------------|
936
+ | Default | [description] | [what data shows] | [what user can do] |
937
+ | Hover | [change] | same | click triggers [action] |
938
+ | Active/Selected | [change] | same | [action] |
939
+ | Disabled | [change] | same | no interaction |
940
+ | Loading | skeleton | none | no interaction |
941
+ | Empty | illustration + message | none | CTA to [action] |
942
+ | Error | error banner | none | retry button |
943
+ ```
944
+
945
+ ### Step 4: Animation specs
946
+
947
+ From the motion plan:
948
+
949
+ ```markdown
950
+ ### Animations
951
+
952
+ | Element | Property | From | To | Duration | Easing | Trigger |
953
+ |---------|----------|------|-----|----------|--------|---------|
954
+ | Modal | opacity | 0 | 1 | 200ms | ease-out | open |
955
+ | Modal | transform | scale(0.95) | scale(1) | 200ms | ease-out | open |
956
+ | Toast | transform | translateY(-100%) | translateY(0) | 300ms | ease-out | show |
957
+
958
+ **CSS implementation:**
959
+ ```css
960
+ .modal-enter { opacity: 0; transform: scale(0.95); }
961
+ .modal-enter-active { opacity: 1; transform: scale(1); transition: all 200ms ease-out; }
962
+
963
+ @media (prefers-reduced-motion: reduce) {
964
+ .modal-enter-active { transition: none; }
965
+ }
966
+ ```
967
+ ```
968
+
969
+ ### Step 5: Tailwind config
970
+
971
+ If tokens exist but Tailwind config wasn't generated yet:
972
+
973
+ ```javascript
974
+ // tailwind.config.js — paste this into the extend section
975
+ module.exports = {
976
+ theme: {
977
+ extend: {
978
+ colors: {
979
+ // from tokens.md
980
+ },
981
+ fontFamily: {
982
+ // from tokens.md
983
+ },
984
+ spacing: {
985
+ // from tokens.md
986
+ },
987
+ borderRadius: {
988
+ // from tokens.md
989
+ },
990
+ },
991
+ },
992
+ }
993
+ ```
994
+
995
+ ### Step 6: Platform-specific notes
996
+
997
+ Add any notes that matter for the frontend stack:
998
+
999
+ ```markdown
1000
+ ### Implementation notes
1001
+
1002
+ - **Framework:** [Next.js App Router / React / etc.]
1003
+ - **Styling:** [Tailwind + CSS variables / styled-components / etc.]
1004
+ - **State management:** [React Query / Zustand / context / etc.]
1005
+ - **API pattern:** [how to fetch data — server components, client fetch, etc.]
1006
+ - **Image handling:** [Next/Image, lazy loading, responsive sizes]
1007
+ - **Fonts:** [how to load — next/font, self-hosted, Google Fonts]
1008
+ ```
1009
+
1010
+ ### Step 7: Update screen files
1011
+
1012
+ Append the handoff notes to each screen file in `.planning/design/screens/`.
1013
+
1014
+ > "Handoff notes added to screen files in `.planning/design/screens/`."
1015
+ >
1016
+ > **Next:** `/spartan:plan {{ args[1] | default: "" }}` then `/spartan:build frontend {{ args[1] | default: "" }}` to start building.
1017
+ >
1018
+ > After building, run `/spartan:ux qa {{ args[1] | default: "" }}` to check the build matches the design.
1019
+
1020
+ {% elif args[0] == "qa" %}
1021
+
1022
+ ## Phase 8: Design QA
1023
+
1024
+ Goal: Check that the built UI matches the design specs. Generate a QA checklist.
1025
+
1026
+ ### Step 1: Read design artifacts
1027
+
1028
+ ```bash
1029
+ cat .planning/design/system/tokens.md 2>/dev/null
1030
+ cat .planning/design/screens/*.md 2>/dev/null
1031
+ ```
1032
+
1033
+ If no design files exist:
1034
+ > "No design specs found. Can't do design QA without specs to compare against. Run `/spartan:ux prototype` first."
1035
+
1036
+ ### Step 2: Generate QA checklist
1037
+
1038
+ From the screen designs and tokens, generate a checklist:
1039
+
1040
+ ```markdown
1041
+ ## Design QA Checklist
1042
+
1043
+ ### Typography
1044
+ - [ ] Font family matches tokens (--font-family)
1045
+ - [ ] Font sizes match scale (check each heading level, body, labels)
1046
+ - [ ] Font weights match spec (bold for headings, regular for body)
1047
+ - [ ] Line heights look right (not too tight, not too loose)
1048
+
1049
+ ### Colors
1050
+ - [ ] Primary color used for CTAs and active states only (not overused)
1051
+ - [ ] Background colors match tokens (--color-bg, --color-bg-secondary)
1052
+ - [ ] Text colors match tokens (--color-text, --color-text-secondary)
1053
+ - [ ] Success/warning/error colors match tokens
1054
+ - [ ] No hardcoded color values (all from tokens or Tailwind)
1055
+
1056
+ ### Spacing
1057
+ - [ ] Component spacing matches scale (--space-*)
1058
+ - [ ] Card padding is consistent
1059
+ - [ ] Section margins are consistent
1060
+ - [ ] No pixel-pushing (spacing should come from tokens)
1061
+
1062
+ ### Layout
1063
+ - [ ] Layout matches wireframes at 1440px (desktop)
1064
+ - [ ] Layout adapts properly at 768px (tablet)
1065
+ - [ ] Layout adapts properly at 375px (mobile)
1066
+ - [ ] Sidebar collapses/hides on mobile (if applicable)
1067
+ - [ ] No horizontal scroll at any breakpoint
1068
+
1069
+ ### Components
1070
+ - [ ] Buttons match spec (size, color, radius, hover state)
1071
+ - [ ] Inputs match spec (border, focus ring, error state)
1072
+ - [ ] Cards match spec (background, shadow, radius, padding)
1073
+ - [ ] Tables match spec (headers, rows, alignment)
1074
+ - [ ] Modals match spec (size, backdrop, animation)
1075
+
1076
+ ### States
1077
+ - [ ] Loading state shows skeleton/spinner (not blank)
1078
+ - [ ] Empty state shows illustration + message + CTA
1079
+ - [ ] Error state shows message + retry
1080
+ - [ ] Success feedback (toast/animation) works
1081
+ - [ ] Hover states on interactive elements
1082
+ - [ ] Focus states visible for keyboard nav
1083
+
1084
+ ### Animations
1085
+ - [ ] Page transitions match motion plan
1086
+ - [ ] Modal open/close animation matches spec
1087
+ - [ ] Toast animation matches spec
1088
+ - [ ] `prefers-reduced-motion` disables animations
1089
+
1090
+ ### Accessibility
1091
+ - [ ] Tab order matches visual order
1092
+ - [ ] All buttons/links reachable by keyboard
1093
+ - [ ] Focus ring visible on interactive elements
1094
+ - [ ] Screen reader can navigate the page
1095
+ - [ ] Form errors announced to screen readers
1096
+ - [ ] Images have alt text
1097
+ - [ ] Contrast ratio passes WCAG AA
1098
+ ```
1099
+
1100
+ ### Step 3: Run browser QA (optional)
1101
+
1102
+ > "Want me to run browser QA with Playwright to check the live app?"
1103
+ >
1104
+ > - **A) Yes** — I'll open the app and check the design visually (uses `/spartan:qa`)
1105
+ > - **B) No** — I'll just give you the checklist to check manually
1106
+ >
1107
+ > I'd pick **A** if the app is running locally.
1108
+
1109
+ If user picks A, suggest running `/spartan:qa` with the URL.
1110
+
1111
+ ### Step 4: Save
1112
+
1113
+ Save to `.planning/design/qa-checklist.md`.
1114
+
1115
+ > "QA checklist saved to `.planning/design/qa-checklist.md`."
1116
+ >
1117
+ > Check each item. If anything doesn't match, fix it and run the checklist again.
1118
+
1119
+ {% elif args[0] == "audit" %}
1120
+
1121
+ ## Audit: Gap Analysis
1122
+
1123
+ Goal: Scan what exists and report what's done, what's missing, and what to do next.
1124
+
1125
+ ### Step 1: Scan design artifacts
1126
+
1127
+ ```bash
1128
+ ls -la .planning/design/ 2>/dev/null
1129
+ ls -la .planning/design/research/ 2>/dev/null
1130
+ ls -la .planning/design/definition/ 2>/dev/null
1131
+ ls -la .planning/design/ideation/ 2>/dev/null
1132
+ ls -la .planning/design/system/ 2>/dev/null
1133
+ ls -la .planning/design/screens/ 2>/dev/null
1134
+ ls .planning/design/test-results.md 2>/dev/null
1135
+ ls .planning/design/qa-checklist.md 2>/dev/null
1136
+ ls .planning/design-config.md .claude/design-config.md 2>/dev/null
1137
+ ls .planning/specs/*.md 2>/dev/null
1138
+ ls .planning/designs/*.md 2>/dev/null
1139
+ ```
1140
+
1141
+ ### Step 2: Scan codebase for existing design system
1142
+
1143
+ ```bash
1144
+ # Check for Tailwind config
1145
+ cat tailwind.config.js 2>/dev/null || cat tailwind.config.ts 2>/dev/null
1146
+
1147
+ # Check for CSS variables
1148
+ ls src/styles/globals.css 2>/dev/null || ls src/app/globals.css 2>/dev/null
1149
+
1150
+ # Check for component library
1151
+ ls src/components/ui/ 2>/dev/null
1152
+ ls src/components/ 2>/dev/null | head -20
1153
+
1154
+ # Check for design tokens file
1155
+ ls src/styles/tokens.* 2>/dev/null || ls src/lib/tokens.* 2>/dev/null
1156
+ ```
1157
+
1158
+ ### Step 3: Report
1159
+
1160
+ ```markdown
1161
+ ## UX Audit Report
1162
+
1163
+ ### Design artifacts
1164
+ | Artifact | Status | Path | Notes |
1165
+ |----------|--------|------|-------|
1166
+ | Design config | [found/missing] | [path] | [notes] |
1167
+ | Research insights | [found/missing] | [path] | [notes] |
1168
+ | Problem brief | [found/missing] | [path] | [notes] |
1169
+ | User flows | [found/missing] | [path] | [notes] |
1170
+ | Design tokens | [found/missing] | [path] | [notes] |
1171
+ | Component inventory | [found/missing] | [path] | [notes] |
1172
+ | Screen designs | [found/missing] | [path] | [notes] |
1173
+ | Test results | [found/missing] | [path] | [notes] |
1174
+ | QA checklist | [found/missing] | [path] | [notes] |
1175
+
1176
+ ### Codebase design system
1177
+ | Item | Status | Details |
1178
+ |------|--------|---------|
1179
+ | Tailwind config | [found/missing] | [custom colors? fonts? spacing?] |
1180
+ | CSS variables | [found/missing] | [how many tokens defined?] |
1181
+ | Component library | [found/missing] | [which components exist?] |
1182
+ | Design tokens file | [found/missing] | [format?] |
1183
+
1184
+ ### Gaps
1185
+ [List what's missing and why it matters]
1186
+
1187
+ ### Recommendations
1188
+ 1. **[Most important]** — run `/spartan:ux [phase]` because [reason]
1189
+ 2. **[Second]** — ...
1190
+ 3. **[Third]** — ...
1191
+ ```
1192
+
1193
+ {% else %}
1194
+
1195
+ ## Unknown action: {{ args[0] }}
1196
+
1197
+ Available actions:
1198
+
1199
+ | Action | What it does |
1200
+ |--------|-------------|
1201
+ | `/spartan:ux` | Smart router — check status, suggest next step |
1202
+ | `/spartan:ux research` | User research — interviews, competitive analysis, empathy maps |
1203
+ | `/spartan:ux define` | Problem definition — statement, personas, journey, metrics |
1204
+ | `/spartan:ux ideate` | Solution exploration — ideas, user flows, IA |
1205
+ | `/spartan:ux system` | Design system — tokens, Tailwind config, component inventory |
1206
+ | `/spartan:ux prototype` | Screen design — wireframes, states, responsive, Design Gate |
1207
+ | `/spartan:ux test` | Usability testing — test scripts, result analysis |
1208
+ | `/spartan:ux handoff` | Developer handoff — specs, state matrix, animation details |
1209
+ | `/spartan:ux qa` | Design QA — checklist to verify build matches design |
1210
+ | `/spartan:ux audit` | Gap analysis — scan what exists, find what's missing |
1211
+
1212
+ **Example:** `/spartan:ux prototype "dashboard"` designs the dashboard screens.
1213
+
1214
+ **Quick start:** Just run `/spartan:ux` and I'll figure out where you are.
1215
+
1216
+ {% endif %}
1217
+
1218
+ ---
1219
+
1220
+ ## Rules
1221
+
1222
+ - **Read upstream artifacts first.** Every phase checks for artifacts from earlier phases. Use them if they exist. Don't ask the user to repeat info.
1223
+ - **Save everything to `.planning/design/`.** Each phase has its own subfolder. This is the source of truth for the design.
1224
+ - **Design tokens are the law.** If tokens exist, every color, font, spacing, and radius must come from them. Don't invent values.
1225
+ - **Anti-AI-generic is the top priority.** If the design looks like every other AI-generated page, it fails. Load the `design-workflow` skill and follow its rules.
1226
+ - **All states must be covered.** Loading, empty, error, success, edge cases. Not just the happy path. This is the most common miss.
1227
+ - **Responsive is not optional.** Every screen must work at 375px, 768px, and 1440px. Show what changes at each breakpoint.
1228
+ - **The critic must accept.** The `prototype` phase spawns the `design-critic` agent. Both agents must agree before the design is approved. Single-agent design is not enough.
1229
+ - **Accessibility is built in, not bolted on.** Check contrast, keyboard nav, focus order, reduced motion, and screen readers during design, not after build.
1230
+ - **Auto mode on?** Skip confirmations, but still run the full design critic review in the `prototype` phase. Never skip the Design Gate.
1231
+ - **Keep language simple.** Short sentences. Simple words. Don't use jargon unless the user did first.
1232
+ - **Always suggest the next step.** After each phase, tell the user what comes next and give the command.
1233
+ - **Questions always have options.** When you ask the user something, give A/B/C options. Always pick a side ("I'd pick A because...").