@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.
Files changed (40) hide show
  1. package/README.md +6 -0
  2. package/dist/cli.js +3 -3
  3. package/package.json +3 -2
  4. package/skills/check-pr-ci/SKILL.md +12 -0
  5. package/skills/complete-pr/SKILL.md +32 -0
  6. package/skills/fetch-issue/SKILL.md +9 -0
  7. package/skills/fetch-pr/SKILL.md +9 -0
  8. package/skills/fix-bug/SKILL.md +21 -0
  9. package/skills/manage-pr-review-threads/SKILL.md +35 -0
  10. package/skills/open-pr/SKILL.md +39 -0
  11. package/skills/plan-issue-claude/SKILL.md +10 -0
  12. package/skills/plan-issue-codex/SKILL.md +10 -0
  13. package/skills/plan-issue-gemini/SKILL.md +10 -0
  14. package/skills/playwright-cli/SKILL.md +331 -0
  15. package/skills/playwright-cli/references/element-attributes.md +23 -0
  16. package/skills/playwright-cli/references/playwright-tests.md +39 -0
  17. package/skills/playwright-cli/references/request-mocking.md +87 -0
  18. package/skills/playwright-cli/references/running-code.md +231 -0
  19. package/skills/playwright-cli/references/session-management.md +170 -0
  20. package/skills/playwright-cli/references/storage-state.md +275 -0
  21. package/skills/playwright-cli/references/test-generation.md +88 -0
  22. package/skills/playwright-cli/references/tracing.md +142 -0
  23. package/skills/playwright-cli/references/video-recording.md +146 -0
  24. package/skills/refactor-structure/SKILL.md +12 -0
  25. package/skills/review-all/SKILL.md +13 -0
  26. package/skills/review-claude/SKILL.md +10 -0
  27. package/skills/review-codex/SKILL.md +10 -0
  28. package/skills/review-fix-all/SKILL.md +17 -0
  29. package/skills/review-fix-claude/SKILL.md +15 -0
  30. package/skills/review-fix-codex/SKILL.md +15 -0
  31. package/skills/review-fix-gemini/SKILL.md +15 -0
  32. package/skills/review-gemini/SKILL.md +10 -0
  33. package/skills/screenshot-claude/SKILL.md +13 -0
  34. package/skills/screenshot-codex/SKILL.md +13 -0
  35. package/skills/screenshot-gemini/SKILL.md +13 -0
  36. package/skills/simplify-pr-claude/SKILL.md +10 -0
  37. package/skills/simplify-pr-codex/SKILL.md +10 -0
  38. package/skills/simplify-pr-gemini/SKILL.md +10 -0
  39. package/skills/update-pr/SKILL.md +60 -0
  40. package/skills/wbfy/SKILL.md +17 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/agent-skills",
3
- "version": "1.16.0",
3
+ "version": "1.17.0",
4
4
  "description": "A collection of agent skills for WillBooster Inc.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,7 +13,8 @@
13
13
  "agent-skills": "./dist/cli.js"
14
14
  },
15
15
  "files": [
16
- "dist/"
16
+ "dist/",
17
+ "skills/"
17
18
  ],
18
19
  "scripts": {
19
20
  "build": "build-ts app --input src/cli.ts && chmod +x dist/cli.js",
@@ -0,0 +1,12 @@
1
+ ---
2
+ name: check-pr-ci
3
+ description: Check the latest test-related CI results for the current pull request.
4
+ allowed-tools: Bash(bun:*), Bash(gh:*), Bash(git:*)
5
+ ---
6
+
7
+ # Check PR CI
8
+
9
+ Run the following command with a 1-hour timeout (DO NOT STOP THE COMMAND BEFORE 1 HOUR ELAPSES): `bunx @willbooster/agent-skills@latest check-pr-ci`
10
+
11
+ - Exit code `0`: all latest workflows succeeded.
12
+ - Exit code `1`: a latest workflow failed or test-related workflows timed out; read the output for details.
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: complete-pr
3
+ description: Complete GitHub pull requests by iterating on CI and review feedback until the PR is ready.
4
+ ---
5
+
6
+ First, fetch the current repository owner with `gh repo view --json owner --jq '.owner.login'`.
7
+ If the owner is `WillBooster` or `WillBoosterLab`, follow the first workflow below.
8
+ Otherwise, follow the second workflow below.
9
+
10
+ ## Workflow for `WillBooster` or `WillBoosterLab` repositories
11
+
12
+ 1. Read the PR body and its messages using the `fetch-pr` skill.
13
+ 2. Check the CI (GitHub Actions) results using the `check-pr-ci` skill.
14
+ 3. If any workflow has failed, fix the CI issues, commit, push, and then return to step 2. Otherwise, proceed to step 4.
15
+ 4. Fetch unresolved review threads using the `manage-pr-review-threads` skill.
16
+ 5. Review each unresolved thread to determine if it requires code or documentation changes. Validate each claim against the current codebase first, and reproduce issues or consult official documentation when necessary instead of relying on memory.
17
+ 6. Address valid review comments by updating the code. For invalid comments, add explanatory comments to the code detailing why the existing implementation is necessary.
18
+ - If there are valid review comments that are out of scope for the current PR, create new issues for them.
19
+ 7. Reply to all review threads using the `manage-pr-review-threads` skill.
20
+ 8. If you made changes in step 6, commit and push them, post `/gemini review` on the PR, wait for 5 minutes (`sleep 5m`), and return to step 2.
21
+ 9. Update the PR title and body using the `update-pr` skill to reflect all changes.
22
+
23
+ ## Workflow for the other repositories
24
+
25
+ 1. Read the PR body and its messages with the `fetch-pr` skill.
26
+ 2. Check the results of CI (GitHub Actions) with the `check-pr-ci` skill.
27
+ 3. If any workflow has failed, fix the CI issues, commit, push, and then return to step 2. Otherwise, go to step 4.
28
+ 4. Fetch unresolved review threads.
29
+ 5. Review each unresolved thread and decide whether it requires a code or documentation change. Validate each claim against the current codebase first, and reproduce it or check official documentation when needed instead of relying on memory. Ignore only comments that are clearly outdated, incorrect, or intentionally declined with solid reasoning.
30
+ 6. If there are valid review comments to address, make only the changes supported by the validation from step 5, commit, push, and then return to step 2.
31
+ - Do not post any message like review replies on non-WillBooster repositories.
32
+ 7. Update the PR title and body with the `update-pr` skill to reflect all the changes.
@@ -0,0 +1,9 @@
1
+ ---
2
+ name: fetch-issue
3
+ description: Fetch a GitHub issue body and its messages for the current repository or an issue URL.
4
+ allowed-tools: Bash(bun:*), Bash(gh:*)
5
+ ---
6
+
7
+ # Fetch GitHub Issue Messages
8
+
9
+ Run the following command to fetch the issue body and its messages: `bunx @willbooster/agent-skills@latest fetch-issue <issue-number-or-url>`
@@ -0,0 +1,9 @@
1
+ ---
2
+ name: fetch-pr
3
+ description: Fetch a GitHub pull request body and its messages for the current repository or a pull request URL.
4
+ allowed-tools: Bash(bun:*), Bash(gh:*)
5
+ ---
6
+
7
+ # Fetch GitHub PR Messages
8
+
9
+ Run the following command to fetch the pull request body and messages, excluding inline review comments: `bunx @willbooster/agent-skills@latest fetch-pr <pr-number-or-url>`
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: fix-bug
3
+ description: Fix a reported bug by first enhancing tests until the bug is reproduced, then fixing the implementation, and finally confirming the enhanced tests pass.
4
+ ---
5
+
6
+ # Bug fix workflow
7
+
8
+ 1. Understand the reported bug precisely.
9
+ - Identify the expected behavior, the actual behavior, and the smallest scope that reproduces the problem.
10
+ 2. Inspect the existing tests and locate the best place to extend them.
11
+ - Prefer enhancing an existing focused test file over adding a broad new one.
12
+ 3. Before modifying tests, gather debugging evidence that helps explain the failure mode.
13
+ - Use logging, screenshots, traces, or other lightweight diagnostics that fit the stack.
14
+ 4. Enhance the tests until they reproduce the bug.
15
+ - If a relevant test already fails for the bug, keep it as the reproduction and tighten it only if needed.
16
+ - Stop once the reproduction is minimal, reliable, and clearly tied to the reported bug.
17
+ 5. Fix the implementation without weakening the new or existing assertions.
18
+ - Keep the code change as small and cohesive as possible.
19
+ 6. Run the enhanced tests and confirm they pass with the fix in place.
20
+ 7. If the repository workflow requires broader verification, run the relevant checks after the targeted tests pass.
21
+ 8. Summarize the root cause, the test enhancement, and the implementation fix.
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: manage-pr-review-threads
3
+ description: Inspect unresolved review threads for the current pull request, then reply to and resolve them as needed.
4
+ allowed-tools: Bash(bun:*), Bash(gh:*), Bash(git:*)
5
+ ---
6
+
7
+ # Manage PR Review Threads
8
+
9
+ Use this skill when you need to inspect unresolved review threads and then reply to or resolve them.
10
+
11
+ ## List unresolved review threads
12
+
13
+ ```bash
14
+ bunx @willbooster/agent-skills@latest list-pr-review-threads
15
+ ```
16
+
17
+ ## Reply to and resolve review threads
18
+
19
+ ```bash
20
+ bunx @willbooster/agent-skills@latest resolve-pr-review-threads <<'EOF'
21
+ {
22
+ "replies": {
23
+ "PRRT_kwDORiWJ-851nXBt": "Fixed in the latest update.",
24
+ "PRRT_kwDORiWJ-851nXBu": "Kept as-is intentionally. Added clarification in the code."
25
+ }
26
+ }
27
+ EOF
28
+ ```
29
+
30
+ The JSON object must contain `replies`, keyed by review thread ID.
31
+
32
+ ## Notes
33
+
34
+ - Run the commands from the repository that owns the pull request you want to inspect.
35
+ - `resolve-pr-review-threads` depends on thread IDs returned by `list-pr-review-threads`.
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: open-pr
3
+ description: Create a pull request for the current branch in the current repository.
4
+ allowed-tools: Bash(bun:*), Bash(gh:*), Bash(git:*)
5
+ ---
6
+
7
+ # Open PR workflow
8
+
9
+ Commit your changes and push them to the current branch.
10
+ Write a PR body that helps reviewers quickly understand the scope, motivation, and validation.
11
+ Include the linked issue when applicable, a concise summary of the changes, the reasoning behind them, and how they were tested.
12
+ Run the following command to open a pull request.
13
+ Finally, report the PR URL.
14
+
15
+ ```bash
16
+ bunx @willbooster/agent-skills@latest open-pr <<'EOF'
17
+ Close #<issue>
18
+
19
+ ## Summary
20
+
21
+ - What changed
22
+ - Key scope or affected area
23
+ - Any notable tradeoff or limitation
24
+
25
+ ## Why
26
+
27
+ - Problem being solved
28
+ - Reason this approach was chosen
29
+
30
+ ## Testing
31
+
32
+ - Exact commands run
33
+ - Manual verification steps if relevant
34
+
35
+ ## Notes (if needed)
36
+
37
+ - Breaking changes, rollout concerns, screenshots, or follow-up work
38
+ EOF
39
+ ```
@@ -0,0 +1,10 @@
1
+ ---
2
+ name: plan-issue-claude
3
+ description: Run Claude Code planning via the CLI and report the planning results.
4
+ allowed-tools: Bash(bunx:*)
5
+ ---
6
+
7
+ # Planning 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 plan --agent claude`
10
+ 2. Report on the issue URL.
@@ -0,0 +1,10 @@
1
+ ---
2
+ name: plan-issue-codex
3
+ description: Run Codex planning via the CLI and report the planning results.
4
+ allowed-tools: Bash(bunx:*)
5
+ ---
6
+
7
+ # Planning 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 plan --agent codex`
10
+ 2. Report on the issue URL.
@@ -0,0 +1,10 @@
1
+ ---
2
+ name: plan-issue-gemini
3
+ description: Run Gemini CLI planning via the CLI and report the planning results.
4
+ allowed-tools: Bash(bunx:*)
5
+ ---
6
+
7
+ # Planning 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 plan --agent gemini`
10
+ 2. Report on the issue URL.
@@ -0,0 +1,331 @@
1
+ ---
2
+ name: playwright-cli
3
+ description: Automate browser interactions, test web pages and work with Playwright tests.
4
+ allowed-tools: Bash(playwright-cli:*) Bash(npx:*) Bash(npm:*)
5
+ ---
6
+
7
+ # Browser Automation with playwright-cli
8
+
9
+ ## Quick start
10
+
11
+ ```bash
12
+ # open new browser
13
+ bunx @playwright/cli@latest open
14
+ # navigate to a page
15
+ bunx @playwright/cli@latest goto https://playwright.dev
16
+ # interact with the page using refs from the snapshot
17
+ bunx @playwright/cli@latest click e15
18
+ bunx @playwright/cli@latest type "page.click"
19
+ bunx @playwright/cli@latest press Enter
20
+ # take a screenshot (rarely used, as snapshot is more common)
21
+ bunx @playwright/cli@latest screenshot
22
+ # close the browser
23
+ bunx @playwright/cli@latest close
24
+ ```
25
+
26
+ ## Commands
27
+
28
+ ### Core
29
+
30
+ ```bash
31
+ bunx @playwright/cli@latest open
32
+ # open and navigate right away
33
+ bunx @playwright/cli@latest open https://example.com/
34
+ bunx @playwright/cli@latest goto https://playwright.dev
35
+ bunx @playwright/cli@latest type "search query"
36
+ bunx @playwright/cli@latest click e3
37
+ bunx @playwright/cli@latest dblclick e7
38
+ # --submit presses Enter after filling the element
39
+ bunx @playwright/cli@latest fill e5 "user@example.com" --submit
40
+ bunx @playwright/cli@latest drag e2 e8
41
+ bunx @playwright/cli@latest hover e4
42
+ bunx @playwright/cli@latest select e9 "option-value"
43
+ bunx @playwright/cli@latest upload ./document.pdf
44
+ bunx @playwright/cli@latest check e12
45
+ bunx @playwright/cli@latest uncheck e12
46
+ bunx @playwright/cli@latest snapshot
47
+ bunx @playwright/cli@latest eval "document.title"
48
+ bunx @playwright/cli@latest eval "el => el.textContent" e5
49
+ # get element id, class, or any attribute not visible in the snapshot
50
+ bunx @playwright/cli@latest eval "el => el.id" e5
51
+ bunx @playwright/cli@latest eval "el => el.getAttribute('data-testid')" e5
52
+ bunx @playwright/cli@latest dialog-accept
53
+ bunx @playwright/cli@latest dialog-accept "confirmation text"
54
+ bunx @playwright/cli@latest dialog-dismiss
55
+ bunx @playwright/cli@latest resize 1920 1080
56
+ bunx @playwright/cli@latest close
57
+ ```
58
+
59
+ ### Navigation
60
+
61
+ ```bash
62
+ bunx @playwright/cli@latest go-back
63
+ bunx @playwright/cli@latest go-forward
64
+ bunx @playwright/cli@latest reload
65
+ ```
66
+
67
+ ### Keyboard
68
+
69
+ ```bash
70
+ bunx @playwright/cli@latest press Enter
71
+ bunx @playwright/cli@latest press ArrowDown
72
+ bunx @playwright/cli@latest keydown Shift
73
+ bunx @playwright/cli@latest keyup Shift
74
+ ```
75
+
76
+ ### Mouse
77
+
78
+ ```bash
79
+ bunx @playwright/cli@latest mousemove 150 300
80
+ bunx @playwright/cli@latest mousedown
81
+ bunx @playwright/cli@latest mousedown right
82
+ bunx @playwright/cli@latest mouseup
83
+ bunx @playwright/cli@latest mouseup right
84
+ bunx @playwright/cli@latest mousewheel 0 100
85
+ ```
86
+
87
+ ### Save as
88
+
89
+ ```bash
90
+ bunx @playwright/cli@latest screenshot
91
+ bunx @playwright/cli@latest screenshot e5
92
+ bunx @playwright/cli@latest screenshot --filename=page.png
93
+ bunx @playwright/cli@latest pdf --filename=page.pdf
94
+ ```
95
+
96
+ ### Tabs
97
+
98
+ ```bash
99
+ bunx @playwright/cli@latest tab-list
100
+ bunx @playwright/cli@latest tab-new
101
+ bunx @playwright/cli@latest tab-new https://example.com/page
102
+ bunx @playwright/cli@latest tab-close
103
+ bunx @playwright/cli@latest tab-close 2
104
+ bunx @playwright/cli@latest tab-select 0
105
+ ```
106
+
107
+ ### Storage
108
+
109
+ ```bash
110
+ bunx @playwright/cli@latest state-save
111
+ bunx @playwright/cli@latest state-save auth.json
112
+ bunx @playwright/cli@latest state-load auth.json
113
+
114
+ # Cookies
115
+ bunx @playwright/cli@latest cookie-list
116
+ bunx @playwright/cli@latest cookie-list --domain=example.com
117
+ bunx @playwright/cli@latest cookie-get session_id
118
+ bunx @playwright/cli@latest cookie-set session_id abc123
119
+ bunx @playwright/cli@latest cookie-set session_id abc123 --domain=example.com --httpOnly --secure
120
+ bunx @playwright/cli@latest cookie-delete session_id
121
+ bunx @playwright/cli@latest cookie-clear
122
+
123
+ # LocalStorage
124
+ bunx @playwright/cli@latest localstorage-list
125
+ bunx @playwright/cli@latest localstorage-get theme
126
+ bunx @playwright/cli@latest localstorage-set theme dark
127
+ bunx @playwright/cli@latest localstorage-delete theme
128
+ bunx @playwright/cli@latest localstorage-clear
129
+
130
+ # SessionStorage
131
+ bunx @playwright/cli@latest sessionstorage-list
132
+ bunx @playwright/cli@latest sessionstorage-get step
133
+ bunx @playwright/cli@latest sessionstorage-set step 3
134
+ bunx @playwright/cli@latest sessionstorage-delete step
135
+ bunx @playwright/cli@latest sessionstorage-clear
136
+ ```
137
+
138
+ ### Network
139
+
140
+ ```bash
141
+ bunx @playwright/cli@latest route "**/*.jpg" --status=404
142
+ bunx @playwright/cli@latest route "https://api.example.com/**" --body='{"mock": true}'
143
+ bunx @playwright/cli@latest route-list
144
+ bunx @playwright/cli@latest unroute "**/*.jpg"
145
+ bunx @playwright/cli@latest unroute
146
+ ```
147
+
148
+ ### DevTools
149
+
150
+ ```bash
151
+ bunx @playwright/cli@latest console
152
+ bunx @playwright/cli@latest console warning
153
+ bunx @playwright/cli@latest network
154
+ bunx @playwright/cli@latest run-code "async page => await page.context().grantPermissions(['geolocation'])"
155
+ bunx @playwright/cli@latest run-code --filename=script.js
156
+ bunx @playwright/cli@latest tracing-start
157
+ bunx @playwright/cli@latest tracing-stop
158
+ bunx @playwright/cli@latest video-start video.webm
159
+ bunx @playwright/cli@latest video-chapter "Chapter Title" --description="Details" --duration=2000
160
+ bunx @playwright/cli@latest video-stop
161
+ ```
162
+
163
+ ## Raw output
164
+
165
+ The global `--raw` option strips page status, generated code, and snapshot sections from the output, returning only the result value. Use it to pipe command output into other tools. Commands that don't produce output return nothing.
166
+
167
+ ```bash
168
+ bunx @playwright/cli@latest --raw eval "JSON.stringify(performance.timing)" | jq '.loadEventEnd - .navigationStart'
169
+ bunx @playwright/cli@latest --raw eval "JSON.stringify([...document.querySelectorAll('a')].map(a => a.href))" > links.json
170
+ bunx @playwright/cli@latest --raw snapshot > before.yml
171
+ bunx @playwright/cli@latest click e5
172
+ bunx @playwright/cli@latest --raw snapshot > after.yml
173
+ diff before.yml after.yml
174
+ TOKEN=$(bunx @playwright/cli@latest --raw cookie-get session_id)
175
+ bunx @playwright/cli@latest --raw localstorage-get theme
176
+ ```
177
+
178
+ ## Open parameters
179
+
180
+ ```bash
181
+ # Use specific browser when creating session
182
+ bunx @playwright/cli@latest open --browser=chrome
183
+ bunx @playwright/cli@latest open --browser=firefox
184
+ bunx @playwright/cli@latest open --browser=webkit
185
+ bunx @playwright/cli@latest open --browser=msedge
186
+
187
+ # Use persistent profile (by default profile is in-memory)
188
+ bunx @playwright/cli@latest open --persistent
189
+ # Use persistent profile with custom directory
190
+ bunx @playwright/cli@latest open --profile=/path/to/profile
191
+
192
+ # Connect to browser via extension
193
+ bunx @playwright/cli@latest attach --extension
194
+
195
+ # Start with config file
196
+ bunx @playwright/cli@latest open --config=my-config.json
197
+
198
+ # Close the browser
199
+ bunx @playwright/cli@latest close
200
+ # Delete user data for the default session
201
+ bunx @playwright/cli@latest delete-data
202
+ ```
203
+
204
+ ## Snapshots
205
+
206
+ After each command, playwright-cli provides a snapshot of the current browser state.
207
+
208
+ ```bash
209
+ > bunx @playwright/cli@latest goto https://example.com
210
+ ### Page
211
+ - Page URL: https://example.com/
212
+ - Page Title: Example Domain
213
+ ### Snapshot
214
+ [Snapshot](.playwright-cli/page-2026-02-14T19-22-42-679Z.yml)
215
+ ```
216
+
217
+ You can also take a snapshot on demand using `playwright-cli snapshot` command. All the options below can be combined as needed.
218
+
219
+ ```bash
220
+ # default - save to a file with timestamp-based name
221
+ bunx @playwright/cli@latest snapshot
222
+
223
+ # save to file, use when snapshot is a part of the workflow result
224
+ bunx @playwright/cli@latest snapshot --filename=after-click.yaml
225
+
226
+ # snapshot an element instead of the whole page
227
+ bunx @playwright/cli@latest snapshot "#main"
228
+
229
+ # limit snapshot depth for efficiency, take a partial snapshot afterwards
230
+ bunx @playwright/cli@latest snapshot --depth=4
231
+ bunx @playwright/cli@latest snapshot e34
232
+ ```
233
+
234
+ ## Targeting elements
235
+
236
+ By default, use refs from the snapshot to interact with page elements.
237
+
238
+ ```bash
239
+ # get snapshot with refs
240
+ bunx @playwright/cli@latest snapshot
241
+
242
+ # interact using a ref
243
+ bunx @playwright/cli@latest click e15
244
+ ```
245
+
246
+ You can also use css selectors or Playwright locators.
247
+
248
+ ```bash
249
+ # css selector
250
+ bunx @playwright/cli@latest click "#main > button.submit"
251
+
252
+ # role locator
253
+ bunx @playwright/cli@latest click "getByRole('button', { name: 'Submit' })"
254
+
255
+ # test id
256
+ bunx @playwright/cli@latest click "getByTestId('submit-button')"
257
+ ```
258
+
259
+ ## Browser Sessions
260
+
261
+ ```bash
262
+ # create new browser session named "mysession" with persistent profile
263
+ bunx @playwright/cli@latest -s=mysession open example.com --persistent
264
+ # same with manually specified profile directory (use when requested explicitly)
265
+ bunx @playwright/cli@latest -s=mysession open example.com --profile=/path/to/profile
266
+ bunx @playwright/cli@latest -s=mysession click e6
267
+ bunx @playwright/cli@latest -s=mysession close # stop a named browser
268
+ bunx @playwright/cli@latest -s=mysession delete-data # delete user data for persistent session
269
+
270
+ bunx @playwright/cli@latest list
271
+ # Close all browsers
272
+ bunx @playwright/cli@latest close-all
273
+ # Forcefully kill all browser processes
274
+ bunx @playwright/cli@latest kill-all
275
+ ```
276
+
277
+ ## Example: Form submission
278
+
279
+ ```bash
280
+ bunx @playwright/cli@latest open https://example.com/form
281
+ bunx @playwright/cli@latest snapshot
282
+
283
+ bunx @playwright/cli@latest fill e1 "user@example.com"
284
+ bunx @playwright/cli@latest fill e2 "password123"
285
+ bunx @playwright/cli@latest click e3
286
+ bunx @playwright/cli@latest snapshot
287
+ bunx @playwright/cli@latest close
288
+ ```
289
+
290
+ ## Example: Multi-tab workflow
291
+
292
+ ```bash
293
+ bunx @playwright/cli@latest open https://example.com
294
+ bunx @playwright/cli@latest tab-new https://example.com/other
295
+ bunx @playwright/cli@latest tab-list
296
+ bunx @playwright/cli@latest tab-select 0
297
+ bunx @playwright/cli@latest snapshot
298
+ bunx @playwright/cli@latest close
299
+ ```
300
+
301
+ ## Example: Debugging with DevTools
302
+
303
+ ```bash
304
+ bunx @playwright/cli@latest open https://example.com
305
+ bunx @playwright/cli@latest click e4
306
+ bunx @playwright/cli@latest fill e7 "test"
307
+ bunx @playwright/cli@latest console
308
+ bunx @playwright/cli@latest network
309
+ bunx @playwright/cli@latest close
310
+ ```
311
+
312
+ ```bash
313
+ bunx @playwright/cli@latest open https://example.com
314
+ bunx @playwright/cli@latest tracing-start
315
+ bunx @playwright/cli@latest click e4
316
+ bunx @playwright/cli@latest fill e7 "test"
317
+ bunx @playwright/cli@latest tracing-stop
318
+ bunx @playwright/cli@latest close
319
+ ```
320
+
321
+ ## Specific tasks
322
+
323
+ - **Running and Debugging Playwright tests** [references/playwright-tests.md](references/playwright-tests.md)
324
+ - **Request mocking** [references/request-mocking.md](references/request-mocking.md)
325
+ - **Running Playwright code** [references/running-code.md](references/running-code.md)
326
+ - **Browser session management** [references/session-management.md](references/session-management.md)
327
+ - **Storage state (cookies, localStorage)** [references/storage-state.md](references/storage-state.md)
328
+ - **Test generation** [references/test-generation.md](references/test-generation.md)
329
+ - **Tracing** [references/tracing.md](references/tracing.md)
330
+ - **Video recording** [references/video-recording.md](references/video-recording.md)
331
+ - **Inspecting element attributes** [references/element-attributes.md](references/element-attributes.md)
@@ -0,0 +1,23 @@
1
+ # Inspecting Element Attributes
2
+
3
+ When the snapshot doesn't show an element's `id`, `class`, `data-*` attributes, or other DOM properties, use `eval` to inspect them.
4
+
5
+ ## Examples
6
+
7
+ ```bash
8
+ bunx @playwright/cli@latest snapshot
9
+ # snapshot shows a button as e7 but doesn't reveal its id or data attributes
10
+
11
+ # get the element's id
12
+ bunx @playwright/cli@latest eval "el => el.id" e7
13
+
14
+ # get all CSS classes
15
+ bunx @playwright/cli@latest eval "el => el.className" e7
16
+
17
+ # get a specific attribute
18
+ bunx @playwright/cli@latest eval "el => el.getAttribute('data-testid')" e7
19
+ bunx @playwright/cli@latest eval "el => el.getAttribute('aria-label')" e7
20
+
21
+ # get a computed style property
22
+ bunx @playwright/cli@latest eval "el => getComputedStyle(el).display" e7
23
+ ```
@@ -0,0 +1,39 @@
1
+ # Running Playwright Tests
2
+
3
+ To run Playwright tests, use the `npx playwright test` command, or a package manager script. To avoid opening the interactive html report, use `PLAYWRIGHT_HTML_OPEN=never` environment variable.
4
+
5
+ ```bash
6
+ # Run all tests
7
+ PLAYWRIGHT_HTML_OPEN=never npx playwright test
8
+
9
+ # Run all tests through a custom npm script
10
+ PLAYWRIGHT_HTML_OPEN=never npm run special-test-command
11
+ ```
12
+
13
+ # Debugging Playwright Tests
14
+
15
+ To debug a failing Playwright test, run it with `--debug=cli` option. This command will pause the test at the start and print the debugging instructions.
16
+
17
+ **IMPORTANT**: run the command in the background and check the output until "Debugging Instructions" is printed.
18
+
19
+ Once instructions containing a session name are printed, use `playwright-cli` to attach the session and explore the page.
20
+
21
+ ```bash
22
+ # Run the test
23
+ PLAYWRIGHT_HTML_OPEN=never npx playwright test --debug=cli
24
+ # ...
25
+ # ... debugging instructions for "tw-abcdef" session ...
26
+ # ...
27
+
28
+ # Attach to the test
29
+ bunx @playwright/cli@latest attach tw-abcdef
30
+ ```
31
+
32
+ Keep the test running in the background while you explore and look for a fix.
33
+ The test is paused at the start, so you should step over or pause at a particular location
34
+ where the problem is most likely to be.
35
+
36
+ Every action you perform with `playwright-cli` generates corresponding Playwright TypeScript code.
37
+ This code appears in the output and can be copied directly into the test. Most of the time, a specific locator or an expectation should be updated, but it could also be a bug in the app. Use your judgement.
38
+
39
+ After fixing the test, stop the background test run. Rerun to check that test passes.