opencodekit 0.10.0 → 0.11.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 (46) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/template/.opencode/agent/planner.md +3 -2
  3. package/dist/template/.opencode/command/accessibility-check.md +293 -30
  4. package/dist/template/.opencode/command/analyze-mockup.md +406 -20
  5. package/dist/template/.opencode/command/analyze-project.md +439 -30
  6. package/dist/template/.opencode/command/brainstorm.md +288 -5
  7. package/dist/template/.opencode/command/commit.md +226 -17
  8. package/dist/template/.opencode/command/create.md +138 -35
  9. package/dist/template/.opencode/command/design-audit.md +477 -29
  10. package/dist/template/.opencode/command/design.md +609 -6
  11. package/dist/template/.opencode/command/edit-image.md +223 -20
  12. package/dist/template/.opencode/command/finish.md +162 -71
  13. package/dist/template/.opencode/command/fix-ci.md +296 -24
  14. package/dist/template/.opencode/command/fix-types.md +345 -13
  15. package/dist/template/.opencode/command/fix-ui.md +293 -13
  16. package/dist/template/.opencode/command/fix.md +256 -9
  17. package/dist/template/.opencode/command/generate-diagram.md +327 -26
  18. package/dist/template/.opencode/command/generate-icon.md +266 -22
  19. package/dist/template/.opencode/command/generate-image.md +232 -12
  20. package/dist/template/.opencode/command/generate-pattern.md +234 -20
  21. package/dist/template/.opencode/command/generate-storyboard.md +231 -21
  22. package/dist/template/.opencode/command/handoff.md +202 -30
  23. package/dist/template/.opencode/command/implement.md +162 -50
  24. package/dist/template/.opencode/command/import-plan.md +247 -51
  25. package/dist/template/.opencode/command/init.md +154 -35
  26. package/dist/template/.opencode/command/integration-test.md +405 -24
  27. package/dist/template/.opencode/command/issue.md +171 -21
  28. package/dist/template/.opencode/command/new-feature.md +382 -54
  29. package/dist/template/.opencode/command/plan.md +144 -118
  30. package/dist/template/.opencode/command/pr.md +229 -28
  31. package/dist/template/.opencode/command/quick-build.md +234 -5
  32. package/dist/template/.opencode/command/research-and-implement.md +436 -12
  33. package/dist/template/.opencode/command/research-ui.md +444 -34
  34. package/dist/template/.opencode/command/research.md +173 -45
  35. package/dist/template/.opencode/command/restore-image.md +416 -22
  36. package/dist/template/.opencode/command/resume.md +439 -63
  37. package/dist/template/.opencode/command/revert-feature.md +341 -64
  38. package/dist/template/.opencode/command/review-codebase.md +193 -4
  39. package/dist/template/.opencode/command/skill-create.md +506 -14
  40. package/dist/template/.opencode/command/skill-optimize.md +487 -16
  41. package/dist/template/.opencode/command/status.md +320 -60
  42. package/dist/template/.opencode/command/summarize.md +374 -33
  43. package/dist/template/.opencode/command/triage.md +355 -0
  44. package/dist/template/.opencode/command/ui-review.md +292 -25
  45. package/dist/template/.opencode/skill/playwriter/SKILL.md +148 -0
  46. package/package.json +1 -1
@@ -1,53 +1,501 @@
1
1
  ---
2
2
  description: Audit design system from screenshots or codebase
3
- argument-hint: "<screenshots-path|codebase> [output: tokens|report|both]"
3
+ argument-hint: "<screenshots-path|codebase|both> [output: tokens|report|both] [--quick|--deep]"
4
4
  agent: vision
5
5
  model: proxypal/gemini-3-pro-preview
6
6
  ---
7
7
 
8
8
  # Design Audit: $ARGUMENTS
9
9
 
10
- skill({ name: "design-system-audit" })
10
+ ## Phase 1: Source Detection & File Discovery
11
+
12
+ Parse `$ARGUMENTS`:
13
+
14
+ | Input | Action |
15
+ | ---------------- | ------------------------------------------ |
16
+ | Screenshots path | Analyze images for visual inventory |
17
+ | `codebase` | Search code for design tokens and patterns |
18
+ | `both` | Screenshots + codebase, then compare |
19
+
20
+ **Output format** (default: `both`):
11
21
 
12
- Perform a comprehensive design system audit.
22
+ - `tokens` - Design tokens JSON only
23
+ - `report` - Markdown audit report only
24
+ - `both` - Full audit with tokens and report
13
25
 
14
- ## Instructions
26
+ **Depth** (default: `--deep`):
27
+
28
+ - `--quick` - Top-level scan, major issues only (~5-10 min)
29
+ - `--deep` - Comprehensive audit with all categories (~20-30 min)
30
+
31
+ ---
15
32
 
16
- Determine source type from `$ARGUMENTS`:
33
+ ## Phase 2: File Discovery (for codebase audit)
17
34
 
18
- - **Screenshots path**: Analyze images for visual inventory
19
- - **"codebase"**: Analyze code for design tokens and patterns
35
+ Search for design-related files:
36
+
37
+ ```bash
38
+ # Token/config files
39
+ glob pattern="**/tailwind.config.{js,ts,mjs}"
40
+ glob pattern="**/globals.css"
41
+ glob pattern="**/variables.css"
42
+ glob pattern="**/tokens.{json,js,ts}"
43
+ glob pattern="**/theme.{js,ts}"
44
+ glob pattern="**/*.css.ts" # vanilla-extract, etc.
45
+
46
+ # Component files for pattern analysis
47
+ glob pattern="**/components/**/*.{tsx,jsx,vue}"
48
+ ```
49
+
50
+ **Detect design system in use:**
51
+
52
+ | Pattern Found | System |
53
+ | ---------------------------- | ---------------- |
54
+ | `@shadcn/ui` in package.json | shadcn/ui |
55
+ | `@mui/material` | Material UI |
56
+ | `@radix-ui/*` | Radix Primitives |
57
+ | `@chakra-ui/*` | Chakra UI |
58
+ | Tailwind config only | Custom Tailwind |
59
+ | CSS variables only | Custom system |
60
+
61
+ ---
20
62
 
21
- Output format (default: both):
63
+ ## Phase 3: Token Extraction
22
64
 
23
- - **tokens**: JSON design tokens
24
- - **report**: Markdown audit report
25
- - **both**: Both formats
65
+ skill({ name: "design-system-audit" })
26
66
 
27
- ## For Screenshots
67
+ ### For Screenshots
28
68
 
29
69
  Analyze all images and extract:
30
70
 
31
- 1. Color palette (group by primary, secondary, neutral, semantic)
32
- 2. Typography scale (families, sizes, weights)
33
- 3. Spacing patterns
34
- 4. Component variants
35
- 5. Inconsistencies to consolidate
71
+ ```
72
+ 1. COLOR PALETTE
73
+ - Primary colors (brand)
74
+ - Secondary colors
75
+ - Neutral/gray scale (should be 8-12 shades)
76
+ - Semantic colors (success, warning, error, info)
77
+ - Accent colors
78
+
79
+ 2. TYPOGRAPHY SCALE
80
+ - Font families (sans, serif, mono)
81
+ - Heading sizes (H1-H6)
82
+ - Body text sizes (xs, sm, base, lg, xl)
83
+ - Font weights used
84
+ - Line heights
85
+
86
+ 3. SPACING PATTERNS
87
+ - Base unit (typically 4px or 8px)
88
+ - Common padding values
89
+ - Common margin values
90
+ - Gap patterns
91
+
92
+ 4. BORDER & SHADOW
93
+ - Border radius values
94
+ - Border widths
95
+ - Shadow definitions
96
+
97
+ 5. COMPONENT VARIANTS
98
+ - Button styles (primary, secondary, outline, ghost)
99
+ - Input field styles
100
+ - Card variations
101
+ ```
102
+
103
+ ### For Codebase
104
+
105
+ Search for hardcoded values using ast-grep and grep:
106
+
107
+ ```bash
108
+ # Hardcoded colors
109
+ ast-grep pattern='color: "#$HEX"'
110
+ ast-grep pattern='background: "#$HEX"'
111
+ grep '#[0-9a-fA-F]{3,8}' --include="*.{css,scss,tsx,jsx}"
112
+ grep 'rgb\(' --include="*.{css,scss,tsx,jsx}"
113
+ grep 'hsl\(' --include="*.{css,scss,tsx,jsx}"
114
+
115
+ # Hardcoded spacing
116
+ grep '[0-9]+px' --include="*.{css,scss,tsx,jsx}"
117
+ grep '[0-9]+rem' --include="*.{css,scss,tsx,jsx}"
118
+
119
+ # Hardcoded typography
120
+ grep 'font-size:' --include="*.css"
121
+ grep 'fontSize:' --include="*.{tsx,jsx}"
122
+
123
+ # Magic numbers in Tailwind classes
124
+ ast-grep pattern='className="$$$"' # then analyze for arbitrary values like [16px]
125
+ ```
126
+
127
+ **Read and analyze token files:**
128
+
129
+ ```
130
+ read tailwind.config.js → extract theme.extend
131
+ read globals.css → extract :root CSS variables
132
+ read tokens.json → parse token structure
133
+ ```
134
+
135
+ ---
136
+
137
+ ## Phase 4: Consistency Analysis
138
+
139
+ Compare findings and identify issues:
140
+
141
+ ### Consistency Score Calculation
142
+
143
+ ```
144
+ Score = 100 - (penalties)
145
+
146
+ Penalties:
147
+ - Each one-off color: -2 points (max -20)
148
+ - Each duplicate/similar color (ΔE < 5): -1 point (max -10)
149
+ - Missing semantic token: -3 points (max -15)
150
+ - Inconsistent spacing (not on base grid): -1 point (max -10)
151
+ - Typography not in scale: -2 points (max -10)
152
+ - Hardcoded values in components: -1 point per 5 instances (max -15)
153
+ - No dark mode support: -10 points
154
+ - Missing focus states: -10 points
155
+
156
+ Score interpretation:
157
+ 90-100: Excellent - Well-maintained design system
158
+ 70-89: Good - Minor inconsistencies
159
+ 50-69: Fair - Needs attention
160
+ <50: Poor - Significant design debt
161
+ ```
162
+
163
+ ### Issue Categories
164
+
165
+ | Category | Check For |
166
+ | --------------------- | --------------------------------------------- |
167
+ | **Duplicates** | Colors within ΔE < 5, similar spacing values |
168
+ | **One-offs** | Values used only once, not in token file |
169
+ | **Missing Semantics** | Using primitives where semantic tokens needed |
170
+ | **Hardcoded** | Values in components instead of tokens |
171
+ | **Naming** | Inconsistent naming conventions |
172
+ | **Accessibility** | Contrast ratios, focus states |
173
+
174
+ ---
175
+
176
+ ## Phase 5: Theme Analysis
177
+
178
+ ### Light/Dark Mode Coverage
179
+
180
+ | Token | Light Value | Dark Value | Status |
181
+ | ------------ | ----------- | ---------- | ------- |
182
+ | --background | #FFFFFF | #0A0A0A | Covered |
183
+ | --foreground | #0A0A0A | #FAFAFA | Covered |
184
+ | --primary | #0066CC | #3B82F6 | Covered |
185
+ | --muted | #F3F4F6 | ??? | MISSING |
186
+
187
+ ### Semantic Token Completeness
188
+
189
+ ```markdown
190
+ ## Required Semantic Tokens
191
+
192
+ ### Colors
193
+
194
+ - [x] background (default, muted, subtle)
195
+ - [x] foreground (default, muted, subtle)
196
+ - [x] primary (default, hover, active)
197
+ - [x] secondary
198
+ - [ ] accent (MISSING)
199
+ - [x] destructive/error
200
+ - [x] success
201
+ - [ ] warning (MISSING)
202
+ - [x] border
203
+ - [x] ring/focus
204
+
205
+ ### Typography
206
+
207
+ - [x] font-sans
208
+ - [x] font-mono
209
+ - [ ] font-serif (optional)
210
+
211
+ ### Spacing
212
+
213
+ - [x] Base unit defined
214
+ - [x] Scale follows pattern (4, 8, 12, 16, 24, 32, 48, 64)
215
+
216
+ ### Borders
217
+
218
+ - [x] radius scale (sm, md, lg, full)
219
+ - [x] border-width (default)
220
+ ```
36
221
 
37
- ## For Codebase
222
+ ---
223
+
224
+ ## Phase 6: Audit Report Output
225
+
226
+ ### Summary Dashboard
227
+
228
+ | Metric | Value | Target | Status |
229
+ | --------------------- | ---------- | ------ | ------ |
230
+ | Unique colors | 47 | < 30 | Over |
231
+ | Color duplicates | 8 | 0 | Issue |
232
+ | Spacing values | 12 | 8-12 | OK |
233
+ | Typography variants | 9 | 6-10 | OK |
234
+ | One-off values | 23 | 0 | Issue |
235
+ | Dark mode coverage | 85% | 100% | Issue |
236
+ | **Consistency Score** | **72/100** | > 80 | Fair |
237
+
238
+ ### Findings by Category
239
+
240
+ #### Colors (High Priority)
241
+
242
+ | Severity | Issue | Location | Recommendation |
243
+ | -------- | --------------------- | ---------- | ------------------------------ |
244
+ | Critical | 8 duplicate blues | Various | Consolidate to --primary scale |
245
+ | Warning | 15 one-off grays | Components | Create --gray scale |
246
+ | Info | No semantic "warning" | Theme | Add --warning token |
247
+
248
+ #### Typography (Medium Priority)
249
+
250
+ | Severity | Issue | Location | Recommendation |
251
+ | -------- | ------------------------ | ------------------- | ----------------------- |
252
+ | Warning | 3 undefined sizes | Card.tsx, Modal.tsx | Add to typography scale |
253
+ | Info | Inconsistent line-height | Body text | Standardize to 1.5 |
254
+
255
+ #### Spacing (Low Priority)
256
+
257
+ | Severity | Issue | Location | Recommendation |
258
+ | -------- | -------------------- | ---------------- | -------------------- |
259
+ | Info | 5 values not on grid | Padding in cards | Round to nearest 4px |
260
+
261
+ ### Priority Actions
262
+
263
+ #### High Priority (Fix This Week)
264
+
265
+ 1. Consolidate 8 duplicate blue colors → single `--primary` scale
266
+ 2. Add dark mode values for 5 missing tokens
267
+ 3. Create `--warning` semantic token
268
+
269
+ #### Medium Priority (Fix This Sprint)
270
+
271
+ 1. Replace 15 one-off grays with `--gray` scale
272
+ 2. Add missing typography sizes to scale
273
+
274
+ #### Low Priority (Design Debt)
275
+
276
+ 1. Round spacing values to base-4 grid
277
+ 2. Document token naming conventions
278
+
279
+ ---
280
+
281
+ ## Phase 7: Token Export
282
+
283
+ ### Design Tokens JSON
284
+
285
+ ```json
286
+ {
287
+ "color": {
288
+ "primitive": {
289
+ "blue": {
290
+ "50": "#EFF6FF",
291
+ "100": "#DBEAFE",
292
+ "200": "#BFDBFE",
293
+ "300": "#93C5FD",
294
+ "400": "#60A5FA",
295
+ "500": "#3B82F6",
296
+ "600": "#2563EB",
297
+ "700": "#1D4ED8",
298
+ "800": "#1E40AF",
299
+ "900": "#1E3A8A"
300
+ },
301
+ "gray": {
302
+ "50": "#F9FAFB",
303
+ "100": "#F3F4F6",
304
+ "200": "#E5E7EB",
305
+ "300": "#D1D5DB",
306
+ "400": "#9CA3AF",
307
+ "500": "#6B7280",
308
+ "600": "#4B5563",
309
+ "700": "#374151",
310
+ "800": "#1F2937",
311
+ "900": "#111827"
312
+ }
313
+ },
314
+ "semantic": {
315
+ "background": {
316
+ "DEFAULT": "{color.primitive.white}",
317
+ "muted": "{color.primitive.gray.100}"
318
+ },
319
+ "foreground": {
320
+ "DEFAULT": "{color.primitive.gray.900}",
321
+ "muted": "{color.primitive.gray.500}"
322
+ },
323
+ "primary": {
324
+ "DEFAULT": "{color.primitive.blue.600}",
325
+ "hover": "{color.primitive.blue.700}"
326
+ },
327
+ "destructive": { "DEFAULT": "#EF4444", "hover": "#DC2626" },
328
+ "success": { "DEFAULT": "#10B981", "hover": "#059669" },
329
+ "warning": { "DEFAULT": "#F59E0B", "hover": "#D97706" },
330
+ "border": "{color.primitive.gray.200}",
331
+ "ring": "{color.primitive.blue.500}"
332
+ }
333
+ },
334
+ "spacing": {
335
+ "0": "0",
336
+ "1": "0.25rem",
337
+ "2": "0.5rem",
338
+ "3": "0.75rem",
339
+ "4": "1rem",
340
+ "5": "1.25rem",
341
+ "6": "1.5rem",
342
+ "8": "2rem",
343
+ "10": "2.5rem",
344
+ "12": "3rem",
345
+ "16": "4rem",
346
+ "20": "5rem"
347
+ },
348
+ "typography": {
349
+ "fontFamily": {
350
+ "sans": "Inter, system-ui, sans-serif",
351
+ "mono": "JetBrains Mono, monospace"
352
+ },
353
+ "fontSize": {
354
+ "xs": ["0.75rem", { "lineHeight": "1rem" }],
355
+ "sm": ["0.875rem", { "lineHeight": "1.25rem" }],
356
+ "base": ["1rem", { "lineHeight": "1.5rem" }],
357
+ "lg": ["1.125rem", { "lineHeight": "1.75rem" }],
358
+ "xl": ["1.25rem", { "lineHeight": "1.75rem" }],
359
+ "2xl": ["1.5rem", { "lineHeight": "2rem" }],
360
+ "3xl": ["1.875rem", { "lineHeight": "2.25rem" }],
361
+ "4xl": ["2.25rem", { "lineHeight": "2.5rem" }]
362
+ }
363
+ },
364
+ "borderRadius": {
365
+ "none": "0",
366
+ "sm": "0.125rem",
367
+ "DEFAULT": "0.25rem",
368
+ "md": "0.375rem",
369
+ "lg": "0.5rem",
370
+ "xl": "0.75rem",
371
+ "2xl": "1rem",
372
+ "full": "9999px"
373
+ },
374
+ "shadow": {
375
+ "sm": "0 1px 2px 0 rgb(0 0 0 / 0.05)",
376
+ "DEFAULT": "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
377
+ "md": "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
378
+ "lg": "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)"
379
+ }
380
+ }
381
+ ```
382
+
383
+ ### CSS Variables Output
384
+
385
+ ```css
386
+ :root {
387
+ /* Primitives */
388
+ --color-blue-500: #3b82f6;
389
+ --color-blue-600: #2563eb;
390
+ --color-gray-100: #f3f4f6;
391
+ --color-gray-900: #111827;
392
+
393
+ /* Semantics */
394
+ --background: #ffffff;
395
+ --foreground: #111827;
396
+ --primary: #2563eb;
397
+ --primary-hover: #1d4ed8;
398
+ --muted: #f3f4f6;
399
+ --muted-foreground: #6b7280;
400
+ --border: #e5e7eb;
401
+ --ring: #3b82f6;
38
402
 
39
- Search for:
403
+ /* Typography */
404
+ --font-sans: Inter, system-ui, sans-serif;
405
+ --font-mono: JetBrains Mono, monospace;
40
406
 
41
- - Hardcoded colors and values
42
- - Tailwind config
43
- - CSS custom properties
44
- - Design token files
407
+ /* Spacing */
408
+ --space-1: 0.25rem;
409
+ --space-2: 0.5rem;
410
+ --space-4: 1rem;
411
+ --space-6: 1.5rem;
412
+ --space-8: 2rem;
45
413
 
46
- ## Output
414
+ /* Radius */
415
+ --radius-sm: 0.125rem;
416
+ --radius-md: 0.375rem;
417
+ --radius-lg: 0.5rem;
418
+ }
419
+
420
+ .dark {
421
+ --background: #0a0a0a;
422
+ --foreground: #fafafa;
423
+ --muted: #262626;
424
+ --muted-foreground: #a3a3a3;
425
+ --border: #262626;
426
+ }
427
+ ```
428
+
429
+ ---
430
+
431
+ ## Phase 8: Create Tracking Issues
432
+
433
+ For high-priority findings:
434
+
435
+ ```
436
+ bd_add({
437
+ title: "[Design] Consolidate duplicate blue colors",
438
+ desc: "8 similar blue values found. Consolidate to --primary scale.\nLocations: Button.tsx, Link.tsx, Card.tsx",
439
+ type: "task",
440
+ pri: 1,
441
+ tags: ["design-system", "cleanup"]
442
+ })
443
+
444
+ bd_add({
445
+ title: "[Design] Add missing dark mode tokens",
446
+ desc: "5 tokens missing dark mode values: --muted, --accent, --warning, --card, --popover",
447
+ type: "task",
448
+ pri: 1,
449
+ tags: ["design-system", "dark-mode"]
450
+ })
451
+ ```
452
+
453
+ ---
454
+
455
+ ## Storage
456
+
457
+ Save outputs to:
458
+
459
+ - **Tokens**: `.opencode/memory/design/tokens/[project]-tokens.json`
460
+ - **Report**: `.opencode/memory/design/audits/[date]-audit.md`
461
+ - **CSS**: `.opencode/memory/design/tokens/[project]-variables.css`
462
+
463
+ ---
464
+
465
+ ## Examples
466
+
467
+ ```bash
468
+ # Audit from screenshots
469
+ /design-audit designs/screens/ --deep
470
+
471
+ # Audit codebase only
472
+ /design-audit codebase tokens
473
+
474
+ # Full audit with comparison
475
+ /design-audit both report --deep
476
+
477
+ # Quick consistency check
478
+ /design-audit codebase --quick
479
+ ```
480
+
481
+ ---
482
+
483
+ ## Follow-up Commands
484
+
485
+ | Finding | Command |
486
+ | ------------------------ | -------------------------------------------- |
487
+ | Need to implement tokens | `/design src/styles/tokens.css` |
488
+ | Fix specific component | `/fix-ui src/components/Button.tsx` |
489
+ | Accessibility issues | `/accessibility-check` |
490
+ | Compare to mockup | `/analyze-mockup designs/spec.png --compare` |
491
+
492
+ ---
47
493
 
48
- Provide design tokens JSON and/or audit report with:
494
+ ## Related Skills
49
495
 
50
- - Executive summary with metrics
51
- - Findings by category
52
- - Prioritized recommendations
53
- - Consistency score
496
+ | Need | Skill |
497
+ | ---------------------- | --------------------- |
498
+ | Aesthetic improvements | `frontend-aesthetics` |
499
+ | Implement from mockup | `mockup-to-code` |
500
+ | Accessibility audit | `accessibility-audit` |
501
+ | Visual analysis | `visual-analysis` |