@caddis/cli 0.0.0 → 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 (153) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +150 -1
  3. package/bundles/antigravity-plugin/agents/code-reviewer.md +47 -0
  4. package/bundles/antigravity-plugin/agents/preflight.md +53 -0
  5. package/bundles/antigravity-plugin/guard_agy.py +338 -0
  6. package/bundles/antigravity-plugin/hooks.json +36 -0
  7. package/bundles/antigravity-plugin/mcp_config.json +8 -0
  8. package/bundles/antigravity-plugin/mcp_ping_server.py +55 -0
  9. package/bundles/antigravity-plugin/plugin.json +5 -0
  10. package/bundles/antigravity-plugin/session_end_agy.py +57 -0
  11. package/bundles/antigravity-plugin/skills/_registry.md +115 -0
  12. package/bundles/antigravity-plugin/skills/add-rules/SKILL.md +45 -0
  13. package/bundles/antigravity-plugin/skills/api-design/SKILL.md +249 -0
  14. package/bundles/antigravity-plugin/skills/backend-development/SKILL.md +305 -0
  15. package/bundles/antigravity-plugin/skills/best-practices/SKILL.md +500 -0
  16. package/bundles/antigravity-plugin/skills/best-practices/agents/best-practices-referencer.md +263 -0
  17. package/bundles/antigravity-plugin/skills/best-practices/agents/codebase-context-builder.md +326 -0
  18. package/bundles/antigravity-plugin/skills/best-practices/agents/task-intent-analyzer.md +245 -0
  19. package/bundles/antigravity-plugin/skills/best-practices/references/anti-patterns.md +571 -0
  20. package/bundles/antigravity-plugin/skills/best-practices/references/before-after-examples.md +1114 -0
  21. package/bundles/antigravity-plugin/skills/best-practices/references/best-practices-guide.md +513 -0
  22. package/bundles/antigravity-plugin/skills/best-practices/references/common-workflows.md +692 -0
  23. package/bundles/antigravity-plugin/skills/best-practices/references/prompt-patterns.md +547 -0
  24. package/bundles/antigravity-plugin/skills/brainstorming/SKILL.md +57 -0
  25. package/bundles/antigravity-plugin/skills/ci-cd-pipeline/SKILL.md +315 -0
  26. package/bundles/antigravity-plugin/skills/code-documentation/SKILL.md +271 -0
  27. package/bundles/antigravity-plugin/skills/code-review/SKILL.md +122 -0
  28. package/bundles/antigravity-plugin/skills/codebase-audit/SKILL.md +204 -0
  29. package/bundles/antigravity-plugin/skills/context-curator/SKILL.md +157 -0
  30. package/bundles/antigravity-plugin/skills/cross-review/SKILL.md +40 -0
  31. package/bundles/antigravity-plugin/skills/css-architecture/SKILL.md +305 -0
  32. package/bundles/antigravity-plugin/skills/css-architecture/references/RESPONSIVE-DESIGN.md +604 -0
  33. package/bundles/antigravity-plugin/skills/database-design/SKILL.md +177 -0
  34. package/bundles/antigravity-plugin/skills/db-diagram/SKILL.md +148 -0
  35. package/bundles/antigravity-plugin/skills/db-diagram/scripts/sql_to_graph.py +1212 -0
  36. package/bundles/antigravity-plugin/skills/digress/SKILL.md +61 -0
  37. package/bundles/antigravity-plugin/skills/draw-io/SKILL.md +162 -0
  38. package/bundles/antigravity-plugin/skills/draw-io/references/aws-icons.md +677 -0
  39. package/bundles/antigravity-plugin/skills/draw-io/references/layout-guidelines.md +142 -0
  40. package/bundles/antigravity-plugin/skills/draw-io/references/troubleshooting.md +118 -0
  41. package/bundles/antigravity-plugin/skills/draw-io/references/workflows.md +103 -0
  42. package/bundles/antigravity-plugin/skills/draw-io/scripts/convert-drawio-to-png.sh +25 -0
  43. package/bundles/antigravity-plugin/skills/draw-io/scripts/find_aws_icon.py +79 -0
  44. package/bundles/antigravity-plugin/skills/error-handling/SKILL.md +260 -0
  45. package/bundles/antigravity-plugin/skills/excalidraw-db/SKILL.md +38 -0
  46. package/bundles/antigravity-plugin/skills/fastapi-dev/SKILL.md +300 -0
  47. package/bundles/antigravity-plugin/skills/feature-plan/SKILL.md +198 -0
  48. package/bundles/antigravity-plugin/skills/frontend-design/SKILL.md +193 -0
  49. package/bundles/antigravity-plugin/skills/frontend-design/references/my-tech-stack.md +127 -0
  50. package/bundles/antigravity-plugin/skills/gh-cli/SKILL.md +195 -0
  51. package/bundles/antigravity-plugin/skills/git-commit/SKILL.md +285 -0
  52. package/bundles/antigravity-plugin/skills/golden-plan/SKILL.md +577 -0
  53. package/bundles/antigravity-plugin/skills/handoff/SKILL.md +100 -0
  54. package/bundles/antigravity-plugin/skills/implement/SKILL.md +114 -0
  55. package/bundles/antigravity-plugin/skills/javascript-typescript/SKILL.md +142 -0
  56. package/bundles/antigravity-plugin/skills/kb/SKILL.md +60 -0
  57. package/bundles/antigravity-plugin/skills/mermaid-db/SKILL.md +33 -0
  58. package/bundles/antigravity-plugin/skills/mermaid-diagrams/SKILL.md +236 -0
  59. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/ENHANCEMENTS.md +264 -0
  60. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/MERMAID-SUMMARY.md +137 -0
  61. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/advanced-features.md +556 -0
  62. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/architecture-diagrams.md +192 -0
  63. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/c4-diagrams.md +410 -0
  64. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/class-diagrams.md +361 -0
  65. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/erd-diagrams.md +510 -0
  66. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/flowcharts.md +450 -0
  67. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/sequence-diagrams.md +394 -0
  68. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/troubleshooting.md +335 -0
  69. package/bundles/antigravity-plugin/skills/mermaid-diagrams/references/workflows.md +418 -0
  70. package/bundles/antigravity-plugin/skills/migrate-dir/SKILL.md +68 -0
  71. package/bundles/antigravity-plugin/skills/mockup/SKILL.md +242 -0
  72. package/bundles/antigravity-plugin/skills/particle-art/SKILL.md +243 -0
  73. package/bundles/antigravity-plugin/skills/particle-art/references/canvas-utils.ts +171 -0
  74. package/bundles/antigravity-plugin/skills/particle-art/references/dot-field.template.tsx +203 -0
  75. package/bundles/antigravity-plugin/skills/particle-art/references/flow-field.template.tsx +263 -0
  76. package/bundles/antigravity-plugin/skills/particle-art/references/node-shape.template.tsx +261 -0
  77. package/bundles/antigravity-plugin/skills/particle-art/references/shape-sampler.ts +281 -0
  78. package/bundles/antigravity-plugin/skills/particle-art/references/stipple-morph.template.tsx +167 -0
  79. package/bundles/antigravity-plugin/skills/particle-art/references/stipple.template.tsx +175 -0
  80. package/bundles/antigravity-plugin/skills/particle-art/references/trail-ghost.template.tsx +266 -0
  81. package/bundles/antigravity-plugin/skills/particle-art/references/usage-examples.md +320 -0
  82. package/bundles/antigravity-plugin/skills/playwright/API_REFERENCE.md +653 -0
  83. package/bundles/antigravity-plugin/skills/playwright/SKILL.md +454 -0
  84. package/bundles/antigravity-plugin/skills/playwright/lib/helpers.js +441 -0
  85. package/bundles/antigravity-plugin/skills/playwright/package.json +26 -0
  86. package/bundles/antigravity-plugin/skills/playwright/run.js +228 -0
  87. package/bundles/antigravity-plugin/skills/prd/SKILL.md +107 -0
  88. package/bundles/antigravity-plugin/skills/preflight/SKILL.md +435 -0
  89. package/bundles/antigravity-plugin/skills/python/SKILL.md +388 -0
  90. package/bundles/antigravity-plugin/skills/react-best-practices/SKILL.md +269 -0
  91. package/bundles/antigravity-plugin/skills/react-dev/README.md +404 -0
  92. package/bundles/antigravity-plugin/skills/react-dev/SKILL.md +459 -0
  93. package/bundles/antigravity-plugin/skills/react-dev/examples/generic-components.md +579 -0
  94. package/bundles/antigravity-plugin/skills/react-dev/examples/server-components.md +579 -0
  95. package/bundles/antigravity-plugin/skills/react-dev/references/event-handlers.md +574 -0
  96. package/bundles/antigravity-plugin/skills/react-dev/references/hooks.md +456 -0
  97. package/bundles/antigravity-plugin/skills/react-dev/references/react-19-patterns.md +638 -0
  98. package/bundles/antigravity-plugin/skills/react-dev/references/react-router.md +1002 -0
  99. package/bundles/antigravity-plugin/skills/react-dev/references/tanstack-router.md +587 -0
  100. package/bundles/antigravity-plugin/skills/refactoring/SKILL.md +486 -0
  101. package/bundles/antigravity-plugin/skills/resume/SKILL.md +36 -0
  102. package/bundles/antigravity-plugin/skills/security-review/SKILL.md +196 -0
  103. package/bundles/antigravity-plugin/skills/setup-project-ai/SKILL.md +61 -0
  104. package/bundles/antigravity-plugin/skills/ship/SKILL.md +107 -0
  105. package/bundles/antigravity-plugin/skills/ship-merge/SKILL.md +103 -0
  106. package/bundles/antigravity-plugin/skills/ship-pr/SKILL.md +102 -0
  107. package/bundles/antigravity-plugin/skills/skill-creator/LICENSE.txt +202 -0
  108. package/bundles/antigravity-plugin/skills/skill-creator/SKILL.md +491 -0
  109. package/bundles/antigravity-plugin/skills/skill-creator/agents/analyzer.md +274 -0
  110. package/bundles/antigravity-plugin/skills/skill-creator/agents/comparator.md +202 -0
  111. package/bundles/antigravity-plugin/skills/skill-creator/agents/grader.md +223 -0
  112. package/bundles/antigravity-plugin/skills/skill-creator/assets/eval_review.html +146 -0
  113. package/bundles/antigravity-plugin/skills/skill-creator/eval-viewer/generate_review.py +471 -0
  114. package/bundles/antigravity-plugin/skills/skill-creator/eval-viewer/viewer.html +1325 -0
  115. package/bundles/antigravity-plugin/skills/skill-creator/references/schemas.md +430 -0
  116. package/bundles/antigravity-plugin/skills/skill-creator/scripts/__init__.py +0 -0
  117. package/bundles/antigravity-plugin/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
  118. package/bundles/antigravity-plugin/skills/skill-creator/scripts/generate_report.py +326 -0
  119. package/bundles/antigravity-plugin/skills/skill-creator/scripts/improve_description.py +247 -0
  120. package/bundles/antigravity-plugin/skills/skill-creator/scripts/package_skill.py +136 -0
  121. package/bundles/antigravity-plugin/skills/skill-creator/scripts/quick_validate.py +103 -0
  122. package/bundles/antigravity-plugin/skills/skill-creator/scripts/run_eval.py +310 -0
  123. package/bundles/antigravity-plugin/skills/skill-creator/scripts/run_loop.py +328 -0
  124. package/bundles/antigravity-plugin/skills/skill-creator/scripts/utils.py +47 -0
  125. package/bundles/antigravity-plugin/skills/sql/SKILL.md +321 -0
  126. package/bundles/antigravity-plugin/skills/tdd/SKILL.md +37 -0
  127. package/bundles/antigravity-plugin/skills/tdd-workflow/SKILL.md +188 -0
  128. package/bundles/antigravity-plugin/skills/technical-writing/SKILL.md +286 -0
  129. package/bundles/antigravity-plugin/skills/test-strategy/SKILL.md +155 -0
  130. package/bundles/antigravity-plugin/skills/ui-brief/SKILL.md +84 -0
  131. package/bundles/antigravity-plugin/skills/ui-review/SKILL.md +176 -0
  132. package/bundles/antigravity-plugin/skills/ui-review/references/framework-fixes.md +471 -0
  133. package/bundles/antigravity-plugin/skills/ui-review/references/visual-checklist.md +236 -0
  134. package/bundles/antigravity-plugin/skills/usage-review/SKILL.md +77 -0
  135. package/bundles/antigravity-plugin/skills/use-model/SKILL.md +64 -0
  136. package/bundles/antigravity-plugin/skills/using-git-worktrees/SKILL.md +217 -0
  137. package/bundles/antigravity-plugin/skills/version/SKILL.md +18 -0
  138. package/bundles/antigravity-plugin/skills/warm-editorial-ui/DESIGN_TOKENS.md +487 -0
  139. package/bundles/antigravity-plugin/skills/warm-editorial-ui/IMPLEMENTATION_GUIDE.md +177 -0
  140. package/bundles/antigravity-plugin/skills/warm-editorial-ui/SKILL.md +732 -0
  141. package/bundles/antigravity-plugin/skills/webapp-testing/LICENSE.txt +202 -0
  142. package/bundles/antigravity-plugin/skills/webapp-testing/SKILL.md +97 -0
  143. package/bundles/antigravity-plugin/skills/webapp-testing/examples/console_logging.py +35 -0
  144. package/bundles/antigravity-plugin/skills/webapp-testing/examples/element_discovery.py +40 -0
  145. package/bundles/antigravity-plugin/skills/webapp-testing/examples/static_html_automation.py +33 -0
  146. package/bundles/antigravity-plugin/skills/webapp-testing/scripts/with_server.py +106 -0
  147. package/bundles/antigravity-plugin/skills/windows-deployment/SKILL.md +880 -0
  148. package/bundles/antigravity-plugin/skills/writing-plans/SKILL.md +384 -0
  149. package/bundles/antigravity-plugin/statusline-command-agy.sh +91 -0
  150. package/bundles/antigravity-plugin/warm_start_agy.py +149 -0
  151. package/bundles/manifest.json +6 -0
  152. package/dist/cli.js +5363 -0
  153. package/package.json +61 -4
@@ -0,0 +1,305 @@
1
+ ---
2
+ name: css-architecture
3
+ description: CSS architecture, design token strategy, Tailwind conventions, CSS Modules, container queries, dark mode, responsive patterns, and animation architecture. Use for design token naming, CSS custom properties, Tailwind config, container queries, dark mode implementation, fluid typography, or CSS animation decisions. Complements frontend-design (what to achieve) with how to implement it.
4
+ ---
5
+
6
+ # CSS Architecture Skill
7
+
8
+ How to implement what `frontend-design` specifies. Covers design token strategy, Tailwind conventions, responsive patterns, dark mode, and animation architecture.
9
+
10
+ ## 1. Design Token Strategy — CSS Custom Properties
11
+
12
+ ### Hierarchy (global → component)
13
+ ```css
14
+ /* Layer 1: Primitive tokens (raw values) */
15
+ :root {
16
+ --color-slate-900: #0f172a;
17
+ --color-slate-100: #f1f5f9;
18
+ --color-amber-500: #f59e0b;
19
+ --space-4: 1rem;
20
+ --space-8: 2rem;
21
+ --radius-md: 0.5rem;
22
+ --font-sans: 'Inter Variable', system-ui, sans-serif;
23
+
24
+ /* Layer 2: Semantic tokens (intent) */
25
+ --color-bg: var(--color-slate-900);
26
+ --color-surface: hsl(220 15% 12%);
27
+ --color-text: var(--color-slate-100);
28
+ --color-accent: var(--color-amber-500);
29
+ --color-border: hsl(220 15% 20%);
30
+
31
+ /* Layer 3: Component tokens */
32
+ --button-bg: var(--color-accent);
33
+ --button-text: var(--color-slate-900);
34
+ --card-padding: var(--space-8);
35
+ }
36
+ ```
37
+
38
+ ### Naming Conventions
39
+ - Primitive: `--color-{hue}-{shade}`, `--space-{n}`, `--radius-{size}`
40
+ - Semantic: `--color-{role}` (bg, surface, text, accent, border, error, success)
41
+ - Component: `--{component}-{property}` (button-bg, card-radius)
42
+ - Never skip semantic layer — primitives must not be used directly in components.
43
+
44
+ ## 2. Tailwind Conventions
45
+
46
+ ### v3 Config (`tailwind.config.ts`)
47
+ ```ts
48
+ import type { Config } from 'tailwindcss'
49
+ import { fontFamily } from 'tailwindcss/defaultTheme'
50
+
51
+ const config: Config = {
52
+ content: ['./src/**/*.{ts,tsx,mdx}'],
53
+ darkMode: 'class', // or 'media'
54
+ theme: {
55
+ extend: {
56
+ colors: {
57
+ // Map to CSS custom properties so tokens work everywhere
58
+ bg: 'hsl(var(--color-bg) / <alpha-value>)',
59
+ surface: 'hsl(var(--color-surface) / <alpha-value>)',
60
+ accent: 'hsl(var(--color-accent) / <alpha-value>)',
61
+ border: 'hsl(var(--color-border) / <alpha-value>)',
62
+ },
63
+ fontFamily: {
64
+ sans: ['var(--font-sans)', ...fontFamily.sans],
65
+ display: ['var(--font-display)', ...fontFamily.serif],
66
+ },
67
+ borderRadius: { DEFAULT: 'var(--radius-md)' },
68
+ animation: {
69
+ 'fade-up': 'fadeUp 0.4s ease-out',
70
+ 'fade-in': 'fadeIn 0.3s ease-out',
71
+ },
72
+ keyframes: {
73
+ fadeUp: { from: { opacity: '0', transform: 'translateY(12px)' }, to: { opacity: '1', transform: 'none' } },
74
+ fadeIn: { from: { opacity: '0' }, to: { opacity: '1' } },
75
+ },
76
+ },
77
+ },
78
+ plugins: [
79
+ require('@tailwindcss/typography'),
80
+ require('@tailwindcss/container-queries'),
81
+ ],
82
+ }
83
+ export default config
84
+ ```
85
+
86
+ ### v4 Config (CSS-first)
87
+ ```css
88
+ /* globals.css — Tailwind v4 uses @theme, no tailwind.config.ts */
89
+ @import "tailwindcss";
90
+
91
+ @theme {
92
+ --color-accent: oklch(75% 0.18 85);
93
+ --font-sans: 'Inter Variable', system-ui, sans-serif;
94
+ --radius-default: 0.5rem;
95
+ }
96
+ ```
97
+
98
+ ### `@apply` Rules
99
+ - Use `@apply` sparingly — only for repeated utility combos in shared components (`btn`, `card`).
100
+ - Prefer component classes over `@apply` in large components — Tailwind utility classes in JSX are more readable.
101
+ - Never `@apply` responsive or state variants (`hover:`, `md:`) — those are JSX-only.
102
+
103
+ ## 3. CSS Modules vs Tailwind — Decision Criteria
104
+
105
+ | Use Tailwind | Use CSS Modules |
106
+ |---|---|
107
+ | UI components, layouts, spacing | Complex animations with `@keyframes` that need JS access |
108
+ | Responsive design | Component styles that conflict with Tailwind's reset |
109
+ | Dark mode | Styles requiring CSS `calc()` with token math |
110
+ | One-off utility combos | Legacy codebases with existing `.module.css` patterns |
111
+ | New projects | Server-rendered styles that must avoid className hydration |
112
+
113
+ **Hybrid**: Tailwind for layout/spacing/color, CSS Modules for complex animation or context-dependent logic.
114
+
115
+ ## 4. Container Queries
116
+
117
+ Responsive based on parent container width, not viewport.
118
+
119
+ ```tsx
120
+ // tailwind.config.ts: add @tailwindcss/container-queries plugin
121
+ // Install: pnpm add -D @tailwindcss/container-queries
122
+
123
+ export function Card({ children }: { children: React.ReactNode }) {
124
+ return (
125
+ // Mark the container
126
+ <div className="@container rounded-lg bg-surface p-6">
127
+ <div className="grid @sm:grid-cols-2 @lg:grid-cols-3 gap-4">
128
+ {children}
129
+ </div>
130
+ </div>
131
+ )
132
+ }
133
+ ```
134
+
135
+ ```css
136
+ /* Pure CSS container queries */
137
+ .card { container-type: inline-size; }
138
+
139
+ @container (min-width: 400px) {
140
+ .card-body { display: grid; grid-template-columns: 1fr 1fr; }
141
+ }
142
+ ```
143
+
144
+ **Use container queries when**: a component is used in multiple layout contexts (sidebar vs main vs modal) and needs different layouts in each.
145
+
146
+ ## 5. Dark Mode
147
+
148
+ ### Class Toggle (recommended for app control)
149
+ ```tsx
150
+ // Toggle on <html> element
151
+ document.documentElement.classList.toggle('dark')
152
+
153
+ // Tailwind: darkMode: 'class' in config
154
+ // CSS: dark: prefix on utilities
155
+ <div className="bg-white dark:bg-slate-900 text-slate-900 dark:text-slate-100">
156
+ ```
157
+
158
+ ### CSS Custom Property Token Switching
159
+ ```css
160
+ :root {
161
+ --color-bg: hsl(0 0% 100%);
162
+ --color-text: hsl(220 15% 10%);
163
+ --color-accent: hsl(220 90% 55%);
164
+ }
165
+
166
+ .dark {
167
+ --color-bg: hsl(220 15% 8%);
168
+ --color-text: hsl(220 10% 90%);
169
+ --color-accent: hsl(220 90% 65%);
170
+ }
171
+
172
+ /* With prefers-color-scheme fallback */
173
+ @media (prefers-color-scheme: dark) {
174
+ :root:not(.light) {
175
+ --color-bg: hsl(220 15% 8%);
176
+ --color-text: hsl(220 10% 90%);
177
+ }
178
+ }
179
+ ```
180
+
181
+ ## 6. Responsive Patterns — Mobile-First
182
+
183
+ ```tsx
184
+ // Mobile-first: base = mobile, md: = tablet, lg+ = desktop
185
+ <div className="
186
+ flex flex-col gap-4 /* mobile */
187
+ md:flex-row md:gap-6 /* tablet */
188
+ lg:gap-8 /* desktop */
189
+ ">
190
+ ```
191
+
192
+ ### Fluid Typography with `clamp()`
193
+ ```css
194
+ /* Min, preferred (viewport-relative), max */
195
+ .hero-heading {
196
+ font-size: clamp(2rem, 5vw + 1rem, 5rem);
197
+ line-height: clamp(1.1, 1.2, 1.3);
198
+ }
199
+
200
+ /* In Tailwind (custom utility) */
201
+ /* tailwind.config.ts > theme.extend.fontSize */
202
+ 'fluid-xl': 'clamp(1.5rem, 3vw + 0.5rem, 2.5rem)',
203
+ ```
204
+
205
+ ### Breakpoint Tokens
206
+ ```ts
207
+ // Consistent with Tailwind defaults
208
+ const breakpoints = { sm: '640px', md: '768px', lg: '1024px', xl: '1280px', '2xl': '1536px' }
209
+ ```
210
+
211
+ ## 7. Animation Architecture
212
+
213
+ ### Decision Matrix
214
+ | Use Case | Solution |
215
+ |---|---|
216
+ | Simple enter/exit | CSS `@keyframes` + `transition` |
217
+ | Complex sequences / orchestrated | Framer Motion |
218
+ | Physics-based spring | Framer Motion `spring` |
219
+ | Hover/focus micro-interactions | CSS `transition` (no JS cost) |
220
+ | Scroll-driven | CSS `@scroll-timeline` or Framer `useInView` |
221
+ | Page transitions | Framer `AnimatePresence` |
222
+
223
+ ### CSS Transitions
224
+ ```css
225
+ /* ✅ GPU-accelerated properties only */
226
+ .card {
227
+ transition: transform 200ms ease-out, opacity 200ms ease-out,
228
+ box-shadow 200ms ease-out;
229
+ }
230
+ .card:hover {
231
+ transform: translateY(-2px);
232
+ box-shadow: 0 8px 32px hsl(0 0% 0% / 0.15);
233
+ }
234
+ ```
235
+
236
+ ### `@keyframes` Structure
237
+ ```css
238
+ @keyframes slideIn {
239
+ from { opacity: 0; transform: translateX(-16px); }
240
+ to { opacity: 1; transform: none; }
241
+ }
242
+
243
+ /* Apply with animation shorthand */
244
+ .panel { animation: slideIn 300ms ease-out both; }
245
+ ```
246
+
247
+ ### `prefers-reduced-motion` — Non-Negotiable
248
+ ```css
249
+ /* Global reset for reduced motion */
250
+ @media (prefers-reduced-motion: reduce) {
251
+ *, *::before, *::after {
252
+ animation-duration: 0.01ms !important;
253
+ animation-iteration-count: 1 !important;
254
+ transition-duration: 0.01ms !important;
255
+ }
256
+ }
257
+ ```
258
+
259
+ ## 8. Anti-Patterns
260
+
261
+ | Anti-Pattern | Problem | Fix |
262
+ |---|---|---|
263
+ | `!important` | Specificity wars, hard to override | Refactor selector or use CSS layers (`@layer`) |
264
+ | Specificity wars | `.sidebar .card .button {}` | BEM naming or CSS Modules scoping |
265
+ | Magic numbers z-index (`z-[9999]`) | Unpredictable stacking | Named z-index tokens in config |
266
+ | Inline style overrides | Bypasses design system | Add utility class or extend Tailwind theme |
267
+ | Animating layout properties | Reflow on every frame | Animate `transform` + `opacity` only |
268
+ | `@apply` for large blocks | Reduces readability benefit of Tailwind | Component extraction instead |
269
+ | Global selector bleed in CSS Modules | `.module.css` affects non-module elements | Scope all selectors with `:local()` or class names |
270
+
271
+ ## 9. Z-Index Layer System
272
+
273
+ ```ts
274
+ // tailwind.config.ts
275
+ extend: {
276
+ zIndex: {
277
+ base: '0',
278
+ above: '10',
279
+ dropdown: '100',
280
+ sticky: '200',
281
+ overlay: '300',
282
+ modal: '400',
283
+ toast: '500',
284
+ tooltip: '600',
285
+ }
286
+ }
287
+ ```
288
+
289
+ ```tsx
290
+ // Use named z-index in JSX
291
+ <div className="z-modal">…</div>
292
+ ```
293
+
294
+ ## 10. Checklist
295
+
296
+ - [ ] CSS custom properties defined at 3 layers (primitive → semantic → component)
297
+ - [ ] No primitive tokens used directly in component styles
298
+ - [ ] Tailwind version confirmed before writing config
299
+ - [ ] `@apply` used only for repeated utility combos, not state variants
300
+ - [ ] Container queries used for multi-context components
301
+ - [ ] Dark mode uses token switching (not duplicated utility classes)
302
+ - [ ] All animations respect `prefers-reduced-motion`
303
+ - [ ] Fluid typography with `clamp()` for hero/heading text
304
+ - [ ] Z-index uses named tokens, not inline integers
305
+ - [ ] No `!important` in component styles