devflow-kit 1.1.0 → 1.3.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 (152) hide show
  1. package/CHANGELOG.md +69 -1
  2. package/README.md +23 -6
  3. package/dist/cli.js +2 -0
  4. package/dist/commands/ambient.js +5 -4
  5. package/dist/commands/init.js +4 -2
  6. package/dist/commands/memory.js +4 -4
  7. package/dist/commands/skills.d.ts +11 -0
  8. package/dist/commands/skills.js +116 -0
  9. package/dist/commands/uninstall.js +11 -1
  10. package/dist/plugins.js +67 -3
  11. package/dist/utils/installer.js +20 -2
  12. package/package.json +4 -2
  13. package/plugins/devflow-accessibility/.claude-plugin/plugin.json +22 -0
  14. package/plugins/devflow-ambient/.claude-plugin/plugin.json +4 -2
  15. package/plugins/devflow-ambient/README.md +8 -8
  16. package/plugins/devflow-ambient/commands/ambient.md +14 -14
  17. package/plugins/devflow-ambient/skills/ambient-router/SKILL.md +16 -9
  18. package/plugins/devflow-ambient/skills/ambient-router/references/skill-catalog.md +6 -2
  19. package/plugins/devflow-audit-claude/.claude-plugin/plugin.json +1 -1
  20. package/plugins/devflow-code-review/.claude-plugin/plugin.json +13 -6
  21. package/plugins/devflow-code-review/agents/reviewer.md +8 -0
  22. package/plugins/devflow-code-review/commands/code-review-teams.md +11 -1
  23. package/plugins/devflow-code-review/commands/code-review.md +12 -2
  24. package/plugins/devflow-code-review/skills/architecture-patterns/SKILL.md +1 -1
  25. package/plugins/devflow-code-review/skills/complexity-patterns/SKILL.md +1 -1
  26. package/plugins/devflow-code-review/skills/consistency-patterns/SKILL.md +1 -1
  27. package/plugins/devflow-code-review/skills/database-patterns/SKILL.md +1 -1
  28. package/plugins/devflow-code-review/skills/dependencies-patterns/SKILL.md +1 -1
  29. package/plugins/devflow-code-review/skills/documentation-patterns/SKILL.md +1 -1
  30. package/plugins/devflow-code-review/skills/performance-patterns/SKILL.md +1 -1
  31. package/plugins/devflow-code-review/skills/regression-patterns/SKILL.md +1 -1
  32. package/plugins/devflow-code-review/skills/review-methodology/SKILL.md +1 -1
  33. package/plugins/devflow-code-review/skills/security-patterns/SKILL.md +1 -1
  34. package/plugins/devflow-core-skills/.claude-plugin/plugin.json +10 -7
  35. package/plugins/devflow-core-skills/skills/test-driven-development/SKILL.md +5 -8
  36. package/plugins/devflow-debug/.claude-plugin/plugin.json +10 -3
  37. package/plugins/devflow-frontend-design/.claude-plugin/plugin.json +22 -0
  38. package/plugins/devflow-go/.claude-plugin/plugin.json +22 -0
  39. package/plugins/devflow-go/skills/go/SKILL.md +187 -0
  40. package/plugins/devflow-go/skills/go/references/concurrency.md +312 -0
  41. package/plugins/devflow-go/skills/go/references/detection.md +129 -0
  42. package/plugins/devflow-go/skills/go/references/patterns.md +232 -0
  43. package/plugins/devflow-go/skills/go/references/violations.md +205 -0
  44. package/plugins/devflow-implement/.claude-plugin/plugin.json +19 -5
  45. package/plugins/devflow-implement/agents/coder.md +11 -6
  46. package/plugins/devflow-implement/skills/self-review/SKILL.md +1 -1
  47. package/plugins/devflow-java/.claude-plugin/plugin.json +22 -0
  48. package/plugins/devflow-java/skills/java/SKILL.md +183 -0
  49. package/plugins/devflow-java/skills/java/references/detection.md +120 -0
  50. package/plugins/devflow-java/skills/java/references/modern-java.md +270 -0
  51. package/plugins/devflow-java/skills/java/references/patterns.md +235 -0
  52. package/plugins/devflow-java/skills/java/references/violations.md +213 -0
  53. package/plugins/devflow-python/.claude-plugin/plugin.json +22 -0
  54. package/plugins/devflow-python/skills/python/SKILL.md +188 -0
  55. package/plugins/devflow-python/skills/python/references/async.md +220 -0
  56. package/plugins/devflow-python/skills/python/references/detection.md +128 -0
  57. package/plugins/devflow-python/skills/python/references/patterns.md +226 -0
  58. package/plugins/devflow-python/skills/python/references/violations.md +204 -0
  59. package/plugins/devflow-react/.claude-plugin/plugin.json +22 -0
  60. package/plugins/{devflow-core-skills → devflow-react}/skills/react/SKILL.md +1 -1
  61. package/plugins/{devflow-core-skills → devflow-react}/skills/react/references/patterns.md +3 -3
  62. package/plugins/devflow-resolve/.claude-plugin/plugin.json +13 -3
  63. package/plugins/devflow-resolve/skills/security-patterns/SKILL.md +1 -1
  64. package/plugins/devflow-rust/.claude-plugin/plugin.json +22 -0
  65. package/plugins/devflow-rust/skills/rust/SKILL.md +193 -0
  66. package/plugins/devflow-rust/skills/rust/references/detection.md +131 -0
  67. package/plugins/devflow-rust/skills/rust/references/ownership.md +242 -0
  68. package/plugins/devflow-rust/skills/rust/references/patterns.md +210 -0
  69. package/plugins/devflow-rust/skills/rust/references/violations.md +191 -0
  70. package/plugins/devflow-self-review/.claude-plugin/plugin.json +10 -3
  71. package/plugins/devflow-self-review/skills/self-review/SKILL.md +1 -1
  72. package/plugins/devflow-specify/.claude-plugin/plugin.json +15 -4
  73. package/plugins/devflow-typescript/.claude-plugin/plugin.json +22 -0
  74. package/plugins/{devflow-core-skills → devflow-typescript}/skills/typescript/references/patterns.md +3 -3
  75. package/scripts/hooks/{ambient-prompt.sh → ambient-prompt} +4 -4
  76. package/scripts/hooks/{background-memory-update.sh → background-memory-update} +3 -3
  77. package/scripts/hooks/{ensure-memory-gitignore.sh → ensure-memory-gitignore} +1 -1
  78. package/scripts/hooks/{pre-compact-memory.sh → pre-compact-memory} +2 -2
  79. package/scripts/hooks/run-hook +23 -0
  80. package/scripts/hooks/session-start-memory +151 -0
  81. package/scripts/hooks/{stop-update-memory.sh → stop-update-memory} +4 -4
  82. package/shared/agents/coder.md +11 -6
  83. package/shared/agents/reviewer.md +8 -0
  84. package/shared/skills/ambient-router/SKILL.md +16 -9
  85. package/shared/skills/ambient-router/references/skill-catalog.md +6 -2
  86. package/shared/skills/architecture-patterns/SKILL.md +1 -1
  87. package/shared/skills/complexity-patterns/SKILL.md +1 -1
  88. package/shared/skills/consistency-patterns/SKILL.md +1 -1
  89. package/shared/skills/database-patterns/SKILL.md +1 -1
  90. package/shared/skills/dependencies-patterns/SKILL.md +1 -1
  91. package/shared/skills/documentation-patterns/SKILL.md +1 -1
  92. package/shared/skills/go/SKILL.md +187 -0
  93. package/shared/skills/go/references/concurrency.md +312 -0
  94. package/shared/skills/go/references/detection.md +129 -0
  95. package/shared/skills/go/references/patterns.md +232 -0
  96. package/shared/skills/go/references/violations.md +205 -0
  97. package/shared/skills/java/SKILL.md +183 -0
  98. package/shared/skills/java/references/detection.md +120 -0
  99. package/shared/skills/java/references/modern-java.md +270 -0
  100. package/shared/skills/java/references/patterns.md +235 -0
  101. package/shared/skills/java/references/violations.md +213 -0
  102. package/shared/skills/performance-patterns/SKILL.md +1 -1
  103. package/shared/skills/python/SKILL.md +188 -0
  104. package/shared/skills/python/references/async.md +220 -0
  105. package/shared/skills/python/references/detection.md +128 -0
  106. package/shared/skills/python/references/patterns.md +226 -0
  107. package/shared/skills/python/references/violations.md +204 -0
  108. package/shared/skills/react/SKILL.md +1 -1
  109. package/shared/skills/react/references/patterns.md +3 -3
  110. package/shared/skills/regression-patterns/SKILL.md +1 -1
  111. package/shared/skills/review-methodology/SKILL.md +1 -1
  112. package/shared/skills/rust/SKILL.md +193 -0
  113. package/shared/skills/rust/references/detection.md +131 -0
  114. package/shared/skills/rust/references/ownership.md +242 -0
  115. package/shared/skills/rust/references/patterns.md +210 -0
  116. package/shared/skills/rust/references/violations.md +191 -0
  117. package/shared/skills/security-patterns/SKILL.md +1 -1
  118. package/shared/skills/self-review/SKILL.md +1 -1
  119. package/shared/skills/test-driven-development/SKILL.md +5 -8
  120. package/shared/skills/typescript/references/patterns.md +3 -3
  121. package/src/templates/settings.json +3 -3
  122. package/plugins/devflow-code-review/skills/react/SKILL.md +0 -276
  123. package/plugins/devflow-code-review/skills/react/references/patterns.md +0 -1331
  124. package/plugins/devflow-core-skills/skills/accessibility/SKILL.md +0 -229
  125. package/plugins/devflow-core-skills/skills/accessibility/references/detection.md +0 -171
  126. package/plugins/devflow-core-skills/skills/accessibility/references/patterns.md +0 -670
  127. package/plugins/devflow-core-skills/skills/accessibility/references/violations.md +0 -419
  128. package/plugins/devflow-core-skills/skills/frontend-design/SKILL.md +0 -254
  129. package/plugins/devflow-core-skills/skills/frontend-design/references/detection.md +0 -184
  130. package/plugins/devflow-core-skills/skills/frontend-design/references/patterns.md +0 -511
  131. package/plugins/devflow-core-skills/skills/frontend-design/references/violations.md +0 -453
  132. package/plugins/devflow-core-skills/skills/react/references/violations.md +0 -565
  133. package/plugins/devflow-implement/skills/accessibility/SKILL.md +0 -229
  134. package/plugins/devflow-implement/skills/accessibility/references/detection.md +0 -171
  135. package/plugins/devflow-implement/skills/accessibility/references/patterns.md +0 -670
  136. package/plugins/devflow-implement/skills/accessibility/references/violations.md +0 -419
  137. package/plugins/devflow-implement/skills/frontend-design/SKILL.md +0 -254
  138. package/plugins/devflow-implement/skills/frontend-design/references/detection.md +0 -184
  139. package/plugins/devflow-implement/skills/frontend-design/references/patterns.md +0 -511
  140. package/plugins/devflow-implement/skills/frontend-design/references/violations.md +0 -453
  141. package/scripts/hooks/session-start-memory.sh +0 -126
  142. /package/plugins/{devflow-code-review → devflow-accessibility}/skills/accessibility/SKILL.md +0 -0
  143. /package/plugins/{devflow-code-review → devflow-accessibility}/skills/accessibility/references/detection.md +0 -0
  144. /package/plugins/{devflow-code-review → devflow-accessibility}/skills/accessibility/references/patterns.md +0 -0
  145. /package/plugins/{devflow-code-review → devflow-accessibility}/skills/accessibility/references/violations.md +0 -0
  146. /package/plugins/{devflow-code-review → devflow-frontend-design}/skills/frontend-design/SKILL.md +0 -0
  147. /package/plugins/{devflow-code-review → devflow-frontend-design}/skills/frontend-design/references/detection.md +0 -0
  148. /package/plugins/{devflow-code-review → devflow-frontend-design}/skills/frontend-design/references/patterns.md +0 -0
  149. /package/plugins/{devflow-code-review → devflow-frontend-design}/skills/frontend-design/references/violations.md +0 -0
  150. /package/plugins/{devflow-code-review → devflow-react}/skills/react/references/violations.md +0 -0
  151. /package/plugins/{devflow-core-skills → devflow-typescript}/skills/typescript/SKILL.md +0 -0
  152. /package/plugins/{devflow-core-skills → devflow-typescript}/skills/typescript/references/violations.md +0 -0
@@ -1,184 +0,0 @@
1
- # Frontend Design Detection Patterns
2
-
3
- Grep and regex patterns for detecting design issues. Use with `Grep` tool.
4
-
5
- ## Typography Issues
6
-
7
- ```bash
8
- # Font-family without rationale (look for undocumented choices)
9
- rg "font-family:" --type css --type scss
10
-
11
- # Flat heading sizes (minimal difference between levels)
12
- rg "h[1-6]\s*\{" --type css -A3 | rg "font-size"
13
-
14
- # Hardcoded font sizes (not using scale)
15
- rg "font-size:\s*\d+px" --type css
16
-
17
- # Line-height issues
18
- rg "line-height:\s*[01]\.[0-3]" --type css # Too tight
19
- rg "line-height:\s*[2-9]" --type css # Too loose
20
- ```
21
-
22
- ## Color Issues
23
-
24
- ```bash
25
- # Random hex values (not using variables)
26
- rg "#[a-fA-F0-9]{3,6}" --type css | rg -v "var\(--"
27
-
28
- # AI slop gradients (purple-pink patterns)
29
- rg "gradient.*#(667e|764b|8b5c|ec48|f974)" --type css -i
30
- rg "from-purple.*to-pink" --type tsx
31
-
32
- # Inline style colors
33
- rg "style=.*color:" --type tsx
34
- rg "style=.*background:" --type tsx
35
-
36
- # filter: invert (dark mode hack)
37
- rg "filter:\s*invert" --type css
38
- ```
39
-
40
- ## Motion Issues
41
-
42
- ```bash
43
- # Decorative animations
44
- rg "animation:.*infinite" --type css
45
- rg "animation:.*pulse" --type css
46
-
47
- # "all" transition (animates layout)
48
- rg "transition:\s*all" --type css
49
-
50
- # Random durations (not using system)
51
- rg "transition:.*\d+\.\d+s" --type css
52
- rg "animation-duration:.*\d+\.\d+s" --type css
53
-
54
- # Linear easing for UI
55
- rg "transition:.*linear" --type css
56
-
57
- # Missing reduced motion support
58
- rg "@media.*prefers-reduced-motion" --type css -c
59
- ```
60
-
61
- ## Spacing Issues
62
-
63
- ```bash
64
- # Magic number padding/margin
65
- rg "(padding|margin):\s*\d{2,}px" --type css
66
- rg "(padding|margin):.*\d+px\s+\d+px\s+\d+px\s+\d+px" --type css
67
-
68
- # Hardcoded Tailwind spacing (not using scale)
69
- rg "class=.*p-\[.*px\]" --type tsx
70
- rg "class=.*m-\[.*px\]" --type tsx
71
-
72
- # Inconsistent gap usage
73
- rg "gap:\s*\d+px" --type css
74
- ```
75
-
76
- ## Layout Issues
77
-
78
- ```bash
79
- # Everything centered
80
- rg "text-align:\s*center" --type css -c
81
-
82
- # Border-radius overuse (same value everywhere)
83
- rg "border-radius:\s*12px" --type css -c
84
- rg "rounded-xl" --type tsx -c
85
-
86
- # Shadow on everything
87
- rg "box-shadow:" --type css -c
88
-
89
- # Bento grid patterns
90
- rg "grid-column:\s*span" --type css -c
91
- ```
92
-
93
- ## AI Slop Patterns
94
-
95
- ```bash
96
- # Generic hero sections
97
- rg "class=.*hero.*gradient" --type tsx
98
- rg "<section.*hero" --type tsx
99
-
100
- # Glassmorphism patterns
101
- rg "backdrop-filter:\s*blur" --type css
102
- rg "rgba.*0\.[12]" --type css # Low opacity backgrounds
103
-
104
- # Trending patterns
105
- rg "animate-bounce|animate-pulse" --type tsx
106
- rg "hover:scale-" --type tsx
107
-
108
- # Template-like code
109
- rg "Welcome to|Get Started|Learn More" --type tsx
110
- ```
111
-
112
- ## Dark Mode Issues
113
-
114
- ```bash
115
- # Dark mode not defined
116
- rg "prefers-color-scheme:\s*dark" --type css -c
117
-
118
- # Only background swap
119
- rg "\.dark\s*\{" --type css -A5 | rg -v "color:"
120
-
121
- # Same shadows in dark mode
122
- rg "\.dark.*box-shadow" --type css
123
- ```
124
-
125
- ## Component Issues
126
-
127
- ```bash
128
- # Inline styles (not using design system)
129
- rg "style=\{\{" --type tsx -c
130
-
131
- # Hardcoded colors in components
132
- rg "color:\s*['\"]#" --type tsx
133
- rg "background:\s*['\"]#" --type tsx
134
-
135
- # Non-token spacing
136
- rg "padding:\s*['\"].*px" --type tsx
137
- rg "margin:\s*['\"].*px" --type tsx
138
- ```
139
-
140
- ## Testing Commands
141
-
142
- ```bash
143
- # Full design audit on CSS files
144
- echo "=== Typography Issues ==="
145
- rg "font-size:\s*\d+px" --type css -c
146
-
147
- echo "=== Color Issues ==="
148
- rg "#[a-fA-F0-9]{6}" --type css | rg -v "var\(--" | wc -l
149
-
150
- echo "=== Motion Issues ==="
151
- rg "animation:.*infinite" --type css -c
152
-
153
- echo "=== Spacing Issues ==="
154
- rg "(padding|margin):\s*\d+px" --type css | wc -l
155
-
156
- echo "=== Design System Usage ==="
157
- rg "var\(--" --type css -c
158
- ```
159
-
160
- ## Tailwind-Specific Issues
161
-
162
- ```bash
163
- # Arbitrary values (bypassing design system)
164
- rg "\[#[a-fA-F0-9]+\]" --type tsx
165
- rg "\[\d+px\]" --type tsx
166
- rg "\[\d+rem\]" --type tsx
167
-
168
- # Inconsistent responsive prefixes
169
- rg "md:|lg:|xl:" --type tsx | sort | uniq -c
170
-
171
- # Excessive utility classes (consider extraction)
172
- rg "className=\"[^\"]{200,}\"" --type tsx
173
- ```
174
-
175
- ## CSS-in-JS Issues
176
-
177
- ```bash
178
- # Hardcoded values in styled-components
179
- rg "styled\." --type tsx -A10 | rg "\d+px"
180
- rg "styled\." --type tsx -A10 | rg "#[a-fA-F0-9]"
181
-
182
- # Missing theme usage
183
- rg "styled\." --type tsx -A10 | rg -v "theme\."
184
- ```
@@ -1,511 +0,0 @@
1
- # Frontend Design Correct Patterns
2
-
3
- Extended correct patterns for frontend design. Reference from main SKILL.md.
4
-
5
- ## Typography Patterns
6
-
7
- ### Intentional Font Selection
8
-
9
- ```css
10
- /* CORRECT: Font choice with documented rationale */
11
-
12
- /* Developer tools - monospace conveys precision, code-first */
13
- :root {
14
- --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
15
- --font-sans: 'Inter', system-ui, sans-serif;
16
- }
17
-
18
- /* Documentation - optimized for long-form reading */
19
- :root {
20
- --font-body: 'Source Serif Pro', Georgia, serif;
21
- --font-heading: 'Source Sans Pro', system-ui, sans-serif;
22
- --font-code: 'Source Code Pro', monospace;
23
- }
24
-
25
- /* Brand-forward marketing - distinctive personality */
26
- :root {
27
- --font-display: 'Fraunces', serif; /* Distinctive headlines */
28
- --font-body: 'DM Sans', sans-serif; /* Clean, modern body */
29
- }
30
- ```
31
-
32
- ### Clear Type Scale
33
-
34
- ```css
35
- /* CORRECT: Mathematical type scale (1.25 ratio) */
36
- :root {
37
- --text-xs: 0.64rem; /* 10.24px */
38
- --text-sm: 0.8rem; /* 12.8px */
39
- --text-base: 1rem; /* 16px */
40
- --text-lg: 1.25rem; /* 20px */
41
- --text-xl: 1.563rem; /* 25px */
42
- --text-2xl: 1.953rem; /* 31.25px */
43
- --text-3xl: 2.441rem; /* 39px */
44
- --text-4xl: 3.052rem; /* 48.8px */
45
- }
46
-
47
- /* CORRECT: Distinct heading styles */
48
- h1 {
49
- font-size: var(--text-4xl);
50
- font-weight: 800;
51
- letter-spacing: -0.03em;
52
- line-height: 1.1;
53
- }
54
-
55
- h2 {
56
- font-size: var(--text-2xl);
57
- font-weight: 700;
58
- letter-spacing: -0.02em;
59
- line-height: 1.2;
60
- }
61
-
62
- h3 {
63
- font-size: var(--text-xl);
64
- font-weight: 600;
65
- letter-spacing: -0.01em;
66
- line-height: 1.3;
67
- }
68
- ```
69
-
70
- ### Optimized Readability
71
-
72
- ```css
73
- /* CORRECT: Context-appropriate line length and height */
74
- .prose {
75
- max-width: 65ch; /* ~65 characters per line */
76
- line-height: 1.7;
77
- font-size: 1.125rem; /* Slightly larger for reading */
78
- }
79
-
80
- .ui-text {
81
- max-width: none;
82
- line-height: 1.4;
83
- font-size: 0.875rem;
84
- }
85
-
86
- .code {
87
- line-height: 1.5;
88
- font-size: 0.9em;
89
- tab-size: 2;
90
- }
91
- ```
92
-
93
- ---
94
-
95
- ## Color System Patterns
96
-
97
- ### Semantic Color Tokens
98
-
99
- ```css
100
- /* CORRECT: Multi-layer color system */
101
- :root {
102
- /* Primitive colors (raw values) */
103
- --blue-50: #eff6ff;
104
- --blue-500: #3b82f6;
105
- --blue-600: #2563eb;
106
- --blue-700: #1d4ed8;
107
-
108
- /* Semantic tokens (meaning) */
109
- --color-primary: var(--blue-600);
110
- --color-primary-hover: var(--blue-700);
111
- --color-primary-subtle: var(--blue-50);
112
-
113
- /* Component tokens (usage) */
114
- --button-primary-bg: var(--color-primary);
115
- --button-primary-bg-hover: var(--color-primary-hover);
116
- --link-color: var(--color-primary);
117
- }
118
-
119
- /* Dark mode swaps semantic tokens, not primitives */
120
- @media (prefers-color-scheme: dark) {
121
- :root {
122
- --color-primary: var(--blue-500);
123
- --color-primary-hover: var(--blue-400);
124
- --color-primary-subtle: var(--blue-900);
125
- }
126
- }
127
- ```
128
-
129
- ### Intentional Dark Mode
130
-
131
- ```css
132
- /* CORRECT: Designed dark mode, not inverted */
133
- :root {
134
- /* Light mode surfaces */
135
- --surface-0: #ffffff;
136
- --surface-1: #f9fafb;
137
- --surface-2: #f3f4f6;
138
- --surface-elevated: #ffffff;
139
-
140
- /* Light mode text */
141
- --text-primary: #111827;
142
- --text-secondary: #4b5563;
143
- --text-muted: #9ca3af;
144
-
145
- /* Light mode borders */
146
- --border-default: #e5e7eb;
147
- --border-strong: #d1d5db;
148
- }
149
-
150
- @media (prefers-color-scheme: dark) {
151
- :root {
152
- /* Dark mode surfaces - elevation via lightness */
153
- --surface-0: #0a0a0a;
154
- --surface-1: #141414;
155
- --surface-2: #1f1f1f;
156
- --surface-elevated: #262626;
157
-
158
- /* Dark mode text */
159
- --text-primary: #f9fafb;
160
- --text-secondary: #d1d5db;
161
- --text-muted: #6b7280;
162
-
163
- /* Dark mode borders */
164
- --border-default: #2e2e2e;
165
- --border-strong: #404040;
166
- }
167
- }
168
- ```
169
-
170
- ### Accessible Color Contrast
171
-
172
- ```css
173
- /* CORRECT: Verified contrast ratios */
174
- :root {
175
- /* All text colors meet WCAG AA on their intended backgrounds */
176
- --text-on-primary: #ffffff; /* White on blue-600: 4.6:1 */
177
- --text-on-surface: #111827; /* Gray-900 on white: 15.8:1 */
178
- --text-secondary: #4b5563; /* Gray-600 on white: 5.7:1 */
179
- --text-link: #2563eb; /* Blue-600 on white: 4.5:1 */
180
- }
181
- ```
182
-
183
- ---
184
-
185
- ## Motion Patterns
186
-
187
- ### Animation Timing System
188
-
189
- ```css
190
- /* CORRECT: Consistent timing scale */
191
- :root {
192
- /* Durations */
193
- --duration-instant: 50ms;
194
- --duration-fast: 100ms;
195
- --duration-normal: 200ms;
196
- --duration-slow: 300ms;
197
- --duration-slower: 500ms;
198
-
199
- /* Easing */
200
- --ease-in: cubic-bezier(0.4, 0, 1, 1);
201
- --ease-out: cubic-bezier(0, 0, 0.2, 1);
202
- --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
203
- --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
204
- }
205
-
206
- /* Usage guidelines */
207
- /* instant: Immediate feedback (opacity, color) */
208
- /* fast: Micro-interactions (hover, active states) */
209
- /* normal: Standard UI (dropdowns, tooltips) */
210
- /* slow: Attention transitions (modals, drawers) */
211
- /* slower: Major transitions (page, layout) */
212
- ```
213
-
214
- ### Purposeful State Transitions
215
-
216
- ```css
217
- /* CORRECT: Animation communicates function */
218
- .button {
219
- transition:
220
- background-color var(--duration-fast) var(--ease-out),
221
- transform var(--duration-instant) var(--ease-out);
222
- }
223
-
224
- .button:hover {
225
- background-color: var(--button-hover-bg);
226
- }
227
-
228
- .button:active {
229
- transform: scale(0.98); /* "I received your input" */
230
- }
231
-
232
- /* CORRECT: Loading state with meaningful animation */
233
- .button[data-loading] {
234
- position: relative;
235
- color: transparent; /* Hide text */
236
- }
237
-
238
- .button[data-loading]::after {
239
- content: '';
240
- position: absolute;
241
- width: 16px;
242
- height: 16px;
243
- border: 2px solid currentColor;
244
- border-right-color: transparent;
245
- border-radius: 50%;
246
- animation: spin var(--duration-slower) linear infinite;
247
- }
248
- ```
249
-
250
- ### Reduced Motion Support
251
-
252
- ```css
253
- /* CORRECT: Complete reduced motion implementation */
254
- @media (prefers-reduced-motion: reduce) {
255
- *,
256
- *::before,
257
- *::after {
258
- animation-duration: 0.01ms !important;
259
- animation-iteration-count: 1 !important;
260
- transition-duration: 0.01ms !important;
261
- scroll-behavior: auto !important;
262
- }
263
- }
264
-
265
- /* Or preserve critical animations with reduced intensity */
266
- @media (prefers-reduced-motion: reduce) {
267
- .modal {
268
- transition: opacity var(--duration-fast);
269
- /* Remove transform animation, keep opacity */
270
- }
271
-
272
- .skeleton {
273
- animation: none;
274
- /* Static skeleton, no pulse */
275
- }
276
- }
277
- ```
278
-
279
- ---
280
-
281
- ## Spacing Patterns
282
-
283
- ### Mathematical Spacing Scale
284
-
285
- ```css
286
- /* CORRECT: Base-4 spacing system */
287
- :root {
288
- --space-0: 0;
289
- --space-px: 1px;
290
- --space-0.5: 0.125rem; /* 2px */
291
- --space-1: 0.25rem; /* 4px */
292
- --space-2: 0.5rem; /* 8px */
293
- --space-3: 0.75rem; /* 12px */
294
- --space-4: 1rem; /* 16px */
295
- --space-5: 1.25rem; /* 20px */
296
- --space-6: 1.5rem; /* 24px */
297
- --space-8: 2rem; /* 32px */
298
- --space-10: 2.5rem; /* 40px */
299
- --space-12: 3rem; /* 48px */
300
- --space-16: 4rem; /* 64px */
301
- --space-20: 5rem; /* 80px */
302
- --space-24: 6rem; /* 96px */
303
- }
304
- ```
305
-
306
- ### Component-Level Spacing
307
-
308
- ```css
309
- /* CORRECT: Consistent component spacing */
310
- .card {
311
- padding: var(--space-6);
312
- }
313
-
314
- .card-header {
315
- margin-bottom: var(--space-4);
316
- }
317
-
318
- .card-title {
319
- margin-bottom: var(--space-2);
320
- }
321
-
322
- .card-actions {
323
- margin-top: var(--space-6);
324
- display: flex;
325
- gap: var(--space-3);
326
- }
327
-
328
- /* CORRECT: Section spacing with hierarchy */
329
- .section {
330
- padding-block: var(--space-16);
331
- }
332
-
333
- .section + .section {
334
- border-top: 1px solid var(--border-default);
335
- }
336
-
337
- .section-header {
338
- margin-bottom: var(--space-8);
339
- }
340
-
341
- .section-content > * + * {
342
- margin-top: var(--space-4);
343
- }
344
- ```
345
-
346
- ---
347
-
348
- ## Layout Patterns
349
-
350
- ### Contextual Border Radius
351
-
352
- ```css
353
- /* CORRECT: Radius varies by component size and context */
354
- :root {
355
- --radius-sm: 4px; /* Small elements: badges, tags */
356
- --radius-md: 6px; /* Medium: inputs, buttons */
357
- --radius-lg: 8px; /* Large: cards, dialogs */
358
- --radius-xl: 12px; /* Extra large: modals, panels */
359
- --radius-full: 9999px; /* Pills, avatars */
360
- }
361
-
362
- .badge { border-radius: var(--radius-sm); }
363
- .button { border-radius: var(--radius-md); }
364
- .card { border-radius: var(--radius-lg); }
365
- .modal { border-radius: var(--radius-xl); }
366
- .avatar { border-radius: var(--radius-full); }
367
- ```
368
-
369
- ### Intentional Elevation
370
-
371
- ```css
372
- /* CORRECT: Shadows indicate interactivity level */
373
- :root {
374
- --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
375
- --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
376
- --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
377
- --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
378
- }
379
-
380
- /* Static content - no shadow or subtle */
381
- .card { box-shadow: var(--shadow-sm); }
382
-
383
- /* Interactive, hoverable - medium shadow on hover */
384
- .card-interactive:hover {
385
- box-shadow: var(--shadow-md);
386
- }
387
-
388
- /* Floating UI (dropdowns, tooltips) - larger shadow */
389
- .dropdown { box-shadow: var(--shadow-lg); }
390
-
391
- /* Modals, dialogs - maximum elevation */
392
- .modal { box-shadow: var(--shadow-xl); }
393
- ```
394
-
395
- ### Responsive Breakpoint System
396
-
397
- ```css
398
- /* CORRECT: Minimal, purposeful breakpoints */
399
- :root {
400
- /* Mobile-first defaults */
401
-
402
- /* Tablet: when two columns become useful */
403
- --breakpoint-md: 768px;
404
-
405
- /* Desktop: when full layout is appropriate */
406
- --breakpoint-lg: 1024px;
407
-
408
- /* Wide: when extra space needs addressing */
409
- --breakpoint-xl: 1280px;
410
- }
411
-
412
- /* Container with responsive padding */
413
- .container {
414
- width: 100%;
415
- max-width: var(--breakpoint-xl);
416
- margin-inline: auto;
417
- padding-inline: var(--space-4);
418
- }
419
-
420
- @media (min-width: 768px) {
421
- .container {
422
- padding-inline: var(--space-6);
423
- }
424
- }
425
-
426
- @media (min-width: 1024px) {
427
- .container {
428
- padding-inline: var(--space-8);
429
- }
430
- }
431
- ```
432
-
433
- ---
434
-
435
- ## Component Patterns
436
-
437
- ### Design Token Usage
438
-
439
- ```tsx
440
- // CORRECT: Components use tokens, not raw values
441
- const Button = styled.button`
442
- padding: var(--space-2) var(--space-4);
443
- font-size: var(--text-sm);
444
- font-weight: 500;
445
- border-radius: var(--radius-md);
446
- background: var(--color-primary);
447
- color: var(--text-on-primary);
448
- transition: background var(--duration-fast) var(--ease-out);
449
-
450
- &:hover {
451
- background: var(--color-primary-hover);
452
- }
453
-
454
- &:active {
455
- transform: scale(0.98);
456
- }
457
- `;
458
- ```
459
-
460
- ### Systematic Icon Sizing
461
-
462
- ```css
463
- /* CORRECT: Icon sizes that align with text */
464
- .icon-xs { width: 12px; height: 12px; } /* With text-xs */
465
- .icon-sm { width: 16px; height: 16px; } /* With text-sm */
466
- .icon-md { width: 20px; height: 20px; } /* With text-base */
467
- .icon-lg { width: 24px; height: 24px; } /* With text-lg */
468
- .icon-xl { width: 32px; height: 32px; } /* Standalone */
469
-
470
- /* Icons in buttons */
471
- .button .icon {
472
- flex-shrink: 0;
473
- }
474
-
475
- .button-sm .icon { width: 14px; height: 14px; }
476
- .button-md .icon { width: 16px; height: 16px; }
477
- .button-lg .icon { width: 20px; height: 20px; }
478
- ```
479
-
480
- ---
481
-
482
- ## Design System Documentation
483
-
484
- ```css
485
- /* CORRECT: Self-documenting design tokens */
486
- :root {
487
- /*
488
- * COLOR SYSTEM
489
- * ------------
490
- * Primitives: Raw color values, named by hue+shade
491
- * Semantic: Meaning-based aliases (primary, success, error)
492
- * Component: Specific usage (button-bg, input-border)
493
- */
494
-
495
- /*
496
- * SPACING SYSTEM
497
- * --------------
498
- * Base unit: 4px (0.25rem)
499
- * Scale: 0, 0.5, 1, 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24
500
- * Usage: Use smallest value that creates visual separation
501
- */
502
-
503
- /*
504
- * TYPOGRAPHY SYSTEM
505
- * -----------------
506
- * Scale ratio: 1.25 (major third)
507
- * Base: 16px (1rem)
508
- * Weights: 400 (body), 500 (emphasis), 600 (heading), 700 (display)
509
- */
510
- }
511
- ```