create-harness-vibe-coding 0.8.7 → 0.8.9
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 +163 -105
- package/README.md +179 -244
- package/bin/create-harness-vibe-coding.js +2 -2
- package/docs/images/harness-architecture-light.png +0 -0
- package/docs/images/harness-architecture.drawio +164 -0
- package/docs/images/harness-icon.png +0 -0
- package/package.json +47 -44
- package/src/generator.js +41 -5
- package/src/index.js +86 -13
- package/src/prompts.js +37 -37
- package/templates/common/.claude/agents/architect-manager.md +45 -45
- package/templates/common/.claude/agents/architect.md +31 -31
- package/templates/common/.claude/agents/codebase-explorer.md +45 -0
- package/templates/common/.claude/agents/context-master.md +75 -75
- package/templates/common/.claude/agents/debugger.md +41 -41
- package/templates/common/.claude/agents/docs-researcher.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 +82 -64
- 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/reviewer.md +34 -34
- package/templates/common/.claude/agents/task-scribe.md +70 -0
- package/templates/common/.claude/agents/verifier.md +29 -29
- package/templates/common/.claude/commands/wf-help.md +9 -5
- package/templates/common/.claude/commands/wf-update.md +24 -0
- package/templates/common/.claude/rules/ecc/common.md +57 -44
- package/templates/common/.claude/settings.json +13 -0
- package/templates/common/.claude/skills/subagent-orchestrator/SKILL.md +8 -4
- package/templates/common/.claude/skills/wf/SKILL.md +15 -8
- package/templates/common/.claude/skills/wf-auto/SKILL.md +10 -7
- package/templates/common/.claude/skills/wf-learn/SKILL.md +9 -2
- package/templates/common/.claude/skills/wf-max/SKILL.md +23 -5
- package/templates/common/.claude/skills/wf-readme/SKILL.md +49 -49
- package/templates/common/.claude/skills/wf-remove/SKILL.md +7 -7
- package/templates/common/.claude/skills/wf-update/SKILL.md +15 -2
- package/templates/common/.codex/hooks.json +17 -0
- package/templates/common/.harness-version +130 -45
- package/templates/common/.opencode/agents/architect-manager.md +52 -0
- package/templates/common/.opencode/agents/architect.md +35 -0
- package/templates/common/.opencode/agents/codebase-explorer.md +45 -0
- package/templates/common/.opencode/agents/context-master.md +81 -0
- package/templates/common/.opencode/agents/debugger.md +43 -0
- package/templates/common/.opencode/agents/docs-researcher.md +42 -0
- package/templates/common/.opencode/agents/explore-manager.md +49 -0
- package/templates/common/.opencode/agents/implement-manager.md +56 -0
- package/templates/common/.opencode/agents/implementer.md +42 -0
- package/templates/common/.opencode/agents/memory-master.md +88 -0
- package/templates/common/.opencode/agents/planner.md +38 -0
- package/templates/common/.opencode/agents/reflector.md +39 -0
- package/templates/common/.opencode/agents/researcher.md +42 -0
- package/templates/common/.opencode/agents/review-manager.md +63 -0
- package/templates/common/.opencode/agents/reviewer.md +37 -0
- package/templates/common/.opencode/agents/task-scribe.md +70 -0
- package/templates/common/.opencode/agents/tdd-guide.md +83 -0
- package/templates/common/.opencode/agents/test-writer.md +54 -0
- package/templates/common/.opencode/agents/verifier.md +37 -0
- package/templates/common/.opencode/commands/wf-auto-spark.md +15 -0
- package/templates/common/.opencode/commands/wf-auto.md +15 -0
- package/templates/common/.opencode/commands/wf-help.md +27 -0
- package/templates/common/.opencode/commands/wf-learn.md +15 -0
- package/templates/common/.opencode/commands/wf-max.md +15 -0
- package/templates/common/.opencode/commands/wf-readme.md +15 -0
- package/templates/common/.opencode/commands/wf-remove.md +15 -0
- package/templates/common/.opencode/commands/wf-review.md +15 -0
- package/templates/common/.opencode/commands/wf-update.md +24 -0
- package/templates/common/.opencode/commands/wf.md +15 -0
- package/templates/common/.opencode/plugins/harness-wf-status.mjs +135 -0
- package/templates/common/AGENTS.md +2 -29
- package/templates/common/CLAUDE.md +114 -88
- package/templates/common/Harness/ACCEPTANCE_PROTOCOL.md +2 -2
- package/templates/common/{MEMORY.md → Harness/MEMORY.md} +17 -4
- package/templates/common/Harness/MEMORY_PROTOCOL.md +80 -30
- package/templates/common/Harness/PROGRESS.md +17 -17
- package/templates/common/Harness/README.md +58 -19
- package/templates/common/{SETUP.md → Harness/SETUP.md} +278 -276
- package/templates/common/Harness/TASK_ARCHIVE.md +56 -0
- package/templates/common/Harness/WF-AUTO-ANGLES.md +170 -0
- package/templates/common/Harness/WF-AUTO-SPARK.md +10 -19
- package/templates/common/Harness/WF-AUTO.md +93 -167
- package/templates/common/Harness/WF-KERNEL.md +189 -0
- package/templates/common/Harness/WF-MAX.md +60 -328
- package/templates/common/Harness/WF-STATE.md +83 -0
- package/templates/common/Harness/WF.md +117 -237
- package/templates/common/Harness/agent-workflow.md +2 -2
- package/templates/common/Harness/architecture.md +124 -124
- package/templates/common/Harness/context-loading.md +111 -111
- package/templates/common/Harness/dispatch.md +43 -35
- package/templates/common/Harness/extension.md +66 -66
- package/templates/common/Harness/lifecycle.md +20 -20
- package/templates/common/Harness/research/PRD.md +56 -56
- package/templates/common/Harness/research/README.md +169 -169
- package/templates/common/Harness/research/research-results.md +66 -66
- package/templates/common/Harness/scripts/archive-tasks.mjs +239 -0
- package/templates/common/{scripts → Harness/scripts}/scan-clean.mjs +443 -416
- package/templates/common/{scripts → Harness/scripts}/validate-harness.mjs +691 -452
- package/templates/common/Harness/scripts/wf-auto-update-prompt.mjs +258 -0
- package/templates/common/{scripts → Harness/scripts}/wf-remove.mjs +56 -39
- package/templates/common/{scripts → Harness/scripts}/wf-update-check.mjs +632 -599
- package/templates/common/Harness/subagents.md +215 -214
- package/templates/common/Harness/tasks/_template/ARTIFACTS.md +2 -2
- package/templates/common/Harness/tasks/_template/NOTES.md +2 -2
- package/templates/common/Harness/tasks/_template/PLAN.md +5 -0
- package/templates/common/Harness/tasks/_template/STATE.json +23 -0
- package/templates/common/README.md +37 -37
- package/templates/common/memory/agent-lessons-patterns.md +22 -21
- package/templates/common/memory/routes.md +43 -0
- package/templates/common/memory/startup-hints.md +32 -0
- package/templates/common/memory/tool-usage-reflections.md +22 -21
- package/templates/common/memory/user-corrections-preferences.md +23 -21
- package/templates/common/opencode.json +19 -0
- package/templates/optional/catalog.json +49 -33
- package/templates/optional/skills/browser-e2e/.claude/skills/browser-e2e/SKILL.md +42 -42
- package/templates/optional/skills/browser-e2e/.claude/skills/wf-browser/SKILL.md +193 -193
- package/templates/optional/skills/browser-e2e/.opencode/commands/wf-browser.md +15 -0
- package/templates/optional/skills/browser-e2e/Harness/workflows/browser-e2e.md +48 -48
- package/templates/optional/skills/github-pr-review/.claude/skills/github-pr-review/SKILL.md +40 -40
- package/templates/optional/skills/github-pr-review/Harness/workflows/github-pr-review.md +28 -28
- package/templates/optional/skills/python-backend/.claude/skills/python-backend/SKILL.md +40 -40
- package/templates/optional/skills/python-backend/Harness/workflows/python-backend.md +34 -34
- package/templates/optional/skills/ts-react-frontend/.claude/skills/ts-react-frontend/SKILL.md +43 -43
- package/templates/optional/skills/ts-react-frontend/Harness/workflows/ts-react-frontend.md +34 -34
- package/templates/optional/skills/ui-ux-review/.claude/skills/ui-ux-review/SKILL.md +40 -40
- package/templates/optional/skills/ui-ux-review/Harness/workflows/ui-ux-review.md +26 -26
|
@@ -1,255 +1,135 @@
|
|
|
1
|
-
# WF Mode
|
|
1
|
+
# WF Mode — Dynamic Orchestration Kernel
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
user-triggered with `/wf`, `$wf`, `wf mode`, `workflow mode`, or `wk mode`.
|
|
3
|
+
`/wf` is a **dynamic workflow kernel**, not a fixed serial pipeline. The orchestrator (main agent) makes decisions, dispatches agents, synthesizes returns, and owns final acceptance. It does NOT do bulk source reading, log scraping, or task-state paperwork — those are delegated to appropriate subagents.
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
exploration, second planning, implementation, review, verification, and recovery
|
|
8
|
-
instead of stalling on the first obstacle.
|
|
5
|
+
WF is **explicit only**. Complexity does not auto-trigger WF.
|
|
9
6
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
## Shared Kernel
|
|
8
|
+
|
|
9
|
+
All WF variants (`/wf`, `/wf-max`, `/wf-auto`, `/wf-auto-spark`, `/wf-review`, `/wf-browser`) share the orchestration engine defined in [WF-KERNEL.md](WF-KERNEL.md). That file is the authoritative source for:
|
|
10
|
+
|
|
11
|
+
- Role / Model Matrix (which agent, which model tier, for which work)
|
|
12
|
+
- Dynamic ready-queue pseudocode
|
|
13
|
+
- Dispatch packet fields
|
|
14
|
+
- Task type → agent/skill routing
|
|
15
|
+
- Tier-aware acceptance gates
|
|
16
|
+
- State ownership rules (controller + task-scribe)
|
|
17
|
+
|
|
18
|
+
Resumable state follows [WF-STATE.md](WF-STATE.md): STATE.json is the machine-readable resume truth; the ready queue is persisted there across sessions.
|
|
19
|
+
|
|
20
|
+
This file defines the `/wf` user contract, tiers, and the standard orchestration loop.
|
|
16
21
|
|
|
17
22
|
## Trigger
|
|
18
23
|
|
|
19
|
-
Enter WF
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
`/wf-max`, `$wf-max`): role fan-out is mandatory and unconditional. File
|
|
36
|
-
count, task size, and subsystem count are irrelevant. A one-file task invoked
|
|
37
|
-
with WF still schedules the complete role chain before closeout.
|
|
38
|
-
- Auto-triggering decides whether the harness enters WF mode on its own. It can
|
|
39
|
-
only escalate into WF, never downgrade an explicit command out of WF.
|
|
40
|
-
|
|
41
|
-
## Complete Role Chain Requirement
|
|
42
|
-
|
|
43
|
-
WF mode requires the complete role chain by default.
|
|
44
|
-
|
|
45
|
-
Normative rule: Explicit `/wf`, `$wf`, `wf mode`, `workflow mode`, or `wk mode` MUST cover every mandatory role class before closeout: Plan, Research, Architecture, Test, Implement, Independent Validation, Cross-Review, Reflect, and Final Acceptance.
|
|
46
|
-
|
|
47
|
-
- Explicit `/wf`, `$wf`, `wf mode`, `workflow mode`, or `wk mode` MUST schedule
|
|
48
|
-
the complete role chain at intake. Use real subagents when the runtime
|
|
49
|
-
supports them; otherwise emulate those roles as bounded passes and record the
|
|
50
|
-
fallback.
|
|
51
|
-
- Mandatory role classes:
|
|
52
|
-
- Plan: `planner`
|
|
53
|
-
- Research: `researcher` or `docs-researcher`; use both when local and external/current facts matter
|
|
54
|
-
- Architecture: `architect`
|
|
55
|
-
- Test: `test-writer`
|
|
56
|
-
- Implement: `implementer` and `debugger` when needed
|
|
57
|
-
- Independent Validation: `verifier` records AC-mapped evidence before cross-review
|
|
58
|
-
- Cross-Review: at least two independent review lenses after implementation
|
|
59
|
-
- Reflect: `reflector`
|
|
60
|
-
- Final Acceptance: controller accepts only after cross-review passes and `reflector` returns PASS
|
|
61
|
-
- Runtime mapping:
|
|
62
|
-
- Claude Code: prefer subagents from `.claude/agents/`.
|
|
63
|
-
- Codex: prefer the available Codex subagent surface; if unavailable, use
|
|
64
|
-
bounded passes with the same roles and evidence contract.
|
|
65
|
-
- Collaboration decision tree (replaces the old "7:3" heuristic with concrete
|
|
66
|
-
conditions):
|
|
67
|
-
- Explicit WF/WK mode -> complete role chain, no exceptions.
|
|
68
|
-
- 3+ files changed -> complete role chain.
|
|
69
|
-
- Cross-layer change -> complete role chain plus separate architecture review.
|
|
70
|
-
- Uncertain scope or approach -> complete role chain with both researcher and architect passes.
|
|
71
|
-
- 1-2 files, well-understood, not in WF mode -> solo is acceptable.
|
|
72
|
-
- Repeated failure on the same task -> stop solo and switch to multi-role.
|
|
73
|
-
- Default `/wf` startup records the full chain in the task plan. Dependency-bound
|
|
74
|
-
roles run when their phase is ready; they are not optional.
|
|
75
|
-
|
|
76
|
-
## Exploration Gate
|
|
77
|
-
|
|
78
|
-
- [ ] Controller has not read source files directly; only Harness docs, root
|
|
79
|
-
agent entries, and subagent or bounded-pass returns.
|
|
80
|
-
- [ ] Complete role chain is scheduled in the task plan.
|
|
81
|
-
- [ ] Plan, Research, and Architecture role passes each have one specific question before second planning.
|
|
82
|
-
- [ ] Role passes were dispatched together when the runtime supports parallel
|
|
83
|
-
dispatch.
|
|
84
|
-
- [ ] Agent count is at least `max(3, ceil(estimated_dirs / 2))`; estimate from
|
|
85
|
-
prompt/docs and run a second wave if returns reveal more.
|
|
86
|
-
- [ ] Fallbacks are recorded in `Harness/tasks/<task-id>/PLAN.md`.
|
|
87
|
-
|
|
88
|
-
For maximum-parallelism mode (write-set coloring, wave dispatch, parallel
|
|
89
|
-
reviewers), use `/wf-max [task]` in Claude Code or `$wf-max [task]` in Codex and
|
|
90
|
-
see [WF-MAX.md](WF-MAX.md).
|
|
91
|
-
|
|
92
|
-
## WF Loop
|
|
24
|
+
WF is **explicit only**. Enter WF ONLY when the user explicitly types:
|
|
25
|
+
- `/wf`, `$wf`, `/skills wf`
|
|
26
|
+
|
|
27
|
+
These are NOT WF triggers:
|
|
28
|
+
- Multi-step work, multi-file changes, complexity, uncertainty, architecture scope, browser/API behavior, repeated failure
|
|
29
|
+
- Those may need planning, subagents, or tests — but not WF
|
|
30
|
+
|
|
31
|
+
## Memory Preflight
|
|
32
|
+
|
|
33
|
+
1. Load `CLAUDE.md`, `Harness/MEMORY.md` index only, then `Harness/README.md`.
|
|
34
|
+
2. Load `Harness/memory/*` only when `MEMORY_PROTOCOL.md` scenario hints match.
|
|
35
|
+
3. Record `Memory preflight: done` and `Memory hints: none | <file/path + reason>`.
|
|
36
|
+
|
|
37
|
+
## Standard Orchestration Loop
|
|
38
|
+
|
|
39
|
+
The `/wf` kernel follows a dependency-driven ready-queue, NOT a fixed serial phase list.
|
|
93
40
|
|
|
94
41
|
```text
|
|
95
42
|
Intake
|
|
96
|
-
->
|
|
97
|
-
->
|
|
98
|
-
-> Mini PRD
|
|
99
|
-
->
|
|
100
|
-
->
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
43
|
+
-> Understand user goal; ask <=3 blocking decision questions (each with recommendation)
|
|
44
|
+
-> Requirement analysis: scope, non-goals, risks, acceptance direction
|
|
45
|
+
-> Mini PRD (compact, not a large document)
|
|
46
|
+
-> 1-3 ACs (expand only for high-risk triggers)
|
|
47
|
+
-> Plan: task split, dependencies, readSet/writeSet, verification commands, subagent dispatch
|
|
48
|
+
|
|
49
|
+
// Ready-queue dispatch (NOT serial phase)
|
|
50
|
+
while task not accepted:
|
|
51
|
+
update readyQueue from dependency graph
|
|
52
|
+
|
|
53
|
+
// Read-only and chore — always parallel when ready
|
|
54
|
+
dispatch codebase-explorer(s) for scoped source reading
|
|
55
|
+
dispatch docs-researcher / researcher as needed
|
|
56
|
+
dispatch planner for decomposition (unless already done)
|
|
57
|
+
dispatch task-scribe alongside any work
|
|
58
|
+
|
|
59
|
+
// Write gate
|
|
60
|
+
for each independent writeSet:
|
|
61
|
+
dispatch implementer (one file_claim each)
|
|
62
|
+
when wave complete: dispatch verifier
|
|
63
|
+
|
|
64
|
+
// Review gate — wave-level, not end-of-task
|
|
65
|
+
when verifier evidence exists for a wave:
|
|
66
|
+
dispatch reviewer(s) on that wave
|
|
67
|
+
|
|
68
|
+
// Fix gate — on-demand
|
|
69
|
+
if review finding or failed AC:
|
|
70
|
+
dispatch debugger or implementer (smallest fix)
|
|
71
|
+
re-run verifier
|
|
72
|
+
|
|
73
|
+
// Reflect gate — WF-Full only or risk-triggered
|
|
74
|
+
if WF-Full or unresolved contradiction:
|
|
75
|
+
dispatch reflector
|
|
76
|
+
|
|
77
|
+
// Closeout
|
|
78
|
+
task-scribe records final state
|
|
79
|
+
if durable lesson: context-master -> memory-master
|
|
80
|
+
|
|
81
|
+
stop on: accepted | blocked | user decision required
|
|
110
82
|
```
|
|
111
83
|
|
|
112
|
-
##
|
|
84
|
+
## WF Tiers
|
|
113
85
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
86
|
+
### WF-Light
|
|
87
|
+
1-2 files, well-understood, low risk.
|
|
88
|
+
- planner + test-writer + implementer + verifier
|
|
89
|
+
- task-scribe maintains state
|
|
90
|
+
- codebase-explorer optional
|
|
91
|
+
- **Acceptance**: verification passes = closeout
|
|
92
|
+
- Cross-review and reflector NOT mandatory
|
|
93
|
+
|
|
94
|
+
### WF-Standard
|
|
95
|
+
Multi-file or behavior change.
|
|
96
|
+
- WF-Light baseline + research/docs + at least one independent review lens
|
|
97
|
+
- Parallel: codebase-explorer(s), docs-researcher/researcher, planner, task-scribe
|
|
98
|
+
- **Acceptance**: verifier evidence + one review PASS = closeout
|
|
99
|
+
- Reflector: only when risk, contradiction, or high impact triggers
|
|
100
|
+
|
|
101
|
+
### WF-Full
|
|
102
|
+
High-risk, cross-layer, security/data-loss, browser/API acceptance, ambiguous architecture.
|
|
103
|
+
- Full chain per [WF-KERNEL.md](WF-KERNEL.md) Role/Model Matrix
|
|
104
|
+
- **Acceptance**: cross-review PASS + reflector PASS
|
|
105
|
+
|
|
106
|
+
## State Ownership
|
|
107
|
+
|
|
108
|
+
Per [WF-KERNEL.md](WF-KERNEL.md):
|
|
109
|
+
- **Controller** (main agent): decisions, decomposition, synthesis, final verification
|
|
110
|
+
- **task-scribe** (haiku): writes task state (PLAN, PROGRESS, ARTIFACTS, NOTES). Controller supplies structured updates; task-scribe formats and writes.
|
|
111
|
+
- **Production source agents**: write ONLY their assigned writeSet. Never write task state.
|
|
123
112
|
|
|
124
113
|
## Exploration
|
|
125
114
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
Use `Harness/subagents.md` as the orchestration methodology and
|
|
144
|
-
`Harness/dispatch.md` as the dispatch table protocol.
|
|
145
|
-
|
|
146
|
-
- The main agent is the controller and owns synthesis, integration, and final
|
|
147
|
-
verification.
|
|
148
|
-
- Subagents are readers and reporters. Only the main agent writes task
|
|
149
|
-
`PROGRESS.md` and `PLAN.md`.
|
|
150
|
-
- Parallelize read-only exploration; serialize writers unless write sets are
|
|
151
|
-
disjoint and isolated.
|
|
152
|
-
- Every role gets a dispatch pack with role, goal, mode, read set, write set,
|
|
153
|
-
forbidden scope, injected docs, evidence, stop condition, and return format.
|
|
154
|
-
- After implementation, run spec review before code-quality or architecture
|
|
155
|
-
review.
|
|
156
|
-
- If subagents are unavailable, emulate the same roles as bounded passes and
|
|
157
|
-
record the fallback.
|
|
158
|
-
|
|
159
|
-
## Second Plan
|
|
160
|
-
|
|
161
|
-
After exploration, synthesize facts found, assumptions, risks,
|
|
162
|
-
accepted/rejected options, Mini PRD, AC IDs, UI/API contracts, tasks,
|
|
163
|
-
read/write sets, verification path, and rollback or recovery plan.
|
|
164
|
-
|
|
165
|
-
Write the result to `Harness/tasks/<task-id>/PLAN.md` before implementation.
|
|
166
|
-
Update `Harness/tasks/<task-id>/PROGRESS.md#Heartbeat`.
|
|
167
|
-
|
|
168
|
-
The second plan must pass:
|
|
169
|
-
|
|
170
|
-
- PRD-GATE: goal, scope, non-scope, user flow, and verification commands exist.
|
|
171
|
-
- AC-GATE: each behavior has an AC ID and Given/When/Then.
|
|
172
|
-
- CONTRACT-GATE: UI/API/state contracts exist when the feature touches UI/API/state.
|
|
173
|
-
- TEST-GATE: verification commands and test levels map to AC IDs.
|
|
174
|
-
- IMPLEMENT-GATE: implementer forbidden set includes PRD, AC, UI/API contracts, test plan, and validation report unless a Change Request is approved.
|
|
175
|
-
|
|
176
|
-
## Build And Review
|
|
177
|
-
|
|
178
|
-
1. `test-writer` defines failing tests or written manual checks from AC IDs and contracts first.
|
|
179
|
-
2. `implementer` changes only the declared write set and may not edit truth files without Change Request.
|
|
180
|
-
3. `verifier` or independent validator runs AC-mapped checks against running behavior and records an evidence matrix before cross-review.
|
|
181
|
-
4. Cross-review is mandatory: at least two independent review lenses must pass before acceptance.
|
|
182
|
-
- Spec/AC review checks request, scope, contracts, and non-goals.
|
|
183
|
-
- Code/architecture/test review checks implementation risk, maintainability, security, and verification adequacy.
|
|
184
|
-
5. `reflector` reads verifier evidence and reviewer findings, resolves contradictions with the controller, and returns PASS before final acceptance.
|
|
185
|
-
6. For cross-layer or risky work, run separate reviewers for spec/AC compliance, architecture, security, and test adequacy.
|
|
186
|
-
|
|
187
|
-
## Browser And API Evidence
|
|
188
|
-
|
|
189
|
-
For browser-visible changes, typecheck/build/unit tests are not enough. Use
|
|
190
|
-
Chrome DevTools, CDP, Playwright, or a documented real-browser run:
|
|
191
|
-
|
|
192
|
-
- start the app and record URL/port
|
|
193
|
-
- click through the critical flow
|
|
194
|
-
- capture frontend console/runtime errors
|
|
195
|
-
- capture failed network requests
|
|
196
|
-
- collect backend logs when the flow crosses an API
|
|
197
|
-
- record screenshot, trace, video, or manual evidence path
|
|
198
|
-
- produce an AC-by-AC acceptance result matrix
|
|
199
|
-
- for frontend-backend paths, check UI selectors and API behavior against `HARNESS_BRIDGE.md`
|
|
200
|
-
|
|
201
|
-
For API changes, run the project API/integration test path or a documented real
|
|
202
|
-
request against a local service and record request, response, logs, and failure
|
|
203
|
-
behavior.
|
|
204
|
-
|
|
205
|
-
## Recovery Loop
|
|
206
|
-
|
|
207
|
-
If verification fails:
|
|
208
|
-
|
|
209
|
-
1. Update `Harness/tasks/<task-id>/PROGRESS.md#Heartbeat` with failure count
|
|
210
|
-
and blocker.
|
|
211
|
-
2. Dispatch `debugger` with the failed AC ID, failing command, error output,
|
|
212
|
-
trace/screenshot/network evidence, and smallest relevant files.
|
|
213
|
-
3. Classify the failure layer using [DEBUG_PROTOCOL.md](DEBUG_PROTOCOL.md), then fix the smallest reproduced failure.
|
|
214
|
-
4. Run verifier again and record fresh AC-mapped evidence.
|
|
215
|
-
5. Run cross-review again.
|
|
216
|
-
6. Run reflector again.
|
|
217
|
-
7. Repeat until verified or blocked by missing user input/external state.
|
|
218
|
-
|
|
219
|
-
Before asking the user after repeated failures, run the context-master then
|
|
220
|
-
memory-master learning cycle or use `wf-learn`.
|
|
221
|
-
|
|
222
|
-
## Heartbeat Protocol
|
|
223
|
-
|
|
224
|
-
Heartbeat is a lightweight recovery protocol, not a background daemon.
|
|
225
|
-
Keep heartbeat entries to one or two lines: phase, blocker/failure, next action,
|
|
226
|
-
and evidence pointer. Do not paste command logs or subagent transcripts.
|
|
227
|
-
|
|
228
|
-
Update `Harness/tasks/<task-id>/PROGRESS.md#Heartbeat`:
|
|
229
|
-
|
|
230
|
-
- before a long command
|
|
231
|
-
- after a long command
|
|
232
|
-
- before spawning subagents or bounded passes
|
|
233
|
-
- after integrating returns
|
|
234
|
-
- after each failed verification
|
|
235
|
-
- before stopping for user input
|
|
236
|
-
|
|
237
|
-
When context approaches about 85% of the window, run context-master or the
|
|
238
|
-
equivalent bounded pass to append a compression suggestion to the task heartbeat.
|
|
115
|
+
Controller delegates source reading to subagents. Controller does NOT read source files directly before dispatch.
|
|
116
|
+
|
|
117
|
+
First wave — dispatch in parallel:
|
|
118
|
+
- codebase-explorer(s): scoped source discovery
|
|
119
|
+
- planner: decomposition, dependencies, writeSet
|
|
120
|
+
- researcher / docs-researcher: external context as needed
|
|
121
|
+
- task-scribe: compact heartbeat and dispatch ledger
|
|
122
|
+
|
|
123
|
+
Second wave — after synthesis:
|
|
124
|
+
- architect (if cross-layer or architecture risk)
|
|
125
|
+
- test-writer: failing tests from AC IDs
|
|
126
|
+
|
|
127
|
+
## Browser and API Evidence
|
|
128
|
+
|
|
129
|
+
See [HARNESS_BRIDGE.md](HARNESS_BRIDGE.md) and [WF-KERNEL.md](WF-KERNEL.md) Task Type Routing for UI/browser and API/backend task types.
|
|
130
|
+
|
|
131
|
+
Agents live under `.claude/agents/` and `.opencode/agents/`. Task state lives under `Harness/tasks/<task-id>/`.
|
|
239
132
|
|
|
240
133
|
## Closeout
|
|
241
134
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
- PRD-GATE, AC-GATE, CONTRACT-GATE, TEST-GATE, VALIDATION-GATE, REVIEW-GATE, and REFLECT-GATE are satisfied
|
|
245
|
-
- acceptance criteria are satisfied and reported by AC ID
|
|
246
|
-
- cross-review has passed with no unresolved critical/high findings
|
|
247
|
-
- reflector verdict is PASS
|
|
248
|
-
- test/API/browser evidence is recorded
|
|
249
|
-
- affected Harness docs are synced
|
|
250
|
-
- context-master has analyzed the session and extracted durable knowledge
|
|
251
|
-
- memory-master has consolidated extracted knowledge into `Harness/memory/*`
|
|
252
|
-
- current task PROGRESS.md and PLAN.md are archived under `Harness/tasks/<task-id>/`
|
|
253
|
-
with Phase set to Verified
|
|
254
|
-
- `Harness/PROGRESS.md` task index is updated and Active Task is cleared or set
|
|
255
|
-
to the next task
|
|
135
|
+
Closeout is tier-aware. WF-Light: verification + task state update = done. WF-Full: full gate chain per [WF-KERNEL.md](WF-KERNEL.md).
|
|
@@ -118,8 +118,8 @@ Use [subagents.md](subagents.md) and [dispatch.md](dispatch.md) for multi-agent
|
|
|
118
118
|
| Mode | Agent Count Rule | Source |
|
|
119
119
|
|------|-----------------|--------|
|
|
120
120
|
| Default (non-WF) | up to 3 active agents by default | This file |
|
|
121
|
-
| `/wf` |
|
|
122
|
-
| `/wf
|
|
121
|
+
| `/wf` | WF-KERNEL tier selection (Light/Standard/Full) by risk and scope; full role chain only at WF-Full | [WF.md](WF.md) |
|
|
122
|
+
| `/wf-max` | WF kernel plus maximum useful fan-out (WF-Max-Useful default; WF-Max-Strict explicit only) | [WF-MAX.md](WF-MAX.md) |
|
|
123
123
|
|
|
124
124
|
Prefer parallel read-only work first, then serial writes.
|
|
125
125
|
|
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
# Harness Architecture - create-harness-vibe-coding
|
|
2
|
-
|
|
3
|
-
> **Responsibility**: Define the repository structure and scaffold generation boundaries.
|
|
4
|
-
> **Does NOT cover**: Generated target-project business architecture.
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## 1. Layering Rules
|
|
9
|
-
|
|
10
|
-
```text
|
|
11
|
-
bin/
|
|
12
|
-
CLI executable shim. Calls src/index.js.
|
|
13
|
-
|
|
14
|
-
src/
|
|
15
|
-
CLI orchestration and scaffold generation logic.
|
|
16
|
-
May read templates/ and write the chosen target directory.
|
|
17
|
-
|
|
18
|
-
templates/
|
|
19
|
-
Source of generated scaffold assets.
|
|
20
|
-
Must stay declarative: markdown, skill files, agent files, scripts, and optional workflow docs.
|
|
21
|
-
|
|
22
|
-
Harness/ and .claude/
|
|
23
|
-
Dogfood runtime for this repository's own agent work.
|
|
24
|
-
Must not be treated as package source unless intentionally copied into templates/.
|
|
25
|
-
|
|
26
|
-
tests/
|
|
27
|
-
Node test suite for CLI behavior, generator behavior, package contents, and generated harness validation.
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
Hard constraints:
|
|
31
|
-
|
|
32
|
-
- `templates/common/**` and `templates/optional/**` are the source of generated output.
|
|
33
|
-
- Root `Harness/**` is this repository's operating harness; changing it does not change generated projects.
|
|
34
|
-
- Generated output paths are normalized by `harnessDest()` in `src/generator.js`.
|
|
35
|
-
- Existing-project safety is owned by conflict planning in `src/generator.js`, not by template prose alone.
|
|
36
|
-
- Package publication is constrained by `package.json#files`; root dogfood files are not package contents.
|
|
37
|
-
|
|
38
|
-
## 2. Interface Decoupling
|
|
39
|
-
|
|
40
|
-
Use interfaces and module boundaries to protect real seams in the generator, not to decorate straightforward code.
|
|
41
|
-
|
|
42
|
-
- `src/index.js` owns CLI/user interaction; `src/generator.js` owns planning and file writes.
|
|
43
|
-
- Template files are declarative inputs; source code should not depend on root dogfood `Harness/**`.
|
|
44
|
-
- Optional catalog structure is the extension contract for presets and optional skills.
|
|
45
|
-
- Avoid speculative abstraction: do not add plugin systems, generic runners, extra config layers, or service containers until a real second use or testability boundary exists.
|
|
46
|
-
- When a boundary is real, express it with a small data contract and test it through generated output behavior.
|
|
47
|
-
|
|
48
|
-
## 3. State Design
|
|
49
|
-
|
|
50
|
-
State in this repo should be explicit, serializable, and owned by one layer.
|
|
51
|
-
|
|
52
|
-
- Generator plan state is computed in memory and returned as `plan`/`summary`; file writes consume that plan instead of re-deciding conflicts.
|
|
53
|
-
- Filesystem state is authoritative only through existence/type checks and write results.
|
|
54
|
-
- Optional selection state comes from CLI flags plus `templates/optional/catalog.json`; do not duplicate it in template prose.
|
|
55
|
-
- Release state lives in `package.json`, npm, git tags, and GitHub; document commands in `README.md`, not `CLAUDE.md`.
|
|
56
|
-
- Long-running agent work records resumable status in `Harness/tasks/<task-id>/PLAN.md#Heartbeat`.
|
|
57
|
-
|
|
58
|
-
## 4. Core Components
|
|
59
|
-
|
|
60
|
-
### 4.1 CLI Entry
|
|
61
|
-
|
|
62
|
-
- **Location**: `bin/create-harness-vibe-coding.js`, `src/index.js`
|
|
63
|
-
- **Responsibility**: Parse flags, handle interactive/non-interactive modes, print plans/results, and call the generator.
|
|
64
|
-
- **Does NOT handle**: Template walking, conflict classification, or file writing internals.
|
|
65
|
-
|
|
66
|
-
### 4.2 Prompt Layer
|
|
67
|
-
|
|
68
|
-
- **Location**: `src/prompts.js`
|
|
69
|
-
- **Responsibility**: Ask basic interactive npx questions: project name and target directory.
|
|
70
|
-
- **Does NOT handle**: Agent-link install intake. That matrix is read by coding agents from `README.md` and `Harness/SETUP.md`.
|
|
71
|
-
|
|
72
|
-
### 4.3 Generator Core
|
|
73
|
-
|
|
74
|
-
- **Location**: `src/generator.js`
|
|
1
|
+
# Harness Architecture - create-harness-vibe-coding
|
|
2
|
+
|
|
3
|
+
> **Responsibility**: Define the repository structure and scaffold generation boundaries.
|
|
4
|
+
> **Does NOT cover**: Generated target-project business architecture.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 1. Layering Rules
|
|
9
|
+
|
|
10
|
+
```text
|
|
11
|
+
bin/
|
|
12
|
+
CLI executable shim. Calls src/index.js.
|
|
13
|
+
|
|
14
|
+
src/
|
|
15
|
+
CLI orchestration and scaffold generation logic.
|
|
16
|
+
May read templates/ and write the chosen target directory.
|
|
17
|
+
|
|
18
|
+
templates/
|
|
19
|
+
Source of generated scaffold assets.
|
|
20
|
+
Must stay declarative: markdown, skill files, agent files, scripts, and optional workflow docs.
|
|
21
|
+
|
|
22
|
+
Harness/ and .claude/
|
|
23
|
+
Dogfood runtime for this repository's own agent work.
|
|
24
|
+
Must not be treated as package source unless intentionally copied into templates/.
|
|
25
|
+
|
|
26
|
+
tests/
|
|
27
|
+
Node test suite for CLI behavior, generator behavior, package contents, and generated harness validation.
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Hard constraints:
|
|
31
|
+
|
|
32
|
+
- `templates/common/**` and `templates/optional/**` are the source of generated output.
|
|
33
|
+
- Root `Harness/**` is this repository's operating harness; changing it does not change generated projects.
|
|
34
|
+
- Generated output paths are normalized by `harnessDest()` in `src/generator.js`.
|
|
35
|
+
- Existing-project safety is owned by conflict planning in `src/generator.js`, not by template prose alone.
|
|
36
|
+
- Package publication is constrained by `package.json#files`; root dogfood files are not package contents.
|
|
37
|
+
|
|
38
|
+
## 2. Interface Decoupling
|
|
39
|
+
|
|
40
|
+
Use interfaces and module boundaries to protect real seams in the generator, not to decorate straightforward code.
|
|
41
|
+
|
|
42
|
+
- `src/index.js` owns CLI/user interaction; `src/generator.js` owns planning and file writes.
|
|
43
|
+
- Template files are declarative inputs; source code should not depend on root dogfood `Harness/**`.
|
|
44
|
+
- Optional catalog structure is the extension contract for presets and optional skills.
|
|
45
|
+
- Avoid speculative abstraction: do not add plugin systems, generic runners, extra config layers, or service containers until a real second use or testability boundary exists.
|
|
46
|
+
- When a boundary is real, express it with a small data contract and test it through generated output behavior.
|
|
47
|
+
|
|
48
|
+
## 3. State Design
|
|
49
|
+
|
|
50
|
+
State in this repo should be explicit, serializable, and owned by one layer.
|
|
51
|
+
|
|
52
|
+
- Generator plan state is computed in memory and returned as `plan`/`summary`; file writes consume that plan instead of re-deciding conflicts.
|
|
53
|
+
- Filesystem state is authoritative only through existence/type checks and write results.
|
|
54
|
+
- Optional selection state comes from CLI flags plus `templates/optional/catalog.json`; do not duplicate it in template prose.
|
|
55
|
+
- Release state lives in `package.json`, npm, git tags, and GitHub; document commands in `README.md`, not `CLAUDE.md`.
|
|
56
|
+
- Long-running agent work records resumable status in `Harness/tasks/<task-id>/PLAN.md#Heartbeat`.
|
|
57
|
+
|
|
58
|
+
## 4. Core Components
|
|
59
|
+
|
|
60
|
+
### 4.1 CLI Entry
|
|
61
|
+
|
|
62
|
+
- **Location**: `bin/create-harness-vibe-coding.js`, `src/index.js`
|
|
63
|
+
- **Responsibility**: Parse flags, handle interactive/non-interactive modes, print plans/results, and call the generator.
|
|
64
|
+
- **Does NOT handle**: Template walking, conflict classification, or file writing internals.
|
|
65
|
+
|
|
66
|
+
### 4.2 Prompt Layer
|
|
67
|
+
|
|
68
|
+
- **Location**: `src/prompts.js`
|
|
69
|
+
- **Responsibility**: Ask basic interactive npx questions: project name and target directory.
|
|
70
|
+
- **Does NOT handle**: Agent-link install intake. That matrix is read by coding agents from `README.md` and `Harness/SETUP.md`.
|
|
71
|
+
|
|
72
|
+
### 4.3 Generator Core
|
|
73
|
+
|
|
74
|
+
- **Location**: `src/generator.js`
|
|
75
75
|
- **Responsibility**: Resolve optional selections, keep Harness-owned template paths under `Harness/**`, detect conflicts, render templates, register optional workflows, and write files.
|
|
76
|
-
- **Critical functions**:
|
|
76
|
+
- **Critical functions**:
|
|
77
77
|
- `harnessDest()` keeps root entry files at root and Harness-owned files under generated root `Harness/*`.
|
|
78
|
-
- `createPlan()` and `addFileActions()` classify directories and file actions before writes.
|
|
79
|
-
- `registerOptionalContent()` updates generated router/memory docs when optional workflows are selected.
|
|
80
|
-
|
|
81
|
-
### 4.4 Template Assets
|
|
82
|
-
|
|
83
|
-
- **Location**: `templates/common/**`, `templates/optional/**`
|
|
84
|
-
- **Responsibility**: Define generated `CLAUDE.md`, `AGENTS.md`, `README.md`, `Harness/**`, `.claude/**`, optional skills, and optional workflows.
|
|
85
|
-
- **Does NOT handle**: Existing-project decisions. Templates state contracts; generator and agents apply them safely.
|
|
86
|
-
|
|
87
|
-
### 4.5 Validator
|
|
88
|
-
|
|
89
|
-
- **Source template**: `templates/common/scripts/validate-harness.mjs`
|
|
90
|
-
- **Generated location**: `Harness/scripts/validate-harness.mjs`
|
|
91
|
-
- **Responsibility**: Validate required scaffold files, skill/agent registrations, router invariants, optional workflow registrations, and strict project-fact placeholders.
|
|
92
|
-
|
|
93
|
-
### 4.6 Dogfood Runtime
|
|
94
|
-
|
|
95
|
-
- **Location**: root `Harness/**`, `.claude/**`, `CLAUDE.md`, `AGENTS.md`, `MEMORY.md`
|
|
96
|
-
- **Responsibility**: Govern future AI-agent work in this repository.
|
|
97
|
-
- **Does NOT handle**: Changing package output unless edits are made to `templates/**` or source code.
|
|
98
|
-
|
|
99
|
-
## 5. Data Flow
|
|
100
|
-
|
|
101
|
-
```text
|
|
102
|
-
CLI args / prompts
|
|
103
|
-
-> src/index.js parse and display
|
|
104
|
-
-> src/generator.js resolve optional catalog
|
|
105
|
-
-> walk templates/common and selected templates/optional
|
|
106
|
-
-> harnessDest maps source paths to generated destinations
|
|
107
|
-
-> createPlan/addFileActions classify create/skip/backup/overwrite/conflict
|
|
108
|
-
-> renderTemplate substitutes projectName
|
|
109
|
-
-> registerOptionalContent updates generated Harness router/memory
|
|
110
|
-
-> write files or return dry-run/json plan
|
|
111
|
-
-> tests and generated validator verify behavior
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
## 6. Architectural Constraints
|
|
115
|
-
|
|
116
|
-
- Do not add generated-output behavior by editing only root `Harness/`; edit `templates/common/**` or `templates/optional/**`.
|
|
117
|
-
- Do not add user-facing CLI behavior without tests in `tests/cli-smoke.test.js` or `tests/generator.test.js`.
|
|
118
|
-
- Do not add required generated files without updating `templates/common/scripts/validate-harness.mjs` and relevant tests.
|
|
119
|
-
- Do not write Harness docs into generated `docs/`; `Harness/` is the generated root for harness-owned docs.
|
|
120
|
-
- Do not make root `CLAUDE.md` a dumping ground for build commands, architecture, or release process.
|
|
121
|
-
|
|
122
|
-
## 7. Known Follow-Up Risks
|
|
123
|
-
|
|
124
|
-
- Interactive confirmation currently happens before full conflict-plan display in interactive mode.
|
|
125
|
-
- Some README tests assert exact prose and can be made more structural.
|
|
126
|
-
- `subagent-orchestrator` routing priority should continue to be tightened in templates.
|
|
78
|
+
- `createPlan()` and `addFileActions()` classify directories and file actions before writes.
|
|
79
|
+
- `registerOptionalContent()` updates generated router/memory docs when optional workflows are selected.
|
|
80
|
+
|
|
81
|
+
### 4.4 Template Assets
|
|
82
|
+
|
|
83
|
+
- **Location**: `templates/common/**`, `templates/optional/**`
|
|
84
|
+
- **Responsibility**: Define generated `CLAUDE.md`, `AGENTS.md`, `README.md`, `Harness/**`, `.claude/**`, optional skills, and optional workflows.
|
|
85
|
+
- **Does NOT handle**: Existing-project decisions. Templates state contracts; generator and agents apply them safely.
|
|
86
|
+
|
|
87
|
+
### 4.5 Validator
|
|
88
|
+
|
|
89
|
+
- **Source template**: `templates/common/scripts/validate-harness.mjs`
|
|
90
|
+
- **Generated location**: `Harness/scripts/validate-harness.mjs`
|
|
91
|
+
- **Responsibility**: Validate required scaffold files, skill/agent registrations, router invariants, optional workflow registrations, and strict project-fact placeholders.
|
|
92
|
+
|
|
93
|
+
### 4.6 Dogfood Runtime
|
|
94
|
+
|
|
95
|
+
- **Location**: root `Harness/**`, `.claude/**`, `CLAUDE.md`, `AGENTS.md`, `MEMORY.md`
|
|
96
|
+
- **Responsibility**: Govern future AI-agent work in this repository.
|
|
97
|
+
- **Does NOT handle**: Changing package output unless edits are made to `templates/**` or source code.
|
|
98
|
+
|
|
99
|
+
## 5. Data Flow
|
|
100
|
+
|
|
101
|
+
```text
|
|
102
|
+
CLI args / prompts
|
|
103
|
+
-> src/index.js parse and display
|
|
104
|
+
-> src/generator.js resolve optional catalog
|
|
105
|
+
-> walk templates/common and selected templates/optional
|
|
106
|
+
-> harnessDest maps source paths to generated destinations
|
|
107
|
+
-> createPlan/addFileActions classify create/skip/backup/overwrite/conflict
|
|
108
|
+
-> renderTemplate substitutes projectName
|
|
109
|
+
-> registerOptionalContent updates generated Harness router/memory
|
|
110
|
+
-> write files or return dry-run/json plan
|
|
111
|
+
-> tests and generated validator verify behavior
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## 6. Architectural Constraints
|
|
115
|
+
|
|
116
|
+
- Do not add generated-output behavior by editing only root `Harness/`; edit `templates/common/**` or `templates/optional/**`.
|
|
117
|
+
- Do not add user-facing CLI behavior without tests in `tests/cli-smoke.test.js` or `tests/generator.test.js`.
|
|
118
|
+
- Do not add required generated files without updating `templates/common/scripts/validate-harness.mjs` and relevant tests.
|
|
119
|
+
- Do not write Harness docs into generated `docs/`; `Harness/` is the generated root for harness-owned docs.
|
|
120
|
+
- Do not make root `CLAUDE.md` a dumping ground for build commands, architecture, or release process.
|
|
121
|
+
|
|
122
|
+
## 7. Known Follow-Up Risks
|
|
123
|
+
|
|
124
|
+
- Interactive confirmation currently happens before full conflict-plan display in interactive mode.
|
|
125
|
+
- Some README tests assert exact prose and can be made more structural.
|
|
126
|
+
- `subagent-orchestrator` routing priority should continue to be tightened in templates.
|