create-harness-vibe-coding 0.8.6 → 0.8.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 (93) hide show
  1. package/README-CN.md +157 -105
  2. package/README.md +160 -244
  3. package/bin/create-harness-vibe-coding.js +2 -2
  4. package/docs/images/harness-architecture-light.png +0 -0
  5. package/docs/images/harness-architecture.drawio +164 -0
  6. package/package.json +46 -44
  7. package/src/generator.js +30 -11
  8. package/src/index.js +143 -14
  9. package/src/prompts.js +37 -37
  10. package/templates/common/.claude/agents/architect-manager.md +45 -45
  11. package/templates/common/.claude/agents/context-master.md +75 -75
  12. package/templates/common/.claude/agents/debugger.md +41 -41
  13. package/templates/common/.claude/agents/explore-manager.md +41 -41
  14. package/templates/common/.claude/agents/implement-manager.md +49 -49
  15. package/templates/common/.claude/agents/implementer.md +40 -40
  16. package/templates/common/.claude/agents/memory-master.md +64 -64
  17. package/templates/common/.claude/agents/planner.md +34 -34
  18. package/templates/common/.claude/agents/reflector.md +35 -0
  19. package/templates/common/.claude/agents/researcher.md +41 -41
  20. package/templates/common/.claude/agents/review-manager.md +56 -56
  21. package/templates/common/.claude/agents/verifier.md +34 -32
  22. package/templates/common/.claude/commands/wf-help.md +2 -3
  23. package/templates/common/.claude/rules/ecc/common.md +44 -44
  24. package/templates/common/.claude/skills/subagent-orchestrator/SKILL.md +10 -4
  25. package/templates/common/.claude/skills/wf/SKILL.md +7 -3
  26. package/templates/common/.claude/skills/wf-auto/SKILL.md +61 -107
  27. package/templates/common/.claude/skills/wf-auto-spark/SKILL.md +19 -17
  28. package/templates/common/.claude/skills/wf-max/SKILL.md +40 -21
  29. package/templates/common/.claude/skills/wf-readme/SKILL.md +49 -49
  30. package/templates/common/.claude/skills/wf-remove/SKILL.md +7 -7
  31. package/templates/common/.claude/skills/wf-update/SKILL.md +9 -4
  32. package/templates/common/.codex/config.toml +5 -0
  33. package/templates/common/.harness-version +78 -36
  34. package/templates/common/.opencode/agents/architect-manager.md +52 -0
  35. package/templates/common/.opencode/agents/architect.md +35 -0
  36. package/templates/common/.opencode/agents/context-master.md +81 -0
  37. package/templates/common/.opencode/agents/debugger.md +43 -0
  38. package/templates/common/.opencode/agents/docs-researcher.md +42 -0
  39. package/templates/common/.opencode/agents/explore-manager.md +49 -0
  40. package/templates/common/.opencode/agents/implement-manager.md +56 -0
  41. package/templates/common/.opencode/agents/implementer.md +42 -0
  42. package/templates/common/.opencode/agents/memory-master.md +70 -0
  43. package/templates/common/.opencode/agents/planner.md +38 -0
  44. package/templates/common/.opencode/agents/reflector.md +39 -0
  45. package/templates/common/.opencode/agents/researcher.md +42 -0
  46. package/templates/common/.opencode/agents/review-manager.md +63 -0
  47. package/templates/common/.opencode/agents/reviewer.md +37 -0
  48. package/templates/common/.opencode/agents/tdd-guide.md +83 -0
  49. package/templates/common/.opencode/agents/test-writer.md +54 -0
  50. package/templates/common/.opencode/agents/verifier.md +37 -0
  51. package/templates/common/.opencode/commands/wf-help.md +23 -0
  52. package/templates/common/AGENTS.md +26 -25
  53. package/templates/common/CLAUDE.md +86 -88
  54. package/templates/common/Harness/ACCEPTANCE_PROTOCOL.md +12 -4
  55. package/templates/common/Harness/PROGRESS.md +17 -17
  56. package/templates/common/Harness/README.md +26 -16
  57. package/templates/common/Harness/WF-AUTO-ANGLES.md +170 -0
  58. package/templates/common/Harness/WF-AUTO-SPARK.md +23 -6
  59. package/templates/common/Harness/WF-AUTO.md +508 -493
  60. package/templates/common/Harness/WF-MAX.md +284 -232
  61. package/templates/common/Harness/WF.md +47 -29
  62. package/templates/common/Harness/agent-workflow.md +108 -76
  63. package/templates/common/Harness/architecture.md +124 -124
  64. package/templates/common/Harness/context-loading.md +111 -111
  65. package/templates/common/Harness/dispatch.md +96 -95
  66. package/templates/common/Harness/extension.md +67 -67
  67. package/templates/common/Harness/lifecycle.md +20 -20
  68. package/templates/common/Harness/research/PRD.md +56 -56
  69. package/templates/common/Harness/research/README.md +169 -169
  70. package/templates/common/Harness/research/research-results.md +66 -66
  71. package/templates/common/Harness/subagents.md +192 -170
  72. package/templates/common/Harness/tasks/_template/ARTIFACTS.md +3 -3
  73. package/templates/common/Harness/tasks/_template/NOTES.md +3 -3
  74. package/templates/common/Harness/tasks/_template/PLAN.md +53 -60
  75. package/templates/common/Harness/tasks/_template/PROGRESS.md +26 -29
  76. package/templates/common/MEMORY.md +27 -30
  77. package/templates/common/README.md +36 -36
  78. package/templates/common/SETUP.md +1 -1
  79. package/templates/common/memory/agent-lessons-patterns.md +21 -21
  80. package/templates/common/memory/tool-usage-reflections.md +21 -21
  81. package/templates/common/memory/user-corrections-preferences.md +21 -21
  82. package/templates/common/opencode.json +19 -0
  83. package/templates/common/scripts/scan-clean.mjs +487 -448
  84. package/templates/common/scripts/validate-harness.mjs +245 -146
  85. package/templates/common/scripts/wf-remove.mjs +311 -293
  86. package/templates/common/scripts/wf-update-check.mjs +511 -311
  87. package/templates/optional/catalog.json +41 -33
  88. package/templates/optional/skills/browser-e2e/.claude/skills/wf-browser/SKILL.md +194 -194
  89. package/templates/optional/skills/browser-e2e/Harness/workflows/browser-e2e.md +105 -69
  90. package/templates/optional/skills/github-pr-review/Harness/workflows/github-pr-review.md +28 -28
  91. package/templates/optional/skills/python-backend/Harness/workflows/python-backend.md +34 -34
  92. package/templates/optional/skills/ts-react-frontend/Harness/workflows/ts-react-frontend.md +34 -34
  93. package/templates/optional/skills/ui-ux-review/Harness/workflows/ui-ux-review.md +26 -26
@@ -1,41 +1,41 @@
1
- {
2
- "skills": [
3
- {
1
+ {
2
+ "skills": [
3
+ {
4
4
  "id": "browser-e2e",
5
5
  "title": "Browser E2E",
6
6
  "description": "Mandatory real-browser smoke workflow using Playwright, Chrome DevTools/CDP, or documented manual evidence.",
7
7
  "files": ["skills/browser-e2e"],
8
8
  "tags": ["e2e", "browser", "playwright", "cdp"]
9
- },
10
- {
11
- "id": "ui-ux-review",
12
- "title": "UI/UX Review",
13
- "description": "Screenshot-driven responsive, accessibility, and visual polish review workflow.",
14
- "files": ["skills/ui-ux-review"],
15
- "tags": ["ui", "ux", "accessibility", "review"]
16
- },
17
- {
18
- "id": "github-pr-review",
19
- "title": "GitHub PR Review",
20
- "description": "GitHub CLI based PR diff, checks, review findings, and CI evidence workflow.",
21
- "files": ["skills/github-pr-review"],
22
- "tags": ["github", "pr", "review", "ci"]
23
- },
24
- {
25
- "id": "python-backend",
26
- "title": "Python Backend",
27
- "description": "Python backend workflow for FastAPI or similar APIs with unittest or pytest verification.",
28
- "files": ["skills/python-backend"],
29
- "tags": ["python", "fastapi", "unittest", "pytest", "api"]
30
- },
31
- {
32
- "id": "ts-react-frontend",
33
- "title": "TypeScript React Frontend",
34
- "description": "TypeScript React workflow for typecheck, component tests, builds, and browser smoke.",
35
- "files": ["skills/ts-react-frontend"],
36
- "tags": ["typescript", "react", "vite", "frontend"]
37
- }
38
- ],
9
+ },
10
+ {
11
+ "id": "ui-ux-review",
12
+ "title": "UI/UX Review",
13
+ "description": "Screenshot-driven responsive, accessibility, and visual polish review workflow.",
14
+ "files": ["skills/ui-ux-review"],
15
+ "tags": ["ui", "ux", "accessibility", "review"]
16
+ },
17
+ {
18
+ "id": "github-pr-review",
19
+ "title": "GitHub PR Review",
20
+ "description": "GitHub CLI based PR diff, checks, review findings, and CI evidence workflow.",
21
+ "files": ["skills/github-pr-review"],
22
+ "tags": ["github", "pr", "review", "ci"]
23
+ },
24
+ {
25
+ "id": "python-backend",
26
+ "title": "Python Backend",
27
+ "description": "Python backend workflow for FastAPI or similar APIs with unittest or pytest verification.",
28
+ "files": ["skills/python-backend"],
29
+ "tags": ["python", "fastapi", "unittest", "pytest", "api"]
30
+ },
31
+ {
32
+ "id": "ts-react-frontend",
33
+ "title": "TypeScript React Frontend",
34
+ "description": "TypeScript React workflow for typecheck, component tests, builds, and browser smoke.",
35
+ "files": ["skills/ts-react-frontend"],
36
+ "tags": ["typescript", "react", "vite", "frontend"]
37
+ }
38
+ ],
39
39
  "presets": {
40
40
  "web-app": ["ts-react-frontend", "browser-e2e", "ui-ux-review"],
41
41
  "fullstack": ["ts-react-frontend", "python-backend", "browser-e2e", "github-pr-review"]
@@ -72,6 +72,14 @@
72
72
  "installMode": "recommend-only",
73
73
  "url": "https://github.com/colbymchenry/codegraph",
74
74
  "tags": ["code graph", "architecture", "analysis"]
75
+ },
76
+ {
77
+ "id": "oh-my-openagent",
78
+ "title": "oh-my-openagent",
79
+ "description": "Community OpenCode plugin harness: curated agents (Sisyphus/Prometheus/Hephaestus), lifecycle hooks, hash-anchored edits, and Team Mode. For OpenCode and Codex CLI.",
80
+ "installMode": "recommend-only",
81
+ "url": "https://github.com/code-yeongyu/oh-my-openagent",
82
+ "tags": ["opencode", "agents", "harness", "ecosystem"]
75
83
  }
76
84
  ]
77
85
  }
@@ -1,194 +1,194 @@
1
- ---
2
- name: wf-browser
3
- description: AI-driven browser automation for E2E testing, web scraping, form filling, and UI verification. Powered by Browser Use (89.1% WebVoyager benchmark). Use for /wf-browser, browser testing, web automation, page interaction, form filling, screenshot verification, or any task requiring real browser control. Dual mode: CLI (fast iteration, no LLM needed) + Python Agent API (complex multi-step workflows with AI reasoning).
4
- ---
5
-
6
- # WF Browser — AI Browser Automation
7
-
8
- Load:
9
-
10
- - `Harness/workflows/browser-e2e.md`
11
- - Official `browser-use` skill at `~/.claude/skills/browser-use/SKILL.md` (auto-installed if missing)
12
- - `Harness/PROGRESS.md` when work is active
13
-
14
- ## Modes
15
-
16
- Choose based on task complexity:
17
-
18
- ### Mode 1: CLI (fast iteration, ~50ms per call)
19
-
20
- Best for: single-page checks, quick screenshots, form fills, element inspection. No LLM needed — Claude Code reasons and issues CLI commands.
21
-
22
- ```bash
23
- browser-use --headed open https://example.com # Open page (headed = visible browser)
24
- browser-use state # Get page title, text, interactive elements with indices
25
- browser-use screenshot evidence.png # Capture screenshot as evidence
26
- browser-use click 5 # Click element by index from state output
27
- browser-use input 3 "user@example.com" # Fill input field by index
28
- browser-use eval "document.title" # Run JavaScript in page
29
- browser-use close # Close browser when done
30
- ```
31
-
32
- Daemon keeps the browser open between commands — no cold-start per action.
33
-
34
- ### Mode 2: Python Agent API (multi-step AI reasoning)
35
-
36
- Best for: complex multi-page workflows, dynamic navigation, data extraction across pages. Needs LLM API key.
37
-
38
- ```python
39
- from browser_use.beta import Agent, BrowserProfile
40
- from browser_use.llm import ChatAnthropic
41
-
42
- agent = Agent(
43
- task="Go to github.com, search for 'browser-use', click the first result, and report the star count",
44
- llm=ChatAnthropic(model="claude-haiku-4-5-20251001"),
45
- browser_profile=BrowserProfile(headless=False),
46
- )
47
- history = await agent.run()
48
- print(history.final_result())
49
- ```
50
-
51
- ## Environment Setup
52
-
53
- Run once per machine:
54
-
55
- ```bash
56
- # 1. Install browser-use with CLI extras
57
- pip install "browser-use[cli]"
58
-
59
- # 2. Install Chromium browser
60
- browser-use install
61
-
62
- # 3. Verify installation
63
- browser-use doctor
64
-
65
- # 4. (Optional) Set LLM API key for Agent mode
66
- # Create .env file with: ANTHROPIC_API_KEY=sk-ant-...
67
- # Or: OPENAI_API_KEY=sk-...
68
- # Or: BROWSER_USE_API_KEY=bu-...
69
- ```
70
-
71
- ### Windows GBK Encoding Fix
72
-
73
- If you see `UnicodeEncodeError: 'gbk' codec can't encode character`, the install is auto-patched. If not, set env var before commands:
74
-
75
- ```bash
76
- set PYTHONIOENCODING=utf-8
77
- ```
78
-
79
- ### Windows Daemon Patches
80
-
81
- Browser Use v0.13.1 has two known issues on Windows that are auto-patched on install. If `browser-use open` fails with "Failed to start daemon" or socket timeout, re-apply:
82
-
83
- ```bash
84
- python -c "
85
- import browser_use.skill_cli.main as m
86
- p = m.__file__
87
- c = open(p, encoding='utf-8').read()
88
- # Patch 1: auto-clean stale state on dead PID
89
- c = c.replace(
90
- 'probe = _probe_session(session)\n\n\t# Socket reachable',
91
- 'probe = _probe_session(session)\n\n\t# Auto-clean stale state\n\tif not probe.socket_reachable and not probe.pid_alive and probe.phase:\n\t\t_clean_session_files(session)\n\t\tprobe = _probe_session(session)\n\n\t# Socket reachable'
92
- )
93
- # Patch 2: auto-recover from stale session instead of erroring
94
- c = c.replace(
95
- \"f'Error: Session {session!r} is alive (phase={probe.phase}) but socket unreachable.\",\"
96
- \"f'Warning: Session {session!r} has stale state (phase={probe.phase}), auto-cleaning...\",\"
97
- )
98
- c = c.replace(
99
- \"sys.exit(1)\n\n\t\telif probe.phase == 'shutting_down'\",
100
- \"_terminate_pid(probe.pid)\n\t\t\t_clean_session_files(session)\n\n\t\telif probe.phase == 'shutting_down'\"
101
- )
102
- # Patch 3: extend daemon startup timeout (15s -> 30s)
103
- c = c.replace('deadline = time.time() + 15', 'deadline = time.time() + 30')
104
- open(p, 'w', encoding='utf-8').write(c)
105
- print('Patches applied')
106
- "
107
- ```
108
-
109
- ### Requirements
110
-
111
- | Requirement | Version | Check |
112
- |-------------|---------|-------|
113
- | Python | >= 3.11 | `python --version` |
114
- | pip | any | `pip --version` |
115
- | Chromium | auto-installed | `browser-use doctor` |
116
- | LLM API key | for Agent mode only | check `.env` |
117
-
118
- ## Common Patterns
119
-
120
- ### Login Persistence
121
-
122
- ```bash
123
- # Use real Chrome profile (preserves cookies/logins)
124
- browser-use --profile "Default" open https://app.target.com
125
- # Or connect to running Chrome with remote debugging
126
- browser-use connect
127
- ```
128
-
129
- ### E2E Test Flow
130
-
131
- ```bash
132
- browser-use --headed open https://yourapp.local
133
- browser-use state # Verify page loaded
134
- browser-use screenshot step1-landing.png # Evidence
135
- browser-use input 3 "test@email.com" # Fill email
136
- browser-use input 5 "password123" # Fill password
137
- browser-use click 8 # Click login button
138
- browser-use wait text "Dashboard" # Wait for navigation text
139
- browser-use state # Verify logged in
140
- browser-use screenshot step2-dashboard.png # Evidence
141
- browser-use close
142
- ```
143
-
144
- ### Console & Network Log Capture
145
-
146
- ```bash
147
- browser-use eval "console.log('checkpoint');" # Inject log marker
148
- browser-use eval "document.title" # Read page state via JS
149
- browser-use get text 5 # Get text of element index 5
150
- browser-use get value 3 # Get value of input element index 3
151
- # For full console/network: use Python Agent mode with Playwright's page.on('console') and page.on('request')
152
- ```
153
-
154
- ### Error Recovery
155
-
156
- ```bash
157
- # If daemon crashes or gets stuck:
158
- browser-use close # Clean shutdown
159
- # Then restart:
160
- browser-use open <url> # Fresh daemon starts automatically
161
- ```
162
-
163
- ## Verification Contract
164
-
165
- Every browser task must produce:
166
-
167
- 1. **State evidence**: `browser-use state` output or screenshot
168
- 2. **Action log**: sequence of commands issued
169
- 3. **Result assertion**: explicit before/after state comparison
170
-
171
- No browser/UI claim without real-browser evidence.
172
-
173
- ## Architecture Note
174
-
175
- Browser Use wraps Playwright with AI reasoning. The daemon keeps Chromium running between CLI commands (~50ms latency). The Agent mode adds an LLM observation→decision→action loop on top. This replaces fragile CSS-selector scripts with semantic element targeting via accessibility tree snapshots.
176
-
177
- Benchmarks: 89.1% WebVoyager (SOTA), 78k+ GitHub stars, MIT license.
178
-
179
- ## Security
180
-
181
- - **Never log or screenshot credentials** — redact password fields, API keys, tokens before capturing evidence
182
- - **Chrome profiles contain sensitive data** — only use `--profile` with explicit user approval; never share profile data
183
- - **Screenshots may capture PII** — review before saving to task evidence directory
184
- - **Scraping targets need approval** — confirm the target site's ToS allow automated access before scraping
185
- - **`browser-use input` commands with passwords** — use placeholder values in documentation; never hardcode real credentials
186
- - **Agent mode sandbox** — run Agent API with `allowed_domains` restriction when possible
187
-
188
- ## Return
189
-
190
- - CLI commands issued and their output
191
- - screenshot paths
192
- - agent history (if Agent mode used)
193
- - verification pass/fail with evidence
194
- - remaining risks (flaky selectors, auth issues, CAPTCHAs)
1
+ ---
2
+ name: wf-browser
3
+ description: AI-driven browser automation for E2E testing, web scraping, form filling, and UI verification. Powered by Browser Use (89.1% WebVoyager benchmark). Use for Claude /wf-browser, Codex $wf-browser, browser testing, web automation, page interaction, form filling, screenshot verification, or any task requiring real browser control. Dual mode: CLI (fast iteration, no LLM needed) + Python Agent API (complex multi-step workflows with AI reasoning).
4
+ ---
5
+
6
+ # WF Browser — AI Browser Automation
7
+
8
+ Load:
9
+
10
+ - `Harness/workflows/browser-e2e.md`
11
+ - Official `browser-use` skill at `~/.claude/skills/browser-use/SKILL.md` (auto-installed if missing)
12
+ - `Harness/PROGRESS.md` when work is active
13
+
14
+ ## Modes
15
+
16
+ Choose based on task complexity:
17
+
18
+ ### Mode 1: CLI (fast iteration, ~50ms per call)
19
+
20
+ Best for: single-page checks, quick screenshots, form fills, element inspection. No LLM needed — Claude Code reasons and issues CLI commands.
21
+
22
+ ```bash
23
+ browser-use --headed open https://example.com # Open page (headed = visible browser)
24
+ browser-use state # Get page title, text, interactive elements with indices
25
+ browser-use screenshot evidence.png # Capture screenshot as evidence
26
+ browser-use click 5 # Click element by index from state output
27
+ browser-use input 3 "user@example.com" # Fill input field by index
28
+ browser-use eval "document.title" # Run JavaScript in page
29
+ browser-use close # Close browser when done
30
+ ```
31
+
32
+ Daemon keeps the browser open between commands — no cold-start per action.
33
+
34
+ ### Mode 2: Python Agent API (multi-step AI reasoning)
35
+
36
+ Best for: complex multi-page workflows, dynamic navigation, data extraction across pages. Needs LLM API key.
37
+
38
+ ```python
39
+ from browser_use.beta import Agent, BrowserProfile
40
+ from browser_use.llm import ChatAnthropic
41
+
42
+ agent = Agent(
43
+ task="Go to github.com, search for 'browser-use', click the first result, and report the star count",
44
+ llm=ChatAnthropic(model="claude-haiku-4-5-20251001"),
45
+ browser_profile=BrowserProfile(headless=False),
46
+ )
47
+ history = await agent.run()
48
+ print(history.final_result())
49
+ ```
50
+
51
+ ## Environment Setup
52
+
53
+ Run once per machine:
54
+
55
+ ```bash
56
+ # 1. Install browser-use with CLI extras
57
+ pip install "browser-use[cli]"
58
+
59
+ # 2. Install Chromium browser
60
+ browser-use install
61
+
62
+ # 3. Verify installation
63
+ browser-use doctor
64
+
65
+ # 4. (Optional) Set LLM API key for Agent mode
66
+ # Create .env file with: ANTHROPIC_API_KEY=sk-ant-...
67
+ # Or: OPENAI_API_KEY=sk-...
68
+ # Or: BROWSER_USE_API_KEY=bu-...
69
+ ```
70
+
71
+ ### Windows GBK Encoding Fix
72
+
73
+ If you see `UnicodeEncodeError: 'gbk' codec can't encode character`, the install is auto-patched. If not, set env var before commands:
74
+
75
+ ```bash
76
+ set PYTHONIOENCODING=utf-8
77
+ ```
78
+
79
+ ### Windows Daemon Patches
80
+
81
+ Browser Use v0.13.1 has two known issues on Windows that are auto-patched on install. If `browser-use open` fails with "Failed to start daemon" or socket timeout, re-apply:
82
+
83
+ ```bash
84
+ python -c "
85
+ import browser_use.skill_cli.main as m
86
+ p = m.__file__
87
+ c = open(p, encoding='utf-8').read()
88
+ # Patch 1: auto-clean stale state on dead PID
89
+ c = c.replace(
90
+ 'probe = _probe_session(session)\n\n\t# Socket reachable',
91
+ 'probe = _probe_session(session)\n\n\t# Auto-clean stale state\n\tif not probe.socket_reachable and not probe.pid_alive and probe.phase:\n\t\t_clean_session_files(session)\n\t\tprobe = _probe_session(session)\n\n\t# Socket reachable'
92
+ )
93
+ # Patch 2: auto-recover from stale session instead of erroring
94
+ c = c.replace(
95
+ \"f'Error: Session {session!r} is alive (phase={probe.phase}) but socket unreachable.\",\"
96
+ \"f'Warning: Session {session!r} has stale state (phase={probe.phase}), auto-cleaning...\",\"
97
+ )
98
+ c = c.replace(
99
+ \"sys.exit(1)\n\n\t\telif probe.phase == 'shutting_down'\",
100
+ \"_terminate_pid(probe.pid)\n\t\t\t_clean_session_files(session)\n\n\t\telif probe.phase == 'shutting_down'\"
101
+ )
102
+ # Patch 3: extend daemon startup timeout (15s -> 30s)
103
+ c = c.replace('deadline = time.time() + 15', 'deadline = time.time() + 30')
104
+ open(p, 'w', encoding='utf-8').write(c)
105
+ print('Patches applied')
106
+ "
107
+ ```
108
+
109
+ ### Requirements
110
+
111
+ | Requirement | Version | Check |
112
+ |-------------|---------|-------|
113
+ | Python | >= 3.11 | `python --version` |
114
+ | pip | any | `pip --version` |
115
+ | Chromium | auto-installed | `browser-use doctor` |
116
+ | LLM API key | for Agent mode only | check `.env` |
117
+
118
+ ## Common Patterns
119
+
120
+ ### Login Persistence
121
+
122
+ ```bash
123
+ # Use real Chrome profile (preserves cookies/logins)
124
+ browser-use --profile "Default" open https://app.target.com
125
+ # Or connect to running Chrome with remote debugging
126
+ browser-use connect
127
+ ```
128
+
129
+ ### E2E Test Flow
130
+
131
+ ```bash
132
+ browser-use --headed open https://yourapp.local
133
+ browser-use state # Verify page loaded
134
+ browser-use screenshot step1-landing.png # Evidence
135
+ browser-use input 3 "test@email.com" # Fill email
136
+ browser-use input 5 "password123" # Fill password
137
+ browser-use click 8 # Click login button
138
+ browser-use wait text "Dashboard" # Wait for navigation text
139
+ browser-use state # Verify logged in
140
+ browser-use screenshot step2-dashboard.png # Evidence
141
+ browser-use close
142
+ ```
143
+
144
+ ### Console & Network Log Capture
145
+
146
+ ```bash
147
+ browser-use eval "console.log('checkpoint');" # Inject log marker
148
+ browser-use eval "document.title" # Read page state via JS
149
+ browser-use get text 5 # Get text of element index 5
150
+ browser-use get value 3 # Get value of input element index 3
151
+ # For full console/network: use Python Agent mode with Playwright's page.on('console') and page.on('request')
152
+ ```
153
+
154
+ ### Error Recovery
155
+
156
+ ```bash
157
+ # If daemon crashes or gets stuck:
158
+ browser-use close # Clean shutdown
159
+ # Then restart:
160
+ browser-use open <url> # Fresh daemon starts automatically
161
+ ```
162
+
163
+ ## Verification Contract
164
+
165
+ Every browser task must produce:
166
+
167
+ 1. **State evidence**: `browser-use state` output or screenshot
168
+ 2. **Action log**: sequence of commands issued
169
+ 3. **Result assertion**: explicit before/after state comparison
170
+
171
+ No browser/UI claim without real-browser evidence.
172
+
173
+ ## Architecture Note
174
+
175
+ Browser Use wraps Playwright with AI reasoning. The daemon keeps Chromium running between CLI commands (~50ms latency). The Agent mode adds an LLM observation→decision→action loop on top. This replaces fragile CSS-selector scripts with semantic element targeting via accessibility tree snapshots.
176
+
177
+ Benchmarks: 89.1% WebVoyager (SOTA), 78k+ GitHub stars, MIT license.
178
+
179
+ ## Security
180
+
181
+ - **Never log or screenshot credentials** — redact password fields, API keys, tokens before capturing evidence
182
+ - **Chrome profiles contain sensitive data** — only use `--profile` with explicit user approval; never share profile data
183
+ - **Screenshots may capture PII** — review before saving to task evidence directory
184
+ - **Scraping targets need approval** — confirm the target site's ToS allow automated access before scraping
185
+ - **`browser-use input` commands with passwords** — use placeholder values in documentation; never hardcode real credentials
186
+ - **Agent mode sandbox** — run Agent API with `allowed_domains` restriction when possible
187
+
188
+ ## Return
189
+
190
+ - CLI commands issued and their output
191
+ - screenshot paths
192
+ - agent history (if Agent mode used)
193
+ - verification pass/fail with evidence
194
+ - remaining risks (flaky selectors, auth issues, CAPTCHAs)