medesign 0.0.0-stage → 1.2.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 (82) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +128 -2
  3. package/bin/medesign.js +200 -0
  4. package/integrations/claude-code/SKILL.md +20 -0
  5. package/integrations/cursor/medesign.mdc +26 -0
  6. package/medesign.config.js +46 -0
  7. package/package.json +62 -4
  8. package/presets/apple/design-tokens.css +115 -0
  9. package/presets/apple/guidelines.md +19 -0
  10. package/presets/apple/preset.json +53 -0
  11. package/presets/metha/design-tokens.css +127 -0
  12. package/presets/metha/guidelines.md +23 -0
  13. package/presets/metha/preset.json +53 -0
  14. package/presets/schema.json +102 -0
  15. package/presets/tesla/design-tokens.css +112 -0
  16. package/presets/tesla/guidelines.md +17 -0
  17. package/presets/tesla/preset.json +53 -0
  18. package/references/ai-tells.md +127 -0
  19. package/references/appendices.md +220 -0
  20. package/references/architecture.md +39 -0
  21. package/references/argon-design-archetypes.md +317 -0
  22. package/references/banner-sizes-and-styles.md +118 -0
  23. package/references/block-library.md +61 -0
  24. package/references/brand-design-tokens.md +42 -0
  25. package/references/catalog.json +108 -0
  26. package/references/cip-deliverable-guide.md +95 -0
  27. package/references/cip-design.md +121 -0
  28. package/references/cip-prompt-engineering.md +84 -0
  29. package/references/cip-style-guide.md +68 -0
  30. package/references/cli-architecture.md +146 -0
  31. package/references/components.md +240 -0
  32. package/references/dark-mode.md +23 -0
  33. package/references/design-core.md +42 -0
  34. package/references/design-md-protocol.md +75 -0
  35. package/references/design-routing.md +207 -0
  36. package/references/eng-imagery-content.md +71 -0
  37. package/references/eng-layout.md +28 -0
  38. package/references/eng-other.md +26 -0
  39. package/references/eng-states-theme.md +22 -0
  40. package/references/eng-type-color.md +44 -0
  41. package/references/icon-design.md +122 -0
  42. package/references/image-mockup-direction.md +53 -0
  43. package/references/image-to-code.md +46 -0
  44. package/references/impeccable-polish.md +85 -0
  45. package/references/intake.md +90 -0
  46. package/references/logo-color-psychology.md +101 -0
  47. package/references/logo-design.md +110 -0
  48. package/references/logo-prompt-engineering.md +158 -0
  49. package/references/logo-style-guide.md +109 -0
  50. package/references/mesurv-dna.md +104 -0
  51. package/references/micro-interactions-and-auto-animate.md +71 -0
  52. package/references/modern-craft-invariants.md +332 -0
  53. package/references/motion-tokens.md +99 -0
  54. package/references/preflight.md +110 -0
  55. package/references/proactive-motion.md +167 -0
  56. package/references/quality-gate.md +147 -0
  57. package/references/redesign-audit.md +38 -0
  58. package/references/redesign.md +52 -0
  59. package/references/slides-copywriting-formulas.md +84 -0
  60. package/references/slides-create.md +4 -0
  61. package/references/slides-html-template.md +295 -0
  62. package/references/slides-layout-patterns.md +137 -0
  63. package/references/slides-strategies.md +94 -0
  64. package/references/slides.md +42 -0
  65. package/references/social-photos-design.md +329 -0
  66. package/references/spatial-canvas-engine.md +160 -0
  67. package/references/stitch-system.md +184 -0
  68. package/references/style-extraction.md +17 -0
  69. package/references/styles/brutalist.md +88 -0
  70. package/references/styles/minimalist.md +81 -0
  71. package/references/styles/soft.md +94 -0
  72. package/references/threeui-spatial-engine.md +224 -0
  73. package/references/ui-styling-shadcn.md +336 -0
  74. package/references/ui-ux-vocabulary-vault.json +1223 -0
  75. package/references/ui-ux-vocabulary-vault.md +438 -0
  76. package/references/vocab-protocol.md +52 -0
  77. package/references/vocabulary.md +78 -0
  78. package/scripts/export-tokens.js +403 -0
  79. package/tests/browser-audit.js +442 -0
  80. package/tests/linter.js +412 -0
  81. package/tests/schemas/sarif-2.1.0.schema.json +2915 -0
  82. package/tests/visual-testbed.html +681 -0
@@ -0,0 +1,336 @@
1
+ ---
2
+ name: ui-styling
3
+ description: "ออกแบบตกแต่งหน้าเว็บและเขียนโค้ด UI ด้วย Tailwind CSS และ shadcn/ui — ใช้เมื่อต้องการสร้างปุ่ม ฟอร์ม ตาราง โหมดมืด (Dark Mode) หรือจัดหน้าเว็บให้สวยงามทันสมัย (UI styling with shadcn/ui, Radix UI, Tailwind CSS utilities, dark mode theming, and accessible components)"
4
+ argument-hint: "[component or layout]"
5
+ license: MIT
6
+ metadata:
7
+ author: claudekit
8
+ version: "1.0.0"
9
+ ---
10
+
11
+ # UI Styling Skill
12
+
13
+ Comprehensive skill for creating beautiful, accessible user interfaces combining shadcn/ui components, Tailwind CSS utility styling, and canvas-based visual design systems.
14
+
15
+ ## Reference
16
+
17
+ - shadcn/ui: https://ui.shadcn.com/llms.txt
18
+ - Tailwind CSS: https://tailwindcss.com/docs
19
+
20
+ ## When to Use This Skill
21
+
22
+ Use when:
23
+ - Building UI with React-based frameworks (Next.js, Vite, Remix, Astro)
24
+ - Implementing accessible components (dialogs, forms, tables, navigation)
25
+ - Styling with utility-first CSS approach
26
+ - Creating responsive, mobile-first layouts
27
+ - Implementing dark mode and theme customization
28
+ - Building design systems with consistent tokens
29
+ - Generating visual designs, posters, or brand materials
30
+ - Rapid prototyping with immediate visual feedback
31
+ - Adding complex UI patterns (data tables, charts, command palettes)
32
+
33
+ ## Core Stack
34
+
35
+ ### Component Layer: shadcn/ui
36
+ - Pre-built accessible components via Radix UI primitives
37
+ - Copy-paste distribution model (components live in your codebase)
38
+ - TypeScript-first with full type safety
39
+ - Composable primitives for complex UIs
40
+ - CLI-based installation and management
41
+
42
+ ### Styling Layer: Tailwind CSS
43
+ - Utility-first CSS framework
44
+ - Build-time processing with zero runtime overhead
45
+ - Mobile-first responsive design
46
+ - Consistent design tokens (colors, spacing, typography)
47
+ - Automatic dead code elimination
48
+
49
+ ### Visual Design Layer: Canvas
50
+ - Museum-quality visual compositions
51
+ - Philosophy-driven design approach
52
+ - Sophisticated visual communication
53
+ - Minimal text, maximum visual impact
54
+ - Systematic patterns and refined aesthetics
55
+
56
+ ## Script Paths
57
+
58
+ Script paths in this skill and its `references/` are relative to the directory that contains this SKILL.md, not to the project: `scripts/<file>` is this skill's own `scripts/` folder, and `../<skill>/scripts/<file>` is a sibling sub-skill installed alongside it. Build the full path from that directory (Claude Code reports it as the skill's base directory when the skill loads) and keep the working directory at the project root — the scripts read and write project files such as `docs/brand-guidelines.md`, `assets/design-tokens.json` or `src/` relative to it.
59
+
60
+ ## Quick Start
61
+
62
+ ### Component + Styling Setup
63
+
64
+ **Install shadcn/ui with Tailwind:**
65
+ ```bash
66
+ npx shadcn@latest init
67
+ ```
68
+
69
+ CLI prompts for framework, TypeScript, paths, and theme preferences. This configures both shadcn/ui and Tailwind CSS.
70
+
71
+ **Add components:**
72
+ ```bash
73
+ npx shadcn@latest add button card dialog form
74
+ ```
75
+
76
+ **Use components with utility styling:**
77
+ ```tsx
78
+ import { Button } from "@/components/ui/button"
79
+ import { Card, CardHeader, CardTitle, CardContent } from "@/components/ui/card"
80
+
81
+ export function Dashboard() {
82
+ return (
83
+ <div className="container mx-auto p-6 grid gap-6 md:grid-cols-2 lg:grid-cols-3">
84
+ <Card className="hover:shadow-lg transition-shadow">
85
+ <CardHeader>
86
+ <CardTitle className="text-2xl font-bold">Analytics</CardTitle>
87
+ </CardHeader>
88
+ <CardContent className="space-y-4">
89
+ <p className="text-muted-foreground">View your metrics</p>
90
+ <Button variant="default" className="w-full">
91
+ View Details
92
+ </Button>
93
+ </CardContent>
94
+ </Card>
95
+ </div>
96
+ )
97
+ }
98
+ ```
99
+
100
+ ### Alternative: Tailwind-Only Setup
101
+
102
+ **Vite projects:**
103
+ ```bash
104
+ npm install -D tailwindcss @tailwindcss/vite
105
+ ```
106
+
107
+ ```javascript
108
+ // vite.config.ts
109
+ import tailwindcss from '@tailwindcss/vite'
110
+ export default { plugins: [tailwindcss()] }
111
+ ```
112
+
113
+ ```css
114
+ /* src/index.css */
115
+ @import "tailwindcss";
116
+ ```
117
+
118
+ ## Component Library Guide
119
+
120
+ **Comprehensive component catalog with usage patterns, installation, and composition examples.**
121
+
122
+ See: `references/shadcn-components.md`
123
+
124
+ Covers:
125
+ - Form & input components (Button, Input, Select, Checkbox, Date Picker, Form validation)
126
+ - Layout & navigation (Card, Tabs, Accordion, Navigation Menu)
127
+ - Overlays & dialogs (Dialog, Drawer, Popover, Toast, Command)
128
+ - Feedback & status (Alert, Progress, Skeleton)
129
+ - Display components (Table, Data Table, Avatar, Badge)
130
+
131
+ ## Theme & Customization
132
+
133
+ **Theme configuration, CSS variables, dark mode implementation, and component customization.**
134
+
135
+ See: `references/shadcn-theming.md`
136
+
137
+ Covers:
138
+ - Dark mode setup with next-themes
139
+ - CSS variable system
140
+ - Color customization and palettes
141
+ - Component variant customization
142
+ - Theme toggle implementation
143
+
144
+ ## Accessibility Patterns
145
+
146
+ **ARIA patterns, keyboard navigation, screen reader support, and accessible component usage.**
147
+
148
+ See: `references/shadcn-accessibility.md`
149
+
150
+ Covers:
151
+ - Radix UI accessibility features
152
+ - Keyboard navigation patterns
153
+ - Focus management
154
+ - Screen reader announcements
155
+ - Form validation accessibility
156
+
157
+ ## Tailwind Utilities
158
+
159
+ **Core utility classes for layout, spacing, typography, colors, borders, and shadows.**
160
+
161
+ See: `references/tailwind-utilities.md`
162
+
163
+ Covers:
164
+ - Layout utilities (Flexbox, Grid, positioning)
165
+ - Spacing system (padding, margin, gap)
166
+ - Typography (font sizes, weights, alignment, line height)
167
+ - Colors and backgrounds
168
+ - Borders and shadows
169
+ - Arbitrary values for custom styling
170
+
171
+ ## Responsive Design
172
+
173
+ **Mobile-first breakpoints, responsive utilities, and adaptive layouts.**
174
+
175
+ See: `references/tailwind-responsive.md`
176
+
177
+ Covers:
178
+ - Mobile-first approach
179
+ - Breakpoint system (sm, md, lg, xl, 2xl)
180
+ - Responsive utility patterns
181
+ - Container queries
182
+ - Max-width queries
183
+ - Custom breakpoints
184
+
185
+ ## Tailwind Customization
186
+
187
+ **Config file structure, custom utilities, plugins, and theme extensions.**
188
+
189
+ See: `references/tailwind-customization.md`
190
+
191
+ Covers:
192
+ - @theme directive for custom tokens
193
+ - Custom colors and fonts
194
+ - Spacing and breakpoint extensions
195
+ - Custom utility creation
196
+ - Custom variants
197
+ - Layer organization (@layer base, components, utilities)
198
+ - Apply directive for component extraction
199
+
200
+ ## Visual Design System
201
+
202
+ **Canvas-based design philosophy, visual communication principles, and sophisticated compositions.**
203
+
204
+ See: `references/canvas-design-system.md`
205
+
206
+ Covers:
207
+ - Design philosophy approach
208
+ - Visual communication over text
209
+ - Systematic patterns and composition
210
+ - Color, form, and spatial design
211
+ - Minimal text integration
212
+ - Museum-quality execution
213
+ - Multi-page design systems
214
+
215
+ ## Utility Scripts
216
+
217
+ **Python automation for component installation and configuration generation.**
218
+
219
+ ### shadcn_add.py
220
+ Add shadcn/ui components with dependency handling:
221
+ ```bash
222
+ python scripts/shadcn_add.py button card dialog
223
+ ```
224
+
225
+ ### tailwind_config_gen.py
226
+ Generate tailwind.config.js with custom theme:
227
+ ```bash
228
+ python scripts/tailwind_config_gen.py --colors brand:blue --fonts display:Inter
229
+ ```
230
+
231
+ The generator refuses to create or replace a config when any sibling
232
+ `tailwind.config.js`, `.cjs`, `.mjs`, or `.ts` file already exists. Review the
233
+ reported config first, then pass `--force` only when the competing output is
234
+ intentional:
235
+ ```bash
236
+ python scripts/tailwind_config_gen.py --colors brand:blue --force
237
+ ```
238
+
239
+ ## Best Practices
240
+
241
+ 1. **Component Composition**: Build complex UIs from simple, composable primitives
242
+ 2. **Utility-First Styling**: Use Tailwind classes directly; extract components only for true repetition
243
+ 3. **Mobile-First Responsive**: Start with mobile styles, layer responsive variants
244
+ 4. **Accessibility-First**: Leverage Radix UI primitives, add focus states, use semantic HTML
245
+ 5. **Design Tokens**: Use consistent spacing scale, color palettes, typography system
246
+ 6. **Dark Mode Consistency**: Apply dark variants to all themed elements
247
+ 7. **Performance**: Leverage automatic CSS purging, avoid dynamic class names
248
+ 8. **TypeScript**: Use full type safety for better DX
249
+ 9. **Visual Hierarchy**: Let composition guide attention, use spacing and color intentionally
250
+ 10. **Expert Craftsmanship**: Every detail matters - treat UI as a craft
251
+
252
+ ## Reference Navigation
253
+
254
+ **Component Library**
255
+ - `references/shadcn-components.md` - Complete component catalog
256
+ - `references/shadcn-theming.md` - Theming and customization
257
+ - `references/shadcn-accessibility.md` - Accessibility patterns
258
+
259
+ **Styling System**
260
+ - `references/tailwind-utilities.md` - Core utility classes
261
+ - `references/tailwind-responsive.md` - Responsive design
262
+ - `references/tailwind-customization.md` - Configuration and extensions
263
+
264
+ **Visual Design**
265
+ - `references/canvas-design-system.md` - Design philosophy and canvas workflows
266
+
267
+ **Automation**
268
+ - `scripts/shadcn_add.py` - Component installation
269
+ - `scripts/tailwind_config_gen.py` - Config generation
270
+
271
+ ## Common Patterns
272
+
273
+ **Form with validation:**
274
+ ```tsx
275
+ import { useForm } from "react-hook-form"
276
+ import { zodResolver } from "@hookform/resolvers/zod"
277
+ import * as z from "zod"
278
+ import { Form, FormField, FormItem, FormLabel, FormControl, FormMessage } from "@/components/ui/form"
279
+ import { Input } from "@/components/ui/input"
280
+ import { Button } from "@/components/ui/button"
281
+
282
+ const schema = z.object({
283
+ email: z.string().email(),
284
+ password: z.string().min(8)
285
+ })
286
+
287
+ export function LoginForm() {
288
+ const form = useForm({
289
+ resolver: zodResolver(schema),
290
+ defaultValues: { email: "", password: "" }
291
+ })
292
+
293
+ return (
294
+ <Form {...form}>
295
+ <form onSubmit={form.handleSubmit(console.log)} className="space-y-6">
296
+ <FormField control={form.control} name="email" render={({ field }) => (
297
+ <FormItem>
298
+ <FormLabel>Email</FormLabel>
299
+ <FormControl>
300
+ <Input type="email" {...field} />
301
+ </FormControl>
302
+ <FormMessage />
303
+ </FormItem>
304
+ )} />
305
+ <Button type="submit" className="w-full">Sign In</Button>
306
+ </form>
307
+ </Form>
308
+ )
309
+ }
310
+ ```
311
+
312
+ **Responsive layout with dark mode:**
313
+ ```tsx
314
+ <div className="min-h-screen bg-white dark:bg-gray-900">
315
+ <div className="container mx-auto px-4 py-8">
316
+ <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
317
+ <Card className="bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700">
318
+ <CardContent className="p-6">
319
+ <h3 className="text-xl font-semibold text-gray-900 dark:text-white">
320
+ Content
321
+ </h3>
322
+ </CardContent>
323
+ </Card>
324
+ </div>
325
+ </div>
326
+ </div>
327
+ ```
328
+
329
+ ## Resources
330
+
331
+ - shadcn/ui Docs: https://ui.shadcn.com
332
+ - Tailwind CSS Docs: https://tailwindcss.com
333
+ - Radix UI: https://radix-ui.com
334
+ - Tailwind UI: https://tailwindui.com
335
+ - Headless UI: https://headlessui.com
336
+ - v0 (AI UI Generator): https://v0.dev