oxycode-skills 1.0.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.
- package/LICENSE +21 -0
- package/README.md +143 -0
- package/index.js +17 -0
- package/package.json +49 -0
- package/skills/anti-slop/README.md +106 -0
- package/skills/anti-slop/SKILL.md +311 -0
- package/skills/anti-slop/examples/before-after.md +380 -0
- package/skills/anti-slop/references/quality-rubric.md +313 -0
- package/skills/anti-slop/references/slop-patterns.md +433 -0
- package/skills/component-architect/README.md +186 -0
- package/skills/component-architect/SKILL.md +644 -0
- package/skills/component-architect/examples/component-patterns.md +569 -0
- package/skills/component-architect/references/atomic-design.md +516 -0
- package/skills/design-audit/README.md +114 -0
- package/skills/design-audit/SKILL.md +305 -0
- package/skills/design-audit/examples/audit-report.md +424 -0
- package/skills/design-audit/references/scoring-rubric.md +498 -0
- package/skills/design-md/README.md +106 -0
- package/skills/design-md/SKILL.md +262 -0
- package/skills/design-md/examples/bad-design.md +195 -0
- package/skills/design-md/examples/good-design.md +250 -0
- package/skills/design-md/references/design-md-spec.md +267 -0
- package/skills/design-md/scripts/validate.sh +134 -0
- package/skills/ui-builder/README.md +169 -0
- package/skills/ui-builder/SKILL.md +357 -0
- package/skills/ui-builder/examples/dashboard.md +323 -0
- package/skills/ui-builder/examples/landing-page.md +396 -0
- package/skills/ui-builder/references/component-patterns.md +396 -0
- package/skills/ui-builder/references/layout-system.md +423 -0
- package/skills/ui-builder/references/polish-checklist.md +221 -0
|
@@ -0,0 +1,516 @@
|
|
|
1
|
+
# Atomic Design Reference
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Atomic Design is a methodology created by Brad Frost for creating design systems. It breaks down interfaces into five levels of components:
|
|
6
|
+
|
|
7
|
+
1. **Atoms** - Basic building blocks
|
|
8
|
+
2. **Molecules** - Groups of atoms
|
|
9
|
+
3. **Organisms** - Complex components
|
|
10
|
+
4. **Templates** - Page layouts
|
|
11
|
+
5. **Pages** - Specific instances
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Level 1: Atoms
|
|
16
|
+
|
|
17
|
+
### Definition
|
|
18
|
+
Atoms are the basic building blocks of an interface. They cannot be broken down further without losing their functionality.
|
|
19
|
+
|
|
20
|
+
### Examples
|
|
21
|
+
- Buttons
|
|
22
|
+
- Inputs
|
|
23
|
+
- Labels
|
|
24
|
+
- Icons
|
|
25
|
+
- Badges
|
|
26
|
+
- Avatars
|
|
27
|
+
- Checkboxes
|
|
28
|
+
- Radio buttons
|
|
29
|
+
- Switches
|
|
30
|
+
|
|
31
|
+
### File Structure
|
|
32
|
+
```
|
|
33
|
+
src/components/atoms/
|
|
34
|
+
├── Button/
|
|
35
|
+
│ ├── Button.tsx
|
|
36
|
+
│ ├── Button.test.tsx
|
|
37
|
+
│ ├── Button.stories.tsx
|
|
38
|
+
│ └── index.ts
|
|
39
|
+
├── Input/
|
|
40
|
+
├── Badge/
|
|
41
|
+
├── Avatar/
|
|
42
|
+
├── Icon/
|
|
43
|
+
└── index.ts
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Example: Button Atom
|
|
47
|
+
```tsx
|
|
48
|
+
// atoms/Button/Button.tsx
|
|
49
|
+
import { cn } from '@/lib/utils'
|
|
50
|
+
|
|
51
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
52
|
+
variant?: 'primary' | 'secondary' | 'ghost'
|
|
53
|
+
size?: 'sm' | 'md' | 'lg'
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function Button({
|
|
57
|
+
variant = 'primary',
|
|
58
|
+
size = 'md',
|
|
59
|
+
className,
|
|
60
|
+
children,
|
|
61
|
+
...props
|
|
62
|
+
}: ButtonProps) {
|
|
63
|
+
return (
|
|
64
|
+
<button
|
|
65
|
+
className={cn(
|
|
66
|
+
'inline-flex items-center justify-center font-medium rounded-lg transition-colors',
|
|
67
|
+
variant === 'primary' && 'bg-zinc-900 text-white hover:bg-zinc-800',
|
|
68
|
+
variant === 'secondary' && 'bg-zinc-100 text-zinc-900 hover:bg-zinc-200',
|
|
69
|
+
variant === 'ghost' && 'text-zinc-600 hover:text-zinc-900 hover:bg-zinc-100',
|
|
70
|
+
size === 'sm' && 'px-3 py-1.5 text-xs',
|
|
71
|
+
size === 'md' && 'px-4 py-2 text-sm',
|
|
72
|
+
size === 'lg' && 'px-6 py-3 text-base',
|
|
73
|
+
className
|
|
74
|
+
)}
|
|
75
|
+
{...props}
|
|
76
|
+
>
|
|
77
|
+
{children}
|
|
78
|
+
</button>
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Level 2: Molecules
|
|
86
|
+
|
|
87
|
+
### Definition
|
|
88
|
+
Molecules are groups of atoms bonded together. They form relatively simple UI components.
|
|
89
|
+
|
|
90
|
+
### Examples
|
|
91
|
+
- Form fields (label + input + error)
|
|
92
|
+
- Card (image + title + description)
|
|
93
|
+
- Nav item (icon + text)
|
|
94
|
+
- Search bar (input + button)
|
|
95
|
+
- User row (avatar + name + email)
|
|
96
|
+
|
|
97
|
+
### File Structure
|
|
98
|
+
```
|
|
99
|
+
src/components/molecules/
|
|
100
|
+
├── form-field/
|
|
101
|
+
│ ├── FormField.tsx
|
|
102
|
+
│ ├── FormField.test.tsx
|
|
103
|
+
│ └── index.ts
|
|
104
|
+
├── card/
|
|
105
|
+
├── nav-item/
|
|
106
|
+
├── search-bar/
|
|
107
|
+
└── index.ts
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Example: Form Field Molecule
|
|
111
|
+
```tsx
|
|
112
|
+
// molecules/form-field/FormField.tsx
|
|
113
|
+
import { cn } from '@/lib/utils'
|
|
114
|
+
|
|
115
|
+
interface FormFieldProps {
|
|
116
|
+
label: string
|
|
117
|
+
error?: string
|
|
118
|
+
children: React.ReactNode
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export function FormField({ label, error, children }: FormFieldProps) {
|
|
122
|
+
return (
|
|
123
|
+
<div className="space-y-1">
|
|
124
|
+
<label className="text-sm font-medium text-zinc-700">
|
|
125
|
+
{label}
|
|
126
|
+
</label>
|
|
127
|
+
{children}
|
|
128
|
+
{error && (
|
|
129
|
+
<p className="text-xs text-red-500">{error}</p>
|
|
130
|
+
)}
|
|
131
|
+
</div>
|
|
132
|
+
)
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Usage
|
|
136
|
+
<FormField label="Email" error="Invalid email">
|
|
137
|
+
<input type="email" className="w-full px-3 py-2 border border-zinc-300 rounded-lg" />
|
|
138
|
+
</FormField>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Example: Card Molecule
|
|
142
|
+
```tsx
|
|
143
|
+
// molecules/card/Card.tsx
|
|
144
|
+
import { cn } from '@/lib/utils'
|
|
145
|
+
|
|
146
|
+
interface CardProps {
|
|
147
|
+
image?: string
|
|
148
|
+
title: string
|
|
149
|
+
description?: string
|
|
150
|
+
children?: React.ReactNode
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export function Card({ image, title, description, children }: CardProps) {
|
|
154
|
+
return (
|
|
155
|
+
<div className="bg-white border border-zinc-200 rounded-lg overflow-hidden">
|
|
156
|
+
{image && (
|
|
157
|
+
<img src={image} alt={title} className="w-full h-48 object-cover" />
|
|
158
|
+
)}
|
|
159
|
+
<div className="p-4">
|
|
160
|
+
<h3 className="text-lg font-semibold text-zinc-900">{title}</h3>
|
|
161
|
+
{description && (
|
|
162
|
+
<p className="mt-1 text-sm text-zinc-500">{description}</p>
|
|
163
|
+
)}
|
|
164
|
+
{children}
|
|
165
|
+
</div>
|
|
166
|
+
</div>
|
|
167
|
+
)
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## Level 3: Organisms
|
|
174
|
+
|
|
175
|
+
### Definition
|
|
176
|
+
Organisms are complex UI components composed of molecules and/or atoms. They form distinct sections of an interface.
|
|
177
|
+
|
|
178
|
+
### Examples
|
|
179
|
+
- Header (logo + nav + search + user menu)
|
|
180
|
+
- Sidebar (logo + nav + user info)
|
|
181
|
+
- Data table (header + rows + pagination)
|
|
182
|
+
- Form (multiple form fields + submit button)
|
|
183
|
+
- Modal (overlay + content + actions)
|
|
184
|
+
|
|
185
|
+
### File Structure
|
|
186
|
+
```
|
|
187
|
+
src/components/organisms/
|
|
188
|
+
├── header/
|
|
189
|
+
│ ├── Header.tsx
|
|
190
|
+
│ ├── Header.test.tsx
|
|
191
|
+
│ └── index.ts
|
|
192
|
+
├── sidebar/
|
|
193
|
+
├── data-table/
|
|
194
|
+
├── form/
|
|
195
|
+
├── modal/
|
|
196
|
+
└── index.ts
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Example: Header Organism
|
|
200
|
+
```tsx
|
|
201
|
+
// organisms/header/Header.tsx
|
|
202
|
+
import { Logo } from '@/components/atoms/Logo'
|
|
203
|
+
import { Button } from '@/components/atoms/Button'
|
|
204
|
+
import { SearchBar } from '@/components/molecules/search-bar'
|
|
205
|
+
import { UserMenu } from '@/components/molecules/user-menu'
|
|
206
|
+
|
|
207
|
+
interface HeaderProps {
|
|
208
|
+
user?: User
|
|
209
|
+
onSearch?: (query: string) => void
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export function Header({ user, onSearch }: HeaderProps) {
|
|
213
|
+
return (
|
|
214
|
+
<header className="h-16 border-b border-zinc-200 bg-white">
|
|
215
|
+
<div className="h-full px-6 flex items-center justify-between">
|
|
216
|
+
<div className="flex items-center gap-6">
|
|
217
|
+
<Logo />
|
|
218
|
+
<nav className="hidden md:flex items-center gap-6">
|
|
219
|
+
<a href="/dashboard" className="text-sm text-zinc-600 hover:text-zinc-900">
|
|
220
|
+
Dashboard
|
|
221
|
+
</a>
|
|
222
|
+
<a href="/analytics" className="text-sm text-zinc-600 hover:text-zinc-900">
|
|
223
|
+
Analytics
|
|
224
|
+
</a>
|
|
225
|
+
</nav>
|
|
226
|
+
</div>
|
|
227
|
+
|
|
228
|
+
<div className="flex items-center gap-4">
|
|
229
|
+
<SearchBar onSearch={onSearch} />
|
|
230
|
+
{user && <UserMenu user={user} />}
|
|
231
|
+
</div>
|
|
232
|
+
</div>
|
|
233
|
+
</header>
|
|
234
|
+
)
|
|
235
|
+
}
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### Example: Data Table Organism
|
|
239
|
+
```tsx
|
|
240
|
+
// organisms/data-table/DataTable.tsx
|
|
241
|
+
import { Table } from '@/components/atoms/Table'
|
|
242
|
+
import { Pagination } from '@/components/molecules/pagination'
|
|
243
|
+
|
|
244
|
+
interface DataTableProps {
|
|
245
|
+
columns: Column[]
|
|
246
|
+
data: any[]
|
|
247
|
+
totalItems: number
|
|
248
|
+
currentPage: number
|
|
249
|
+
onPageChange: (page: number) => void
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export function DataTable({
|
|
253
|
+
columns,
|
|
254
|
+
data,
|
|
255
|
+
totalItems,
|
|
256
|
+
currentPage,
|
|
257
|
+
onPageChange
|
|
258
|
+
}: DataTableProps) {
|
|
259
|
+
return (
|
|
260
|
+
<div className="bg-white border border-zinc-200 rounded-lg">
|
|
261
|
+
<Table columns={columns} data={data} />
|
|
262
|
+
<div className="px-6 py-4 border-t border-zinc-200">
|
|
263
|
+
<Pagination
|
|
264
|
+
totalItems={totalItems}
|
|
265
|
+
currentPage={currentPage}
|
|
266
|
+
onPageChange={onPageChange}
|
|
267
|
+
/>
|
|
268
|
+
</div>
|
|
269
|
+
</div>
|
|
270
|
+
)
|
|
271
|
+
}
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
## Level 4: Templates
|
|
277
|
+
|
|
278
|
+
### Definition
|
|
279
|
+
Templates are page-level objects that place components in a layout. They define the structure of a page.
|
|
280
|
+
|
|
281
|
+
### Examples
|
|
282
|
+
- Dashboard layout (sidebar + main content)
|
|
283
|
+
- Landing page (hero + features + pricing + footer)
|
|
284
|
+
- Auth layout (form + branding)
|
|
285
|
+
- Settings layout (tabs + content)
|
|
286
|
+
|
|
287
|
+
### File Structure
|
|
288
|
+
```
|
|
289
|
+
src/components/templates/
|
|
290
|
+
├── dashboard/
|
|
291
|
+
│ ├── DashboardTemplate.tsx
|
|
292
|
+
│ └── index.ts
|
|
293
|
+
├── landing/
|
|
294
|
+
├── auth/
|
|
295
|
+
├── settings/
|
|
296
|
+
└── index.ts
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
### Example: Dashboard Template
|
|
300
|
+
```tsx
|
|
301
|
+
// templates/dashboard/DashboardTemplate.tsx
|
|
302
|
+
import { Sidebar } from '@/components/organisms/sidebar'
|
|
303
|
+
import { Header } from '@/components/organisms/header'
|
|
304
|
+
|
|
305
|
+
interface DashboardTemplateProps {
|
|
306
|
+
children: React.ReactNode
|
|
307
|
+
user?: User
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
export function DashboardTemplate({ children, user }: DashboardTemplateProps) {
|
|
311
|
+
return (
|
|
312
|
+
<div className="flex h-screen bg-zinc-50">
|
|
313
|
+
<Sidebar user={user} />
|
|
314
|
+
|
|
315
|
+
<div className="flex-1 flex flex-col overflow-hidden">
|
|
316
|
+
<Header user={user} />
|
|
317
|
+
|
|
318
|
+
<main className="flex-1 overflow-auto p-6">
|
|
319
|
+
{children}
|
|
320
|
+
</main>
|
|
321
|
+
</div>
|
|
322
|
+
</div>
|
|
323
|
+
)
|
|
324
|
+
}
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
### Example: Landing Template
|
|
328
|
+
```tsx
|
|
329
|
+
// templates/landing/LandingTemplate.tsx
|
|
330
|
+
import { Hero } from '@/components/organisms/hero'
|
|
331
|
+
import { Features } from '@/components/organisms/features'
|
|
332
|
+
import { Pricing } from '@/components/organisms/pricing'
|
|
333
|
+
import { Footer } from '@/components/organisms/footer'
|
|
334
|
+
|
|
335
|
+
interface LandingTemplateProps {
|
|
336
|
+
children?: React.ReactNode
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
export function LandingTemplate({ children }: LandingTemplateProps) {
|
|
340
|
+
return (
|
|
341
|
+
<div className="min-h-screen">
|
|
342
|
+
<nav>{/* Navigation */}</nav>
|
|
343
|
+
<Hero />
|
|
344
|
+
<Features />
|
|
345
|
+
{children}
|
|
346
|
+
<Pricing />
|
|
347
|
+
<Footer />
|
|
348
|
+
</div>
|
|
349
|
+
)
|
|
350
|
+
}
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
## Level 5: Pages
|
|
356
|
+
|
|
357
|
+
### Definition
|
|
358
|
+
Pages are specific instances of templates. They show what a UI looks like with real data.
|
|
359
|
+
|
|
360
|
+
### Examples
|
|
361
|
+
- Home page
|
|
362
|
+
- Settings page
|
|
363
|
+
- Profile page
|
|
364
|
+
- Dashboard page
|
|
365
|
+
- Landing page
|
|
366
|
+
|
|
367
|
+
### File Structure
|
|
368
|
+
```
|
|
369
|
+
src/components/pages/
|
|
370
|
+
├── home/
|
|
371
|
+
│ ├── HomePage.tsx
|
|
372
|
+
│ └── index.ts
|
|
373
|
+
├── settings/
|
|
374
|
+
├── profile/
|
|
375
|
+
├── dashboard/
|
|
376
|
+
└── index.ts
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
### Example: Dashboard Page
|
|
380
|
+
```tsx
|
|
381
|
+
// pages/dashboard/DashboardPage.tsx
|
|
382
|
+
import { DashboardTemplate } from '@/components/templates/dashboard'
|
|
383
|
+
import { StatsCard } from '@/components/molecules/stats-card'
|
|
384
|
+
import { DataTable } from '@/components/organisms/data-table'
|
|
385
|
+
|
|
386
|
+
export function DashboardPage() {
|
|
387
|
+
return (
|
|
388
|
+
<DashboardTemplate>
|
|
389
|
+
<div className="space-y-6">
|
|
390
|
+
<h1 className="text-2xl font-bold text-zinc-900">Dashboard</h1>
|
|
391
|
+
|
|
392
|
+
<div className="grid grid-cols-1 md:grid-cols-4 gap-4">
|
|
393
|
+
<StatsCard title="Users" value="1,234" change="+12%" />
|
|
394
|
+
<StatsCard title="Revenue" value="$45,678" change="+8%" />
|
|
395
|
+
<StatsCard title="Orders" value="567" change="+5%" />
|
|
396
|
+
<StatsCard title="Conversion" value="3.2%" change="+0.5%" />
|
|
397
|
+
</div>
|
|
398
|
+
|
|
399
|
+
<DataTable
|
|
400
|
+
columns={columns}
|
|
401
|
+
data={data}
|
|
402
|
+
totalItems={100}
|
|
403
|
+
currentPage={1}
|
|
404
|
+
onPageChange={handlePageChange}
|
|
405
|
+
/>
|
|
406
|
+
</div>
|
|
407
|
+
</DashboardTemplate>
|
|
408
|
+
)
|
|
409
|
+
}
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
---
|
|
413
|
+
|
|
414
|
+
## Relationship Diagram
|
|
415
|
+
|
|
416
|
+
```
|
|
417
|
+
Pages
|
|
418
|
+
└── Templates
|
|
419
|
+
└── Organisms
|
|
420
|
+
└── Molecules
|
|
421
|
+
└── Atoms
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
### Real-World Example
|
|
425
|
+
|
|
426
|
+
```
|
|
427
|
+
DashboardPage (Page)
|
|
428
|
+
└── DashboardTemplate (Template)
|
|
429
|
+
├── Sidebar (Organism)
|
|
430
|
+
│ ├── Logo (Atom)
|
|
431
|
+
│ ├── NavItem (Molecule)
|
|
432
|
+
│ │ ├── Icon (Atom)
|
|
433
|
+
│ │ └── Text (Atom)
|
|
434
|
+
│ └── UserInfo (Molecule)
|
|
435
|
+
│ ├── Avatar (Atom)
|
|
436
|
+
│ └── Name (Atom)
|
|
437
|
+
├── Header (Organism)
|
|
438
|
+
│ ├── Logo (Atom)
|
|
439
|
+
│ ├── SearchBar (Molecule)
|
|
440
|
+
│ │ ├── Input (Atom)
|
|
441
|
+
│ │ └── Button (Atom)
|
|
442
|
+
│ └── UserMenu (Molecule)
|
|
443
|
+
│ ├── Avatar (Atom)
|
|
444
|
+
│ └── Dropdown (Atom)
|
|
445
|
+
└── Main Content
|
|
446
|
+
├── StatsCard (Molecule)
|
|
447
|
+
│ ├── Title (Atom)
|
|
448
|
+
│ └── Value (Atom)
|
|
449
|
+
└── DataTable (Organism)
|
|
450
|
+
├── TableHeader (Molecule)
|
|
451
|
+
│ └── ColumnHeaders (Atoms)
|
|
452
|
+
├── TableRow (Molecule)
|
|
453
|
+
│ └── Cells (Atoms)
|
|
454
|
+
└── Pagination (Molecule)
|
|
455
|
+
├── Button (Atom)
|
|
456
|
+
└── Text (Atom)
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
---
|
|
460
|
+
|
|
461
|
+
## Benefits
|
|
462
|
+
|
|
463
|
+
### 1. Consistency
|
|
464
|
+
- Components are reused across the interface
|
|
465
|
+
- Design tokens are applied consistently
|
|
466
|
+
- Patterns are established and followed
|
|
467
|
+
|
|
468
|
+
### 2. Reusability
|
|
469
|
+
- Atoms can be used anywhere
|
|
470
|
+
- Molecules combine atoms in useful ways
|
|
471
|
+
- Organisms compose molecules into sections
|
|
472
|
+
|
|
473
|
+
### 3. Maintainability
|
|
474
|
+
- Changes to atoms propagate everywhere
|
|
475
|
+
- Components are small and focused
|
|
476
|
+
- Easy to update and refactor
|
|
477
|
+
|
|
478
|
+
### 4. Scalability
|
|
479
|
+
- New components build on existing ones
|
|
480
|
+
- Patterns are established for growth
|
|
481
|
+
- Team can work on different levels
|
|
482
|
+
|
|
483
|
+
### 5. Documentation
|
|
484
|
+
- Each level has clear responsibilities
|
|
485
|
+
- Easy to understand component hierarchy
|
|
486
|
+
- Clear naming conventions
|
|
487
|
+
|
|
488
|
+
---
|
|
489
|
+
|
|
490
|
+
## Best Practices
|
|
491
|
+
|
|
492
|
+
### 1. Start with Atoms
|
|
493
|
+
- Build basic components first
|
|
494
|
+
- Ensure they're reusable
|
|
495
|
+
- Test thoroughly
|
|
496
|
+
|
|
497
|
+
### 2. Compose, Don't Configure
|
|
498
|
+
- Use composition over props
|
|
499
|
+
- Create compound components
|
|
500
|
+
- Avoid prop drilling
|
|
501
|
+
|
|
502
|
+
### 3. Separate Concerns
|
|
503
|
+
- UI components (atoms, molecules)
|
|
504
|
+
- Logic components (organisms)
|
|
505
|
+
- Layout components (templates)
|
|
506
|
+
- Page components (pages)
|
|
507
|
+
|
|
508
|
+
### 4. Name Consistently
|
|
509
|
+
- Use clear, descriptive names
|
|
510
|
+
- Follow naming conventions
|
|
511
|
+
- Be consistent across levels
|
|
512
|
+
|
|
513
|
+
### 5. Document Everything
|
|
514
|
+
- Document each component
|
|
515
|
+
- Provide usage examples
|
|
516
|
+
- Document props and variants
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# design-audit Skill
|
|
2
|
+
|
|
3
|
+
> Score UI quality across 10 dimensions and generate a ranked fix list with code snippets.
|
|
4
|
+
|
|
5
|
+
## What Does This Skill Do?
|
|
6
|
+
|
|
7
|
+
The `design-audit` skill teaches AI coding agents to:
|
|
8
|
+
1. **Analyze** UI code across 10 dimensions
|
|
9
|
+
2. **Score** each dimension 0-10 (total 0-100)
|
|
10
|
+
3. **Identify** issues ranked by impact
|
|
11
|
+
4. **Generate** code fixes for each issue
|
|
12
|
+
5. **Provide** actionable recommendations
|
|
13
|
+
|
|
14
|
+
## Why Use This Skill?
|
|
15
|
+
|
|
16
|
+
- **Quality Gate**: Ensure UI meets production standards
|
|
17
|
+
- **Consistent Scoring**: Objective criteria for evaluation
|
|
18
|
+
- **Actionable Feedback**: Not just problems, but solutions
|
|
19
|
+
- **Prioritized Fixes**: Focus on high-impact issues first
|
|
20
|
+
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
23
|
+
### Audit a Component
|
|
24
|
+
```bash
|
|
25
|
+
/design-audit "Audit this stats card component"
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Score UI Quality
|
|
29
|
+
```bash
|
|
30
|
+
/design-audit "Score this UI on a 0-100 scale"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Get Fix Recommendations
|
|
34
|
+
```bash
|
|
35
|
+
/design-audit "What issues does this UI have?"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Features
|
|
39
|
+
|
|
40
|
+
- ✅ 10-dimension scoring system
|
|
41
|
+
- ✅ 0-100 quality score
|
|
42
|
+
- ✅ Ranked issue list
|
|
43
|
+
- ✅ Code fixes for each issue
|
|
44
|
+
- ✅ Prioritized recommendations
|
|
45
|
+
- ✅ Before/after examples
|
|
46
|
+
|
|
47
|
+
## File Structure
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
skills/design-audit/
|
|
51
|
+
├── SKILL.md # Main skill instructions
|
|
52
|
+
├── README.md # This file
|
|
53
|
+
├── references/
|
|
54
|
+
│ └── scoring-rubric.md # Detailed scoring criteria
|
|
55
|
+
└── examples/
|
|
56
|
+
└── audit-report.md # Example audit reports
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Scoring Dimensions
|
|
60
|
+
|
|
61
|
+
| Dimension | Points | Description |
|
|
62
|
+
|-----------|--------|-------------|
|
|
63
|
+
| Color System | 10 | Design tokens, hierarchy, contrast |
|
|
64
|
+
| Typography | 10 | Font family, scale, weights |
|
|
65
|
+
| Spacing | 10 | Consistent scale, rhythm |
|
|
66
|
+
| Layout | 10 | Grid/flex, responsive |
|
|
67
|
+
| Components | 10 | States, accessibility, reusability |
|
|
68
|
+
| Accessibility | 10 | Semantics, ARIA, keyboard |
|
|
69
|
+
| Visual Hierarchy | 10 | Focal points, contrast |
|
|
70
|
+
| Consistency | 10 | Patterns, naming |
|
|
71
|
+
| Polish | 10 | Animations, states |
|
|
72
|
+
| Code Quality | 10 | TypeScript, structure |
|
|
73
|
+
|
|
74
|
+
## Score Interpretation
|
|
75
|
+
|
|
76
|
+
- **90-100**: Excellent (Vercel-quality)
|
|
77
|
+
- **80-89**: Good (Minor improvements)
|
|
78
|
+
- **70-79**: Average (Several issues)
|
|
79
|
+
- **60-69**: Below Average (Many issues)
|
|
80
|
+
- **50-59**: Poor (Significant issues)
|
|
81
|
+
- **0-49**: Terrible (Complete rewrite)
|
|
82
|
+
|
|
83
|
+
## Priority Levels
|
|
84
|
+
|
|
85
|
+
### HIGH PRIORITY (5-10 points)
|
|
86
|
+
- Accessibility issues
|
|
87
|
+
- Responsive issues
|
|
88
|
+
- Color contrast issues
|
|
89
|
+
- Broken layouts
|
|
90
|
+
|
|
91
|
+
### MEDIUM PRIORITY (2-4 points)
|
|
92
|
+
- Missing hover states
|
|
93
|
+
- Inconsistent spacing
|
|
94
|
+
- Typography issues
|
|
95
|
+
- Missing loading states
|
|
96
|
+
|
|
97
|
+
### LOW PRIORITY (1 point)
|
|
98
|
+
- Minor polish issues
|
|
99
|
+
- Missing animations
|
|
100
|
+
- Code quality improvements
|
|
101
|
+
|
|
102
|
+
## Examples
|
|
103
|
+
|
|
104
|
+
See [examples/audit-report.md](examples/audit-report.md) for complete audit report examples.
|
|
105
|
+
|
|
106
|
+
## Resources
|
|
107
|
+
|
|
108
|
+
- [WCAG 2.1 Guidelines](https://www.w3.org/WAI/WCAG21/quickref/)
|
|
109
|
+
- [Vercel Design System](https://vercel.com/design)
|
|
110
|
+
- [Design Systems Checklist](https://designsystemschecklist.com/)
|
|
111
|
+
|
|
112
|
+
## Contributing
|
|
113
|
+
|
|
114
|
+
See [CONTRIBUTING.md](../../CONTRIBUTING.md) for guidelines.
|