opencodekit 0.8.0 → 0.9.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.
- package/dist/index.js +1 -1
- package/dist/template/.opencode/AGENTS.md +5 -6
- package/dist/template/.opencode/README.md +14 -19
- package/dist/template/.opencode/agent/build.md +4 -6
- package/dist/template/.opencode/agent/explore.md +18 -18
- package/dist/template/.opencode/agent/planner.md +4 -7
- package/dist/template/.opencode/agent/review.md +1 -2
- package/dist/template/.opencode/agent/rush.md +4 -6
- package/dist/template/.opencode/agent/scout.md +45 -38
- package/dist/template/.opencode/agent/vision.md +16 -24
- package/dist/template/.opencode/command/handoff.md +8 -12
- package/dist/template/.opencode/command/research.md +10 -10
- package/dist/template/.opencode/command/status.md +4 -6
- package/dist/template/.opencode/opencode.json +1 -23
- package/dist/template/.opencode/plugin/skill-mcp.ts +458 -0
- package/dist/template/.opencode/skill/figma/SKILL.md +214 -0
- package/dist/template/.opencode/skill/playwright/SKILL.md +187 -0
- package/package.json +1 -1
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: playwright
|
|
3
|
+
description: Browser automation with Playwright MCP. Test pages, fill forms, take screenshots, check responsive design, validate UX, test login flows. Use when user wants to test websites or automate browser interactions.
|
|
4
|
+
mcp:
|
|
5
|
+
playwright:
|
|
6
|
+
command: npx
|
|
7
|
+
args: ["@playwright/mcp@latest"]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Playwright Browser Automation (MCP)
|
|
11
|
+
|
|
12
|
+
Browser automation via Playwright MCP server. When this skill is loaded, the `playwright` MCP server auto-starts and exposes browser tools.
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
After loading this skill, use `skill_mcp` to invoke browser tools:
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
skill_mcp(mcp_name="playwright", tool_name="browser_navigate", arguments='{"url": "https://example.com"}')
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Available Tools
|
|
23
|
+
|
|
24
|
+
### Navigation & Page
|
|
25
|
+
|
|
26
|
+
| Tool | Description | Arguments |
|
|
27
|
+
| -------------------- | ---------------------- | ----------------------------------- |
|
|
28
|
+
| `browser_navigate` | Navigate to URL | `{"url": "https://..."}` |
|
|
29
|
+
| `browser_go_back` | Go back | `{}` |
|
|
30
|
+
| `browser_go_forward` | Go forward | `{}` |
|
|
31
|
+
| `browser_wait_for` | Wait for text/selector | `{"text": "...", "timeout": 10000}` |
|
|
32
|
+
|
|
33
|
+
### Interaction
|
|
34
|
+
|
|
35
|
+
| Tool | Description | Arguments |
|
|
36
|
+
| ----------------------- | ------------------------- | ---------------------------------------------------------------------------------- |
|
|
37
|
+
| `browser_click` | Click element | `{"element": "Submit button", "ref": "e123"}` |
|
|
38
|
+
| `browser_type` | Type text | `{"element": "Search input", "ref": "e456", "text": "query"}` |
|
|
39
|
+
| `browser_fill` | Fill input (clears first) | `{"element": "Email field", "ref": "e789", "text": "test@example.com"}` |
|
|
40
|
+
| `browser_select_option` | Select dropdown option | `{"element": "Country", "ref": "e012", "values": ["US"]}` |
|
|
41
|
+
| `browser_hover` | Hover over element | `{"element": "Menu", "ref": "e345"}` |
|
|
42
|
+
| `browser_drag` | Drag and drop | `{"startElement": "...", "startRef": "...", "endElement": "...", "endRef": "..."}` |
|
|
43
|
+
|
|
44
|
+
### Screenshots & Content
|
|
45
|
+
|
|
46
|
+
| Tool | Description | Arguments |
|
|
47
|
+
| ------------------------- | ------------------------------- | -------------------------------------- |
|
|
48
|
+
| `browser_take_screenshot` | Capture screenshot | `{"filename": "screenshot.png"}` |
|
|
49
|
+
| `browser_snapshot` | Get page accessibility snapshot | `{}` |
|
|
50
|
+
| `browser_evaluate` | Run JavaScript | `{"function": "() => document.title"}` |
|
|
51
|
+
| `browser_pdf_save` | Save page as PDF | `{"filename": "page.pdf"}` |
|
|
52
|
+
|
|
53
|
+
### Viewport & Device
|
|
54
|
+
|
|
55
|
+
| Tool | Description | Arguments |
|
|
56
|
+
| ---------------- | --------------- | ------------------------------------------------------------ |
|
|
57
|
+
| `browser_resize` | Resize viewport | `{"width": 375, "height": 667}` or `{"device": "iPhone 13"}` |
|
|
58
|
+
|
|
59
|
+
### Tabs
|
|
60
|
+
|
|
61
|
+
| Tool | Description | Arguments |
|
|
62
|
+
| -------------------- | -------------- | ------------------------ |
|
|
63
|
+
| `browser_tab_list` | List open tabs | `{}` |
|
|
64
|
+
| `browser_tab_new` | Open new tab | `{"url": "https://..."}` |
|
|
65
|
+
| `browser_tab_select` | Switch to tab | `{"index": 0}` |
|
|
66
|
+
| `browser_tab_close` | Close tab | `{"index": 0}` |
|
|
67
|
+
|
|
68
|
+
## Workflow
|
|
69
|
+
|
|
70
|
+
1. **Navigate** to the target URL
|
|
71
|
+
2. **Snapshot** to see page structure and element refs
|
|
72
|
+
3. **Interact** using element refs from snapshot
|
|
73
|
+
4. **Screenshot** to capture results
|
|
74
|
+
|
|
75
|
+
## Examples
|
|
76
|
+
|
|
77
|
+
### Test a Page
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
# Navigate
|
|
81
|
+
skill_mcp(mcp_name="playwright", tool_name="browser_navigate", arguments='{"url": "http://localhost:3000"}')
|
|
82
|
+
|
|
83
|
+
# Get page snapshot (shows elements with refs)
|
|
84
|
+
skill_mcp(mcp_name="playwright", tool_name="browser_snapshot")
|
|
85
|
+
|
|
86
|
+
# Take screenshot
|
|
87
|
+
skill_mcp(mcp_name="playwright", tool_name="browser_take_screenshot", arguments='{"filename": "/tmp/homepage.png"}')
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Fill a Form
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
# Navigate to form
|
|
94
|
+
skill_mcp(mcp_name="playwright", tool_name="browser_navigate", arguments='{"url": "http://localhost:3000/contact"}')
|
|
95
|
+
|
|
96
|
+
# Get snapshot to find element refs
|
|
97
|
+
skill_mcp(mcp_name="playwright", tool_name="browser_snapshot")
|
|
98
|
+
|
|
99
|
+
# Fill fields (use refs from snapshot)
|
|
100
|
+
skill_mcp(mcp_name="playwright", tool_name="browser_fill", arguments='{"element": "Name input", "ref": "e12", "text": "John Doe"}')
|
|
101
|
+
skill_mcp(mcp_name="playwright", tool_name="browser_fill", arguments='{"element": "Email input", "ref": "e34", "text": "john@example.com"}')
|
|
102
|
+
|
|
103
|
+
# Submit
|
|
104
|
+
skill_mcp(mcp_name="playwright", tool_name="browser_click", arguments='{"element": "Submit button", "ref": "e56"}')
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Test Responsive Design
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
# Navigate
|
|
111
|
+
skill_mcp(mcp_name="playwright", tool_name="browser_navigate", arguments='{"url": "http://localhost:3000"}')
|
|
112
|
+
|
|
113
|
+
# Desktop
|
|
114
|
+
skill_mcp(mcp_name="playwright", tool_name="browser_resize", arguments='{"width": 1920, "height": 1080}')
|
|
115
|
+
skill_mcp(mcp_name="playwright", tool_name="browser_take_screenshot", arguments='{"filename": "/tmp/desktop.png"}')
|
|
116
|
+
|
|
117
|
+
# Tablet
|
|
118
|
+
skill_mcp(mcp_name="playwright", tool_name="browser_resize", arguments='{"device": "iPad Pro 11"}')
|
|
119
|
+
skill_mcp(mcp_name="playwright", tool_name="browser_take_screenshot", arguments='{"filename": "/tmp/tablet.png"}')
|
|
120
|
+
|
|
121
|
+
# Mobile
|
|
122
|
+
skill_mcp(mcp_name="playwright", tool_name="browser_resize", arguments='{"device": "iPhone 13"}')
|
|
123
|
+
skill_mcp(mcp_name="playwright", tool_name="browser_take_screenshot", arguments='{"filename": "/tmp/mobile.png"}')
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Test Login Flow
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
# Navigate to login
|
|
130
|
+
skill_mcp(mcp_name="playwright", tool_name="browser_navigate", arguments='{"url": "http://localhost:3000/login"}')
|
|
131
|
+
|
|
132
|
+
# Snapshot to get refs
|
|
133
|
+
skill_mcp(mcp_name="playwright", tool_name="browser_snapshot")
|
|
134
|
+
|
|
135
|
+
# Fill credentials
|
|
136
|
+
skill_mcp(mcp_name="playwright", tool_name="browser_fill", arguments='{"element": "Email", "ref": "e10", "text": "test@example.com"}')
|
|
137
|
+
skill_mcp(mcp_name="playwright", tool_name="browser_fill", arguments='{"element": "Password", "ref": "e20", "text": "password123"}')
|
|
138
|
+
|
|
139
|
+
# Click login
|
|
140
|
+
skill_mcp(mcp_name="playwright", tool_name="browser_click", arguments='{"element": "Login button", "ref": "e30"}')
|
|
141
|
+
|
|
142
|
+
# Wait for redirect
|
|
143
|
+
skill_mcp(mcp_name="playwright", tool_name="browser_wait_for", arguments='{"text": "Dashboard", "timeout": 10000}')
|
|
144
|
+
|
|
145
|
+
# Screenshot success
|
|
146
|
+
skill_mcp(mcp_name="playwright", tool_name="browser_take_screenshot", arguments='{"filename": "/tmp/logged-in.png"}')
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Run JavaScript
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
# Get page title
|
|
153
|
+
skill_mcp(mcp_name="playwright", tool_name="browser_evaluate", arguments='{"function": "() => document.title"}')
|
|
154
|
+
|
|
155
|
+
# Get all links
|
|
156
|
+
skill_mcp(mcp_name="playwright", tool_name="browser_evaluate", arguments='{"function": "() => Array.from(document.querySelectorAll(\"a\")).map(a => a.href)"}')
|
|
157
|
+
|
|
158
|
+
# Scroll to bottom
|
|
159
|
+
skill_mcp(mcp_name="playwright", tool_name="browser_evaluate", arguments='{"function": "() => window.scrollTo(0, document.body.scrollHeight)"}')
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Server Options
|
|
163
|
+
|
|
164
|
+
For advanced usage, modify the MCP args in frontmatter:
|
|
165
|
+
|
|
166
|
+
```yaml
|
|
167
|
+
mcp:
|
|
168
|
+
playwright:
|
|
169
|
+
command: npx
|
|
170
|
+
args: ["@playwright/mcp@latest", "--headless", "--browser=firefox"]
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Common options:
|
|
174
|
+
|
|
175
|
+
- `--headless` - Run without visible browser
|
|
176
|
+
- `--browser=chrome|firefox|webkit` - Choose browser
|
|
177
|
+
- `--device="iPhone 13"` - Emulate device
|
|
178
|
+
- `--viewport-size=1280x720` - Set viewport
|
|
179
|
+
- `--user-data-dir=/path` - Persist browser data
|
|
180
|
+
|
|
181
|
+
## Tips
|
|
182
|
+
|
|
183
|
+
- **Always snapshot first** to get element refs before interacting
|
|
184
|
+
- **Use descriptive element names** in click/fill for clarity
|
|
185
|
+
- **Save screenshots to /tmp** for easy access
|
|
186
|
+
- **Use device presets** for accurate mobile emulation
|
|
187
|
+
- **Chain wait_for** after navigation for dynamic pages
|