@brunosps00/dev-workflow 0.0.6 → 0.0.8

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 (27) hide show
  1. package/bin/dev-workflow.js +11 -4
  2. package/lib/constants.js +11 -0
  3. package/lib/init.js +8 -1
  4. package/lib/install-deps.js +42 -0
  5. package/lib/wrappers.js +8 -2
  6. package/package.json +1 -1
  7. package/scaffold/en/commands/dw-bugfix.md +2 -3
  8. package/scaffold/en/commands/dw-fix-qa.md +1 -2
  9. package/scaffold/en/commands/dw-functional-doc.md +0 -1
  10. package/scaffold/en/commands/dw-run-qa.md +2 -3
  11. package/scaffold/en/commands/dw-run-task.md +1 -2
  12. package/scaffold/pt-br/commands/dw-bugfix.md +2 -3
  13. package/scaffold/pt-br/commands/dw-fix-qa.md +1 -2
  14. package/scaffold/pt-br/commands/dw-functional-doc.md +0 -1
  15. package/scaffold/pt-br/commands/dw-run-qa.md +2 -3
  16. package/scaffold/pt-br/commands/dw-run-task.md +1 -2
  17. package/scaffold/skills/agent-browser/SKILL.md +0 -750
  18. package/scaffold/skills/agent-browser/references/authentication.md +0 -303
  19. package/scaffold/skills/agent-browser/references/commands.md +0 -295
  20. package/scaffold/skills/agent-browser/references/profiling.md +0 -120
  21. package/scaffold/skills/agent-browser/references/proxy-support.md +0 -194
  22. package/scaffold/skills/agent-browser/references/session-management.md +0 -193
  23. package/scaffold/skills/agent-browser/references/snapshot-refs.md +0 -219
  24. package/scaffold/skills/agent-browser/references/video-recording.md +0 -173
  25. package/scaffold/skills/agent-browser/templates/authenticated-session.sh +0 -105
  26. package/scaffold/skills/agent-browser/templates/capture-workflow.sh +0 -69
  27. package/scaffold/skills/agent-browser/templates/form-automation.sh +0 -62
@@ -1,120 +0,0 @@
1
- # Profiling
2
-
3
- Capture Chrome DevTools performance profiles during browser automation for performance analysis.
4
-
5
- **Related**: [commands.md](commands.md) for full command reference, [SKILL.md](../SKILL.md) for quick start.
6
-
7
- ## Contents
8
-
9
- - [Basic Profiling](#basic-profiling)
10
- - [Profiler Commands](#profiler-commands)
11
- - [Categories](#categories)
12
- - [Use Cases](#use-cases)
13
- - [Output Format](#output-format)
14
- - [Viewing Profiles](#viewing-profiles)
15
- - [Limitations](#limitations)
16
-
17
- ## Basic Profiling
18
-
19
- ```bash
20
- # Start profiling
21
- agent-browser profiler start
22
-
23
- # Perform actions
24
- agent-browser navigate https://example.com
25
- agent-browser click "#button"
26
- agent-browser wait 1000
27
-
28
- # Stop and save
29
- agent-browser profiler stop ./trace.json
30
- ```
31
-
32
- ## Profiler Commands
33
-
34
- ```bash
35
- # Start profiling with default categories
36
- agent-browser profiler start
37
-
38
- # Start with custom trace categories
39
- agent-browser profiler start --categories "devtools.timeline,v8.execute,blink.user_timing"
40
-
41
- # Stop profiling and save to file
42
- agent-browser profiler stop ./trace.json
43
- ```
44
-
45
- ## Categories
46
-
47
- The `--categories` flag accepts a comma-separated list of Chrome trace categories. Default categories include:
48
-
49
- - `devtools.timeline` -- standard DevTools performance traces
50
- - `v8.execute` -- time spent running JavaScript
51
- - `blink` -- renderer events
52
- - `blink.user_timing` -- `performance.mark()` / `performance.measure()` calls
53
- - `latencyInfo` -- input-to-latency tracking
54
- - `renderer.scheduler` -- task scheduling and execution
55
- - `toplevel` -- broad-spectrum basic events
56
-
57
- Several `disabled-by-default-*` categories are also included for detailed timeline, call stack, and V8 CPU profiling data.
58
-
59
- ## Use Cases
60
-
61
- ### Diagnosing Slow Page Loads
62
-
63
- ```bash
64
- agent-browser profiler start
65
- agent-browser navigate https://app.example.com
66
- agent-browser wait --load networkidle
67
- agent-browser profiler stop ./page-load-profile.json
68
- ```
69
-
70
- ### Profiling User Interactions
71
-
72
- ```bash
73
- agent-browser navigate https://app.example.com
74
- agent-browser profiler start
75
- agent-browser click "#submit"
76
- agent-browser wait 2000
77
- agent-browser profiler stop ./interaction-profile.json
78
- ```
79
-
80
- ### CI Performance Regression Checks
81
-
82
- ```bash
83
- #!/bin/bash
84
- agent-browser profiler start
85
- agent-browser navigate https://app.example.com
86
- agent-browser wait --load networkidle
87
- agent-browser profiler stop "./profiles/build-${BUILD_ID}.json"
88
- ```
89
-
90
- ## Output Format
91
-
92
- The output is a JSON file in Chrome Trace Event format:
93
-
94
- ```json
95
- {
96
- "traceEvents": [
97
- { "cat": "devtools.timeline", "name": "RunTask", "ph": "X", "ts": 12345, "dur": 100, ... },
98
- ...
99
- ],
100
- "metadata": {
101
- "clock-domain": "LINUX_CLOCK_MONOTONIC"
102
- }
103
- }
104
- ```
105
-
106
- The `metadata.clock-domain` field is set based on the host platform (Linux or macOS). On Windows it is omitted.
107
-
108
- ## Viewing Profiles
109
-
110
- Load the output JSON file in any of these tools:
111
-
112
- - **Chrome DevTools**: Performance panel > Load profile (Ctrl+Shift+I > Performance)
113
- - **Perfetto UI**: https://ui.perfetto.dev/ -- drag and drop the JSON file
114
- - **Trace Viewer**: `chrome://tracing` in any Chromium browser
115
-
116
- ## Limitations
117
-
118
- - Only works with Chromium-based browsers (Chrome, Edge). Not supported on Firefox or WebKit.
119
- - Trace data accumulates in memory while profiling is active (capped at 5 million events). Stop profiling promptly after the area of interest.
120
- - Data collection on stop has a 30-second timeout. If the browser is unresponsive, the stop command may fail.
@@ -1,194 +0,0 @@
1
- # Proxy Support
2
-
3
- Proxy configuration for geo-testing, rate limiting avoidance, and corporate environments.
4
-
5
- **Related**: [commands.md](commands.md) for global options, [SKILL.md](../SKILL.md) for quick start.
6
-
7
- ## Contents
8
-
9
- - [Basic Proxy Configuration](#basic-proxy-configuration)
10
- - [Authenticated Proxy](#authenticated-proxy)
11
- - [SOCKS Proxy](#socks-proxy)
12
- - [Proxy Bypass](#proxy-bypass)
13
- - [Common Use Cases](#common-use-cases)
14
- - [Verifying Proxy Connection](#verifying-proxy-connection)
15
- - [Troubleshooting](#troubleshooting)
16
- - [Best Practices](#best-practices)
17
-
18
- ## Basic Proxy Configuration
19
-
20
- Use the `--proxy` flag or set proxy via environment variable:
21
-
22
- ```bash
23
- # Via CLI flag
24
- agent-browser --proxy "http://proxy.example.com:8080" open https://example.com
25
-
26
- # Via environment variable
27
- export HTTP_PROXY="http://proxy.example.com:8080"
28
- agent-browser open https://example.com
29
-
30
- # HTTPS proxy
31
- export HTTPS_PROXY="https://proxy.example.com:8080"
32
- agent-browser open https://example.com
33
-
34
- # Both
35
- export HTTP_PROXY="http://proxy.example.com:8080"
36
- export HTTPS_PROXY="http://proxy.example.com:8080"
37
- agent-browser open https://example.com
38
- ```
39
-
40
- ## Authenticated Proxy
41
-
42
- For proxies requiring authentication:
43
-
44
- ```bash
45
- # Include credentials in URL
46
- export HTTP_PROXY="http://username:password@proxy.example.com:8080"
47
- agent-browser open https://example.com
48
- ```
49
-
50
- ## SOCKS Proxy
51
-
52
- ```bash
53
- # SOCKS5 proxy
54
- export ALL_PROXY="socks5://proxy.example.com:1080"
55
- agent-browser open https://example.com
56
-
57
- # SOCKS5 with auth
58
- export ALL_PROXY="socks5://user:pass@proxy.example.com:1080"
59
- agent-browser open https://example.com
60
- ```
61
-
62
- ## Proxy Bypass
63
-
64
- Skip proxy for specific domains using `--proxy-bypass` or `NO_PROXY`:
65
-
66
- ```bash
67
- # Via CLI flag
68
- agent-browser --proxy "http://proxy.example.com:8080" --proxy-bypass "localhost,*.internal.com" open https://example.com
69
-
70
- # Via environment variable
71
- export NO_PROXY="localhost,127.0.0.1,.internal.company.com"
72
- agent-browser open https://internal.company.com # Direct connection
73
- agent-browser open https://external.com # Via proxy
74
- ```
75
-
76
- ## Common Use Cases
77
-
78
- ### Geo-Location Testing
79
-
80
- ```bash
81
- #!/bin/bash
82
- # Test site from different regions using geo-located proxies
83
-
84
- PROXIES=(
85
- "http://us-proxy.example.com:8080"
86
- "http://eu-proxy.example.com:8080"
87
- "http://asia-proxy.example.com:8080"
88
- )
89
-
90
- for proxy in "${PROXIES[@]}"; do
91
- export HTTP_PROXY="$proxy"
92
- export HTTPS_PROXY="$proxy"
93
-
94
- region=$(echo "$proxy" | grep -oP '^\w+-\w+')
95
- echo "Testing from: $region"
96
-
97
- agent-browser --session "$region" open https://example.com
98
- agent-browser --session "$region" screenshot "./screenshots/$region.png"
99
- agent-browser --session "$region" close
100
- done
101
- ```
102
-
103
- ### Rotating Proxies for Scraping
104
-
105
- ```bash
106
- #!/bin/bash
107
- # Rotate through proxy list to avoid rate limiting
108
-
109
- PROXY_LIST=(
110
- "http://proxy1.example.com:8080"
111
- "http://proxy2.example.com:8080"
112
- "http://proxy3.example.com:8080"
113
- )
114
-
115
- URLS=(
116
- "https://site.com/page1"
117
- "https://site.com/page2"
118
- "https://site.com/page3"
119
- )
120
-
121
- for i in "${!URLS[@]}"; do
122
- proxy_index=$((i % ${#PROXY_LIST[@]}))
123
- export HTTP_PROXY="${PROXY_LIST[$proxy_index]}"
124
- export HTTPS_PROXY="${PROXY_LIST[$proxy_index]}"
125
-
126
- agent-browser open "${URLS[$i]}"
127
- agent-browser get text body > "output-$i.txt"
128
- agent-browser close
129
-
130
- sleep 1 # Polite delay
131
- done
132
- ```
133
-
134
- ### Corporate Network Access
135
-
136
- ```bash
137
- #!/bin/bash
138
- # Access internal sites via corporate proxy
139
-
140
- export HTTP_PROXY="http://corpproxy.company.com:8080"
141
- export HTTPS_PROXY="http://corpproxy.company.com:8080"
142
- export NO_PROXY="localhost,127.0.0.1,.company.com"
143
-
144
- # External sites go through proxy
145
- agent-browser open https://external-vendor.com
146
-
147
- # Internal sites bypass proxy
148
- agent-browser open https://intranet.company.com
149
- ```
150
-
151
- ## Verifying Proxy Connection
152
-
153
- ```bash
154
- # Check your apparent IP
155
- agent-browser open https://httpbin.org/ip
156
- agent-browser get text body
157
- # Should show proxy's IP, not your real IP
158
- ```
159
-
160
- ## Troubleshooting
161
-
162
- ### Proxy Connection Failed
163
-
164
- ```bash
165
- # Test proxy connectivity first
166
- curl -x http://proxy.example.com:8080 https://httpbin.org/ip
167
-
168
- # Check if proxy requires auth
169
- export HTTP_PROXY="http://user:pass@proxy.example.com:8080"
170
- ```
171
-
172
- ### SSL/TLS Errors Through Proxy
173
-
174
- Some proxies perform SSL inspection. If you encounter certificate errors:
175
-
176
- ```bash
177
- # For testing only - not recommended for production
178
- agent-browser open https://example.com --ignore-https-errors
179
- ```
180
-
181
- ### Slow Performance
182
-
183
- ```bash
184
- # Use proxy only when necessary
185
- export NO_PROXY="*.cdn.com,*.static.com" # Direct CDN access
186
- ```
187
-
188
- ## Best Practices
189
-
190
- 1. **Use environment variables** - Don't hardcode proxy credentials
191
- 2. **Set NO_PROXY appropriately** - Avoid routing local traffic through proxy
192
- 3. **Test proxy before automation** - Verify connectivity with simple requests
193
- 4. **Handle proxy failures gracefully** - Implement retry logic for unstable proxies
194
- 5. **Rotate proxies for large scraping jobs** - Distribute load and avoid bans
@@ -1,193 +0,0 @@
1
- # Session Management
2
-
3
- Multiple isolated browser sessions with state persistence and concurrent browsing.
4
-
5
- **Related**: [authentication.md](authentication.md) for login patterns, [SKILL.md](../SKILL.md) for quick start.
6
-
7
- ## Contents
8
-
9
- - [Named Sessions](#named-sessions)
10
- - [Session Isolation Properties](#session-isolation-properties)
11
- - [Session State Persistence](#session-state-persistence)
12
- - [Common Patterns](#common-patterns)
13
- - [Default Session](#default-session)
14
- - [Session Cleanup](#session-cleanup)
15
- - [Best Practices](#best-practices)
16
-
17
- ## Named Sessions
18
-
19
- Use `--session` flag to isolate browser contexts:
20
-
21
- ```bash
22
- # Session 1: Authentication flow
23
- agent-browser --session auth open https://app.example.com/login
24
-
25
- # Session 2: Public browsing (separate cookies, storage)
26
- agent-browser --session public open https://example.com
27
-
28
- # Commands are isolated by session
29
- agent-browser --session auth fill @e1 "user@example.com"
30
- agent-browser --session public get text body
31
- ```
32
-
33
- ## Session Isolation Properties
34
-
35
- Each session has independent:
36
- - Cookies
37
- - LocalStorage / SessionStorage
38
- - IndexedDB
39
- - Cache
40
- - Browsing history
41
- - Open tabs
42
-
43
- ## Session State Persistence
44
-
45
- ### Save Session State
46
-
47
- ```bash
48
- # Save cookies, storage, and auth state
49
- agent-browser state save /path/to/auth-state.json
50
- ```
51
-
52
- ### Load Session State
53
-
54
- ```bash
55
- # Restore saved state
56
- agent-browser state load /path/to/auth-state.json
57
-
58
- # Continue with authenticated session
59
- agent-browser open https://app.example.com/dashboard
60
- ```
61
-
62
- ### State File Contents
63
-
64
- ```json
65
- {
66
- "cookies": [...],
67
- "localStorage": {...},
68
- "sessionStorage": {...},
69
- "origins": [...]
70
- }
71
- ```
72
-
73
- ## Common Patterns
74
-
75
- ### Authenticated Session Reuse
76
-
77
- ```bash
78
- #!/bin/bash
79
- # Save login state once, reuse many times
80
-
81
- STATE_FILE="/tmp/auth-state.json"
82
-
83
- # Check if we have saved state
84
- if [[ -f "$STATE_FILE" ]]; then
85
- agent-browser state load "$STATE_FILE"
86
- agent-browser open https://app.example.com/dashboard
87
- else
88
- # Perform login
89
- agent-browser open https://app.example.com/login
90
- agent-browser snapshot -i
91
- agent-browser fill @e1 "$USERNAME"
92
- agent-browser fill @e2 "$PASSWORD"
93
- agent-browser click @e3
94
- agent-browser wait --load networkidle
95
-
96
- # Save for future use
97
- agent-browser state save "$STATE_FILE"
98
- fi
99
- ```
100
-
101
- ### Concurrent Scraping
102
-
103
- ```bash
104
- #!/bin/bash
105
- # Scrape multiple sites concurrently
106
-
107
- # Start all sessions
108
- agent-browser --session site1 open https://site1.com &
109
- agent-browser --session site2 open https://site2.com &
110
- agent-browser --session site3 open https://site3.com &
111
- wait
112
-
113
- # Extract from each
114
- agent-browser --session site1 get text body > site1.txt
115
- agent-browser --session site2 get text body > site2.txt
116
- agent-browser --session site3 get text body > site3.txt
117
-
118
- # Cleanup
119
- agent-browser --session site1 close
120
- agent-browser --session site2 close
121
- agent-browser --session site3 close
122
- ```
123
-
124
- ### A/B Testing Sessions
125
-
126
- ```bash
127
- # Test different user experiences
128
- agent-browser --session variant-a open "https://app.com?variant=a"
129
- agent-browser --session variant-b open "https://app.com?variant=b"
130
-
131
- # Compare
132
- agent-browser --session variant-a screenshot /tmp/variant-a.png
133
- agent-browser --session variant-b screenshot /tmp/variant-b.png
134
- ```
135
-
136
- ## Default Session
137
-
138
- When `--session` is omitted, commands use the default session:
139
-
140
- ```bash
141
- # These use the same default session
142
- agent-browser open https://example.com
143
- agent-browser snapshot -i
144
- agent-browser close # Closes default session
145
- ```
146
-
147
- ## Session Cleanup
148
-
149
- ```bash
150
- # Close specific session
151
- agent-browser --session auth close
152
-
153
- # List active sessions
154
- agent-browser session list
155
- ```
156
-
157
- ## Best Practices
158
-
159
- ### 1. Name Sessions Semantically
160
-
161
- ```bash
162
- # GOOD: Clear purpose
163
- agent-browser --session github-auth open https://github.com
164
- agent-browser --session docs-scrape open https://docs.example.com
165
-
166
- # AVOID: Generic names
167
- agent-browser --session s1 open https://github.com
168
- ```
169
-
170
- ### 2. Always Clean Up
171
-
172
- ```bash
173
- # Close sessions when done
174
- agent-browser --session auth close
175
- agent-browser --session scrape close
176
- ```
177
-
178
- ### 3. Handle State Files Securely
179
-
180
- ```bash
181
- # Don't commit state files (contain auth tokens!)
182
- echo "*.auth-state.json" >> .gitignore
183
-
184
- # Delete after use
185
- rm /tmp/auth-state.json
186
- ```
187
-
188
- ### 4. Timeout Long Sessions
189
-
190
- ```bash
191
- # Set timeout for automated scripts
192
- timeout 60 agent-browser --session long-task get text body
193
- ```