@willbooster/agent-skills 1.16.0 → 1.17.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/README.md +6 -0
- package/dist/cli.js +3 -3
- package/package.json +3 -2
- package/skills/check-pr-ci/SKILL.md +12 -0
- package/skills/complete-pr/SKILL.md +32 -0
- package/skills/fetch-issue/SKILL.md +9 -0
- package/skills/fetch-pr/SKILL.md +9 -0
- package/skills/fix-bug/SKILL.md +21 -0
- package/skills/manage-pr-review-threads/SKILL.md +35 -0
- package/skills/open-pr/SKILL.md +39 -0
- package/skills/plan-issue-claude/SKILL.md +10 -0
- package/skills/plan-issue-codex/SKILL.md +10 -0
- package/skills/plan-issue-gemini/SKILL.md +10 -0
- package/skills/playwright-cli/SKILL.md +331 -0
- package/skills/playwright-cli/references/element-attributes.md +23 -0
- package/skills/playwright-cli/references/playwright-tests.md +39 -0
- package/skills/playwright-cli/references/request-mocking.md +87 -0
- package/skills/playwright-cli/references/running-code.md +231 -0
- package/skills/playwright-cli/references/session-management.md +170 -0
- package/skills/playwright-cli/references/storage-state.md +275 -0
- package/skills/playwright-cli/references/test-generation.md +88 -0
- package/skills/playwright-cli/references/tracing.md +142 -0
- package/skills/playwright-cli/references/video-recording.md +146 -0
- package/skills/refactor-structure/SKILL.md +12 -0
- package/skills/review-all/SKILL.md +13 -0
- package/skills/review-claude/SKILL.md +10 -0
- package/skills/review-codex/SKILL.md +10 -0
- package/skills/review-fix-all/SKILL.md +17 -0
- package/skills/review-fix-claude/SKILL.md +15 -0
- package/skills/review-fix-codex/SKILL.md +15 -0
- package/skills/review-fix-gemini/SKILL.md +15 -0
- package/skills/review-gemini/SKILL.md +10 -0
- package/skills/screenshot-claude/SKILL.md +13 -0
- package/skills/screenshot-codex/SKILL.md +13 -0
- package/skills/screenshot-gemini/SKILL.md +13 -0
- package/skills/simplify-pr-claude/SKILL.md +10 -0
- package/skills/simplify-pr-codex/SKILL.md +10 -0
- package/skills/simplify-pr-gemini/SKILL.md +10 -0
- package/skills/update-pr/SKILL.md +60 -0
- package/skills/wbfy/SKILL.md +17 -0
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
# Storage Management
|
|
2
|
+
|
|
3
|
+
Manage cookies, localStorage, sessionStorage, and browser storage state.
|
|
4
|
+
|
|
5
|
+
## Storage State
|
|
6
|
+
|
|
7
|
+
Save and restore complete browser state including cookies and storage.
|
|
8
|
+
|
|
9
|
+
### Save Storage State
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Save to auto-generated filename (storage-state-{timestamp}.json)
|
|
13
|
+
bunx @playwright/cli@latest state-save
|
|
14
|
+
|
|
15
|
+
# Save to specific filename
|
|
16
|
+
bunx @playwright/cli@latest state-save my-auth-state.json
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Restore Storage State
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Load storage state from file
|
|
23
|
+
bunx @playwright/cli@latest state-load my-auth-state.json
|
|
24
|
+
|
|
25
|
+
# Reload page to apply cookies
|
|
26
|
+
bunx @playwright/cli@latest open https://example.com
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Storage State File Format
|
|
30
|
+
|
|
31
|
+
The saved file contains:
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"cookies": [
|
|
36
|
+
{
|
|
37
|
+
"name": "session_id",
|
|
38
|
+
"value": "abc123",
|
|
39
|
+
"domain": "example.com",
|
|
40
|
+
"path": "/",
|
|
41
|
+
"expires": 1735689600,
|
|
42
|
+
"httpOnly": true,
|
|
43
|
+
"secure": true,
|
|
44
|
+
"sameSite": "Lax"
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"origins": [
|
|
48
|
+
{
|
|
49
|
+
"origin": "https://example.com",
|
|
50
|
+
"localStorage": [
|
|
51
|
+
{ "name": "theme", "value": "dark" },
|
|
52
|
+
{ "name": "user_id", "value": "12345" }
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Cookies
|
|
60
|
+
|
|
61
|
+
### List All Cookies
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
bunx @playwright/cli@latest cookie-list
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Filter Cookies by Domain
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
bunx @playwright/cli@latest cookie-list --domain=example.com
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Filter Cookies by Path
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
bunx @playwright/cli@latest cookie-list --path=/api
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Get Specific Cookie
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
bunx @playwright/cli@latest cookie-get session_id
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Set a Cookie
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# Basic cookie
|
|
89
|
+
bunx @playwright/cli@latest cookie-set session abc123
|
|
90
|
+
|
|
91
|
+
# Cookie with options
|
|
92
|
+
bunx @playwright/cli@latest cookie-set session abc123 --domain=example.com --path=/ --httpOnly --secure --sameSite=Lax
|
|
93
|
+
|
|
94
|
+
# Cookie with expiration (Unix timestamp)
|
|
95
|
+
bunx @playwright/cli@latest cookie-set remember_me token123 --expires=1735689600
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Delete a Cookie
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
bunx @playwright/cli@latest cookie-delete session_id
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Clear All Cookies
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
bunx @playwright/cli@latest cookie-clear
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Advanced: Multiple Cookies or Custom Options
|
|
111
|
+
|
|
112
|
+
For complex scenarios like adding multiple cookies at once, use `run-code`:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
bunx @playwright/cli@latest run-code "async page => {
|
|
116
|
+
await page.context().addCookies([
|
|
117
|
+
{ name: 'session_id', value: 'sess_abc123', domain: 'example.com', path: '/', httpOnly: true },
|
|
118
|
+
{ name: 'preferences', value: JSON.stringify({ theme: 'dark' }), domain: 'example.com', path: '/' }
|
|
119
|
+
]);
|
|
120
|
+
}"
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Local Storage
|
|
124
|
+
|
|
125
|
+
### List All localStorage Items
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
bunx @playwright/cli@latest localstorage-list
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Get Single Value
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
bunx @playwright/cli@latest localstorage-get token
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Set Value
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
bunx @playwright/cli@latest localstorage-set theme dark
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Set JSON Value
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
bunx @playwright/cli@latest localstorage-set user_settings '{"theme":"dark","language":"en"}'
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Delete Single Item
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
bunx @playwright/cli@latest localstorage-delete token
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Clear All localStorage
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
bunx @playwright/cli@latest localstorage-clear
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Advanced: Multiple Operations
|
|
162
|
+
|
|
163
|
+
For complex scenarios like setting multiple values at once, use `run-code`:
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
bunx @playwright/cli@latest run-code "async page => {
|
|
167
|
+
await page.evaluate(() => {
|
|
168
|
+
localStorage.setItem('token', 'jwt_abc123');
|
|
169
|
+
localStorage.setItem('user_id', '12345');
|
|
170
|
+
localStorage.setItem('expires_at', Date.now() + 3600000);
|
|
171
|
+
});
|
|
172
|
+
}"
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Session Storage
|
|
176
|
+
|
|
177
|
+
### List All sessionStorage Items
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
bunx @playwright/cli@latest sessionstorage-list
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Get Single Value
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
bunx @playwright/cli@latest sessionstorage-get form_data
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### Set Value
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
bunx @playwright/cli@latest sessionstorage-set step 3
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Delete Single Item
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
bunx @playwright/cli@latest sessionstorage-delete step
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Clear sessionStorage
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
bunx @playwright/cli@latest sessionstorage-clear
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## IndexedDB
|
|
208
|
+
|
|
209
|
+
### List Databases
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
bunx @playwright/cli@latest run-code "async page => {
|
|
213
|
+
return await page.evaluate(async () => {
|
|
214
|
+
const databases = await indexedDB.databases();
|
|
215
|
+
return databases;
|
|
216
|
+
});
|
|
217
|
+
}"
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### Delete Database
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
bunx @playwright/cli@latest run-code "async page => {
|
|
224
|
+
await page.evaluate(() => {
|
|
225
|
+
indexedDB.deleteDatabase('myDatabase');
|
|
226
|
+
});
|
|
227
|
+
}"
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## Common Patterns
|
|
231
|
+
|
|
232
|
+
### Authentication State Reuse
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
# Step 1: Login and save state
|
|
236
|
+
bunx @playwright/cli@latest open https://app.example.com/login
|
|
237
|
+
bunx @playwright/cli@latest snapshot
|
|
238
|
+
bunx @playwright/cli@latest fill e1 "user@example.com"
|
|
239
|
+
bunx @playwright/cli@latest fill e2 "password123"
|
|
240
|
+
bunx @playwright/cli@latest click e3
|
|
241
|
+
|
|
242
|
+
# Save the authenticated state
|
|
243
|
+
bunx @playwright/cli@latest state-save auth.json
|
|
244
|
+
|
|
245
|
+
# Step 2: Later, restore state and skip login
|
|
246
|
+
bunx @playwright/cli@latest state-load auth.json
|
|
247
|
+
bunx @playwright/cli@latest open https://app.example.com/dashboard
|
|
248
|
+
# Already logged in!
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### Save and Restore Roundtrip
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
# Set up authentication state
|
|
255
|
+
bunx @playwright/cli@latest open https://example.com
|
|
256
|
+
bunx @playwright/cli@latest eval "() => { document.cookie = 'session=abc123'; localStorage.setItem('user', 'john'); }"
|
|
257
|
+
|
|
258
|
+
# Save state to file
|
|
259
|
+
bunx @playwright/cli@latest state-save my-session.json
|
|
260
|
+
|
|
261
|
+
# ... later, in a new session ...
|
|
262
|
+
|
|
263
|
+
# Restore state
|
|
264
|
+
bunx @playwright/cli@latest state-load my-session.json
|
|
265
|
+
bunx @playwright/cli@latest open https://example.com
|
|
266
|
+
# Cookies and localStorage are restored!
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
## Security Notes
|
|
270
|
+
|
|
271
|
+
- Never commit storage state files containing auth tokens
|
|
272
|
+
- Add `*.auth-state.json` to `.gitignore`
|
|
273
|
+
- Delete state files after automation completes
|
|
274
|
+
- Use environment variables for sensitive data
|
|
275
|
+
- By default, sessions run in-memory mode which is safer for sensitive operations
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Test Generation
|
|
2
|
+
|
|
3
|
+
Generate Playwright test code automatically as you interact with the browser.
|
|
4
|
+
|
|
5
|
+
## How It Works
|
|
6
|
+
|
|
7
|
+
Every action you perform with `playwright-cli` generates corresponding Playwright TypeScript code.
|
|
8
|
+
This code appears in the output and can be copied directly into your test files.
|
|
9
|
+
|
|
10
|
+
## Example Workflow
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
# Start a session
|
|
14
|
+
bunx @playwright/cli@latest open https://example.com/login
|
|
15
|
+
|
|
16
|
+
# Take a snapshot to see elements
|
|
17
|
+
bunx @playwright/cli@latest snapshot
|
|
18
|
+
# Output shows: e1 [textbox "Email"], e2 [textbox "Password"], e3 [button "Sign In"]
|
|
19
|
+
|
|
20
|
+
# Fill form fields - generates code automatically
|
|
21
|
+
bunx @playwright/cli@latest fill e1 "user@example.com"
|
|
22
|
+
# Ran Playwright code:
|
|
23
|
+
# await page.getByRole('textbox', { name: 'Email' }).fill('user@example.com');
|
|
24
|
+
|
|
25
|
+
bunx @playwright/cli@latest fill e2 "password123"
|
|
26
|
+
# Ran Playwright code:
|
|
27
|
+
# await page.getByRole('textbox', { name: 'Password' }).fill('password123');
|
|
28
|
+
|
|
29
|
+
bunx @playwright/cli@latest click e3
|
|
30
|
+
# Ran Playwright code:
|
|
31
|
+
# await page.getByRole('button', { name: 'Sign In' }).click();
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Building a Test File
|
|
35
|
+
|
|
36
|
+
Collect the generated code into a Playwright test:
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
import { test, expect } from '@playwright/test';
|
|
40
|
+
|
|
41
|
+
test('login flow', async ({ page }) => {
|
|
42
|
+
// Generated code from playwright-cli session:
|
|
43
|
+
await page.goto('https://example.com/login');
|
|
44
|
+
await page.getByRole('textbox', { name: 'Email' }).fill('user@example.com');
|
|
45
|
+
await page.getByRole('textbox', { name: 'Password' }).fill('password123');
|
|
46
|
+
await page.getByRole('button', { name: 'Sign In' }).click();
|
|
47
|
+
|
|
48
|
+
// Add assertions
|
|
49
|
+
await expect(page).toHaveURL(/.*dashboard/);
|
|
50
|
+
});
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Best Practices
|
|
54
|
+
|
|
55
|
+
### 1. Use Semantic Locators
|
|
56
|
+
|
|
57
|
+
The generated code uses role-based locators when possible, which are more resilient:
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
// Generated (good - semantic)
|
|
61
|
+
await page.getByRole('button', { name: 'Submit' }).click();
|
|
62
|
+
|
|
63
|
+
// Avoid (fragile - CSS selectors)
|
|
64
|
+
await page.locator('#submit-btn').click();
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### 2. Explore Before Recording
|
|
68
|
+
|
|
69
|
+
Take snapshots to understand the page structure before recording actions:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
bunx @playwright/cli@latest open https://example.com
|
|
73
|
+
bunx @playwright/cli@latest snapshot
|
|
74
|
+
# Review the element structure
|
|
75
|
+
bunx @playwright/cli@latest click e5
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### 3. Add Assertions Manually
|
|
79
|
+
|
|
80
|
+
Generated code captures actions but not assertions. Add expectations in your test:
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
// Generated action
|
|
84
|
+
await page.getByRole('button', { name: 'Submit' }).click();
|
|
85
|
+
|
|
86
|
+
// Manual assertion
|
|
87
|
+
await expect(page.getByText('Success')).toBeVisible();
|
|
88
|
+
```
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Tracing
|
|
2
|
+
|
|
3
|
+
Capture detailed execution traces for debugging and analysis. Traces include DOM snapshots, screenshots, network activity, and console logs.
|
|
4
|
+
|
|
5
|
+
## Basic Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Start trace recording
|
|
9
|
+
bunx @playwright/cli@latest tracing-start
|
|
10
|
+
|
|
11
|
+
# Perform actions
|
|
12
|
+
bunx @playwright/cli@latest open https://example.com
|
|
13
|
+
bunx @playwright/cli@latest click e1
|
|
14
|
+
bunx @playwright/cli@latest fill e2 "test"
|
|
15
|
+
|
|
16
|
+
# Stop trace recording
|
|
17
|
+
bunx @playwright/cli@latest tracing-stop
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Trace Output Files
|
|
21
|
+
|
|
22
|
+
When you start tracing, Playwright creates a `traces/` directory with several files:
|
|
23
|
+
|
|
24
|
+
### `trace-{timestamp}.trace`
|
|
25
|
+
|
|
26
|
+
**Action log** - The main trace file containing:
|
|
27
|
+
|
|
28
|
+
- Every action performed (clicks, fills, navigations)
|
|
29
|
+
- DOM snapshots before and after each action
|
|
30
|
+
- Screenshots at each step
|
|
31
|
+
- Timing information
|
|
32
|
+
- Console messages
|
|
33
|
+
- Source locations
|
|
34
|
+
|
|
35
|
+
### `trace-{timestamp}.network`
|
|
36
|
+
|
|
37
|
+
**Network log** - Complete network activity:
|
|
38
|
+
|
|
39
|
+
- All HTTP requests and responses
|
|
40
|
+
- Request headers and bodies
|
|
41
|
+
- Response headers and bodies
|
|
42
|
+
- Timing (DNS, connect, TLS, TTFB, download)
|
|
43
|
+
- Resource sizes
|
|
44
|
+
- Failed requests and errors
|
|
45
|
+
|
|
46
|
+
### `resources/`
|
|
47
|
+
|
|
48
|
+
**Resources directory** - Cached resources:
|
|
49
|
+
|
|
50
|
+
- Images, fonts, stylesheets, scripts
|
|
51
|
+
- Response bodies for replay
|
|
52
|
+
- Assets needed to reconstruct page state
|
|
53
|
+
|
|
54
|
+
## What Traces Capture
|
|
55
|
+
|
|
56
|
+
| Category | Details |
|
|
57
|
+
| --------------- | -------------------------------------------------- |
|
|
58
|
+
| **Actions** | Clicks, fills, hovers, keyboard input, navigations |
|
|
59
|
+
| **DOM** | Full DOM snapshot before/after each action |
|
|
60
|
+
| **Screenshots** | Visual state at each step |
|
|
61
|
+
| **Network** | All requests, responses, headers, bodies, timing |
|
|
62
|
+
| **Console** | All console.log, warn, error messages |
|
|
63
|
+
| **Timing** | Precise timing for each operation |
|
|
64
|
+
|
|
65
|
+
## Use Cases
|
|
66
|
+
|
|
67
|
+
### Debugging Failed Actions
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
bunx @playwright/cli@latest tracing-start
|
|
71
|
+
bunx @playwright/cli@latest open https://app.example.com
|
|
72
|
+
|
|
73
|
+
# This click fails - why?
|
|
74
|
+
bunx @playwright/cli@latest click e5
|
|
75
|
+
|
|
76
|
+
bunx @playwright/cli@latest tracing-stop
|
|
77
|
+
# Open trace to see DOM state when click was attempted
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Analyzing Performance
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
bunx @playwright/cli@latest tracing-start
|
|
84
|
+
bunx @playwright/cli@latest open https://slow-site.com
|
|
85
|
+
bunx @playwright/cli@latest tracing-stop
|
|
86
|
+
|
|
87
|
+
# View network waterfall to identify slow resources
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Capturing Evidence
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Record a complete user flow for documentation
|
|
94
|
+
bunx @playwright/cli@latest tracing-start
|
|
95
|
+
|
|
96
|
+
bunx @playwright/cli@latest open https://app.example.com/checkout
|
|
97
|
+
bunx @playwright/cli@latest fill e1 "4111111111111111"
|
|
98
|
+
bunx @playwright/cli@latest fill e2 "12/25"
|
|
99
|
+
bunx @playwright/cli@latest fill e3 "123"
|
|
100
|
+
bunx @playwright/cli@latest click e4
|
|
101
|
+
|
|
102
|
+
bunx @playwright/cli@latest tracing-stop
|
|
103
|
+
# Trace shows exact sequence of events
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Trace vs Video vs Screenshot
|
|
107
|
+
|
|
108
|
+
| Feature | Trace | Video | Screenshot |
|
|
109
|
+
| ----------------------- | ----------- | ----------- | ---------------- |
|
|
110
|
+
| **Format** | .trace file | .webm video | .png/.jpeg image |
|
|
111
|
+
| **DOM inspection** | Yes | No | No |
|
|
112
|
+
| **Network details** | Yes | No | No |
|
|
113
|
+
| **Step-by-step replay** | Yes | Continuous | Single frame |
|
|
114
|
+
| **File size** | Medium | Large | Small |
|
|
115
|
+
| **Best for** | Debugging | Demos | Quick capture |
|
|
116
|
+
|
|
117
|
+
## Best Practices
|
|
118
|
+
|
|
119
|
+
### 1. Start Tracing Before the Problem
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# Trace the entire flow, not just the failing step
|
|
123
|
+
bunx @playwright/cli@latest tracing-start
|
|
124
|
+
bunx @playwright/cli@latest open https://example.com
|
|
125
|
+
# ... all steps leading to the issue ...
|
|
126
|
+
bunx @playwright/cli@latest tracing-stop
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### 2. Clean Up Old Traces
|
|
130
|
+
|
|
131
|
+
Traces can consume significant disk space:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# Remove traces older than 7 days
|
|
135
|
+
find .playwright-cli/traces -mtime +7 -delete
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Limitations
|
|
139
|
+
|
|
140
|
+
- Traces add overhead to automation
|
|
141
|
+
- Large traces can consume significant disk space
|
|
142
|
+
- Some dynamic content may not replay perfectly
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# Video Recording
|
|
2
|
+
|
|
3
|
+
Capture browser automation sessions as video for debugging, documentation, or verification. Produces WebM (VP8/VP9 codec).
|
|
4
|
+
|
|
5
|
+
## Basic Recording
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Open browser first
|
|
9
|
+
bunx @playwright/cli@latest open
|
|
10
|
+
|
|
11
|
+
# Start recording
|
|
12
|
+
bunx @playwright/cli@latest video-start demo.webm
|
|
13
|
+
|
|
14
|
+
# Add a chapter marker for section transitions
|
|
15
|
+
bunx @playwright/cli@latest video-chapter "Getting Started" --description="Opening the homepage" --duration=2000
|
|
16
|
+
|
|
17
|
+
# Navigate and perform actions
|
|
18
|
+
bunx @playwright/cli@latest goto https://example.com
|
|
19
|
+
bunx @playwright/cli@latest snapshot
|
|
20
|
+
bunx @playwright/cli@latest click e1
|
|
21
|
+
|
|
22
|
+
# Add another chapter
|
|
23
|
+
bunx @playwright/cli@latest video-chapter "Filling Form" --description="Entering test data" --duration=2000
|
|
24
|
+
bunx @playwright/cli@latest fill e2 "test input"
|
|
25
|
+
|
|
26
|
+
# Stop and save
|
|
27
|
+
bunx @playwright/cli@latest video-stop
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Best Practices
|
|
31
|
+
|
|
32
|
+
### 1. Use Descriptive Filenames
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# Include context in filename
|
|
36
|
+
bunx @playwright/cli@latest video-start recordings/login-flow-2024-01-15.webm
|
|
37
|
+
bunx @playwright/cli@latest video-start recordings/checkout-test-run-42.webm
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### 2. Record entire hero scripts.
|
|
41
|
+
|
|
42
|
+
When recording a video for the user or as a proof of work, it is best to create a code snippet and execute it with run-code.
|
|
43
|
+
It allows pulling appropriate pauses between the actions and annotating the video. There are new Playwright APIs for that.
|
|
44
|
+
|
|
45
|
+
1. Perform scenario using CLI and take note of all locators and actions. You'll need those locators to request thier bounding boxes for highlight.
|
|
46
|
+
2. Create a file with the intended script for video (below). Use pressSequentially w/ delay for nice typing, make reasonable pauses.
|
|
47
|
+
3. Use playwright-cli run-code --file your-script.js
|
|
48
|
+
|
|
49
|
+
**Important**: Overlays are `pointer-events: none` — they do not interfere with page interactions. You can safely keep sticky overlays visible while clicking, filling, or performing any actions on the page.
|
|
50
|
+
|
|
51
|
+
```js
|
|
52
|
+
async (page) => {
|
|
53
|
+
await page.screencast.start({ path: 'video.webm', size: { width: 1280, height: 800 } });
|
|
54
|
+
await page.goto('https://demo.playwright.dev/todomvc');
|
|
55
|
+
|
|
56
|
+
// Show a chapter card — blurs the page and shows a dialog.
|
|
57
|
+
// Blocks until duration expires, then auto-removes.
|
|
58
|
+
// Use this for simple use cases, but always feel free to hand-craft your own beautiful
|
|
59
|
+
// overlay via await page.screencast.showOverlay().
|
|
60
|
+
await page.screencast.showChapter('Adding Todo Items', {
|
|
61
|
+
description: 'We will add several items to the todo list.',
|
|
62
|
+
duration: 2000,
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// Perform action
|
|
66
|
+
await page.getByRole('textbox', { name: 'What needs to be done?' }).pressSequentially('Walk the dog', { delay: 60 });
|
|
67
|
+
await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');
|
|
68
|
+
await page.waitForTimeout(1000);
|
|
69
|
+
|
|
70
|
+
// Show next chapter
|
|
71
|
+
await page.screencast.showChapter('Verifying Results', {
|
|
72
|
+
description: 'Checking the item appeared in the list.',
|
|
73
|
+
duration: 2000,
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// Add a sticky annotation that stays while you perform actions.
|
|
77
|
+
// Overlays are pointer-events: none, so they won't block clicks.
|
|
78
|
+
const annotation = await page.screencast.showOverlay(`
|
|
79
|
+
<div style="position: absolute; top: 8px; right: 8px;
|
|
80
|
+
padding: 6px 12px; background: rgba(0,0,0,0.7);
|
|
81
|
+
border-radius: 8px; font-size: 13px; color: white;">
|
|
82
|
+
✓ Item added successfully
|
|
83
|
+
</div>
|
|
84
|
+
`);
|
|
85
|
+
|
|
86
|
+
// Perform more actions while the annotation is visible
|
|
87
|
+
await page.getByRole('textbox', { name: 'What needs to be done?' }).pressSequentially('Buy groceries', { delay: 60 });
|
|
88
|
+
await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');
|
|
89
|
+
await page.waitForTimeout(1500);
|
|
90
|
+
|
|
91
|
+
// Remove the annotation when done
|
|
92
|
+
await annotation.dispose();
|
|
93
|
+
|
|
94
|
+
// You can also highlight relevant locators and provide contextual annotations.
|
|
95
|
+
const bounds = await page.getByText('Walk the dog').boundingBox();
|
|
96
|
+
await page.screencast.showOverlay(
|
|
97
|
+
`
|
|
98
|
+
<div style="position: absolute;
|
|
99
|
+
top: ${bounds.y}px;
|
|
100
|
+
left: ${bounds.x}px;
|
|
101
|
+
width: ${bounds.width}px;
|
|
102
|
+
height: ${bounds.height}px;
|
|
103
|
+
border: 1px solid red;">
|
|
104
|
+
</div>
|
|
105
|
+
<div style="position: absolute;
|
|
106
|
+
top: ${bounds.y + bounds.height + 5}px;
|
|
107
|
+
left: ${bounds.x + bounds.width / 2}px;
|
|
108
|
+
transform: translateX(-50%);
|
|
109
|
+
padding: 6px;
|
|
110
|
+
background: #808080;
|
|
111
|
+
border-radius: 10px;
|
|
112
|
+
font-size: 14px;
|
|
113
|
+
color: white;">Check it out, it is right above this text
|
|
114
|
+
</div>
|
|
115
|
+
`,
|
|
116
|
+
{ duration: 2000 }
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
await page.screencast.stop();
|
|
120
|
+
};
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Embrace creativity, overlays are powerful.
|
|
124
|
+
|
|
125
|
+
### Overlay API Summary
|
|
126
|
+
|
|
127
|
+
| Method | Use Case |
|
|
128
|
+
| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
|
|
129
|
+
| `page.screencast.showChapter(title, { description?, duration?, styleSheet? })` | Full-screen chapter card with blurred backdrop — ideal for section transitions |
|
|
130
|
+
| `page.screencast.showOverlay(html, { duration? })` | Custom HTML overlay — use for callouts, labels, highlights |
|
|
131
|
+
| `disposable.dispose()` | Remove a sticky overlay added without duration |
|
|
132
|
+
| `page.screencast.hideOverlays()` / `page.screencast.showOverlays()` | Temporarily hide/show all overlays |
|
|
133
|
+
|
|
134
|
+
## Tracing vs Video
|
|
135
|
+
|
|
136
|
+
| Feature | Video | Tracing |
|
|
137
|
+
| -------- | -------------------- | ---------------------------------------- |
|
|
138
|
+
| Output | WebM file | Trace file (viewable in Trace Viewer) |
|
|
139
|
+
| Shows | Visual recording | DOM snapshots, network, console, actions |
|
|
140
|
+
| Use case | Demos, documentation | Debugging, analysis |
|
|
141
|
+
| Size | Larger | Smaller |
|
|
142
|
+
|
|
143
|
+
## Limitations
|
|
144
|
+
|
|
145
|
+
- Recording adds slight overhead to automation
|
|
146
|
+
- Large recordings can consume significant disk space
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: refactor-structure
|
|
3
|
+
description: Refactor the source tree by splitting oversized files, grouping related code, and reorganizing directories without changing intended behavior.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Structure refactor workflow
|
|
7
|
+
|
|
8
|
+
1. Inspect the current layout with `tree -h src` (or `tree -h <specified_dir>`) and read the main entry points and largest nearby files.
|
|
9
|
+
2. Reorganize by responsibility to improve cohesion and reduce coupling: split oversized files, group related modules, and add directories only when they make ownership clearer.
|
|
10
|
+
3. Update imports as you go and preserve existing behavior unless broader changes are explicitly requested.
|
|
11
|
+
4. Run the lightest relevant verification, such as typecheck or lint, to catch broken imports or module wiring.
|
|
12
|
+
5. Summarize what moved and why the new structure is easier to maintain.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: review-all
|
|
3
|
+
description: Run Codex, Claude Code, and Gemini CLI reviews against the current branch concurrently, deduplicate the findings, and report only the review comments that are still valid for the current codebase.
|
|
4
|
+
allowed-tools: Bash(bunx:*), Task
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Review workflow
|
|
8
|
+
|
|
9
|
+
1. Run the following command with a 1-hour timeout (DO NOT STOP THE COMMAND BEFORE 1 HOUR ELAPSES): `bunx @willbooster/agent-skills@latest review --agent all`
|
|
10
|
+
2. Treat the combined output as a set of candidate comments returned by Codex, Claude Code, and Gemini CLI running concurrently.
|
|
11
|
+
3. Merge the returned review results into a single candidate comment set, deduplicating comments that point to the same underlying issue.
|
|
12
|
+
4. Judge whether each candidate comment is still valid in the current codebase.
|
|
13
|
+
5. Report only the comments you judged valid. If none remain, respond with exactly: `There is no concern.`
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: review-claude
|
|
3
|
+
description: Run Claude Code review against the current branch and report only the review comments that are still valid for the current codebase, without applying fixes.
|
|
4
|
+
allowed-tools: Bash(bunx:*)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Review workflow
|
|
8
|
+
|
|
9
|
+
1. Run the following command with a 1-hour timeout (DO NOT STOP THE COMMAND BEFORE 1 HOUR ELAPSES): `bunx @willbooster/agent-skills@latest review --agent claude`
|
|
10
|
+
2. Report on the review results.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: review-codex
|
|
3
|
+
description: Run Codex code review against the current branch and report only the review comments that are still valid for the current codebase, without applying fixes.
|
|
4
|
+
allowed-tools: Bash(bunx:*)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Review workflow
|
|
8
|
+
|
|
9
|
+
1. Run the following command with a 1-hour timeout (DO NOT STOP THE COMMAND BEFORE 1 HOUR ELAPSES): `bunx @willbooster/agent-skills@latest review --agent codex`
|
|
10
|
+
2. Report on the review results.
|