Skip to content

Commit 1ffa387

Browse files
committed
genAI
1 parent db338a6 commit 1ffa387

48 files changed

Lines changed: 2253 additions & 54 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/skills/Blog/SKILL.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: SearchAndResumeNugetPackage
3+
description: Search and resume the nuget package of a skill and how to use it.
4+
allowed-tools: Bash(playwright-cli:*)
5+
---
6+
7+
# Search page
8+
9+
Search for folder name on the current v2/rscg_examples.
10+
After you find the folder, read the description.json inside the folder to get the name of the article and the link to it.
11+
12+
Read also all C# files in the src folder to get how it is used and extract the most relevant information about it.
13+
14+
15+
## Steps
16+
17+
1. Use powershell to search for folders in the current v2/rscg_examples directory that match the user's query. You can use `Get-ChildItem` with the `-Recurse` flag to search through all subdirectories.
18+
2. If there is no matching folder, inform the user that no results were found and suggest trying a different query.
19+
2. If there are multiple matching folders, list them and ask the user to select one or more of them to proceed with.
20+
3. If there is a single folder, look for a `description.json` file inside it. If found, read the JSON file to understand the what it does.
21+
4. Use Powershell eval to extract nuget URL from the description.json file.
22+
5. Use playwright-cli to open the nuget URL in a browser and extract the article title and URL from the page. You can use `playwright-cli eval` to run JavaScript on the page to find the relevant elements containing the article information.
23+
6. Read the src folder inside the found folder to find all C# files. Extract relevant information about how the skill is used from these files, such as method names, parameters, and comments.
24+
5. Compile a summary of the skill based on the description and the information extracted from the C# files. This summary should include the purpose of the skill, how to use it, and any important details or caveats.
25+
7. Show the summary and offer to copy the summary to the clipboard with Powershell Set-Clipboard.
26+
27+
## Output format
28+
29+
Return results as a numbered list:
30+
31+
```
32+
Summary of the skill:
33+
```
34+
35+
## Notes
36+
37+
- Make sure to handle cases where the `description.json` file is missing or does not contain the expected information gracefully, providing appropriate feedback to the user.
Lines changed: 278 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,278 @@
1+
---
2+
name: playwright-cli
3+
description: Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.
4+
allowed-tools: Bash(playwright-cli:*)
5+
---
6+
7+
# Browser Automation with playwright-cli
8+
9+
## Quick start
10+
11+
```bash
12+
# open new browser
13+
playwright-cli open
14+
# navigate to a page
15+
playwright-cli goto https://playwright.dev
16+
# interact with the page using refs from the snapshot
17+
playwright-cli click e15
18+
playwright-cli type "page.click"
19+
playwright-cli press Enter
20+
# take a screenshot (rarely used, as snapshot is more common)
21+
playwright-cli screenshot
22+
# close the browser
23+
playwright-cli close
24+
```
25+
26+
## Commands
27+
28+
### Core
29+
30+
```bash
31+
playwright-cli open
32+
# open and navigate right away
33+
playwright-cli open https://example.com/
34+
playwright-cli goto https://playwright.dev
35+
playwright-cli type "search query"
36+
playwright-cli click e3
37+
playwright-cli dblclick e7
38+
playwright-cli fill e5 "user@example.com"
39+
playwright-cli drag e2 e8
40+
playwright-cli hover e4
41+
playwright-cli select e9 "option-value"
42+
playwright-cli upload ./document.pdf
43+
playwright-cli check e12
44+
playwright-cli uncheck e12
45+
playwright-cli snapshot
46+
playwright-cli snapshot --filename=after-click.yaml
47+
playwright-cli eval "document.title"
48+
playwright-cli eval "el => el.textContent" e5
49+
playwright-cli dialog-accept
50+
playwright-cli dialog-accept "confirmation text"
51+
playwright-cli dialog-dismiss
52+
playwright-cli resize 1920 1080
53+
playwright-cli close
54+
```
55+
56+
### Navigation
57+
58+
```bash
59+
playwright-cli go-back
60+
playwright-cli go-forward
61+
playwright-cli reload
62+
```
63+
64+
### Keyboard
65+
66+
```bash
67+
playwright-cli press Enter
68+
playwright-cli press ArrowDown
69+
playwright-cli keydown Shift
70+
playwright-cli keyup Shift
71+
```
72+
73+
### Mouse
74+
75+
```bash
76+
playwright-cli mousemove 150 300
77+
playwright-cli mousedown
78+
playwright-cli mousedown right
79+
playwright-cli mouseup
80+
playwright-cli mouseup right
81+
playwright-cli mousewheel 0 100
82+
```
83+
84+
### Save as
85+
86+
```bash
87+
playwright-cli screenshot
88+
playwright-cli screenshot e5
89+
playwright-cli screenshot --filename=page.png
90+
playwright-cli pdf --filename=page.pdf
91+
```
92+
93+
### Tabs
94+
95+
```bash
96+
playwright-cli tab-list
97+
playwright-cli tab-new
98+
playwright-cli tab-new https://example.com/page
99+
playwright-cli tab-close
100+
playwright-cli tab-close 2
101+
playwright-cli tab-select 0
102+
```
103+
104+
### Storage
105+
106+
```bash
107+
playwright-cli state-save
108+
playwright-cli state-save auth.json
109+
playwright-cli state-load auth.json
110+
111+
# Cookies
112+
playwright-cli cookie-list
113+
playwright-cli cookie-list --domain=example.com
114+
playwright-cli cookie-get session_id
115+
playwright-cli cookie-set session_id abc123
116+
playwright-cli cookie-set session_id abc123 --domain=example.com --httpOnly --secure
117+
playwright-cli cookie-delete session_id
118+
playwright-cli cookie-clear
119+
120+
# LocalStorage
121+
playwright-cli localstorage-list
122+
playwright-cli localstorage-get theme
123+
playwright-cli localstorage-set theme dark
124+
playwright-cli localstorage-delete theme
125+
playwright-cli localstorage-clear
126+
127+
# SessionStorage
128+
playwright-cli sessionstorage-list
129+
playwright-cli sessionstorage-get step
130+
playwright-cli sessionstorage-set step 3
131+
playwright-cli sessionstorage-delete step
132+
playwright-cli sessionstorage-clear
133+
```
134+
135+
### Network
136+
137+
```bash
138+
playwright-cli route "**/*.jpg" --status=404
139+
playwright-cli route "https://api.example.com/**" --body='{"mock": true}'
140+
playwright-cli route-list
141+
playwright-cli unroute "**/*.jpg"
142+
playwright-cli unroute
143+
```
144+
145+
### DevTools
146+
147+
```bash
148+
playwright-cli console
149+
playwright-cli console warning
150+
playwright-cli network
151+
playwright-cli run-code "async page => await page.context().grantPermissions(['geolocation'])"
152+
playwright-cli tracing-start
153+
playwright-cli tracing-stop
154+
playwright-cli video-start
155+
playwright-cli video-stop video.webm
156+
```
157+
158+
## Open parameters
159+
```bash
160+
# Use specific browser when creating session
161+
playwright-cli open --browser=chrome
162+
playwright-cli open --browser=firefox
163+
playwright-cli open --browser=webkit
164+
playwright-cli open --browser=msedge
165+
# Connect to browser via extension
166+
playwright-cli open --extension
167+
168+
# Use persistent profile (by default profile is in-memory)
169+
playwright-cli open --persistent
170+
# Use persistent profile with custom directory
171+
playwright-cli open --profile=/path/to/profile
172+
173+
# Start with config file
174+
playwright-cli open --config=my-config.json
175+
176+
# Close the browser
177+
playwright-cli close
178+
# Delete user data for the default session
179+
playwright-cli delete-data
180+
```
181+
182+
## Snapshots
183+
184+
After each command, playwright-cli provides a snapshot of the current browser state.
185+
186+
```bash
187+
> playwright-cli goto https://example.com
188+
### Page
189+
- Page URL: https://example.com/
190+
- Page Title: Example Domain
191+
### Snapshot
192+
[Snapshot](.playwright-cli/page-2026-02-14T19-22-42-679Z.yml)
193+
```
194+
195+
You can also take a snapshot on demand using `playwright-cli snapshot` command.
196+
197+
If `--filename` is not provided, a new snapshot file is created with a timestamp. Default to automatic file naming, use `--filename=` when artifact is a part of the workflow result.
198+
199+
## Browser Sessions
200+
201+
```bash
202+
# create new browser session named "mysession" with persistent profile
203+
playwright-cli -s=mysession open example.com --persistent
204+
# same with manually specified profile directory (use when requested explicitly)
205+
playwright-cli -s=mysession open example.com --profile=/path/to/profile
206+
playwright-cli -s=mysession click e6
207+
playwright-cli -s=mysession close # stop a named browser
208+
playwright-cli -s=mysession delete-data # delete user data for persistent session
209+
210+
playwright-cli list
211+
# Close all browsers
212+
playwright-cli close-all
213+
# Forcefully kill all browser processes
214+
playwright-cli kill-all
215+
```
216+
217+
## Local installation
218+
219+
In some cases user might want to install playwright-cli locally. If running globally available `playwright-cli` binary fails, use `npx playwright-cli` to run the commands. For example:
220+
221+
```bash
222+
npx playwright-cli open https://example.com
223+
npx playwright-cli click e1
224+
```
225+
226+
## Example: Form submission
227+
228+
```bash
229+
playwright-cli open https://example.com/form
230+
playwright-cli snapshot
231+
232+
playwright-cli fill e1 "user@example.com"
233+
playwright-cli fill e2 "password123"
234+
playwright-cli click e3
235+
playwright-cli snapshot
236+
playwright-cli close
237+
```
238+
239+
## Example: Multi-tab workflow
240+
241+
```bash
242+
playwright-cli open https://example.com
243+
playwright-cli tab-new https://example.com/other
244+
playwright-cli tab-list
245+
playwright-cli tab-select 0
246+
playwright-cli snapshot
247+
playwright-cli close
248+
```
249+
250+
## Example: Debugging with DevTools
251+
252+
```bash
253+
playwright-cli open https://example.com
254+
playwright-cli click e4
255+
playwright-cli fill e7 "test"
256+
playwright-cli console
257+
playwright-cli network
258+
playwright-cli close
259+
```
260+
261+
```bash
262+
playwright-cli open https://example.com
263+
playwright-cli tracing-start
264+
playwright-cli click e4
265+
playwright-cli fill e7 "test"
266+
playwright-cli tracing-stop
267+
playwright-cli close
268+
```
269+
270+
## Specific tasks
271+
272+
* **Request mocking** [references/request-mocking.md](references/request-mocking.md)
273+
* **Running Playwright code** [references/running-code.md](references/running-code.md)
274+
* **Browser session management** [references/session-management.md](references/session-management.md)
275+
* **Storage state (cookies, localStorage)** [references/storage-state.md](references/storage-state.md)
276+
* **Test generation** [references/test-generation.md](references/test-generation.md)
277+
* **Tracing** [references/tracing.md](references/tracing.md)
278+
* **Video recording** [references/video-recording.md](references/video-recording.md)

0 commit comments

Comments
 (0)