motif-design 0.1.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 (48) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +91 -0
  3. package/bin/install.js +724 -0
  4. package/core/references/context-engine.md +190 -0
  5. package/core/references/design-inputs.md +421 -0
  6. package/core/references/runtime-adapters.md +180 -0
  7. package/core/references/state-machine.md +124 -0
  8. package/core/references/verticals/ecommerce.md +251 -0
  9. package/core/references/verticals/fintech.md +226 -0
  10. package/core/references/verticals/health.md +235 -0
  11. package/core/references/verticals/saas.md +248 -0
  12. package/core/templates/STATE-TEMPLATE.md +28 -0
  13. package/core/templates/SUMMARY-TEMPLATE.md +21 -0
  14. package/core/templates/VERTICAL-TEMPLATE.md +144 -0
  15. package/core/templates/token-showcase-template.html +946 -0
  16. package/core/workflows/compose-screen.md +163 -0
  17. package/core/workflows/evolve.md +64 -0
  18. package/core/workflows/fix.md +64 -0
  19. package/core/workflows/generate-system.md +336 -0
  20. package/core/workflows/quick.md +23 -0
  21. package/core/workflows/research.md +233 -0
  22. package/core/workflows/review.md +126 -0
  23. package/package.json +26 -0
  24. package/runtimes/claude-code/CLAUDE-MD-SNIPPET.md +34 -0
  25. package/runtimes/claude-code/agents/motif-design-reviewer.md +207 -0
  26. package/runtimes/claude-code/agents/motif-fix-agent.md +119 -0
  27. package/runtimes/claude-code/agents/motif-researcher.md +100 -0
  28. package/runtimes/claude-code/agents/motif-screen-composer.md +157 -0
  29. package/runtimes/claude-code/agents/motif-system-architect.md +120 -0
  30. package/runtimes/claude-code/commands/motif/compose.md +7 -0
  31. package/runtimes/claude-code/commands/motif/evolve.md +6 -0
  32. package/runtimes/claude-code/commands/motif/fix.md +7 -0
  33. package/runtimes/claude-code/commands/motif/help.md +29 -0
  34. package/runtimes/claude-code/commands/motif/init.md +229 -0
  35. package/runtimes/claude-code/commands/motif/progress.md +11 -0
  36. package/runtimes/claude-code/commands/motif/quick.md +7 -0
  37. package/runtimes/claude-code/commands/motif/research.md +4 -0
  38. package/runtimes/claude-code/commands/motif/review.md +7 -0
  39. package/runtimes/claude-code/commands/motif/system.md +4 -0
  40. package/runtimes/claude-code/hooks/motif-aria-check.js +164 -0
  41. package/runtimes/claude-code/hooks/motif-context-monitor.js +40 -0
  42. package/runtimes/claude-code/hooks/motif-font-check.js +192 -0
  43. package/runtimes/claude-code/hooks/motif-token-check.js +221 -0
  44. package/runtimes/cursor/README.md +24 -0
  45. package/runtimes/gemini/README.md +13 -0
  46. package/runtimes/opencode/README.md +28 -0
  47. package/scripts/contrast-checker.js +114 -0
  48. package/scripts/token-counter.js +107 -0
@@ -0,0 +1,190 @@
1
+ # Motif Context Engine
2
+
3
+ This file defines the context management strategy for Motif. Every orchestrator and agent MUST follow these rules. Context discipline is what separates Motif from a long-form prompt.
4
+
5
+ ## Core Principle
6
+
7
+ **The orchestrator stays thin. Agents get fresh context. Work happens in clean windows.**
8
+
9
+ The main Claude Code session (the orchestrator) should NEVER exceed 30-40% context usage. All heavy work — research, screen composition, design review — happens in spawned subagents with fresh 200K token windows.
10
+
11
+ ## Orchestrator Rules
12
+
13
+ 1. **Read STATE.md** — determine what to do
14
+ 2. **Read ONLY the file paths needed** — assemble context for the subagent
15
+ 3. **Spawn subagent with Task()** — pass the assembled context as the prompt
16
+ 4. **Collect result** — read the SUMMARY.md the subagent creates
17
+ 5. **Update STATE.md** — track progress
18
+ 6. **NEVER read full file contents into main context** — pass file PATHS to subagents, let them read in their fresh window
19
+
20
+ ## Context Budgets
21
+
22
+ Every planning/design file has a maximum token budget. If a file exceeds its budget, it must be split or summarized.
23
+
24
+ | File | Max Tokens | Purpose |
25
+ |---|---|---|
26
+ | STATE.md | 500 | Phase tracking, screen status |
27
+ | PROJECT.md | 1,000 | Product context, vertical, stack |
28
+ | DESIGN-BRIEF.md | 1,000 | Aesthetic direction, constraints |
29
+ | DESIGN-RESEARCH.md | 3,000 | Synthesized research findings |
30
+ | research/*.md | 2,000 each | Raw research per dimension |
31
+ | tokens.css | 3,000 | Design tokens |
32
+ | DESIGN-SYSTEM.md | 3,000 | System documentation |
33
+ | COMPONENT-SPECS.md | 5,000 | Component XML specs |
34
+ | [screen]-SUMMARY.md | 500 each | Per-screen summary |
35
+ | [screen]-REVIEW.md | 1,000 each | Per-screen review |
36
+
37
+ **Total context budget for a fully-loaded subagent**: ~15,000 tokens of context files, leaving ~185,000 tokens for the actual work.
38
+
39
+ ## Context Loading Profiles
40
+
41
+ Different commands need different slices of context. These profiles define exactly what each subagent type loads.
42
+
43
+ ### Profile: Research Agent
44
+ ```xml
45
+ <context_profile name="researcher">
46
+ <always_load>
47
+ .planning/design/PROJECT.md
48
+ .planning/design/DESIGN-BRIEF.md
49
+ </always_load>
50
+ <load_if_exists>
51
+ .claude/get-motif/verticals/{vertical}.md
52
+ </load_if_exists>
53
+ <never_load>
54
+ tokens.css
55
+ COMPONENT-SPECS.md
56
+ Any screen source code
57
+ </never_load>
58
+ </context_profile>
59
+ ```
60
+
61
+ ### Profile: System Generator
62
+ ```xml
63
+ <context_profile name="system-generator">
64
+ <always_load>
65
+ .planning/design/PROJECT.md
66
+ .planning/design/DESIGN-BRIEF.md
67
+ .planning/design/DESIGN-RESEARCH.md
68
+ </always_load>
69
+ <load_if_exists>
70
+ .planning/design/research/02-visual-language.md
71
+ .planning/design/research/03-accessibility.md
72
+ .claude/get-motif/verticals/{vertical}.md
73
+ </load_if_exists>
74
+ <never_load>
75
+ research/01-vertical-patterns.md (already synthesized in DESIGN-RESEARCH.md)
76
+ research/04-competitor-audit.md (already synthesized)
77
+ Any screen source code
78
+ </never_load>
79
+ </context_profile>
80
+ ```
81
+
82
+ ### Profile: Screen Composer
83
+ ```xml
84
+ <context_profile name="composer">
85
+ <always_load>
86
+ .planning/design/PROJECT.md
87
+ .planning/design/system/tokens.css
88
+ .planning/design/system/COMPONENT-SPECS.md
89
+ </always_load>
90
+ <load_if_exists>
91
+ .planning/design/DESIGN-RESEARCH.md
92
+ .planning/design/screens/{previous-screen}-SUMMARY.md (for consistency)
93
+ </load_if_exists>
94
+ <never_load>
95
+ DESIGN-BRIEF.md (decisions already encoded in tokens + research)
96
+ Raw research files (already synthesized)
97
+ Other screen source code (only summaries)
98
+ DESIGN-SYSTEM.md (tokens.css + COMPONENT-SPECS.md are sufficient)
99
+ </never_load>
100
+ </context_profile>
101
+ ```
102
+
103
+ ### Profile: Design Reviewer
104
+ ```xml
105
+ <context_profile name="reviewer">
106
+ <always_load>
107
+ .planning/design/system/tokens.css
108
+ .planning/design/system/COMPONENT-SPECS.md
109
+ .planning/design/DESIGN-RESEARCH.md
110
+ The actual source code of the screen being reviewed
111
+ </always_load>
112
+ <load_if_exists>
113
+ .planning/design/PROJECT.md
114
+ .planning/design/screens/{screen}-SUMMARY.md
115
+ </load_if_exists>
116
+ <never_load>
117
+ DESIGN-BRIEF.md
118
+ Raw research files
119
+ Other screens (unless checking cross-screen consistency)
120
+ </never_load>
121
+ </context_profile>
122
+ ```
123
+
124
+ ### Profile: Fix Agent
125
+ ```xml
126
+ <context_profile name="fixer">
127
+ <always_load>
128
+ .planning/design/reviews/{screen}-REVIEW.md
129
+ .planning/design/system/tokens.css
130
+ .planning/design/system/COMPONENT-SPECS.md
131
+ The actual source code of the screen being fixed
132
+ </always_load>
133
+ <never_load>
134
+ Research files
135
+ DESIGN-BRIEF.md
136
+ Other screen source code
137
+ </never_load>
138
+ </context_profile>
139
+ ```
140
+
141
+ ## Subagent Spawning Pattern
142
+
143
+ This is the exact pattern every orchestrator workflow uses to spawn a subagent:
144
+
145
+ ```
146
+ ## Step 1: Assemble context (orchestrator reads file PATHS, not contents)
147
+
148
+ Read STATE.md to determine:
149
+ - Current phase
150
+ - Which screen to work on
151
+ - Vertical name (for loading vertical reference)
152
+
153
+ ## Step 2: Build the subagent prompt
154
+
155
+ The orchestrator constructs an XML prompt with:
156
+ - The agent's role and instructions (from agents/*.md)
157
+ - File paths the agent should read (NOT inlined content)
158
+ - The specific task to perform
159
+ - Where to save output
160
+ - Commit message to use
161
+
162
+ ## Step 3: Spawn with Task()
163
+
164
+ Use Task() to spawn a fresh subagent. The prompt tells the agent to:
165
+ 1. Read the files at the specified paths
166
+ 2. Execute the task
167
+ 3. Save output to the specified locations
168
+ 4. Create a SUMMARY.md for the orchestrator
169
+ 5. Commit with the specified message
170
+
171
+ ## Step 4: Collect results
172
+
173
+ The orchestrator reads ONLY the SUMMARY.md — never the full output.
174
+ Updates STATE.md.
175
+ Decides what to do next.
176
+ ```
177
+
178
+ ## Anti-Patterns
179
+
180
+ These MUST be avoided:
181
+
182
+ 1. **NEVER inline file contents in the orchestrator prompt.** Pass paths. Let the subagent read.
183
+ 2. **NEVER use TaskOutput to read full subagent output.** Read the SUMMARY.md instead.
184
+ 3. **NEVER accumulate context across multiple compose operations.** Each screen gets a fresh agent.
185
+ 4. **NEVER load all research files when only the synthesis is needed.** DESIGN-RESEARCH.md exists to be the compressed version.
186
+ 5. **NEVER load the full DESIGN-SYSTEM.md when tokens.css + COMPONENT-SPECS.md suffice.** The system doc is for humans, the tokens + specs are for agents.
187
+
188
+ ## Context Monitoring
189
+
190
+ The orchestrator should check context usage after each subagent spawn cycle. If main context exceeds 50%, recommend the user run `/clear` before continuing. STATE.md preserves all progress — nothing is lost on clear.
@@ -0,0 +1,421 @@
1
+ # Motif — Design Input System
2
+
3
+ This reference defines how Motif handles visual inputs, brand constraints, and design differentiation. Every workflow that generates visual decisions MUST consult this file.
4
+
5
+ ---
6
+
7
+ ## 1. Input Types
8
+
9
+ Motif accepts four types of design input. They're detected during `/motif:init` and stored in `DESIGN-BRIEF.md` under a structured `## Inputs` section.
10
+
11
+ ### Type A: Starting Fresh (No Inputs)
12
+ User has no existing brand, no colors, no references. Motif makes all visual decisions based on vertical research + a differentiation algorithm.
13
+
14
+ ### Type B: Brand Constraints
15
+ User provides specific values: "My brand color is #1A73E8" or "We use Poppins for our logo." These are hard constraints — the system builds AROUND them, never overrides them.
16
+
17
+ ### Type C: Visual References
18
+ User provides screenshots, URLs, or product names as inspiration: "I want it to feel like Linear but warmer" or "Here's a screenshot of a UI I love." These are soft constraints — they inform direction but don't lock specific values.
19
+
20
+ ### Type D: Figma/Design File
21
+ User has a Figma file, screenshot of a complete design, or an existing UI to implement faithfully. This is an implementation task — Motif extracts the design system from the file rather than generating one.
22
+
23
+ ---
24
+
25
+ ## 2. Detection During /motif:init
26
+
27
+ The init interview MUST include this question (Round 2):
28
+
29
+ ```
30
+ Do you have any existing design assets?
31
+
32
+ a) Starting fresh — no colors, fonts, or designs yet
33
+ b) I have brand colors and/or fonts I want to use
34
+ c) I have screenshots or products I want to reference for inspiration
35
+ d) I have a Figma file or complete design to implement
36
+ e) Some combination of the above
37
+ ```
38
+
39
+ Based on the answer, the DESIGN-BRIEF.md gets a structured Inputs section:
40
+
41
+ ```markdown
42
+ ## Inputs
43
+
44
+ ### Input Type
45
+ [A: Fresh | B: Brand Constraints | C: Visual References | D: Design File | combination]
46
+
47
+ ### Brand Constraints (if Type B)
48
+ - Primary color: #[hex] (user-provided, LOCKED)
49
+ - Secondary color: #[hex] (user-provided, LOCKED)
50
+ - Font: [name] (user-provided, LOCKED)
51
+ - Logo: [description or path]
52
+ - Other: [any additional brand rules]
53
+
54
+ ### Visual References (if Type C)
55
+ - Reference 1: [product name or screenshot path]
56
+ - What to take from it: [specific aspects — "the spacing", "the color warmth", "the navigation pattern"]
57
+ - What to ignore: [what NOT to copy]
58
+ - Reference 2: [...]
59
+
60
+ ### Design File (if Type D)
61
+ - Source: [Figma URL | screenshot path | existing codebase path]
62
+ - Fidelity: [pixel-perfect | spirit-of-the-design | extract-tokens-only]
63
+ - Coverage: [complete design | partial — which screens exist | tokens only]
64
+
65
+ ### Differentiation Seed
66
+ [See Section 5 — always present, even for Type A]
67
+ ```
68
+
69
+ ---
70
+
71
+ ## 3. How Brand Constraints Flow Through the System
72
+
73
+ When the user provides specific colors or fonts, they become LOCKED constraints that cascade through every downstream step.
74
+
75
+ ### In /motif:research
76
+ Research agents are told: "The brand's primary color is #[hex]. Research must consider how this color works within [vertical] conventions. Do NOT suggest replacing it — suggest how to complement it."
77
+
78
+ ### In /motif:system (Color Algorithm Override)
79
+
80
+ When brand colors are provided, the Color Decision Algorithm changes:
81
+
82
+ ```
83
+ IF brand_primary_color PROVIDED:
84
+ 1. Accept the user's color as --color-primary-500 (LOCKED)
85
+ 2. Generate the primary scale (50-950) by adjusting lightness/saturation around the provided value
86
+ - 50: lighten to ~97% luminance
87
+ - 100-400: interpolate between 50 and 500
88
+ - 500: USER'S EXACT VALUE (never modify)
89
+ - 600-900: darken progressively
90
+ - 950: darken to ~10% luminance
91
+ 3. Check if the user's color works for the vertical:
92
+ - If yes: proceed normally
93
+ - If potentially problematic (e.g., bright red for fintech): NOTE in tokens.css comment but DO NOT override.
94
+ Example: "/* Primary: #E53E3E — user-specified. Note: warm red is unconventional for fintech;
95
+ we've paired with cool neutral surfaces to maintain trust. */"
96
+ 4. Choose surface and semantic colors that COMPLEMENT the user's primary
97
+ 5. Ensure all contrast pairs pass WCAG AA
98
+
99
+ IF brand_font PROVIDED:
100
+ 1. Use as --font-display or --font-body (user specifies which)
101
+ 2. Choose complementary fonts for the other roles
102
+ 3. If the brand font is Inter/Roboto/system-default, STILL USE IT — the user chose it intentionally
103
+ NOTE: The "never use Inter" rule applies only when Motif is choosing. User choice overrides.
104
+ 4. Ensure the brand font is available (Google Fonts, or user provides files)
105
+
106
+ IF brand_secondary_color PROVIDED:
107
+ 1. Use as accent/secondary color
108
+ 2. Derive the accent scale from it
109
+ 3. Ensure sufficient contrast between primary and secondary
110
+ ```
111
+
112
+ ### In /motif:compose
113
+ Composer agents receive the brand constraints through tokens.css (which already encodes them). No additional handling needed — the token system IS the constraint carrier.
114
+
115
+ ### In /motif:review
116
+ Reviewer checks: "Are brand-constrained tokens used correctly? Is the user's primary color actually showing up as the primary action color, or did the composer drift?"
117
+
118
+ ---
119
+
120
+ ## 4. How Visual References Flow Through the System
121
+
122
+ ### Handling Screenshots/Images
123
+
124
+ When the user provides a screenshot or image:
125
+
126
+ 1. **During /motif:init**: Save the image path to DESIGN-BRIEF.md under Inputs
127
+ 2. **During /motif:research**: The visual language research agent is given the image and told:
128
+ ```
129
+ The user provided this screenshot as a reference. Analyze:
130
+ - Color palette (extract approximate hex values for primary, secondary, surface, text)
131
+ - Typography style (serif/sans/mono, weight, density)
132
+ - Spacing density (compact/comfortable/spacious)
133
+ - Border radius style (sharp/medium/rounded)
134
+ - Shadow style (flat/subtle/layered)
135
+ - Layout pattern (sidebar/tab/top-nav, grid/list/card)
136
+ - Overall mood (clinical/warm/playful/dark/minimal)
137
+
138
+ Output a structured extraction in the visual-language research file.
139
+ These become SOFT CONSTRAINTS — inform the design direction, don't copy pixel-for-pixel.
140
+ ```
141
+ 3. **During /motif:system**: The system generator receives the extracted analysis as input alongside the research. It uses the reference's characteristics as starting points, then adapts for the project's vertical and differentiation seed.
142
+
143
+ ### Handling Product Name References
144
+
145
+ When the user says "I want it to feel like Linear" or "Stripe's checkout is beautiful":
146
+
147
+ 1. **During /motif:research**: The competitor audit agent is told to prioritize these products in its analysis. Extract specific design decisions from them.
148
+ 2. **During /motif:system**: The "Reference Products" section of DESIGN-RESEARCH.md carries these forward with specific aspects to draw from.
149
+
150
+ ### Handling Figma Files
151
+
152
+ This is the most complex input type. Three sub-modes:
153
+
154
+ #### D1: Pixel-Perfect Implementation
155
+ User has a complete Figma design and wants it built exactly.
156
+
157
+ ```
158
+ Workflow changes:
159
+ - /motif:research → SKIP (design decisions are already made)
160
+ - /motif:system → EXTRACT mode:
161
+ - Analyze the Figma file/screenshots
162
+ - Extract: color palette, typography, spacing, radii, shadows
163
+ - Generate tokens.css that matches the design, not the vertical conventions
164
+ - Generate COMPONENT-SPECS.md from the components visible in the design
165
+ - /motif:compose → IMPLEMENT mode:
166
+ - Reference the design file alongside tokens + specs
167
+ - Goal is fidelity to the design, not vertical conventions
168
+ - /motif:review → Checks against the Figma, not against heuristics
169
+ - "Does this match the design?" replaces "Does this follow vertical patterns?"
170
+ ```
171
+
172
+ #### D2: Spirit of the Design
173
+ User has a partial Figma design or mood board and wants the system to extend it.
174
+
175
+ ```
176
+ Workflow changes:
177
+ - /motif:research → RUNS but researcher is told "The user has an existing design direction.
178
+ Research should validate and extend it, not replace it."
179
+ - /motif:system → HYBRID mode:
180
+ - Extract tokens from the design file
181
+ - Fill gaps from vertical research (e.g., design shows colors but no error states → derive from vertical)
182
+ - Generate missing component specs from vertical conventions
183
+ - /motif:compose → Normal but with design file as additional reference
184
+ - /motif:review → Normal (heuristics + vertical patterns apply where the design didn't specify)
185
+ ```
186
+
187
+ #### D3: Extract Tokens Only
188
+ User has a design they like and wants the token system extracted, but will compose screens from scratch.
189
+
190
+ ```
191
+ Workflow changes:
192
+ - /motif:system → EXTRACT mode only
193
+ - Everything else → Normal flow
194
+ ```
195
+
196
+ ### Figma MCP Integration (When Available)
197
+
198
+ If the user has Figma MCP connected:
199
+ ```
200
+ 1. /motif:init asks for the Figma file URL
201
+ 2. Use Figma MCP to fetch:
202
+ - Color styles → map to token palette
203
+ - Text styles → map to typography tokens
204
+ - Spacing patterns → infer spacing scale
205
+ - Component instances → generate COMPONENT-SPECS.md
206
+ 3. Generate tokens.css from the extracted Figma data
207
+ 4. User can modify tokens and compose screens that faithfully implement the Figma design
208
+ ```
209
+
210
+ Without Figma MCP (screenshot-based):
211
+ ```
212
+ 1. User provides screenshots of key screens
213
+ 2. System analyzes screenshots visually during /motif:system
214
+ 3. Extracts approximate values (less precise than MCP, but functional)
215
+ 4. Notes uncertainty: "Color extracted approximately as #2563EB — verify against your design file"
216
+ ```
217
+
218
+ ---
219
+
220
+ ## 5. Differentiation System
221
+
222
+ This is the solution to "every fintech app looks the same." The differentiation system ensures that even when two products share a vertical, their design systems diverge.
223
+
224
+ ### The Differentiation Seed
225
+
226
+ Every project gets a differentiation seed during /motif:init. It's a set of attributes that push the design away from the vertical's center of gravity.
227
+
228
+ ```markdown
229
+ ### Differentiation Seed
230
+ - **Personality axis:** [corporate ←→ rebellious] — position: [1-10]
231
+ - **Temperature axis:** [cool/clinical ←→ warm/human] — position: [1-10]
232
+ - **Density axis:** [spacious/breathing ←→ dense/information-rich] — position: [1-10]
233
+ - **Formality axis:** [buttoned-up ←→ casual] — position: [1-10]
234
+ - **Era axis:** [timeless/classic ←→ cutting-edge/trendy] — position: [1-10]
235
+ ```
236
+
237
+ ### How the Seed is Determined
238
+
239
+ During init, after detecting the vertical, ask:
240
+
241
+ ```
242
+ I've identified this as a [vertical] product. Most [vertical] products feel [description of the center of gravity].
243
+
244
+ Where does YOUR product sit on these spectrums?
245
+
246
+ 1. Personality: Corporate and institutional ←→ Bold and rebellious
247
+ [Most fintech: 3-4. Crypto/neobanks: 6-8]
248
+
249
+ 2. Temperature: Cool and precise ←→ Warm and human
250
+ [Most fintech: 2-4. Personal finance: 5-7]
251
+
252
+ 3. Density: Spacious and calm ←→ Dense and data-rich
253
+ [Most fintech: 5-6. Trading platforms: 8-9]
254
+
255
+ 4. Formality: Professional and serious ←→ Casual and approachable
256
+ [Most fintech: 2-4. Gen-Z neobanks: 6-8]
257
+
258
+ 5. Era: Timeless and proven ←→ Cutting-edge and experimental
259
+ [Most fintech: 3-5. Crypto/DeFi: 7-9]
260
+ ```
261
+
262
+ If the user doesn't want to answer all of these, detect from context:
263
+ - "Crypto payments for Nigerian users" → personality: 7, temperature: 6, density: 5, formality: 5, era: 8
264
+ - "Enterprise treasury management" → personality: 2, temperature: 3, density: 7, formality: 2, era: 4
265
+
266
+ ### How the Seed Affects Color Selection
267
+
268
+ The Color Decision Algorithm in `/motif:system` uses the seed to SHIFT the hue, saturation, and approach:
269
+
270
+ ```
271
+ Fintech base: HSL 170-220° (blue-teal)
272
+
273
+ Adjustments based on seed:
274
+ - Personality ≥ 7 (rebellious): shift hue toward unconventional ranges
275
+ → Consider: 260-290° (violet/purple), 30-50° (amber/gold), 330-350° (magenta)
276
+ → Reasoning: "This is a crypto product targeting young Nigerians. The teal-blue
277
+ convention signals traditional banking — the opposite of the product's positioning."
278
+
279
+ - Temperature ≥ 6 (warm): shift toward warm hues, increase saturation
280
+ → Pull hue toward 0-60° or 300-360° range
281
+ → Warmer surface colors (cream/warm gray instead of cool gray)
282
+
283
+ - Formality ≥ 7 (casual): allow more saturated, playful palettes
284
+ → Higher saturation primary
285
+ → Consider accent colors
286
+ → More rounded radii
287
+
288
+ - Era ≥ 7 (cutting-edge): allow non-traditional palettes
289
+ → Dark-mode-first consideration
290
+ → Gradient accents (subtle, not AI-slop gradients)
291
+ → Monochrome + single vibrant accent
292
+
293
+ COMBINATION EXAMPLE:
294
+ "CryptoPay" — fintech, personality:7, temperature:6, era:8
295
+
296
+ Instead of the default fintech teal (#10B981):
297
+ → Primary: HSL 270° 65% 55% → #7C3AED (violet — signals crypto/web3 identity)
298
+ → Warm surfaces: #FFFBEB (warm cream) instead of #F8FAFC (cool slate)
299
+ → Dark mode primary: use lighter violet on near-black with warm undertone
300
+ → Reasoning captured in tokens.css comments
301
+
302
+ vs. "First National Mobile Banking" — fintech, personality:2, temperature:3, era:3
303
+ → Primary: HSL 210° 55% 45% → #2563A8 (deep institutional blue)
304
+ → Cool surfaces: #F8FAFC (standard cool gray)
305
+ → Conservative radii, minimal shadow, no gradients
306
+ ```
307
+
308
+ ### How the Seed Affects Typography
309
+
310
+ ```
311
+ Fintech base: geometric sans-serif (DM Sans, Plus Jakarta Sans)
312
+
313
+ Adjustments:
314
+ - Personality ≥ 7: consider more distinctive display fonts
315
+ → Clash Display, Syne, Space Grotesk — fonts with personality
316
+ → Still pair with a readable body font
317
+
318
+ - Formality ≤ 4 (casual): rounder, friendlier fonts
319
+ → Outfit, Nunito Sans, Quicksand for body
320
+
321
+ - Era ≥ 7: consider newer/trending fonts
322
+ → Geist, General Sans, Satoshi — fonts released in last 2 years
323
+ → Avoid: fonts that have become overused in the AI/startup space
324
+ ```
325
+
326
+ ### How the Seed Affects Other Decisions
327
+
328
+ ```
329
+ Border Radius:
330
+ - Formality 1-3: sm=2, md=4, lg=8 (sharp, institutional)
331
+ - Formality 4-6: sm=4, md=8, lg=12 (balanced)
332
+ - Formality 7-10: sm=6, md=12, lg=16+ (rounded, friendly)
333
+
334
+ Shadows:
335
+ - Temperature 1-4: cool shadows (blue-tinted, e.g., rgba(0,0,30,0.08))
336
+ - Temperature 5-7: neutral shadows
337
+ - Temperature 8-10: warm shadows (amber-tinted, e.g., rgba(30,15,0,0.06))
338
+
339
+ Motion:
340
+ - Formality 1-4: minimal, functional transitions only
341
+ - Formality 5-7: subtle micro-interactions
342
+ - Formality 8-10: expressive animations, playful feedback
343
+ ```
344
+
345
+ ### Anti-Convergence Rules
346
+
347
+ Even with the same vertical and similar seeds, two projects must not converge. The system ensures this by:
348
+
349
+ 1. **Never defaulting to the first option in any list.** If the font recommendation list is [DM Sans, Plus Jakarta Sans, Satoshi], the system doesn't always pick DM Sans. It considers the full seed and makes a justified selection.
350
+
351
+ 2. **Requiring unique reasoning in every tokens.css.** The comment explaining each choice must reference THIS project's specific context, not generic advice. If two projects can't be distinguished by their token comments, the differentiation failed.
352
+
353
+ 3. **Hue randomization within ranges.** Instead of "fintech → 180°", it's "fintech with seed personality:7 → 250-290° range → randomly select within range, then fine-tune." The range narrows the possibilities; the seed + project context picks the specific value.
354
+
355
+ 4. **Explicit anti-clone check.** During /motif:system, if the user mentioned competitor products during init, the system checks: "Would my generated palette be confused with [competitor]? If yes, shift."
356
+
357
+ ---
358
+
359
+ ## 6. Updated DESIGN-BRIEF.md Format
360
+
361
+ The brief now includes structured input and differentiation data:
362
+
363
+ ```markdown
364
+ # Design Brief — [Product Name]
365
+
366
+ ## Inputs
367
+ ### Input Type
368
+ [A/B/C/D/combination]
369
+
370
+ ### Brand Constraints
371
+ [Specific locked values, or "none — starting fresh"]
372
+
373
+ ### Visual References
374
+ [Products, screenshots, or "none"]
375
+
376
+ ### Design File
377
+ [Figma URL, screenshot paths, or "none"]
378
+
379
+ ## Differentiation Seed
380
+ - Personality: [1-10] — [reasoning]
381
+ - Temperature: [1-10] — [reasoning]
382
+ - Density: [1-10] — [reasoning]
383
+ - Formality: [1-10] — [reasoning]
384
+ - Era: [1-10] — [reasoning]
385
+
386
+ ## Aesthetic Direction
387
+ [Informed by seed + vertical + inputs]
388
+
389
+ ## This Is NOT
390
+ [Explicit anti-patterns INCLUDING named competitors to differentiate from]
391
+
392
+ ## Typography Direction
393
+ [Informed by seed]
394
+
395
+ ## Color Direction
396
+ [Informed by seed + brand constraints if any]
397
+
398
+ ## Spatial Philosophy
399
+ [Informed by density axis]
400
+
401
+ ## Motion Philosophy
402
+ [Informed by formality axis]
403
+
404
+ ## Interaction Model
405
+ [From research]
406
+
407
+ ## Accessibility
408
+ [WCAG level + specific needs]
409
+ ```
410
+
411
+ ---
412
+
413
+ ## 7. Summary: How Each Input Type Changes the Workflow
414
+
415
+ | Step | Type A (Fresh) | Type B (Brand) | Type C (References) | Type D (Figma) |
416
+ |---|---|---|---|---|
417
+ | `/motif:init` | Full interview + seed | Interview + lock colors/fonts | Interview + save refs | Interview + set fidelity mode |
418
+ | `/motif:research` | Full research | Research considers brand | Refs prioritized in audit | Skip (D1) or validate (D2) |
419
+ | `/motif:system` | Generate from seed + research | Build around locked values | Use refs as starting points | Extract from design file |
420
+ | `/motif:compose` | Normal | Normal (tokens carry constraints) | Normal (tokens carry direction) | Implement against design |
421
+ | `/motif:review` | Full 4-lens | Full + brand compliance check | Full 4-lens | Fidelity check (D1) or full (D2) |