create-harness-vibe-coding 0.7.2 → 0.8.0
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/README-CN.md +91 -155
- package/README.md +200 -177
- package/bin/create-harness-vibe-coding.js +2 -2
- package/package.json +45 -43
- package/src/generator.js +115 -77
- package/src/index.js +159 -49
- package/src/prompts.js +95 -27
- package/templates/common/.claude/agents/architect-manager.md +45 -45
- package/templates/common/.claude/agents/context-master.md +77 -77
- package/templates/common/.claude/agents/debugger.md +41 -41
- package/templates/common/.claude/agents/explore-manager.md +41 -41
- package/templates/common/.claude/agents/implement-manager.md +49 -49
- package/templates/common/.claude/agents/implementer.md +40 -40
- package/templates/common/.claude/agents/memory-master.md +66 -66
- package/templates/common/.claude/agents/planner.md +34 -34
- package/templates/common/.claude/agents/researcher.md +41 -41
- package/templates/common/.claude/agents/review-manager.md +56 -56
- package/templates/common/.claude/agents/test-writer.md +38 -38
- package/templates/common/.claude/agents/verifier.md +32 -32
- package/templates/common/.claude/rules/ecc/common.md +45 -45
- package/templates/common/.claude/settings.json +68 -68
- package/templates/common/.claude/skills/subagent-orchestrator/SKILL.md +36 -31
- package/templates/common/.claude/skills/wf/SKILL.md +36 -0
- package/templates/common/.claude/skills/wf-learn/SKILL.md +13 -28
- package/templates/common/.claude/skills/wf-max/SKILL.md +24 -88
- package/templates/common/.claude/skills/wf-readme/SKILL.md +49 -49
- package/templates/common/.claude/skills/wf-remove/SKILL.md +17 -38
- package/templates/common/.claude/skills/wf-review/SKILL.md +19 -69
- package/templates/common/.claude/skills/wf-update/SKILL.md +19 -61
- package/templates/common/.codex/config.toml +2 -2
- package/templates/common/.codex/hooks.json +37 -37
- package/templates/common/.harness-version +53 -51
- package/templates/common/AGENTS.md +30 -30
- package/templates/common/CLAUDE.md +94 -94
- package/templates/common/{docs/harness → Harness}/PROGRESS.md +17 -17
- package/templates/common/{docs → Harness}/README.md +18 -17
- package/templates/common/{docs/harness → Harness}/WF-MAX.md +223 -223
- package/templates/common/Harness/WF.md +217 -0
- package/templates/common/{docs/harness → Harness}/architecture.md +126 -126
- package/templates/common/{docs/harness → Harness}/dispatch.md +99 -99
- package/templates/common/{docs → Harness}/research/research-results.md +66 -66
- package/templates/common/{docs/harness → Harness}/subagents.md +194 -194
- package/templates/common/{docs → Harness}/tasks/_template/ARTIFACTS.md +3 -3
- package/templates/common/{docs → Harness}/tasks/_template/NOTES.md +3 -3
- package/templates/common/{docs → Harness}/tasks/_template/PLAN.md +40 -40
- package/templates/common/{docs → Harness}/tasks/_template/PROGRESS.md +29 -29
- package/templates/common/MEMORY.md +68 -66
- package/templates/common/README.md +44 -37
- package/templates/common/SETUP.md +41 -34
- package/templates/common/memory/agent-lessons-patterns.md +21 -21
- package/templates/common/memory/tool-usage-reflections.md +21 -21
- package/templates/common/memory/user-corrections-preferences.md +21 -21
- package/templates/common/scripts/scan-clean.mjs +450 -449
- package/templates/common/scripts/validate-harness.mjs +56 -34
- package/templates/common/scripts/wf-mode-hook.mjs +318 -318
- package/templates/common/scripts/wf-remove.mjs +400 -384
- package/templates/common/scripts/wf-statusline.ps1 +38 -38
- package/templates/common/scripts/wf-statusline.sh +48 -48
- package/templates/common/scripts/wf-update-check.mjs +389 -389
- package/templates/optional/catalog.json +63 -29
- package/templates/optional/skills/browser-e2e/.claude/skills/wf-browser/SKILL.md +194 -194
- package/templates/optional/skills/browser-e2e/{docs → Harness}/workflows/browser-e2e.md +75 -75
- package/templates/optional/skills/github-pr-review/{docs → Harness}/workflows/github-pr-review.md +28 -28
- package/templates/optional/skills/python-backend/{docs → Harness}/workflows/python-backend.md +34 -34
- package/templates/optional/skills/ts-react-frontend/{docs → Harness}/workflows/ts-react-frontend.md +35 -35
- package/templates/optional/skills/ui-ux-review/{docs → Harness}/workflows/ui-ux-review.md +26 -26
- package/templates/common/.claude/commands/wf-learn.md +0 -17
- package/templates/common/.claude/commands/wf-max.md +0 -49
- package/templates/common/.claude/commands/wf-remove.md +0 -23
- package/templates/common/.claude/commands/wf-review.md +0 -25
- package/templates/common/.claude/commands/wf-update.md +0 -17
- package/templates/common/.claude/commands/wf.md +0 -31
- package/templates/common/commands/wf-max.toml +0 -18
- package/templates/common/commands/wf-review.toml +0 -15
- package/templates/common/docs/harness/WF.md +0 -174
- package/templates/optional/skills/browser-e2e/.claude/commands/wf-browser.md +0 -25
- /package/templates/common/{docs/harness → Harness}/agent-workflow.md +0 -0
- /package/templates/common/{docs/harness → Harness}/context-loading.md +0 -0
- /package/templates/common/{docs/harness → Harness}/extension.md +0 -0
- /package/templates/common/{docs/harness → Harness}/lifecycle.md +0 -0
- /package/templates/common/{docs → Harness}/research/PRD.md +0 -0
- /package/templates/common/{docs → Harness}/research/README.md +0 -0
|
@@ -1,194 +1,194 @@
|
|
|
1
|
-
# Subagent Orchestration
|
|
2
|
-
|
|
3
|
-
Purpose: coordinate subagents for speed without losing control of scope, evidence, or integration.
|
|
4
|
-
|
|
5
|
-
Use this file when work needs multiple roles, parallel reading, independent review, broad context, repeated failures, or `/wf`.
|
|
6
|
-
|
|
7
|
-
project files are the only durable communication channel; chat/subagent transcript state is non-authoritative. Important assumptions, decisions, blockers, evidence, and handoffs must be written to `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md`, the current feature doc, `Harness/MEMORY.md`, or `Harness/memory/*` as appropriate.
|
|
8
|
-
|
|
9
|
-
## Source Attribution
|
|
10
|
-
|
|
11
|
-
This harness distills ideas from these sources. Keep the protocol local and conservative; do not import external runtimes by default.
|
|
12
|
-
|
|
13
|
-
| Source | Found By | Adopted Idea |
|
|
14
|
-
| --- | --- | --- |
|
|
15
|
-
| `superpowers:dispatching-parallel-agents` | local skill | Dispatch one agent per independent problem domain; give focused scope and exact context. |
|
|
16
|
-
| `superpowers:subagent-driven-development` | local skill | Fresh implementer per task; spec review before code-quality review; handle `DONE`, `DONE_WITH_CONCERNS`, `NEEDS_CONTEXT`, and `BLOCKED`. |
|
|
17
|
-
| [`flc1125/skills@subagent-orchestrator`](https://skills.sh/flc1125/skills/subagent-orchestrator) | `npx skills find "subagent orchestration"` | Explicit subagent invocation, role-specific prompts, tool permission awareness. |
|
|
18
|
-
| [`davila7/claude-code-templates@parallel-agents`](https://skills.sh/davila7/claude-code-templates/parallel-agents) | `npx skills find "parallel agents"` | Discovery -> domain agents -> synthesis; one unified synthesis instead of scattered reports. |
|
|
19
|
-
| [`ruvnet/ruflo@agent-workflow`](https://skills.sh/ruvnet/ruflo/agent-workflow) | `npx skills find "agent workflow"` | Workflow thinking: triggers, agent assignments, parallel processing, and stateful handoffs. |
|
|
20
|
-
| [`pcvelz/superpowers@subagent-driven-development`](https://skills.sh/pcvelz/superpowers/subagent-driven-development) | `npx skills find "subagent driven development"` | Implementer plus review gates for spec compliance and code quality. |
|
|
21
|
-
| [`oimiragieo/agent-studio`](https://skills.sh/oimiragieo/agent-studio/dispatching-parallel-agents) | Skills CLI / public docs | Router-subordinate architecture and durable handoff discipline. |
|
|
22
|
-
| [`subagent-orchestration-skill`](https://skills.rest/rjtaryn/skills/subagent-orchestration-skill) | public docs | Multi-stage executor, spec reviewer, code reviewer, circuit breaker, and escalation pattern. |
|
|
23
|
-
|
|
24
|
-
## Controller Role
|
|
25
|
-
|
|
26
|
-
The main agent is the controller. It owns:
|
|
27
|
-
|
|
28
|
-
- intent confidence and user questions
|
|
29
|
-
- task decomposition
|
|
30
|
-
- read/write set boundaries
|
|
31
|
-
- dispatch table in `Harness/tasks/<task-id>/PLAN.md#Subagent Dispatch`
|
|
32
|
-
- integration of returned summaries
|
|
33
|
-
- final verification and closeout
|
|
34
|
-
|
|
35
|
-
Subagents provide bounded work. They do not own final scope, architecture, release claims, or user-facing decisions.
|
|
36
|
-
|
|
37
|
-
## Built-in Agent Roster
|
|
38
|
-
|
|
39
|
-
Use the installed roster under `.claude/agents/` before inventing ad hoc roles.
|
|
40
|
-
|
|
41
|
-
| Agent | Default Use |
|
|
42
|
-
| --- | --- |
|
|
43
|
-
| `planner` | decompose goals, map unknowns, define success criteria and write sets |
|
|
44
|
-
| `researcher` | local/external ecosystem context, comparable projects, current facts |
|
|
45
|
-
| `docs-researcher` | official docs, SDK/API behavior, browser/tool constraints |
|
|
46
|
-
| `architect` | boundaries, interface decoupling, state ownership, data flow, migration risk |
|
|
47
|
-
| `test-writer` | failing tests, manual check contracts, browser/API evidence plan |
|
|
48
|
-
| `implementer` | bounded code or doc changes after the second plan |
|
|
49
|
-
| `reviewer` | spec compliance, code quality, maintainability, security, missing tests |
|
|
50
|
-
| `debugger` | reproduced failures, root cause isolation, smallest safe fix |
|
|
51
|
-
| `verifier` | command execution, real browser/API checks, final evidence |
|
|
52
|
-
| `memory-master` | write/consolidate memory entries, dedup, cross-project extraction; dispatched on repeated failures, user corrections, and WF closeout |
|
|
53
|
-
| `context-master` | analyze context usage, recommend compression at ~85% window, extract durable session knowledge during closeout |
|
|
54
|
-
|
|
55
|
-
## WF Default Fan-Out
|
|
56
|
-
|
|
57
|
-
Explicit `/wf`, `wf mode`, `workflow mode`, or `wk mode` requires at least 3 distinct agents from `.claude/agents/` before second planning.
|
|
58
|
-
|
|
59
|
-
Default starter set:
|
|
60
|
-
|
|
61
|
-
- `planner` for decomposition and local map
|
|
62
|
-
- `architect` for boundaries, interfaces, and state impact
|
|
63
|
-
- `researcher` or `docs-researcher` depending whether the unknowns are project/ecosystem facts or official tool/API behavior
|
|
64
|
-
|
|
65
|
-
Then add phase-specific agents:
|
|
66
|
-
|
|
67
|
-
- `test-writer` before implementation
|
|
68
|
-
- `implementer` for the serial write lane
|
|
69
|
-
- `reviewer` for spec and code-quality gates
|
|
70
|
-
- `debugger` after a reproduced verification failure
|
|
71
|
-
- `verifier` for final command/browser/API evidence
|
|
72
|
-
- `context-master` before closeout for knowledge extraction
|
|
73
|
-
- `memory-master` after repeated failures and during closeout for consolidation
|
|
74
|
-
|
|
75
|
-
Collaboration mode is determined by concrete conditions, not a fixed ratio. See `Harness/WF.md#Multi-Subagent Requirement` for the full decision tree. Summary: explicit WF/WK mode → always multi-agent. 3+ files or cross-layer → multi-agent. 1-2 local files, well-understood, not in WF mode → solo acceptable. Repeated failure → stop solo, switch to multi-agent.
|
|
76
|
-
|
|
77
|
-
## Efficiency Ladder
|
|
78
|
-
|
|
79
|
-
Choose the cheapest coordination level that is safe.
|
|
80
|
-
|
|
81
|
-
| Level | Use When | Pattern |
|
|
82
|
-
| --- | --- | --- |
|
|
83
|
-
| Solo pass | one file, low risk, clear intent | no subagent |
|
|
84
|
-
| Single reviewer | small change with meaningful risk | implement, then reviewer |
|
|
85
|
-
| Parallel read-only | broad reading, research, architecture, multiple independent failures | 2-3 read-only agents |
|
|
86
|
-
| Serial build lane | normal feature or fix | test-writer -> implementer -> reviewers -> verifier |
|
|
87
|
-
| Isolated lanes | disjoint write sets or competing approaches | separate worktrees, then review and merge |
|
|
88
|
-
| Max parallelism | 5+ disjoint files, fan-out benefit > coordination cost | /wf max: write-set coloring -> wave dispatch -> parallel review |
|
|
89
|
-
|
|
90
|
-
Default for automatic WF triggers: 3-5 active read-only agents before second planning. For explicit WF/WK mode, never use the solo pass unless subagents are unavailable; use bounded role passes as the recorded fallback.
|
|
91
|
-
|
|
92
|
-
## WF Orchestration Shape
|
|
93
|
-
|
|
94
|
-
```text
|
|
95
|
-
controller intake
|
|
96
|
-
-> parallel planner/researcher/docs-researcher/architect subagents
|
|
97
|
-
-> controller synthesis
|
|
98
|
-
-> second plan with dependencies and write sets
|
|
99
|
-
-> test-writer
|
|
100
|
-
-> implementer
|
|
101
|
-
-> spec reviewer
|
|
102
|
-
-> code/architecture reviewer
|
|
103
|
-
-> verifier
|
|
104
|
-
-> if failed: debugger/fixer -> review -> verify -> loop
|
|
105
|
-
-> close with evidence
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
Use this shape for `/wf`, long tasks, multi-file changes, architecture work, migrations, browser/API behavior, or repeated failures.
|
|
109
|
-
|
|
110
|
-
```text
|
|
111
|
-
/wf max orchestration shape:
|
|
112
|
-
controller intake
|
|
113
|
-
-> wave 0: max-parallel exploration (4-14 read-only agents)
|
|
114
|
-
-> controller synthesis: dependency graph + write-set coloring
|
|
115
|
-
-> wave 1: N parallel implementers (disjoint file claims)
|
|
116
|
-
-> wave 1 review: parallel spec/code/security reviewers
|
|
117
|
-
-> wave 2+: dependent implementers (if any)
|
|
118
|
-
-> integration verifier
|
|
119
|
-
-> closeout with evidence
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
## Dispatch Pack
|
|
123
|
-
|
|
124
|
-
Every subagent dispatch must be self-contained:
|
|
125
|
-
|
|
126
|
-
```text
|
|
127
|
-
Role:
|
|
128
|
-
Goal:
|
|
129
|
-
Mode: read-only | write
|
|
130
|
-
Read set:
|
|
131
|
-
Write set:
|
|
132
|
-
Forbidden scope:
|
|
133
|
-
Injected docs:
|
|
134
|
-
Dependencies:
|
|
135
|
-
Expected evidence:
|
|
136
|
-
Stop condition:
|
|
137
|
-
Return format:
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
Do not make a subagent rediscover the entire project or read the whole harness. Inject only the docs selected by `Harness/README.md` and `Harness/context-loading.md`.
|
|
141
|
-
|
|
142
|
-
## Parallelism Rules
|
|
143
|
-
|
|
144
|
-
- Read-only agents may run in parallel.
|
|
145
|
-
- Writing agents run serially unless write sets are disjoint and the controller has chosen an isolated worktree.
|
|
146
|
-
- Reviewers may run in parallel after implementation, but spec compliance is evaluated before code-quality approval.
|
|
147
|
-
- Subagents are readers and reporters. They return findings and PLAN patch suggestions. Only the controller (main agent) commits state changes to task files.
|
|
148
|
-
- Do not let two agents edit `Harness/tasks/<task-id>/PROGRESS.md`, `Harness/tasks/<task-id>/PLAN.md`, `Harness/MEMORY.md`, or `Harness/memory/*` concurrently. The controller writes durable state.
|
|
149
|
-
- If two agents disagree, the controller records the conflict in `Harness/tasks/<task-id>/PLAN.md` and chooses the smallest reversible next step.
|
|
150
|
-
|
|
151
|
-
## Review Gates
|
|
152
|
-
|
|
153
|
-
Implementation is not complete until both gates pass:
|
|
154
|
-
|
|
155
|
-
1. **Spec review**: confirms the result matches the user request, PRD, feature doc, acceptance criteria, and non-goals. Extra features are failures.
|
|
156
|
-
2. **Code-quality review**: checks correctness, maintainability, architecture, tests, security, and integration risk.
|
|
157
|
-
|
|
158
|
-
If either reviewer finds issues, the implementer or debugger fixes them and the same gate runs again. Do not move to verifier with open critical/high findings.
|
|
159
|
-
|
|
160
|
-
## Subagent Status Handling
|
|
161
|
-
|
|
162
|
-
| Status | Controller Action |
|
|
163
|
-
| --- | --- |
|
|
164
|
-
| `DONE` | start review gates |
|
|
165
|
-
| `DONE_WITH_CONCERNS` | read concerns, decide whether to address before review, record in `Harness/tasks/<task-id>/PROGRESS.md` |
|
|
166
|
-
| `NEEDS_CONTEXT` | provide only missing context and re-dispatch |
|
|
167
|
-
| `BLOCKED` | change something: add context, split task, upgrade reasoning, use debugger, or ask user |
|
|
168
|
-
|
|
169
|
-
Never retry the same failed prompt unchanged.
|
|
170
|
-
|
|
171
|
-
## Failure Recovery
|
|
172
|
-
|
|
173
|
-
- First failed verification: record evidence, dispatch debugger with the smallest reproduced failure.
|
|
174
|
-
- Second same-class failure: narrow scope, update `Harness/tasks/<task-id>/PROGRESS.md#Heartbeat`, and add a reviewer before another fix.
|
|
175
|
-
- Third same-class failure: stop blind fixes. Present evidence-backed options to the user.
|
|
176
|
-
|
|
177
|
-
The recovery loop must preserve the same evidence standard as the main workflow: real commands, real browser/API checks when applicable, and recorded logs or artifacts.
|
|
178
|
-
|
|
179
|
-
## Synthesis Output
|
|
180
|
-
|
|
181
|
-
After subagents return, the controller writes one synthesis into `Harness/tasks/<task-id>/PLAN.md`:
|
|
182
|
-
|
|
183
|
-
```text
|
|
184
|
-
Agents used:
|
|
185
|
-
Findings accepted:
|
|
186
|
-
Findings rejected:
|
|
187
|
-
Conflicts:
|
|
188
|
-
Decisions:
|
|
189
|
-
Next write set:
|
|
190
|
-
Verification path:
|
|
191
|
-
Residual risk:
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
Only the synthesis and named files enter main context. Do not replay full subagent conversations.
|
|
1
|
+
# Subagent Orchestration
|
|
2
|
+
|
|
3
|
+
Purpose: coordinate subagents for speed without losing control of scope, evidence, or integration.
|
|
4
|
+
|
|
5
|
+
Use this file when work needs multiple roles, parallel reading, independent review, broad context, repeated failures, or `/wf`.
|
|
6
|
+
|
|
7
|
+
project files are the only durable communication channel; chat/subagent transcript state is non-authoritative. Important assumptions, decisions, blockers, evidence, and handoffs must be written to `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md`, the current feature doc, `Harness/MEMORY.md`, or `Harness/memory/*` as appropriate.
|
|
8
|
+
|
|
9
|
+
## Source Attribution
|
|
10
|
+
|
|
11
|
+
This harness distills ideas from these sources. Keep the protocol local and conservative; do not import external runtimes by default.
|
|
12
|
+
|
|
13
|
+
| Source | Found By | Adopted Idea |
|
|
14
|
+
| --- | --- | --- |
|
|
15
|
+
| `superpowers:dispatching-parallel-agents` | local skill | Dispatch one agent per independent problem domain; give focused scope and exact context. |
|
|
16
|
+
| `superpowers:subagent-driven-development` | local skill | Fresh implementer per task; spec review before code-quality review; handle `DONE`, `DONE_WITH_CONCERNS`, `NEEDS_CONTEXT`, and `BLOCKED`. |
|
|
17
|
+
| [`flc1125/skills@subagent-orchestrator`](https://skills.sh/flc1125/skills/subagent-orchestrator) | `npx skills find "subagent orchestration"` | Explicit subagent invocation, role-specific prompts, tool permission awareness. |
|
|
18
|
+
| [`davila7/claude-code-templates@parallel-agents`](https://skills.sh/davila7/claude-code-templates/parallel-agents) | `npx skills find "parallel agents"` | Discovery -> domain agents -> synthesis; one unified synthesis instead of scattered reports. |
|
|
19
|
+
| [`ruvnet/ruflo@agent-workflow`](https://skills.sh/ruvnet/ruflo/agent-workflow) | `npx skills find "agent workflow"` | Workflow thinking: triggers, agent assignments, parallel processing, and stateful handoffs. |
|
|
20
|
+
| [`pcvelz/superpowers@subagent-driven-development`](https://skills.sh/pcvelz/superpowers/subagent-driven-development) | `npx skills find "subagent driven development"` | Implementer plus review gates for spec compliance and code quality. |
|
|
21
|
+
| [`oimiragieo/agent-studio`](https://skills.sh/oimiragieo/agent-studio/dispatching-parallel-agents) | Skills CLI / public docs | Router-subordinate architecture and durable handoff discipline. |
|
|
22
|
+
| [`subagent-orchestration-skill`](https://skills.rest/rjtaryn/skills/subagent-orchestration-skill) | public docs | Multi-stage executor, spec reviewer, code reviewer, circuit breaker, and escalation pattern. |
|
|
23
|
+
|
|
24
|
+
## Controller Role
|
|
25
|
+
|
|
26
|
+
The main agent is the controller. It owns:
|
|
27
|
+
|
|
28
|
+
- intent confidence and user questions
|
|
29
|
+
- task decomposition
|
|
30
|
+
- read/write set boundaries
|
|
31
|
+
- dispatch table in `Harness/tasks/<task-id>/PLAN.md#Subagent Dispatch`
|
|
32
|
+
- integration of returned summaries
|
|
33
|
+
- final verification and closeout
|
|
34
|
+
|
|
35
|
+
Subagents provide bounded work. They do not own final scope, architecture, release claims, or user-facing decisions.
|
|
36
|
+
|
|
37
|
+
## Built-in Agent Roster
|
|
38
|
+
|
|
39
|
+
Use the installed roster under `.claude/agents/` before inventing ad hoc roles.
|
|
40
|
+
|
|
41
|
+
| Agent | Default Use |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| `planner` | decompose goals, map unknowns, define success criteria and write sets |
|
|
44
|
+
| `researcher` | local/external ecosystem context, comparable projects, current facts |
|
|
45
|
+
| `docs-researcher` | official docs, SDK/API behavior, browser/tool constraints |
|
|
46
|
+
| `architect` | boundaries, interface decoupling, state ownership, data flow, migration risk |
|
|
47
|
+
| `test-writer` | failing tests, manual check contracts, browser/API evidence plan |
|
|
48
|
+
| `implementer` | bounded code or doc changes after the second plan |
|
|
49
|
+
| `reviewer` | spec compliance, code quality, maintainability, security, missing tests |
|
|
50
|
+
| `debugger` | reproduced failures, root cause isolation, smallest safe fix |
|
|
51
|
+
| `verifier` | command execution, real browser/API checks, final evidence |
|
|
52
|
+
| `memory-master` | write/consolidate memory entries, dedup, cross-project extraction; dispatched on repeated failures, user corrections, and WF closeout |
|
|
53
|
+
| `context-master` | analyze context usage, recommend compression at ~85% window, extract durable session knowledge during closeout |
|
|
54
|
+
|
|
55
|
+
## WF Default Fan-Out
|
|
56
|
+
|
|
57
|
+
Explicit `/wf`, `wf mode`, `workflow mode`, or `wk mode` requires at least 3 distinct agents from `.claude/agents/` before second planning.
|
|
58
|
+
|
|
59
|
+
Default starter set:
|
|
60
|
+
|
|
61
|
+
- `planner` for decomposition and local map
|
|
62
|
+
- `architect` for boundaries, interfaces, and state impact
|
|
63
|
+
- `researcher` or `docs-researcher` depending whether the unknowns are project/ecosystem facts or official tool/API behavior
|
|
64
|
+
|
|
65
|
+
Then add phase-specific agents:
|
|
66
|
+
|
|
67
|
+
- `test-writer` before implementation
|
|
68
|
+
- `implementer` for the serial write lane
|
|
69
|
+
- `reviewer` for spec and code-quality gates
|
|
70
|
+
- `debugger` after a reproduced verification failure
|
|
71
|
+
- `verifier` for final command/browser/API evidence
|
|
72
|
+
- `context-master` before closeout for knowledge extraction
|
|
73
|
+
- `memory-master` after repeated failures and during closeout for consolidation
|
|
74
|
+
|
|
75
|
+
Collaboration mode is determined by concrete conditions, not a fixed ratio. See `Harness/WF.md#Multi-Subagent Requirement` for the full decision tree. Summary: explicit WF/WK mode → always multi-agent. 3+ files or cross-layer → multi-agent. 1-2 local files, well-understood, not in WF mode → solo acceptable. Repeated failure → stop solo, switch to multi-agent.
|
|
76
|
+
|
|
77
|
+
## Efficiency Ladder
|
|
78
|
+
|
|
79
|
+
Choose the cheapest coordination level that is safe.
|
|
80
|
+
|
|
81
|
+
| Level | Use When | Pattern |
|
|
82
|
+
| --- | --- | --- |
|
|
83
|
+
| Solo pass | one file, low risk, clear intent | no subagent |
|
|
84
|
+
| Single reviewer | small change with meaningful risk | implement, then reviewer |
|
|
85
|
+
| Parallel read-only | broad reading, research, architecture, multiple independent failures | 2-3 read-only agents |
|
|
86
|
+
| Serial build lane | normal feature or fix | test-writer -> implementer -> reviewers -> verifier |
|
|
87
|
+
| Isolated lanes | disjoint write sets or competing approaches | separate worktrees, then review and merge |
|
|
88
|
+
| Max parallelism | 5+ disjoint files, fan-out benefit > coordination cost | /wf max: write-set coloring -> wave dispatch -> parallel review |
|
|
89
|
+
|
|
90
|
+
Default for automatic WF triggers: 3-5 active read-only agents before second planning. For explicit WF/WK mode, never use the solo pass unless subagents are unavailable; use bounded role passes as the recorded fallback.
|
|
91
|
+
|
|
92
|
+
## WF Orchestration Shape
|
|
93
|
+
|
|
94
|
+
```text
|
|
95
|
+
controller intake
|
|
96
|
+
-> parallel planner/researcher/docs-researcher/architect subagents
|
|
97
|
+
-> controller synthesis
|
|
98
|
+
-> second plan with dependencies and write sets
|
|
99
|
+
-> test-writer
|
|
100
|
+
-> implementer
|
|
101
|
+
-> spec reviewer
|
|
102
|
+
-> code/architecture reviewer
|
|
103
|
+
-> verifier
|
|
104
|
+
-> if failed: debugger/fixer -> review -> verify -> loop
|
|
105
|
+
-> close with evidence
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Use this shape for `/wf`, long tasks, multi-file changes, architecture work, migrations, browser/API behavior, or repeated failures.
|
|
109
|
+
|
|
110
|
+
```text
|
|
111
|
+
/wf max orchestration shape:
|
|
112
|
+
controller intake
|
|
113
|
+
-> wave 0: max-parallel exploration (4-14 read-only agents)
|
|
114
|
+
-> controller synthesis: dependency graph + write-set coloring
|
|
115
|
+
-> wave 1: N parallel implementers (disjoint file claims)
|
|
116
|
+
-> wave 1 review: parallel spec/code/security reviewers
|
|
117
|
+
-> wave 2+: dependent implementers (if any)
|
|
118
|
+
-> integration verifier
|
|
119
|
+
-> closeout with evidence
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Dispatch Pack
|
|
123
|
+
|
|
124
|
+
Every subagent dispatch must be self-contained:
|
|
125
|
+
|
|
126
|
+
```text
|
|
127
|
+
Role:
|
|
128
|
+
Goal:
|
|
129
|
+
Mode: read-only | write
|
|
130
|
+
Read set:
|
|
131
|
+
Write set:
|
|
132
|
+
Forbidden scope:
|
|
133
|
+
Injected docs:
|
|
134
|
+
Dependencies:
|
|
135
|
+
Expected evidence:
|
|
136
|
+
Stop condition:
|
|
137
|
+
Return format:
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Do not make a subagent rediscover the entire project or read the whole harness. Inject only the docs selected by `Harness/README.md` and `Harness/context-loading.md`.
|
|
141
|
+
|
|
142
|
+
## Parallelism Rules
|
|
143
|
+
|
|
144
|
+
- Read-only agents may run in parallel.
|
|
145
|
+
- Writing agents run serially unless write sets are disjoint and the controller has chosen an isolated worktree.
|
|
146
|
+
- Reviewers may run in parallel after implementation, but spec compliance is evaluated before code-quality approval.
|
|
147
|
+
- Subagents are readers and reporters. They return findings and PLAN patch suggestions. Only the controller (main agent) commits state changes to task files.
|
|
148
|
+
- Do not let two agents edit `Harness/tasks/<task-id>/PROGRESS.md`, `Harness/tasks/<task-id>/PLAN.md`, `Harness/MEMORY.md`, or `Harness/memory/*` concurrently. The controller writes durable state.
|
|
149
|
+
- If two agents disagree, the controller records the conflict in `Harness/tasks/<task-id>/PLAN.md` and chooses the smallest reversible next step.
|
|
150
|
+
|
|
151
|
+
## Review Gates
|
|
152
|
+
|
|
153
|
+
Implementation is not complete until both gates pass:
|
|
154
|
+
|
|
155
|
+
1. **Spec review**: confirms the result matches the user request, PRD, feature doc, acceptance criteria, and non-goals. Extra features are failures.
|
|
156
|
+
2. **Code-quality review**: checks correctness, maintainability, architecture, tests, security, and integration risk.
|
|
157
|
+
|
|
158
|
+
If either reviewer finds issues, the implementer or debugger fixes them and the same gate runs again. Do not move to verifier with open critical/high findings.
|
|
159
|
+
|
|
160
|
+
## Subagent Status Handling
|
|
161
|
+
|
|
162
|
+
| Status | Controller Action |
|
|
163
|
+
| --- | --- |
|
|
164
|
+
| `DONE` | start review gates |
|
|
165
|
+
| `DONE_WITH_CONCERNS` | read concerns, decide whether to address before review, record in `Harness/tasks/<task-id>/PROGRESS.md` |
|
|
166
|
+
| `NEEDS_CONTEXT` | provide only missing context and re-dispatch |
|
|
167
|
+
| `BLOCKED` | change something: add context, split task, upgrade reasoning, use debugger, or ask user |
|
|
168
|
+
|
|
169
|
+
Never retry the same failed prompt unchanged.
|
|
170
|
+
|
|
171
|
+
## Failure Recovery
|
|
172
|
+
|
|
173
|
+
- First failed verification: record evidence, dispatch debugger with the smallest reproduced failure.
|
|
174
|
+
- Second same-class failure: narrow scope, update `Harness/tasks/<task-id>/PROGRESS.md#Heartbeat`, and add a reviewer before another fix.
|
|
175
|
+
- Third same-class failure: stop blind fixes. Present evidence-backed options to the user.
|
|
176
|
+
|
|
177
|
+
The recovery loop must preserve the same evidence standard as the main workflow: real commands, real browser/API checks when applicable, and recorded logs or artifacts.
|
|
178
|
+
|
|
179
|
+
## Synthesis Output
|
|
180
|
+
|
|
181
|
+
After subagents return, the controller writes one synthesis into `Harness/tasks/<task-id>/PLAN.md`:
|
|
182
|
+
|
|
183
|
+
```text
|
|
184
|
+
Agents used:
|
|
185
|
+
Findings accepted:
|
|
186
|
+
Findings rejected:
|
|
187
|
+
Conflicts:
|
|
188
|
+
Decisions:
|
|
189
|
+
Next write set:
|
|
190
|
+
Verification path:
|
|
191
|
+
Residual risk:
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Only the synthesis and named files enter main context. Do not replay full subagent conversations.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
# {{TASK_ID}} — Artifacts
|
|
2
|
-
|
|
3
|
-
Optional: screenshots, logs, API responses, links. Create only when evidence is too large for this task's PLAN.md verification table.
|
|
1
|
+
# {{TASK_ID}} — Artifacts
|
|
2
|
+
|
|
3
|
+
Optional: screenshots, logs, API responses, links. Create only when evidence is too large for this task's PLAN.md verification table.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
# {{TASK_ID}} — Notes
|
|
2
|
-
|
|
3
|
-
Optional: exploration notes, design alternatives, research leads. Create only when notes are too long for this task's PLAN.md.
|
|
1
|
+
# {{TASK_ID}} — Notes
|
|
2
|
+
|
|
3
|
+
Optional: exploration notes, design alternatives, research leads. Create only when notes are too long for this task's PLAN.md.
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
# {{TASK_ID}} — PLAN
|
|
2
|
-
|
|
3
|
-
Task-level implementation plan and evidence. Main agent writes after second planning; implementer reads before coding.
|
|
4
|
-
|
|
5
|
-
## Goal
|
|
6
|
-
|
|
7
|
-
## Acceptance Criteria
|
|
8
|
-
|
|
9
|
-
- [ ]
|
|
10
|
-
|
|
11
|
-
## Scope
|
|
12
|
-
|
|
13
|
-
Allowed write set:
|
|
14
|
-
-
|
|
15
|
-
|
|
16
|
-
Forbidden:
|
|
17
|
-
-
|
|
18
|
-
|
|
19
|
-
## Loaded Context
|
|
20
|
-
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
## Subagent Dispatch
|
|
24
|
-
|
|
25
|
-
| Agent | Mode | Read Set | Write Set | Status |
|
|
26
|
-
|-------|------|----------|-----------|--------|
|
|
27
|
-
|
|
28
|
-
## Subagent Synthesis
|
|
29
|
-
|
|
30
|
-
Agents used:
|
|
31
|
-
Findings accepted:
|
|
32
|
-
Findings rejected:
|
|
33
|
-
Conflicts:
|
|
34
|
-
Decisions:
|
|
35
|
-
Residual risk:
|
|
36
|
-
|
|
37
|
-
## Verification
|
|
38
|
-
|
|
39
|
-
| Check | Result | Notes |
|
|
40
|
-
|-------|--------|-------|
|
|
1
|
+
# {{TASK_ID}} — PLAN
|
|
2
|
+
|
|
3
|
+
Task-level implementation plan and evidence. Main agent writes after second planning; implementer reads before coding.
|
|
4
|
+
|
|
5
|
+
## Goal
|
|
6
|
+
|
|
7
|
+
## Acceptance Criteria
|
|
8
|
+
|
|
9
|
+
- [ ]
|
|
10
|
+
|
|
11
|
+
## Scope
|
|
12
|
+
|
|
13
|
+
Allowed write set:
|
|
14
|
+
-
|
|
15
|
+
|
|
16
|
+
Forbidden:
|
|
17
|
+
-
|
|
18
|
+
|
|
19
|
+
## Loaded Context
|
|
20
|
+
|
|
21
|
+
-
|
|
22
|
+
|
|
23
|
+
## Subagent Dispatch
|
|
24
|
+
|
|
25
|
+
| Agent | Mode | Read Set | Write Set | Status |
|
|
26
|
+
|-------|------|----------|-----------|--------|
|
|
27
|
+
|
|
28
|
+
## Subagent Synthesis
|
|
29
|
+
|
|
30
|
+
Agents used:
|
|
31
|
+
Findings accepted:
|
|
32
|
+
Findings rejected:
|
|
33
|
+
Conflicts:
|
|
34
|
+
Decisions:
|
|
35
|
+
Residual risk:
|
|
36
|
+
|
|
37
|
+
## Verification
|
|
38
|
+
|
|
39
|
+
| Check | Result | Notes |
|
|
40
|
+
|-------|--------|-------|
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
# {{TASK_ID}} — PROGRESS
|
|
2
|
-
|
|
3
|
-
Task-level progress and heartbeat. Main agent updates; subagents read only.
|
|
4
|
-
|
|
5
|
-
## Current Goal
|
|
6
|
-
|
|
7
|
-
## Phase
|
|
8
|
-
|
|
9
|
-
Current: Intake
|
|
10
|
-
|
|
11
|
-
## Heartbeat
|
|
12
|
-
|
|
13
|
-
Last beat:
|
|
14
|
-
Current phase: Intake
|
|
15
|
-
Current blocker: none
|
|
16
|
-
Next beat trigger:
|
|
17
|
-
Failure count: 0
|
|
18
|
-
Recovery action: none
|
|
19
|
-
|
|
20
|
-
## Tasks
|
|
21
|
-
|
|
22
|
-
| # | Task | Owner | Verify | Status |
|
|
23
|
-
|---|------|-------|--------|--------|
|
|
24
|
-
| 1 | Define goal and scope | main agent | recorded above | Pending |
|
|
25
|
-
|
|
26
|
-
## Agent Handoffs
|
|
27
|
-
|
|
28
|
-
| Agent | Role | Context Pack | Result |
|
|
29
|
-
|-------|------|-------------|--------|
|
|
1
|
+
# {{TASK_ID}} — PROGRESS
|
|
2
|
+
|
|
3
|
+
Task-level progress and heartbeat. Main agent updates; subagents read only.
|
|
4
|
+
|
|
5
|
+
## Current Goal
|
|
6
|
+
|
|
7
|
+
## Phase
|
|
8
|
+
|
|
9
|
+
Current: Intake
|
|
10
|
+
|
|
11
|
+
## Heartbeat
|
|
12
|
+
|
|
13
|
+
Last beat:
|
|
14
|
+
Current phase: Intake
|
|
15
|
+
Current blocker: none
|
|
16
|
+
Next beat trigger:
|
|
17
|
+
Failure count: 0
|
|
18
|
+
Recovery action: none
|
|
19
|
+
|
|
20
|
+
## Tasks
|
|
21
|
+
|
|
22
|
+
| # | Task | Owner | Verify | Status |
|
|
23
|
+
|---|------|-------|--------|--------|
|
|
24
|
+
| 1 | Define goal and scope | main agent | recorded above | Pending |
|
|
25
|
+
|
|
26
|
+
## Agent Handoffs
|
|
27
|
+
|
|
28
|
+
| Agent | Role | Context Pack | Result |
|
|
29
|
+
|-------|------|-------------|--------|
|