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,55 +1,465 @@
1
1
  ---
2
- description: Research UI/UX patterns across codebase or topic
3
- argument-hint: "<topic-or-path> [bead-id]"
2
+ description: Research UI/UX patterns, design systems, and component implementations
3
+ argument-hint: "<topic-or-path> [bead-id] [--audit] [--compare]"
4
4
  agent: vision
5
5
  model: proxypal/gemini-3-flash-preview
6
6
  ---
7
7
 
8
8
  # Research UI: $ARGUMENTS
9
9
 
10
- skill({ name: "ui-ux-research" })
10
+ Comprehensive UI/UX research across codebase patterns, design systems, and external best practices.
11
11
 
12
- Research UI/UX patterns, implementations, or design topics.
12
+ ## Load Research Skill
13
13
 
14
- ## Instructions
14
+ ```typescript
15
+ skill({ name: "ui-ux-research" });
16
+ ```
15
17
 
16
- Parse research topic/path and optional bead ID from `$ARGUMENTS`.
18
+ ## Phase 1: Parse Research Target
17
19
 
18
- ## Research Approach
20
+ ### Input Types
19
21
 
20
- For **codebase paths**:
22
+ ```typescript
23
+ const input = "$ARGUMENTS";
21
24
 
22
- - Scan component and style directories
23
- - Identify current patterns and implementations
24
- - Assess consistency across files
25
- - Find improvement opportunities
25
+ const parseTarget = (input: string) => {
26
+ // File/directory path
27
+ if (input.includes("/") || input.startsWith("src")) {
28
+ return { type: "codebase", path: input };
29
+ }
26
30
 
27
- For **topics**:
31
+ // Bead reference
32
+ if (input.startsWith("bd-")) {
33
+ return { type: "bead", id: input };
34
+ }
28
35
 
29
- - Research best practices
30
- - Find relevant examples
31
- - Compare approaches
32
- - Recommend implementation
36
+ // Topic keywords
37
+ const topics = [
38
+ "design-system",
39
+ "components",
40
+ "typography",
41
+ "colors",
42
+ "spacing",
43
+ "animations",
44
+ "accessibility",
45
+ "responsive",
46
+ "dark-mode",
47
+ "forms",
48
+ "tables",
49
+ "navigation",
50
+ "modals",
51
+ ];
33
52
 
34
- ## Common Topics
53
+ if (topics.some((t) => input.includes(t))) {
54
+ return { type: "topic", name: input };
55
+ }
35
56
 
36
- - Design system consistency
37
- - Component inventory
38
- - Typography usage
39
- - Color token patterns
40
- - Animation/motion usage
41
- - Responsive patterns
42
- - Accessibility compliance
57
+ // Default: treat as general topic
58
+ return { type: "topic", name: input };
59
+ };
60
+ ```
43
61
 
44
- ## Output
62
+ ## Phase 2: Codebase UI Analysis
45
63
 
46
- Provide:
64
+ ### If Path Provided
47
65
 
48
- 1. Research summary
49
- 2. Key findings
50
- 3. Specific recommendations
51
- 4. Code examples where helpful
52
- 5. Next steps
66
+ ```typescript
67
+ // Find all UI-related files in path
68
+ glob({ pattern: `${path}/**/*.{tsx,jsx,css,scss,vue,svelte}` });
53
69
 
54
- If bead ID provided, save findings to bead artifacts.
55
- Otherwise, save to `.opencode/memory/design/research/`.
70
+ // Analyze component structure
71
+ lsp_document_symbols({ filePath: mainComponentFile });
72
+
73
+ // Search for styling patterns
74
+ ast_grep({ pattern: "className={$$$}", path });
75
+ ast_grep({ pattern: "style={{$$$}}", path });
76
+ ```
77
+
78
+ ### Component Inventory
79
+
80
+ ```
81
+ COMPONENT INVENTORY: [path]
82
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━
83
+
84
+ Components Found: [count]
85
+
86
+ Component │ Props │ Variants │ Tests │ Docs
87
+ ───────────────────┼───────┼──────────┼───────┼──────
88
+ Button │ 8 │ 4 │ ✓ │ ✓
89
+ Card │ 5 │ 2 │ ✓ │ ✗
90
+ Modal │ 12 │ 3 │ ✗ │ ✗
91
+ Input │ 15 │ 5 │ ✓ │ ✓
92
+
93
+ Patterns Detected:
94
+ - Styling: [Tailwind/CSS Modules/Styled Components/etc.]
95
+ - Variants: [CVA/clsx/manual classes]
96
+ - Icons: [Lucide/Heroicons/custom]
97
+ - Animations: [Framer Motion/CSS/none]
98
+ ```
99
+
100
+ ### Design Token Analysis
101
+
102
+ ```typescript
103
+ // Find design tokens
104
+ grep({ pattern: "colors\\.|spacing\\.|fontSize", include: "*.{ts,js,css}" });
105
+
106
+ // Check for Tailwind config
107
+ read({ filePath: "tailwind.config.js" });
108
+ read({ filePath: "tailwind.config.ts" });
109
+
110
+ // Check for CSS variables
111
+ grep({ pattern: "--[a-z]+-", include: "*.css" });
112
+ ```
113
+
114
+ ```
115
+ DESIGN TOKENS
116
+ ━━━━━━━━━━━━━
117
+
118
+ Source: [tailwind.config.ts / CSS variables / theme.ts]
119
+
120
+ Colors:
121
+ ├── Primary: #3B82F6 (blue-500)
122
+ ├── Secondary: #6B7280 (gray-500)
123
+ ├── Accent: #10B981 (emerald-500)
124
+ ├── Error: #EF4444 (red-500)
125
+ └── Background: #FFFFFF / #0F172A (dark)
126
+
127
+ Spacing Scale:
128
+ ├── xs: 4px (0.25rem)
129
+ ├── sm: 8px (0.5rem)
130
+ ├── md: 16px (1rem)
131
+ ├── lg: 24px (1.5rem)
132
+ └── xl: 32px (2rem)
133
+
134
+ Typography:
135
+ ├── Font: Inter, system-ui
136
+ ├── Sizes: 12px - 48px (7 steps)
137
+ └── Weights: 400, 500, 600, 700
138
+
139
+ Breakpoints:
140
+ ├── sm: 640px
141
+ ├── md: 768px
142
+ ├── lg: 1024px
143
+ └── xl: 1280px
144
+ ```
145
+
146
+ ## Phase 3: Topic-Based Research
147
+
148
+ ### Design System Topics
149
+
150
+ | Topic | Research Focus |
151
+ | --------------- | -------------------------------------------------------- |
152
+ | `design-system` | Overall architecture, token structure, component library |
153
+ | `components` | Component inventory, prop patterns, composition |
154
+ | `typography` | Font stacks, scale, line heights, responsive sizing |
155
+ | `colors` | Palette, semantic colors, dark mode support |
156
+ | `spacing` | Scale consistency, component spacing patterns |
157
+ | `animations` | Motion patterns, timing, accessibility concerns |
158
+ | `accessibility` | ARIA usage, keyboard nav, color contrast |
159
+ | `responsive` | Breakpoints, mobile-first patterns, fluid sizing |
160
+ | `dark-mode` | Color inversion, theme switching, persistence |
161
+ | `forms` | Input patterns, validation, error states |
162
+ | `tables` | Data display, sorting, pagination, responsive |
163
+ | `navigation` | Menu patterns, routing, breadcrumbs, mobile nav |
164
+ | `modals` | Dialog patterns, focus trap, animations, stacking |
165
+
166
+ ### Research Approach by Topic
167
+
168
+ ```typescript
169
+ const researchApproach = {
170
+ "design-system": async () => {
171
+ // Find theme/config files
172
+ glob({ pattern: "**/theme.{ts,js}" });
173
+ glob({ pattern: "**/design-tokens.{ts,js}" });
174
+ glob({ pattern: "**/tailwind.config.*" });
175
+
176
+ // Analyze token usage
177
+ grep({ pattern: "theme\\.", include: "*.tsx" });
178
+ },
179
+
180
+ accessibility: async () => {
181
+ // Find ARIA usage
182
+ grep({ pattern: "aria-", include: "*.tsx" });
183
+ grep({ pattern: "role=", include: "*.tsx" });
184
+
185
+ // Check for focus management
186
+ grep({ pattern: "tabIndex|focus\\(\\)", include: "*.tsx" });
187
+
188
+ // Run accessibility skill
189
+ skill({ name: "accessibility-audit" });
190
+ },
191
+
192
+ "dark-mode": async () => {
193
+ // Find dark mode patterns
194
+ grep({ pattern: "dark:|dark-mode|isDark", include: "*.{tsx,css}" });
195
+
196
+ // Check for theme context
197
+ grep({ pattern: "ThemeProvider|useTheme", include: "*.tsx" });
198
+ },
199
+ };
200
+ ```
201
+
202
+ ## Phase 4: External Research
203
+
204
+ ### Best Practices Lookup
205
+
206
+ ```typescript
207
+ // Design system documentation
208
+ context7_resolve_library_id({
209
+ libraryName: "shadcn/ui",
210
+ query: "[specific UI pattern]",
211
+ });
212
+
213
+ // Real-world implementations
214
+ gh_grep_searchGitHub({
215
+ query: "[pattern to find]",
216
+ language: ["TypeScript", "TSX"],
217
+ path: "components/",
218
+ });
219
+ ```
220
+
221
+ ### Research Sources
222
+
223
+ ```
224
+ EXTERNAL SOURCES
225
+ ━━━━━━━━━━━━━━━━
226
+
227
+ 1. Component Libraries
228
+ - shadcn/ui (Radix-based, Tailwind)
229
+ - Chakra UI (accessible, themeable)
230
+ - Material UI (design system)
231
+ - Ant Design (enterprise)
232
+
233
+ 2. Design Systems
234
+ - Tailwind CSS (utility-first)
235
+ - Open Props (CSS custom properties)
236
+ - Radix Primitives (unstyled, accessible)
237
+
238
+ 3. Pattern Libraries
239
+ - Patterns.dev (React patterns)
240
+ - Component Gallery (real implementations)
241
+ - Storybook showcase
242
+ ```
243
+
244
+ ## Phase 5: Comparison Mode (--compare)
245
+
246
+ Compare two UI implementations:
247
+
248
+ ```bash
249
+ /research-ui src/components/Button --compare packages/ui/Button
250
+ ```
251
+
252
+ ```
253
+ COMPARISON: Button Components
254
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
255
+
256
+ │ src/components │ packages/ui
257
+ ────────────────────┼────────────────┼─────────────
258
+ Props │ 8 │ 12
259
+ Variants │ 4 │ 6
260
+ Accessibility │ Partial │ Full
261
+ Dark Mode │ ✗ │ ✓
262
+ Animation │ CSS │ Framer Motion
263
+ Bundle Size │ 2.1kb │ 3.4kb
264
+ Test Coverage │ 45% │ 92%
265
+
266
+ Key Differences:
267
+ 1. packages/ui has better a11y (full ARIA support)
268
+ 2. packages/ui supports more variants
269
+ 3. src/components is lighter but less complete
270
+
271
+ Recommendation:
272
+ Consider migrating to packages/ui for consistency,
273
+ or backport a11y patterns to src/components.
274
+ ```
275
+
276
+ ## Phase 6: Audit Mode (--audit)
277
+
278
+ Comprehensive UI audit:
279
+
280
+ ```bash
281
+ /research-ui --audit
282
+ ```
283
+
284
+ ```
285
+ UI AUDIT REPORT
286
+ ━━━━━━━━━━━━━━━
287
+
288
+ CONSISTENCY SCORE: 72/100
289
+
290
+ Issues Found:
291
+
292
+ 🔴 CRITICAL (3)
293
+ ├── Hardcoded colors in 12 files (bypassing theme)
294
+ ├── Missing dark mode support in Modal component
295
+ └── No focus indicators on custom buttons
296
+
297
+ 🟡 WARNING (7)
298
+ ├── Inconsistent spacing: mix of px and rem
299
+ ├── Typography: 3 different font stacks detected
300
+ ├── Z-index: no consistent scale (values: 1-9999)
301
+ ├── Animation timing varies (0.2s to 0.5s)
302
+ ├── Border radius: 4 values used (2px, 4px, 8px, 12px)
303
+ ├── Icon sizes not standardized
304
+ └── Form inputs have different heights
305
+
306
+ 🟢 GOOD PRACTICES (5)
307
+ ├── Consistent primary color usage
308
+ ├── Semantic color naming
309
+ ├── Responsive breakpoints aligned
310
+ ├── Component folder structure
311
+ └── Prop naming conventions
312
+
313
+ RECOMMENDATIONS:
314
+ 1. Create border-radius scale: sm, md, lg
315
+ 2. Standardize animation timing: fast(150ms), normal(250ms), slow(400ms)
316
+ 3. Add dark mode to remaining 8 components
317
+ 4. Create z-index scale in theme config
318
+ ```
319
+
320
+ ## Phase 7: Generate Research Report
321
+
322
+ ### Report Structure
323
+
324
+ ```markdown
325
+ # UI Research: $ARGUMENTS
326
+
327
+ ## Executive Summary
328
+
329
+ [1-2 sentence overview]
330
+
331
+ ## Current State
332
+
333
+ ### Component Analysis
334
+
335
+ [What exists, patterns used]
336
+
337
+ ### Design Token Status
338
+
339
+ [Token coverage, consistency]
340
+
341
+ ### Gaps Identified
342
+
343
+ [Missing pieces, inconsistencies]
344
+
345
+ ## Research Findings
346
+
347
+ ### Codebase Patterns
348
+
349
+ [What was discovered in the code]
350
+
351
+ ### External Best Practices
352
+
353
+ [What industry does]
354
+
355
+ ### Recommendations
356
+
357
+ [Actionable suggestions]
358
+
359
+ ## Implementation Guidance
360
+
361
+ ### Quick Wins
362
+
363
+ - [Low effort, high impact changes]
364
+
365
+ ### Medium Term
366
+
367
+ - [Larger improvements]
368
+
369
+ ### Long Term
370
+
371
+ - [Architectural changes]
372
+
373
+ ## Code Examples
374
+
375
+ ### Pattern to Adopt
376
+
377
+ \`\`\`tsx
378
+ // Recommended pattern based on research
379
+ \`\`\`
380
+
381
+ ### Anti-Pattern to Avoid
382
+
383
+ \`\`\`tsx
384
+ // Pattern found in codebase that should be refactored
385
+ \`\`\`
386
+
387
+ ## Next Steps
388
+
389
+ 1. [Immediate action]
390
+ 2. [Follow-up task]
391
+ 3. [Future consideration]
392
+ ```
393
+
394
+ ### Save Research
395
+
396
+ ```typescript
397
+ if (beadId) {
398
+ // Save to bead artifacts
399
+ write({
400
+ filePath: `.beads/artifacts/${beadId}/ui-research.md`,
401
+ content: researchReport,
402
+ });
403
+ } else {
404
+ // Save to memory
405
+ write({
406
+ filePath: `.opencode/memory/design/research/${topic}-${timestamp}.md`,
407
+ content: researchReport,
408
+ });
409
+ }
410
+ ```
411
+
412
+ ## Examples
413
+
414
+ ```bash
415
+ /research-ui src/components # Analyze component directory
416
+ /research-ui typography # Research typography patterns
417
+ /research-ui dark-mode bd-theme01 # Research for specific bead
418
+ /research-ui --audit # Full UI consistency audit
419
+ /research-ui Button --compare # Compare implementations
420
+ /research-ui forms accessibility # Focused topic research
421
+ ```
422
+
423
+ ## Integration
424
+
425
+ After research, common next steps:
426
+
427
+ ```
428
+ NEXT STEPS
429
+ ━━━━━━━━━━
430
+
431
+ Based on your research, consider:
432
+
433
+ /design-audit # Formal audit with scoring
434
+ /accessibility-check # A11y focused review
435
+ /implement bd-xxx # Implement findings
436
+ /plan bd-xxx # Create implementation plan
437
+
438
+ Or create new tasks:
439
+ /create "Fix typography inconsistencies"
440
+ /create "Add dark mode to Modal component"
441
+ ```
442
+
443
+ ## Output Formats
444
+
445
+ ### Concise (default)
446
+
447
+ Key findings + recommendations in ~50 lines
448
+
449
+ ### Detailed (--verbose)
450
+
451
+ Full analysis with all code examples
452
+
453
+ ### JSON (--json)
454
+
455
+ Structured output for tooling:
456
+
457
+ ```json
458
+ {
459
+ "topic": "design-system",
460
+ "components": [],
461
+ "tokens": {},
462
+ "issues": [],
463
+ "recommendations": []
464
+ }
465
+ ```