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
@@ -34,41 +34,51 @@ Two distinct trigger classes; do not conflate them:
34
34
  - Explicit invocation (`/wf`, `$wf`, `wf mode`, `workflow mode`, `wk mode`,
35
35
  `/wf-max`, `$wf-max`): role fan-out is mandatory and unconditional. File
36
36
  count, task size, and subsystem count are irrelevant. A one-file task invoked
37
- with WF still uses at least three role passes before the second plan.
37
+ with WF still schedules the complete role chain before closeout.
38
38
  - Auto-triggering decides whether the harness enters WF mode on its own. It can
39
39
  only escalate into WF, never downgrade an explicit command out of WF.
40
40
 
41
- ## Multi-Subagent Requirement
42
-
43
- WF mode requires multi-subagent orchestration by default.
44
-
45
- Normative rule: Explicit `/wf`, `$wf`, `wf mode`, `workflow mode`, or `wk mode` MUST use at least 3 distinct role passes before second planning.
46
-
47
- - Explicit `/wf`, `$wf`, `wf mode`, `workflow mode`, or `wk mode` MUST use at
48
- least 3 distinct role passes before second planning. Use real subagents when
49
- the runtime supports them; otherwise emulate those roles as bounded passes and
50
- record the fallback.
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
51
61
  - Runtime mapping:
52
62
  - Claude Code: prefer subagents from `.claude/agents/`.
53
63
  - Codex: prefer the available Codex subagent surface; if unavailable, use
54
64
  bounded passes with the same roles and evidence contract.
55
65
  - Collaboration decision tree (replaces the old "7:3" heuristic with concrete
56
66
  conditions):
57
- - Explicit WF/WK mode -> always multi-role, no exceptions.
58
- - 3+ files changed -> multi-role at minimum: planner, implementer, reviewer.
59
- - Cross-layer change -> architect plus implementers plus reviewer.
60
- - Uncertain scope or approach -> planner plus researcher plus architect.
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.
61
71
  - 1-2 files, well-understood, not in WF mode -> solo is acceptable.
62
72
  - Repeated failure on the same task -> stop solo and switch to multi-role.
63
- - Default initial fan-out: `planner`, `researcher` or `docs-researcher`, and
64
- `architect`. Add `test-writer`, `reviewer`, `debugger`, or `verifier` when
65
- the phase needs them.
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.
66
75
 
67
76
  ## Exploration Gate
68
77
 
69
78
  - [ ] Controller has not read source files directly; only Harness docs, root
70
79
  agent entries, and subagent or bounded-pass returns.
71
- - [ ] At least 3 distinct role types, each with one specific question.
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.
72
82
  - [ ] Role passes were dispatched together when the runtime supports parallel
73
83
  dispatch.
74
84
  - [ ] Agent count is at least `max(3, ceil(estimated_dirs / 2))`; estimate from
@@ -93,8 +103,9 @@ Intake
93
103
  -> test-writer
94
104
  -> implementer
95
105
  -> independent validator
96
- -> reviewers
97
- -> if failed: debugger -> review -> e2e/API validation -> loop
106
+ -> cross-review: spec/AC reviewer + code/architecture/test reviewer
107
+ -> reflector
108
+ -> if failed: debugger -> verifier -> cross-review -> reflector -> loop
98
109
  -> memory closeout with evidence
99
110
  ```
100
111
 
@@ -166,9 +177,12 @@ The second plan must pass:
166
177
 
167
178
  1. `test-writer` defines failing tests or written manual checks from AC IDs and contracts first.
168
179
  2. `implementer` changes only the declared write set and may not edit truth files without Change Request.
169
- 3. `verifier` or independent validator runs AC-mapped checks against running behavior and records an acceptance result matrix.
170
- 4. At least one `reviewer` checks diff, architecture, risks, missing tests, and AC traceability.
171
- 5. For cross-layer or risky work, run separate reviewers for spec/AC compliance, architecture, and test adequacy.
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.
172
186
 
173
187
  ## Browser And API Evidence
174
188
 
@@ -197,9 +211,10 @@ If verification fails:
197
211
  2. Dispatch `debugger` with the failed AC ID, failing command, error output,
198
212
  trace/screenshot/network evidence, and smallest relevant files.
199
213
  3. Classify the failure layer using [DEBUG_PROTOCOL.md](DEBUG_PROTOCOL.md), then fix the smallest reproduced failure.
200
- 4. Run reviewer again.
201
- 5. Run verifier again.
202
- 6. Repeat until verified or blocked by missing user input/external state.
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.
203
218
 
204
219
  Before asking the user after repeated failures, run the context-master then
205
220
  memory-master learning cycle or use `wf-learn`.
@@ -207,6 +222,8 @@ memory-master learning cycle or use `wf-learn`.
207
222
  ## Heartbeat Protocol
208
223
 
209
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.
210
227
 
211
228
  Update `Harness/tasks/<task-id>/PROGRESS.md#Heartbeat`:
212
229
 
@@ -224,9 +241,10 @@ equivalent bounded pass to append a compression suggestion to the task heartbeat
224
241
 
225
242
  Close only when:
226
243
 
227
- - PRD-GATE, AC-GATE, CONTRACT-GATE, TEST-GATE, VALIDATION-GATE, and REVIEW-GATE are satisfied
244
+ - PRD-GATE, AC-GATE, CONTRACT-GATE, TEST-GATE, VALIDATION-GATE, REVIEW-GATE, and REFLECT-GATE are satisfied
228
245
  - acceptance criteria are satisfied and reported by AC ID
229
- - reviewer has no unresolved critical/high findings
246
+ - cross-review has passed with no unresolved critical/high findings
247
+ - reflector verdict is PASS
230
248
  - test/API/browser evidence is recorded
231
249
  - affected Harness docs are synced
232
250
  - context-master has analyzed the session and extracted durable knowledge
@@ -1,5 +1,5 @@
1
- # Agent Workflow
2
-
1
+ # Agent Workflow
2
+
3
3
  Use when implementing, reviewing, debugging, or coordinating subagents.
4
4
 
5
5
  This workflow is acceptance-driven. PRD-derived Acceptance Criteria are the
@@ -8,33 +8,47 @@ must trace to AC IDs. Load [ACCEPTANCE_PROTOCOL.md](ACCEPTANCE_PROTOCOL.md) for
8
8
  gate rules, [TDD-GUIDE.md](TDD-GUIDE.md) for AC-linked RED tests,
9
9
  [HARNESS_BRIDGE.md](HARNESS_BRIDGE.md) for UI/API/browser evidence, and
10
10
  [AGENT_ISOLATION.md](AGENT_ISOLATION.md) before role splits.
11
-
12
- ## ReAct Loop
13
-
14
- ```text
15
- Observe -> Load minimal context -> Plan -> Act -> Verify -> Update Harness/tasks/<task-id>/PROGRESS.md
16
- ```
17
-
18
- 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).
19
-
20
- ## Feature Packet
21
-
22
- Every PRD scope item must be covered by AC IDs and a task plan at `Harness/tasks/<task-id>/PLAN.md`
23
- created from `Harness/tasks/_template/PLAN.md` (the primary work tracking system).
24
- **Cohesion rule**: if multiple PRD scope items share the same write set, the same
25
- test/verification path, and the same review boundary, group them into a single
26
- feature doc. The PRD owns scope decomposition; the feature doc owns the
27
- implementation unit. The number of feature docs should reflect the number of
28
- distinguishable implementation units, not the number of PRD checkboxes.
29
-
30
- **Minimum bar**: a task plan is required when the implementation touches more than one
31
- file or changes user-visible behavior. Record the plan in `Harness/tasks/<task-id>/PLAN.md`.
32
- For single-file fixes with no behavior change, a brief note in `PROGRESS.md` is enough.
33
-
34
- **New vs iterate**: if a PRD scope item overlaps with an existing task, reopen the existing
35
- task capsule and append to its `PROGRESS.md`. Only create a new task capsule when the
36
- scope is substantially different. When unsure, ask.
37
-
11
+
12
+ ## ReAct Loop
13
+
14
+ ```text
15
+ Observe -> Load minimal context -> Plan -> Act -> Verify -> Update Harness/tasks/<task-id>/PROGRESS.md
16
+ ```
17
+
18
+ If context grows, load [context-loading.md](context-loading.md) and split the
19
+ work. If more than one agent is useful, load [subagents.md](subagents.md) and
20
+ [dispatch.md](dispatch.md).
21
+
22
+ ## Feature Packet
23
+
24
+ Every PRD scope item must be covered by AC IDs and a task plan at
25
+ `Harness/tasks/<task-id>/PLAN.md` created from
26
+ `Harness/tasks/_template/PLAN.md` (the primary work tracking system).
27
+
28
+ **Cohesion rule**: if multiple PRD scope items share the same write set, the
29
+ same test/verification path, and the same review boundary, group them into a
30
+ single feature doc. The PRD owns scope decomposition; the feature doc owns the
31
+ implementation unit.
32
+
33
+ **Minimum bar**: a task plan is required when the implementation touches more
34
+ than one file or changes user-visible behavior. Record the plan in
35
+ `Harness/tasks/<task-id>/PLAN.md`. For single-file fixes with no behavior
36
+ change, a brief note in `PROGRESS.md` is enough.
37
+
38
+ Use the compact task template by default. `PLAN.md` owns goal, decisions,
39
+ scope/write set, agents, verification intent, and risks. `PROGRESS.md` owns
40
+ status/next/blocker, completed tasks, changed files, verification evidence, and
41
+ notes. Expand sections only when they change an implementation or review
42
+ decision.
43
+
44
+ **AC record size**: default to 1-3 concise ACs. Use full UI/API contracts and an
45
+ AC-by-AC validation matrix only for browser-visible, API/integration,
46
+ security/data-loss, cross-module, or other high-risk behavior.
47
+
48
+ **New vs iterate**: if a PRD scope item overlaps with an existing task, reopen
49
+ the existing task capsule and append to its `PROGRESS.md`. Only create a new
50
+ task capsule when the scope is substantially different. When unsure, ask.
51
+
38
52
  ## Acceptance-Driven Build Loop
39
53
 
40
54
  ```text
@@ -45,7 +59,9 @@ Mini PRD
45
59
  -> failing test or manual check
46
60
  -> minimal implementation
47
61
  -> independent validation
48
- -> review
62
+ -> cross-review (spec/AC + code/architecture/test)
63
+ -> reflector PASS
64
+ -> final acceptance
49
65
  -> debug if needed
50
66
  -> docs sync
51
67
  -> memory
@@ -61,27 +77,31 @@ Rules:
61
77
  - Frontend-backend behavior must include network/API assertions against the contract.
62
78
  - Implementer cannot modify PRD, acceptance criteria, UI/API contracts, test plan, or validation report unless a Change Request is recorded.
63
79
  - Validator must be independent from implementer and must produce an AC-by-AC result matrix.
64
-
65
- ## Subagent Use
66
-
67
- 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.
68
-
69
- Before spawn, define:
70
-
71
- - role
72
- - task
73
- - mode
74
- - read boundary
75
- - write boundary
76
- - dependency
77
- - injected docs from [context-loading.md](context-loading.md)
78
- - return format
79
-
80
- Rules:
81
-
82
- - Explorer Pass, Reviewer, and Verifier are read-only.
83
- - Researcher and Docs Researcher are read-only unless explicitly asked to return a docs patch.
84
- - Planner and Architect are read-only unless explicitly asked to return a docs patch.
80
+ - Cross-review and reflector PASS are required before final acceptance.
81
+
82
+ ## Subagent Use
83
+
84
+ Use subagents when a task needs broad reading, parallel work, cross-layer
85
+ changes, independent review, or isolated debugging. Follow
86
+ [subagents.md](subagents.md) for controller-led orchestration and
87
+ [dispatch.md](dispatch.md) for the dispatch table.
88
+
89
+ Before spawn, define:
90
+
91
+ - role
92
+ - task
93
+ - mode
94
+ - read boundary
95
+ - write boundary
96
+ - dependency
97
+ - injected docs from [context-loading.md](context-loading.md)
98
+ - return format
99
+
100
+ Rules:
101
+
102
+ - Explorer Pass, Reviewer, Verifier, and Reflector are read-only.
103
+ - Researcher and Docs Researcher are read-only unless explicitly asked to return a docs patch.
104
+ - Planner and Architect are read-only unless explicitly asked to return a docs patch.
85
105
  - Test Writer writes tests before Implementer writes production code.
86
106
  - Implementer only writes inside its declared write set.
87
107
  - Implementer forbidden set includes PRD, acceptance criteria, UI/API contracts, test plan, and validation report by default.
@@ -89,31 +109,43 @@ Rules:
89
109
  - Debugger fixes the smallest failing path, not adjacent design.
90
110
  - Debugger receives failed AC IDs, evidence, and failing layer hypothesis before editing.
91
111
  - Main agent integrates summaries, resolves conflicts, and runs final verification.
92
-
93
- ## Parallel Dispatch
94
-
95
- Use [subagents.md](subagents.md) and [dispatch.md](dispatch.md) for multi-agent work. Default to at most three active agents (WF mode overrides this; see [WF.md](WF.md)). In `/wf max`, the CEO/Manager/Worker hierarchy in [WF-MAX.md](WF-MAX.md) overrides this limit entirely with wave-based parallel dispatch. Prefer parallel read-only work first, then serial writes.
96
-
97
- Every dispatched agent returns the handoff format defined in [dispatch.md](dispatch.md).
98
-
99
- ## Conflict Rule
100
-
101
- If PRD, acceptance criteria, UI/API contracts, task PLAN.md, architecture, ports, tests, or code disagree:
102
-
103
- 1. stop implementation
104
- 2. record the conflict in `Harness/tasks/<task-id>/PROGRESS.md` or the feature doc
105
- 3. choose the smallest reversible decision
106
- 4. ask the maintainer when user-visible behavior or security is affected
107
-
108
- ## Completion Gate
109
-
110
- Close only when:
111
-
112
+
113
+ ## Parallel Dispatch
114
+
115
+ Use [subagents.md](subagents.md) and [dispatch.md](dispatch.md) for multi-agent work.
116
+
117
+ **Agent count by mode:**
118
+ | Mode | Agent Count Rule | Source |
119
+ |------|-----------------|--------|
120
+ | Default (non-WF) | up to 3 active agents by default | This file |
121
+ | `/wf` | complete role chain mandatory before closeout | [WF.md](WF.md) |
122
+ | `/wf max` | complete WF role chain plus maximum useful fan-out | [WF-MAX.md](WF-MAX.md) |
123
+
124
+ Prefer parallel read-only work first, then serial writes.
125
+
126
+ Every dispatched agent returns the handoff format defined in [dispatch.md](dispatch.md).
127
+
128
+ ## Conflict Rule
129
+
130
+ If PRD, acceptance criteria, UI/API contracts, task PLAN.md, architecture,
131
+ ports, tests, or code disagree:
132
+
133
+ 1. stop implementation
134
+ 2. record the conflict in `Harness/tasks/<task-id>/PROGRESS.md` or the feature doc
135
+ 3. choose the smallest reversible decision
136
+ 4. ask the maintainer when user-visible behavior or security is affected
137
+
138
+ ## Completion Gate
139
+
140
+ Close only when:
141
+
112
142
  - acceptance criteria are satisfied by AC ID
113
143
  - validation result matrix exists for user-visible behavior
114
144
  - verification evidence is recorded
115
- - architecture docs are synced if affected
116
- - no unresolved critical/high review findings remain
117
- - any optimistic UI mutation has a declared and verified rollback path
118
- - any file declared as DONE in PLAN.md or PROGRESS.md exists on disk (chat output is not durable evidence)
119
- - `Harness/tasks/<task-id>/PROGRESS.md` states the final status or next iteration
145
+ - cross-review has passed with no unresolved critical/high findings
146
+ - reflector verdict is PASS
147
+ - architecture docs are synced if affected
148
+ - no unresolved critical/high review findings remain
149
+ - any optimistic UI mutation has a declared and verified rollback path
150
+ - any file declared as DONE in PLAN.md or PROGRESS.md exists on disk (chat output is not durable evidence)
151
+ - `Harness/tasks/<task-id>/PROGRESS.md` states the final status or next iteration
@@ -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.