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
@@ -7,60 +7,323 @@ model: proxypal/gemini-3-flash-preview
7
7
 
8
8
  # Accessibility Check: $ARGUMENTS
9
9
 
10
- skill({ name: "accessibility-audit" })
10
+ ## Phase 1: Load Context
11
11
 
12
- Perform WCAG accessibility audit.
12
+ **Load skill:**
13
13
 
14
- ## Instructions
14
+ ```typescript
15
+ skill({ name: "accessibility-audit" });
16
+ ```
17
+
18
+ **Check for bead context:**
19
+
20
+ ```typescript
21
+ bd_show({ id: "$ARGUMENTS" }); // If bead ID provided
22
+ ```
15
23
 
16
24
  Parse path and WCAG level from `$ARGUMENTS` (default: AA).
17
25
 
18
- Determine input type:
26
+ ## Phase 2: Estimate Complexity
19
27
 
20
- - **Image/screenshot**: Visual accessibility analysis
21
- - **Component path**: Code accessibility patterns
28
+ | Signals | Estimate | Approach |
29
+ | ------------------------------ | -------- | --------------- |
30
+ | Single component, few elements | S (~10) | Quick audit |
31
+ | Page with multiple components | M (~30) | Full audit |
32
+ | Complex app, multiple pages | L (~100) | Comprehensive |
33
+ | Design system audit | XL | Systematic scan |
22
34
 
23
- ## Visual Analysis
35
+ ## Phase 3: Determine Input Type
24
36
 
25
- Check:
37
+ - **Image/screenshot**: Visual accessibility analysis (Phase 4)
38
+ - **Component path**: Code accessibility patterns (Phase 5)
39
+ - **URL**: Run automated + visual analysis (Phase 4 + 5)
26
40
 
27
- 1. **Color contrast** - Text/background ratios (AA: 4.5:1 normal, 3:1 large)
28
- 2. **Touch targets** - Interactive elements ≥44x44px
29
- 3. **Visual information** - Color-only cues, missing labels
30
- 4. **Content structure** - Heading hierarchy, reading order
31
- 5. **Interactive states** - Focus indicators, hover states
41
+ ## Phase 4: Visual Analysis
32
42
 
33
- ## Code Analysis
43
+ ### Color & Contrast
34
44
 
35
- Search for:
45
+ | Check | WCAG Ref | Requirement |
46
+ | ------------------------ | ----------- | ---------------------------- |
47
+ | Text contrast | 1.4.3 (AA) | 4.5:1 normal, 3:1 large text |
48
+ | UI component contrast | 1.4.11 (AA) | 3:1 against adjacent colors |
49
+ | Focus indicator contrast | 1.4.11 (AA) | 3:1 contrast |
50
+ | Color-only information | 1.4.1 (A) | Don't rely on color alone |
36
51
 
37
- - Missing alt text on images
38
- - Click handlers on non-interactive elements
39
- - Form inputs without labels
40
- - Missing ARIA attributes
52
+ ### Touch & Interaction
41
53
 
42
- ## Output
54
+ | Check | WCAG Ref | Requirement |
55
+ | ----------------- | ----------- | -------------------------- |
56
+ | Touch target size | 2.5.5 (AAA) | ≥44x44px (≥24x24 for AA) |
57
+ | Target spacing | 2.5.8 (AA) | Adequate spacing between |
58
+ | Pointer gestures | 2.5.1 (A) | Single pointer alternative |
59
+
60
+ ### Visual Structure
61
+
62
+ | Check | WCAG Ref | Requirement |
63
+ | ----------------- | ----------- | ----------------------------- |
64
+ | Heading hierarchy | 1.3.1 (A) | Logical heading order |
65
+ | Reading order | 1.3.2 (A) | Meaningful sequence |
66
+ | Text spacing | 1.4.12 (AA) | Adjustable without loss |
67
+ | Reflow | 1.4.10 (AA) | No horizontal scroll at 320px |
68
+
69
+ ### Motion & Animation
70
+
71
+ | Check | WCAG Ref | Requirement |
72
+ | ----------------------- | ----------- | ------------------------------- |
73
+ | Motion from interaction | 2.3.3 (AAA) | Can be disabled |
74
+ | Reduced motion | 2.3.3 | Respects prefers-reduced-motion |
75
+ | Auto-playing media | 1.4.2 (A) | Pause/stop/hide controls |
76
+ | Flashing content | 2.3.1 (A) | No more than 3 flashes/second |
77
+
78
+ ## Phase 5: Code Analysis
79
+
80
+ ### Automated Testing
81
+
82
+ Run axe-core or Lighthouse:
83
+
84
+ ```bash
85
+ # Using Lighthouse
86
+ npx lighthouse <url> --only-categories=accessibility --output=json
87
+
88
+ # Using axe-core in tests
89
+ npm install -D @axe-core/playwright # or jest-axe
90
+ ```
91
+
92
+ ```typescript
93
+ // Playwright + axe example
94
+ import { injectAxe, checkA11y } from "@axe-core/playwright";
95
+
96
+ await injectAxe(page);
97
+ await checkA11y(page);
98
+ ```
99
+
100
+ ### Semantic HTML Checks
101
+
102
+ ```typescript
103
+ // Find images without alt text
104
+ ast - grep({ pattern: "<img $$$>" }); // Check for alt attribute
105
+
106
+ // Find click handlers on non-interactive elements
107
+ ast - grep({ pattern: "<div onClick={$$$}>" });
108
+ ast - grep({ pattern: "<span onClick={$$$}>" });
109
+
110
+ // Find form inputs without labels
111
+ ast - grep({ pattern: "<input $$$>" }); // Check for id + matching label
112
+ ```
113
+
114
+ ### ARIA Pattern Checks
115
+
116
+ | Pattern | Required ARIA |
117
+ | --------------- | ------------------------------------------ |
118
+ | Modal dialog | role="dialog", aria-modal, aria-labelledby |
119
+ | Dropdown menu | role="menu", aria-expanded, aria-haspopup |
120
+ | Tab panel | role="tablist/tab/tabpanel", aria-selected |
121
+ | Accordion | aria-expanded, aria-controls |
122
+ | Alert | role="alert", aria-live="assertive" |
123
+ | Toast | role="status", aria-live="polite" |
124
+ | Loading spinner | aria-busy, aria-live |
125
+
126
+ ### Focus Management
127
+
128
+ | Check | Requirement |
129
+ | ------------------- | ----------------------------------- |
130
+ | Focus visible | All interactive elements show focus |
131
+ | Focus order | Logical tab sequence |
132
+ | Focus trap (modals) | Focus contained within modal |
133
+ | Focus restoration | Focus returns after modal closes |
134
+ | Skip links | Skip to main content available |
135
+
136
+ ```typescript
137
+ // Check for focus styles
138
+ grep({ pattern: ":focus", include: "*.css" });
139
+ grep({ pattern: "focus:", include: "*.tsx" }); // Tailwind
140
+ ```
141
+
142
+ ## Phase 6: Keyboard Navigation Testing
143
+
144
+ Test manually or with Playwright:
145
+
146
+ ```typescript
147
+ skill({ name: "playwright" });
148
+ skill_mcp({
149
+ skill_name: "playwright",
150
+ tool_name: "browser_press_key",
151
+ arguments: '{"key": "Tab"}',
152
+ });
153
+ ```
154
+
155
+ | Action | Expected Behavior |
156
+ | ---------- | ---------------------------------------- |
157
+ | Tab | Moves to next interactive element |
158
+ | Shift+Tab | Moves to previous element |
159
+ | Enter | Activates buttons, links |
160
+ | Space | Toggles checkboxes, activates buttons |
161
+ | Arrow keys | Navigate within components (tabs, menus) |
162
+ | Escape | Closes modals, dropdowns |
163
+
164
+ ```
165
+ Keyboard Navigation:
166
+ ━━━━━━━━━━━━━━━━━━━━
167
+
168
+ - Tab order: [logical/broken at X]
169
+ - Focus visible: [all/missing on X]
170
+ - Enter/Space: [working/broken on X]
171
+ - Escape: [working/not implemented]
172
+ - Skip link: [present/missing]
173
+ ```
174
+
175
+ ## Phase 7: Screen Reader Guidance
176
+
177
+ For manual testing, suggest:
43
178
 
44
- ```markdown
45
- ## Accessibility Audit
179
+ | Platform | Screen Reader | Command to Start |
180
+ | -------- | ------------- | ------------------------ |
181
+ | macOS | VoiceOver | Cmd + F5 |
182
+ | Windows | NVDA | Ctrl + Alt + N |
183
+ | Windows | Narrator | Win + Ctrl + Enter |
184
+ | iOS | VoiceOver | Settings > Accessibility |
185
+ | Android | TalkBack | Settings > Accessibility |
46
186
 
47
- **WCAG Level:** [level]
187
+ **Key things to verify:**
48
188
 
49
- ### Critical Issues
189
+ - [ ] All content is announced
190
+ - [ ] Images have meaningful alt text
191
+ - [ ] Form fields announce labels
192
+ - [ ] Error messages are announced
193
+ - [ ] Dynamic content updates are announced (aria-live)
50
194
 
51
- - [ ] Issue + WCAG ref + fix
195
+ ## Phase 8: Generate Report
196
+
197
+ ````markdown
198
+ ## Accessibility Audit: [Component/Page]
199
+
200
+ **WCAG Level:** [A/AA/AAA]
201
+ **Automated Score:** [Lighthouse score if available]
202
+
203
+ ### Summary
204
+
205
+ | Category | Critical | Major | Minor | Passed |
206
+ | -------------- | -------- | ----- | ----- | ------ |
207
+ | Perceivable | [N] | [N] | [N] | [N] |
208
+ | Operable | [N] | [N] | [N] | [N] |
209
+ | Understandable | [N] | [N] | [N] | [N] |
210
+ | Robust | [N] | [N] | [N] | [N] |
211
+
212
+ ### Critical Issues (Must Fix)
213
+
214
+ #### [Issue Title]
215
+
216
+ - **WCAG:** [criterion number and name]
217
+ - **Location:** [file:line or element description]
218
+ - **Problem:** [description]
219
+ - **Fix:**
220
+
221
+ ```[language]
222
+ [code fix]
223
+ ```
224
+ ````
52
225
 
53
226
  ### Major Issues
54
227
 
55
- - [ ] Issue + WCAG ref + fix
228
+ [Same format]
56
229
 
57
230
  ### Minor Issues
58
231
 
59
- - [ ] Issue + WCAG ref + fix
232
+ [Same format]
233
+
234
+ ### Passed Checks
235
+
236
+ - Color contrast: [ratio] meets [level]
237
+ - Touch targets: [size] meets requirement
238
+ - Heading structure: Logical hierarchy
239
+ - Keyboard navigation: All elements reachable
240
+ - Focus indicators: Visible on all elements
241
+
242
+ ````
243
+
244
+ ## Phase 9: Create Observation
245
+
246
+ If patterns discovered:
247
+
248
+ ```typescript
249
+ observation({
250
+ type: "pattern",
251
+ title: "A11y pattern: [name]",
252
+ content: `
253
+ ## Pattern
254
+ [Description of accessibility pattern]
255
+
256
+ ## Implementation
257
+ \`\`\`tsx
258
+ [Accessible code example]
259
+ \`\`\`
260
+
261
+ ## Common Mistakes
262
+ - [What to avoid]
263
+ `,
264
+ concepts: "accessibility, wcag, [specific area]",
265
+ bead_id: "<bead-id>",
266
+ });
267
+ ````
268
+
269
+ ## Phase 10: Verify Fixes
270
+
271
+ After fixes applied, re-run checks:
272
+
273
+ ```bash
274
+ npx lighthouse <url> --only-categories=accessibility
275
+ ```
276
+
277
+ ```
278
+ Verification:
279
+ ━━━━━━━━━━━━━
280
+
281
+ Before: [N] issues
282
+ After: [N] issues
283
+ Resolved: [N]
284
+
285
+ Remaining:
286
+ - [Any outstanding issues]
287
+ ```
288
+
289
+ ## Phase 11: Sync
290
+
291
+ ```typescript
292
+ bd_sync({ reason: "Accessibility audit for $ARGUMENTS" });
293
+ ```
294
+
295
+ ## Output
296
+
297
+ ```
298
+ Accessibility Audit Complete: $ARGUMENTS
299
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
300
+
301
+ WCAG Level: [AA]
302
+ Estimate: [S/M/L]
303
+
304
+ Results:
305
+ - Critical: [N]
306
+ - Major: [N]
307
+ - Minor: [N]
308
+ - Passed: [N]
60
309
 
61
- ### Passed
310
+ Automated Score: [N]/100 (Lighthouse)
62
311
 
63
- - What passed
312
+ Key Fixes Needed:
313
+ 1. [Most critical issue]
314
+ 2. [Second issue]
315
+ 3. [Third issue]
316
+
317
+ Report: .beads/artifacts/<bead-id>/a11y-audit.md (if bead)
64
318
  ```
65
319
 
66
- Include code fix snippets for each issue.
320
+ **Next steps:**
321
+
322
+ ```
323
+ Fix issues:
324
+ /fix-ui <bead-id> # Fix visual issues
325
+ /fix <bead-id> # Fix code issues
326
+
327
+ After fixing:
328
+ /accessibility-check <path> # Re-run audit
329
+ ```