create-harness-vibe-coding 0.8.8 → 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 +7 -1
- package/README.md +21 -2
- package/docs/images/harness-icon.png +0 -0
- package/package.json +2 -1
- package/src/generator.js +36 -0
- package/src/index.js +72 -4
- package/templates/common/.claude/agents/architect.md +31 -31
- package/templates/common/.claude/agents/codebase-explorer.md +45 -0
- package/templates/common/.claude/agents/docs-researcher.md +41 -41
- package/templates/common/.claude/agents/memory-master.md +26 -8
- package/templates/common/.claude/agents/reviewer.md +34 -34
- package/templates/common/.claude/agents/task-scribe.md +70 -0
- package/templates/common/.claude/commands/wf-help.md +8 -4
- package/templates/common/.claude/commands/wf-update.md +24 -0
- package/templates/common/.claude/rules/ecc/common.md +15 -2
- 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 +3 -2
- 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-update/SKILL.md +15 -2
- package/templates/common/.codex/hooks.json +17 -0
- package/templates/common/.harness-version +89 -44
- package/templates/common/.opencode/agents/architect.md +24 -24
- package/templates/common/.opencode/agents/codebase-explorer.md +45 -0
- package/templates/common/.opencode/agents/docs-researcher.md +34 -34
- package/templates/common/.opencode/agents/memory-master.md +26 -8
- package/templates/common/.opencode/agents/reviewer.md +27 -27
- package/templates/common/.opencode/agents/task-scribe.md +70 -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 +8 -4
- 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 +35 -6
- package/templates/common/Harness/ACCEPTANCE_PROTOCOL.md +2 -2
- package/templates/common/{MEMORY.md → Harness/MEMORY.md} +16 -3
- package/templates/common/Harness/MEMORY_PROTOCOL.md +80 -30
- package/templates/common/Harness/README.md +50 -22
- 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-SPARK.md +5 -14
- package/templates/common/Harness/WF-AUTO.md +13 -76
- 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/context-loading.md +3 -3
- package/templates/common/Harness/dispatch.md +43 -35
- package/templates/common/Harness/scripts/archive-tasks.mjs +239 -0
- package/templates/common/{scripts → Harness/scripts}/scan-clean.mjs +28 -1
- package/templates/common/{scripts → Harness/scripts}/validate-harness.mjs +909 -699
- package/templates/common/Harness/scripts/wf-auto-update-prompt.mjs +258 -0
- package/templates/common/{scripts → Harness/scripts}/wf-update-check.mjs +40 -7
- package/templates/common/Harness/subagents.md +28 -27
- 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 +1 -1
- package/templates/common/memory/agent-lessons-patterns.md +9 -8
- 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 +9 -8
- package/templates/common/memory/user-corrections-preferences.md +11 -9
- package/templates/optional/catalog.json +8 -0
- package/templates/optional/skills/browser-e2e/.claude/skills/browser-e2e/SKILL.md +42 -42
- package/templates/optional/skills/browser-e2e/.opencode/commands/wf-browser.md +15 -0
- package/templates/optional/skills/github-pr-review/.claude/skills/github-pr-review/SKILL.md +40 -40
- package/templates/optional/skills/python-backend/.claude/skills/python-backend/SKILL.md +40 -40
- package/templates/optional/skills/ts-react-frontend/.claude/skills/ts-react-frontend/SKILL.md +43 -43
- package/templates/optional/skills/ui-ux-review/.claude/skills/ui-ux-review/SKILL.md +40 -40
- /package/templates/common/{scripts → Harness/scripts}/wf-remove.mjs +0 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# TASK_ARCHIVE — Task Archive Mechanism
|
|
2
|
+
|
|
3
|
+
Purpose: keep `Harness/tasks/` lean by archiving completed/abandoned tasks while preserving all evidence.
|
|
4
|
+
|
|
5
|
+
## Archive Location
|
|
6
|
+
|
|
7
|
+
Active tasks stay in `Harness/tasks/<task-id>/`.
|
|
8
|
+
Archived tasks move to `Harness/tasks/_archive/YYYY/<task-id>/`.
|
|
9
|
+
|
|
10
|
+
## What Is Never Archived
|
|
11
|
+
|
|
12
|
+
- `Harness/tasks/_template/` — scaffold template, never moved.
|
|
13
|
+
- `Harness/tasks/auto/` — WF-AUTO permanent state capsule, never moved unless explicitly allowed by WF-AUTO docs.
|
|
14
|
+
- `Harness/tasks/_archive/` — the archive directory itself.
|
|
15
|
+
- Active, blocked, in-progress, or needs-user-decision tasks.
|
|
16
|
+
- Tasks whose STATE.json status is `active`, `blocked`, `in_progress`, `running`, `pending`, or `needs-user-decision`.
|
|
17
|
+
|
|
18
|
+
## What May Be Archived
|
|
19
|
+
|
|
20
|
+
Tasks whose STATE.json or PROGRESS.md status is: `complete`, `verified`, `archived`, `abandoned`, `obsolete`, `done`, `closed`, or `closeout`.
|
|
21
|
+
|
|
22
|
+
The script reads STATE.json `status`/`phase` first, then falls back to the first `- Phase:`, `Phase:`, or `Current:` marker in the task's PROGRESS.md (first word wins). Ambiguous phases are never auto-archived.
|
|
23
|
+
|
|
24
|
+
## Archive Process
|
|
25
|
+
|
|
26
|
+
1. Verify the task is not active/blocked.
|
|
27
|
+
2. Ensure `Harness/tasks/_archive/YYYY/` exists.
|
|
28
|
+
3. Move `Harness/tasks/<task-id>/` → `Harness/tasks/_archive/YYYY/<task-id>/`.
|
|
29
|
+
4. Update the moved STATE.json: `status` → `archived`, `phase` → `archived`.
|
|
30
|
+
5. Update `Harness/tasks/_archive/INDEX.md`.
|
|
31
|
+
6. Update `Harness/PROGRESS.md` Task Index — remove or annotate `(archived)`.
|
|
32
|
+
|
|
33
|
+
## Retention
|
|
34
|
+
|
|
35
|
+
- Archived tasks retain: PLAN, PROGRESS, STATE, ARTIFACTS, NOTES.
|
|
36
|
+
- Do NOT delete historical evidence.
|
|
37
|
+
- `Harness/PROGRESS.md` keeps the last 5 non-archived task entries in the Task Index.
|
|
38
|
+
- When outer task capsules exceed 5 completed/abandoned/obsolete, archive the oldest.
|
|
39
|
+
- The validator (`Harness/scripts/validate-harness.mjs`) warns when `Harness/tasks/` holds more than 5 outer task capsules (excluding `_archive`, `_template`, `auto`) and fails in `--strict` mode.
|
|
40
|
+
|
|
41
|
+
## Script
|
|
42
|
+
|
|
43
|
+
Use `Harness/scripts/archive-tasks.mjs`:
|
|
44
|
+
- Default: dry-run
|
|
45
|
+
- `--apply` to execute
|
|
46
|
+
- `--keep 5` to set the non-archived task threshold
|
|
47
|
+
- `--task <task-id>` to archive a specific task
|
|
48
|
+
- `--json` for machine-readable output
|
|
49
|
+
- `node Harness/scripts/archive-tasks.mjs --dry-run --json` must always run
|
|
50
|
+
|
|
51
|
+
## Safety Rules
|
|
52
|
+
|
|
53
|
+
- Windows path safe. Use `path.resolve()` before moving.
|
|
54
|
+
- Confirm target is within `Harness/tasks/` before any move.
|
|
55
|
+
- Do NOT recursively delete.
|
|
56
|
+
- Tasks with `needs-user-decision` status are never auto-archived.
|
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
## Trigger
|
|
6
6
|
|
|
7
|
-
- User explicitly invokes `/wf-auto-spark
|
|
7
|
+
- User explicitly invokes `/wf-auto-spark`, `$wf-auto-spark`, or `/skills wf-auto-spark`
|
|
8
8
|
- Auto-degrade from `/wf-auto` when user can't clarify direction at Re-Anchor Gate
|
|
9
9
|
- Auto-activate when adaptive internal coverage returns empty for 3+ consecutive cycles AND oracle also empty
|
|
10
10
|
|
|
11
|
+
Note: Natural-language phrases like "spark mode", "external inspiration", "discover mode", "never stop" are NOT triggers — only explicit command tokens or documented auto-degrade/auto-activate paths from inside WF-AUTO enter WF-AUTO-SPARK.
|
|
12
|
+
|
|
11
13
|
## Core Philosophy
|
|
12
14
|
|
|
13
15
|
**"Inspiration never runs dry, but direction must hold."**
|
|
@@ -18,20 +20,9 @@ But perpetual search without direction = drift. The **Roadmap** is the anchor.
|
|
|
18
20
|
|
|
19
21
|
## Inherited Execution Chain
|
|
20
22
|
|
|
21
|
-
WF-AUTO-SPARK inherits WF-AUTO and WF constraints. External spark search replaces discovery only; it does not replace acceptance, implementation, review, verification, reflection, or evidence.
|
|
22
|
-
|
|
23
|
-
Every accepted spark candidate must re-enter the same per-cycle chain:
|
|
24
|
-
|
|
25
|
-
```text
|
|
26
|
-
spark search -> Value Gate -> deviation check -> Mini PRD -> AC IDs
|
|
27
|
-
-> test/validation plan -> implementer -> verifier -> cross-review
|
|
28
|
-
-> reflector PASS -> evidence ledger -> next spark cycle
|
|
29
|
-
```
|
|
23
|
+
WF-AUTO-SPARK is a `/wf` variant layered on WF-AUTO: it inherits the WF-KERNEL contract via WF-AUTO and WF constraints, and does not define an independent heavy process. External spark search replaces discovery only; it does not replace acceptance, implementation, review, verification, reflection, or evidence.
|
|
30
24
|
|
|
31
|
-
Spark searchers are read-only. Any implementation must use the dispatch packet
|
|
32
|
-
from `Harness/dispatch.md` with explicit write set, forbidden truth files, AC
|
|
33
|
-
IDs, and verification commands. A candidate with no verifier evidence or no
|
|
34
|
-
reflector PASS is not accepted, even if the idea is valuable.
|
|
25
|
+
Accepted spark candidates re-enter the standard W2-W5 gates per [WF-KERNEL.md](WF-KERNEL.md): implementer (one file_claim, ≤3 files, ≤50 lines), verifier, reviewer(s), reflector. Spark searchers are read-only. Any implementation must use the dispatch packet from `Harness/dispatch.md` with explicit write set, forbidden truth files, AC IDs, and verification commands. A candidate with no verifier evidence or no reflector PASS is not accepted, even if the idea is valuable.
|
|
35
26
|
|
|
36
27
|
## Startup: Roadmap Declaration
|
|
37
28
|
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
## Trigger
|
|
4
4
|
|
|
5
|
-
- Explicit: `/wf-auto`,
|
|
6
|
-
- The user
|
|
7
|
-
-
|
|
5
|
+
- Explicit: `/wf-auto`, `$wf-auto`, `/skills wf-auto`
|
|
6
|
+
- The user must type one of these exact tokens to enter WF-AUTO.
|
|
7
|
+
- These phrases are NOT triggers and must NOT auto-enter WF-AUTO: "auto mode", "never stop", "self-improve", "continuous optimize", "unbounded self-directed optimization", "keep going", or any natural-language description of perpetual work. Only explicit command tokens enter.
|
|
8
8
|
|
|
9
9
|
## Core Principle
|
|
10
10
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
This fills the gap between:
|
|
14
14
|
- `/wf` — task-bounded, stops on completion
|
|
15
|
-
- `/wf-max` - task-bounded
|
|
15
|
+
- `/wf-max` - task-bounded `/wf` variant on the same WF kernel: maximum safe fan-out, WF-Max-Useful by default, WF-Max-Strict only on explicit strict request
|
|
16
16
|
- `/wf-auto` — **unbounded, self-directed, perpetual improvement**
|
|
17
17
|
|
|
18
18
|
## Organization Model
|
|
@@ -39,7 +39,7 @@ does not edit production source. Implementation happens only through dispatched
|
|
|
39
39
|
workers with explicit write sets, forbidden truth files, and verification
|
|
40
40
|
commands.
|
|
41
41
|
|
|
42
|
-
WF-AUTO does not inherit WF-MAX
|
|
42
|
+
WF-AUTO does not inherit WF-MAX fan-out modes (Useful or Strict) unless `/wf-max` is
|
|
43
43
|
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
|
|
|
@@ -260,53 +260,13 @@ Before W2, CEO writes a cycle Mini PRD:
|
|
|
260
260
|
- UI/API/state contracts, if touched
|
|
261
261
|
- Verification commands and evidence expected
|
|
262
262
|
|
|
263
|
-
### W2: IMPLEMENT
|
|
263
|
+
### W2-W5: IMPLEMENT → REVIEW → DEBUG → VERIFY
|
|
264
264
|
|
|
265
|
-
|
|
265
|
+
WF-AUTO inherits the standard WF-KERNEL write/review/fix/verify gates per cycle. Each accepted finding follows:
|
|
266
266
|
|
|
267
|
-
|
|
268
|
-
2. CEO dispatches `implementer` with the change spec
|
|
269
|
-
3. Implementer changes ONLY the declared write set
|
|
267
|
+
[WF-KERNEL.md](WF-KERNEL.md) write gate (implementer, one file_claim per cycle, ≤3 files, ≤50 lines net), review gate (at least one independent reviewer; two for critical/security), fix gate (debugger on failure, max 2 fix attempts per cycle), and verify gate (test suite, real browser/API check, AC-by-AC evidence).
|
|
270
268
|
|
|
271
|
-
CEO NEVER writes production code
|
|
272
|
-
|
|
273
|
-
Acceptance-specific implementation rules:
|
|
274
|
-
|
|
275
|
-
- Dispatch `test-writer` when AC IDs need new or updated tests.
|
|
276
|
-
- Dispatch `implementer` with forbidden truth files: PRD, AC, UI/API contracts, test plan, and validation report.
|
|
277
|
-
- Implementer may not rewrite ACs/contracts to make the implementation pass.
|
|
278
|
-
|
|
279
|
-
### W3: REVIEW
|
|
280
|
-
|
|
281
|
-
Two-gate review (from WF/subagents.md), then reflection:
|
|
282
|
-
|
|
283
|
-
1. **Spec review**: Did the change address the finding without introducing extras?
|
|
284
|
-
2. **Code-quality review**: Is the change correct, maintainable, safe?
|
|
285
|
-
3. **Reflector gate**: Does review evidence, verifier evidence, and residual
|
|
286
|
-
risk support acceptance?
|
|
287
|
-
|
|
288
|
-
At least one `reviewer` subagent. For critical/security findings, dispatch two independent reviewers.
|
|
289
|
-
Do not record the cycle as accepted until `reflector` returns PASS.
|
|
290
|
-
|
|
291
|
-
### W4: DEBUG (Recovery)
|
|
292
|
-
|
|
293
|
-
If review or verification fails:
|
|
294
|
-
1. `debugger` isolates the smallest failing path
|
|
295
|
-
2. Fix and re-review (max 2 attempts per cycle)
|
|
296
|
-
3. On 3rd failure: record the finding as "attempted, blocked" and move to next finding in W1
|
|
297
|
-
4. Blocked findings are revisited after 3 cycles (the codebase may have changed enough to unblock)
|
|
298
|
-
|
|
299
|
-
### W5: VERIFY
|
|
300
|
-
|
|
301
|
-
- Run project test suite (or relevant subset)
|
|
302
|
-
- For browser-visible changes: real browser check
|
|
303
|
-
- For API changes: real request/response check
|
|
304
|
-
- Record evidence in `Harness/tasks/auto/PROGRESS.md`
|
|
305
|
-
- Final acceptance still requires cross-review and reflector PASS after
|
|
306
|
-
verification. A passing command alone is not acceptance.
|
|
307
|
-
|
|
308
|
-
Validation must include AC-by-AC evidence in `Harness/tasks/auto/PROGRESS.md`,
|
|
309
|
-
not only a generic pass/fail command result.
|
|
269
|
+
CEO NEVER writes production code (per WF-KERNEL State Ownership). Implementer writes ONLY the declared write set. Production agents never write task state.
|
|
310
270
|
|
|
311
271
|
### RECORD
|
|
312
272
|
|
|
@@ -483,36 +443,13 @@ If a spark cycle's measured result is NEGLIGIBLE or REVERTED, increment `weakSpa
|
|
|
483
443
|
|
|
484
444
|
## CEO Constraints
|
|
485
445
|
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
| CEO Has | CEO MUST NOT Use (on source code) |
|
|
489
|
-
|---------|-----------------------------------|
|
|
490
|
-
| Task (spawn agents) | Edit (on source files) |
|
|
491
|
-
| Read (for scoping) | Write (on source files) |
|
|
492
|
-
| Grep/Glob (for scoping) | MultiEdit (on source files) |
|
|
493
|
-
| Write (to PROGRESS.md only) | Bash (except final verification) |
|
|
494
|
-
|
|
495
|
-
**Exception**: CEO MAY write to `Harness/tasks/auto/PROGRESS.md` and `Harness/tasks/auto/PLAN.md` — these are task-tracking artifacts.
|
|
446
|
+
CEO tool boundaries follow [WF-KERNEL.md](WF-KERNEL.md) State Ownership: CEO plans, dispatches, synthesizes, and writes ONLY the auto task capsule (`Harness/tasks/auto/PROGRESS.md`, `Harness/tasks/auto/PLAN.md`). CEO never writes production source code — all implementation is delegated to Workers.
|
|
496
447
|
|
|
497
448
|
## Anti-Pattern Catalog
|
|
498
449
|
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
| AP2 | **Premature stop** | CEO decides "good enough" before A-GATE | A-GATE is the ONLY stop. No exceptions. |
|
|
503
|
-
| AP3 | **Shallow probe scan** | Probe returns "exhausted" after scanning 1-2 files | Require ≥80% relevant-surface coverage and record the coverage basis |
|
|
504
|
-
| AP4 | **Batch implementation** | Multiple unrelated changes in one cycle | ONE finding per cycle. Split if needed. |
|
|
505
|
-
| AP5 | **Wasteful probe scan** | Every catalog item is dispatched every cycle | Select probes by risk, relevance, evidence gap, novelty, and scan cost |
|
|
506
|
-
| AP6 | **Skip review** | Implementation → verify without review | Review gate is mandatory, every cycle |
|
|
507
|
-
| AP7 | **Scope creep** | A "simple fix" grows to 5+ files | Hard cap: ≤3 files per cycle. Split larger changes across cycles. |
|
|
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 |
|
|
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. |
|
|
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. |
|
|
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). |
|
|
514
|
-
| AP14 | **Inspiration theater** | Spark cycles without evidence ledger → no way to know if they worked | Evidence ledger is mandatory per cycle. Weak spark count tracked. |
|
|
515
|
-
| AP15 | **Interrogation checkpoint** | Asking 5+ aggressive questions → user tunes out | Exactly 2 questions: "Still aligned?" + "What should change?" |
|
|
450
|
+
Core anti-patterns AP1 (CEO-as-Worker), AP4 (batch implementation), AP6 (skip review), AP7 (scope creep) are covered by [WF-KERNEL.md](WF-KERNEL.md) State Ownership and Tier-Aware Acceptance Gates.
|
|
451
|
+
|
|
452
|
+
WF-AUTO-specific anti-patterns:
|
|
516
453
|
|
|
517
454
|
## Safety Controls
|
|
518
455
|
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
# WF Kernel — Shared Orchestration Engine
|
|
2
|
+
|
|
3
|
+
The WF Kernel is the shared engine for `/wf`, `/wf-max`, `/wf-auto`, `/wf-auto-spark`, `/wf-review`, and `/wf-browser`. Variants extend the kernel; they do not duplicate the orchestration logic.
|
|
4
|
+
|
|
5
|
+
## Role / Model Matrix
|
|
6
|
+
|
|
7
|
+
The orchestrator dispatches agents by role, model tier, and task type. No single agent type handles all work.
|
|
8
|
+
|
|
9
|
+
### Small-Fast (haiku)
|
|
10
|
+
|
|
11
|
+
Chore and scoped read-only work. Dispatch early and often.
|
|
12
|
+
|
|
13
|
+
| Agent | Writes | Purpose |
|
|
14
|
+
|---|---|---|
|
|
15
|
+
| `task-scribe` | Task state only | Heartbeat, dispatch ledger, evidence pointers, compact PLAN/PROGRESS updates |
|
|
16
|
+
| `codebase-explorer` | None | Scoped read-only source exploration, file discovery, symbol tracing |
|
|
17
|
+
| `context-master` | Heartbeat compression line only | Context analysis, compression suggestions |
|
|
18
|
+
|
|
19
|
+
### Standard (sonnet)
|
|
20
|
+
|
|
21
|
+
Most decision-bound and implementation work.
|
|
22
|
+
|
|
23
|
+
| Agent | Writes | Purpose |
|
|
24
|
+
|---|---|---|
|
|
25
|
+
| `planner` | None (returns PLAN patch) | Task decomposition, dependencies, writeSet, verification commands |
|
|
26
|
+
| `researcher` | None (returns research patch) | Product, market, dependency, ecosystem research |
|
|
27
|
+
| `docs-researcher` | None | Official docs, API, SDK, version, limits |
|
|
28
|
+
| `architect` | None (returns architecture patch) | Boundaries, ports, data flow, state impact, migration risks |
|
|
29
|
+
| `test-writer` / `tdd-guide` | Tests/plan only | AC-linked failing tests, manual verification plans |
|
|
30
|
+
| `implementer` | Assigned writeSet only | Minimal production code changes |
|
|
31
|
+
| `debugger` | Smallest fix path | Root-cause isolation and fix |
|
|
32
|
+
| `verifier` | None | Command execution, AC evidence, validation matrix |
|
|
33
|
+
| `reviewer` | None | Spec/code/security/architecture/test review findings |
|
|
34
|
+
| `reflector` | None | Closeout synthesis, PASS/RETURN_TO_DEBUG/BLOCKED verdict |
|
|
35
|
+
| `memory-master` | Memory files + MEMORY.md index | Durable memory write, dedup, consolidation |
|
|
36
|
+
|
|
37
|
+
### High-Reasoning (opus)
|
|
38
|
+
|
|
39
|
+
Reserved for architecture conflicts, security/data-loss risk, multi-layer ambiguity, or user explicitly requests.
|
|
40
|
+
|
|
41
|
+
### WF-MAX Managers (sonnet)
|
|
42
|
+
|
|
43
|
+
| Manager | Spawns | Purpose |
|
|
44
|
+
|---|---|---|
|
|
45
|
+
| `explore-manager` | 5-10 read-only researchers/explorers | W0 exploration fan-out |
|
|
46
|
+
| `architect-manager` | 3 architects | W1 boundary/interface contracts |
|
|
47
|
+
| `implement-manager` | 5-7 implementers (one file_claim each) | W2 parallel implementation |
|
|
48
|
+
| `review-manager` | 3-4 reviewers (spec/code/security/perf) | W2R review fan-out |
|
|
49
|
+
|
|
50
|
+
## Dynamic Ready-Queue Orchestration
|
|
51
|
+
|
|
52
|
+
`/wf` is NOT a fixed serial pipeline. It uses a dependency-driven ready queue, persisted across sessions via [WF-STATE.md](WF-STATE.md).
|
|
53
|
+
|
|
54
|
+
```text
|
|
55
|
+
while task not accepted:
|
|
56
|
+
update readyQueue from dependency graph
|
|
57
|
+
|
|
58
|
+
// Phase-independent: dispatch anything ready
|
|
59
|
+
dispatch all ready read-only agents in parallel
|
|
60
|
+
(codebase-explorer, docs-researcher, researcher, planner, architect)
|
|
61
|
+
dispatch task-scribe to maintain state alongside any work
|
|
62
|
+
|
|
63
|
+
// Write gate: only when AC + contracts + test plan exist
|
|
64
|
+
for each independent writeSet:
|
|
65
|
+
dispatch implementer (one file_claim each)
|
|
66
|
+
wait for wave complete
|
|
67
|
+
dispatch verifier on completed wave
|
|
68
|
+
|
|
69
|
+
// Review gate: wave-level, not end-of-task
|
|
70
|
+
when verifier evidence exists for a wave:
|
|
71
|
+
dispatch reviewer(s) on that wave
|
|
72
|
+
|
|
73
|
+
// Fix gate: on-demand only
|
|
74
|
+
if review finding or failed AC:
|
|
75
|
+
dispatch debugger or implementer (smallest fix)
|
|
76
|
+
re-run verifier on the fixed wave
|
|
77
|
+
|
|
78
|
+
// Reflect gate: WF-Full only, or risk-triggered
|
|
79
|
+
if WF-Full or unresolved contradiction or high-risk behavior:
|
|
80
|
+
dispatch reflector before final acceptance
|
|
81
|
+
|
|
82
|
+
// Closeout
|
|
83
|
+
task-scribe records final state
|
|
84
|
+
if durable lesson found:
|
|
85
|
+
dispatch context-master -> memory-master
|
|
86
|
+
|
|
87
|
+
stop on: accepted | blocked | user decision required
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Concurrency Rules
|
|
91
|
+
|
|
92
|
+
1. Read-only agents always run in parallel (different readSets = no conflict).
|
|
93
|
+
2. `task-scribe` runs alongside any wave — task state is its own writeSet, disjoint from source.
|
|
94
|
+
3. Write agents serial within wave; parallel across waves only when writeSets are disjoint.
|
|
95
|
+
4. `verifier` launches per-wave as soon as that wave's write agents complete.
|
|
96
|
+
5. `reviewer` launches per-wave when verifier evidence is ready.
|
|
97
|
+
6. `debugger` launches on-demand when a specific AC or review finding fails.
|
|
98
|
+
7. `reflector` launches only in WF-Full, or when risk/contradiction is detected.
|
|
99
|
+
8. Idle capacity is immediately filled with the next ready item from the queue.
|
|
100
|
+
|
|
101
|
+
## Dispatch Packet (Extended)
|
|
102
|
+
|
|
103
|
+
Every dispatch MUST carry:
|
|
104
|
+
|
|
105
|
+
```text
|
|
106
|
+
Role:
|
|
107
|
+
Objective:
|
|
108
|
+
TaskType: ui-browser | api-backend | architecture-migration | docs-readme | dependency-sdk | bug-fix | refactor | chore
|
|
109
|
+
ModelTier: small-fast | standard | high-reasoning
|
|
110
|
+
AgentName:
|
|
111
|
+
Skills: list or none
|
|
112
|
+
ReadSet:
|
|
113
|
+
WriteSet:
|
|
114
|
+
Forbidden:
|
|
115
|
+
AC IDs:
|
|
116
|
+
MaxReturnTokens:
|
|
117
|
+
ReturnSchema:
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Task Type → Agent/Skill Routing
|
|
121
|
+
|
|
122
|
+
| Task Type | Primary Agents | Skills |
|
|
123
|
+
|---|---|---|
|
|
124
|
+
| UI/browser behavior | test-writer, implementer, verifier, reviewer | browser-e2e, wf-browser |
|
|
125
|
+
| API/backend | docs-researcher, test-writer, implementer, verifier, reviewer (security) | tdd |
|
|
126
|
+
| Architecture/migration | architect, codebase-explorer, planner, reviewer | — |
|
|
127
|
+
| Docs/README | wf-readme, reviewer, task-scribe | wf-readme |
|
|
128
|
+
| Dependency/SDK/API upgrade | docs-researcher, researcher, implementer | — |
|
|
129
|
+
| Bug/failing test | debugger, verifier, implementer, reviewer | tdd |
|
|
130
|
+
| Large refactor | planner, architect, codebase-explorer fan-out, implement-manager, review-manager | — |
|
|
131
|
+
| Task state/log/evidence only | task-scribe (haiku) | — |
|
|
132
|
+
| Source discovery/tracing | codebase-explorer (haiku) fan-out | — |
|
|
133
|
+
|
|
134
|
+
## Tier-Aware Acceptance Gates
|
|
135
|
+
|
|
136
|
+
Acceptance is tier-dependent. No single gate covers all tiers.
|
|
137
|
+
|
|
138
|
+
### WF-Light
|
|
139
|
+
|
|
140
|
+
1-2 files, well-understood, low risk.
|
|
141
|
+
- planner + test-writer + implementer + verifier
|
|
142
|
+
- Task-scribe maintains state throughout
|
|
143
|
+
- Codebase-explorer optional
|
|
144
|
+
- **Acceptance**: verification passes + task state recorded = closeout
|
|
145
|
+
- Cross-review and reflector are NOT mandatory
|
|
146
|
+
- Heartbeat: phase boundaries, failure, closeout
|
|
147
|
+
|
|
148
|
+
### WF-Standard
|
|
149
|
+
|
|
150
|
+
Multi-file or behavior change.
|
|
151
|
+
- WF-Light baseline + research/docs + at least one independent review lens
|
|
152
|
+
- Parallel: codebase-explorer(s), docs-researcher/researcher, planner, task-scribe
|
|
153
|
+
- **Acceptance**: verifier evidence + one review PASS = closeout
|
|
154
|
+
- Reflector: triggered only by risk, contradiction, or high-impact behavior
|
|
155
|
+
- Heartbeat: wave boundaries, failure, blocker, closeout
|
|
156
|
+
|
|
157
|
+
### WF-Full
|
|
158
|
+
|
|
159
|
+
High-risk, cross-layer, security/data-loss, browser/API acceptance, ambiguous architecture.
|
|
160
|
+
- Full chain: planner + research/docs + architect + test-writer + implementer + verifier + multi-review + reflector
|
|
161
|
+
- **Acceptance**: cross-review PASS + reflector PASS
|
|
162
|
+
- Maximize parallel reads; serial writes only when writeSets overlap
|
|
163
|
+
- Heartbeat: wave boundaries, gate results, failure, blocker, closeout
|
|
164
|
+
|
|
165
|
+
### WF-MAX
|
|
166
|
+
|
|
167
|
+
`/wf-max` = `/wf` kernel + maximum safe fan-out. It is NOT a separate workflow.
|
|
168
|
+
|
|
169
|
+
Delta from `/wf`:
|
|
170
|
+
- Tasks are decomposed into smallest safe write-units
|
|
171
|
+
- Each write-unit = one file_claim = one implementer Worker
|
|
172
|
+
- Managers coordinate per-domain fan-out (explore, architect, implement, review)
|
|
173
|
+
- CEO/controller never writes source; delegates all production edits to Workers
|
|
174
|
+
- WF-Max-Useful (default): fan-out only where writeSets are meaningfully independent
|
|
175
|
+
- WF-Max-Strict (explicit `--strict`): unconditional fan-out per span formula
|
|
176
|
+
- Disjoint writeSets → parallel; overlapping → serial wave or worktree isolation
|
|
177
|
+
- task-scribe continuously maintains dispatch ledger and heartbeat
|
|
178
|
+
- `idleWorker -> nextReady` queue: dispatch immediately when a slot opens
|
|
179
|
+
- Write workers return <=250 tokens + evidence/file paths
|
|
180
|
+
|
|
181
|
+
## State Ownership
|
|
182
|
+
|
|
183
|
+
- **Controller (main agent or CEO)**: owns decisions, decomposition, synthesis, final verification, dispatch
|
|
184
|
+
- **task-scribe**: writes task state (PROGRESS, PLAN, ARTIFACTS, NOTES). Controller or CEO supplies structured updates; task-scribe formats and writes them.
|
|
185
|
+
- **Production source agents (implementer, debugger, test-writer)**: write ONLY their assigned writeSet. Never write task state.
|
|
186
|
+
- **Reviewer, verifier, reflector, architect, planner, researcher**: read-only. Return findings/patches to controller for synthesis.
|
|
187
|
+
|
|
188
|
+
Old rule: "Only main agent writes task PROGRESS/PLAN."
|
|
189
|
+
New rule: "Only controller or task-scribe writes task state. Production source agents never write task state unless explicitly dispatched as task-scribe."
|