medesign 0.0.0-stage → 1.4.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 +223 -3
  3. package/bin/medesign.js +691 -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 +69 -6
  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 +1023 -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,240 @@
1
+ ## 🎨 Interactive Modal Archetypes (เมื่อใช้ `/medesign` ปกติ)
2
+
3
+ เรียก `ask_question` ทันทีด้วยตัวเลือกต่อไปนี้ (หรือเปิด Comparison Lab บน Localhost):
4
+
5
+ - 📄 **My DNA — Warm Editorial & Glass** *(Calibrated Default)*
6
+ - Near-White `#f7f5f2` + Terracotta `#cc785c` + Fraunces Serif + Frosted Glass + Full Pill
7
+ - ⚡ **Electric Dark Upgraded**
8
+ - Deep Ink `#090909` + Indigo/Violet Accent + Frosted Glass Sidebar
9
+ - 🏛️ **Warm Dark Editorial**
10
+ - Dark Navy `#0d1520` + Terracotta `#cc785c` + Fraunces Serif + Editorial Contrast
11
+ - 💎 **Cyber Precision (Vercel × Linear)**
12
+ - Pure Ink `#0a0a0a` + Hairline `1px` Borders + Stark Monochrome + Geist Sans
13
+ - 🟢 **Spotify Pulse**
14
+ - Pitch Charcoal `#121212` + Neon Green `#1ed760` + Solid Surface + Pill CTA
15
+ - 🏎️ **BMW Precision Luxury**
16
+ - Pure Black `#050505` + Metallic Inset Glass + Precision Blue `#0066b1` + Razor Type
17
+ - 📓 **Notion Warm Modern**
18
+ - Clean White `#ffffff` + Solid Warm Gray Sidebar `#f9f9f8` + Zero Blur + Crisp Borders
19
+ - 🧠 **Claude Intelligent**
20
+ - Warm Paper `#fbfaf8` + Soft Terracotta `#a15e41` + Literary Serif + Human Approachability
21
+ - ✦ **Best Designs on X (Linear Dark Craft)** *(New 2026 Trend)*
22
+ - Deep Void `#09090b` + 1px Border Glow (`rgba(255,255,255,0.08)`) + Instrument Serif Italic + Geist Sans/Mono + Indigo `#6366f1` / Violet `#8b5cf6`
23
+
24
+ ---
25
+
26
+ ## 📦 Component Blueprint Library
27
+
28
+ ### Hero Section
29
+ ```css
30
+ /* Headline: Serif Display Italic */
31
+ font-family: 'Fraunces', 'Playfair Display', serif;
32
+ font-size: clamp(2.5rem, 6vw, 5rem);
33
+ font-weight: 600;
34
+ letter-spacing: -0.025em;
35
+ font-style: italic; /* on display words */
36
+
37
+ /* Eyebrow tag above headline */
38
+ font-family: 'Geist Mono', monospace;
39
+ font-size: 0.75rem;
40
+ letter-spacing: 0.1em;
41
+ text-transform: uppercase;
42
+
43
+ /* CTA Primary */
44
+ border-radius: 9999px;
45
+ background: #cc785c;
46
+ color: #fff;
47
+ height: 2.75rem; /* h-11 */
48
+ padding: 0 2rem;
49
+ transition: opacity 150ms ease;
50
+ ```
51
+
52
+ ### Bento Grid
53
+ ```css
54
+ display: grid;
55
+ grid-template-columns: repeat(3, 1fr);
56
+ grid-template-rows: auto;
57
+ gap: 1rem;
58
+ /* Feature card spans 2 cols */
59
+ .feature-card { grid-column: span 2; }
60
+
61
+ /* Card Base: Frosted Glass */
62
+ background: rgba(255, 255, 255, 0.6);
63
+ backdrop-filter: blur(16px);
64
+ border: 1px solid rgba(204, 120, 92, 0.15);
65
+ border-radius: 16px;
66
+ /* Hover: border warm glow */
67
+ transition: border-color 150ms ease;
68
+ &:hover { border-color: rgba(204, 120, 92, 0.4); }
69
+ ```
70
+
71
+ ### Navigation (Sticky Glassmorphic)
72
+ ```css
73
+ position: sticky; top: 0; z-index: 50;
74
+ backdrop-filter: blur(24px) saturate(160%);
75
+ background: rgba(250, 250, 250, 0.75);
76
+ border-bottom: 1px solid rgba(0, 0, 0, 0.05);
77
+ ```
78
+
79
+ ### Data Metric Card
80
+ ```css
81
+ /* Value */
82
+ font-family: 'Geist Mono', monospace;
83
+ font-size: 2.25rem;
84
+ font-weight: 600;
85
+ /* Label */
86
+ font-family: 'Plus Jakarta Sans', sans-serif;
87
+ font-size: 0.7rem;
88
+ letter-spacing: 0.08em;
89
+ text-transform: uppercase;
90
+ color: #9ca3af;
91
+ /* Status Pill */
92
+ border-radius: 9999px;
93
+ border: 1px solid currentColor;
94
+ font-size: 0.688rem;
95
+ font-family: 'Geist Mono';
96
+ ```
97
+
98
+ ### Command Palette (`⌘K` Modal)
99
+ ```css
100
+ /* Container */
101
+ background: rgba(18, 18, 23, 0.9);
102
+ backdrop-filter: blur(20px);
103
+ border: 1px solid rgba(255, 255, 255, 0.1);
104
+ border-radius: 14px;
105
+ box-shadow: 0 24px 64px -12px rgba(0, 0, 0, 0.7);
106
+
107
+ /* Search Input */
108
+ font-family: 'Geist', sans-serif;
109
+ color: #f4f4f5;
110
+ border-bottom: 1px solid rgba(255, 255, 255, 0.08);
111
+
112
+ /* Active Row */
113
+ background: rgba(99, 102, 241, 0.12);
114
+ border: 1px solid rgba(99, 102, 241, 0.25);
115
+ border-radius: 8px;
116
+ color: #ffffff;
117
+ ```
118
+
119
+ ### Apple Bento Box 2.0 (High-Density with Mini-Metrics)
120
+ ```css
121
+ display: grid;
122
+ grid-template-columns: repeat(3, minmax(0, 1fr));
123
+ gap: 1rem;
124
+
125
+ /* Bento Tile Base */
126
+ background: #111115;
127
+ border: 1px solid rgba(255, 255, 255, 0.08);
128
+ border-radius: 16px;
129
+ padding: 1.25rem;
130
+ position: relative;
131
+ overflow: hidden;
132
+
133
+ /* Border Glow Mask */
134
+ &::before {
135
+ content: '';
136
+ position: absolute;
137
+ inset: -1px;
138
+ border-radius: inherit;
139
+ padding: 1px;
140
+ background: linear-gradient(135deg, rgba(255,255,255,0.15), rgba(255,255,255,0.02) 40%, rgba(99,102,241,0.2));
141
+ -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
142
+ mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
143
+ -webkit-mask-composite: xor;
144
+ mask-composite: exclude;
145
+ pointer-events: none;
146
+ }
147
+ ```
148
+
149
+ ### Specular Top Rim Light (Crafted Button / Card Highlight)
150
+ ```css
151
+ /* ใส่บนปุ่มหรือการ์ดเพื่อสร้างมิติสะท้อนแสงขอบบน */
152
+ position: relative;
153
+ &::after {
154
+ content: '';
155
+ position: absolute;
156
+ top: 1px;
157
+ left: 8px;
158
+ right: 8px;
159
+ height: 1px;
160
+ background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
161
+ border-radius: 9999px;
162
+ pointer-events: none;
163
+ }
164
+ ```
165
+
166
+ ---
167
+
168
+ ## 🧠 5 UI Ergonomics Blueprints (Cognitive Load Reduction)
169
+
170
+ เกณฑ์การจัดวางและออกแบบส่วนติดต่อผู้ใช้เพื่อลดภาระทางสมอง (Cognitive Friction) ของผู้ใช้:
171
+
172
+ ### 1. Primary Action Dominance (ปุ่มหลักเด่นเพียง 1 เดียว)
173
+ ใน 1 มุมมองหรือ 1 การ์ด ต้องมี Primary CTA เพียง 1 ปุ่มเท่านั้นเพื่อชี้ทิศทางชัดเจน (Hick's Law):
174
+ ```tsx
175
+ {/* Primary Action vs Secondary Outline */}
176
+ <div className="flex items-center gap-3">
177
+ <button className="h-10 px-5 rounded-full bg-primary text-primary-foreground font-medium shadow-sm hover:opacity-90 active:scale-[0.98] transition">
178
+ Confirm Coordinates
179
+ </button>
180
+ <button className="h-10 px-4 rounded-full border border-border bg-transparent text-foreground/80 hover:bg-muted/50 transition">
181
+ Cancel
182
+ </button>
183
+ </div>
184
+ ```
185
+
186
+ ### 2. Whitespace & Gestalt Grouping (ระยะหายใจและการจัดกลุ่ม)
187
+ ใช้ Negative Space และระยะห่างที่ได้สัดส่วนในการแยกกลุ่มข้อมูล:
188
+ - **Container Padding:** ขั้นต่ำ `p-4` (16px) ถึง `p-6` (24px) รอบการ์ด
189
+ - **Intra-group Gap:** ข้อมูลหรืออินพุตที่เกี่ยวข้องกันใช้ `space-y-2` หรือ `gap-2` (8px)
190
+ - **Inter-group Spacing:** การแบ่งกลุ่มข้อมูลต่างประเภทใช้ `space-y-6` หรือ `gap-6` (24px) พร้อมเส้นแบ่งบาง 1px (`border-t border-border/40`)
191
+
192
+ ### 3. Progressive Disclosure Overflow (ปุ่มเยอะซ่อนในเมนูเพิ่มเติม)
193
+ จำกัด Action ปุ่มลอยบนหน้าจอไม่เกิน 2–3 ปุ่ม ส่วนที่เหลือ (ปุ่มที่ใช้น้อย หรือ Destructive Action) ให้รวมไว้ใน Overflow Menu (`...`):
194
+ ```tsx
195
+ <div className="flex items-center gap-2">
196
+ <Button variant="default">Save Traverse</Button>
197
+ <Button variant="outline">Preview Map</Button>
198
+
199
+ {/* Overflow for rare / secondary actions */}
200
+ <DropdownMenu>
201
+ <DropdownMenuTrigger asChild>
202
+ <Button variant="ghost" size="icon"><MoreHorizontal className="w-4 h-4" /></Button>
203
+ </DropdownMenuTrigger>
204
+ <DropdownMenuContent align="end">
205
+ <DropdownMenuItem>Export GeoJSON</DropdownMenuItem>
206
+ <DropdownMenuItem>Duplicate Layer</DropdownMenuItem>
207
+ <DropdownMenuSeparator />
208
+ <DropdownMenuItem className="text-destructive">Delete Survey</DropdownMenuItem>
209
+ </DropdownMenuContent>
210
+ </DropdownMenu>
211
+ </div>
212
+ ```
213
+
214
+ ### 4. Typographic Scanability Hierarchy (ลำดับสายตาตัวอักษร)
215
+ ห้ามใช้ข้อความขนาดยาวเป็นก้อนสม่ำเสมอ (Wall of Text) บังคับใช้ Type Scale นำสายตาตาม F-Shape:
216
+ ```tsx
217
+ <div className="space-y-1.5">
218
+ <span className="text-xs font-mono uppercase tracking-wider text-muted-foreground">Station Alpha</span>
219
+ <h2 className="text-xl font-bold tracking-tight text-foreground">Traverse Computation Matrix</h2>
220
+ <p className="text-sm text-foreground/80 leading-relaxed max-w-prose">
221
+ Calculated relative closure error is within the secondary urban boundary survey threshold (1:10,000).
222
+ </p>
223
+ </div>
224
+ ```
225
+
226
+ ### 5. Form Chunking & Multi-Step Stepper (ฟอร์มยาวแบ่งเป็นก้อน)
227
+ เมื่อฟอร์มมี Input ตั้งแต่ $\ge 6$ รายการขึ้นไป ให้จัดกลุ่มเป็นการ์ดย่อย (Semantic Fieldsets) หรือแบ่งเป็น Multi-step Stepper:
228
+ ```tsx
229
+ {/* Multi-step progress header */}
230
+ <div className="mb-6 space-y-2">
231
+ <div className="flex justify-between text-xs font-medium text-muted-foreground">
232
+ <span>Step 1: Instrument Setup</span>
233
+ <span>Step 1 of 3</span>
234
+ </div>
235
+ <div className="h-1.5 w-full bg-muted rounded-full overflow-hidden">
236
+ <div className="h-full bg-primary rounded-full w-1/3 transition-all duration-300" />
237
+ </div>
238
+ </div>
239
+ ```
240
+
@@ -0,0 +1,23 @@
1
+ ## 8. DARK MODE PROTOCOL
2
+
3
+ Dual-mode by default. Never assume light-only unless the brief is print-emulating editorial.
4
+
5
+ ### 8.A Token Strategy (pick one, stick to it)
6
+ * **Tailwind `dark:` variant** (default for utility-first projects): every color utility paired with its dark variant (`bg-white dark:bg-zinc-950`, `text-gray-900 dark:text-gray-100`).
7
+ * **CSS variables** (for shadcn/ui, Radix Themes, or component libraries with theming): define semantic tokens (`--surface`, `--surface-elevated`, `--text-primary`, `--accent`) and swap values under `[data-theme="dark"]` or `@media (prefers-color-scheme: dark)`.
8
+
9
+ ### 8.B Do Not Prescribe Specific Colors Here
10
+ The brief and brand decide. This skill enforces only:
11
+ * **Contrast** - WCAG AA minimum for body text, AAA target for hero copy.
12
+ * **Hierarchy parity** - visual hierarchy that works in light must work in dark. If a CTA pops in light, it pops in dark.
13
+ * **Brand fidelity** - primary brand color stays recognisable. Don't desaturate the brand into a dark mode.
14
+ * **No pure `#000000` and no pure `#ffffff`** - use off-black (zinc-950, near-black warm gray) and off-white. Pure values kill depth.
15
+
16
+ ### 8.C Default Mode
17
+ Respect `prefers-color-scheme` unless the brand insists. Add a manual toggle if either mode would lose key brand expression.
18
+
19
+ ### 8.D Test in Both Modes Before Finishing
20
+ Open the page in both modes during development. Do not ship a page you've only seen in one mode.
21
+
22
+ ---
23
+
@@ -0,0 +1,42 @@
1
+ ## 🚫 Non-Bland & Anti-AI-Slop Protocol (ห้ามจืดชืดและห้ามดูเหมือนงาน AI สุกเอาเผากิน)
2
+
3
+ 1. **Zero AI-Slop Negative Prompts (ข้อห้ามเด็ดขาด):**
4
+ - **No Gaudy Gradients:** ห้ามใช้ multi-stop rainbow/neon gradient ทับปุ่มหรือการ์ดมั่วซั่ว (อนุญาตเฉพาะ subtle atmospheric radial glow ≤ 10% opacity)
5
+ - **No Emoji Spam in Headings:** ห้ามใส่ Emoji เรียงหน้าหัวข้อหลัก (`🚀 Features`, `✨ Overview`) ยกเว้นผู้ใช้ระบุหรือเป็น Icon Badge เฉพาะจุด
6
+ - **No Heavy Drop Shadows:** ห้ามใช้ `shadow-md/lg/xl` ดำทึบเดี่ยวๆ → ต้องเป็น Frosted Glass (`backdrop-blur`) หรือ Stacked Inset Hairline Ring (`1px solid`) เสมอ
7
+ - **No Colored Border Clutter:** ห้ามตีกรอบสีสด (`border-blue-500`, `border-purple-500`) รอบการ์ดทุกใบ ใช้ hairline border โปร่งแสง (`rgba(..., 0.08–0.15)`) เท่านั้น
8
+ - **No Unnecessary Hover Bounces:** ห้ามทำการ์ดเด้งลอยสูง (`-translate-y-2`, `scale-105`) หรือ Parallax กวนสายตา → จำกัด motion ไม่เกิน `150ms–200ms` (`active:scale-[0.97]` เฉพาะปุ่มกด)
9
+ - **Zero Cliche AI Palette:** ห้ามใช้โทนม่วง-ฟ้า AI มาตรฐาน (`bg-indigo-600` + `bg-purple-600`) หรือขาว-ส้มการตลาดทื่อๆ ที่ไม่ได้มาจาก Brand Token หรือ User DNA
10
+ 2. **Typography Discipline:**
11
+ - หัวข้อทุกตัวต้องบีบ `letter-spacing: -0.025em` ถึง `-0.035em`
12
+ - ตัวเลข พิกัด สถิติ เวลา และรหัสสถานะ ต้องใช้ `font-mono tabular-nums` (`Geist Mono` / `JetBrains Mono`) เสมอ
13
+ 3. **Min-UI Principle (สำหรับ Tool / Engineering / SaaS Workspace เช่น MESURV, Mesnooker):**
14
+ - **Controls Near Content:** วางปุ่มควบคุมและตัวกรองไว้ติดกับข้อมูลที่ถูกกระทำ ไม่แยกห่างเกินจำเป็น
15
+ - **Verbs Over Nouns:** ปุ่ม Action ใช้คำกริยาที่ชัดเจน (`Calculate Traverse`, `Export GeoJSON`, `Start Frame`) แทนคำนามลอยๆ
16
+ - **Zero Marketing Fluff:** ในหน้าทำงานจริง (Workspace/Calculator/Map) ตัดคำโฆษณาเวิ่นเว้อออก เน้นความคมชัดของข้อมูล (High Signal-to-Noise)
17
+
18
+ ---
19
+
20
+ ## 📐 Calibrated Surface × Spatial Architecture Matrix (Round 2 & 3)
21
+
22
+ - **Token Source of Truth:** `user-profile.json` หรือ `tokens/` (`design-tokens.json`, `design-tokens.css`, `tailwind.tokens.config.js`)
23
+ - **Axis 1 — 3 Master Surface Themes (Synthesized from 7 Blind Winners `#B, #G, #L, #C, #K, #D, #F`):**
24
+ 1. `fieldbook` (**The Fieldbook** — Daylight Survey & Editorial: `#B + #G + #L`)
25
+ 2. `cosmos` (**Cosmos Glass** — Deep Space Acrylic & Velvet: `#C + #K`)
26
+ 3. `matrix` (**Data Matrix** — Pro Telemetry & Field Controller: `#D + #F`)
27
+ - **Axis 2 — 8 Spatial Layout Archetypes (`L-01` to `L-08` on `/style/101`–`/style/108`):**
28
+ - `L-01`: Asymmetric Editorial Bento + Top Command Pill (`0px` Sidebar, `8:4` + `7:5` Grid)
29
+ - `L-02`: Full-Bleed Canvas-First Spatial HUD (`100vw × 100vh` Map + Floating Pods)
30
+ - `L-03`: 3-Pane Engineering IDE Split Workbench (`18%` Tree : `56%` Stage+Console : `26%` Inspector)
31
+ - `L-04`: 40/60 Sticky Poster Split & Exposed Architectural Grid (`0px` Gap Hairline Cells)
32
+ - `L-05`: Pro Telemetry Ribbon + 50/50 Synchronized Dual Split (Top Ticker + Left/Right Sync)
33
+ - `L-06`: Focused 760px Executable Fieldbook Stream (Single-Column + Inline Compute Cells)
34
+ - `L-07`: Bottom-Dock OS & 4-Column Modular Swimlanes (4 Vertical Lanes + Bottom OS Dock)
35
+ - `L-08`: Spacious Full-Width Master Table + 440px Slide-Over Inspector Drawer
36
+
37
+ ---
38
+
39
+ <!-- USER_PROFILE_SIGNATURE -->
40
+ <!-- Last calibrated: 2026-09-29T15:19:00+07:00 -->
41
+ <!-- Status: CONFIRMED_V2 (3 Master Themes + 7 Blind Winners + 8 Spatial Layout Archetypes) -->
42
+
@@ -0,0 +1,75 @@
1
+ # DESIGN.md Protocol (Google Stitch Standard)
2
+
3
+ `DESIGN.md` คือไฟล์ข้อกำหนดดีไซน์ระดับโปรเจกต์ (Plain-Text Design System) วางไว้ที่ Root ของโปรเจกต์ควบคู่กับ `AGENTS.md`:
4
+ - `AGENTS.md` กำหนด **"How to Build"** (สถาปัตยกรรมโค้ด, Build steps, Testing harness)
5
+ - `DESIGN.md` กำหนด **"How it Looks & Feels"** (Tokens, Typography, Card Anatomy, Anti-AI styling)
6
+
7
+ ---
8
+
9
+ ## 1. วัตถุประสงค์ & ประโยชน์ต่อ AI Agent
10
+ 1. **Zero Hallucination:** ป้องกันไม่ให้ AI สุ่มสร้างสี, ขนาดฟอนต์ หรือ Padding ที่ไม่สอดคล้องกันข้ามไฟล์
11
+ 2. **Context-Optimized:** เขียนด้วย Markdown ล้วน กระชับ ประหยัด Token มากกว่าการส่ง JSON สเปกหรือไฟล์รูปภาพ Figma
12
+ 3. **Single Source of Truth:** เมื่อมีการปรับเปลี่ยน Brand Tokens หรือ Component Spacing ให้แก้ที่ `DESIGN.md` จุดเดียว
13
+
14
+ ---
15
+
16
+ ## 2. โครงสร้างมาตรฐานของ `DESIGN.md` (Project Root Template)
17
+
18
+ ```markdown
19
+ # Design System Specification (DESIGN.md)
20
+
21
+ ## 1. Aesthetic Archetype & Direction
22
+ - **Archetype:** [Minimalist Clean / Tactical Dense / Editorial Luxury / Neumorphic Soft / Retro Cyber]
23
+ - **Mood & Tone:** Professional, fast, low-friction, high-density survey data presentation.
24
+ - **Visual Personality:** Sharp 1px borders, subtle frosted backdrops, negative heading tracking.
25
+
26
+ ## 2. Color Palette & WCAG Compliance
27
+ - **Surfaces:**
28
+ - Background Base: `#09090b` (Dark) / `#fafafa` (Light) — ห้ามใช้ pure #000000 หรือ #ffffff แบนราบ
29
+ - Surface Elevated: `#141416` (Dark) / `#ffffff` (Light)
30
+ - Surface Border: `rgba(255, 255, 255, 0.08)` (Dark) / `rgba(0, 0, 0, 0.08)` (Light)
31
+ - **Accents:**
32
+ - Primary Action / Voltage: `#cc785c` (Terracotta) หรือ `#6366f1` (Indigo)
33
+ - Success: `#10b981` (Emerald)
34
+ - Warning: `#f59e0b` (Amber)
35
+ - Danger: `#ef4444` (Rose Red)
36
+ - **Contrast Proof:** ทุกคู่ข้อความและพื้นหลังต้องผ่านเกณฑ์ WCAG AAA (Contrast ratio >= 7:1 สำหรับ Normal text)
37
+
38
+ ## 3. Typography Hierarchy
39
+ - **Font Stacks:**
40
+ - Display / Headings: `Instrument Serif`, `Playfair Display`, หรือ Serif italic accents
41
+ - Body / UI: `Plus Jakarta Sans`, `Geist`, หรือ `Inter`
42
+ - Code / Data / Numbers: `Geist Mono`, `JetBrains Mono`
43
+ - **Scale:**
44
+ - H1 Hero: `2.25rem` (36px) | weight: 700 | tracking: `-0.03em` | line-height: 1.15
45
+ - H2 Section: `1.5rem` (24px) | weight: 600 | tracking: `-0.025em` | line-height: 1.25
46
+ - H3 Subsection: `1.125rem` (18px) | weight: 600 | tracking: `-0.015em` | line-height: 1.35
47
+ - Body: `0.875rem` (14px) | weight: 400 | tracking: `0em` | line-height: 1.5
48
+ - Caption / Micro: `0.75rem` (12px) | weight: 500 | tracking: `0.02em` | line-height: 1.4
49
+
50
+ ## 4. Component Anatomy & Spatial Scale
51
+ - **Grid / Spacing:** 4px base (4, 8, 12, 16, 24, 32, 48, 64px)
52
+ - **Border Radius:**
53
+ - Cards & Containers: `8px` (`rounded-lg`) ถึง `12px` (`rounded-xl`)
54
+ - Inputs & Dropdowns: `6px` (`rounded-md`)
55
+ - Primary Action Buttons: `9999px` (`rounded-full` Pill)
56
+ - Status Badges / Tags: `4px` (`rounded`) หรือ `9999px`
57
+ - **Shadows & Elevation:**
58
+ - Card Default: `0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.03)`
59
+ - Card Hover: `0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)`
60
+ - Modal: `0 20px 25px -5px rgba(0, 0, 0, 0.2)`
61
+
62
+ ## 5. Anti-AI Visual Tells Checklist
63
+ - [ ] ไม่มี Generic Centered Hero พร้อมปุ่มสีม่วงนีออนไล่เฉด (Indigo/Purple gradient cliché)
64
+ - [ ] ไม่มีไอคอนลอยกลางการ์ด 3 ช่องที่มีขนาดเท่ากันหมดอย่างไร้ลำดับความสำคัญ
65
+ - [ ] มี State ชัดเจน: Hover, Active, Focus-Visible, Disabled, Loading
66
+ - [ ] มี Empty State ที่ออกแบบมาเฉพาะจุด พร้อมปุ่ม Action ที่พาไปขั้นตอนต่อไป
67
+ - [ ] ใช้ 1px hairline borders (`border-border/40`) แทน Drop Shadow ขนาดใหญ่เกินจริง
68
+ ```
69
+
70
+ ---
71
+
72
+ ## 3. Workflow การประยุกต์ใช้กับ AI Agent
73
+ 1. **เมื่อเริ่มโปรเจกต์ใหม่:** รัน `/medesign` เพื่อสังเคราะห์ `DESIGN.md` วางไว้ที่ Root ของโปรเจกต์
74
+ 2. **เมื่อแก้ไขหรือเพิ่ม Component:** ตรวจสอบค่าสี, Spacing, และ Font จาก `DESIGN.md` เสมอ
75
+ 3. **เมื่อรีวิวโค้ด UI (`review`):** นำ Checklists ใน `DESIGN.md` มาเป็นเกณฑ์ตรวจรับงาน
@@ -0,0 +1,207 @@
1
+ # Design Routing Guide
2
+
3
+ When to use each design sub-skill.
4
+
5
+ ## Skill Overview
6
+
7
+ | Skill | Purpose | Key Files |
8
+ |-------|---------|-----------|
9
+ | brand | Brand identity, voice, assets | SKILL.md + 10 references + 3 scripts |
10
+ | design-system | Token architecture, specs | SKILL.md + 7 references + 2 scripts |
11
+ | ui-styling | Component implementation | SKILL.md + 7 references + 2 scripts |
12
+ | logo-design | AI logo generation (55 styles, 30 palettes) | SKILL.md + 4 references + 2 scripts |
13
+ | cip-design | Corporate Identity Program (50 deliverables) | SKILL.md + 3 references + 3 scripts |
14
+ | slides | HTML presentations with Chart.js | SKILL.md + 4 references |
15
+ | banner (built-in) | Banners for social, ads, web, print (22 styles) | references/banner-sizes-and-styles.md |
16
+ | icon-design | SVG icon generation (15 styles, Gemini 3.1 Pro) | SKILL.md + 1 reference + 1 script |
17
+
18
+ ## Routing by Task Type
19
+
20
+ ### Brand Identity Tasks
21
+ **→ brand**
22
+
23
+ - Define brand colors and typography
24
+ - Create logo usage guidelines
25
+ - Establish brand voice and tone
26
+ - Organize and validate assets
27
+ - Create messaging frameworks
28
+ - Audit brand consistency
29
+
30
+ ### Token System Tasks
31
+ **→ design-system**
32
+
33
+ - Create design tokens JSON
34
+ - Generate CSS variables
35
+ - Define component specifications
36
+ - Map tokens to Tailwind config
37
+ - Validate token usage in code
38
+ - Document state and variants
39
+
40
+ ### Implementation Tasks
41
+ **→ ui-styling**
42
+
43
+ - Add shadcn/ui components
44
+ - Style with Tailwind classes
45
+ - Implement dark mode
46
+ - Create responsive layouts
47
+ - Build accessible components
48
+
49
+ ### Logo Design Tasks
50
+ **→ logo-design**
51
+
52
+ - Create logos with AI (Gemini Nano Banana)
53
+ - Search logo styles, color palettes, industry guidelines
54
+ - Generate design briefs
55
+ - Explore 55+ styles (minimalist, vintage, luxury, geometric, etc.)
56
+
57
+ ### Corporate Identity Program Tasks
58
+ **→ cip-design**
59
+
60
+ - Generate CIP deliverables (business cards, letterheads, signage, vehicles, apparel)
61
+ - Create CIP briefs with industry/style analysis
62
+ - Generate mockups with/without logo (Gemini Flash/Pro)
63
+ - Render HTML presentations from CIP mockups
64
+
65
+ ### Presentation Tasks
66
+ **→ slides**
67
+
68
+ - Create strategic HTML presentations
69
+ - Data visualization with Chart.js
70
+ - Apply copywriting formulas to slide content
71
+ - Use layout patterns and design tokens
72
+
73
+ ### Banner Design Tasks
74
+ **→ design (built-in banner: references/banner-sizes-and-styles.md)**
75
+
76
+ - Design banners for social media (Facebook, Twitter, LinkedIn, YouTube, Instagram)
77
+ - Create ad banners (Google Ads, Meta Ads)
78
+ - Website hero banners and headers
79
+ - Print banners and covers
80
+ - 22 art direction styles (minimalist, bold typography, gradient, glassmorphism, etc.)
81
+
82
+ ### Icon Design Tasks
83
+ **→ icon-design**
84
+
85
+ - Generate SVG icons with AI (Gemini 3.1 Pro Preview)
86
+ - Batch icon variations in multiple styles
87
+ - Multi-size export (16px, 24px, 32px, 48px)
88
+ - 15 styles: outlined, filled, duotone, rounded, sharp, gradient, etc.
89
+ - 12 categories: navigation, action, communication, media, commerce, data
90
+
91
+ ## Routing by Question Type
92
+
93
+ | Question | Skill |
94
+ |----------|-------|
95
+ | "What color should this be?" | brand |
96
+ | "How do I create a token for X?" | design-system |
97
+ | "How do I build a button component?" | ui-styling |
98
+ | "Is this on-brand?" | brand |
99
+ | "Should I use a CSS variable here?" | design-system |
100
+ | "How do I add dark mode?" | ui-styling |
101
+ | "Create a logo for my brand" | logo-design |
102
+ | "Generate business card mockups" | cip-design |
103
+ | "Create a pitch deck" | slides |
104
+ | "Design brand identity package" | cip-design |
105
+ | "What logo style fits my industry?" | logo-design |
106
+ | "Design a Facebook cover" | design (built-in banner) |
107
+ | "Create ad banners for Google" | design (built-in banner) |
108
+ | "Make a website hero banner" | design (built-in banner) |
109
+ | "Generate a settings icon" | icon-design |
110
+ | "Create SVG icons for my app" | icon-design |
111
+ | "Design an icon set" | icon-design |
112
+
113
+ ## Multi-Skill Workflows
114
+
115
+ ### New Project Setup
116
+
117
+ ```
118
+ 1. brand → Define identity
119
+ - Colors, typography, voice
120
+
121
+ 2. design-system → Create tokens
122
+ - Primitive, semantic, component
123
+
124
+ 3. ui-styling → Implement
125
+ - Configure Tailwind, add components
126
+ ```
127
+
128
+ ### Design System Migration
129
+
130
+ ```
131
+ 1. brand → Audit existing
132
+ - Extract brand colors, fonts
133
+
134
+ 2. design-system → Formalize tokens
135
+ - Create three-layer architecture
136
+
137
+ 3. ui-styling → Update code
138
+ - Replace hardcoded values
139
+ ```
140
+
141
+ ### Component Creation
142
+
143
+ ```
144
+ 1. design-system → Reference specs
145
+ - Button states, sizes, variants
146
+
147
+ 2. ui-styling → Implement
148
+ - Build with shadcn/ui + Tailwind
149
+ ```
150
+
151
+ ## Skill Dependencies
152
+
153
+ ```
154
+ brand
155
+ ↓ (colors, typography)
156
+ design-system
157
+ ↓ (tokens, specs)
158
+ ui-styling
159
+ ↓ (components)
160
+ Application Code
161
+ ```
162
+
163
+ ## Quick Commands
164
+
165
+ **Brand:**
166
+ ```bash
167
+ node ../brand/scripts/inject-brand-context.cjs
168
+ node ../brand/scripts/validate-asset.cjs <path>
169
+ ```
170
+
171
+ **Tokens:**
172
+ ```bash
173
+ node ../design-system/scripts/generate-tokens.cjs -c tokens.json
174
+ node ../design-system/scripts/validate-tokens.cjs -d src/
175
+ ```
176
+
177
+ **Components:**
178
+ ```bash
179
+ npx shadcn@latest add button card input
180
+ ```
181
+
182
+ ## When to Use Multiple Skills
183
+
184
+ Use **all eight** when:
185
+ - Complete brand package from scratch (logo → CIP → presentation)
186
+
187
+ Use **brand + design-system + ui-styling** when:
188
+ - Design system setup and implementation
189
+
190
+ Use **logo-design + cip-design** when:
191
+ - Complete brand identity package with deliverable mockups
192
+
193
+ Use **logo-design + cip-design + slides** when:
194
+ - Brand pitch: generate logo, create CIP mockups, build pitch deck
195
+
196
+ Use **design (banner) + brand** when:
197
+ - Social media presence: branded banners across all platforms
198
+
199
+ Use **icon-design + design-system** when:
200
+ - Custom icon set matching design tokens and component specs
201
+
202
+ Use **brand + design-system** when:
203
+ - Defining design language without implementation
204
+
205
+ Use **design-system + ui-styling** when:
206
+ - Implementing existing brand in code
207
+ - Building component library
@@ -0,0 +1,71 @@
1
+ ### 4.8 Image & Visual Asset Strategy
2
+
3
+ Landing pages and portfolios are **visual products**. Text-only pages with fake-screenshot divs are slop.
4
+
5
+ **Priority order for visual assets:**
6
+ 1. **Image-generation tool first.** If ANY image-gen tool is available in the environment (`generate_image`, MCP image tool, IDE-integrated gen, OpenAI image tools, etc.) you MUST use it to create section-specific assets: hero photography, product shots, texture backgrounds, mood images. Generate at the right aspect ratio for the section. Do not skip this step because hand-rolled CSS feels faster.
7
+ 2. **Real web images second.** When no gen tool is available, use real photography sources. Acceptable defaults:
8
+ * `https://picsum.photos/seed/{descriptive-seed}/{w}/{h}` for placeholder photography (seed should describe the section, e.g. `marrow-cookware-kitchen`)
9
+ * Actual stock or brand URLs when the brief provides them
10
+ * Open-license sources (Unsplash via direct URL, Pexels) if explicitly allowed
11
+ 3. **Last resort: tell the user.** If neither is possible, do NOT fill the page with hand-rolled SVG illustrations or div-based "fake screenshots." Instead, leave clearly-labeled placeholder slots (`<!-- TODO: hero product photo, 1600x1200 -->`) and at the end of the response say: *"This page needs real images at: \[list of placements\]. Please generate or provide them."*
12
+
13
+ **Even minimalist sites need real images.** A pure-text page is not minimalism. It is incomplete work. Even an editorial Linear-style site needs at least 2-3 real images (hero, one product/lifestyle shot, one supporting image). Generate B&W minimalist photography if the brief is restrained; do not skip images entirely because the dial is low.
14
+
15
+ **Real company logos for social proof.** When the brief calls for a "Trusted by / Used by / Customers" logo wall, do NOT default to plain text wordmarks (`<span>Acme Co</span>` styled in a row). Use real SVG logos:
16
+ * **Source: Simple Icons** (`https://cdn.simpleicons.org/{slug}/ffffff` for any color, or `simple-icons` npm package). Covers most known brands.
17
+ * **Alternative: devicon** for tech-stack logos (`@svgr/cli` or CDN).
18
+ * **Make-up the brand name? Then make-up an SVG mark too.** Generate a simple monogram (one letter in a circle, two-letter ligature, abstract glyph) rendered as an inline `<svg>` matching the page style. Plain text wordmarks for invented brand names look generic.
19
+ * **Always** ensure logos render in both light and dark mode (white-on-dark, black-on-light, or single-color theme variable).
20
+ * **LOGO-ONLY rule (mandatory):** logo wall = logos and nothing else. Do NOT print industry / category labels below each logo (no `Vercel` + `hosting` underneath, no `Stripe` + `payments`, no `Cloudflare` + `infra`). The logo is the credibility, the label adds nothing the user does not already know. Optional: brand name as alt-text for screen readers, optional link to the brand's site. That is it.
21
+
22
+ **Hand-rolled illustrations:**
23
+ * SVG icons from libraries: fine (see Section 3.C).
24
+ * Hand-rolled decorative SVGs (custom illustrations, logos, marks): **strongly discouraged**, never as default. Acceptable only when:
25
+ - The brief explicitly calls for it ("draw me an SVG logo")
26
+ - It's a single, simple geometric mark (a square, a circle, a wordmark in display type)
27
+ - You're confident in the output quality
28
+
29
+ **Div-based fake screenshots are banned.** A "hand-built product preview" rendered with `<div>` rectangles, fake task lists, fake dashboards, fake terminal windows is a Tell. If you need to show a product:
30
+ * Use a real screenshot URL if one exists
31
+ * Generate one via image tool
32
+ * Use a real component preview (an actual mini-version of the UI inside the page)
33
+ * Or skip the preview entirely and use editorial photography
34
+
35
+ **Hero needs a real visual.** Text + gradient blob is not a hero - it's a placeholder.
36
+
37
+ ### 4.9 Content Density
38
+
39
+ Landing pages live on the **first impression**, not the full read. Cut ruthlessly.
40
+
41
+ * **Default content shape per section:** short headline (≤ 8 words) + short sub-paragraph (≤ 25 words) + one visual asset OR one CTA. Anything more must be justified by the section's job.
42
+ * **No data-dump sections.** A 20-row publication table, a 30-row award list, a giant pricing matrix on a marketing page = wrong layout. Use:
43
+ - Top 3-5 highlights + "View full list" link
44
+ - Marquee / carousel for breadth
45
+ - Different page entirely if the data is the product
46
+ * **Long lists need a different UI component, not a longer list.** Default `<ul>` with bullets / `divide-y` rows is the lazy choice. If you have > 5 items, reach for one of these instead:
47
+ - 2-column split with grouped items
48
+ - Card grid with image + label per item
49
+ - Tabs / accordion if items are categorisable
50
+ - Horizontal scroll-snap pills
51
+ - Carousel for breadth-heavy lists (testimonials, logos, capabilities)
52
+ - Marquee for "lots-of-things-that-don't-need-individual-attention"
53
+ A spec sheet with 10 rows + a hairline under every row is the WORST default. Either group rows into 2-3 chunks with sparse dividers, or move to a card-per-spec layout.
54
+ * **Spec sheets specifically (the Marrow-cookware pattern).** A long product specification table with `border-b` on every row is the AI default for cookware / hardware / apparel / artisan-goods briefs. Banned. Concrete alternatives:
55
+ - **2-col card grid:** each spec gets its own card with the spec name, the value (large display number), and a one-line "why it matters" body. Cards arranged 2-col on desktop, 1-col mobile.
56
+ - **Scroll-snap horizontal pills:** each spec is a pill, user can flick through.
57
+ - **Grouped chunks:** group 10 specs into 3 logical clusters (e.g. "Materials", "Cooking", "Warranty"), each cluster gets ONE soft divider and a cluster heading.
58
+ - **Featured-vs-rest:** 3-4 hero specs visualised as large display tiles, the rest collapsed under a "View full specifications" disclosure.
59
+
60
+ * **COPY SELF-AUDIT (mandatory before ship):** Before declaring any task done, re-read every visible string on the page (headlines, subheads, eyebrows, button labels, body copy, captions, alt text, footer text, error messages). Flag any string that is:
61
+ - **Grammatically broken** ("free on its past", "two plans but one is honest", "to put it on the table" out of context)
62
+ - **Has unclear referents** ("we plan to stay that way" without prior context)
63
+ - **Sounds like AI hallucination** (cute-but-wrong wordplay, forced metaphors that don't track, "elegant nothing" phrases)
64
+ - **Reads like an LLM trying to sound thoughtful** (passive-aggressive humility, fake-craftsman labels, mock-poetic micro-meta)
65
+ Rewrite every flagged string. If unsure whether a string makes sense, replace it with a plain functional sentence. AI-generated cute copy is worse than boring copy.
66
+ * **Fake-precise numbers are flagged.** Numbers like `92%`, `4.1×`, `48k`, `5.8 mm`, `13.4 lb` either:
67
+ - Come from real data (brief, brand guidelines, public metrics) - fine
68
+ - Are explicitly labeled as mock (`<!-- mock -->`, "example", "sample data") - fine
69
+ - Are AI-invented spec aesthetics - banned. Don't fake engineering precision the brand doesn't claim.
70
+ * **One copy register per page.** Don't mix technical mono ("47 tasks · 0.6 ctx-switches/day"), editorial prose, and marketing punch in the same composition unless the brand voice explicitly calls for it.
71
+