create-harness-vibe-coding 0.8.16 → 0.8.17
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/CHANGELOG.md +9 -0
- package/README-CN.md +98 -127
- package/README.md +61 -42
- package/package.json +1 -1
- package/src/generator.js +15 -24
- package/src/index.js +1 -1
- package/templates/common/.claude/commands/wf-auto-spark.md +16 -0
- package/templates/common/.claude/commands/wf-auto.md +16 -0
- package/templates/{optional/skills/browser-e2e/.opencode → common/.claude}/commands/wf-browser.md +1 -1
- package/templates/common/.claude/commands/wf-help.md +9 -6
- package/templates/common/.claude/commands/wf-learn.md +16 -0
- package/templates/common/.claude/commands/wf-max.md +20 -0
- package/templates/common/.claude/commands/wf-readme.md +16 -0
- package/templates/common/.claude/commands/wf-remove.md +16 -0
- package/templates/common/.claude/commands/wf-review.md +16 -0
- package/templates/common/.claude/commands/wf.md +16 -0
- package/templates/common/.claude/rules/ecc/common.md +1 -1
- package/templates/common/.claude/skills/wf-browser/SKILL.md +176 -0
- package/templates/common/.claude/skills/wf-help/SKILL.md +30 -0
- package/templates/common/.claude/skills/wf-max/SKILL.md +21 -7
- package/templates/common/.codex/config.toml +3 -5
- package/templates/common/.harness-version +69 -36
- package/templates/common/.opencode/agents/architect-manager.md +7 -1
- package/templates/common/.opencode/agents/explore-manager.md +10 -1
- package/templates/common/.opencode/agents/implement-manager.md +5 -3
- package/templates/common/.opencode/agents/review-manager.md +5 -2
- package/templates/common/.opencode/commands/wf-browser.md +16 -0
- package/templates/common/.opencode/commands/wf-help.md +9 -6
- package/templates/common/.opencode/commands/wf-max.md +12 -7
- package/templates/common/CLAUDE.md +2 -2
- package/templates/common/Harness/MEMORY.md +3 -3
- package/templates/common/Harness/README.md +12 -11
- package/templates/common/Harness/ownership.manifest.json +77 -14
- package/templates/common/Harness/scripts/archive-tasks.mjs +12 -220
- package/templates/common/Harness/scripts/scan-clean.mjs +3 -9
- package/templates/common/Harness/scripts/task-state.mjs +889 -0
- package/templates/common/Harness/scripts/validate-harness.mjs +233 -28
- package/templates/common/Harness/scripts/wf-remove.mjs +3 -3
- package/templates/common/Harness/scripts/wf-update-check.mjs +3 -0
- package/templates/common/Harness/specs/guides/SETUP.md +2 -2
- package/templates/common/Harness/specs/protocols/TASK_ARCHIVE.md +43 -23
- package/templates/common/Harness/specs/runtime/dispatch.md +2 -2
- package/templates/common/Harness/specs/runtime/subagents.md +9 -5
- package/templates/common/Harness/specs/workflows/WF-AUTO.md +6 -6
- package/templates/common/Harness/specs/workflows/WF-KERNEL.md +1 -1
- package/templates/common/Harness/specs/workflows/WF-MAX.md +30 -2
- package/templates/common/Harness/specs/workflows/WF-STATE.md +89 -36
- package/templates/common/opencode.json +1 -0
- package/templates/optional/catalog.json +2 -9
- package/templates/optional/skills/browser-e2e/.claude/skills/browser-e2e/SKILL.md +0 -42
- package/templates/optional/skills/browser-e2e/.claude/skills/wf-browser/SKILL.md +0 -201
- package/templates/optional/skills/browser-e2e/Harness/workflows/browser-e2e.md +0 -119
|
@@ -130,11 +130,15 @@ Max parallelism removes the Harness default cap, not the runtime's physical or
|
|
|
130
130
|
account cap. For WF-MAX, record the current runtime budget, use native
|
|
131
131
|
subagents first, close completed agents before declaring the pool exhausted,
|
|
132
132
|
then overflow to a peer CLI (`claude -p`, `codex exec`, or `opencode run --agent <role> --dir .`) with explicit
|
|
133
|
-
dispatch packets.
|
|
134
|
-
`
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
133
|
+
dispatch packets. WF-MAX must attempt native subagent fan-out and record
|
|
134
|
+
`fanoutAttempted: true` before any solo fallback. Do not scaffold Codex scalar
|
|
135
|
+
`[agents]` capacity fields into `.codex/config.toml`; codex-cli 0.144.x can
|
|
136
|
+
reject them during TUI `skills/list`. Probe the installed runtime first and
|
|
137
|
+
manage Codex WF-MAX caps through the dispatch ledger unless the installed
|
|
138
|
+
version accepts the config shape. Generated OpenCode config defaults to
|
|
139
|
+
`subagent_depth = 2` so manager subagents can invoke worker subagents; manager
|
|
140
|
+
agents also need `permission.task` allowlists. Do not rely on undocumented
|
|
141
|
+
fork/derive bypasses as stable capacity.
|
|
138
142
|
|
|
139
143
|
Default for explicit WF invocation: tier-based. WF-Light: planner + test-writer + implementer + verifier (bounded passes acceptable). WF-Standard: adds research/docs + one independent review lens. WF-Full: complete role chain, use bounded role passes as the recorded fallback when subagents are unavailable.
|
|
140
144
|
|
|
@@ -296,11 +296,11 @@ Every cycle writes one entry to `Harness/tasks/auto/PROGRESS.md`:
|
|
|
296
296
|
|
|
297
297
|
IMMEDIATELY return to W0. No pause between cycles — the only breaks are the adaptive Intent Checkpoint and the A-GATE.
|
|
298
298
|
|
|
299
|
-
###
|
|
299
|
+
### Runtime Hook Boundaries
|
|
300
300
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
auto-optimization.
|
|
301
|
+
Execution-control hooks are disabled by default across the Harness scaffold.
|
|
302
|
+
Startup update-check hooks are not execution-control hooks. Only an explicitly
|
|
303
|
+
enabled `/wf-auto` tick hook may drive long-running auto-optimization.
|
|
304
304
|
|
|
305
305
|
Manual or benchmark-driven single-cycle `/wf-auto` runs use the same bounded
|
|
306
306
|
tick contract: they may stop because the caller explicitly requested one tick,
|
|
@@ -321,8 +321,8 @@ wf-auto hook event
|
|
|
321
321
|
|
|
322
322
|
Hard boundaries:
|
|
323
323
|
|
|
324
|
-
- no hook is installed or registered by default
|
|
325
|
-
- only `/wf-auto` may use a runtime hook
|
|
324
|
+
- no execution-control hook is installed or registered by default
|
|
325
|
+
- only `/wf-auto` may use a runtime hook to drive auto-optimization
|
|
326
326
|
- the hook must run one bounded tick, not an unbounded process
|
|
327
327
|
- the hook must respect `Harness/tasks/auto/STOP`, `state=paused`, user stop,
|
|
328
328
|
and the Adaptive Coverage Exhaustion Gate
|
|
@@ -131,7 +131,7 @@ ReturnSchema:
|
|
|
131
131
|
|
|
132
132
|
| Task Type | Primary Agents | Skills |
|
|
133
133
|
|---|---|---|
|
|
134
|
-
| UI/browser behavior | test-writer, implementer, verifier, reviewer |
|
|
134
|
+
| UI/browser behavior | test-writer, implementer, verifier, reviewer | wf-browser |
|
|
135
135
|
| API/backend | docs-researcher, test-writer, implementer, verifier, reviewer (security) | tdd |
|
|
136
136
|
| Architecture/migration | architect, codebase-explorer, planner, reviewer | — |
|
|
137
137
|
| Docs/README | wf-readme, reviewer, task-scribe | wf-readme |
|
|
@@ -22,6 +22,24 @@ WF-MAX is **explicit only**. Enter ONLY when the user explicitly types `/wf-max`
|
|
|
22
22
|
|
|
23
23
|
**WF-Max-Strict** (explicit `--strict`, `strict wf-max`, or `strict mode`): unconditional fan-out per span formula. Every file gets a Worker.
|
|
24
24
|
|
|
25
|
+
## Mandatory Fan-Out Contract
|
|
26
|
+
|
|
27
|
+
`/wf-max` MUST attempt native subagent fan-out before implementation planning is considered complete. A solo controller path is allowed only after an explicit degradation record.
|
|
28
|
+
|
|
29
|
+
Minimum W0 attempt:
|
|
30
|
+
|
|
31
|
+
- Start `task-scribe` when available to maintain task state and the dispatch ledger.
|
|
32
|
+
- Start at least one independent read-only planning/exploration/review lane. For real multi-domain tasks, prefer `explore-manager` plus scoped researchers or codebase explorers.
|
|
33
|
+
- Record `fanoutAttempted: true`, runtime, channel tried, agents requested, configured/runtime limit facts, result, and degradation reason in the task PLAN or PROGRESS.
|
|
34
|
+
|
|
35
|
+
Mode interaction:
|
|
36
|
+
|
|
37
|
+
- WF-Max-Useful may shrink the fan-out after the first native attempt when write sets or review lenses are not meaningfully independent. It may not silently skip the attempt.
|
|
38
|
+
- WF-Max-Strict continues through the span formula until the Harness caps, runtime caps, user budget, or safety gates stop dispatch.
|
|
39
|
+
- If native manager fan-out is unavailable, the controller dispatches leaf agents directly with exact WF-MAX dispatch packets; if no independent channel exists, stop honestly and ask the user.
|
|
40
|
+
|
|
41
|
+
OpenCode-specific requirement: project `opencode.json` must set `subagent_depth >= 2` for manager -> worker nesting, and WF-MAX manager agents must expose `permission.task` allowlists for their child agents. Without those two settings, OpenCode may accept `/wf-max` but fail to fan out from manager subagents.
|
|
42
|
+
|
|
25
43
|
## CEO Contract
|
|
26
44
|
|
|
27
45
|
CEO reads, plans, dispatches, synthesizes, and writes task state only.
|
|
@@ -104,11 +122,21 @@ WF-MAX fan-out is bounded. Unbounded worker dispatch is forbidden.
|
|
|
104
122
|
- **Overflow discipline**: Cross-CLI overflow (Codex → Claude, Claude → Codex) is allowed only after native subagent pool is genuinely exhausted (not just busy). Each overflow dispatch costs context; prefer closing completed agents first.
|
|
105
123
|
- **Idle workers**: Close completed agents before declaring the pool exhausted. Do not spawn new workers while idle capacity is available.
|
|
106
124
|
|
|
125
|
+
## Runtime Capacity Map
|
|
126
|
+
|
|
127
|
+
Harness treats vendor/runtime limits as outer ceilings, not as permission to exceed the WF-MAX caps above.
|
|
128
|
+
|
|
129
|
+
| Runtime | Native limit/config surface | Harness rule |
|
|
130
|
+
| --- | --- | --- |
|
|
131
|
+
| Claude Code | Official docs describe subagent caps for session total `CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION` (default 200), concurrency `CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS` (default 20), and spawn depth `CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH` (default 3); use current Claude Code agent/subagent settings when available. | Record the detected limit/source when known; Harness WF-MAX caps still apply unless the user approves a task-local override. Do not raise environment limits without user approval. |
|
|
132
|
+
| Codex | Official manual documents `[agents].max_concurrent_threads_per_session`; `agents.max_threads` is a legacy alias. Local codex-cli 0.144.x can reject scalar `[agents]` caps from project `.codex/config.toml` during TUI `skills/list`. | Do not scaffold Codex scalar agent caps into `.codex/config.toml`. Probe the installed runtime first; Harness manages a conservative task-local cap through the dispatch ledger unless `codex --strict-config doctor` verifies the config shape. |
|
|
133
|
+
| OpenCode | Official config uses `subagent_depth`; default `1` permits primary -> subagent but blocks subagent -> subagent. `0` disables subagent launches; `2` permits one nested manager -> worker level. No official concurrent-count cap was found in the current docs. | Generated config sets `subagent_depth = 2`; Harness manages total/per-wave counts through WF-MAX caps and manager `permission.task` allowlists. |
|
|
134
|
+
|
|
107
135
|
## Organization Model
|
|
108
136
|
|
|
109
137
|
```
|
|
110
138
|
CEO(1) -> Manager_1(span) -> Worker_1..n
|
|
111
|
-
-> Manager_2(span) ->
|
|
139
|
+
-> Manager_2(span) -> Worker_1..n
|
|
112
140
|
```
|
|
113
141
|
|
|
114
142
|
## D-GATE
|
|
@@ -121,7 +149,7 @@ D-GATE is mandatory before implementation waves per [WF-KERNEL.md](WF-KERNEL.md)
|
|
|
121
149
|
2. Close completed agents; fill idle slots immediately.
|
|
122
150
|
3. Cross-CLI overflow: use an available peer CLI with explicit dispatch packets: `claude -p`, `codex exec`, or `opencode run --agent <role> --dir .`.
|
|
123
151
|
4. Bounded-pass fallback only when subagents and overflow are exhausted.
|
|
124
|
-
5.
|
|
152
|
+
5. Codex compatibility guard: do not write scalar `[agents]` capacity fields into project `.codex/config.toml` by default. Probe the installed version first; local codex-cli 0.144.x has been observed to reject those fields during TUI `skills/list`. Harness manages Codex WF-MAX concurrency through the dispatch ledger and asks the user before any project/global Codex config change.
|
|
125
153
|
6. Do not rely on Codex++, undocumented config, environment variables, forked/derived conversations, or third-party forks as stable capacity.
|
|
126
154
|
|
|
127
155
|
## Anti-Patterns and Sizing
|
|
@@ -1,77 +1,127 @@
|
|
|
1
|
-
# WF-STATE
|
|
1
|
+
# WF-STATE - Lightweight Resumable State Machine
|
|
2
2
|
|
|
3
|
-
Purpose: persist resumable workflow state across compaction, new Claude Code
|
|
3
|
+
Purpose: persist resumable workflow state across compaction, new Claude Code
|
|
4
|
+
windows, new terminals, and project reopen. It is NOT a scheduler, daemon, lock
|
|
5
|
+
manager, async runtime, or graph framework.
|
|
4
6
|
|
|
5
7
|
## State Files
|
|
6
8
|
|
|
7
9
|
| File | Role |
|
|
8
10
|
|------|------|
|
|
9
|
-
| `Harness/PROGRESS.md` |
|
|
10
|
-
| `Harness/tasks/<task-id>/STATE.json` |
|
|
11
|
+
| `Harness/PROGRESS.md` | Derived global active pointer and Task Index |
|
|
12
|
+
| `Harness/tasks/<task-id>/STATE.json` | Canonical machine-readable resume truth |
|
|
11
13
|
| `Harness/tasks/<task-id>/PROGRESS.md` | Human-readable summary |
|
|
12
14
|
| `Harness/tasks/<task-id>/PLAN.md` | Plan, decisions, scope context |
|
|
13
15
|
|
|
14
|
-
Task id convention: new task capsules MUST use
|
|
15
|
-
(kebab-case, 2-5 words after the prefix), for
|
|
16
|
-
`task-fix-login-flow`. Do not create bare task names such as
|
|
16
|
+
Task id convention: new task capsules MUST use
|
|
17
|
+
`task-<verb>-<noun>[-detail]` (kebab-case, 2-5 words after the prefix), for
|
|
18
|
+
example `task-fix-login-flow`. Do not create bare task names such as
|
|
17
19
|
`fix-login-flow`.
|
|
18
20
|
|
|
19
21
|
## Enums
|
|
20
22
|
|
|
23
|
+
### status
|
|
24
|
+
|
|
25
|
+
`active`, `blocked`, `in_progress`, `running`, `pending`,
|
|
26
|
+
`needs-user-decision`, `complete`, `verified`, `archived`, `abandoned`,
|
|
27
|
+
`obsolete`, `done`, `closed`, `closeout`, `skipped`, `failed`
|
|
28
|
+
|
|
21
29
|
### phase
|
|
22
|
-
|
|
30
|
+
|
|
31
|
+
`intake`, `clarify`, `requirements`, `prd`, `acceptance`, `plan`, `explore`,
|
|
32
|
+
`implement`, `verify`, `review`, `fix`, `reflect`, `closeout`, `blocked`,
|
|
33
|
+
`verified`, `archived`
|
|
34
|
+
|
|
35
|
+
Legacy aliases such as `Implementation`, `Validation`, and
|
|
36
|
+
`Verified/Complete` are normalized by `task-state.mjs`.
|
|
23
37
|
|
|
24
38
|
### item status (queues)
|
|
39
|
+
|
|
25
40
|
`pending`, `ready`, `running`, `done`, `blocked`, `skipped`, `failed`
|
|
26
41
|
|
|
27
42
|
### mode
|
|
28
|
-
|
|
43
|
+
|
|
44
|
+
`direct`, `wf`, `wf-max`, `wf-auto`, `wf-auto-spark`, `wf-review`,
|
|
45
|
+
`wf-browser`
|
|
29
46
|
|
|
30
47
|
### tier
|
|
48
|
+
|
|
31
49
|
`none`, `light`, `standard`, `full`, `max-useful`, `max-strict`
|
|
32
50
|
|
|
33
51
|
## Rules
|
|
34
52
|
|
|
35
|
-
1. **STATE.json is machine-readable resume truth.** On session start, the agent
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
53
|
+
1. **STATE.json is machine-readable resume truth.** On session start, the agent
|
|
54
|
+
reads it to know where it left off.
|
|
55
|
+
2. **PROGRESS.md is human-readable summary.** It mirrors key state but is
|
|
56
|
+
secondary for machine reasoning and may be rewritten from state.
|
|
57
|
+
3. **PLAN.md is plan/decision context.** Load only when decisions or scope need
|
|
58
|
+
review.
|
|
59
|
+
4. **On every phase transition, dispatch return, blocker, verification result,
|
|
60
|
+
review finding, or closeout, update STATE.json through
|
|
61
|
+
`Harness/scripts/task-state.mjs` when the command covers the change.**
|
|
62
|
+
task-scribe or controller writes; production agents never write task state.
|
|
39
63
|
5. **Long logs/transcripts never go into STATE.json.** Store paths only.
|
|
40
|
-
6. **task-scribe may update STATE.json and task summaries; production agents may
|
|
41
|
-
|
|
64
|
+
6. **task-scribe may update STATE.json and task summaries; production agents may
|
|
65
|
+
not.**
|
|
66
|
+
7. **If STATE.json conflicts with PLAN/PROGRESS, controller stops and reconciles
|
|
67
|
+
before continuing.**
|
|
68
|
+
|
|
69
|
+
## CLI Contract
|
|
70
|
+
|
|
71
|
+
Use `Harness/scripts/task-state.mjs` as the deterministic state writer:
|
|
72
|
+
|
|
73
|
+
- `node Harness/scripts/task-state.mjs list --json`
|
|
74
|
+
- `node Harness/scripts/task-state.mjs validate --json`
|
|
75
|
+
- `node Harness/scripts/task-state.mjs reconcile --dry-run --json`
|
|
76
|
+
- `node Harness/scripts/task-state.mjs reconcile --apply`
|
|
77
|
+
- `node Harness/scripts/task-state.mjs set-active <task-id>`
|
|
78
|
+
- `node Harness/scripts/task-state.mjs transition <task-id> --status <status> --phase <phase>`
|
|
79
|
+
- `node Harness/scripts/task-state.mjs archive --keep 5 --dry-run --json`
|
|
80
|
+
- `node Harness/scripts/task-state.mjs archive --keep 5 --apply`
|
|
81
|
+
|
|
82
|
+
Do not rely on prompt instructions alone to keep active task, task `STATE.json`,
|
|
83
|
+
task `PROGRESS.md`, and root `Harness/PROGRESS.md` synchronized.
|
|
42
84
|
|
|
43
85
|
## Resume Protocol
|
|
44
86
|
|
|
45
87
|
New window / session start:
|
|
88
|
+
|
|
46
89
|
1. Read `CLAUDE.md`.
|
|
47
|
-
2. If user says "continue", "resume", "last task", "current task", "status",
|
|
48
|
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
- Read `Harness/tasks/<active-task>/
|
|
90
|
+
2. If user says "continue", "resume", "last task", "current task", "status",
|
|
91
|
+
or the work is not a simple direct task:
|
|
92
|
+
- Read `Harness/PROGRESS.md` and find Active Task.
|
|
93
|
+
- If Active Task exists, read `Harness/tasks/<active-task>/STATE.json`.
|
|
94
|
+
- Read `Harness/tasks/<active-task>/PROGRESS.md`.
|
|
95
|
+
- Read `Harness/tasks/<active-task>/PLAN.md` only if decisions/scope need review.
|
|
52
96
|
3. From STATE.json, determine:
|
|
53
|
-
- Current phase, gate, tier
|
|
54
|
-
- activeQuestion (needs user answer before proceeding)
|
|
55
|
-
- Queues: ready (can dispatch immediately), running (awaiting results),
|
|
56
|
-
|
|
97
|
+
- Current phase, gate, tier.
|
|
98
|
+
- activeQuestion (needs user answer before proceeding).
|
|
99
|
+
- Queues: ready (can dispatch immediately), running (awaiting results),
|
|
100
|
+
blocked (needs resolution), done.
|
|
101
|
+
- nextAction (what to do next).
|
|
57
102
|
4. Do NOT bulk-read `Harness/tasks/` to find context. Use the active pointer.
|
|
58
|
-
5. Direct simple tasks may skip STATE/PLAN/PROGRESS unless the user says
|
|
103
|
+
5. Direct simple tasks may skip STATE/PLAN/PROGRESS unless the user says
|
|
104
|
+
"continue"/"resume".
|
|
59
105
|
|
|
60
106
|
## State Transitions
|
|
61
107
|
|
|
62
|
-
```
|
|
63
|
-
intake
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
108
|
+
```text
|
|
109
|
+
intake -> clarify -> requirements -> prd -> acceptance -> plan
|
|
110
|
+
-> explore -> implement -> verify -> review
|
|
111
|
+
-> (fix -> verify -> review loop)
|
|
112
|
+
-> reflect -> closeout
|
|
67
113
|
```
|
|
68
114
|
|
|
69
|
-
Any phase may transition to `blocked` if a dependency, user decision, or external
|
|
115
|
+
Any phase may transition to `blocked` if a dependency, user decision, or external
|
|
116
|
+
input is required.
|
|
70
117
|
|
|
71
118
|
## Dispatch Ledger
|
|
72
119
|
|
|
73
|
-
Every dispatch packet MUST have an `id`. On return, controller or task-scribe
|
|
74
|
-
|
|
120
|
+
Every dispatch packet MUST have an `id`. On return, controller or task-scribe
|
|
121
|
+
updates the ledger item:
|
|
122
|
+
|
|
123
|
+
- `id`, `agent`, `role`, `phase`, `status` (`pending`, `ready`, `running`,
|
|
124
|
+
`done`, `blocked`, `skipped`, `failed`), `evidence`
|
|
75
125
|
|
|
76
126
|
See [WF-KERNEL.md](WF-KERNEL.md) for the dispatch packet format.
|
|
77
127
|
|
|
@@ -79,10 +129,13 @@ See [WF-KERNEL.md](WF-KERNEL.md) for the dispatch packet format.
|
|
|
79
129
|
|
|
80
130
|
- `/wf` uses the STATE ready queue for dynamic orchestration.
|
|
81
131
|
- `/wf-max` uses the SAME STATE ready queue for maximum safe fan-out.
|
|
82
|
-
- When a subagent returns or goes idle, controller immediately dispatches the
|
|
132
|
+
- When a subagent returns or goes idle, controller immediately dispatches the
|
|
133
|
+
next ready item.
|
|
83
134
|
- task-scribe is the exception for task-state writes.
|
|
84
|
-
- Production source agents do not write STATE/PLAN/PROGRESS unless explicitly
|
|
135
|
+
- Production source agents do not write STATE/PLAN/PROGRESS unless explicitly
|
|
136
|
+
dispatched as task-scribe.
|
|
85
137
|
|
|
86
138
|
## Template
|
|
87
139
|
|
|
88
|
-
See `Harness/tasks/_template/STATE.json` for the canonical template. On task
|
|
140
|
+
See `Harness/tasks/_template/STATE.json` for the canonical template. On task
|
|
141
|
+
creation, copy and populate from the template.
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"skills": [
|
|
3
|
-
{
|
|
4
|
-
"id": "browser-e2e",
|
|
5
|
-
"title": "Browser E2E",
|
|
6
|
-
"description": "Mandatory real-browser smoke workflow using Playwright, Chrome DevTools/CDP, or documented manual evidence.",
|
|
7
|
-
"files": ["skills/browser-e2e"],
|
|
8
|
-
"tags": ["e2e", "browser", "playwright", "cdp"]
|
|
9
|
-
},
|
|
10
3
|
{
|
|
11
4
|
"id": "ui-ux-review",
|
|
12
5
|
"title": "UI/UX Review",
|
|
@@ -37,8 +30,8 @@
|
|
|
37
30
|
}
|
|
38
31
|
],
|
|
39
32
|
"presets": {
|
|
40
|
-
"web-app": ["ts-react-frontend", "
|
|
41
|
-
"fullstack": ["ts-react-frontend", "python-backend", "
|
|
33
|
+
"web-app": ["ts-react-frontend", "ui-ux-review"],
|
|
34
|
+
"fullstack": ["ts-react-frontend", "python-backend", "github-pr-review"]
|
|
42
35
|
},
|
|
43
36
|
"externalRecommendations": [
|
|
44
37
|
{
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: browser-e2e
|
|
3
|
-
description: Mandatory real-browser smoke and end-to-end verification using Playwright, Chrome DevTools/CDP, or documented manual browser evidence.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Browser E2E
|
|
7
|
-
|
|
8
|
-
## When To Use
|
|
9
|
-
|
|
10
|
-
Use this skill when a change affects browser-visible behavior, navigation, forms, routing, layout, or client-side integration. Web/UI acceptance requires loading the app in a real browser before claiming the UI is done.
|
|
11
|
-
|
|
12
|
-
## Docs To Load
|
|
13
|
-
|
|
14
|
-
- `Harness/workflows/browser-e2e.md`
|
|
15
|
-
- `Harness/PROGRESS.md` and current task `tasks/<id>/PLAN.md`
|
|
16
|
-
- Existing project test, build, and run instructions.
|
|
17
|
-
|
|
18
|
-
## Required Inputs
|
|
19
|
-
|
|
20
|
-
- Target URL or command to start the app.
|
|
21
|
-
- User flows or pages to verify.
|
|
22
|
-
- Expected behavior and supported viewport/browser scope.
|
|
23
|
-
- Selector contract: stable accessible labels/roles and `data-testid` hooks for critical inputs, buttons, filters, rows, empty/error/loading states, and other targetable UI states.
|
|
24
|
-
|
|
25
|
-
## Allowed Writes
|
|
26
|
-
|
|
27
|
-
- Browser test files in the project's existing test locations.
|
|
28
|
-
- Evidence artifacts such as screenshots, traces, or reports in existing artifact folders.
|
|
29
|
-
- Notes in current task plan when the active task asks for plan tracking.
|
|
30
|
-
|
|
31
|
-
## Output Format
|
|
32
|
-
|
|
33
|
-
Return changed files, commands run, browser evidence paths, verified flows, failures, and follow-up risks.
|
|
34
|
-
Include the selectors used for CDP/Playwright/manual verification.
|
|
35
|
-
|
|
36
|
-
## PROGRESS.md & Task PLAN.md Updates
|
|
37
|
-
|
|
38
|
-
Update `Harness/tasks/<task-id>/PLAN.md` only when executing a tracked plan item or recording evidence requested by the current task.
|
|
39
|
-
|
|
40
|
-
## dispatch.md Usage
|
|
41
|
-
|
|
42
|
-
Use `Harness/specs/runtime/dispatch.md` only when splitting independent browser checks across workers is explicitly useful.
|
|
@@ -1,201 +0,0 @@
|
|
|
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
|
-
## Cache Discipline
|
|
15
|
-
|
|
16
|
-
Follow `Harness/specs/runtime/context-loading.md#Cache-First Context Contract`: keep workflow
|
|
17
|
-
docs stable, use CLI state/screenshot paths as dynamic evidence, and avoid
|
|
18
|
-
replaying full browser logs or screenshots in prompts unless a failed AC needs
|
|
19
|
-
targeted inspection.
|
|
20
|
-
|
|
21
|
-
## Modes
|
|
22
|
-
|
|
23
|
-
Choose based on task complexity:
|
|
24
|
-
|
|
25
|
-
### Mode 1: CLI (fast iteration, ~50ms per call)
|
|
26
|
-
|
|
27
|
-
Best for: single-page checks, quick screenshots, form fills, element inspection. No LLM needed — Claude Code reasons and issues CLI commands.
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
browser-use --headed open https://example.com # Open page (headed = visible browser)
|
|
31
|
-
browser-use state # Get page title, text, interactive elements with indices
|
|
32
|
-
browser-use screenshot evidence.png # Capture screenshot as evidence
|
|
33
|
-
browser-use click 5 # Click element by index from state output
|
|
34
|
-
browser-use input 3 "user@example.com" # Fill input field by index
|
|
35
|
-
browser-use eval "document.title" # Run JavaScript in page
|
|
36
|
-
browser-use close # Close browser when done
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
Daemon keeps the browser open between commands — no cold-start per action.
|
|
40
|
-
|
|
41
|
-
### Mode 2: Python Agent API (multi-step AI reasoning)
|
|
42
|
-
|
|
43
|
-
Best for: complex multi-page workflows, dynamic navigation, data extraction across pages. Needs LLM API key.
|
|
44
|
-
|
|
45
|
-
```python
|
|
46
|
-
from browser_use.beta import Agent, BrowserProfile
|
|
47
|
-
from browser_use.llm import ChatAnthropic
|
|
48
|
-
|
|
49
|
-
agent = Agent(
|
|
50
|
-
task="Go to github.com, search for 'browser-use', click the first result, and report the star count",
|
|
51
|
-
llm=ChatAnthropic(model="claude-haiku-4-5-20251001"),
|
|
52
|
-
browser_profile=BrowserProfile(headless=False),
|
|
53
|
-
)
|
|
54
|
-
history = await agent.run()
|
|
55
|
-
print(history.final_result())
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
## Environment Setup
|
|
59
|
-
|
|
60
|
-
Run once per machine:
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
# 1. Install browser-use with CLI extras
|
|
64
|
-
pip install "browser-use[cli]"
|
|
65
|
-
|
|
66
|
-
# 2. Install Chromium browser
|
|
67
|
-
browser-use install
|
|
68
|
-
|
|
69
|
-
# 3. Verify installation
|
|
70
|
-
browser-use doctor
|
|
71
|
-
|
|
72
|
-
# 4. (Optional) Set LLM API key for Agent mode
|
|
73
|
-
# Create .env file with: ANTHROPIC_API_KEY=sk-ant-...
|
|
74
|
-
# Or: OPENAI_API_KEY=sk-...
|
|
75
|
-
# Or: BROWSER_USE_API_KEY=bu-...
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### Windows GBK Encoding Fix
|
|
79
|
-
|
|
80
|
-
If you see `UnicodeEncodeError: 'gbk' codec can't encode character`, the install is auto-patched. If not, set env var before commands:
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
set PYTHONIOENCODING=utf-8
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
### Windows Daemon Patches
|
|
87
|
-
|
|
88
|
-
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:
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
python -c "
|
|
92
|
-
import browser_use.skill_cli.main as m
|
|
93
|
-
p = m.__file__
|
|
94
|
-
c = open(p, encoding='utf-8').read()
|
|
95
|
-
# Patch 1: auto-clean stale state on dead PID
|
|
96
|
-
c = c.replace(
|
|
97
|
-
'probe = _probe_session(session)\n\n\t# Socket reachable',
|
|
98
|
-
'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'
|
|
99
|
-
)
|
|
100
|
-
# Patch 2: auto-recover from stale session instead of erroring
|
|
101
|
-
c = c.replace(
|
|
102
|
-
\"f'Error: Session {session!r} is alive (phase={probe.phase}) but socket unreachable.\",\"
|
|
103
|
-
\"f'Warning: Session {session!r} has stale state (phase={probe.phase}), auto-cleaning...\",\"
|
|
104
|
-
)
|
|
105
|
-
c = c.replace(
|
|
106
|
-
\"sys.exit(1)\n\n\t\telif probe.phase == 'shutting_down'\",
|
|
107
|
-
\"_terminate_pid(probe.pid)\n\t\t\t_clean_session_files(session)\n\n\t\telif probe.phase == 'shutting_down'\"
|
|
108
|
-
)
|
|
109
|
-
# Patch 3: extend daemon startup timeout (15s -> 30s)
|
|
110
|
-
c = c.replace('deadline = time.time() + 15', 'deadline = time.time() + 30')
|
|
111
|
-
open(p, 'w', encoding='utf-8').write(c)
|
|
112
|
-
print('Patches applied')
|
|
113
|
-
"
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### Requirements
|
|
117
|
-
|
|
118
|
-
| Requirement | Version | Check |
|
|
119
|
-
|-------------|---------|-------|
|
|
120
|
-
| Python | >= 3.11 | `python --version` |
|
|
121
|
-
| pip | any | `pip --version` |
|
|
122
|
-
| Chromium | auto-installed | `browser-use doctor` |
|
|
123
|
-
| LLM API key | for Agent mode only | check `.env` |
|
|
124
|
-
|
|
125
|
-
## Common Patterns
|
|
126
|
-
|
|
127
|
-
### Login Persistence
|
|
128
|
-
|
|
129
|
-
```bash
|
|
130
|
-
# Use real Chrome profile (preserves cookies/logins)
|
|
131
|
-
browser-use --profile "Default" open https://app.target.com
|
|
132
|
-
# Or connect to running Chrome with remote debugging
|
|
133
|
-
browser-use connect
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
### E2E Test Flow
|
|
137
|
-
|
|
138
|
-
```bash
|
|
139
|
-
browser-use --headed open https://yourapp.local
|
|
140
|
-
browser-use state # Verify page loaded
|
|
141
|
-
browser-use screenshot step1-landing.png # Evidence
|
|
142
|
-
browser-use input 3 "test@email.com" # Fill email
|
|
143
|
-
browser-use input 5 "password123" # Fill password
|
|
144
|
-
browser-use click 8 # Click login button
|
|
145
|
-
browser-use wait text "Dashboard" # Wait for navigation text
|
|
146
|
-
browser-use state # Verify logged in
|
|
147
|
-
browser-use screenshot step2-dashboard.png # Evidence
|
|
148
|
-
browser-use close
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
### Console & Network Log Capture
|
|
152
|
-
|
|
153
|
-
```bash
|
|
154
|
-
browser-use eval "console.log('checkpoint');" # Inject log marker
|
|
155
|
-
browser-use eval "document.title" # Read page state via JS
|
|
156
|
-
browser-use get text 5 # Get text of element index 5
|
|
157
|
-
browser-use get value 3 # Get value of input element index 3
|
|
158
|
-
# For full console/network: use Python Agent mode with Playwright's page.on('console') and page.on('request')
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
### Error Recovery
|
|
162
|
-
|
|
163
|
-
```bash
|
|
164
|
-
# If daemon crashes or gets stuck:
|
|
165
|
-
browser-use close # Clean shutdown
|
|
166
|
-
# Then restart:
|
|
167
|
-
browser-use open <url> # Fresh daemon starts automatically
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
## Verification Contract
|
|
171
|
-
|
|
172
|
-
Every browser task must produce:
|
|
173
|
-
|
|
174
|
-
1. **State evidence**: `browser-use state` output or screenshot
|
|
175
|
-
2. **Action log**: sequence of commands issued
|
|
176
|
-
3. **Result assertion**: explicit before/after state comparison
|
|
177
|
-
|
|
178
|
-
No browser/UI claim without real-browser evidence.
|
|
179
|
-
|
|
180
|
-
## Architecture Note
|
|
181
|
-
|
|
182
|
-
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.
|
|
183
|
-
|
|
184
|
-
Benchmarks: 89.1% WebVoyager (SOTA), 78k+ GitHub stars, MIT license.
|
|
185
|
-
|
|
186
|
-
## Security
|
|
187
|
-
|
|
188
|
-
- **Never log or screenshot credentials** — redact password fields, API keys, tokens before capturing evidence
|
|
189
|
-
- **Chrome profiles contain sensitive data** — only use `--profile` with explicit user approval; never share profile data
|
|
190
|
-
- **Screenshots may capture PII** — review before saving to task evidence directory
|
|
191
|
-
- **Scraping targets need approval** — confirm the target site's ToS allow automated access before scraping
|
|
192
|
-
- **`browser-use input` commands with passwords** — use placeholder values in documentation; never hardcode real credentials
|
|
193
|
-
- **Agent mode sandbox** — run Agent API with `allowed_domains` restriction when possible
|
|
194
|
-
|
|
195
|
-
## Return
|
|
196
|
-
|
|
197
|
-
- CLI commands issued and their output
|
|
198
|
-
- screenshot paths
|
|
199
|
-
- agent history (if Agent mode used)
|
|
200
|
-
- verification pass/fail with evidence
|
|
201
|
-
- remaining risks (flaky selectors, auth issues, CAPTCHAs)
|