create-harness-vibe-coding 0.1.10 → 0.2.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.md +86 -35
- package/package.json +1 -1
- package/src/generator.js +72 -12
- package/src/index.js +30 -11
- package/templates/common/.claude/agents/architect.md +4 -4
- package/templates/common/.claude/agents/debugger.md +1 -1
- package/templates/common/.claude/agents/docs-researcher.md +4 -4
- package/templates/common/.claude/agents/implementer.md +1 -1
- package/templates/common/.claude/agents/planner.md +3 -3
- package/templates/common/.claude/agents/researcher.md +4 -4
- package/templates/common/.claude/agents/reviewer.md +1 -1
- package/templates/common/.claude/agents/test-writer.md +2 -2
- package/templates/common/.claude/agents/verifier.md +1 -1
- package/templates/common/.claude/commands/wf.md +18 -0
- package/templates/common/.claude/rules/ecc/common.md +11 -10
- package/templates/common/.claude/skills/harness-build-loop/SKILL.md +4 -3
- package/templates/common/.claude/skills/harness-context/SKILL.md +4 -3
- package/templates/common/.claude/skills/harness-lifecycle/SKILL.md +3 -3
- package/templates/common/.claude/skills/harness-research/SKILL.md +4 -4
- package/templates/common/.claude/skills/harness-router/SKILL.md +7 -5
- package/templates/common/.claude/skills/readme-optimizer/SKILL.md +48 -0
- package/templates/common/.claude/skills/subagent-orchestrator/SKILL.md +36 -0
- package/templates/common/.claude/skills/wf-mode/SKILL.md +48 -0
- package/templates/common/AGENTS.md +2 -2
- package/templates/common/CLAUDE.md +39 -73
- package/templates/common/MEMORY.md +32 -27
- package/templates/common/README.md +41 -0
- package/templates/common/SETUP.md +95 -72
- package/templates/common/docs/README.md +71 -54
- package/templates/common/docs/domain/ports.md +1 -1
- package/templates/common/docs/features/_template.md +10 -10
- package/templates/common/docs/harness/PLAN.md +25 -2
- package/templates/common/docs/harness/WF.md +136 -0
- package/templates/common/docs/harness/agent-workflow.md +8 -8
- package/templates/common/docs/harness/context-loading.md +16 -16
- package/templates/common/docs/harness/data-flow.md +1 -1
- package/templates/common/docs/harness/dispatch.md +5 -2
- package/templates/common/docs/harness/extension.md +14 -14
- package/templates/common/docs/harness/lifecycle.md +2 -2
- package/templates/common/docs/harness/subagents.md +140 -0
- package/templates/common/docs/research/PRD.md +1 -1
- package/templates/common/docs/research/README.md +5 -5
- package/templates/common/scripts/validate-harness.mjs +131 -56
- package/templates/optional/skills/browser-e2e/.claude/skills/browser-e2e/SKILL.md +5 -5
- package/templates/optional/skills/browser-e2e/docs/workflows/browser-e2e.md +1 -1
- package/templates/optional/skills/github-pr-review/.claude/skills/github-pr-review/SKILL.md +5 -5
- package/templates/optional/skills/python-backend/.claude/skills/python-backend/SKILL.md +5 -5
- package/templates/optional/skills/ts-react-frontend/.claude/skills/ts-react-frontend/SKILL.md +5 -5
- package/templates/optional/skills/ui-ux-review/.claude/skills/ui-ux-review/SKILL.md +5 -5
|
@@ -12,6 +12,18 @@ Choose one: Idea / Research / PRD / Architecture / Plan / Build / Verify / Feedb
|
|
|
12
12
|
|
|
13
13
|
Current: {{CURRENT_PHASE}}
|
|
14
14
|
|
|
15
|
+
## Heartbeat
|
|
16
|
+
|
|
17
|
+
Mode: normal
|
|
18
|
+
Last beat: {{LAST_BEAT}}
|
|
19
|
+
Current phase: {{CURRENT_PHASE}}
|
|
20
|
+
Current blocker: {{CURRENT_BLOCKER_OR_NONE}}
|
|
21
|
+
Next beat trigger: {{NEXT_BEAT_TRIGGER}}
|
|
22
|
+
Failure count: 0
|
|
23
|
+
Recovery action: {{RECOVERY_ACTION_OR_NONE}}
|
|
24
|
+
|
|
25
|
+
Update this section before long commands, after long commands, before and after subagent handoffs, after failed verification, and before stopping for user input. In `wf-mode`, use this as the resume point after context loss or interruption.
|
|
26
|
+
|
|
15
27
|
## Progress Rules
|
|
16
28
|
|
|
17
29
|
- Phase tracks lifecycle progress.
|
|
@@ -44,7 +56,7 @@ Forbidden:
|
|
|
44
56
|
|
|
45
57
|
Keep this list short. Add only docs/files used for the current phase.
|
|
46
58
|
|
|
47
|
-
- `
|
|
59
|
+
- `Harness/README.md`
|
|
48
60
|
- `{{LOADED_DOC_OR_FILE}}`
|
|
49
61
|
|
|
50
62
|
## Tasks
|
|
@@ -55,12 +67,23 @@ Keep this list short. Add only docs/files used for the current phase.
|
|
|
55
67
|
|
|
56
68
|
## Parallel Dispatch
|
|
57
69
|
|
|
58
|
-
Use [dispatch.md](dispatch.md) when more than one agent or bounded pass is useful.
|
|
70
|
+
Use [subagents.md](subagents.md) and [dispatch.md](dispatch.md) when more than one agent or bounded pass is useful.
|
|
59
71
|
|
|
60
72
|
| Task | Agent | Mode | Read Set | Write Set | Depends On | Output | Status |
|
|
61
73
|
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
62
74
|
| {{TASK}} | {{AGENT}} | Parallel Read / Serial Write / Isolated Worktree | `{{READ_SET}}` | `{{WRITE_SET_OR_NONE}}` | {{DEPENDENCY_OR_NONE}} | {{EXPECTED_OUTPUT}} | Pending |
|
|
63
75
|
|
|
76
|
+
## Subagent Synthesis
|
|
77
|
+
|
|
78
|
+
Agents used:
|
|
79
|
+
Findings accepted:
|
|
80
|
+
Findings rejected:
|
|
81
|
+
Conflicts:
|
|
82
|
+
Decisions:
|
|
83
|
+
Next write set:
|
|
84
|
+
Verification path:
|
|
85
|
+
Residual risk:
|
|
86
|
+
|
|
64
87
|
## Agent Handoffs
|
|
65
88
|
|
|
66
89
|
| Agent | Role | Context Pack | Result |
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# WF Mode - Long Task Workflow
|
|
2
|
+
|
|
3
|
+
Use this when work is long, difficult, uncertain, multi-file, multi-agent, or user-triggered with `/wf`, `wf mode`, or `workflow mode`.
|
|
4
|
+
|
|
5
|
+
This is a Ralph-style harness loop: keep moving through evidence, bounded exploration, second planning, implementation, review, verification, and recovery instead of stalling on the first obstacle.
|
|
6
|
+
|
|
7
|
+
## Trigger
|
|
8
|
+
|
|
9
|
+
Enter WF mode when any of these are true:
|
|
10
|
+
|
|
11
|
+
- The user explicitly says `/wf`, `wf mode`, or asks for the full workflow.
|
|
12
|
+
- The task needs more than one step, more than three files, or more than one subsystem.
|
|
13
|
+
- The task needs research, architecture judgment, browser/API validation, or migration planning.
|
|
14
|
+
- Confidence in intent, architecture, or implementation is below 95%.
|
|
15
|
+
- The same command, test, tool, or approach fails twice.
|
|
16
|
+
|
|
17
|
+
## WF Loop
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
Intake
|
|
21
|
+
-> confidence gate
|
|
22
|
+
-> parallel explorer / researcher / docs-researcher / architect passes
|
|
23
|
+
-> synthesis
|
|
24
|
+
-> second plan
|
|
25
|
+
-> test-writer
|
|
26
|
+
-> implementer
|
|
27
|
+
-> reviewers
|
|
28
|
+
-> verifier
|
|
29
|
+
-> if failed: debugger -> review -> e2e/API verification -> loop
|
|
30
|
+
-> close with evidence
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Intake
|
|
34
|
+
|
|
35
|
+
1. Read `CLAUDE.md`, `Harness/MEMORY.md`, `Harness/README.md`, and `Harness/PLAN.md`.
|
|
36
|
+
2. State the goal, non-goals, confidence level, known risks, and write boundaries.
|
|
37
|
+
3. Ask up to three blocking questions only when the next action cannot reach 95% confidence.
|
|
38
|
+
4. Update `Harness/PLAN.md#Heartbeat` before dispatching agents or running long commands.
|
|
39
|
+
5. Load `Harness/subagents.md` before coordinating multiple agents.
|
|
40
|
+
|
|
41
|
+
## Exploration
|
|
42
|
+
|
|
43
|
+
Use parallel read-only passes first. Prefer three or fewer active agents.
|
|
44
|
+
|
|
45
|
+
| Agent | Purpose | Writes |
|
|
46
|
+
| --- | --- | --- |
|
|
47
|
+
| Explorer Pass | map local project facts, commands, app entry points, existing docs | none |
|
|
48
|
+
| `researcher` | product, ecosystem, dependency, and external context | none unless returning a docs patch |
|
|
49
|
+
| `docs-researcher` | official docs, SDK/API versions, browser/tool limits | none unless returning a docs patch |
|
|
50
|
+
| `architect` | boundaries, ports, data flow, state impact, migration risks | none unless returning a docs patch |
|
|
51
|
+
|
|
52
|
+
Use local files first. Use web search, Tavily, TinyFish, GitHub, official docs, or user-provided links only when the decision needs current or external evidence. Record tool choice and limitations in `Harness/research/research-results.md` or `Harness/PLAN.md`.
|
|
53
|
+
|
|
54
|
+
## Subagent Orchestration
|
|
55
|
+
|
|
56
|
+
Use `Harness/subagents.md` as the orchestration methodology and `Harness/dispatch.md` as the dispatch table protocol.
|
|
57
|
+
|
|
58
|
+
- The main agent is the controller and owns synthesis, integration, and final verification.
|
|
59
|
+
- Parallelize read-only exploration; serialize writers unless write sets are disjoint and isolated.
|
|
60
|
+
- Every subagent gets a dispatch pack with role, goal, read set, write set, forbidden scope, injected docs, evidence, stop condition, and return format.
|
|
61
|
+
- After implementation, run spec review before code-quality or architecture review.
|
|
62
|
+
- If subagents are unavailable, emulate the same roles as bounded passes and record the fallback.
|
|
63
|
+
|
|
64
|
+
## Second Plan
|
|
65
|
+
|
|
66
|
+
After exploration, synthesize:
|
|
67
|
+
|
|
68
|
+
- facts found
|
|
69
|
+
- assumptions
|
|
70
|
+
- risks
|
|
71
|
+
- accepted/rejected options
|
|
72
|
+
- tasks
|
|
73
|
+
- read/write sets
|
|
74
|
+
- verification path
|
|
75
|
+
- rollback or recovery plan
|
|
76
|
+
|
|
77
|
+
Write the result to `Harness/PLAN.md` before implementation.
|
|
78
|
+
|
|
79
|
+
## Build And Review
|
|
80
|
+
|
|
81
|
+
1. `test-writer` defines a failing test or written manual check first.
|
|
82
|
+
2. `implementer` changes only the declared write set.
|
|
83
|
+
3. At least one `reviewer` checks diff, architecture, risks, and missing tests.
|
|
84
|
+
4. For cross-layer or risky work, run separate reviewers for architecture and test adequacy.
|
|
85
|
+
5. `verifier` runs the declared checks and records exact evidence.
|
|
86
|
+
|
|
87
|
+
## Browser And API Evidence
|
|
88
|
+
|
|
89
|
+
For browser-visible changes, typecheck/build/unit tests are not enough. Use Chrome DevTools, CDP, Playwright, or a documented real-browser run:
|
|
90
|
+
|
|
91
|
+
- start the app and record URL/port
|
|
92
|
+
- click through the critical flow
|
|
93
|
+
- capture frontend console/runtime errors
|
|
94
|
+
- capture failed network requests
|
|
95
|
+
- collect backend logs when the flow crosses an API
|
|
96
|
+
- record screenshot, trace, video, or manual evidence path
|
|
97
|
+
|
|
98
|
+
For API changes, run the project API/integration test path or a documented real request against a local service and record request, response, logs, and failure behavior.
|
|
99
|
+
|
|
100
|
+
## Recovery Loop
|
|
101
|
+
|
|
102
|
+
If verification fails:
|
|
103
|
+
|
|
104
|
+
1. Update `Harness/PLAN.md#Heartbeat` with failure count and blocker.
|
|
105
|
+
2. Dispatch `debugger` with the failing command, error output, and smallest relevant files.
|
|
106
|
+
3. Fix the smallest reproduced failure.
|
|
107
|
+
4. Run reviewer again.
|
|
108
|
+
5. Run verifier again.
|
|
109
|
+
6. Repeat until verified or blocked by missing user input/external state.
|
|
110
|
+
|
|
111
|
+
If the same failure class happens three times, stop blind fixes. Record evidence, likely root causes, attempted paths, and ask the user to choose among clear options.
|
|
112
|
+
|
|
113
|
+
## Heartbeat Protocol
|
|
114
|
+
|
|
115
|
+
Heartbeat is a lightweight recovery protocol, not a background daemon.
|
|
116
|
+
|
|
117
|
+
Update `Harness/PLAN.md#Heartbeat`:
|
|
118
|
+
|
|
119
|
+
- before a long command
|
|
120
|
+
- after a long command
|
|
121
|
+
- before spawning subagents
|
|
122
|
+
- after integrating subagent returns
|
|
123
|
+
- after each failed verification
|
|
124
|
+
- before stopping for user input
|
|
125
|
+
|
|
126
|
+
The agent may set the next beat interval by event instead of time, such as "after next test run", "after reviewer returns", or "after browser evidence is captured".
|
|
127
|
+
|
|
128
|
+
## Closeout
|
|
129
|
+
|
|
130
|
+
Close only when:
|
|
131
|
+
|
|
132
|
+
- acceptance criteria are satisfied
|
|
133
|
+
- reviewer has no unresolved critical/high findings
|
|
134
|
+
- test/API/browser evidence is recorded
|
|
135
|
+
- affected Harness docs are synced
|
|
136
|
+
- `Harness/PLAN.md#Heartbeat` says the task is verified or lists the exact next recovery action
|
|
@@ -5,14 +5,14 @@ Use when implementing, reviewing, debugging, or coordinating subagents.
|
|
|
5
5
|
## ReAct Loop
|
|
6
6
|
|
|
7
7
|
```text
|
|
8
|
-
Observe -> Load minimal context -> Plan -> Act -> Verify -> Update
|
|
8
|
+
Observe -> Load minimal context -> Plan -> Act -> Verify -> Update Harness/PLAN.md
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
If context grows, load [context-loading.md](context-loading.md) and split the work. If more than one agent is useful, load [dispatch.md](dispatch.md).
|
|
11
|
+
If context grows, load [context-loading.md](context-loading.md) and split the work. If more than one agent is useful, load [subagents.md](subagents.md) and [dispatch.md](dispatch.md).
|
|
12
12
|
|
|
13
13
|
## Feature Packet
|
|
14
14
|
|
|
15
|
-
Every PRD scope item (`research/PRD.md` Section 2) must have its own feature doc at `
|
|
15
|
+
Every PRD scope item (`research/PRD.md` Section 2) must have its own feature doc at `Harness/features/<name>.md` created from `Harness/features/_template.md`. One feature = one doc = one implementation unit. Do not code without a feature doc.
|
|
16
16
|
|
|
17
17
|
Small scope is not an exception — a short feature doc is better than none. If the work is truly too small for a full feature doc (single-file fix, no behavior change), it is not a PRD scope item.
|
|
18
18
|
|
|
@@ -32,7 +32,7 @@ PRD/feature packet
|
|
|
32
32
|
|
|
33
33
|
## Subagent Use
|
|
34
34
|
|
|
35
|
-
Use subagents when a task needs broad reading, parallel work, cross-layer changes, independent review, or isolated debugging.
|
|
35
|
+
Use subagents when a task needs broad reading, parallel work, cross-layer changes, independent review, or isolated debugging. Follow [subagents.md](subagents.md) for controller-led orchestration and [dispatch.md](dispatch.md) for the dispatch table.
|
|
36
36
|
|
|
37
37
|
Before spawn, define:
|
|
38
38
|
|
|
@@ -58,16 +58,16 @@ Rules:
|
|
|
58
58
|
|
|
59
59
|
## Parallel Dispatch
|
|
60
60
|
|
|
61
|
-
Use [dispatch.md](dispatch.md) for multi-agent work. Default to at most three active agents. Prefer parallel read-only work first, then serial writes.
|
|
61
|
+
Use [subagents.md](subagents.md) and [dispatch.md](dispatch.md) for multi-agent work. Default to at most three active agents. Prefer parallel read-only work first, then serial writes.
|
|
62
62
|
|
|
63
63
|
Every dispatched agent returns the handoff format defined in [dispatch.md](dispatch.md).
|
|
64
64
|
|
|
65
65
|
## Conflict Rule
|
|
66
66
|
|
|
67
|
-
If PRD,
|
|
67
|
+
If PRD, Harness/PLAN.md, architecture, ports, tests, or code disagree:
|
|
68
68
|
|
|
69
69
|
1. stop implementation
|
|
70
|
-
2. record the conflict in `
|
|
70
|
+
2. record the conflict in `Harness/PLAN.md` or the feature doc
|
|
71
71
|
3. choose the smallest reversible decision
|
|
72
72
|
4. ask the maintainer when user-visible behavior or security is affected
|
|
73
73
|
|
|
@@ -79,4 +79,4 @@ Close only when:
|
|
|
79
79
|
- verification evidence is recorded
|
|
80
80
|
- architecture, ports, data-flow, or state docs are synced if affected
|
|
81
81
|
- no unresolved critical/high review findings remain
|
|
82
|
-
- `
|
|
82
|
+
- `Harness/PLAN.md` states the final status or next iteration
|
|
@@ -4,20 +4,20 @@ Use when context is growing, subagents are needed, or an agent is unsure which h
|
|
|
4
4
|
|
|
5
5
|
## Routing Authority
|
|
6
6
|
|
|
7
|
-
`
|
|
7
|
+
`Harness/README.md` is the primary router. This file is a secondary context-splitting protocol for subagents and long tasks.
|
|
8
8
|
|
|
9
|
-
If this file and `
|
|
9
|
+
If this file and `Harness/README.md` disagree, follow `Harness/README.md`, record the assumption in `Harness/PLAN.md`, and update this file later.
|
|
10
10
|
|
|
11
|
-
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 `
|
|
11
|
+
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/PLAN.md`, the current feature doc, `Harness/MEMORY.md`, or `Harness/memory/*` as appropriate.
|
|
12
12
|
|
|
13
13
|
## Main Context
|
|
14
14
|
|
|
15
15
|
Always keep:
|
|
16
16
|
|
|
17
17
|
- `CLAUDE.md`
|
|
18
|
-
- `MEMORY.md`
|
|
19
|
-
- `
|
|
20
|
-
- `
|
|
18
|
+
- `Harness/MEMORY.md`
|
|
19
|
+
- `Harness/README.md`
|
|
20
|
+
- `Harness/PLAN.md` when active
|
|
21
21
|
- current feature doc when active
|
|
22
22
|
|
|
23
23
|
Load other docs only by trigger.
|
|
@@ -26,16 +26,16 @@ Load other docs only by trigger.
|
|
|
26
26
|
|
|
27
27
|
| Trigger | Load |
|
|
28
28
|
| --- | --- |
|
|
29
|
-
| idea, scope, MVP | `
|
|
30
|
-
| research, competitors, stack choice | `
|
|
31
|
-
| official docs, API, SDK, version, limits | `
|
|
32
|
-
| layer, dependency, module boundary | `
|
|
33
|
-
| task split, owner, write set | `
|
|
34
|
-
| parallel agents, dispatch, worktree decision | `
|
|
35
|
-
| memory, repeated tool failure, repeated user correction, reusable lesson | `MEMORY.md`, the relevant `memory/*.md` file |
|
|
36
|
-
| event, retry, failure path | `
|
|
37
|
-
| status, transition, resume | `
|
|
38
|
-
| subagent spawn | this file plus the role pack below |
|
|
29
|
+
| idea, scope, MVP | `Harness/lifecycle.md`, `Harness/research/PRD.md` |
|
|
30
|
+
| research, competitors, stack choice | `Harness/research/README.md`, `Harness/research/research-results.md` |
|
|
31
|
+
| official docs, API, SDK, version, limits | `Harness/research/README.md`, `Harness/architecture.md`, `Harness/domain/ports.md` as needed |
|
|
32
|
+
| layer, dependency, module boundary | `Harness/architecture.md`, `Harness/domain/ports.md` |
|
|
33
|
+
| task split, owner, write set | `Harness/PLAN.md`, `Harness/agent-workflow.md` |
|
|
34
|
+
| parallel agents, dispatch, worktree decision | `Harness/subagents.md`, `Harness/dispatch.md`, `Harness/PLAN.md` |
|
|
35
|
+
| memory, repeated tool failure, repeated user correction, reusable lesson | `Harness/MEMORY.md`, the relevant `Harness/memory/*.md` file |
|
|
36
|
+
| event, retry, failure path | `Harness/data-flow.md` |
|
|
37
|
+
| status, transition, resume | `Harness/state-machines.md` |
|
|
38
|
+
| subagent spawn | `Harness/subagents.md`, this file plus the role pack below |
|
|
39
39
|
|
|
40
40
|
## Subagent Packs
|
|
41
41
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Data Flow — {{projectName}}
|
|
2
2
|
|
|
3
3
|
> **Purpose**: Define the complete lifecycle of each event/request — happy path + all failure branches.
|
|
4
|
-
> **This is the most important file in
|
|
4
|
+
> **This is the most important runtime-flow file in `Harness/`** — what AI most often invents during implementation is failure-path behavior. Write it clearly and it won't.
|
|
5
5
|
>
|
|
6
6
|
> Philosophy source: EventCatalog pattern + arc42 Chapter 6 (Runtime View).
|
|
7
7
|
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Purpose: coordinate a small set of subagents without building a scheduler.
|
|
4
4
|
|
|
5
|
+
Use [subagents.md](subagents.md) for orchestration strategy. Use this file for the dispatch table, handoff format, and status protocol.
|
|
6
|
+
|
|
5
7
|
Use when work needs parallel reading, independent review, cross-layer analysis, or more than one bounded implementation pass.
|
|
6
8
|
|
|
7
9
|
## Principles
|
|
8
10
|
|
|
9
11
|
- Main agent owns the final decision, integration, and verification.
|
|
10
12
|
- project files are the only durable communication channel; chat/subagent transcript state is non-authoritative.
|
|
11
|
-
- Important assumptions, decisions, blockers, evidence, and handoffs must be written to `
|
|
13
|
+
- Important assumptions, decisions, blockers, evidence, and handoffs must be written to `Harness/PLAN.md`, the current feature doc, `Harness/MEMORY.md`, or `Harness/memory/*` as appropriate.
|
|
12
14
|
- Prefer three or fewer active agents.
|
|
13
15
|
- Read-only agents may run in parallel.
|
|
14
16
|
- Writing agents run serially unless write sets are disjoint.
|
|
@@ -20,6 +22,7 @@ Use when work needs parallel reading, independent review, cross-layer analysis,
|
|
|
20
22
|
```text
|
|
21
23
|
Goal
|
|
22
24
|
-> Fill PLAN tasks and Parallel Dispatch
|
|
25
|
+
-> Apply subagents.md efficiency ladder
|
|
23
26
|
-> Run parallel read-only agents
|
|
24
27
|
-> Main agent integrates findings
|
|
25
28
|
-> Test Writer defines failing test or manual check
|
|
@@ -78,7 +81,7 @@ PLAN patch:
|
|
|
78
81
|
```
|
|
79
82
|
|
|
80
83
|
Use `Files changed: none` for read-only agents. Use `PLAN patch: none` when no state update is needed.
|
|
81
|
-
If a handoff matters after context loss, write it to `
|
|
84
|
+
If a handoff matters after context loss, write it to `Harness/PLAN.md`, the current feature doc, or `Harness/memory/*`; do not rely on chat transcript state.
|
|
82
85
|
|
|
83
86
|
## Statuses
|
|
84
87
|
|
|
@@ -8,12 +8,12 @@ Use during setup whenever adding assets from ECC, SuperClaude, toolboxes, or loc
|
|
|
8
8
|
|
|
9
9
|
Extensions must preserve project and harness ownership boundaries.
|
|
10
10
|
|
|
11
|
-
- Preserve existing `.claude/`, `CLAUDE.md`, `AGENTS.md`, `.gitignore`, `
|
|
11
|
+
- Preserve existing `.claude/`, `CLAUDE.md`, `AGENTS.md`, `.gitignore`, `Harness/README.md`, `Harness/workflows/*.md`, settings, hooks, and local rules unless the user explicitly requests an overwrite.
|
|
12
12
|
- Treat existing project config as project fact. Read it before adding assets, then adapt new assets to the project instead of replacing the project.
|
|
13
|
-
- Register added agents, skills, workflows, rules, and hooks in `MEMORY.md` and this docs router where applicable.
|
|
14
|
-
- Added assets may extend `.claude/skills/`, `.claude/agents/`, `.claude/rules/`, or `
|
|
15
|
-
- Core harness docs are `
|
|
16
|
-
- If an optional workflow needs a new command or tool, document the command and fallback in `
|
|
13
|
+
- Register added agents, skills, workflows, rules, and hooks in `Harness/MEMORY.md` and this docs router where applicable.
|
|
14
|
+
- Added assets may extend `.claude/skills/`, `.claude/agents/`, `.claude/rules/`, or `Harness/workflows/`, but they must not replace core harness docs.
|
|
15
|
+
- Core harness docs are `Harness/README.md`, `Harness/PLAN.md`, `Harness/subagents.md`, `Harness/context-loading.md`, `Harness/dispatch.md`, `Harness/agent-workflow.md`, and this file.
|
|
16
|
+
- If an optional workflow needs a new command or tool, document the command and fallback in `Harness/workflows/<name>.md` instead of changing core harness behavior.
|
|
17
17
|
|
|
18
18
|
## Agent Contract
|
|
19
19
|
|
|
@@ -44,7 +44,7 @@ Agent body must state:
|
|
|
44
44
|
- allowed write set or read-only
|
|
45
45
|
- forbidden scope
|
|
46
46
|
- verification or evidence
|
|
47
|
-
- return format from [dispatch.md](dispatch.md)
|
|
47
|
+
- return format from [subagents.md](subagents.md) and [dispatch.md](dispatch.md)
|
|
48
48
|
|
|
49
49
|
## Skill Contract
|
|
50
50
|
|
|
@@ -55,10 +55,10 @@ Every added skill must state:
|
|
|
55
55
|
- required inputs
|
|
56
56
|
- allowed writes
|
|
57
57
|
- output format
|
|
58
|
-
- whether to update `
|
|
59
|
-
- whether to use [dispatch.md](dispatch.md)
|
|
58
|
+
- whether to update `Harness/PLAN.md`
|
|
59
|
+
- whether to use [subagents.md](subagents.md) and [dispatch.md](dispatch.md)
|
|
60
60
|
|
|
61
|
-
Skills should extend the harness. They should not replace `
|
|
61
|
+
Skills should extend the harness. They should not replace `Harness/README.md`, `PLAN.md`, `subagents.md`, `context-loading.md`, `dispatch.md`, or `agent-workflow.md`.
|
|
62
62
|
|
|
63
63
|
## Rules
|
|
64
64
|
|
|
@@ -72,8 +72,8 @@ Skills should extend the harness. They should not replace `docs/README.md`, `PLA
|
|
|
72
72
|
|
|
73
73
|
After adding assets:
|
|
74
74
|
|
|
75
|
-
- list agents in `MEMORY.md#Agents`
|
|
76
|
-
- list skills in `MEMORY.md#Skills`
|
|
77
|
-
- list workflows by path in `MEMORY.md` or `
|
|
78
|
-
- update `
|
|
79
|
-
- run `node scripts/validate-harness.mjs`
|
|
75
|
+
- list agents in `Harness/MEMORY.md#Agents`
|
|
76
|
+
- list skills in `Harness/MEMORY.md#Skills`
|
|
77
|
+
- list workflows by path in `Harness/MEMORY.md` or `Harness/README.md`
|
|
78
|
+
- update `Harness/PLAN.md` when the asset affects current work
|
|
79
|
+
- run `node Harness/scripts/validate-harness.mjs`
|
|
@@ -9,8 +9,8 @@ Use when starting a new product, clarifying a vague idea, or deciding the next p
|
|
|
9
9
|
| Idea | user intent | problem, target user, non-goals | unclear points asked or assumptions recorded |
|
|
10
10
|
| Research | problem and constraints | `research/research-results.md` | `research/README.md` followed; at least 3 references or explicit reason not possible |
|
|
11
11
|
| PRD | research decision | `research/PRD.md` | MVP, non-goals, acceptance criteria are verifiable |
|
|
12
|
-
| Architecture | PRD | `
|
|
13
|
-
| Plan | PRD and architecture | `
|
|
12
|
+
| Architecture | PRD | `Harness/architecture.md`, `Harness/domain/ports.md` | boundaries and first ports are defined |
|
|
13
|
+
| Plan | PRD and architecture | `Harness/PLAN.md`, optional `Harness/dispatch.md`, one `Harness/features/<name>.md` per PRD scope item | tasks have owners, write sets, verification |
|
|
14
14
|
| Build | plan and tests | minimal vertical slice | tests or manual checks prove behavior |
|
|
15
15
|
| Verify | implementation | review findings, test evidence | no unresolved critical/high findings |
|
|
16
16
|
| Feedback | verified slice | next iteration or release decision | learnings recorded in PRD, PLAN, or MEMORY |
|
|
@@ -0,0 +1,140 @@
|
|
|
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/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/PLAN.md`
|
|
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
|
+
## Efficiency Ladder
|
|
38
|
+
|
|
39
|
+
Choose the cheapest coordination level that is safe.
|
|
40
|
+
|
|
41
|
+
| Level | Use When | Pattern |
|
|
42
|
+
| --- | --- | --- |
|
|
43
|
+
| Solo pass | one file, low risk, clear intent | no subagent |
|
|
44
|
+
| Single reviewer | small change with meaningful risk | implement, then reviewer |
|
|
45
|
+
| Parallel read-only | broad reading, research, architecture, multiple independent failures | 2-3 read-only agents |
|
|
46
|
+
| Serial build lane | normal feature or fix | test-writer -> implementer -> reviewers -> verifier |
|
|
47
|
+
| Isolated lanes | disjoint write sets or competing approaches | separate worktrees, then review and merge |
|
|
48
|
+
|
|
49
|
+
Default: at most three active subagents. More agents increase coordination cost and conflict risk.
|
|
50
|
+
|
|
51
|
+
## WF Orchestration Shape
|
|
52
|
+
|
|
53
|
+
```text
|
|
54
|
+
controller intake
|
|
55
|
+
-> parallel explorer/researcher/docs-researcher/architect passes
|
|
56
|
+
-> controller synthesis
|
|
57
|
+
-> second plan with dependencies and write sets
|
|
58
|
+
-> test-writer
|
|
59
|
+
-> implementer
|
|
60
|
+
-> spec reviewer
|
|
61
|
+
-> code/architecture reviewer
|
|
62
|
+
-> verifier
|
|
63
|
+
-> if failed: debugger/fixer -> review -> verify -> loop
|
|
64
|
+
-> close with evidence
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Use this shape for `/wf`, long tasks, multi-file changes, architecture work, migrations, browser/API behavior, or repeated failures.
|
|
68
|
+
|
|
69
|
+
## Dispatch Pack
|
|
70
|
+
|
|
71
|
+
Every subagent dispatch must be self-contained:
|
|
72
|
+
|
|
73
|
+
```text
|
|
74
|
+
Role:
|
|
75
|
+
Goal:
|
|
76
|
+
Mode: read-only | write
|
|
77
|
+
Read set:
|
|
78
|
+
Write set:
|
|
79
|
+
Forbidden scope:
|
|
80
|
+
Injected docs:
|
|
81
|
+
Dependencies:
|
|
82
|
+
Expected evidence:
|
|
83
|
+
Stop condition:
|
|
84
|
+
Return format:
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
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`.
|
|
88
|
+
|
|
89
|
+
## Parallelism Rules
|
|
90
|
+
|
|
91
|
+
- Read-only agents may run in parallel.
|
|
92
|
+
- Writing agents run serially unless write sets are disjoint and the controller has chosen an isolated worktree.
|
|
93
|
+
- Reviewers may run in parallel after implementation, but spec compliance is evaluated before code-quality approval.
|
|
94
|
+
- Do not let two agents edit `Harness/PLAN.md`, `Harness/MEMORY.md`, or `Harness/memory/*` concurrently. The controller writes durable state.
|
|
95
|
+
- If two agents disagree, the controller records the conflict in `Harness/PLAN.md` and chooses the smallest reversible next step.
|
|
96
|
+
|
|
97
|
+
## Review Gates
|
|
98
|
+
|
|
99
|
+
Implementation is not complete until both gates pass:
|
|
100
|
+
|
|
101
|
+
1. **Spec review**: confirms the result matches the user request, PRD, feature doc, acceptance criteria, and non-goals. Extra features are failures.
|
|
102
|
+
2. **Code-quality review**: checks correctness, maintainability, architecture, tests, security, and integration risk.
|
|
103
|
+
|
|
104
|
+
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.
|
|
105
|
+
|
|
106
|
+
## Subagent Status Handling
|
|
107
|
+
|
|
108
|
+
| Status | Controller Action |
|
|
109
|
+
| --- | --- |
|
|
110
|
+
| `DONE` | start review gates |
|
|
111
|
+
| `DONE_WITH_CONCERNS` | read concerns, decide whether to address before review, record in `PLAN.md` |
|
|
112
|
+
| `NEEDS_CONTEXT` | provide only missing context and re-dispatch |
|
|
113
|
+
| `BLOCKED` | change something: add context, split task, upgrade reasoning, use debugger, or ask user |
|
|
114
|
+
|
|
115
|
+
Never retry the same failed prompt unchanged.
|
|
116
|
+
|
|
117
|
+
## Failure Recovery
|
|
118
|
+
|
|
119
|
+
- First failed verification: record evidence, dispatch debugger with the smallest reproduced failure.
|
|
120
|
+
- Second same-class failure: narrow scope, update `PLAN.md#Heartbeat`, and add a reviewer before another fix.
|
|
121
|
+
- Third same-class failure: stop blind fixes. Present evidence-backed options to the user.
|
|
122
|
+
|
|
123
|
+
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.
|
|
124
|
+
|
|
125
|
+
## Synthesis Output
|
|
126
|
+
|
|
127
|
+
After subagents return, the controller writes one synthesis into `Harness/PLAN.md`:
|
|
128
|
+
|
|
129
|
+
```text
|
|
130
|
+
Agents used:
|
|
131
|
+
Findings accepted:
|
|
132
|
+
Findings rejected:
|
|
133
|
+
Conflicts:
|
|
134
|
+
Decisions:
|
|
135
|
+
Next write set:
|
|
136
|
+
Verification path:
|
|
137
|
+
Residual risk:
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Only the synthesis and named files enter main context. Do not replay full subagent conversations.
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
### v0.1 Must Be Able To
|
|
17
17
|
|
|
18
|
-
> Each item below must be split into a separate `
|
|
18
|
+
> Each item below must be split into a separate `Harness/features/<name>.md` created from `Harness/features/_template.md` before implementation begins. One feature = one doc = one implementation unit.
|
|
19
19
|
|
|
20
20
|
- [ ] {{MUST_1}}
|
|
21
21
|
- [ ] {{MUST_2}}
|
|
@@ -6,7 +6,7 @@ Purpose: guide agent research. Record conclusions in [research-results.md](resea
|
|
|
6
6
|
|
|
7
7
|
Use this before PRD, stack choice, external API use, public dependency choice, pricing/legal/security assumptions, or any fact likely to change.
|
|
8
8
|
|
|
9
|
-
Skip only when the task is local, narrow, and fully answerable from existing project files. Record the skip reason in `
|
|
9
|
+
Skip only when the task is local, narrow, and fully answerable from existing project files. Record the skip reason in `Harness/PLAN.md`.
|
|
10
10
|
|
|
11
11
|
## Research Agent
|
|
12
12
|
|
|
@@ -21,7 +21,7 @@ Built-in agents:
|
|
|
21
21
|
- `.claude/agents/researcher.md`: product, market, open-source, dependency, pricing, policy, and ecosystem research.
|
|
22
22
|
- `.claude/agents/docs-researcher.md`: official docs, API, SDK, config, limits, errors, and examples verification.
|
|
23
23
|
|
|
24
|
-
For multi-agent research plus build work, create the dispatch table in `
|
|
24
|
+
For multi-agent research plus build work, create the dispatch table in `Harness/PLAN.md` and follow `Harness/dispatch.md`.
|
|
25
25
|
|
|
26
26
|
Research Agent input:
|
|
27
27
|
|
|
@@ -104,14 +104,14 @@ Use these patterns when turning research into PRD or feature docs:
|
|
|
104
104
|
|
|
105
105
|
## Write Target
|
|
106
106
|
|
|
107
|
-
- Research process, queries, and limitations: this file or `
|
|
107
|
+
- Research process, queries, and limitations: this file or `Harness/PLAN.md`.
|
|
108
108
|
- Final research decisions: [research-results.md](research-results.md).
|
|
109
109
|
- Product scope: [PRD.md](PRD.md).
|
|
110
|
-
- Architecture consequences: `
|
|
110
|
+
- Architecture consequences: `Harness/architecture.md` and `Harness/domain/ports.md`.
|
|
111
111
|
|
|
112
112
|
## Architecture Decision References
|
|
113
113
|
|
|
114
|
-
When filling `
|
|
114
|
+
When filling `Harness/architecture.md`, `Harness/domain/ports.md`, and `Harness/research/research-results.md`, use these high-trust sources as starting points. Search within them; do not read them whole.
|
|
115
115
|
|
|
116
116
|
### System Design & Architecture Patterns
|
|
117
117
|
|