create-harness-vibe-coding 0.8.16 → 0.8.18
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 +18 -0
- package/README-CN.md +100 -127
- package/README.md +63 -42
- package/package.json +1 -1
- package/src/generator.js +628 -121
- package/src/index.js +174 -43
- package/src/prompts.js +18 -0
- 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-command-create.md +58 -0
- package/templates/common/.claude/commands/wf-help.md +13 -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-task-archive.md +26 -0
- package/templates/common/.claude/commands/wf-task-list.md +24 -0
- package/templates/common/.claude/commands/wf-task-record.md +24 -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-agents-docs/SKILL.md +15 -30
- package/templates/common/.claude/skills/wf-browser/SKILL.md +176 -0
- package/templates/common/.claude/skills/wf-command-create/SKILL.md +37 -0
- package/templates/common/.claude/skills/wf-help/SKILL.md +30 -0
- package/templates/common/.claude/skills/wf-max/SKILL.md +22 -8
- package/templates/common/.claude/skills/wf-review/SKILL.md +29 -2
- package/templates/common/.claude/skills/wf-task-archive/SKILL.md +28 -0
- package/templates/common/.claude/skills/wf-task-list/SKILL.md +28 -0
- package/templates/common/.claude/skills/wf-task-record/SKILL.md +28 -0
- package/templates/common/.codex/config.toml +3 -5
- package/templates/common/.harness-version +108 -41
- 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-command-create.md +61 -0
- package/templates/common/.opencode/commands/wf-help.md +13 -6
- package/templates/common/.opencode/commands/wf-max.md +12 -7
- package/templates/common/.opencode/commands/wf-task-archive.md +29 -0
- package/templates/common/.opencode/commands/wf-task-list.md +27 -0
- package/templates/common/.opencode/commands/wf-task-record.md +27 -0
- package/templates/common/CLAUDE.md +9 -7
- package/templates/common/Harness/MEMORY.md +12 -3
- package/templates/common/Harness/README.md +23 -41
- package/templates/common/Harness/ownership.manifest.json +162 -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 +1279 -0
- package/templates/common/Harness/scripts/validate-harness.mjs +635 -65
- package/templates/common/Harness/scripts/wf-remove.mjs +37 -5
- package/templates/common/Harness/scripts/wf-update-check.mjs +3 -0
- package/templates/common/Harness/specs/guides/SETUP.md +10 -2
- package/templates/common/Harness/specs/protocols/MEMORY_PROTOCOL.md +15 -0
- package/templates/common/Harness/specs/protocols/TASK_ARCHIVE.md +49 -23
- package/templates/common/Harness/specs/runtime/command-surface.json +215 -0
- package/templates/common/Harness/specs/runtime/dispatch.md +2 -2
- package/templates/common/Harness/specs/runtime/subagents.md +15 -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 +35 -2
- package/templates/common/Harness/specs/workflows/WF-STATE.md +155 -36
- package/templates/common/Harness/tasks/_template/STATE.json +6 -0
- 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
|
@@ -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.
|
|
@@ -68,6 +86,11 @@ Every Worker dispatch or peer-CLI call must be bounded by the controller's comma
|
|
|
68
86
|
|
|
69
87
|
Record the channel actually used, command/tool form, timeout, exit status, and a <=250 token Evidence-Packet in the task capsule. Do not create ad hoc probe scripts or write peer-CLI output to `%TEMP%`; persistent evidence belongs only under the current task's `evidence/` directory when it is intentionally part of the task record.
|
|
70
88
|
|
|
89
|
+
### Peer CLI Output Contract
|
|
90
|
+
|
|
91
|
+
- `opencode run --agent reviewer`: installed agent is `mode: subagent` per `.opencode/agents/reviewer.md`. Do NOT claim primary-runner role use without a live probe.
|
|
92
|
+
- Parse JSON/JSONL peer CLI output: fail on empty/non-JSON, error events, budget errors, fallback warnings, or missing final model text.
|
|
93
|
+
|
|
71
94
|
## Parallelism Priority
|
|
72
95
|
|
|
73
96
|
1. Read-only exploration — max parallel, all readSets
|
|
@@ -104,11 +127,21 @@ WF-MAX fan-out is bounded. Unbounded worker dispatch is forbidden.
|
|
|
104
127
|
- **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
128
|
- **Idle workers**: Close completed agents before declaring the pool exhausted. Do not spawn new workers while idle capacity is available.
|
|
106
129
|
|
|
130
|
+
## Runtime Capacity Map
|
|
131
|
+
|
|
132
|
+
Harness treats vendor/runtime limits as outer ceilings, not as permission to exceed the WF-MAX caps above.
|
|
133
|
+
|
|
134
|
+
| Runtime | Native limit/config surface | Harness rule |
|
|
135
|
+
| --- | --- | --- |
|
|
136
|
+
| 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. |
|
|
137
|
+
| 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. |
|
|
138
|
+
| 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. |
|
|
139
|
+
|
|
107
140
|
## Organization Model
|
|
108
141
|
|
|
109
142
|
```
|
|
110
143
|
CEO(1) -> Manager_1(span) -> Worker_1..n
|
|
111
|
-
-> Manager_2(span) ->
|
|
144
|
+
-> Manager_2(span) -> Worker_1..n
|
|
112
145
|
```
|
|
113
146
|
|
|
114
147
|
## D-GATE
|
|
@@ -121,7 +154,7 @@ D-GATE is mandatory before implementation waves per [WF-KERNEL.md](WF-KERNEL.md)
|
|
|
121
154
|
2. Close completed agents; fill idle slots immediately.
|
|
122
155
|
3. Cross-CLI overflow: use an available peer CLI with explicit dispatch packets: `claude -p`, `codex exec`, or `opencode run --agent <role> --dir .`.
|
|
123
156
|
4. Bounded-pass fallback only when subagents and overflow are exhausted.
|
|
124
|
-
5.
|
|
157
|
+
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
158
|
6. Do not rely on Codex++, undocumented config, environment variables, forked/derived conversations, or third-party forks as stable capacity.
|
|
126
159
|
|
|
127
160
|
## Anti-Patterns and Sizing
|
|
@@ -1,77 +1,193 @@
|
|
|
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.
|
|
84
|
+
|
|
85
|
+
## Links (Cross-Task Dependencies)
|
|
86
|
+
|
|
87
|
+
STATE.json `links` enables cross-task dependency resolution without reading
|
|
88
|
+
every task capsule:
|
|
89
|
+
|
|
90
|
+
| Field | Type | Description |
|
|
91
|
+
|-------|------|-------------|
|
|
92
|
+
| `links.dependsOn` | `string[]` | Task IDs this task depends on (blockers) |
|
|
93
|
+
| `links.blocks` | `string[]` | Task IDs this task blocks |
|
|
94
|
+
| `links.related` | `string[]` | Related task IDs (no dependency direction) |
|
|
95
|
+
|
|
96
|
+
When resolving `links.dependsOn`, the controller reads only the listed tasks'
|
|
97
|
+
STATE.json, not all task capsules. A task with unresolved dependsOn entries
|
|
98
|
+
should stay in the blocked queue until its dependencies resolve.
|
|
99
|
+
|
|
100
|
+
## Work Items (Parallel Dispatch)
|
|
101
|
+
|
|
102
|
+
STATE.json `workItems[]` enables fine-grained parallel dispatch tracking with
|
|
103
|
+
per-item dependencies:
|
|
104
|
+
|
|
105
|
+
| Field | Type | Description |
|
|
106
|
+
|-------|------|-------------|
|
|
107
|
+
| `id` | `string` | Unique item identifier |
|
|
108
|
+
| `status` | `string` | `pending`, `ready`, `running`, `done`, `blocked`, `skipped`, `failed` |
|
|
109
|
+
| `phase` | `string` | Phase this item belongs to |
|
|
110
|
+
| `dependsOn` | `string[]` | Item IDs this item depends on |
|
|
111
|
+
| `parallelGroup` | `string` | Group name for concurrent dispatch (optional) |
|
|
112
|
+
| `readSet` | `string[]` | Files/patterns the item may read |
|
|
113
|
+
| `writeSet` | `string[]` | Files/patterns the item may write |
|
|
114
|
+
| `agent` | `string` | Agent role assigned (optional) |
|
|
115
|
+
| `evidence` | `string` | Evidence path or summary (optional) |
|
|
116
|
+
| `next` | `string` | Next action after this item completes (optional) |
|
|
117
|
+
|
|
118
|
+
`workItems` is an additive array — it supplements the dispatchLedger and queues
|
|
119
|
+
for finer-grained tracking. The dispatchLedger remains the canonical record of
|
|
120
|
+
subagent dispatches.
|
|
121
|
+
|
|
122
|
+
## Open Tasks
|
|
123
|
+
|
|
124
|
+
"Open tasks" are non-archived task capsules with status one of:
|
|
125
|
+
`active`, `in_progress`, `running`, `pending`, `blocked`,
|
|
126
|
+
`needs-user-decision`.
|
|
127
|
+
|
|
128
|
+
The active pointer (`Harness/PROGRESS.md`) marks the single task the agent
|
|
129
|
+
should resume. Other open tasks remain visible in the Task Index but are not
|
|
130
|
+
automatically loaded.
|
|
131
|
+
|
|
132
|
+
## Queue Entry Normalization
|
|
133
|
+
|
|
134
|
+
Queues (`ready`, `running`, `blocked`, `done`) accept both plain string entries
|
|
135
|
+
and object entries. The normalization rules are backward-compatible:
|
|
136
|
+
|
|
137
|
+
- A plain string entry is treated as a task or dispatch item ID.
|
|
138
|
+
- An object entry may contain the same fields as a work item (`id`, `status`,
|
|
139
|
+
`dependsOn`, etc.) for richer inline tracking.
|
|
140
|
+
- `task-state.mjs` preserves both forms during reconcile — it does not coerce
|
|
141
|
+
objects to strings or vice versa.
|
|
142
|
+
|
|
143
|
+
This enables incremental adoption: existing STATE.json files with string-only
|
|
144
|
+
queues continue to work without changes.
|
|
42
145
|
|
|
43
146
|
## Resume Protocol
|
|
44
147
|
|
|
45
148
|
New window / session start:
|
|
149
|
+
|
|
46
150
|
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>/
|
|
151
|
+
2. If user says "continue", "resume", "last task", "current task", "status",
|
|
152
|
+
or the work is not a simple direct task:
|
|
153
|
+
- Read `Harness/PROGRESS.md` and find Active Task.
|
|
154
|
+
- If Active Task exists, read `Harness/tasks/<active-task>/STATE.json`.
|
|
155
|
+
- Read `Harness/tasks/<active-task>/PROGRESS.md`.
|
|
156
|
+
- Read `Harness/tasks/<active-task>/PLAN.md` only if decisions/scope need review.
|
|
52
157
|
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
|
-
|
|
158
|
+
- Current phase, gate, tier.
|
|
159
|
+
- activeQuestion (needs user answer before proceeding).
|
|
160
|
+
- Queues: ready (can dispatch immediately), running (awaiting results),
|
|
161
|
+
blocked (needs resolution), done.
|
|
162
|
+
- nextAction (what to do next).
|
|
163
|
+
- **links.dependsOn**: if non-empty, check whether any dependency tasks are
|
|
164
|
+
still open (their STATE.json has a non-archived status). Report blocked
|
|
165
|
+
dependencies to the user.
|
|
166
|
+
- **workItems[]**: if non-empty, inspect items with status `running` or
|
|
167
|
+
`ready` for parallel dispatch candidates.
|
|
57
168
|
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
|
|
169
|
+
5. Direct simple tasks may skip STATE/PLAN/PROGRESS unless the user says
|
|
170
|
+
"continue"/"resume".
|
|
59
171
|
|
|
60
172
|
## State Transitions
|
|
61
173
|
|
|
62
|
-
```
|
|
63
|
-
intake
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
174
|
+
```text
|
|
175
|
+
intake -> clarify -> requirements -> prd -> acceptance -> plan
|
|
176
|
+
-> explore -> implement -> verify -> review
|
|
177
|
+
-> (fix -> verify -> review loop)
|
|
178
|
+
-> reflect -> closeout
|
|
67
179
|
```
|
|
68
180
|
|
|
69
|
-
Any phase may transition to `blocked` if a dependency, user decision, or external
|
|
181
|
+
Any phase may transition to `blocked` if a dependency, user decision, or external
|
|
182
|
+
input is required.
|
|
70
183
|
|
|
71
184
|
## Dispatch Ledger
|
|
72
185
|
|
|
73
|
-
Every dispatch packet MUST have an `id`. On return, controller or task-scribe
|
|
74
|
-
|
|
186
|
+
Every dispatch packet MUST have an `id`. On return, controller or task-scribe
|
|
187
|
+
updates the ledger item:
|
|
188
|
+
|
|
189
|
+
- `id`, `agent`, `role`, `phase`, `status` (`pending`, `ready`, `running`,
|
|
190
|
+
`done`, `blocked`, `skipped`, `failed`), `evidence`
|
|
75
191
|
|
|
76
192
|
See [WF-KERNEL.md](WF-KERNEL.md) for the dispatch packet format.
|
|
77
193
|
|
|
@@ -79,10 +195,13 @@ See [WF-KERNEL.md](WF-KERNEL.md) for the dispatch packet format.
|
|
|
79
195
|
|
|
80
196
|
- `/wf` uses the STATE ready queue for dynamic orchestration.
|
|
81
197
|
- `/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
|
|
198
|
+
- When a subagent returns or goes idle, controller immediately dispatches the
|
|
199
|
+
next ready item.
|
|
83
200
|
- task-scribe is the exception for task-state writes.
|
|
84
|
-
- Production source agents do not write STATE/PLAN/PROGRESS unless explicitly
|
|
201
|
+
- Production source agents do not write STATE/PLAN/PROGRESS unless explicitly
|
|
202
|
+
dispatched as task-scribe.
|
|
85
203
|
|
|
86
204
|
## Template
|
|
87
205
|
|
|
88
|
-
See `Harness/tasks/_template/STATE.json` for the canonical template. On task
|
|
206
|
+
See `Harness/tasks/_template/STATE.json` for the canonical template. On task
|
|
207
|
+
creation, copy and populate from the template.
|
|
@@ -10,12 +10,18 @@
|
|
|
10
10
|
"activeQuestion": null,
|
|
11
11
|
"nextAction": "Define goal and acceptance criteria",
|
|
12
12
|
"acceptance": [],
|
|
13
|
+
"links": {
|
|
14
|
+
"dependsOn": [],
|
|
15
|
+
"blocks": [],
|
|
16
|
+
"related": []
|
|
17
|
+
},
|
|
13
18
|
"queues": {
|
|
14
19
|
"ready": [],
|
|
15
20
|
"running": [],
|
|
16
21
|
"blocked": [],
|
|
17
22
|
"done": []
|
|
18
23
|
},
|
|
24
|
+
"workItems": [],
|
|
19
25
|
"dispatchLedger": [],
|
|
20
26
|
"decisions": [],
|
|
21
27
|
"risks": [],
|
|
@@ -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)
|