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
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 SailsLab
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,91 @@
1
+ # Motif
2
+
3
+ > Domain-intelligent design system for AI coding assistants
4
+
5
+ AI coding tools produce generic, domain-inappropriate UI -- a fintech dashboard that looks like a meditation app, a health portal with e-commerce patterns. Motif fixes this by injecting domain intelligence from vertical databases (fintech, health, SaaS, e-commerce) and composing each screen with a fresh agent context window, so screen 10 is as sharp as screen 1.
6
+
7
+ ## Quick Start
8
+
9
+ ```bash
10
+ npx motif-design@latest
11
+ ```
12
+
13
+ This auto-detects your AI runtime (Claude Code for v1), installs design intelligence into your project, and sets up slash commands. Start designing with `/motif:init`.
14
+
15
+ ## Commands
16
+
17
+ ### Core Workflow (run in order)
18
+
19
+ | Command | What it does |
20
+ |---------|-------------|
21
+ | `/motif:init` | Interview, vertical detection, design brief |
22
+ | `/motif:research` | 4-agent parallel research, locked design decisions |
23
+ | `/motif:system` | Generate tokens + component specs + visual showcase |
24
+ | `/motif:compose [screen]` | Build screen with fresh agent context |
25
+ | `/motif:review [screen\|all]` | 4-lens heuristic evaluation, scored /100 |
26
+ | `/motif:fix [screen]` | Fix review findings systematically |
27
+
28
+ ### Iteration
29
+
30
+ | Command | What it does |
31
+ |---------|-------------|
32
+ | `/motif:evolve` | Update design system based on learnings |
33
+ | `/motif:quick [desc]` | Ad-hoc task with design system consistency |
34
+
35
+ ### Navigation
36
+
37
+ | Command | What it does |
38
+ |---------|-------------|
39
+ | `/motif:progress` | Current status + next steps |
40
+ | `/motif:help` | Command reference |
41
+
42
+ ## How It Works
43
+
44
+ Three things make Motif different from generic UI generation:
45
+
46
+ **Domain intelligence.** Vertical databases contain domain-specific color palettes, typography scales, component patterns, layout conventions, and anti-patterns. When you tell Motif you are building a fintech app, every design decision draws from established fintech patterns -- not random defaults.
47
+
48
+ **Fresh context per screen.** Each screen is composed by a fresh subagent with a full 200K token context window loaded with your design system, research decisions, and domain knowledge. There is no context degradation over time. The tenth screen gets the same quality as the first.
49
+
50
+ **Design system enforcement.** Hooks run during composition to catch hardcoded color values, banned fonts, spacing violations, and accessibility issues before they ship. The design system is not advisory -- it is enforced.
51
+
52
+ ## Architecture
53
+
54
+ ```
55
+ User runs /motif:compose login
56
+ |
57
+ v
58
+ Runtime Adapter (Claude Code)
59
+ thin command file -> loads core workflow
60
+ |
61
+ v
62
+ Core Workflow (compose-screen.md)
63
+ orchestrator reads design system, spawns fresh subagent
64
+ |
65
+ v
66
+ Fresh Subagent (200K context)
67
+ loads tokens.css + COMPONENT-SPECS.md + vertical DB
68
+ builds screen -> commits atomically
69
+ ```
70
+
71
+ Motif uses a **core + adapters** architecture:
72
+
73
+ - **Core** (`core/`) -- shared workflows, references, templates, vertical databases. Runtime-agnostic.
74
+ - **Runtimes** (`runtimes/`) -- thin adapters per AI tool. v1 ships Claude Code; others follow with zero core changes.
75
+
76
+ Installed file layout (Claude Code):
77
+
78
+ ```
79
+ .claude/commands/motif/ Slash commands (/motif:init, etc.)
80
+ .claude/get-motif/ Core: workflows, references, templates, agents
81
+ .planning/design/ Generated design artifacts (tokens, specs, screens)
82
+ ```
83
+
84
+ ## Requirements
85
+
86
+ - Node.js >= 22.0.0
87
+ - Claude Code (v1.0 -- more runtimes coming)
88
+
89
+ ## License
90
+
91
+ [MIT](LICENSE)