create-harness-vibe-coding 0.8.6 → 0.8.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/README-CN.md +157 -105
  2. package/README.md +160 -244
  3. package/bin/create-harness-vibe-coding.js +2 -2
  4. package/docs/images/harness-architecture-light.png +0 -0
  5. package/docs/images/harness-architecture.drawio +164 -0
  6. package/package.json +46 -44
  7. package/src/generator.js +30 -11
  8. package/src/index.js +143 -14
  9. package/src/prompts.js +37 -37
  10. package/templates/common/.claude/agents/architect-manager.md +45 -45
  11. package/templates/common/.claude/agents/context-master.md +75 -75
  12. package/templates/common/.claude/agents/debugger.md +41 -41
  13. package/templates/common/.claude/agents/explore-manager.md +41 -41
  14. package/templates/common/.claude/agents/implement-manager.md +49 -49
  15. package/templates/common/.claude/agents/implementer.md +40 -40
  16. package/templates/common/.claude/agents/memory-master.md +64 -64
  17. package/templates/common/.claude/agents/planner.md +34 -34
  18. package/templates/common/.claude/agents/reflector.md +35 -0
  19. package/templates/common/.claude/agents/researcher.md +41 -41
  20. package/templates/common/.claude/agents/review-manager.md +56 -56
  21. package/templates/common/.claude/agents/verifier.md +34 -32
  22. package/templates/common/.claude/commands/wf-help.md +2 -3
  23. package/templates/common/.claude/rules/ecc/common.md +44 -44
  24. package/templates/common/.claude/skills/subagent-orchestrator/SKILL.md +10 -4
  25. package/templates/common/.claude/skills/wf/SKILL.md +7 -3
  26. package/templates/common/.claude/skills/wf-auto/SKILL.md +61 -107
  27. package/templates/common/.claude/skills/wf-auto-spark/SKILL.md +19 -17
  28. package/templates/common/.claude/skills/wf-max/SKILL.md +40 -21
  29. package/templates/common/.claude/skills/wf-readme/SKILL.md +49 -49
  30. package/templates/common/.claude/skills/wf-remove/SKILL.md +7 -7
  31. package/templates/common/.claude/skills/wf-update/SKILL.md +9 -4
  32. package/templates/common/.codex/config.toml +5 -0
  33. package/templates/common/.harness-version +78 -36
  34. package/templates/common/.opencode/agents/architect-manager.md +52 -0
  35. package/templates/common/.opencode/agents/architect.md +35 -0
  36. package/templates/common/.opencode/agents/context-master.md +81 -0
  37. package/templates/common/.opencode/agents/debugger.md +43 -0
  38. package/templates/common/.opencode/agents/docs-researcher.md +42 -0
  39. package/templates/common/.opencode/agents/explore-manager.md +49 -0
  40. package/templates/common/.opencode/agents/implement-manager.md +56 -0
  41. package/templates/common/.opencode/agents/implementer.md +42 -0
  42. package/templates/common/.opencode/agents/memory-master.md +70 -0
  43. package/templates/common/.opencode/agents/planner.md +38 -0
  44. package/templates/common/.opencode/agents/reflector.md +39 -0
  45. package/templates/common/.opencode/agents/researcher.md +42 -0
  46. package/templates/common/.opencode/agents/review-manager.md +63 -0
  47. package/templates/common/.opencode/agents/reviewer.md +37 -0
  48. package/templates/common/.opencode/agents/tdd-guide.md +83 -0
  49. package/templates/common/.opencode/agents/test-writer.md +54 -0
  50. package/templates/common/.opencode/agents/verifier.md +37 -0
  51. package/templates/common/.opencode/commands/wf-help.md +23 -0
  52. package/templates/common/AGENTS.md +26 -25
  53. package/templates/common/CLAUDE.md +86 -88
  54. package/templates/common/Harness/ACCEPTANCE_PROTOCOL.md +12 -4
  55. package/templates/common/Harness/PROGRESS.md +17 -17
  56. package/templates/common/Harness/README.md +26 -16
  57. package/templates/common/Harness/WF-AUTO-ANGLES.md +170 -0
  58. package/templates/common/Harness/WF-AUTO-SPARK.md +23 -6
  59. package/templates/common/Harness/WF-AUTO.md +508 -493
  60. package/templates/common/Harness/WF-MAX.md +284 -232
  61. package/templates/common/Harness/WF.md +47 -29
  62. package/templates/common/Harness/agent-workflow.md +108 -76
  63. package/templates/common/Harness/architecture.md +124 -124
  64. package/templates/common/Harness/context-loading.md +111 -111
  65. package/templates/common/Harness/dispatch.md +96 -95
  66. package/templates/common/Harness/extension.md +67 -67
  67. package/templates/common/Harness/lifecycle.md +20 -20
  68. package/templates/common/Harness/research/PRD.md +56 -56
  69. package/templates/common/Harness/research/README.md +169 -169
  70. package/templates/common/Harness/research/research-results.md +66 -66
  71. package/templates/common/Harness/subagents.md +192 -170
  72. package/templates/common/Harness/tasks/_template/ARTIFACTS.md +3 -3
  73. package/templates/common/Harness/tasks/_template/NOTES.md +3 -3
  74. package/templates/common/Harness/tasks/_template/PLAN.md +53 -60
  75. package/templates/common/Harness/tasks/_template/PROGRESS.md +26 -29
  76. package/templates/common/MEMORY.md +27 -30
  77. package/templates/common/README.md +36 -36
  78. package/templates/common/SETUP.md +1 -1
  79. package/templates/common/memory/agent-lessons-patterns.md +21 -21
  80. package/templates/common/memory/tool-usage-reflections.md +21 -21
  81. package/templates/common/memory/user-corrections-preferences.md +21 -21
  82. package/templates/common/opencode.json +19 -0
  83. package/templates/common/scripts/scan-clean.mjs +487 -448
  84. package/templates/common/scripts/validate-harness.mjs +245 -146
  85. package/templates/common/scripts/wf-remove.mjs +311 -293
  86. package/templates/common/scripts/wf-update-check.mjs +511 -311
  87. package/templates/optional/catalog.json +41 -33
  88. package/templates/optional/skills/browser-e2e/.claude/skills/wf-browser/SKILL.md +194 -194
  89. package/templates/optional/skills/browser-e2e/Harness/workflows/browser-e2e.md +105 -69
  90. package/templates/optional/skills/github-pr-review/Harness/workflows/github-pr-review.md +28 -28
  91. package/templates/optional/skills/python-backend/Harness/workflows/python-backend.md +34 -34
  92. package/templates/optional/skills/ts-react-frontend/Harness/workflows/ts-react-frontend.md +34 -34
  93. package/templates/optional/skills/ui-ux-review/Harness/workflows/ui-ux-review.md +26 -26
@@ -1,59 +1,60 @@
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
-
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
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
8
 
9
9
  Subagent work is acceptance-driven. Use [AGENT_ISOLATION.md](AGENT_ISOLATION.md)
10
10
  for role/context isolation and [ACCEPTANCE_PROTOCOL.md](ACCEPTANCE_PROTOCOL.md)
11
11
  for PRD-GATE, AC-GATE, CONTRACT-GATE, TEST-GATE, VALIDATION-GATE, and
12
12
  REVIEW-GATE.
13
-
14
- ## Source Attribution
15
-
16
- This harness distills ideas from these sources. Keep the protocol local and conservative; do not import external runtimes by default.
17
-
18
- | Source | Found By | Adopted Idea |
19
- | --- | --- | --- |
20
- | `superpowers:dispatching-parallel-agents` | local skill | Dispatch one agent per independent problem domain; give focused scope and exact context. |
21
- | `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`. |
22
- | [`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. |
23
- | [`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. |
24
- | [`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. |
25
- | [`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. |
26
- | [`oimiragieo/agent-studio`](https://skills.sh/oimiragieo/agent-studio/dispatching-parallel-agents) | Skills CLI / public docs | Router-subordinate architecture and durable handoff discipline. |
27
- | [`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. |
28
-
29
- ## Controller Role
30
-
31
- The main agent is the controller. It owns:
32
-
33
- - intent confidence and user questions
34
- - task decomposition
35
- - read/write set boundaries
36
- - dispatch table in `Harness/tasks/<task-id>/PLAN.md#Subagent Dispatch`
37
- - integration of returned summaries
38
- - final verification and closeout
39
-
40
- Subagents provide bounded work. They do not own final scope, architecture, release claims, or user-facing decisions.
41
-
42
- ## Built-in Agent Roster
43
-
44
- Use the installed roster under `.claude/agents/` before inventing ad hoc roles.
45
-
46
- | Agent | Default Use |
47
- | --- | --- |
48
- | `planner` | decompose goals, map unknowns, define success criteria and write sets |
49
- | `researcher` | local/external ecosystem context, comparable projects, current facts |
50
- | `docs-researcher` | official docs, SDK/API behavior, browser/tool constraints |
51
- | `architect` | boundaries, interface decoupling, state ownership, data flow, migration risk |
52
- | `test-writer` | failing tests, manual check contracts, browser/API evidence plan |
53
- | `implementer` | bounded code or doc changes after the second plan |
54
- | `reviewer` | spec compliance, code quality, maintainability, security, missing tests |
55
- | `debugger` | reproduced failures, root cause isolation, smallest safe fix |
56
- | `verifier` | command execution, real browser/API checks, final evidence |
13
+
14
+ ## Source Attribution
15
+
16
+ This harness distills ideas from these sources. Keep the protocol local and conservative; do not import external runtimes by default.
17
+
18
+ | Source | Found By | Adopted Idea |
19
+ | --- | --- | --- |
20
+ | `superpowers:dispatching-parallel-agents` | local skill | Dispatch one agent per independent problem domain; give focused scope and exact context. |
21
+ | `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`. |
22
+ | [`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. |
23
+ | [`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. |
24
+ | [`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. |
25
+ | [`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. |
26
+ | [`oimiragieo/agent-studio`](https://skills.sh/oimiragieo/agent-studio/dispatching-parallel-agents) | Skills CLI / public docs | Router-subordinate architecture and durable handoff discipline. |
27
+ | [`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. |
28
+
29
+ ## Controller Role
30
+
31
+ The main agent is the controller. It owns:
32
+
33
+ - intent confidence and user questions
34
+ - task decomposition
35
+ - read/write set boundaries
36
+ - dispatch table in `Harness/tasks/<task-id>/PLAN.md#Subagent Dispatch`
37
+ - integration of returned summaries
38
+ - final verification and closeout
39
+
40
+ Subagents provide bounded work. They do not own final scope, architecture, release claims, or user-facing decisions.
41
+
42
+ ## Built-in Agent Roster
43
+
44
+ Use the installed roster under `.claude/agents/` before inventing ad hoc roles.
45
+
46
+ | Agent | Default Use |
47
+ | --- | --- |
48
+ | `planner` | decompose goals, map unknowns, define success criteria and write sets |
49
+ | `researcher` | local/external ecosystem context, comparable projects, current facts |
50
+ | `docs-researcher` | official docs, SDK/API behavior, browser/tool constraints |
51
+ | `architect` | boundaries, interface decoupling, state ownership, data flow, migration risk |
52
+ | `test-writer` | failing tests, manual check contracts, browser/API evidence plan |
53
+ | `implementer` | bounded code or doc changes after the second plan |
54
+ | `reviewer` | spec compliance, code quality, maintainability, security, missing tests |
55
+ | `debugger` | reproduced failures, root cause isolation, smallest safe fix |
56
+ | `verifier` | command execution, real browser/API checks, final evidence |
57
+ | `reflector` | closeout synthesis, unresolved-risk check, acceptance gate verdict |
57
58
  | `memory-master` | write/consolidate memory entries, dedup, cross-project extraction; dispatched on repeated failures, user corrections, and WF closeout |
58
59
  | `context-master` | analyze context usage, recommend compression at ~85% window, extract durable session knowledge during closeout |
59
60
 
@@ -71,137 +72,158 @@ agent file exists.
71
72
  | Test Architect | `test-writer` | AC, contracts, test utilities | tests or test plan only |
72
73
  | Implementer | `implementer` | PRD, AC, contracts, tests, relevant code | assigned implementation write set only |
73
74
  | Independent Validator | `verifier` | PRD, AC, contracts, running app/API, commands | validation report/evidence only |
75
+ | Cross Review | `reviewer` | PRD, AC, contracts, diff, tests, validation evidence | spec/AC and code/architecture/test findings only |
76
+ | Reflector | `reflector` | validation evidence, reviewer findings, risks, decisions | final PASS/RETURN_TO_DEBUG/BLOCKED verdict only |
74
77
  | Debugger | `debugger` | failed AC, logs, trace, screenshot, diff | smallest assigned fix set |
75
78
 
76
79
  Hard rule: implementer may not be the independent validator for the same AC ID.
77
-
78
- ## WF Default Fan-Out
79
-
80
- Explicit `/wf`, `wf mode`, `workflow mode`, or `wk mode` requires at least 3 distinct agents from `.claude/agents/` before second planning.
81
-
82
- Default starter set:
83
-
84
- - `planner` for decomposition and local map
85
- - `architect` for boundaries, interfaces, and state impact
86
- - `researcher` or `docs-researcher` depending whether the unknowns are project/ecosystem facts or official tool/API behavior
87
-
88
- Then add phase-specific agents:
89
-
90
- - `test-writer` before implementation
91
- - `implementer` for the serial write lane
92
- - `reviewer` for spec and code-quality gates
93
- - `debugger` after a reproduced verification failure
94
- - `verifier` for final command/browser/API evidence
95
- - `context-master` before closeout for knowledge extraction
96
- - `memory-master` after repeated failures and during closeout for consolidation
97
-
98
- 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.
99
-
100
- ## Efficiency Ladder
101
-
102
- Choose the cheapest coordination level that is safe.
103
-
104
- | Level | Use When | Pattern |
105
- | --- | --- | --- |
106
- | Solo pass | one file, low risk, clear intent | no subagent |
107
- | Single reviewer | small change with meaningful risk | implement, then reviewer |
108
- | Parallel read-only | broad reading, research, architecture, multiple independent failures | 2-3 read-only agents |
109
- | Serial build lane | normal feature or fix | acceptance/contract -> test-writer -> implementer -> independent validator -> reviewers |
110
- | Isolated lanes | disjoint write sets or competing approaches | separate worktrees, then review and merge |
111
- | Max parallelism | 5+ disjoint files, fan-out benefit > coordination cost | /wf max: write-set coloring -> wave dispatch -> parallel review |
112
-
113
- 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.
114
-
115
- ## WF Orchestration Shape
116
-
117
- ```text
118
- controller intake
119
- -> parallel planner/researcher/docs-researcher/architect subagents
120
- -> controller synthesis
121
- -> second plan with dependencies and write sets
80
+
81
+ ## WF Default Fan-Out
82
+
83
+ Explicit `/wf`, `wf mode`, `workflow mode`, or `wk mode` requires complete
84
+ role-chain coverage from `.claude/agents/` before closeout: plan,
85
+ research/docs research as needed, architecture, test, implement, independent
86
+ validation, cross-review, reflector, and accept.
87
+
88
+ Default starter set:
89
+
90
+ - `planner` for decomposition and local map
91
+ - `architect` for boundaries, interfaces, and state impact
92
+ - `researcher` or `docs-researcher` depending whether the unknowns are project/ecosystem facts or official tool/API behavior
93
+
94
+ Then add phase-specific agents:
95
+
96
+ - `test-writer` before implementation
97
+ - `implementer` for the serial write lane
98
+ - `reviewer` for independent spec/AC and code/architecture/test gates
99
+ - `debugger` after a reproduced verification failure
100
+ - `verifier` for command/browser/API evidence and AC matrix
101
+ - `reflector` after cross-review to decide whether final acceptance may proceed
102
+ - `context-master` before closeout for knowledge extraction
103
+ - `memory-master` after repeated failures and during closeout for consolidation
104
+
105
+ Collaboration mode is determined by concrete conditions, not a fixed ratio. See `Harness/WF.md#Complete Role Chain Requirement` for the full decision tree. Summary: explicit WF/WK mode always uses the complete role chain. 3+ files or cross-layer work uses multi-agent orchestration. 1-2 local files, well-understood, not in WF mode can be solo. Repeated failure stops solo work and switches to multi-agent.
106
+
107
+ ## Efficiency Ladder
108
+
109
+ Choose the cheapest coordination level that is safe.
110
+
111
+ | Level | Use When | Pattern |
112
+ | --- | --- | --- |
113
+ | Solo pass | one file, low risk, clear intent | no subagent |
114
+ | Single reviewer | small change with meaningful risk | implement, then reviewer |
115
+ | Parallel read-only | broad reading, research, architecture, multiple independent failures | 2-3 read-only agents |
116
+ | Serial build lane | normal feature or fix | acceptance/contract -> test-writer -> implementer -> verifier evidence -> cross-review -> reflector -> acceptance |
117
+ | Isolated lanes | disjoint write sets or competing approaches | separate worktrees, then review and merge |
118
+ | Max parallelism | 5+ disjoint files, fan-out benefit > coordination cost | /wf max: write-set coloring -> wave dispatch -> parallel review |
119
+
120
+ Max parallelism removes the Harness default cap, not the runtime's physical or
121
+ account cap. For WF-MAX, record the current runtime budget, use native
122
+ subagents first, close completed agents before declaring the pool exhausted,
123
+ then overflow to the other CLI (`claude -p` or `codex exec`) with explicit
124
+ dispatch packets. Generated Harness Codex config defaults to
125
+ `agents.max_threads = 12` and `agents.max_depth = 1`; if that becomes the
126
+ bottleneck, ask the user before raising `agents.max_threads` and keep
127
+ `max_depth = 1` unless recursive delegation is explicitly approved. Do not rely
128
+ on undocumented fork/derive bypasses as stable capacity.
129
+
130
+ Default for automatic WF triggers: 3-5 active read-only agents before second
131
+ planning. For explicit WF/WK mode, never use the solo pass; schedule the
132
+ complete role chain and use bounded role passes as the recorded fallback when
133
+ subagents are unavailable.
134
+
135
+ ## WF Orchestration Shape
136
+
137
+ ```text
138
+ controller intake
139
+ -> parallel planner/researcher/docs-researcher/architect subagents
140
+ -> controller synthesis
141
+ -> second plan with dependencies and write sets
122
142
  -> acceptance/contract/test-writer
123
143
  -> implementer
124
144
  -> independent validator
125
- -> spec reviewer
126
- -> code/architecture reviewer
127
- -> if failed: debugger/fixer -> review -> verify -> loop
128
- -> close with evidence
129
- ```
130
-
131
- Use this shape for `/wf`, long tasks, multi-file changes, architecture work, migrations, browser/API behavior, or repeated failures.
132
-
133
- ```text
134
- /wf max orchestration shape:
135
- controller intake
136
- -> wave 0: max-parallel exploration (4-14 read-only agents)
137
- -> E-GATE: Exploration Gate all questions answered, findings synthesized (per WF-MAX.md)
138
- -> wave 1: architecture 3 parallel architects boundary decisions + interface contract
139
- -> D-GATE: Write Decomposition Gate Dispatch Table + Self-Audit for write-set (MANDATORY, per WF-MAX.md)
140
- -> wave 2: N parallel implementers (disjoint file claims, ALL spawned in ONE message)
141
- -> wave 2 review: parallel spec/code/security reviewers
142
- -> wave 3+: dependent implementers (if any; re-run D-GATE if write-set changed)
143
- -> integration verifier
144
- -> closeout with evidence
145
- ```
146
-
147
- ## Dispatch Pack
148
-
149
- Use the canonical dispatch input and handoff format in `Harness/dispatch.md`. Every subagent dispatch must be self-contained — inject only the docs selected by `Harness/README.md` and `Harness/context-loading.md`.
150
-
151
- ## Parallelism Rules
152
-
153
- - Read-only agents may run in parallel.
154
- - Writing agents run serially unless write sets are disjoint and the controller has chosen an isolated worktree.
155
- - Reviewers may run in parallel after implementation, but spec compliance is evaluated before code-quality approval.
156
- - Subagents are readers and reporters. They return findings and PLAN patch suggestions. Only the controller (main agent) commits state changes to task files.
157
- - 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.
158
- - If two agents disagree, the controller records the conflict in `Harness/tasks/<task-id>/PLAN.md` and chooses the smallest reversible next step.
159
-
160
- ## Review Gates
161
-
162
- Implementation is not complete until both gates pass:
163
-
145
+ -> cross-review: spec/AC reviewer + code/architecture/test reviewer
146
+ -> reflector
147
+ -> if failed: debugger/fixer -> verify -> cross-review -> reflector -> loop
148
+ -> close with evidence
149
+ ```
150
+
151
+ Use this shape for `/wf`, long tasks, multi-file changes, architecture work, migrations, browser/API behavior, or repeated failures.
152
+
153
+ ```text
154
+ /wf max orchestration shape:
155
+ controller intake
156
+ -> wave 0: max-parallel exploration (4-14 read-only agents)
157
+ -> E-GATE: Exploration Gate - all questions answered, findings synthesized (per WF-MAX.md)
158
+ -> wave 1: architecture - 3 parallel architects -> boundary decisions + interface contract
159
+ -> D-GATE: Write Decomposition Gate - Dispatch Table + Self-Audit for write-set (MANDATORY, per WF-MAX.md)
160
+ -> wave 2: N parallel implementers (disjoint file claims, ALL spawned in ONE message)
161
+ -> wave 2 review: parallel spec/code/security reviewers
162
+ -> wave 3+: dependent implementers (if any; re-run D-GATE if write-set changed)
163
+ -> integration verifier
164
+ -> reflector after cross-review
165
+ -> closeout with evidence
166
+ ```
167
+
168
+ ## Dispatch Pack
169
+
170
+ Use the canonical dispatch input and handoff format in `Harness/dispatch.md`. Every subagent dispatch must be self-contained - inject only the docs selected by `Harness/README.md` and `Harness/context-loading.md`.
171
+
172
+ ## Parallelism Rules
173
+
174
+ - Read-only agents may run in parallel.
175
+ - Writing agents run serially unless write sets are disjoint and the controller has chosen an isolated worktree.
176
+ - Reviewers may run in parallel after implementation, but spec compliance is evaluated before code-quality approval.
177
+ - Subagents are readers and reporters. They return findings and PLAN patch suggestions. Only the controller (main agent) commits state changes to task files.
178
+ - 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.
179
+ - If two agents disagree, the controller records the conflict in `Harness/tasks/<task-id>/PLAN.md` and chooses the smallest reversible next step.
180
+
181
+ ## Review Gates
182
+
183
+ Implementation is not complete until cross-review and reflection pass:
184
+
164
185
  1. **Spec review**: confirms the result matches the user request, PRD, feature doc, acceptance criteria, contracts, and non-goals. Extra features are failures.
165
186
  2. **Code-quality review**: checks correctness, maintainability, architecture, tests, security, and integration risk.
187
+ 3. **Reflector gate**: checks reviewer findings, verifier evidence, unresolved risks, and contradictions; returns PASS, RETURN_TO_DEBUG, or BLOCKED.
166
188
 
167
189
  Validation is separate from review. Validator must produce an AC-by-AC result
168
190
  matrix from running behavior and evidence, not from the implementer's summary.
169
-
170
- 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.
171
-
172
- ## Subagent Status Handling
173
-
174
- | Status | Controller Action |
175
- | --- | --- |
176
- | `DONE` | start review gates |
177
- | `DONE_WITH_CONCERNS` | read concerns, decide whether to address before review, record in `Harness/tasks/<task-id>/PROGRESS.md` |
178
- | `NEEDS_CONTEXT` | provide only missing context and re-dispatch |
179
- | `BLOCKED` | change something: add context, split task, upgrade reasoning, use debugger, or ask user |
180
-
181
- Never retry the same failed prompt unchanged.
182
-
183
- ## Failure Recovery
184
-
185
- - First failed verification: record evidence, dispatch debugger with the smallest reproduced failure.
186
- - Second same-class failure: narrow scope, update `Harness/tasks/<task-id>/PROGRESS.md#Heartbeat`, and add a reviewer before another fix.
187
- - Third same-class failure: stop blind fixes. Present evidence-backed options to the user.
188
-
189
- 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.
190
-
191
- ## Synthesis Output
192
-
193
- After subagents return, the controller writes one synthesis into `Harness/tasks/<task-id>/PLAN.md`:
194
-
195
- ```text
196
- Agents used:
197
- Findings accepted:
198
- Findings rejected:
199
- Conflicts:
200
- Decisions:
201
- Next write set:
191
+
192
+ If either reviewer finds issues, the implementer or debugger fixes them and the same gate runs again. Do not move to final acceptance with open critical/high findings or without reflector PASS.
193
+
194
+ ## Subagent Status Handling
195
+
196
+ | Status | Controller Action |
197
+ | --- | --- |
198
+ | `DONE` | start review gates |
199
+ | `DONE_WITH_CONCERNS` | read concerns, decide whether to address before review, record in `Harness/tasks/<task-id>/PROGRESS.md` |
200
+ | `NEEDS_CONTEXT` | provide only missing context and re-dispatch |
201
+ | `BLOCKED` | change something: add context, split task, upgrade reasoning, use debugger, or ask user |
202
+
203
+ Never retry the same failed prompt unchanged.
204
+
205
+ ## Failure Recovery
206
+
207
+ - First failed verification: record evidence, dispatch debugger with the smallest reproduced failure.
208
+ - Second same-class failure: narrow scope, update `Harness/tasks/<task-id>/PROGRESS.md#Heartbeat`, and add a reviewer before another fix.
209
+ - Third same-class failure: stop blind fixes. Present evidence-backed options to the user.
210
+
211
+ 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.
212
+
213
+ ## Synthesis Output
214
+
215
+ After subagents return, the controller writes one synthesis into `Harness/tasks/<task-id>/PLAN.md`:
216
+
217
+ ```text
218
+ Agents used:
219
+ Findings accepted:
220
+ Findings rejected:
221
+ Conflicts:
222
+ Decisions:
223
+ Next write set:
202
224
  Verification path:
203
225
  Acceptance/contract traceability:
204
226
  Residual risk:
205
- ```
206
-
207
- Only the synthesis and named files enter main context. Do not replay full subagent conversations.
227
+ ```
228
+
229
+ 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,82 +1,75 @@
1
- # {{TASK_ID}} PLAN
2
-
3
- Task-level implementation plan and evidence. Main agent writes after second planning; implementer reads before coding.
4
-
1
+ # {{TASK_ID}} - PLAN
2
+
3
+ Compact task record. Keep only facts needed to resume, review, and verify.
4
+ Link files or command names instead of pasting logs or subagent transcripts.
5
+
6
+ > Task ID: kebab-case, under 60 chars. Directory name = task ID.
7
+
5
8
  ## Goal
6
9
 
7
- ## Mini PRD
10
+ - Outcome:
11
+ - Non-goals:
8
12
 
9
- Scope:
10
- -
13
+ ## Decisions
11
14
 
12
- Non-scope:
13
- -
15
+ -
14
16
 
15
- User flow:
16
- 1.
17
+ ## Acceptance
17
18
 
18
- UI elements:
19
- -
19
+ Default: keep 1-3 concise ACs. Expand only for UI/API/security/data-loss,
20
+ cross-module, or other high-risk behavior.
20
21
 
21
- API behavior:
22
- -
22
+ - AC-001:
23
23
 
24
- ## Acceptance Criteria
24
+ Expanded evidence required when triggered:
25
+ - UI/browser-visible: add selector contract and real browser evidence.
26
+ - API/integration: add endpoint/payload/response contract.
27
+ - High-risk behavior: add AC-by-AC validation matrix.
25
28
 
26
- | AC ID | Given / When / Then | Verification | Evidence |
27
- |-------|----------------------|--------------|----------|
28
- | AC-001 | | | |
29
+ ## Scope
29
30
 
30
- ## UI Contract
31
+ Allowed write set:
32
+ -
31
33
 
32
- | Element | Selector / Role | States | AC IDs |
33
- |---------|-----------------|--------|--------|
34
+ Forbidden:
35
+ -
36
+ - Truth files (PRD, ACs, UI/API contracts, test plan, validation report) unless a Change Request is recorded.
34
37
 
35
- ## API Contract
38
+ ## Context
36
39
 
37
- | Endpoint | Method | Payload / Response | AC IDs |
38
- |----------|--------|--------------------|--------|
40
+ - Loaded:
41
+ - Assumptions:
39
42
 
40
- ## Test Plan
43
+ ## Agents
41
44
 
42
- For browser-visible ACs, include real user actions and evidence. Syntax-only checks, import tests, shallow renders, typecheck, lint, and build success are not acceptance evidence for UI behavior.
45
+ Only record agents or bounded passes that materially changed the decision.
46
+
47
+ | Role | Read / Write Set | Result |
48
+ |------|------------------|--------|
43
49
 
44
- | AC ID | Test Level | User Action / API Request | Command / File | Evidence | Status |
45
- |-------|------------|---------------------------|----------------|----------|--------|
46
-
47
- ## Scope
48
-
49
- Allowed write set:
50
- -
51
-
52
- Forbidden:
53
- -
54
- - PRD / acceptance criteria / UI contract / API contract / test plan / validation report unless Change Request is recorded
55
-
56
- ## Loaded Context
57
-
58
- -
59
-
60
- ## Subagent Dispatch
61
-
62
- | Agent | Mode | Read Set | Write Set | Status |
63
- |-------|------|----------|-----------|--------|
64
-
65
- ## Subagent Synthesis
66
-
67
- Agents used:
68
- Findings accepted:
69
- Findings rejected:
70
- Conflicts:
71
- Decisions:
72
- Residual risk:
73
-
74
50
  ## Verification
75
51
 
76
- | Check | Result | Notes |
77
- |-------|--------|-------|
52
+ - [ ]
53
+
54
+ ## Risks
55
+
56
+ -
57
+
58
+ ## Expanded Contracts
59
+
60
+ Use this section only when the Acceptance triggers above apply.
61
+
62
+ ### UI Contract
63
+
64
+ | Element | Selector / Role | States | AC IDs |
65
+ |---------|-----------------|--------|--------|
66
+
67
+ ### API Contract
68
+
69
+ | Endpoint | Method | Payload / Response | AC IDs |
70
+ |----------|--------|--------------------|--------|
78
71
 
79
- ## Acceptance Result
72
+ ### Validation Matrix
80
73
 
81
74
  | AC ID | Result | Evidence | Notes |
82
75
  |-------|--------|----------|-------|
@@ -1,29 +1,26 @@
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
+ Compact heartbeat. Update on phase changes, blockers, failures, and closeout.
4
+ Do not paste logs; record the command/file that proves the state.
5
+
6
+ ## Status
7
+
8
+ - Phase: Intake
9
+ - Next:
10
+ - Blocker: none
11
+
12
+ ## Tasks
13
+
14
+ - [ ] Define goal and scope
15
+
16
+ ## Changes
17
+
18
+ -
19
+
20
+ ## Verification
21
+
22
+ -
23
+
24
+ ## Notes
25
+
26
+ -