opencodekit 0.10.0 → 0.11.1

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