opencodekit 0.15.1 → 0.15.3
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.
- package/dist/index.js +1 -1
- package/dist/template/.opencode/README.md +1 -1
- package/dist/template/.opencode/agent/scout.md +159 -3
- package/dist/template/.opencode/agent/vision.md +4 -4
- package/dist/template/.opencode/command/agent-browser.md +21 -0
- package/dist/template/.opencode/command/complete-next-task.md +77 -0
- package/dist/template/.opencode/command/create.md +38 -3
- package/dist/template/.opencode/command/design-audit.md +1 -1
- package/dist/template/.opencode/command/design.md +1 -1
- package/dist/template/.opencode/command/finish.md +8 -0
- package/dist/template/.opencode/command/frontend-design.md +21 -0
- package/dist/template/.opencode/command/index-knowledge.md +25 -0
- package/dist/template/.opencode/command/init.md +6 -0
- package/dist/template/.opencode/command/opensrc.md +58 -0
- package/dist/template/.opencode/command/skill-create.md +3 -3
- package/dist/template/.opencode/command/skill-optimize.md +2 -2
- package/dist/template/.opencode/command/start.md +15 -6
- package/dist/template/.opencode/command/ui-review.md +1 -1
- package/dist/template/.opencode/memory/_templates/prd.md +50 -14
- package/dist/template/.opencode/opencode.json +2 -1
- package/dist/template/.opencode/package.json +1 -1
- package/dist/template/.opencode/plans/1768385996691-silent-wizard.md +237 -0
- package/dist/template/.opencode/skill/accessibility-audit/SKILL.md +1 -1
- package/dist/template/.opencode/skill/agent-browser/SKILL.md +376 -0
- package/dist/template/.opencode/skill/design-system-audit/SKILL.md +1 -1
- package/dist/template/.opencode/skill/frontend-design/SKILL.md +155 -0
- package/dist/template/.opencode/skill/frontend-design/references/animation/motion-advanced.md +224 -0
- package/dist/template/.opencode/skill/frontend-design/references/animation/motion-core.md +171 -0
- package/dist/template/.opencode/skill/frontend-design/references/canvas/execution.md +90 -0
- package/dist/template/.opencode/skill/frontend-design/references/canvas/philosophy.md +94 -0
- package/dist/template/.opencode/skill/frontend-design/references/shadcn/accessibility.md +132 -0
- package/dist/template/.opencode/skill/frontend-design/references/shadcn/core-components.md +153 -0
- package/dist/template/.opencode/skill/frontend-design/references/shadcn/form-components.md +158 -0
- package/dist/template/.opencode/skill/frontend-design/references/shadcn/setup.md +69 -0
- package/dist/template/.opencode/skill/frontend-design/references/shadcn/theming.md +152 -0
- package/dist/template/.opencode/skill/frontend-design/references/tailwind/responsive.md +112 -0
- package/dist/template/.opencode/skill/frontend-design/references/tailwind/utilities-layout.md +134 -0
- package/dist/template/.opencode/skill/frontend-design/references/tailwind/utilities-styling.md +165 -0
- package/dist/template/.opencode/skill/frontend-design/references/tailwind/v4-config.md +147 -0
- package/dist/template/.opencode/skill/frontend-design/references/tailwind/v4-features.md +128 -0
- package/dist/template/.opencode/skill/index-knowledge/SKILL.md +358 -0
- package/dist/template/.opencode/skill/mockup-to-code/SKILL.md +1 -1
- package/dist/template/.opencode/skill/opensrc/SKILL.md +115 -0
- package/dist/template/.opencode/skill/opensrc/references/architecture.md +176 -0
- package/dist/template/.opencode/skill/opensrc/references/cli-usage.md +176 -0
- package/dist/template/.opencode/skill/opensrc/references/registry-support.md +137 -0
- package/dist/template/.opencode/skill/prd/SKILL.md +212 -0
- package/dist/template/.opencode/skill/prd-task/SKILL.md +128 -0
- package/dist/template/.opencode/skill/prd-task/references/prd-schema.json +28 -0
- package/dist/template/.opencode/skill/skill-creator/SKILL.md +155 -0
- package/dist/template/.opencode/skill/ui-ux-research/SKILL.md +1 -1
- package/dist/template/.opencode/skill/visual-analysis/SKILL.md +1 -1
- package/package.json +1 -1
- package/dist/template/.opencode/skill/frontend-aesthetics/SKILL.md +0 -117
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-browser
|
|
3
|
+
description: Browser automation CLI for AI agents using Playwright
|
|
4
|
+
version: 1
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# agent-browser
|
|
8
|
+
|
|
9
|
+
Browser automation CLI for AI agents. Use when tasks require web browsing, scraping, form filling, or web interaction. Built on Playwright with Rust CLI + Node.js daemon architecture.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install -g agent-browser
|
|
15
|
+
agent-browser install # Download Chromium
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Linux: `agent-browser install --with-deps`
|
|
19
|
+
|
|
20
|
+
## Architecture
|
|
21
|
+
|
|
22
|
+
- **Rust CLI** (fast native binary) parses commands, communicates with daemon
|
|
23
|
+
- **Node.js daemon** manages Playwright browser instance, persists between commands
|
|
24
|
+
- Daemon auto-starts on first command, stays alive for fast subsequent ops
|
|
25
|
+
- Each session has own daemon process + Unix socket (or TCP on Windows)
|
|
26
|
+
|
|
27
|
+
## Core Workflow
|
|
28
|
+
|
|
29
|
+
1. **Open page**: `agent-browser open <url>`
|
|
30
|
+
2. **Get snapshot**: `agent-browser snapshot -i` (interactive elements only)
|
|
31
|
+
3. **Use refs**: `agent-browser click @e2` / `agent-browser fill @e3 "text"`
|
|
32
|
+
4. **Repeat snapshot** after page changes
|
|
33
|
+
|
|
34
|
+
## Refs (Primary Selection Method)
|
|
35
|
+
|
|
36
|
+
Snapshot generates ARIA accessibility tree with `[ref=eN]` tags. Refs map to `getByRole()` locators internally.
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
agent-browser snapshot
|
|
40
|
+
# - heading "Example Domain" [ref=e1] [level=1]
|
|
41
|
+
# - button "Submit" [ref=e2]
|
|
42
|
+
# - textbox "Email" [ref=e3]
|
|
43
|
+
# - link "Learn more" [ref=e4]
|
|
44
|
+
|
|
45
|
+
agent-browser click @e2 # Click button
|
|
46
|
+
agent-browser fill @e3 "test@example.com"
|
|
47
|
+
agent-browser get text @e1 # Get heading text
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Ref syntax: `@e1`, `e1`, or `ref=e1` all work.
|
|
51
|
+
|
|
52
|
+
**Why refs?**
|
|
53
|
+
- Deterministic: points to exact element from snapshot
|
|
54
|
+
- Fast: no DOM re-query, uses cached role/name locator
|
|
55
|
+
- AI-friendly: snapshot + ref workflow optimal for LLMs
|
|
56
|
+
|
|
57
|
+
### Interactive Roles (get refs automatically)
|
|
58
|
+
`button`, `link`, `textbox`, `checkbox`, `radio`, `combobox`, `listbox`, `menuitem`, `option`, `searchbox`, `slider`, `spinbutton`, `switch`, `tab`, `treeitem`
|
|
59
|
+
|
|
60
|
+
### Content Roles (get refs when named)
|
|
61
|
+
`heading`, `cell`, `gridcell`, `columnheader`, `rowheader`, `listitem`, `article`, `region`, `main`, `navigation`
|
|
62
|
+
|
|
63
|
+
## Commands
|
|
64
|
+
|
|
65
|
+
### Navigation
|
|
66
|
+
```bash
|
|
67
|
+
agent-browser open <url> # Auto-prepends https:// if needed
|
|
68
|
+
agent-browser back
|
|
69
|
+
agent-browser forward
|
|
70
|
+
agent-browser reload
|
|
71
|
+
agent-browser close # Closes browser + daemon
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Interaction
|
|
75
|
+
```bash
|
|
76
|
+
agent-browser click <sel> # Left click
|
|
77
|
+
agent-browser dblclick <sel> # Double click
|
|
78
|
+
agent-browser fill <sel> <text> # Clear field + set value (atomic)
|
|
79
|
+
agent-browser type <sel> <text> # Type character by character (preserves existing)
|
|
80
|
+
agent-browser press <key> # Key press: Enter, Tab, Control+a, Shift+Tab
|
|
81
|
+
agent-browser keydown <key> # Hold key down
|
|
82
|
+
agent-browser keyup <key> # Release key
|
|
83
|
+
agent-browser hover <sel>
|
|
84
|
+
agent-browser focus <sel>
|
|
85
|
+
agent-browser select <sel> <val> # Select dropdown option by value
|
|
86
|
+
agent-browser check <sel> # Check checkbox
|
|
87
|
+
agent-browser uncheck <sel> # Uncheck checkbox
|
|
88
|
+
agent-browser scroll up|down|left|right [px] # Default 300px
|
|
89
|
+
agent-browser scrollintoview <sel>
|
|
90
|
+
agent-browser drag <src> <tgt> # Drag and drop
|
|
91
|
+
agent-browser upload <sel> <file1> [file2...]
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Get Info
|
|
95
|
+
```bash
|
|
96
|
+
agent-browser get text <sel> # textContent
|
|
97
|
+
agent-browser get html <sel> # innerHTML
|
|
98
|
+
agent-browser get value <sel> # input value
|
|
99
|
+
agent-browser get attr <sel> <attr>
|
|
100
|
+
agent-browser get title
|
|
101
|
+
agent-browser get url
|
|
102
|
+
agent-browser get count <sel> # Number of matching elements
|
|
103
|
+
agent-browser get box <sel> # Bounding box {x,y,width,height}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Check State
|
|
107
|
+
```bash
|
|
108
|
+
agent-browser is visible <sel>
|
|
109
|
+
agent-browser is enabled <sel>
|
|
110
|
+
agent-browser is checked <sel>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Snapshot Options
|
|
114
|
+
```bash
|
|
115
|
+
agent-browser snapshot # Full accessibility tree
|
|
116
|
+
agent-browser snapshot -i # Interactive elements only (buttons, inputs, links)
|
|
117
|
+
agent-browser snapshot -c # Compact (remove empty structural elements)
|
|
118
|
+
agent-browser snapshot -d 3 # Limit depth to 3 levels
|
|
119
|
+
agent-browser snapshot -s "#main" # Scope to CSS selector
|
|
120
|
+
agent-browser snapshot -i -c -d 5 # Combine options
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Screenshots & PDF
|
|
124
|
+
```bash
|
|
125
|
+
agent-browser screenshot [path] # PNG to stdout (base64) or file
|
|
126
|
+
agent-browser screenshot --full # Full page screenshot
|
|
127
|
+
agent-browser screenshot -f page.png
|
|
128
|
+
agent-browser pdf <path> # Save as PDF (format: Letter, A4, etc)
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Wait
|
|
132
|
+
```bash
|
|
133
|
+
agent-browser wait <selector> # Wait for element visible
|
|
134
|
+
agent-browser wait <ms> # Wait for time (numeric = milliseconds)
|
|
135
|
+
agent-browser wait --text "Welcome"
|
|
136
|
+
agent-browser wait --url "**/dashboard"
|
|
137
|
+
agent-browser wait --load networkidle # load | domcontentloaded | networkidle
|
|
138
|
+
agent-browser wait --fn "window.ready === true" # Wait for JS condition
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Find (Semantic Locators)
|
|
142
|
+
```bash
|
|
143
|
+
agent-browser find role button click --name "Submit"
|
|
144
|
+
agent-browser find text "Sign In" click
|
|
145
|
+
agent-browser find label "Email" fill "test@test.com"
|
|
146
|
+
agent-browser find placeholder "Search" fill "query"
|
|
147
|
+
agent-browser find alt "Logo" click # By alt text
|
|
148
|
+
agent-browser find title "Close" click # By title attribute
|
|
149
|
+
agent-browser find testid "submit-btn" click
|
|
150
|
+
agent-browser find first ".item" click # First match
|
|
151
|
+
agent-browser find last ".item" click # Last match
|
|
152
|
+
agent-browser find nth 2 "a" text # Nth match (0-indexed)
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Actions: `click`, `fill`, `check`, `hover`, `text`
|
|
156
|
+
|
|
157
|
+
### Sessions (Isolated Browser Instances)
|
|
158
|
+
```bash
|
|
159
|
+
agent-browser --session agent1 open site-a.com
|
|
160
|
+
agent-browser --session agent2 open site-b.com
|
|
161
|
+
AGENT_BROWSER_SESSION=agent1 agent-browser click @e2
|
|
162
|
+
|
|
163
|
+
agent-browser session list # List active sessions
|
|
164
|
+
agent-browser session # Show current session
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Each session has: own browser, cookies/storage, navigation history, auth state.
|
|
168
|
+
|
|
169
|
+
### Storage & Cookies
|
|
170
|
+
```bash
|
|
171
|
+
agent-browser cookies # Get all cookies
|
|
172
|
+
agent-browser cookies set <name> <val>
|
|
173
|
+
agent-browser cookies clear
|
|
174
|
+
|
|
175
|
+
agent-browser storage local # Get all localStorage
|
|
176
|
+
agent-browser storage local <key> # Get specific key
|
|
177
|
+
agent-browser storage local set <k> <v>
|
|
178
|
+
agent-browser storage local clear
|
|
179
|
+
agent-browser storage session # Same for sessionStorage
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Tabs & Windows
|
|
183
|
+
```bash
|
|
184
|
+
agent-browser tab # List tabs
|
|
185
|
+
agent-browser tab new [url] # New tab
|
|
186
|
+
agent-browser tab <n> # Switch to tab n
|
|
187
|
+
agent-browser tab close [n] # Close tab
|
|
188
|
+
agent-browser window new # New window (new context)
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Frames
|
|
192
|
+
```bash
|
|
193
|
+
agent-browser frame <sel> # Switch to iframe by selector
|
|
194
|
+
agent-browser frame main # Back to main frame
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Dialogs (alert/confirm/prompt)
|
|
198
|
+
```bash
|
|
199
|
+
agent-browser dialog accept [text] # Accept (with optional prompt text)
|
|
200
|
+
agent-browser dialog dismiss # Dismiss
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Network Interception
|
|
204
|
+
```bash
|
|
205
|
+
agent-browser network route <url> # Intercept requests
|
|
206
|
+
agent-browser network route <url> --abort # Block requests
|
|
207
|
+
agent-browser network route <url> --body '{"mock":true}' # Mock response
|
|
208
|
+
agent-browser network unroute [url] # Remove routes
|
|
209
|
+
agent-browser network requests # View tracked requests
|
|
210
|
+
agent-browser network requests --filter api # Filter by URL pattern
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### Browser Settings
|
|
214
|
+
```bash
|
|
215
|
+
agent-browser set viewport <w> <h>
|
|
216
|
+
agent-browser set device "iPhone 14" # Emulate device
|
|
217
|
+
agent-browser set geo <lat> <lng> # Geolocation
|
|
218
|
+
agent-browser set offline [on|off] # Toggle offline mode
|
|
219
|
+
agent-browser set media dark|light # Color scheme
|
|
220
|
+
agent-browser set credentials <u> <p> # HTTP basic auth
|
|
221
|
+
agent-browser set headers '{"X-Custom":"value"}'
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Debug & Tracing
|
|
225
|
+
```bash
|
|
226
|
+
agent-browser --headed open <url> # Show browser window (not headless)
|
|
227
|
+
agent-browser console # View console messages
|
|
228
|
+
agent-browser console --clear # Clear console
|
|
229
|
+
agent-browser errors # View page errors
|
|
230
|
+
agent-browser errors --clear
|
|
231
|
+
agent-browser highlight <sel> # Highlight element visually
|
|
232
|
+
agent-browser eval <js> # Run JavaScript, returns result
|
|
233
|
+
agent-browser trace start [path] # Start recording trace
|
|
234
|
+
agent-browser trace stop [path] # Stop and save trace
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Auth State Persistence
|
|
238
|
+
```bash
|
|
239
|
+
agent-browser state save auth.json # Save cookies, localStorage, sessionStorage
|
|
240
|
+
agent-browser state load auth.json # Load at next launch (must be at browser start)
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
### Mouse Control
|
|
244
|
+
```bash
|
|
245
|
+
agent-browser mouse move <x> <y> # Move to coordinates
|
|
246
|
+
agent-browser mouse down [button] # left|right|middle
|
|
247
|
+
agent-browser mouse up [button]
|
|
248
|
+
agent-browser mouse wheel <dy> [dx] # Scroll wheel
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
## Options
|
|
252
|
+
|
|
253
|
+
| Option | Description |
|
|
254
|
+
|--------|-------------|
|
|
255
|
+
| `--session <name>` | Isolated session (or `AGENT_BROWSER_SESSION` env) |
|
|
256
|
+
| `--json` | JSON output (for parsing) |
|
|
257
|
+
| `--full, -f` | Full page screenshot |
|
|
258
|
+
| `--headed` | Show browser window |
|
|
259
|
+
| `--name, -n` | Locator name filter |
|
|
260
|
+
| `--exact` | Exact text match |
|
|
261
|
+
| `--debug` | Debug output |
|
|
262
|
+
|
|
263
|
+
## Selector Types
|
|
264
|
+
|
|
265
|
+
1. **Refs** (preferred): `@e1`, `@e2` from snapshot
|
|
266
|
+
2. **CSS**: `#id`, `.class`, `div > button`
|
|
267
|
+
3. **Text**: `text=Submit`
|
|
268
|
+
4. **XPath**: `xpath=//button`
|
|
269
|
+
|
|
270
|
+
## JSON Output Format
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
agent-browser snapshot --json
|
|
274
|
+
# {"success":true,"data":{"snapshot":"...","refs":{"e1":{"role":"heading","name":"Title"},...}}}
|
|
275
|
+
|
|
276
|
+
agent-browser get text @e1 --json
|
|
277
|
+
# {"success":true,"data":{"text":"Hello World"}}
|
|
278
|
+
|
|
279
|
+
agent-browser is visible @e2 --json
|
|
280
|
+
# {"success":true,"data":{"visible":true}}
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
## Patterns
|
|
284
|
+
|
|
285
|
+
### Login Flow
|
|
286
|
+
```bash
|
|
287
|
+
agent-browser open https://example.com/login
|
|
288
|
+
agent-browser snapshot -i
|
|
289
|
+
# Identify refs for username, password, submit
|
|
290
|
+
agent-browser fill @e2 "username"
|
|
291
|
+
agent-browser fill @e3 "password"
|
|
292
|
+
agent-browser click @e4
|
|
293
|
+
agent-browser wait --url "**/dashboard"
|
|
294
|
+
agent-browser state save auth.json # Persist auth for later
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### Form Submission
|
|
298
|
+
```bash
|
|
299
|
+
agent-browser open https://example.com/form
|
|
300
|
+
agent-browser snapshot -i --json
|
|
301
|
+
# Parse refs from JSON response
|
|
302
|
+
agent-browser fill @e1 "John Doe"
|
|
303
|
+
agent-browser fill @e2 "john@example.com"
|
|
304
|
+
agent-browser select @e3 "option-value"
|
|
305
|
+
agent-browser check @e4
|
|
306
|
+
agent-browser click @e5
|
|
307
|
+
agent-browser wait --text "Success"
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### Scraping Data
|
|
311
|
+
```bash
|
|
312
|
+
agent-browser open https://example.com/data
|
|
313
|
+
agent-browser snapshot
|
|
314
|
+
agent-browser get text @e1
|
|
315
|
+
agent-browser get attr @e2 "href"
|
|
316
|
+
agent-browser eval "document.querySelectorAll('.item').length"
|
|
317
|
+
agent-browser eval "JSON.stringify([...document.querySelectorAll('.price')].map(e => e.textContent))"
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
### Multi-page Navigation
|
|
321
|
+
```bash
|
|
322
|
+
agent-browser open https://example.com
|
|
323
|
+
agent-browser snapshot -i
|
|
324
|
+
agent-browser click @e3 # Navigate to new page
|
|
325
|
+
agent-browser wait --load networkidle
|
|
326
|
+
agent-browser snapshot -i # Fresh snapshot for new page
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### Parallel Browser Sessions
|
|
330
|
+
```bash
|
|
331
|
+
# Terminal 1
|
|
332
|
+
agent-browser --session scraper1 open https://site-a.com
|
|
333
|
+
agent-browser --session scraper1 snapshot -i
|
|
334
|
+
|
|
335
|
+
# Terminal 2
|
|
336
|
+
agent-browser --session scraper2 open https://site-b.com
|
|
337
|
+
agent-browser --session scraper2 snapshot -i
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### Mock API Response
|
|
341
|
+
```bash
|
|
342
|
+
agent-browser network route "**/api/users" --body '[{"id":1,"name":"Mock User"}]'
|
|
343
|
+
agent-browser open https://example.com # App sees mocked data
|
|
344
|
+
agent-browser network unroute "**/api/users"
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
### Handle File Downloads
|
|
348
|
+
```bash
|
|
349
|
+
agent-browser open https://example.com/downloads
|
|
350
|
+
agent-browser snapshot -i
|
|
351
|
+
agent-browser click @e2 # Download button
|
|
352
|
+
# Download handled automatically, saved to suggested filename
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
## Anti-Patterns
|
|
356
|
+
|
|
357
|
+
- **Don't use CSS selectors when refs available** - refs from snapshot are deterministic
|
|
358
|
+
- **Don't skip snapshot after page changes** - refs become stale after navigation
|
|
359
|
+
- **Don't use `type` when `fill` works** - `fill` atomically clears + sets, `type` appends
|
|
360
|
+
- **Don't hardcode wait times** - use semantic waits (`--text`, `--url`, `--load`, `--fn`)
|
|
361
|
+
- **Don't use `--headed` in automation** - only for debugging
|
|
362
|
+
- **Don't call `state load` after browser started** - must be at launch time
|
|
363
|
+
|
|
364
|
+
## Timeouts
|
|
365
|
+
|
|
366
|
+
Default timeout: 10 seconds (Playwright default is 30s). Commands will fail after timeout if element not found or condition not met.
|
|
367
|
+
|
|
368
|
+
## Browser Support
|
|
369
|
+
|
|
370
|
+
| Platform | Binary | Fallback |
|
|
371
|
+
|----------|--------|----------|
|
|
372
|
+
| macOS ARM64 | Native Rust | Node.js |
|
|
373
|
+
| macOS x64 | Native Rust | Node.js |
|
|
374
|
+
| Linux ARM64 | Native Rust | Node.js |
|
|
375
|
+
| Linux x64 | Native Rust | Node.js |
|
|
376
|
+
| Windows | - | Node.js |
|
|
@@ -141,6 +141,6 @@ Save design tokens to `.opencode/memory/design/tokens/`
|
|
|
141
141
|
|
|
142
142
|
| Need | Skill |
|
|
143
143
|
| -------------------- | --------------------- |
|
|
144
|
-
| Aesthetic principles | `frontend-
|
|
144
|
+
| Aesthetic principles | `frontend-design` |
|
|
145
145
|
| Implement components | `mockup-to-code` |
|
|
146
146
|
| Accessibility | `accessibility-audit` |
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: frontend-design
|
|
3
|
+
description: Create distinctive, production-grade frontend interfaces. Use when building web components, pages, or applications with React-based frameworks. Includes Tailwind CSS v4, shadcn/ui components, Motion animations, and visual design philosophy for avoiding generic AI aesthetics.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Frontend Design
|
|
7
|
+
|
|
8
|
+
Create distinctive, production-grade interfaces avoiding generic "AI slop" aesthetics.
|
|
9
|
+
|
|
10
|
+
## When to Use
|
|
11
|
+
|
|
12
|
+
- Building UI with React frameworks (Next.js, Vite, Remix)
|
|
13
|
+
- Creating visually distinctive, memorable interfaces
|
|
14
|
+
- Implementing accessible components with shadcn/ui
|
|
15
|
+
- Styling with Tailwind CSS v4
|
|
16
|
+
- Adding animations and micro-interactions
|
|
17
|
+
- Creating visual designs, posters, brand materials
|
|
18
|
+
|
|
19
|
+
## Reference Documentation
|
|
20
|
+
|
|
21
|
+
### Tailwind CSS v4.1
|
|
22
|
+
|
|
23
|
+
- `./references/tailwind/v4-config.md` - Installation, @theme, CSS-first config
|
|
24
|
+
- `./references/tailwind/v4-features.md` - Container queries, gradients, masks, text shadows
|
|
25
|
+
- `./references/tailwind/utilities-layout.md` - Display, flex, grid, position
|
|
26
|
+
- `./references/tailwind/utilities-styling.md` - Spacing, typography, colors, borders
|
|
27
|
+
- `./references/tailwind/responsive.md` - Breakpoints, mobile-first, container queries
|
|
28
|
+
|
|
29
|
+
Search: `@theme`, `@container`, `OKLCH`, `mask-`, `text-shadow`
|
|
30
|
+
|
|
31
|
+
### shadcn/ui (CLI v3.6)
|
|
32
|
+
|
|
33
|
+
- `./references/shadcn/setup.md` - Installation, visual styles, component list
|
|
34
|
+
- `./references/shadcn/core-components.md` - Button, Card, Dialog, Select, Tabs, Toast
|
|
35
|
+
- `./references/shadcn/form-components.md` - Form, Field, Input Group, 2026 components
|
|
36
|
+
- `./references/shadcn/theming.md` - CSS variables, OKLCH, dark mode
|
|
37
|
+
- `./references/shadcn/accessibility.md` - ARIA, keyboard, screen reader
|
|
38
|
+
|
|
39
|
+
Search: `Field`, `InputGroup`, `Spinner`, `ButtonGroup`, `next-themes`
|
|
40
|
+
|
|
41
|
+
### Animation (Motion + Tailwind)
|
|
42
|
+
|
|
43
|
+
- `./references/animation/motion-core.md` - Core API, variants, gestures, layout animations
|
|
44
|
+
- `./references/animation/motion-advanced.md` - AnimatePresence, scroll, orchestration, TypeScript
|
|
45
|
+
|
|
46
|
+
**Stack**:
|
|
47
|
+
| Animation Type | Tool |
|
|
48
|
+
|----------------|------|
|
|
49
|
+
| Hover/transitions | Tailwind CSS (`transition-*`) |
|
|
50
|
+
| shadcn states | `tailwindcss-animate` (built-in) |
|
|
51
|
+
| Gestures/layout/exit | Motion (`motion/react`) |
|
|
52
|
+
| Complex SVG morphing | anime.js v4 (niche only) |
|
|
53
|
+
|
|
54
|
+
### Visual Design
|
|
55
|
+
|
|
56
|
+
- `./references/canvas/philosophy.md` - Design movements, core principles
|
|
57
|
+
- `./references/canvas/execution.md` - Multi-page systems, quality standards
|
|
58
|
+
|
|
59
|
+
For sophisticated compositions: posters, brand materials, design systems.
|
|
60
|
+
|
|
61
|
+
## Design Thinking
|
|
62
|
+
|
|
63
|
+
Before coding, commit to BOLD aesthetic direction:
|
|
64
|
+
|
|
65
|
+
- **Purpose**: What problem? Who uses it?
|
|
66
|
+
- **Tone**: Pick extreme - brutally minimal, maximalist chaos, retro-futuristic, organic, luxury, playful, editorial, brutalist, art deco, soft/pastel, industrial
|
|
67
|
+
- **Differentiation**: What makes this UNFORGETTABLE?
|
|
68
|
+
|
|
69
|
+
Bold maximalism and refined minimalism both work. Key is intentionality.
|
|
70
|
+
|
|
71
|
+
## Anti-Patterns (NEVER)
|
|
72
|
+
|
|
73
|
+
- Overused fonts: Inter, Roboto, Arial, system fonts, Space Grotesk
|
|
74
|
+
- Cliched colors: purple gradients on white
|
|
75
|
+
- Predictable layouts and component patterns
|
|
76
|
+
- Cookie-cutter design lacking character
|
|
77
|
+
- Generic AI-generated aesthetics
|
|
78
|
+
|
|
79
|
+
## Best Practices
|
|
80
|
+
|
|
81
|
+
1. **Accessibility First**: Radix primitives, focus states, semantic HTML
|
|
82
|
+
2. **Mobile-First**: Start mobile, layer responsive variants
|
|
83
|
+
3. **Design Tokens**: Use `@theme` for spacing, colors, typography
|
|
84
|
+
4. **Dark Mode**: Apply dark variants to all themed elements
|
|
85
|
+
5. **Performance**: Automatic CSS purging, avoid dynamic class names
|
|
86
|
+
6. **TypeScript**: Full type safety
|
|
87
|
+
7. **Expert Craftsmanship**: Every detail matters
|
|
88
|
+
|
|
89
|
+
## Core Stack Summary
|
|
90
|
+
|
|
91
|
+
**Tailwind v4.1**: CSS-first config via `@theme`. Single `@import "tailwindcss"`. OKLCH colors. Container queries built-in.
|
|
92
|
+
|
|
93
|
+
**shadcn/ui v3.6**: Copy-paste Radix components. Visual styles: Vega/Nova/Maia/Lyra/Mira. New: Field, InputGroup, Spinner, ButtonGroup.
|
|
94
|
+
|
|
95
|
+
**Motion**: `import { motion, AnimatePresence } from 'motion/react'`. Declarative React animations. Use `tailwindcss-animate` for shadcn states.
|
|
96
|
+
|
|
97
|
+
## Typography
|
|
98
|
+
|
|
99
|
+
Choose beautiful, unique fonts. Pair distinctive display with refined body:
|
|
100
|
+
|
|
101
|
+
```css
|
|
102
|
+
@theme {
|
|
103
|
+
--font-display: "Playfair Display", serif;
|
|
104
|
+
--font-body: "Source Sans 3", sans-serif;
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Color
|
|
109
|
+
|
|
110
|
+
Use OKLCH for vivid colors. Dominant colors with sharp accents:
|
|
111
|
+
|
|
112
|
+
```css
|
|
113
|
+
@theme {
|
|
114
|
+
--color-primary-500: oklch(0.55 0.22 264);
|
|
115
|
+
--color-accent: oklch(0.75 0.18 45);
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Motion
|
|
120
|
+
|
|
121
|
+
**Primary**: Motion for React animations. **Fallback**: CSS `@starting-style` for simple enter/exit.
|
|
122
|
+
|
|
123
|
+
```tsx
|
|
124
|
+
import { motion, AnimatePresence } from 'motion/react';
|
|
125
|
+
|
|
126
|
+
// Basic animation
|
|
127
|
+
<motion.div initial={{ opacity: 0 }} animate={{ opacity: 1 }} />
|
|
128
|
+
|
|
129
|
+
// Exit animations
|
|
130
|
+
<AnimatePresence>
|
|
131
|
+
{show && <motion.div exit={{ opacity: 0 }} />}
|
|
132
|
+
</AnimatePresence>
|
|
133
|
+
|
|
134
|
+
// Layout animations
|
|
135
|
+
<motion.div layout />
|
|
136
|
+
|
|
137
|
+
// Gestures
|
|
138
|
+
<motion.button whileHover={{ scale: 1.05 }} whileTap={{ scale: 0.95 }} />
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
CSS fallback (no JS):
|
|
142
|
+
```css
|
|
143
|
+
dialog[open] {
|
|
144
|
+
opacity: 1;
|
|
145
|
+
@starting-style { opacity: 0; transform: scale(0.95); }
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Spatial Composition
|
|
150
|
+
|
|
151
|
+
Unexpected layouts. Asymmetry. Overlap. Diagonal flow. Grid-breaking elements. Generous negative space OR controlled density.
|
|
152
|
+
|
|
153
|
+
## Backgrounds
|
|
154
|
+
|
|
155
|
+
Create atmosphere: gradient meshes, noise textures, geometric patterns, layered transparencies, dramatic shadows, grain overlays.
|