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,43 +1,435 @@
1
1
  ---
2
- description: Analyze UI mockup or screenshot
3
- argument-hint: "<image-path> [focus: layout|colors|components|all]"
2
+ description: Analyze UI mockup or screenshot with structured output
3
+ argument-hint: "<image-path> [focus: layout|colors|components|typography|a11y|all] [--quick|--deep] [--compare <file>]"
4
4
  agent: vision
5
5
  model: proxypal/gemini-3-flash-preview
6
6
  ---
7
7
 
8
8
  # Analyze Mockup: $ARGUMENTS
9
9
 
10
+ ## Load Beads Skill
11
+
12
+ ```typescript
13
+ skill({ name: "beads" });
14
+ ```
15
+
16
+ ## Phase 1: Parse Arguments
17
+
18
+ Extract from `$ARGUMENTS`:
19
+
20
+ | Argument | Default | Options |
21
+ | ---------- | -------- | ------------------------------------------------------------- |
22
+ | Image path | required | File path or URL |
23
+ | Focus | `all` | `layout`, `colors`, `components`, `typography`, `a11y`, `all` |
24
+ | Depth | `--deep` | `--quick` (2-3 min), `--deep` (10-15 min) |
25
+ | Compare | none | `--compare <existing-file.tsx>` for diff analysis |
26
+
27
+ Load the image and determine analysis scope.
28
+
29
+ ## Phase 2: Structured Analysis
30
+
10
31
  skill({ name: "visual-analysis" })
11
32
 
12
- Analyze the provided UI mockup or screenshot.
33
+ Run analysis based on focus area. Each section has specific output format.
34
+
35
+ ---
36
+
37
+ ### Colors Analysis
38
+
39
+ **Extract:**
40
+
41
+ ```json
42
+ {
43
+ "primary": {
44
+ "hex": "#0066CC",
45
+ "usage": "buttons, links",
46
+ "percentage": "15%"
47
+ },
48
+ "secondary": {
49
+ "hex": "#6B7280",
50
+ "usage": "text, borders",
51
+ "percentage": "25%"
52
+ },
53
+ "background": {
54
+ "hex": "#FFFFFF",
55
+ "usage": "page background",
56
+ "percentage": "50%"
57
+ },
58
+ "accent": { "hex": "#10B981", "usage": "success states", "percentage": "5%" },
59
+ "error": { "hex": "#EF4444", "usage": "error states", "percentage": "2%" },
60
+ "neutral": ["#F3F4F6", "#E5E7EB", "#D1D5DB", "#9CA3AF"]
61
+ }
62
+ ```
63
+
64
+ **Accessibility Check:**
65
+ | Combination | Contrast Ratio | WCAG AA | WCAG AAA |
66
+ |-------------|----------------|---------|----------|
67
+ | primary on background | 4.5:1 | Pass | Fail |
68
+ | text on background | 7.2:1 | Pass | Pass |
69
+
70
+ **CSS Output:**
71
+
72
+ ```css
73
+ :root {
74
+ --color-primary: #0066cc;
75
+ --color-primary-hover: #0052a3;
76
+ --color-secondary: #6b7280;
77
+ --color-background: #ffffff;
78
+ --color-surface: #f3f4f6;
79
+ --color-accent: #10b981;
80
+ --color-error: #ef4444;
81
+ }
82
+ ```
83
+
84
+ **Tailwind Output:**
85
+
86
+ ```js
87
+ // tailwind.config.js
88
+ colors: {
89
+ primary: { DEFAULT: '#0066CC', hover: '#0052A3' },
90
+ secondary: '#6B7280',
91
+ accent: '#10B981',
92
+ error: '#EF4444',
93
+ }
94
+ ```
95
+
96
+ ---
97
+
98
+ ### Layout Analysis
99
+
100
+ **Grid System:**
101
+
102
+ - Type: [12-column grid | Flexbox | CSS Grid | Mixed]
103
+ - Container max-width: [e.g., 1280px]
104
+ - Gutters: [e.g., 24px]
105
+ - Margins: [e.g., 16px mobile, 32px desktop]
106
+
107
+ **Section Breakdown:**
13
108
 
14
- ## Instructions
109
+ ```
110
+ ┌─────────────────────────────────────┐
111
+ │ Header (h-16, sticky) │
112
+ ├─────────────────────────────────────┤
113
+ │ Hero (h-96, flex center) │
114
+ ├─────────────────────────────────────┤
115
+ │ Content (grid cols-3, gap-6) │
116
+ │ ┌─────┐ ┌─────┐ ┌─────┐ │
117
+ │ │Card │ │Card │ │Card │ │
118
+ │ └─────┘ └─────┘ └─────┘ │
119
+ ├─────────────────────────────────────┤
120
+ │ Footer (py-8) │
121
+ └─────────────────────────────────────┘
122
+ ```
123
+
124
+ **Responsive Breakpoints:**
125
+ | Breakpoint | Layout Change |
126
+ |------------|---------------|
127
+ | < 640px (sm) | Stack to single column, hide sidebar |
128
+ | < 1024px (lg) | 2-column grid, collapsible nav |
129
+ | >= 1280px (xl) | Full 3-column layout |
130
+
131
+ **CSS Structure:**
132
+
133
+ ```css
134
+ .container {
135
+ max-width: 1280px;
136
+ margin: 0 auto;
137
+ padding: 0 1rem;
138
+ }
139
+ .grid {
140
+ display: grid;
141
+ grid-template-columns: repeat(3, 1fr);
142
+ gap: 1.5rem;
143
+ }
144
+ @media (max-width: 1024px) {
145
+ .grid {
146
+ grid-template-columns: repeat(2, 1fr);
147
+ }
148
+ }
149
+ @media (max-width: 640px) {
150
+ .grid {
151
+ grid-template-columns: 1fr;
152
+ }
153
+ }
154
+ ```
155
+
156
+ ---
15
157
 
16
- Load the image from the path in `$ARGUMENTS`.
158
+ ### Components Analysis
17
159
 
18
- Determine focus area (default: all):
160
+ **Component Inventory:**
19
161
 
20
- - **layout**: Grid, hierarchy, spacing, responsive considerations
21
- - **colors**: Extract palette with hex values, suggest semantic naming
22
- - **components**: Identify UI elements, variants, reusability
23
- - **all**: Comprehensive analysis covering everything
162
+ | Component | Library Match | Variants | Complexity | Priority |
163
+ | --------- | ------------- | --------------------------- | ---------- | -------- |
164
+ | Button | shadcn/Button | primary, secondary, outline | S | High |
165
+ | Card | shadcn/Card | default, hover, selected | M | High |
166
+ | Input | shadcn/Input | default, error, disabled | S | Medium |
167
+ | Modal | Radix Dialog | - | M | Low |
168
+ | Dropdown | shadcn/Select | - | M | Medium |
24
169
 
25
- ## Output Format
170
+ **Component Details (for each):**
26
171
 
27
172
  ```markdown
28
- ## Summary
173
+ ## Component: [Name]
174
+
175
+ **Library:** shadcn/ui, MUI, Radix, custom
176
+ **Variants:** primary | secondary | outline
177
+ **States:** default, hover, focus, active, disabled
178
+ **Props Interface:**
179
+
180
+ - variant: 'primary' | 'secondary' | 'outline'
181
+ - size: 'sm' | 'md' | 'lg'
182
+ - disabled?: boolean
183
+
184
+ **Accessibility:**
185
+
186
+ - Focus ring visible
187
+ - ARIA labels needed
188
+ - Keyboard: Enter/Space to activate
189
+ ```
190
+
191
+ ---
192
+
193
+ ### Typography Analysis
194
+
195
+ **Font Stack:**
196
+
197
+ ```css
198
+ --font-sans: "Inter", system-ui, -apple-system, sans-serif;
199
+ --font-mono: "JetBrains Mono", monospace;
200
+ ```
201
+
202
+ **Type Scale:**
203
+ | Element | Size | Weight | Line Height | Letter Spacing |
204
+ |---------|------|--------|-------------|----------------|
205
+ | h1 | 2.5rem (40px) | 700 | 1.2 | -0.02em |
206
+ | h2 | 2rem (32px) | 600 | 1.25 | -0.01em |
207
+ | h3 | 1.5rem (24px) | 600 | 1.3 | 0 |
208
+ | body | 1rem (16px) | 400 | 1.5 | 0 |
209
+ | small | 0.875rem (14px) | 400 | 1.4 | 0 |
210
+ | caption | 0.75rem (12px) | 500 | 1.3 | 0.02em |
211
+
212
+ **CSS Output:**
213
+
214
+ ```css
215
+ :root {
216
+ --font-size-xs: 0.75rem;
217
+ --font-size-sm: 0.875rem;
218
+ --font-size-base: 1rem;
219
+ --font-size-lg: 1.125rem;
220
+ --font-size-xl: 1.25rem;
221
+ --font-size-2xl: 1.5rem;
222
+ --font-size-3xl: 2rem;
223
+ --font-size-4xl: 2.5rem;
224
+
225
+ --line-height-tight: 1.2;
226
+ --line-height-normal: 1.5;
227
+ --line-height-relaxed: 1.75;
228
+ }
229
+ ```
230
+
231
+ ---
232
+
233
+ ### Accessibility Analysis (a11y)
29
234
 
30
- [1-2 sentence overview]
235
+ **Color Contrast:**
236
+ | Element | Foreground | Background | Ratio | Status |
237
+ |---------|------------|------------|-------|--------|
238
+ | Body text | #1F2937 | #FFFFFF | 14.7:1 | AAA Pass |
239
+ | Link | #0066CC | #FFFFFF | 4.5:1 | AA Pass |
240
+ | Button text | #FFFFFF | #0066CC | 4.5:1 | AA Pass |
241
+ | Muted text | #9CA3AF | #FFFFFF | 2.9:1 | FAIL |
31
242
 
32
- ## Findings
243
+ **Touch Targets:**
33
244
 
34
- [Structured analysis based on focus area]
245
+ - Minimum size check: 44x44px for mobile
246
+ - [ ] Buttons meet minimum
247
+ - [ ] Links have adequate padding
248
+ - [ ] Icons have tap area
35
249
 
36
- ## Implementation Notes
250
+ **Focus States:**
251
+
252
+ - [ ] Visible focus ring on interactive elements
253
+ - [ ] Focus order logical (left-right, top-bottom)
254
+ - [ ] Skip links present (if applicable)
255
+
256
+ **Issues Found:**
257
+ | Severity | Issue | Location | Fix |
258
+ |----------|-------|----------|-----|
259
+ | Critical | Low contrast muted text | Body paragraphs | Change to #6B7280 |
260
+ | Warning | Small touch target | Icon buttons | Add 8px padding |
261
+ | Info | No focus ring | Cards | Add focus-visible ring |
262
+
263
+ ---
264
+
265
+ ## Phase 3: Design Token Export
266
+
267
+ Consolidate all findings into ready-to-use code:
268
+
269
+ **Complete CSS Variables:**
270
+
271
+ ```css
272
+ :root {
273
+ /* Colors */
274
+ --color-primary: #0066cc;
275
+ --color-secondary: #6b7280;
276
+ --color-background: #ffffff;
277
+ --color-surface: #f3f4f6;
278
+ --color-accent: #10b981;
279
+ --color-error: #ef4444;
280
+
281
+ /* Typography */
282
+ --font-sans: "Inter", system-ui, sans-serif;
283
+ --font-size-base: 1rem;
284
+ --line-height-base: 1.5;
285
+
286
+ /* Spacing */
287
+ --space-1: 0.25rem;
288
+ --space-2: 0.5rem;
289
+ --space-4: 1rem;
290
+ --space-6: 1.5rem;
291
+ --space-8: 2rem;
292
+
293
+ /* Borders */
294
+ --radius-sm: 0.25rem;
295
+ --radius-md: 0.5rem;
296
+ --radius-lg: 1rem;
297
+
298
+ /* Shadows */
299
+ --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
300
+ --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
301
+ }
302
+ ```
303
+
304
+ **Tailwind Config Extension:**
305
+
306
+ ```js
307
+ // tailwind.config.js
308
+ module.exports = {
309
+ theme: {
310
+ extend: {
311
+ colors: {
312
+ /* extracted colors */
313
+ },
314
+ fontFamily: { sans: ["Inter", ...defaultTheme.fontFamily.sans] },
315
+ spacing: {
316
+ /* if custom */
317
+ },
318
+ borderRadius: {
319
+ /* if custom */
320
+ },
321
+ },
322
+ },
323
+ };
324
+ ```
325
+
326
+ ---
327
+
328
+ ## Phase 4: Comparison Mode (if --compare)
329
+
330
+ When `--compare <existing-file>` is provided:
331
+
332
+ skill({ name: "mockup-to-code" })
333
+
334
+ **Diff Analysis:**
335
+ | Aspect | Mockup | Implementation | Delta |
336
+ |--------|--------|----------------|-------|
337
+ | Primary color | #0066CC | #0066CC | Match |
338
+ | Button radius | 8px | 4px | +4px needed |
339
+ | Card shadow | shadow-md | shadow-sm | Increase shadow |
340
+ | Heading size | 40px | 36px | +4px needed |
341
+
342
+ **Priority Fixes:**
343
+
344
+ 1. [High] Button border-radius: change `rounded` to `rounded-lg`
345
+ 2. [Medium] Card shadow: change `shadow-sm` to `shadow-md`
346
+ 3. [Low] Heading font-size: increase from 2.25rem to 2.5rem
347
+
348
+ ---
349
+
350
+ ## Phase 5: Implementation Plan
351
+
352
+ **Component Build Order (dependency-aware):**
353
+
354
+ 1. Design tokens (CSS variables) - no dependencies
355
+ 2. Typography components (Text, Heading) - depends on tokens
356
+ 3. Button - depends on tokens
357
+ 4. Card - depends on tokens
358
+ 5. Form inputs - depends on tokens, Button
359
+ 6. Page layouts - depends on all above
360
+
361
+ **Create Implementation Tasks:**
37
362
 
38
- - Technical considerations
39
- - Component library suggestions
40
- - CSS/Tailwind starting point
41
363
  ```
364
+ bd_add({
365
+ title: "Implement design tokens from mockup",
366
+ desc: "Extract CSS variables for colors, typography, spacing from [mockup]",
367
+ type: "task",
368
+ pri: 1,
369
+ tags: ["frontend", "design-system"]
370
+ })
371
+
372
+ bd_add({
373
+ title: "Implement [ComponentName] component",
374
+ desc: "Build component matching mockup spec. Variants: [...], States: [...]",
375
+ type: "task",
376
+ pri: 2,
377
+ tags: ["frontend", "component"]
378
+ })
379
+ ```
380
+
381
+ **Suggested Follow-up Commands:**
382
+
383
+ - `/design src/styles/tokens.css` - Create token file from extracted values
384
+ - `/implement bd-<token-task>` - Implement the design tokens
385
+ - `/fix-ui src/components/Button.tsx --compare mockup.png` - Fix component to match
386
+
387
+ ---
388
+
389
+ ## Quick Mode (--quick)
390
+
391
+ When `--quick` is specified, output only:
392
+
393
+ 1. **Summary** (2-3 sentences)
394
+ 2. **Color palette** (hex values only, no CSS)
395
+ 3. **Component list** (names and library matches)
396
+ 4. **Top 3 accessibility issues**
397
+ 5. **Suggested next command**
398
+
399
+ Skip: detailed breakdowns, CSS output, typography scale, comparison mode.
400
+
401
+ ---
402
+
403
+ ## Examples
404
+
405
+ ```bash
406
+ # Full analysis of a mockup
407
+ /analyze-mockup designs/homepage.png
408
+
409
+ # Quick color extraction
410
+ /analyze-mockup designs/button.png colors --quick
411
+
412
+ # Deep layout analysis
413
+ /analyze-mockup designs/dashboard.png layout --deep
414
+
415
+ # Compare implementation to mockup
416
+ /analyze-mockup designs/card.png components --compare src/components/Card.tsx
417
+
418
+ # Accessibility audit
419
+ /analyze-mockup designs/form.png a11y
420
+ ```
421
+
422
+ ---
423
+
424
+ ## Output Storage
425
+
426
+ Save analysis to `.opencode/memory/design/analysis/[mockup-name].md` for future reference.
427
+
428
+ ## Related Commands
42
429
 
43
- Suggest follow-up commands if relevant.
430
+ | Need | Command |
431
+ | ---------------------------- | ------------------------- |
432
+ | Implement the design | `/design` or `/implement` |
433
+ | Audit existing design system | `/design-audit` |
434
+ | Fix UI to match mockup | `/fix-ui --compare` |
435
+ | Check accessibility | `/accessibility-check` |