gm-oc 2.0.371 → 2.0.372
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/package.json +1 -1
- package/skills/browser/SKILL.md +17 -65
package/package.json
CHANGED
package/skills/browser/SKILL.md
CHANGED
|
@@ -1,36 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: browser
|
|
3
|
-
description: Browser automation
|
|
4
|
-
allowed-tools: Bash(
|
|
3
|
+
description: Browser automation. Use when user needs to interact with websites, navigate pages, fill forms, click buttons, take screenshots, extract data, test web apps, or automate any browser task.
|
|
4
|
+
allowed-tools: Bash(exec:browser*)
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# Browser Automation
|
|
7
|
+
# Browser Automation
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
**Session management** — use `browser:` prefix via Bash for session lifecycle only.
|
|
12
|
-
|
|
13
|
-
Create a session first:
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
browser:
|
|
17
|
-
playwriter session new --direct
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
Returns a numeric session ID (e.g. `1`). Use that ID for all subsequent `exec:browser` calls.
|
|
21
|
-
|
|
22
|
-
If `--direct` fails, the user needs Chrome running with debugging enabled:
|
|
23
|
-
- Open `chrome://inspect/#remote-debugging` in Chrome, OR
|
|
24
|
-
- Launch Chrome with `chrome --remote-debugging-port=9222`
|
|
25
|
-
|
|
26
|
-
List active sessions:
|
|
27
|
-
|
|
28
|
-
```
|
|
29
|
-
browser:
|
|
30
|
-
playwriter session list
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
**JS eval** — use `exec:browser` via Bash for ALL JavaScript execution. Never use `playwriter -s <id> -e '...'` for JS code — single-quote quoting fails on Windows CMD. The exec runner writes code to a temp file, avoiding all shell quoting issues.
|
|
9
|
+
Use `exec:browser` via Bash for all browser automation. The runtime provides `page`, `snapshot`, `screenshotWithAccessibilityLabels`, and `state` as globals. Sessions persist across calls automatically.
|
|
34
10
|
|
|
35
11
|
```
|
|
36
12
|
exec:browser
|
|
@@ -38,25 +14,9 @@ await page.goto('https://example.com')
|
|
|
38
14
|
await snapshot({ page })
|
|
39
15
|
```
|
|
40
16
|
|
|
41
|
-
```
|
|
42
|
-
exec:browser
|
|
43
|
-
const title = await page.title()
|
|
44
|
-
console.log(title)
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
State persists across `exec:browser` calls within a session. Never add shell quoting or escaping to the exec body — write plain JavaScript directly.
|
|
48
|
-
|
|
49
17
|
## Core Workflow
|
|
50
18
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
1. **Create session**: `browser:\nplaywriter session new --direct` (note the returned ID)
|
|
54
|
-
2. **All JS code**: use `exec:browser` with plain JS body — navigate, interact, snapshot, extract
|
|
55
|
-
|
|
56
|
-
```
|
|
57
|
-
browser:
|
|
58
|
-
playwriter session new --direct
|
|
59
|
-
```
|
|
19
|
+
Navigate, snapshot to understand the page, then interact:
|
|
60
20
|
|
|
61
21
|
```
|
|
62
22
|
exec:browser
|
|
@@ -70,14 +30,6 @@ await snapshot({ page })
|
|
|
70
30
|
|
|
71
31
|
## Common Patterns
|
|
72
32
|
|
|
73
|
-
### Navigation and Snapshot
|
|
74
|
-
|
|
75
|
-
```
|
|
76
|
-
exec:browser
|
|
77
|
-
await page.goto('https://example.com')
|
|
78
|
-
await snapshot({ page })
|
|
79
|
-
```
|
|
80
|
-
|
|
81
33
|
### Screenshot with Accessibility Labels
|
|
82
34
|
|
|
83
35
|
```
|
|
@@ -98,12 +50,14 @@ console.log(JSON.stringify(items))
|
|
|
98
50
|
|
|
99
51
|
```
|
|
100
52
|
exec:browser
|
|
101
|
-
state.
|
|
102
|
-
await page.goto('https://
|
|
103
|
-
await page.
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
53
|
+
state.count = 0
|
|
54
|
+
await page.goto('https://example.com')
|
|
55
|
+
state.title = await page.title()
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
exec:browser
|
|
60
|
+
console.log(state.title, state.count)
|
|
107
61
|
```
|
|
108
62
|
|
|
109
63
|
### Console Monitoring
|
|
@@ -120,12 +74,10 @@ exec:browser
|
|
|
120
74
|
console.log(JSON.stringify(state.consoleMsgs))
|
|
121
75
|
```
|
|
122
76
|
|
|
123
|
-
## Key
|
|
124
|
-
|
|
125
|
-
**Always use `exec:browser`** for any JavaScript — never `playwriter -s <id> -e '...'` for JS code.
|
|
77
|
+
## Key Rules
|
|
126
78
|
|
|
127
|
-
|
|
79
|
+
**Only `exec:browser`** — never run any browser CLI tool directly via Bash.
|
|
128
80
|
|
|
129
|
-
**
|
|
81
|
+
**Snapshot before interacting** — always call `await snapshot({ page })` to understand current page state before clicking or filling.
|
|
130
82
|
|
|
131
|
-
**
|
|
83
|
+
**State persists** — `state` object and page session carry across multiple `exec:browser` calls.
|