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