create-harness-vibe-coding 0.8.7 → 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.
- package/README-CN.md +157 -105
- package/README.md +160 -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/package.json +46 -44
- package/src/generator.js +5 -5
- package/src/index.js +14 -9
- package/src/prompts.js +37 -37
- package/templates/common/.claude/agents/architect-manager.md +45 -45
- package/templates/common/.claude/agents/context-master.md +75 -75
- package/templates/common/.claude/agents/debugger.md +41 -41
- package/templates/common/.claude/agents/explore-manager.md +41 -41
- package/templates/common/.claude/agents/implement-manager.md +49 -49
- package/templates/common/.claude/agents/implementer.md +40 -40
- package/templates/common/.claude/agents/memory-master.md +64 -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/verifier.md +29 -29
- package/templates/common/.claude/commands/wf-help.md +1 -1
- package/templates/common/.claude/rules/ecc/common.md +44 -44
- package/templates/common/.claude/skills/wf-auto/SKILL.md +8 -6
- 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/.harness-version +54 -14
- package/templates/common/.opencode/agents/architect-manager.md +52 -0
- package/templates/common/.opencode/agents/architect.md +35 -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 +70 -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/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-help.md +23 -0
- package/templates/common/CLAUDE.md +85 -88
- package/templates/common/Harness/PROGRESS.md +17 -17
- package/templates/common/Harness/README.md +16 -5
- package/templates/common/Harness/WF-AUTO-ANGLES.md +170 -0
- package/templates/common/Harness/WF-AUTO-SPARK.md +5 -5
- package/templates/common/Harness/WF-AUTO.md +85 -96
- package/templates/common/Harness/architecture.md +124 -124
- package/templates/common/Harness/context-loading.md +111 -111
- 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/subagents.md +208 -208
- package/templates/common/Harness/tasks/_template/ARTIFACTS.md +2 -2
- package/templates/common/Harness/tasks/_template/NOTES.md +2 -2
- package/templates/common/MEMORY.md +1 -1
- package/templates/common/README.md +36 -36
- package/templates/common/memory/agent-lessons-patterns.md +21 -21
- package/templates/common/memory/tool-usage-reflections.md +21 -21
- package/templates/common/memory/user-corrections-preferences.md +21 -21
- package/templates/common/opencode.json +19 -0
- package/templates/common/scripts/scan-clean.mjs +415 -415
- package/templates/common/scripts/validate-harness.mjs +274 -245
- package/templates/common/scripts/wf-remove.mjs +56 -39
- package/templates/common/scripts/wf-update-check.mjs +599 -599
- package/templates/optional/catalog.json +41 -33
- package/templates/optional/skills/browser-e2e/.claude/skills/wf-browser/SKILL.md +193 -193
- package/templates/optional/skills/browser-e2e/Harness/workflows/browser-e2e.md +48 -48
- package/templates/optional/skills/github-pr-review/Harness/workflows/github-pr-review.md +28 -28
- package/templates/optional/skills/python-backend/Harness/workflows/python-backend.md +34 -34
- package/templates/optional/skills/ts-react-frontend/Harness/workflows/ts-react-frontend.md +34 -34
- package/templates/optional/skills/ui-ux-review/Harness/workflows/ui-ux-review.md +26 -26
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
## Core Principle
|
|
10
10
|
|
|
11
|
-
**NEVER STOP.** WF-AUTO is a perpetual loop. It does not stop when a task is "done" — it finds the next improvement and continues. The
|
|
11
|
+
**NEVER STOP.** WF-AUTO is a perpetual loop. It does not stop when a task is "done" — it finds the next improvement and continues. The only permitted stop is the Adaptive Coverage Exhaustion Gate: when the project's dynamic risk obligations are covered, two different confirmation strategies find no worthwhile direction, and unresolved uncertainty is recorded.
|
|
12
12
|
|
|
13
13
|
This fills the gap between:
|
|
14
14
|
- `/wf` — task-bounded, stops on completion
|
|
@@ -44,14 +44,10 @@ explicitly invoked or the selected change exceeds the auto cycle cap and
|
|
|
44
44
|
escalates. Auto mode stays one accepted change per cycle.
|
|
45
45
|
|
|
46
46
|
```
|
|
47
|
-
CEO(1) ──┬──
|
|
48
|
-
├──
|
|
49
|
-
├──
|
|
50
|
-
|
|
51
|
-
├── Angle-Agent₅ (test-coverage)
|
|
52
|
-
├── Angle-Agent₆ (architecture)
|
|
53
|
-
├── Angle-Agent₇ (ux-dx)
|
|
54
|
-
└── Angle-Agent₈ (robustness)
|
|
47
|
+
CEO(1) ──┬── Probe-Agent (selected by risk and evidence)
|
|
48
|
+
├── Probe-Agent (selected by changed surface)
|
|
49
|
+
├── Probe-Agent (selected by user goal)
|
|
50
|
+
└── Probe-Agent (selected by evidence gap)
|
|
55
51
|
│
|
|
56
52
|
▼
|
|
57
53
|
CEO synthesizes → picks highest-impact direction
|
|
@@ -62,7 +58,7 @@ CEO(1) ──┬── Angle-Agent₁ (correctness)
|
|
|
62
58
|
▼
|
|
63
59
|
LOOP → W0 (re-sense)
|
|
64
60
|
|
|
65
|
-
─── WHEN
|
|
61
|
+
─── WHEN ADAPTIVE COVERAGE IS EXHAUSTED ───
|
|
66
62
|
|
|
67
63
|
CEO → Cross-Model Oracle (Codex/Claude)
|
|
68
64
|
│
|
|
@@ -70,9 +66,9 @@ CEO(1) ──┬── Angle-Agent₁ (correctness)
|
|
|
70
66
|
└── Oracle also empty → Tier 2 confirm rounds → STOP
|
|
71
67
|
```
|
|
72
68
|
|
|
73
|
-
CEO orchestrates the perpetual loop. CEO never writes production code — delegates all implementation. CEO synthesizes
|
|
69
|
+
CEO orchestrates the perpetual loop. CEO never writes production code — delegates all implementation. CEO synthesizes probe findings, picks direction, dispatches implement/review/verify, then loops.
|
|
74
70
|
|
|
75
|
-
When
|
|
71
|
+
When the selected probes return exhausted, the CEO does NOT immediately enter confirmation. It checks dynamic risk obligations and unresolved uncertainty, then consults the other AI model only when a fresh perspective is warranted. Confirmation rounds must use different scan strategies.
|
|
76
72
|
|
|
77
73
|
### State Machine
|
|
78
74
|
|
|
@@ -80,7 +76,7 @@ WF-AUTO operates in explicit states. Without a state machine, "auto-degrade", "s
|
|
|
80
76
|
|
|
81
77
|
```
|
|
82
78
|
┌──────────────────────────────┐
|
|
83
|
-
|
|
79
|
+
│ auto.internal │ ←── W0-W5 loop (adaptive probes + oracle + spark)
|
|
84
80
|
│ (active optimization cycle) │
|
|
85
81
|
└──────────┬───────────────────┘
|
|
86
82
|
│
|
|
@@ -111,38 +107,44 @@ WF-AUTO operates in explicit states. Without a state machine, "auto-degrade", "s
|
|
|
111
107
|
|
|
112
108
|
| State | Meaning | Entry Condition |
|
|
113
109
|
|-------|---------|-----------------|
|
|
114
|
-
| `auto.internal` | Running W0-W5 with
|
|
115
|
-
| `auto.spark` | Searching external sources for candidates when internal + oracle are empty |
|
|
110
|
+
| `auto.internal` | Running W0-W5 with dynamically selected probes | Default, or return from checkpoint/spark |
|
|
111
|
+
| `auto.spark` | Searching external sources for candidates when internal + oracle are empty | Selected probes exhausted + oracle empty, OR user requested spark mode |
|
|
116
112
|
| `auto.checkpoint` | Intent Checkpoint — brief user alignment check | Every N cycles (adaptive: 2→5→10) |
|
|
117
|
-
| `auto.exhausted` | A-GATE passed permanently |
|
|
113
|
+
| `auto.exhausted` | A-GATE passed permanently | Two different confirmation strategies return no actionable finding |
|
|
118
114
|
| `paused` | User interrupted, waiting for direction | User says "stop" or interrupts at any point |
|
|
119
115
|
|
|
120
116
|
**State transitions are CEO-owned.** The CEO decides which state to enter based on W0 results and checkpoint responses. The state machine is recorded in `Harness/tasks/auto/PROGRESS.md` at each transition.
|
|
121
117
|
|
|
122
|
-
##
|
|
118
|
+
## Adaptive coverage instead of a magic angle count
|
|
123
119
|
|
|
124
|
-
|
|
120
|
+
The old protocol dispatched a fixed set of eight angles every cycle. That made
|
|
121
|
+
the stop condition easy to explain, but it also spent context on irrelevant
|
|
122
|
+
surfaces and treated every repository as if it had the same risks.
|
|
125
123
|
|
|
126
|
-
|
|
127
|
-
|---|-------|-------|----------------|
|
|
128
|
-
| 1 | **Correctness** | Bugs, logic errors, edge cases, null safety, race conditions, state inconsistency | Unhandled error paths, missing null checks, off-by-one, stale cache |
|
|
129
|
-
| 2 | **Performance** | Speed, memory, I/O, algorithmic complexity, bundle size, query efficiency | O(n²) where O(n log n) exists, unnecessary allocations, blocking I/O |
|
|
130
|
-
| 3 | **Security** | Injection, auth/authz, secret exposure, input validation, dependency CVEs | Unsanitized input, hardcoded keys, missing rate limits, outdated deps |
|
|
131
|
-
| 4 | **Maintainability** | Code clarity, DRY violations, coupling, naming, comment accuracy, dead code | Duplicated logic, misleading names, god functions, stale comments |
|
|
132
|
-
| 5 | **Test Coverage** | Missing tests, weak assertions, untested edge cases, flaky tests, test speed | Untested error branches, mock-only tests (no integration), slow suites |
|
|
133
|
-
| 6 | **Architecture** | Boundary violations, dependency direction, interface stability, layer discipline | Circular deps, leaky abstractions, wrong layer ownership |
|
|
134
|
-
| 7 | **UX / DX** | Error messages, API ergonomics, documentation, logging, CLI/API consistency | Cryptic errors, missing docs, inconsistent flags, poor discoverability |
|
|
135
|
-
| 8 | **Robustness** | Resilience, retry/backoff, graceful degradation, observability, recovery | Missing retries, no circuit breaker, silent failures, no health checks |
|
|
124
|
+
The current protocol uses a dynamic probe catalog and project obligations:
|
|
136
125
|
|
|
137
|
-
|
|
126
|
+
1. Build a profile from the repository, recent diff, failures, task capsule,
|
|
127
|
+
and user direction.
|
|
128
|
+
2. Score candidate probes by risk, change relevance, evidence gap, expected
|
|
129
|
+
user value, novelty, and scan cost.
|
|
130
|
+
3. Always keep Goal / value and Correctness / safety visible; add security,
|
|
131
|
+
recovery, performance, architecture, testing, UX/DX, dependency, or other
|
|
132
|
+
probes only when the evidence triggers them.
|
|
133
|
+
4. Record selected probes, skipped probes, scan strategy, confidence, surface
|
|
134
|
+
coverage, and findings in the cycle ledger.
|
|
135
|
+
5. Stop only after dynamic high-risk obligations are covered and two different
|
|
136
|
+
confirmation strategies find no actionable improvement.
|
|
137
|
+
|
|
138
|
+
Read the complete selection algorithm, obligation matrix, scan strategies, and
|
|
139
|
+
ledger schema in [WF-AUTO-ANGLES.md](WF-AUTO-ANGLES.md).
|
|
138
140
|
|
|
139
141
|
## Perpetual Loop
|
|
140
142
|
|
|
141
143
|
```text
|
|
142
144
|
┌──────────────────────────────────────────────────────────────┐
|
|
143
|
-
│ W0: SENSE —
|
|
145
|
+
│ W0: SENSE — adaptive probes + oracle + spark (as triggered) │
|
|
144
146
|
│ ↓ │
|
|
145
|
-
│ A-GATE:
|
|
147
|
+
│ A-GATE: Adaptive Coverage Exhaustion Gate │
|
|
146
148
|
│ ├── Findings exist (any source) → continue to W1 │
|
|
147
149
|
│ └── ALL sources empty? → CROSS-MODEL ORACLE │
|
|
148
150
|
│ ├── Oracle finds directions → feed into W1 │
|
|
@@ -172,84 +174,71 @@ These 8 angles are comprehensive by design. If ALL 8 return empty, the codebase
|
|
|
172
174
|
└──────────────────────────────────────────────────────────────┘
|
|
173
175
|
```
|
|
174
176
|
|
|
175
|
-
### W0: SENSE (
|
|
177
|
+
### W0: SENSE (Adaptive Probe Selection)
|
|
176
178
|
|
|
177
|
-
CEO dispatches
|
|
179
|
+
CEO dispatches the selected probe agents in one batch when the runtime allows
|
|
180
|
+
it. The selection comes from [WF-AUTO-ANGLES.md](WF-AUTO-ANGLES.md), not from a
|
|
181
|
+
fixed count. Each probe agent:
|
|
178
182
|
|
|
179
|
-
- **Role**: Read-only scanner through one
|
|
183
|
+
- **Role**: Read-only scanner through one selected probe lens
|
|
180
184
|
- **Read set**: The project source tree (scoped by CEO to relevant paths)
|
|
181
|
-
- **Return**: `{
|
|
185
|
+
- **Return**: `{probe, findings: [{file, line, severity, description, suggestedFix}], exhausted: boolean, confidence: 0-1, coverage: 0-1, skippedReason?: string}`
|
|
182
186
|
- **Stop condition**: Returns when scan is complete — does not implement anything
|
|
183
187
|
|
|
184
|
-
|
|
188
|
+
Probe agents are READ-ONLY. They find, they don't fix.
|
|
185
189
|
|
|
186
190
|
Every cycle starts with a fresh W0 scan. The codebase changed since last cycle (due to W2-W5), so new findings may emerge.
|
|
187
191
|
|
|
188
|
-
### A-GATE:
|
|
192
|
+
### A-GATE: Adaptive Coverage Exhaustion Gate (THE ONLY STOP)
|
|
189
193
|
|
|
190
194
|
This is the single most important gate in WF-AUTO. It prevents both premature stopping and infinite busywork.
|
|
191
195
|
|
|
192
|
-
**Gate Protocol
|
|
196
|
+
**Gate Protocol:**
|
|
193
197
|
|
|
194
198
|
```
|
|
195
|
-
TIER 1 —
|
|
196
|
-
├── NO →
|
|
197
|
-
└── YES →
|
|
198
|
-
|
|
199
|
-
TIER
|
|
200
|
-
├──
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
├── Oracle finds directions? → Feed into W1 as HIGH priority findings.
|
|
211
|
-
│ Reset confirmCount to 0. The oracle's fresh perspective broke the
|
|
212
|
-
│ local blind spot. Continue looping.
|
|
213
|
-
└── Oracle also empty? → Move to Tier 2. The external model agrees:
|
|
214
|
-
this codebase is genuinely optimized.
|
|
215
|
-
|
|
216
|
-
TIER 2 — Confirmation round.
|
|
217
|
-
├── confirmCount < 2? → Increment confirmCount. Re-run W0 with
|
|
218
|
-
│ DIFFERENT agent seeds/scopes to prevent false negatives.
|
|
219
|
-
│ (e.g., if first scan was broad, second scan is deep-dive on
|
|
220
|
-
│ recent change areas; if first used file-level, second uses
|
|
221
|
-
│ function-level.)
|
|
222
|
-
└── confirmCount ≥ 2? → 3 consecutive rounds with all 8 exhausted
|
|
223
|
-
AND cross-model oracle confirmed empty. PERMANENT STOP.
|
|
224
|
-
Record final exhaustion evidence.
|
|
199
|
+
TIER 1 — Did selected probes cover all dynamic high-risk obligations?
|
|
200
|
+
├── NO → Select the missing obligation and continue to W0.
|
|
201
|
+
└── YES → Check findings, confidence, coverage, and value threshold.
|
|
202
|
+
|
|
203
|
+
TIER 2 — Did any selected probe find an actionable direction?
|
|
204
|
+
├── YES → Feed the highest-value finding to W1. Reset confirmCount.
|
|
205
|
+
└── NO → Run a confirmation pass with a different scan strategy.
|
|
206
|
+
|
|
207
|
+
TIER 3 — Is uncertainty still high or coverage borderline?
|
|
208
|
+
├── YES → Re-run only the uncertain probe, or invoke the cross-model oracle.
|
|
209
|
+
└── NO → Record an empty confirmation pass.
|
|
210
|
+
|
|
211
|
+
TIER 4 — Two different confirmation strategies are empty?
|
|
212
|
+
├── NO → Continue with another strategy or newly triggered obligation.
|
|
213
|
+
└── YES → Record exhaustion evidence and stop.
|
|
225
214
|
```
|
|
226
215
|
|
|
227
216
|
**Oracle Rules (modeled on /wf-review):**
|
|
228
217
|
|
|
229
218
|
- [ ] CEO detects which CLI is running: `which codex` / `which claude`
|
|
230
|
-
- [ ] CEO invokes the OTHER CLI
|
|
231
|
-
- [ ] If neither CLI is available
|
|
232
|
-
- [ ] Oracle is invoked at most
|
|
219
|
+
- [ ] CEO invokes the OTHER CLI only when unresolved high-risk uncertainty or borderline coverage justifies it
|
|
220
|
+
- [ ] If neither CLI is available, record "oracle unavailable" in PROGRESS.md and continue with local confirmation
|
|
221
|
+
- [ ] Oracle is invoked at most once per adaptive exhaustion event
|
|
233
222
|
- [ ] Oracle findings are treated as severity=high by default (external model perspective gets extra weight)
|
|
234
223
|
|
|
235
224
|
**Gate Rules:**
|
|
236
225
|
|
|
237
|
-
- [ ]
|
|
238
|
-
- [ ] Each
|
|
239
|
-
- [ ]
|
|
240
|
-
- [ ] Cross-Model Oracle was consulted
|
|
241
|
-
- [ ]
|
|
242
|
-
- [ ] CEO reviewed
|
|
226
|
+
- [ ] Dynamic high-risk obligations are covered
|
|
227
|
+
- [ ] Each selected probe returned structured findings, confidence, and surface coverage
|
|
228
|
+
- [ ] Skipped obligations have an evidence-based reason
|
|
229
|
+
- [ ] Cross-Model Oracle was consulted when uncertainty justified it, or unavailability was recorded
|
|
230
|
+
- [ ] Two different confirmation strategies returned no actionable finding
|
|
231
|
+
- [ ] CEO reviewed borderline probe returns (confidence < 0.8 or coverage < 0.8)
|
|
243
232
|
|
|
244
233
|
**Anti-false-exhaustion measures:**
|
|
245
|
-
-
|
|
246
|
-
- Between confirmation rounds, CEO varies the scan strategy:
|
|
247
|
-
-
|
|
248
|
-
- The Cross-Model Oracle
|
|
234
|
+
- Probe agents MUST include confidence and relevant surface coverage. Low confidence or coverage on "exhausted" means the probe is re-run with a deeper scope.
|
|
235
|
+
- Between confirmation rounds, CEO varies the scan strategy: breadth → depth, change-first → failure-first, or contract-first.
|
|
236
|
+
- Re-run only the uncertain or under-covered probe instead of rescanning irrelevant surfaces.
|
|
237
|
+
- The Cross-Model Oracle breaks blind spots when local evidence is insufficient; if it finds anything, the loop continues.
|
|
249
238
|
|
|
250
239
|
### W1: PRIORITIZE
|
|
251
240
|
|
|
252
|
-
CEO takes all
|
|
241
|
+
CEO takes all probe findings, deduplicates, and ranks:
|
|
253
242
|
|
|
254
243
|
```
|
|
255
244
|
priorityScore = severity × impactRadius × reversibility
|
|
@@ -370,7 +359,7 @@ Hard boundaries:
|
|
|
370
359
|
- only `/wf-auto` may use a runtime hook
|
|
371
360
|
- the hook must run one bounded tick, not an unbounded process
|
|
372
361
|
- the hook must respect `Harness/tasks/auto/STOP`, `state=paused`, user stop,
|
|
373
|
-
and the
|
|
362
|
+
and the Adaptive Coverage Exhaustion Gate
|
|
374
363
|
- the hook must not enforce WF-MAX roles, writeSet, or agent identity
|
|
375
364
|
- the hook must not inject memory directly; use `MEMORY_PROTOCOL.md` scenario
|
|
376
365
|
hints through controller/context-master
|
|
@@ -411,7 +400,7 @@ CEO presents:
|
|
|
411
400
|
|
|
412
401
|
### Spark: External Candidate Provider
|
|
413
402
|
|
|
414
|
-
Spark is NOT a separate optimization engine. It is a **candidate provider** plugged into W0, alongside the
|
|
403
|
+
Spark is NOT a separate optimization engine. It is a **candidate provider** plugged into W0, alongside the adaptive probe scan and the cross-model oracle. W1 still owns prioritization across ALL sources.
|
|
415
404
|
|
|
416
405
|
**When spark activates:**
|
|
417
406
|
- W0 internal scan returns empty AND oracle also empty → `auto.spark` state
|
|
@@ -448,7 +437,7 @@ Spark is NOT a separate optimization engine. It is a **candidate provider** plug
|
|
|
448
437
|
**Spark candidates flow into W1 with `source=spark-<source-name>`:**
|
|
449
438
|
|
|
450
439
|
W1 prioritization now handles three source types:
|
|
451
|
-
- `source=internal` — from
|
|
440
|
+
- `source=internal` — from adaptive probe scan
|
|
452
441
|
- `source=oracle` — from cross-model review
|
|
453
442
|
- `source=spark-<name>` — from external inspiration search
|
|
454
443
|
|
|
@@ -511,14 +500,14 @@ The CEO operates under the same strict tool boundary as WF-MAX:
|
|
|
511
500
|
|---|-------------|---------|-----|
|
|
512
501
|
| AP1 | **CEO-as-Worker** | CEO writes production code | Delegate ALL implementation to Workers |
|
|
513
502
|
| AP2 | **Premature stop** | CEO decides "good enough" before A-GATE | A-GATE is the ONLY stop. No exceptions. |
|
|
514
|
-
| AP3 | **Shallow
|
|
503
|
+
| AP3 | **Shallow probe scan** | Probe returns "exhausted" after scanning 1-2 files | Require ≥80% relevant-surface coverage and record the coverage basis |
|
|
515
504
|
| AP4 | **Batch implementation** | Multiple unrelated changes in one cycle | ONE finding per cycle. Split if needed. |
|
|
516
|
-
| AP5 | **
|
|
505
|
+
| AP5 | **Wasteful probe scan** | Every catalog item is dispatched every cycle | Select probes by risk, relevance, evidence gap, novelty, and scan cost |
|
|
517
506
|
| AP6 | **Skip review** | Implementation → verify without review | Review gate is mandatory, every cycle |
|
|
518
507
|
| AP7 | **Scope creep** | A "simple fix" grows to 5+ files | Hard cap: ≤3 files per cycle. Split larger changes across cycles. |
|
|
519
|
-
| AP8 | **False exhaustion** |
|
|
520
|
-
| AP9 | **Stale
|
|
521
|
-
| AP10 | **
|
|
508
|
+
| AP8 | **False exhaustion** | Probe returns exhausted=true with low confidence | Require confidence and coverage ≥0.8 on exhausted. Re-dispatch only the uncertain probe. |
|
|
509
|
+
| AP9 | **Stale probe strategy** | Same scan strategy every cycle → blind spots emerge | Rotate breadth, depth, change-first, failure-first, and contract-first scans |
|
|
510
|
+
| AP10 | **Unjustified oracle** | CEO invokes another CLI on every empty scan | Invoke the oracle only for unresolved high-risk uncertainty or borderline coverage |
|
|
522
511
|
| AP11 | **Spark as escape hatch** | Using spark to avoid the discipline of internal scan | Spark activates ONLY when internal + oracle are empty. It augments W0, not replaces it. |
|
|
523
512
|
| AP12 | **Fake value scoring** | Inflating Value Gate scores to pass candidates through | CEO must justify each dimension score. Reviewer checks Value Gate scores as part of spec review. |
|
|
524
513
|
| AP13 | **Shiny object syndrome** | Implementing every spark candidate without Value Gate filtering | All spark candidates MUST pass the Value Gate (≥18/25, no dimension <3). |
|
|
@@ -539,7 +528,7 @@ Before W2, CEO checks: does this change delete functionality, change public API,
|
|
|
539
528
|
|
|
540
529
|
### Idle Detection
|
|
541
530
|
- If 5 consecutive cycles produce 0-line changes (all findings rejected at review), trigger IDLE alarm
|
|
542
|
-
- IDLE → CEO re-evaluates: are
|
|
531
|
+
- IDLE → CEO re-evaluates: are probes scoped too narrowly? Are obligations missing? Is the codebase actually done?
|
|
543
532
|
- After IDLE alarm + re-scope + 2 more empty cycles → consider A-GATE
|
|
544
533
|
|
|
545
534
|
### User Interrupt
|
|
@@ -552,7 +541,7 @@ Before W2, CEO checks: does this change delete functionality, change public API,
|
|
|
552
541
|
- Explicit user task with defined completion criteria → use `/wf` or `/wf-max`
|
|
553
542
|
- Single known bug → just fix it directly
|
|
554
543
|
- User wants to review every change before it's made → /wf-auto is autonomous by design
|
|
555
|
-
- Codebase is <100 lines →
|
|
544
|
+
- Codebase is <100 lines → adaptive scan overhead > benefit
|
|
556
545
|
- Production hotfix needed urgently → direct fix, not optimization loop
|
|
557
546
|
|
|
558
547
|
## /wf vs /wf-max vs /wf-auto
|
|
@@ -563,14 +552,14 @@ Mini PRD-derived AC IDs in `/wf-auto`.
|
|
|
563
552
|
| Dimension | /wf | /wf-max | /wf-auto |
|
|
564
553
|
|-----------|-----|---------|----------|
|
|
565
554
|
| Scope | Task-bounded | Task-bounded | Unbounded |
|
|
566
|
-
| Stop condition | Task complete | Task complete |
|
|
555
|
+
| Stop condition | Task complete | Task complete | Dynamic obligations covered + two different empty confirmation passes |
|
|
567
556
|
| Direction | User-specified | User-specified | AI-inferred + cross-model oracle + external spark |
|
|
568
|
-
| Organization | Flat (CEO + agents) | 3-tier (CEO→Mgr→Worker) | Flat (CEO +
|
|
557
|
+
| Organization | Flat (CEO + agents) | 3-tier (CEO→Mgr→Worker) | Flat (CEO + selected probes + oracle + spark searchers + build agents) |
|
|
569
558
|
| Duration | One task | One task | Perpetual |
|
|
570
559
|
| User interaction | At key gates | At key gates | Adaptive checkpoint (2→5→10 cycles), 2 questions only |
|
|
571
560
|
| Cycle count | 1 | 1 (multi-wave) | ∞ (until exhaustion) |
|
|
572
561
|
| Files/cycle | Per task | Per wave (many) | ≤3 per cycle |
|
|
573
|
-
| Exploration | 3-5 agents once | 5-10 agents once |
|
|
562
|
+
| Exploration | 3-5 agents once | 5-10 agents once | Dynamic probes + triggered spark sources per cycle |
|
|
574
563
|
| Cross-model check | No (wf-review is separate) | No (wf-review is separate) | Yes — Cross-Model Oracle built into A-GATE Tier 1.5 |
|
|
575
564
|
| External inspiration | No | No | Yes — Spark candidate provider when internal sources empty |
|
|
576
565
|
| Evidence tracking | Per task | Per task | Evidence ledger per cycle with measured impact |
|
|
@@ -588,7 +577,7 @@ Unlike normal task capsules, this one is never archived — it's the permanent h
|
|
|
588
577
|
|
|
589
578
|
Closeout happens exactly once, when A-GATE passes permanently:
|
|
590
579
|
|
|
591
|
-
1. CEO records final exhaustion evidence
|
|
580
|
+
1. CEO records final exhaustion evidence: dynamic obligations, selected and skipped probes, coverage, confidence, and two different confirmation strategies
|
|
592
581
|
2. CEO writes summary: total cycles, files changed, findings addressed, findings rejected, residual risk
|
|
593
582
|
3. CEO marks `Harness/tasks/auto/PROGRESS.md` as "WF-AUTO EXHAUSTED" with timestamp
|
|
594
583
|
4. `Harness/PROGRESS.md` is updated with the auto session outcome
|
|
@@ -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.
|