opencodekit 0.9.2 → 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 (62) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/template/.opencode/AGENTS.md +116 -47
  3. package/dist/template/.opencode/agent/build.md +16 -48
  4. package/dist/template/.opencode/agent/explore.md +13 -34
  5. package/dist/template/.opencode/agent/planner.md +41 -11
  6. package/dist/template/.opencode/agent/review.md +2 -23
  7. package/dist/template/.opencode/agent/rush.md +24 -65
  8. package/dist/template/.opencode/agent/scout.md +5 -21
  9. package/dist/template/.opencode/agent/vision.md +0 -14
  10. package/dist/template/.opencode/command/accessibility-check.md +293 -30
  11. package/dist/template/.opencode/command/analyze-mockup.md +406 -20
  12. package/dist/template/.opencode/command/analyze-project.md +439 -30
  13. package/dist/template/.opencode/command/brainstorm.md +288 -5
  14. package/dist/template/.opencode/command/commit.md +226 -17
  15. package/dist/template/.opencode/command/create.md +138 -35
  16. package/dist/template/.opencode/command/design-audit.md +477 -29
  17. package/dist/template/.opencode/command/design.md +609 -6
  18. package/dist/template/.opencode/command/edit-image.md +223 -20
  19. package/dist/template/.opencode/command/finish.md +162 -71
  20. package/dist/template/.opencode/command/fix-ci.md +296 -24
  21. package/dist/template/.opencode/command/fix-types.md +345 -13
  22. package/dist/template/.opencode/command/fix-ui.md +293 -13
  23. package/dist/template/.opencode/command/fix.md +256 -9
  24. package/dist/template/.opencode/command/generate-diagram.md +327 -26
  25. package/dist/template/.opencode/command/generate-icon.md +266 -22
  26. package/dist/template/.opencode/command/generate-image.md +232 -12
  27. package/dist/template/.opencode/command/generate-pattern.md +234 -20
  28. package/dist/template/.opencode/command/generate-storyboard.md +231 -21
  29. package/dist/template/.opencode/command/handoff.md +202 -30
  30. package/dist/template/.opencode/command/implement.md +162 -50
  31. package/dist/template/.opencode/command/import-plan.md +247 -51
  32. package/dist/template/.opencode/command/init.md +154 -35
  33. package/dist/template/.opencode/command/integration-test.md +405 -24
  34. package/dist/template/.opencode/command/issue.md +171 -21
  35. package/dist/template/.opencode/command/new-feature.md +382 -54
  36. package/dist/template/.opencode/command/plan.md +144 -118
  37. package/dist/template/.opencode/command/pr.md +229 -28
  38. package/dist/template/.opencode/command/quick-build.md +234 -5
  39. package/dist/template/.opencode/command/research-and-implement.md +436 -12
  40. package/dist/template/.opencode/command/research-ui.md +444 -34
  41. package/dist/template/.opencode/command/research.md +173 -45
  42. package/dist/template/.opencode/command/restore-image.md +416 -22
  43. package/dist/template/.opencode/command/resume.md +439 -63
  44. package/dist/template/.opencode/command/revert-feature.md +341 -64
  45. package/dist/template/.opencode/command/review-codebase.md +193 -4
  46. package/dist/template/.opencode/command/skill-create.md +506 -14
  47. package/dist/template/.opencode/command/skill-optimize.md +487 -16
  48. package/dist/template/.opencode/command/status.md +320 -60
  49. package/dist/template/.opencode/command/summarize.md +374 -33
  50. package/dist/template/.opencode/command/triage.md +355 -0
  51. package/dist/template/.opencode/command/ui-review.md +292 -25
  52. package/dist/template/.opencode/plugin/README.md +110 -98
  53. package/dist/template/.opencode/plugin/compactor.ts +95 -171
  54. package/dist/template/.opencode/plugin/enforcer.ts +177 -127
  55. package/dist/template/.opencode/plugin/injector.ts +150 -0
  56. package/dist/template/.opencode/plugin/lib/notify.ts +86 -0
  57. package/dist/template/.opencode/plugin/notification.ts +57 -123
  58. package/dist/template/.opencode/plugin/truncator.ts +60 -166
  59. package/dist/template/.opencode/skill/mqdh/SKILL.md +161 -0
  60. package/dist/template/.opencode/skill/playwriter/SKILL.md +148 -0
  61. package/dist/template/.opencode/skill/v0/SKILL.md +154 -0
  62. package/package.json +1 -1
@@ -0,0 +1,355 @@
1
+ ---
2
+ description: AI-powered task triage, prioritization, and workload analysis
3
+ argument-hint: "[--auto-assign] [--sla] [--bottleneck]"
4
+ agent: build
5
+ ---
6
+
7
+ # Triage
8
+
9
+ Analyze open tasks and optimize prioritization using dependency graph analysis, SLA tracking, and multi-agent coordination.
10
+
11
+ ## Phase 1: Initialize Beads Connection
12
+
13
+ ```typescript
14
+ bd_init({ _: true, team: "project", role: "triage" });
15
+ ```
16
+
17
+ ## Phase 2: Gather Workspace State
18
+
19
+ Run in parallel:
20
+
21
+ ```typescript
22
+ bd_status({ include_agents: true });
23
+ bd_ls({ status: "open", limit: 50, offset: 0 });
24
+ bd_reservations({ reason: "Check active file locks" });
25
+ bd_inbox({ n: 10, unread: true, global: true });
26
+ ```
27
+
28
+ Capture:
29
+
30
+ - Total open tasks
31
+ - In-progress count
32
+ - Active agents
33
+ - File locks
34
+ - Pending messages
35
+
36
+ ## Phase 3: Run Graph Analysis
37
+
38
+ ```typescript
39
+ bd_insights({ reason: "Triage analysis" });
40
+ bd_priority({ limit: 10 });
41
+ bd_plan({ reason: "Parallel execution plan" });
42
+ ```
43
+
44
+ This provides:
45
+
46
+ - **Bottlenecks**: Tasks blocking the most downstream work
47
+ - **Keystones**: High-impact tasks that unlock multiple paths
48
+ - **Cycles**: Circular dependencies (must break)
49
+ - **PageRank**: Importance score based on graph centrality
50
+ - **Parallel Tracks**: Independent work streams
51
+
52
+ ## Phase 4: Priority Classification
53
+
54
+ ### Priority Matrix
55
+
56
+ ```
57
+ ┌─────────────────────────────────────────────────────────────────────────┐
58
+ │ URGENCY │
59
+ │ High Low │
60
+ │ ┌─────────────────────────────┬─────────────────────────────┐ │
61
+ │ │ P0 - CRITICAL │ P1 - HIGH │ High │
62
+ │ │ • Production down │ • Major feature blocked │ │
63
+ │ │ • Security vulnerability │ • Customer escalation │ I │
64
+ │ │ • Data loss risk │ • Sprint commitment │ M │
65
+ │ │ │ │ P │
66
+ │ │ SLA: 4 hours │ SLA: 24 hours │ A │
67
+ │ ├─────────────────────────────┼─────────────────────────────┤ C │
68
+ │ │ P2 - MEDIUM │ P3 - LOW │ T │
69
+ │ │ • Feature enhancement │ • Tech debt │ │
70
+ │ │ • Non-blocking bugs │ • Nice-to-have │ Low │
71
+ │ │ • Performance improvement │ • Documentation │ │
72
+ │ │ │ │ │
73
+ │ │ SLA: 1 week │ SLA: 2 weeks │ │
74
+ │ └─────────────────────────────┴─────────────────────────────┘ │
75
+ │ │
76
+ │ P4 - BACKLOG: No SLA, review monthly │
77
+ └─────────────────────────────────────────────────────────────────────────┘
78
+ ```
79
+
80
+ ### Impact Scoring Formula
81
+
82
+ ```
83
+ Impact Score = (Downstream Count × 2) + PageRank + (Priority Weight × 3)
84
+
85
+ Where Priority Weight:
86
+ P0 = 5, P1 = 4, P2 = 3, P3 = 2, P4 = 1
87
+ ```
88
+
89
+ ### SLA Tracking
90
+
91
+ For each open task, calculate:
92
+
93
+ ```typescript
94
+ const now = new Date();
95
+ const created = new Date(task.created_at);
96
+ const ageHours = (now - created) / (1000 * 60 * 60);
97
+
98
+ const slaByPriority = { 0: 4, 1: 24, 2: 168, 3: 336, 4: Infinity };
99
+ const slaHours = slaByPriority[task.priority];
100
+ const slaRemaining = slaHours - ageHours;
101
+ const slaStatus =
102
+ slaRemaining < 0
103
+ ? "BREACHED"
104
+ : slaRemaining < slaHours * 0.2
105
+ ? "AT_RISK"
106
+ : "OK";
107
+ ```
108
+
109
+ ## Phase 5: Bottleneck Analysis
110
+
111
+ Identify blocking patterns:
112
+
113
+ ### Critical Bottlenecks
114
+
115
+ Tasks where:
116
+
117
+ - `downstream_count >= 3` (blocks 3+ tasks)
118
+ - `priority >= 2` (medium or higher)
119
+ - `status = open` (not started)
120
+
121
+ ```
122
+ BOTTLENECK ALERT
123
+ ━━━━━━━━━━━━━━━━
124
+
125
+ 🔴 bd-abc12: "Database migration"
126
+ Blocks: bd-def34, bd-ghi56, bd-jkl78, bd-mno90
127
+ Impact Score: 24
128
+ Age: 3 days (SLA: AT_RISK)
129
+
130
+ Recommendation: Assign immediately to unblock 4 tasks
131
+ ```
132
+
133
+ ### Dependency Cycles
134
+
135
+ If cycles detected:
136
+
137
+ ```
138
+ ⚠️ CIRCULAR DEPENDENCY DETECTED
139
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
140
+
141
+ bd-abc12 → bd-def34 → bd-ghi56 → bd-abc12
142
+
143
+ Resolution Options:
144
+ 1. Remove weakest dependency (bd-ghi56 → bd-abc12)
145
+ 2. Merge tasks into single unit
146
+ 3. Split one task to break cycle
147
+
148
+ Run: bd update <id> --remove-dep <dep-id>
149
+ ```
150
+
151
+ ## Phase 6: Generate Triage Report
152
+
153
+ ```
154
+ ╔══════════════════════════════════════════════════════════════════════════╗
155
+ ║ TRIAGE REPORT ║
156
+ ║ [timestamp] ║
157
+ ╠══════════════════════════════════════════════════════════════════════════╣
158
+
159
+ SUMMARY
160
+ ━━━━━━━
161
+ Open: XX | In Progress: XX | Blocked: XX | Ready: XX
162
+
163
+ SLA STATUS
164
+ ━━━━━━━━━━
165
+ 🔴 BREACHED: X tasks
166
+ 🟡 AT RISK: X tasks
167
+ 🟢 ON TRACK: X tasks
168
+
169
+ BOTTLENECKS (Top 3)
170
+ ━━━━━━━━━━━━━━━━━━━
171
+ 1. bd-abc12 - "Database migration" - blocks 4 tasks
172
+ 2. bd-def34 - "API authentication" - blocks 3 tasks
173
+ 3. bd-ghi56 - "Config refactor" - blocks 2 tasks
174
+
175
+ PRIORITY ORDER
176
+ ━━━━━━━━━━━━━━
177
+ Priority │ ID │ Title │ Impact │ SLA
178
+ ─────────┼──────────┼──────────────────────────┼────────┼────────
179
+ P0 │ bd-abc12 │ Database migration │ 24 │ AT_RISK
180
+ P1 │ bd-def34 │ API authentication │ 18 │ OK
181
+ P2 │ bd-ghi56 │ Config refactor │ 12 │ OK
182
+
183
+ PARALLEL TRACKS
184
+ ━━━━━━━━━━━━━━━
185
+ Track A (Frontend): bd-xyz11, bd-xyz22 [can start now]
186
+ Track B (Backend): bd-xyz33, bd-xyz44 [can start now]
187
+ Track C (Infra): bd-xyz55 [blocked by bd-abc12]
188
+
189
+ AGENT WORKLOAD
190
+ ━━━━━━━━━━━━━━
191
+ Agent │ Active │ Completed │ Load
192
+ ──────────┼────────┼───────────┼──────
193
+ fe-agent │ 2 │ 8 │ HIGH
194
+ be-agent │ 1 │ 12 │ MEDIUM
195
+ qa-agent │ 0 │ 5 │ LOW
196
+
197
+ RECOMMENDATIONS
198
+ ━━━━━━━━━━━━━━━
199
+ 1. 🔴 URGENT: bd-abc12 is blocking 4 tasks - assign to be-agent
200
+ 2. 🟡 REBALANCE: fe-agent has high load - redistribute to qa-agent
201
+ 3. 🟢 PARALLEL: Start Track A and B simultaneously
202
+ 4. ⚠️ STALE: bd-old99 has no activity for 7 days - review or close
203
+
204
+ ╚══════════════════════════════════════════════════════════════════════════╝
205
+ ```
206
+
207
+ ## Phase 7: Auto-Assignment (Optional)
208
+
209
+ If `--auto-assign` flag:
210
+
211
+ ### Assignment Rules
212
+
213
+ ```typescript
214
+ const assignmentRules = {
215
+ // Role detection from task tags/title
216
+ "frontend|ui|css|react|vue": "fe",
217
+ "backend|api|database|server": "be",
218
+ "test|qa|e2e|integration": "qa",
219
+ "deploy|ci|docker|infra": "devops",
220
+ "mobile|ios|android|react-native": "mobile",
221
+ };
222
+
223
+ // Load balancing: prefer agent with lowest active count
224
+ function selectAgent(role: string, agents: Agent[]): Agent {
225
+ return agents
226
+ .filter((a) => a.role === role)
227
+ .sort((a, b) => a.activeCount - b.activeCount)[0];
228
+ }
229
+ ```
230
+
231
+ ### Execute Assignments
232
+
233
+ ```typescript
234
+ // For each unassigned high-priority ready task
235
+ for (const task of readyTasks.filter((t) => !t.assignee && t.priority <= 2)) {
236
+ const role = detectRole(task);
237
+ bd_assign({ id: task.id, role, notify: true });
238
+ }
239
+ ```
240
+
241
+ **Output:**
242
+
243
+ ```
244
+ AUTO-ASSIGNMENTS
245
+ ━━━━━━━━━━━━━━━━
246
+
247
+ ✓ bd-abc12 → be-agent (detected: backend, API)
248
+ ✓ bd-def34 → fe-agent (detected: frontend, React)
249
+ ✓ bd-ghi56 → devops (detected: infrastructure)
250
+
251
+ Skipped:
252
+ - bd-xyz99: Already assigned to qa-agent
253
+ - bd-old88: No matching role detected (manual assignment needed)
254
+ ```
255
+
256
+ ## Phase 8: Batch Operations
257
+
258
+ ### Bulk Priority Update
259
+
260
+ ```typescript
261
+ // Escalate all breached SLA tasks
262
+ for (const task of breachedTasks) {
263
+ if (task.priority > 1) {
264
+ bd_update({ id: task.id, priority: task.priority - 1 });
265
+ }
266
+ }
267
+ ```
268
+
269
+ ### Stale Task Cleanup
270
+
271
+ ```typescript
272
+ // Find tasks with no activity > 14 days
273
+ const staleTasks = openTasks.filter(
274
+ (t) => daysSince(t.updated_at) > 14 && t.status === "open",
275
+ );
276
+
277
+ // Prompt for action
278
+ console.log(`Found ${staleTasks.length} stale tasks. Options:`);
279
+ console.log("1. Close all as 'wontfix'");
280
+ console.log("2. Move to P4 backlog");
281
+ console.log("3. Review individually");
282
+ ```
283
+
284
+ ## Phase 9: Sync and Notify
285
+
286
+ ```typescript
287
+ bd_sync({ reason: "Triage complete" });
288
+
289
+ // Broadcast triage summary if significant changes
290
+ if (assignmentsMade > 0 || priorityChanges > 0) {
291
+ bd_msg({
292
+ subj: "Triage Complete",
293
+ body: `Assigned ${assignmentsMade} tasks, updated ${priorityChanges} priorities`,
294
+ to: "all",
295
+ global: true,
296
+ importance: "normal",
297
+ });
298
+ }
299
+ ```
300
+
301
+ ## Alternative: Manual Triage
302
+
303
+ If automated tools unavailable:
304
+
305
+ ### Step 1: List and Sort
306
+
307
+ ```bash
308
+ bd list --status=open --sort=priority
309
+ ```
310
+
311
+ ### Step 2: Identify Dependencies
312
+
313
+ ```bash
314
+ bd show <id> # Check "Blocks" and "Blocked By" fields
315
+ ```
316
+
317
+ ### Step 3: Manual Assignment
318
+
319
+ ```bash
320
+ bd update <id> --assign=@username
321
+ bd update <id> --priority=1
322
+ ```
323
+
324
+ ## Examples
325
+
326
+ ```bash
327
+ /triage # Full triage report
328
+ /triage --auto-assign # Auto-assign ready tasks
329
+ /triage --sla # Focus on SLA status
330
+ /triage --bottleneck # Focus on blocking tasks
331
+ /triage --stale # Review stale tasks
332
+ ```
333
+
334
+ ## Integration
335
+
336
+ After triage:
337
+
338
+ ```
339
+ Recommended Next Commands:
340
+ ━━━━━━━━━━━━━━━━━━━━━━━━━
341
+
342
+ /implement bd-abc12 # Start highest priority task
343
+ /start bd-def34 # Begin planning next task
344
+ /status # Verify changes applied
345
+ ```
346
+
347
+ ## Metrics to Track
348
+
349
+ Over time, monitor:
350
+
351
+ - **Throughput**: Tasks completed per week
352
+ - **Cycle Time**: Average time from open → closed
353
+ - **SLA Compliance**: % of tasks within SLA
354
+ - **Bottleneck Frequency**: How often same tasks block
355
+ - **Agent Utilization**: Balance across team
@@ -1,44 +1,311 @@
1
1
  ---
2
- description: Review UI/UX design for quality and aesthetics
3
- argument-hint: "<image-or-component-path> [bead-id]"
2
+ description: Review UI/UX design for quality, aesthetics, and best practices
3
+ argument-hint: "<image-or-component-path> [--bead=<id>] [--responsive] [--dark-mode]"
4
4
  agent: vision
5
5
  model: proxypal/gemini-3-pro-preview
6
6
  ---
7
7
 
8
8
  # UI Review: $ARGUMENTS
9
9
 
10
- skill({ name: "frontend-aesthetics" })
11
- skill({ name: "visual-analysis" })
10
+ Comprehensive UI/UX review with structured scoring and actionable feedback.
12
11
 
13
- Review UI/UX design for quality, aesthetics, and best practices.
12
+ ## Load Skills
14
13
 
15
- ## Instructions
14
+ ```typescript
15
+ skill({ name: "frontend-aesthetics" });
16
+ skill({ name: "visual-analysis" });
17
+ skill({ name: "accessibility-audit" });
18
+ ```
16
19
 
17
- Parse image/component path and optional bead ID from `$ARGUMENTS`.
20
+ ## Parse Arguments
18
21
 
19
- ## What to Evaluate
22
+ | Argument | Default | Description |
23
+ | -------------- | -------- | ------------------------------------ |
24
+ | Path | required | Image, screenshot, or component file |
25
+ | `--bead` | none | Link findings to bead |
26
+ | `--responsive` | false | Include responsive breakpoint review |
27
+ | `--dark-mode` | false | Include dark mode review |
28
+ | `--compare` | none | Compare against design spec |
20
29
 
21
- 1. **Typography** - Avoid generic fonts (Inter/Roboto without purpose)
22
- 2. **Colors** - Check for overused AI patterns (purple gradients, flat white)
23
- 3. **Layout** - Hierarchy, spacing, visual rhythm
24
- 4. **Motion** - Micro-interactions, transitions
25
- 5. **Atmosphere** - Texture, depth, personality
26
- 6. **Accessibility** - Contrast, focus states, ARIA
30
+ ---
31
+
32
+ ## Review Categories
33
+
34
+ ### 1. Typography (Weight: 15%)
35
+
36
+ | Check | Pass | Fail |
37
+ | --------------- | --------------------------------------- | ----------------------------------- |
38
+ | Font purpose | Intentional choice for brand/context | Generic Inter/Roboto without reason |
39
+ | Hierarchy | Clear H1 > H2 > H3 > body scale | Flat, unclear importance |
40
+ | Readability | Appropriate size, line-height, contrast | Too small, cramped, low contrast |
41
+ | Weight contrast | Uses extremes (300 vs 700) | Muddy middle weights (400 vs 500) |
42
+ | Pairing | Harmonious combination | Clashing or too similar |
43
+
44
+ **Scoring:**
45
+
46
+ - 10: Distinctive, intentional, excellent hierarchy
47
+ - 7-9: Good choices, minor issues
48
+ - 4-6: Generic but functional
49
+ - 1-3: Poor readability or choices
50
+
51
+ ### 2. Color (Weight: 15%)
52
+
53
+ | Check | Pass | Fail |
54
+ | ---------------- | ------------------------------------- | ---------------------------- |
55
+ | Palette cohesion | Unified, intentional palette | Random or clashing colors |
56
+ | Brand alignment | Colors support brand identity | Generic or off-brand |
57
+ | Contrast | WCAG AA minimum (4.5:1 text) | Insufficient contrast |
58
+ | Semantic usage | Consistent meaning (red=error) | Confusing color meaning |
59
+ | No AI slop | Avoids purple/blue gradients, #667eea | Generic AI-generated palette |
60
+
61
+ **Scoring:**
62
+
63
+ - 10: Distinctive, accessible, cohesive
64
+ - 7-9: Good palette, minor issues
65
+ - 4-6: Functional but generic
66
+ - 1-3: Accessibility failures or AI slop
67
+
68
+ ### 3. Layout & Spacing (Weight: 20%)
69
+
70
+ | Check | Pass | Fail |
71
+ | ------------------- | ------------------------------ | ----------------------- |
72
+ | Visual hierarchy | Clear content priority | Everything same weight |
73
+ | Spacing consistency | Uses spacing scale (4/8/16/24) | Random pixel values |
74
+ | Alignment | Elements properly aligned | Misaligned or sloppy |
75
+ | White space | Breathing room, not cramped | Too dense or too sparse |
76
+ | Grid system | Consistent column structure | Arbitrary positioning |
77
+
78
+ **Scoring:**
79
+
80
+ - 10: Professional, balanced, rhythmic
81
+ - 7-9: Good structure, minor inconsistencies
82
+ - 4-6: Functional but lacks polish
83
+ - 1-3: Chaotic or broken layout
84
+
85
+ ### 4. Interactive States (Weight: 15%)
86
+
87
+ | State | Required | Check |
88
+ | -------------- | ------------- | ---------------------------------- |
89
+ | Default | Yes | Clear, inviting appearance |
90
+ | Hover | Yes | Visible change, not jarring |
91
+ | Focus | Yes | Clear ring/outline for keyboard |
92
+ | Active/Pressed | Recommended | Feedback on click |
93
+ | Disabled | If applicable | Obviously inactive, not just faded |
94
+ | Loading | If applicable | Clear loading indication |
95
+
96
+ **Scoring:**
97
+
98
+ - 10: All states polished, consistent
99
+ - 7-9: Most states covered, minor gaps
100
+ - 4-6: Basic states only
101
+ - 1-3: Missing critical states (focus)
102
+
103
+ ### 5. Accessibility (Weight: 20%)
104
+
105
+ | Check | Pass | Fail |
106
+ | -------------- | ---------------------------------- | ------------------------- |
107
+ | Color contrast | 4.5:1 text, 3:1 UI | Below WCAG AA |
108
+ | Focus visible | Clear focus indicator | Hidden or invisible focus |
109
+ | Touch targets | 44x44px minimum | Too small to tap |
110
+ | Alt text | Images have descriptions | Missing alt attributes |
111
+ | Keyboard nav | All interactive elements reachable | Keyboard traps or gaps |
112
+ | Screen reader | Logical reading order | Confusing or broken |
113
+
114
+ **Scoring:**
115
+
116
+ - 10: WCAG AAA compliant
117
+ - 7-9: WCAG AA compliant, minor issues
118
+ - 4-6: Some accessibility, gaps remain
119
+ - 1-3: Significant barriers
120
+
121
+ ### 6. Visual Polish (Weight: 15%)
122
+
123
+ | Check | Pass | Fail |
124
+ | ------------------- | ------------------------ | -------------------------- |
125
+ | Consistency | Same patterns throughout | Inconsistent styling |
126
+ | Attention to detail | Pixel-perfect alignment | Sloppy edges, misalignment |
127
+ | Motion/animation | Purposeful, smooth | Jarring or excessive |
128
+ | Depth/shadow | Consistent shadow system | Random or heavy shadows |
129
+ | Icons | Consistent style, size | Mixed icon sets |
130
+
131
+ **Scoring:**
132
+
133
+ - 10: Exceptional craft and attention
134
+ - 7-9: Professional, polished
135
+ - 4-6: Acceptable, room for improvement
136
+ - 1-3: Unpolished, inconsistent
137
+
138
+ ---
27
139
 
28
140
  ## Anti-Patterns to Flag
29
141
 
30
- - Cookie-cutter card layouts
31
- - Excessive rounded corners
32
- - Glassmorphism without purpose
33
- - Generic stock illustration style
142
+ | Anti-Pattern | Severity | Why It's Bad |
143
+ | --------------------------------- | -------- | ------------------------ |
144
+ | Purple/blue gradient backgrounds | Warning | AI slop signature |
145
+ | 3-column feature cards with icons | Warning | Overused, generic |
146
+ | Excessive rounded corners (16px+) | Info | Trendy but often misused |
147
+ | Glassmorphism without purpose | Warning | Style over function |
148
+ | Generic stock illustrations | Warning | Lacks personality |
149
+ | Drop shadows on everything | Info | Visual noise |
150
+ | Flat white (#FFFFFF) backgrounds | Info | Harsh, sterile |
151
+
152
+ ---
153
+
154
+ ## Responsive Review (--responsive)
155
+
156
+ Check at each breakpoint:
157
+
158
+ | Breakpoint | Width | Check |
159
+ | ---------- | ------- | ------------------------------------ |
160
+ | Mobile | 375px | Touch targets, stacking, readability |
161
+ | Tablet | 768px | Layout adaptation, spacing |
162
+ | Desktop | 1280px | Full layout, hover states |
163
+ | Wide | 1536px+ | Content doesn't stretch awkwardly |
164
+
165
+ **Common responsive issues:**
166
+
167
+ - Text too small on mobile
168
+ - Horizontal scroll
169
+ - Touch targets too close
170
+ - Images not responsive
171
+ - Hidden content on mobile
172
+
173
+ ---
34
174
 
35
- ## Output
175
+ ## Dark Mode Review (--dark-mode)
36
176
 
37
- Provide:
177
+ | Check | Pass | Fail |
178
+ | -------------------- | ------------------------ | ------------------------ |
179
+ | Contrast maintained | Text readable on dark bg | Washed out or too bright |
180
+ | Colors adapted | Not just inverted | Jarring or ugly colors |
181
+ | Images appropriate | Dark-compatible images | Light images on dark bg |
182
+ | Shadows adjusted | Softer or removed | Heavy shadows on dark |
183
+ | Focus states visible | Clear on dark background | Invisible focus ring |
184
+
185
+ ---
186
+
187
+ ## Output Format
188
+
189
+ ### Review Scorecard
190
+
191
+ ```
192
+ UI Review: [Component/Screen Name]
193
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
194
+
195
+ Category Scores:
196
+ ├── Typography: 8/10 ████████░░
197
+ ├── Color: 6/10 ██████░░░░ ⚠ Issues
198
+ ├── Layout: 9/10 █████████░
199
+ ├── Interactive: 7/10 ███████░░░
200
+ ├── Accessibility: 5/10 █████░░░░░ ⚠ Critical
201
+ └── Visual Polish: 8/10 ████████░░
202
+
203
+ Overall Score: 7.2/10 (Good, needs work)
204
+
205
+ Grade: B
206
+ ```
207
+
208
+ ### Findings by Severity
209
+
210
+ ```
211
+ Critical (Must Fix):
212
+ ━━━━━━━━━━━━━━━━━━━
213
+
214
+ 1. [A11Y] Focus states invisible on buttons
215
+ Location: All primary buttons
216
+ Impact: Keyboard users cannot navigate
217
+ Fix: Add `focus-visible:ring-2 focus-visible:ring-primary`
218
+
219
+ 2. [A11Y] Color contrast 2.8:1 on muted text
220
+ Location: Footer links, captions
221
+ Impact: WCAG AA failure
222
+ Fix: Change from #9CA3AF to #6B7280
223
+
224
+ Warning (Should Fix):
225
+ ━━━━━━━━━━━━━━━━━━━━
226
+
227
+ 3. [COLOR] Purple-blue gradient detected
228
+ Location: Hero background
229
+ Impact: AI slop aesthetic
230
+ Fix: Consider solid color or subtle texture
231
+
232
+ 4. [LAYOUT] Inconsistent spacing
233
+ Location: Card grid gaps
234
+ Impact: Visual rhythm broken
235
+ Fix: Standardize to 24px gap
236
+
237
+ Info (Nice to Have):
238
+ ━━━━━━━━━━━━━━━━━━━
239
+
240
+ 5. [TYPOGRAPHY] Could use more weight contrast
241
+ Location: Section headings
242
+ Suggestion: Try font-bold (700) instead of semibold (600)
243
+ ```
244
+
245
+ ### Code Fixes
246
+
247
+ ```tsx
248
+ // Before: Invisible focus
249
+ <button className="bg-primary text-white">
250
+ Submit
251
+ </button>
252
+
253
+ // After: Visible focus
254
+ <button className="bg-primary text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2">
255
+ Submit
256
+ </button>
257
+ ```
258
+
259
+ ---
260
+
261
+ ## Bead Integration
262
+
263
+ If `--bead=<id>` provided:
264
+
265
+ ```typescript
266
+ // Create issues for critical findings
267
+ bd_add({
268
+ title: "[UI] Fix invisible focus states",
269
+ desc: "Focus states not visible on primary buttons.\n\nFix: Add focus-visible ring classes",
270
+ type: "bug",
271
+ pri: 1,
272
+ parent: "<bead-id>",
273
+ tags: ["accessibility", "ui"],
274
+ });
275
+
276
+ // Update review.md
277
+ write(".beads/artifacts/<bead-id>/review.md", reviewContent);
278
+ ```
279
+
280
+ ---
281
+
282
+ ## Examples
283
+
284
+ ```bash
285
+ # Review a screenshot
286
+ /ui-review designs/homepage.png
287
+
288
+ # Review with responsive check
289
+ /ui-review src/components/Card.tsx --responsive
290
+
291
+ # Review and link to bead
292
+ /ui-review screenshots/dashboard.png --bead=bd-feature-123
293
+
294
+ # Full review with dark mode
295
+ /ui-review app/page.tsx --responsive --dark-mode
296
+
297
+ # Compare to design spec
298
+ /ui-review screenshots/current.png --compare designs/mockup.png
299
+ ```
300
+
301
+ ---
38
302
 
39
- 1. Summary of issues found
40
- 2. Specific actionable recommendations
41
- 3. Code snippets for improvements
42
- 4. Before/after suggestions
303
+ ## Related Commands
43
304
 
44
- If bead ID provided, record findings to the bead.
305
+ | Need | Command |
306
+ | ------------------- | ---------------------- |
307
+ | Analyze mockup | `/analyze-mockup` |
308
+ | Fix UI issues | `/fix-ui` |
309
+ | Accessibility audit | `/accessibility-check` |
310
+ | Design from scratch | `/design` |
311
+ | Audit design system | `/design-audit` |