create-harness-vibe-coding 0.6.4 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -1
- package/src/generator.js +95 -2
- package/templates/common/.claude/agents/architect-manager.md +45 -0
- package/templates/common/.claude/agents/explore-manager.md +41 -0
- package/templates/common/.claude/agents/implement-manager.md +49 -0
- package/templates/common/.claude/agents/review-manager.md +56 -0
- package/templates/common/.claude/commands/wf-max.md +28 -14
- package/templates/common/.claude/commands/wf-remove.md +23 -0
- package/templates/common/.claude/commands/wf-review.md +13 -20
- package/templates/common/.claude/commands/wf-update.md +6 -4
- package/templates/common/.claude/settings.json +33 -0
- package/templates/common/.claude/skills/subagent-orchestrator/SKILL.md +1 -1
- package/templates/common/.claude/skills/wf-max/SKILL.md +34 -8
- package/templates/common/.claude/skills/wf-remove/SKILL.md +51 -0
- package/templates/common/.claude/skills/wf-review/SKILL.md +72 -50
- package/templates/common/.claude/skills/wf-update/SKILL.md +74 -58
- package/templates/common/.harness-version +122 -3
- package/templates/common/CLAUDE.md +94 -77
- package/templates/common/MEMORY.md +75 -73
- package/templates/common/SETUP.md +1 -2
- package/templates/common/docs/README.md +2 -2
- package/templates/common/docs/harness/WF-MAX.md +99 -10
- package/templates/common/docs/harness/WF.md +5 -0
- package/templates/common/docs/harness/dispatch.md +4 -0
- package/templates/common/scripts/scan-clean.mjs +456 -0
- package/templates/common/scripts/validate-harness.mjs +9 -0
- package/templates/common/scripts/wf-mode-hook.mjs +318 -0
- package/templates/common/scripts/wf-remove.mjs +396 -0
- package/templates/common/scripts/wf-statusline.ps1 +38 -0
- package/templates/common/scripts/wf-statusline.sh +48 -0
- package/templates/common/scripts/wf-update-check.mjs +389 -0
- package/templates/optional/skills/browser-e2e/docs/workflows/browser-e2e.md +12 -0
|
@@ -1,77 +1,94 @@
|
|
|
1
|
-
# CLAUDE.md
|
|
2
|
-
|
|
3
|
-
This repository dogfoods the generated Harness scaffold. Scaffold source files live under `templates/common/` and `templates/optional/`; generated dogfood runtime files live under root `Harness/` and `.claude/`.
|
|
4
|
-
|
|
5
|
-
## 1. Harness Binding & Startup
|
|
6
|
-
|
|
7
|
-
- If `Harness/` exists, this repository is governed by the Harness contract. Treat these files as mandatory operating instructions, not optional references.
|
|
8
|
-
- Every session: load `Harness/MEMORY.md` first, then `Harness/README.md`.
|
|
9
|
-
- If `Harness/SETUP.md` exists, follow it before normal project work; it is the install/bootstrap contract and may be deleted after setup is complete.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
- If
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This repository dogfoods the generated Harness scaffold. Scaffold source files live under `templates/common/` and `templates/optional/`; generated dogfood runtime files live under root `Harness/` and `.claude/`.
|
|
4
|
+
|
|
5
|
+
## 1. Harness Binding & Startup
|
|
6
|
+
|
|
7
|
+
- If `Harness/` exists, this repository is governed by the Harness contract. Treat these files as mandatory operating instructions, not optional references.
|
|
8
|
+
- Every session: load `Harness/MEMORY.md` first, then `Harness/README.md`.
|
|
9
|
+
- If `Harness/SETUP.md` exists, follow it before normal project work; it is the install/bootstrap contract and may be deleted after setup is complete.
|
|
10
|
+
|
|
11
|
+
### 1a. CEO Contract (READ BEFORE ANY TOOL USE)
|
|
12
|
+
|
|
13
|
+
`/wf-max` active → you are **CEO, not implementer** (enforced by hooks + `.runtime/current-mode.json`).
|
|
14
|
+
|
|
15
|
+
| ALLOWED (W0) | FORBIDDEN (always on source) |
|
|
16
|
+
|---|---|
|
|
17
|
+
| Read Harness docs, CLAUDE.md | Edit / Write / MultiEdit |
|
|
18
|
+
| Grep/Glob for scoping | Bash (except `ls`/`dir`/`tree`/`git`) |
|
|
19
|
+
| Agent spawn (ONE message) | Deep source reads → delegate to Worker |
|
|
20
|
+
| Write PLAN.md / PROGRESS.md | Sequential spawn (AP6) |
|
|
21
|
+
|
|
22
|
+
**Tempted to edit source? STOP. Spawn a Worker.**
|
|
23
|
+
|
|
24
|
+
- `Harness/MEMORY.md` is the memory/resource router: agents, skills, durable memories, and cross-session lessons. Follow its registrations when selecting agents/skills or recording memory.
|
|
25
|
+
- `Harness/README.md` is the task router. For every request, check `Harness/README.md#Load By Task`; if a row matches, read and follow those docs before acting.
|
|
26
|
+
- `Harness/PROGRESS.md` is the global task index. Load at session start to see active task and task history.
|
|
27
|
+
- If work spans more than one step, create a task capsule from `Harness/tasks/_template/` and update `Harness/tasks/<task-id>/PROGRESS.md`.
|
|
28
|
+
- Use `/wf <task>`, `/wf-review [focus]`, `wf mode`, `workflow mode`, or `wk mode` for long, difficult, uncertain, multi-file, or repeated-failure work.
|
|
29
|
+
- Use `/wf-max [task]` for maximum parallelism — CEO→Manager→Worker hierarchy. CEO never writes code directly.
|
|
30
|
+
- Use `/wf-auto` for perpetual self-directed optimization — never stops, continuously improves until 8-angle exhaustion.
|
|
31
|
+
- Use `subagent-orchestrator` and `Harness/subagents.md` when coordinating multiple subagents.
|
|
32
|
+
- Use `/wf-update` to check for and apply scaffold updates from GitHub. See `.claude/skills/wf-update/SKILL.md`.
|
|
33
|
+
- Subagents are readers and reporters. Only the main agent writes to `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md`.
|
|
34
|
+
- For memory writing and consolidation (repeated failures, user corrections, closeout), dispatch `memory-master`.
|
|
35
|
+
- For context analysis and compression alerts (~85% window), dispatch `context-master`.
|
|
36
|
+
- Universal rules live in `.claude/rules/ecc/common.md`.
|
|
37
|
+
- Never bulk-read `Harness/`; route through `Harness/README.md` and `Harness/MEMORY.md`.
|
|
38
|
+
- Scaffold source files live under `templates/common/` and `templates/optional/`; generated dogfood runtime files live under root `Harness/` and `.claude/`.
|
|
39
|
+
|
|
40
|
+
## 2. Think Before Coding
|
|
41
|
+
|
|
42
|
+
- You must have **>=95% confidence** in user intent before writing implementation code.
|
|
43
|
+
- If confidence is below 95%, stop and ask up to 3 blocking questions.
|
|
44
|
+
- If multiple valid approaches exist and the choice affects architecture, scope, stack, or user-facing behavior, present trade-offs instead of picking silently.
|
|
45
|
+
- State assumptions before implementation and record durable assumptions, decisions, blockers, handoffs, and verification evidence in `Harness/tasks/<task-id>/PLAN.md`.
|
|
46
|
+
- If something is unclear, stop. Name what is unclear and ask instead of guessing.
|
|
47
|
+
- Before asserting a fact about the codebase, read the file that proves it. If you cannot cite the file and line, do not assert.
|
|
48
|
+
|
|
49
|
+
## 3. Simplicity First
|
|
50
|
+
|
|
51
|
+
- No features beyond what was asked.
|
|
52
|
+
- No abstractions for single-use code.
|
|
53
|
+
- No unrequested flexibility, configurability, or speculative error handling.
|
|
54
|
+
- Use explicit interfaces or state models only when they protect a real boundary, clarify ownership, or make verification/recovery simpler.
|
|
55
|
+
- If a simpler approach exists, say so and prefer the smallest change that satisfies the request.
|
|
56
|
+
- If the solution is growing faster than the problem, reduce scope before coding more.
|
|
57
|
+
|
|
58
|
+
## 4. Surgical Changes
|
|
59
|
+
|
|
60
|
+
- Touch only files and lines required by the task.
|
|
61
|
+
- Do not improve adjacent code, comments, formatting, or architecture unless it is required for the task.
|
|
62
|
+
- Match existing style even when you would choose a different style in a new project.
|
|
63
|
+
- Clean up imports, variables, functions, and files made unused by your own changes; do not delete pre-existing dead code unless asked.
|
|
64
|
+
- Keep every changed line traceable to the user's request.
|
|
65
|
+
|
|
66
|
+
## 5. Goal-Driven Execution
|
|
67
|
+
|
|
68
|
+
- Define verifiable success criteria before implementation.
|
|
69
|
+
- For bugs, reproduce the failure or document why reproduction is impossible before fixing.
|
|
70
|
+
- For multi-step work, keep `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md` current. The main agent is the only state committer; subagents return suggestions only.
|
|
71
|
+
- State assumptions before implementation and record durable assumptions, decisions, blockers, handoffs, and verification evidence in `Harness/tasks/<task-id>/PLAN.md`.
|
|
72
|
+
- Every task needs a test, build check, validator run, or recorded manual check.
|
|
73
|
+
- Do not claim web/UI acceptance without real-browser evidence from Chrome DevTools, CDP, Playwright, or documented manual browser checks.
|
|
74
|
+
- Do not place project build scripts, git conventions, run commands, or release process in this file. Put them in `README.md`.
|
|
75
|
+
- Do not place code architecture here. Put architecture in `Harness/architecture.md` or the current feature doc.
|
|
76
|
+
- If this file has accumulated unrelated project notes, pause and propose moving them to the right place: `README.md` for development operations, `Harness/architecture.md` for architecture, `Harness/WF.md` or `Harness/workflows/` for workflow rules.
|
|
77
|
+
|
|
78
|
+
## 6. Memory & Self-Learning
|
|
79
|
+
|
|
80
|
+
- `Harness/MEMORY.md` is the resource index. Detailed durable memory lives in `Harness/memory/`.
|
|
81
|
+
- **Tool reflection trigger**: record a lightweight reflection when the same tool/use pattern fails 3+ times, or when a better command pattern/environment fix is found. Write it newest-first in `Harness/memory/tool-usage-reflections.md`.
|
|
82
|
+
- **User correction trigger**: record a lightweight preference/correction when the user asks to remember it, or when the user corrects the same assumption/pattern 2+ times. Write it newest-first in `Harness/memory/user-corrections-preferences.md`.
|
|
83
|
+
- **Agent lesson trigger**: record reusable lessons from review/debug loops in `Harness/memory/agent-lessons-patterns.md` when they would prevent recurrence.
|
|
84
|
+
- **WF auto-trigger**: before WF closeout, dispatch `context-master` then `memory-master` (or use `/wf-learn`). The old "3x same failure" auto-trigger is unreliable — make this a mandatory closeout gate.
|
|
85
|
+
- **Context threshold trigger**: when context approaches ~85% of the window, dispatch `context-master` to analyze and write a non-blocking compression suggestion to `Harness/tasks/<task-id>/PROGRESS.md#Heartbeat`.
|
|
86
|
+
- **Closeout trigger**: during WF closeout, dispatch `context-master` to extract durable knowledge, then `memory-master` to consolidate into `Harness/memory/*`.
|
|
87
|
+
- Never record secrets, credentials, tokens, or private data in memory.
|
|
88
|
+
|
|
89
|
+
## 7. CEO Constraints
|
|
90
|
+
|
|
91
|
+
- Never call `EnterPlanMode` — delegate planning to `planner` subagents (see `Harness/WF.md`).
|
|
92
|
+
- Never write code directly in `/wf` or `/wf-max` mode — delegate all implementation to subagents (see `Harness/WF-MAX.md`).
|
|
93
|
+
- **Enforcement**: `.claude/settings.json` denies `EnterPlanMode` via the `deny` list. CEO contract is in [Section 1a](#1a-ceo-contract-read-before-any-tool-use) — read it first.
|
|
94
|
+
- WF-MAX hooks in `.claude/settings.json` block CEO Edit/Write/MultiEdit/Bash on source files. `Harness/.runtime/current-mode.json` persists mode state across sessions.
|
|
@@ -1,73 +1,75 @@
|
|
|
1
|
-
# MEMORY.md - create-harness-vibe-coding Project Resource Index
|
|
2
|
-
|
|
3
|
-
> The project fact source is reached via `CLAUDE.md -> Harness/README.md`. This file persists cross-session context: resource index, user preferences, tool usage standards.
|
|
4
|
-
> Detailed memory lives in `Harness/memory/`. Keep entries short, newest first, and free of secrets.
|
|
5
|
-
|
|
6
|
-
## Agents (Sub-agents)
|
|
7
|
-
|
|
8
|
-
- [researcher](../.claude/agents/researcher.md) — product, market, open-source, dependency, pricing, policy, and ecosystem research.
|
|
9
|
-
- [docs-researcher](../.claude/agents/docs-researcher.md) — official docs, API, SDK, config, limits, errors, and examples verification.
|
|
10
|
-
- [planner](../.claude/agents/planner.md) — task split, dependencies, write sets, and dispatch table.
|
|
11
|
-
- [architect](../.claude/agents/architect.md) — boundaries, ports, data-flow, and state impact.
|
|
12
|
-
- [test-writer](../.claude/agents/test-writer.md) — failing tests or manual verification before implementation.
|
|
13
|
-
- [implementer](../.claude/agents/implementer.md) — bounded implementation inside declared write set.
|
|
14
|
-
- [debugger](../.claude/agents/debugger.md) — smallest fix for a reproduced failure.
|
|
15
|
-
- [reviewer](../.claude/agents/reviewer.md) — read-only diff review and closeout risk.
|
|
16
|
-
- [verifier](../.claude/agents/verifier.md) — verification commands and evidence.
|
|
17
|
-
- [memory-master](../.claude/agents/memory-master.md) — memory writing, dedup, consolidation, and cross-project knowledge extraction.
|
|
18
|
-
- [context-master](../.claude/agents/context-master.md) — context analysis, compression alerts, and session knowledge extraction for memory-master.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
- [
|
|
29
|
-
- [
|
|
30
|
-
- [wf-
|
|
31
|
-
-
|
|
32
|
-
- [wf-
|
|
33
|
-
- [
|
|
34
|
-
- [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
- [
|
|
50
|
-
- [
|
|
51
|
-
- [
|
|
52
|
-
- [
|
|
53
|
-
- [
|
|
54
|
-
- [
|
|
55
|
-
- [
|
|
56
|
-
- [
|
|
57
|
-
- [
|
|
58
|
-
- [
|
|
59
|
-
- [
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
- [
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
- Use `memory/
|
|
72
|
-
- Use
|
|
73
|
-
-
|
|
1
|
+
# MEMORY.md - create-harness-vibe-coding Project Resource Index
|
|
2
|
+
|
|
3
|
+
> The project fact source is reached via `CLAUDE.md -> Harness/README.md`. This file persists cross-session context: resource index, user preferences, tool usage standards.
|
|
4
|
+
> Detailed memory lives in `Harness/memory/`. Keep entries short, newest first, and free of secrets.
|
|
5
|
+
|
|
6
|
+
## Agents (Sub-agents)
|
|
7
|
+
|
|
8
|
+
- [researcher](../.claude/agents/researcher.md) — product, market, open-source, dependency, pricing, policy, and ecosystem research.
|
|
9
|
+
- [docs-researcher](../.claude/agents/docs-researcher.md) — official docs, API, SDK, config, limits, errors, and examples verification.
|
|
10
|
+
- [planner](../.claude/agents/planner.md) — task split, dependencies, write sets, and dispatch table.
|
|
11
|
+
- [architect](../.claude/agents/architect.md) — boundaries, ports, data-flow, and state impact.
|
|
12
|
+
- [test-writer](../.claude/agents/test-writer.md) — failing tests or manual verification before implementation.
|
|
13
|
+
- [implementer](../.claude/agents/implementer.md) — bounded implementation inside declared write set.
|
|
14
|
+
- [debugger](../.claude/agents/debugger.md) — smallest fix for a reproduced failure.
|
|
15
|
+
- [reviewer](../.claude/agents/reviewer.md) — read-only diff review and closeout risk.
|
|
16
|
+
- [verifier](../.claude/agents/verifier.md) — verification commands and evidence.
|
|
17
|
+
- [memory-master](../.claude/agents/memory-master.md) — memory writing, dedup, consolidation, and cross-project knowledge extraction.
|
|
18
|
+
- [context-master](../.claude/agents/context-master.md) — context analysis, compression alerts, and session knowledge extraction for memory-master.
|
|
19
|
+
- [explore-manager](../.claude/agents/explore-manager.md) — WF-MAX W0 exploration: spawn 5-10 read-only researchers, synthesize, report to CEO.
|
|
20
|
+
- [architect-manager](../.claude/agents/architect-manager.md) — WF-MAX W1 architecture: spawn 3 architects, synthesize interface contracts, report to CEO.
|
|
21
|
+
- [implement-manager](../.claude/agents/implement-manager.md) — WF-MAX W2 implementation: spawn 5-7 implementers (one file_claim each), merge, report to CEO.
|
|
22
|
+
- [review-manager](../.claude/agents/review-manager.md) — WF-MAX W2R review: spawn 3-4 reviewers (spec/code/security/perf), deduplicate, classify severity, report to CEO.
|
|
23
|
+
|
|
24
|
+
Stack-specific agents can be added after the product shape is known.
|
|
25
|
+
|
|
26
|
+
## Skills (Workflows)
|
|
27
|
+
|
|
28
|
+
- [WF Mode](WF.md) — long-task workflow: exploration, second plan, implementation, review, verification, heartbeat, and recovery loop.
|
|
29
|
+
- [subagent-orchestrator](../.claude/skills/subagent-orchestrator/SKILL.md) — controller-led subagent orchestration, parallel read-only passes, review gates, and recovery handoffs.
|
|
30
|
+
- [wf-readme](../.claude/skills/wf-readme/SKILL.md) — README preservation, append-only development sections, structured tables, and approved architecture diagrams.
|
|
31
|
+
- [wf-review](../.claude/skills/wf-review/SKILL.md) — cross-model peer review: invoke the other agent CLI (Codex/Claude) for independent review.
|
|
32
|
+
- [wf-update](../.claude/skills/wf-update/SKILL.md) — GitHub-based incremental harness update, checksum comparison, and safe in-place updates.
|
|
33
|
+
- [wf-learn](../.claude/skills/wf-learn/SKILL.md) — force memory learning cycle: context-master -> memory-master -> project + global memory.
|
|
34
|
+
- [wf-max](../.claude/skills/wf-max/SKILL.md) — maximum-parallelism workflow: write-set coloring, wave dispatch, parallel review per dimension.
|
|
35
|
+
- [wf-remove](../.claude/skills/wf-remove/SKILL.md) — Safely remove Harness framework files (SAFE/MODIFIED/USER classes), auto-prune empty directories, backup option.
|
|
36
|
+
- learn: /wf-learn
|
|
37
|
+
|
|
38
|
+
Stack-specific skills can be added after the product shape is known.
|
|
39
|
+
|
|
40
|
+
## Rules (Harness Constraints)
|
|
41
|
+
|
|
42
|
+
Located under `.claude/rules/ecc/`, auto-loaded by the CC engine:
|
|
43
|
+
|
|
44
|
+
- [common.md](../.claude/rules/ecc/common.md) — universal harness constraints for context loading, verification, subagents, and security (alwaysApply: true)
|
|
45
|
+
- Language-specific rules pending Claude Code initialization (e.g. python.md, typescript.md, etc.)
|
|
46
|
+
|
|
47
|
+
## Harness (Runtime)
|
|
48
|
+
|
|
49
|
+
- [Docs router](README.md)
|
|
50
|
+
- [WF mode](WF.md)
|
|
51
|
+
- [WF Max mode](WF-MAX.md)
|
|
52
|
+
- [0-1 lifecycle](lifecycle.md)
|
|
53
|
+
- [Research protocol](research/README.md)
|
|
54
|
+
- [Context loading protocol](context-loading.md)
|
|
55
|
+
- [Dispatch protocol](dispatch.md)
|
|
56
|
+
- [Subagent orchestration](subagents.md)
|
|
57
|
+
- [Extension contract](extension.md)
|
|
58
|
+
- [Architecture docs](architecture.md)
|
|
59
|
+
- [Agent workflow](agent-workflow.md)
|
|
60
|
+
- [Harness validator](scripts/validate-harness.mjs)
|
|
61
|
+
- [Version file](.harness-version)
|
|
62
|
+
|
|
63
|
+
## Memory Folder
|
|
64
|
+
|
|
65
|
+
- [Tool usage/reflections](memory/tool-usage-reflections.md) - repeated tool failures, better command patterns, environment-specific fixes.
|
|
66
|
+
- [User corrections/preferences](memory/user-corrections-preferences.md) - repeated user corrections, durable preferences, common-sense course corrections.
|
|
67
|
+
- [Agent lessons/patterns](memory/agent-lessons-patterns.md) - reusable lessons from review, debugging, validation, and handoff loops.
|
|
68
|
+
|
|
69
|
+
Write to the memory folder when the guidance should survive chat context loss:
|
|
70
|
+
|
|
71
|
+
- Use `memory/tool-usage-reflections.md` when the same tool/use pattern fails 3+ times, a better command pattern is found, or an environment-specific fix should be reused.
|
|
72
|
+
- Use `memory/user-corrections-preferences.md` when the user explicitly asks to remember a preference, or the user corrects the same assumption/pattern 2+ times.
|
|
73
|
+
- Use `memory/agent-lessons-patterns.md` when a review/debug loop yields a reusable lesson or regression guard.
|
|
74
|
+
- Use this file for the resource index and routing pointers, not long-form lessons.
|
|
75
|
+
- Never record secrets, credentials, tokens, or private data. If a memory is ambiguous, ask before writing.
|
|
@@ -133,8 +133,7 @@ The harness validator checks for specific structural invariants. When comparing
|
|
|
133
133
|
|
|
134
134
|
- `Harness/memory/tool-usage-reflections.md`, `Harness/memory/user-corrections-preferences.md`, `Harness/memory/agent-lessons-patterns.md` — these are new empty files
|
|
135
135
|
- `.claude/agents/*.md` — all 9 common agents
|
|
136
|
-
- `.claude/skills/
|
|
137
|
-
- `.claude/commands/update.md` — /wf update command bridge
|
|
136
|
+
- `.claude/skills/wf-update/SKILL.md` and `.claude/skills/subagent-orchestrator/SKILL.md` — core harness skills and subagent orchestration
|
|
138
137
|
- `.claude/rules/ecc/common.md` — universal rules (unless the project has custom rules in this file)
|
|
139
138
|
- `.claude/settings.json` — harness settings
|
|
140
139
|
- `Harness/WF.md`, `Harness/lifecycle.md`, `Harness/subagents.md`, `Harness/agent-workflow.md`, `Harness/architecture.md` — harness runtime docs
|
|
@@ -64,7 +64,7 @@ Routing priority: if a request explicitly says `/wf <task>`, `wf mode`, `workflo
|
|
|
64
64
|
| Adding harness to existing project | existing project, onboarding, migrate, bootstrap, preserve, conflict | [extension.md](extension.md), [PROGRESS.md](PROGRESS.md), root `README.md` and package/CI files | discovered project facts, preserved config, manual registration plan |
|
|
65
65
|
| README optimization | README, docs, quickstart, install docs, architecture diagram, command table, documentation polish | root `README.md`, `.claude/skills/wf-readme/SKILL.md`, [PROGRESS.md](PROGRESS.md), [architecture.md](architecture.md) as needed | approved README mode, preserved sections, proposed diff plan |
|
|
66
66
|
| Need implementation plan | plan, task, write set, verify, milestone, progress | [PROGRESS.md](PROGRESS.md), the current task `tasks/<id>/PROGRESS.md` and `tasks/<id>/PLAN.md`, [agent-workflow.md](agent-workflow.md) | tasks, write set, verification commands |
|
|
67
|
-
| Browser E2E testing or automation | /wf-browser, browser, e2e, web automation, form fill, screenshot verify, page test, browser test, Playwright AI, Browser Use |
|
|
67
|
+
| Browser E2E testing or automation | /wf-browser, browser, e2e, web automation, form fill, screenshot verify, page test, browser test, Playwright AI, Browser Use | browser-e2e workflow, wf-browser skill, Browser Use skill | CLI commands, screenshots, agent history, verification pass/fail evidence |
|
|
68
68
|
| Optional workflow installed | workflow, optional, ui-ux-review, github-pr-review, python-backend, ts-react-frontend | matching `workflows/*.md` (if installed), [extension.md](extension.md) | workflow-specific evidence, commands, fallback path |
|
|
69
69
|
| Need durable memory or reflection | memory, remember, preference, correction, tool failure, lesson, reflection | [MEMORY.md](MEMORY.md), `Harness/memory/tool-usage-reflections.md`, `Harness/memory/user-corrections-preferences.md`, `Harness/memory/agent-lessons-patterns.md` | concise newest-first memory entry or no-op rationale |
|
|
70
70
|
| Need subagents | subagent, role pack, context, inject, return format, orchestrator | [subagents.md](subagents.md), [context-loading.md](context-loading.md), [dispatch.md](dispatch.md) | controller plan, role-specific context pack, dispatch pack |
|
|
@@ -126,6 +126,6 @@ Harness/scripts/validate-harness.mjs lightweight harness gate
|
|
|
126
126
|
.claude/skills/wf-readme/SKILL.md README preservation and optional structure pass
|
|
127
127
|
.claude/commands/wf.md slash command bridge into WF mode
|
|
128
128
|
.claude/skills/wf-update/SKILL.md GitHub-based harness update
|
|
129
|
-
.claude/commands/update.md
|
|
129
|
+
.claude/commands/wf-update.md /wf-update slash command bridge
|
|
130
130
|
Harness/.harness-version scaffold version and file checksums
|
|
131
131
|
```
|
|
@@ -7,6 +7,12 @@
|
|
|
7
7
|
- parallelismScore = (files × avgLines × 3 / 800) × independenceFactor
|
|
8
8
|
- spawn ≥2.0 | maybe 1.0-2.0 | skip <1.0 (degrade to /wf)
|
|
9
9
|
|
|
10
|
+
## Explicit Invocation Is an Absolute Fan-Out Mandate
|
|
11
|
+
|
|
12
|
+
When the user types `/wf-max` (or `wf max`), spawning subagents is **mandatory and unconditional**. File count, task size, line count, and overhead estimates DO NOT apply to explicit invocation — they govern ONLY auto-triggering (whether the harness enters wf-max on its own). A 1-file task invoked with `/wf-max` still fans out to parallel subagents.
|
|
13
|
+
|
|
14
|
+
"Degrade to /wf" changes the **organization** (flat vs CEO→Manager→Worker), never the **fact** of fan-out: `/wf` itself requires ≥3 subagents before second planning. There is no path from an explicitly typed command to a solo main-thread pass. If you find yourself reading source files and editing them directly after the user typed `/wf-max`, you have violated this mandate — stop and dispatch.
|
|
15
|
+
|
|
10
16
|
## Companion Docs
|
|
11
17
|
|
|
12
18
|
- [subagents.md](subagents.md) — agent roster, controller role, efficiency ladder
|
|
@@ -26,16 +32,91 @@ CEO(1) ──┬── Manager₁(span) ──┬── Worker₁..ₙ
|
|
|
26
32
|
- Worker: single file per write Worker (implementer, one file_claim). Single dimension/topic per read Worker (reviewer, researcher). File claims must be file-level disjoint. Topic-level splitting within a single file is only allowed for read-only Workers.
|
|
27
33
|
- depth ≥3: Manager spawns Sub-Manager (span ≤7) instead of Worker. Recursive until leaf condition met.
|
|
28
34
|
|
|
29
|
-
##
|
|
35
|
+
## Decomposition Gate (MANDATORY — CEO-level, before ANY Worker dispatch)
|
|
36
|
+
|
|
37
|
+
The Decomposition Gate is a hard stop. No code changes, no Worker spawns until the gate passes. The CEO MUST produce a Dispatch Table artifact and pass the Self-Audit Checklist. This is the single most important enforcement mechanism in WF-MAX — it exists because **models default to "do it myself" rather than "decompose and delegate."**
|
|
38
|
+
|
|
39
|
+
### Gate Artifact: Dispatch Table
|
|
40
|
+
|
|
41
|
+
CEO MUST write this table in the task PLAN.md after W1 architecture defines the write-set and before W2 implementation dispatch:
|
|
30
42
|
|
|
31
43
|
```
|
|
32
|
-
|
|
44
|
+
| File | Concern | Worker Type | Worker Label | Read-Only? |
|
|
45
|
+
|------|---------|------------|--------------|------------|
|
|
46
|
+
| src/a.ts | Auth middleware | implementer | impl-auth | No |
|
|
47
|
+
| src/b.ts | DB schema | implementer | impl-db | No |
|
|
48
|
+
| docs/arch.md | Research existing patterns | researcher | res-arch | Yes |
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Gate Rules (any violation = gate fail, retry)
|
|
52
|
+
|
|
53
|
+
1. **Every file in the write-set MUST have exactly one write Worker.** Unassigned files = fail. This is the anti-bundling rule — one Worker touching >1 write file = fail. (Read Workers may span multiple files.)
|
|
54
|
+
2. **Manager count MUST ≥ span_min = ceil(sqrt(write_files) / 3).** This is the anti-under-decomposition rule at the domain level. Fewer than the minimum number of Managers means domains are too coarse. "One Manager can handle everything" is NOT valid in WF-MAX — if the task were that simple, degrade to /wf.
|
|
55
|
+
3. **Each Manager MUST have ≥2 Workers and ≤7 Workers.** 0-1 Workers = Phantom Manager → dissolve. >7 Workers → Manager context is overloaded → split the domain and add a Manager.
|
|
56
|
+
4. **CEO MUST NOT appear as a Worker row.** CEO writes no production code — fail.
|
|
57
|
+
|
|
58
|
+
### CEO Tool Boundary
|
|
59
|
+
|
|
60
|
+
The CEO operates under a strict tool restriction model for production code:
|
|
61
|
+
|
|
62
|
+
| CEO Has | CEO MUST NOT Use (on source code) |
|
|
63
|
+
|---------|-----------------------------------|
|
|
64
|
+
| Task (spawn agents) | Edit (on source files) |
|
|
65
|
+
| Read (for scoping) | Write (on source files) |
|
|
66
|
+
| TodoWrite (tracking) | Bash (except final verification) |
|
|
67
|
+
| Grep/Glob (for scoping) | MultiEdit (on source files) |
|
|
68
|
+
|
|
69
|
+
**Exception**: CEO MAY write to `Harness/tasks/<id>/PLAN.md` and `Harness/tasks/<id>/PROGRESS.md` — these are task-tracking artifacts, not production code. The Dispatch Table, Self-Audit Checklist, and synthesis reports are the CEO's primary durable artifacts.
|
|
70
|
+
|
|
71
|
+
If the CEO finds itself reaching for Edit/Write/Bash on source files, it is violating role boundaries. Stop. Delegate to a Worker.
|
|
72
|
+
|
|
73
|
+
### Self-Audit Checklist
|
|
74
|
+
|
|
75
|
+
After producing the Dispatch Table, CEO MUST answer all before proceeding:
|
|
76
|
+
|
|
77
|
+
- [ ] Did I assign myself any source file? (must be **No** — PLAN.md/PROGRESS.md writes are the exception)
|
|
78
|
+
- [ ] Is every file with planned changes assigned to exactly one write Worker? (must be **Yes**)
|
|
79
|
+
- [ ] Does any Worker have >1 write file? (must be **No**)
|
|
80
|
+
- [ ] Is Manager count ≥ ceil(sqrt(write_files) / 3)? (must be **Yes**, or justification written)
|
|
81
|
+
- [ ] Does every Manager have 2-7 Workers? (<2 = Phantom Manager, >7 = overloaded)
|
|
82
|
+
- [ ] Are there files >200 lines or with >1 concern that should be split into separate files?
|
|
83
|
+
- [ ] Could any serial chain be parallelized? (different files with no shared imports = parallelize)
|
|
84
|
+
- [ ] Will all Workers be spawned in ONE message?
|
|
85
|
+
|
|
86
|
+
Gate retries until all checks pass. **CEO may NOT proceed to W1 with a failing gate.**
|
|
87
|
+
|
|
88
|
+
## Anti-Pattern Catalog
|
|
89
|
+
|
|
90
|
+
Before every wave dispatch, CEO MUST scan for these patterns. **Any match = stop and re-decompose.**
|
|
91
|
+
|
|
92
|
+
| # | Anti-Pattern | Symptom | Detection | Fix |
|
|
93
|
+
|---|-------------|---------|-----------|-----|
|
|
94
|
+
| AP1 | **CEO-as-Worker** | CEO assigns itself a file or starts writing code | CEO in Dispatch Table; Edit/Write/Bash used by CEO | Re-delegate to a Worker immediately |
|
|
95
|
+
| AP2 | **Under-decomposition** | Fewer Workers than `ceil(sqrt(files))` | Count check fails; "1-2 agents is enough for this" | Split files by concern, module, or layer |
|
|
96
|
+
| AP3 | **Serialization trap** | "Let me do X first, then I'll know how to dispatch Y" | Sequential plan without parallel candidates | Dispatch X and Y in parallel NOW; Worker-X returns spec that Worker-Y consumes |
|
|
97
|
+
| AP4 | **Fake parallelism** | Multiple Workers assigned same file | Duplicate file path in Dispatch Table | One file = one Writer. Split file into separate modules, or serialize |
|
|
98
|
+
| AP5 | **Phantom Manager** | Manager spawns 0-1 Workers | Manager's sub-table has <2 Workers | Dissolve Manager; CEO or sibling absorbs domain |
|
|
99
|
+
| AP6 | **Sequential spawn** | Workers spawned one-per-turn instead of batched | Only 1 Task() call per message | Batch ALL Task() calls into ONE message |
|
|
100
|
+
| AP7 | **Silent degrade** | CEO switches to /wf without recording reason | No Dispatch Table; flat agent spawns | Explicit decision + justification in PLAN.md; only valid reason is overhead > 0.30 |
|
|
101
|
+
|
|
102
|
+
## Span Formula (Prescriptive Floor)
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
Manager_min = ceil(sqrt(write_files) / 3) # HARD FLOOR — you MUST have ≥ this many Managers
|
|
106
|
+
Manager_max = min(Manager_min × 2, 7) # per-wave; exceed only with written justification
|
|
107
|
+
Worker_max_per_manager = 7 # hard cap; split domain if exceeded
|
|
108
|
+
|
|
109
|
+
Worker count per wave = write_files (one Worker per write file, guaranteed by Gate Rule #1)
|
|
110
|
+
|
|
111
|
+
Domain caps (workers per Manager by type):
|
|
33
112
|
Architecture: cap = 3
|
|
34
|
-
Implementation: cap =
|
|
35
|
-
Review: cap =
|
|
36
|
-
Research: cap =
|
|
113
|
+
Implementation: cap = 7
|
|
114
|
+
Review: cap = 10
|
|
115
|
+
Research: cap = 12
|
|
37
116
|
```
|
|
38
117
|
|
|
118
|
+
**Manager_min is a floor, not a target.** The span formula prevents domain-level under-decomposition — the real failure mode where one Manager tries to coordinate too many Workers across unrelated concerns. Worker-level under-decomposition is prevented by Gate Rule #1 (one file per Worker).
|
|
119
|
+
|
|
39
120
|
## Total Agents (recursive, scales to 1000)
|
|
40
121
|
|
|
41
122
|
```
|
|
@@ -92,15 +173,21 @@ total(depth, span) = Σ span^L for L=0..depth
|
|
|
92
173
|
## Wave Orchestration
|
|
93
174
|
|
|
94
175
|
```
|
|
95
|
-
W0:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
176
|
+
W0: Explore-Mgr → N parallel researchers → synthesize → CEO
|
|
177
|
+
E-GATE: → Exploration Gate: CEO verifies all exploration questions answered, findings synthesized (lightweight; see WF.md Decomposition Gate)
|
|
178
|
+
W1: Architect-Mgr → 3 parallel → boundary decisions + interface contract → CEO approval
|
|
179
|
+
D-GATE: → Write Decomposition Gate: CEO produces Dispatch Table + Self-Audit → GATE PASS/FAIL (MANDATORY, applied to the write-set defined by architecture)
|
|
180
|
+
W2: Implement-Mgr → write-set coloring → wave dispatch: ALL Workers spawned in ONE message → merge → CEO
|
|
181
|
+
W2R: Review-Mgr → 3-4 parallel reviewers → dedupe + severity → CEO assigns fixes
|
|
182
|
+
W3+: Dependent waves (repeat W2 pattern; re-run D-GATE if write-set changed significantly)
|
|
100
183
|
INTEGRATION: CEO → verifier → fail → debugger → loop (cap=3)
|
|
101
184
|
CLOSEOUT: CEO → context-master + memory-master (direct, no Manager)
|
|
102
185
|
```
|
|
103
186
|
|
|
187
|
+
- **E-GATE** (Exploration Gate): read-only agents each had a specific question; all returns are synthesized into PLAN.md. No exploration blind spots.
|
|
188
|
+
- **D-GATE** (Write Decomposition Gate): applies AFTER architecture defines the write-set, BEFORE any implementation Worker spawns. Dispatch Table covers the actual write-set. Gate is non-negotiable.
|
|
189
|
+
- W2 dispatch: ALL Workers for a wave MUST be spawned in a single message — not one per turn. Batching is what makes parallelism real.
|
|
190
|
+
|
|
104
191
|
- Wave scheduling: Managers serial across domains, Workers parallel within domain.
|
|
105
192
|
- CEO validates wave output before starting next wave. No pipelining.
|
|
106
193
|
|
|
@@ -115,6 +202,8 @@ overhead(depth) = 0.10 (depth≤2) | 0.20 (depth=3) | 0.35 (depth≥4)
|
|
|
115
202
|
|
|
116
203
|
## When NOT to use /wf-max
|
|
117
204
|
|
|
205
|
+
These conditions govern **auto-trigger degradation only** (wf-max → /wf). They never apply when the user explicitly types `/wf-max`, and "degrade" always means the flat /wf multi-subagent loop, never a solo pass.
|
|
206
|
+
|
|
118
207
|
- files < 5 → use /wf
|
|
119
208
|
- all changes share single interface → serial dependency
|
|
120
209
|
- import/re-export refactor → global consistency required
|
|
@@ -15,6 +15,11 @@ Enter WF mode when any of these are true:
|
|
|
15
15
|
- The same command, test, tool, or approach fails twice.
|
|
16
16
|
- The user explicitly says `/wf-max [task]` or `wf max` (for maximum-parallelism mode, see [WF-MAX.md](WF-MAX.md)).
|
|
17
17
|
|
|
18
|
+
**Two distinct trigger classes — do not conflate them:**
|
|
19
|
+
|
|
20
|
+
- **Explicit invocation** (`/wf`, `wf mode`, `workflow mode`, `wk mode`, `/wf-max`): subagent fan-out is **mandatory and unconditional**. File count, task size, and subsystem count are IRRELEVANT — a 1-file task typed with `/wf` still fans out to ≥3 subagents before the second plan. There is no "too small for WF" exception once the user types the command.
|
|
21
|
+
- **Auto-triggering** (the file-count / multi-subsystem / repeated-failure bullets above): these decide whether the harness enters WF mode *on its own*. They are the ONLY place file count matters, and they can only ESCALATE into WF — never downgrade an explicit command out of it.
|
|
22
|
+
|
|
18
23
|
## Multi-Subagent Requirement
|
|
19
24
|
|
|
20
25
|
WF mode requires multi-subagent orchestration by default.
|
|
@@ -57,6 +57,10 @@ Goal
|
|
|
57
57
|
| `verifier` | Parallel Read | run checks and record evidence |
|
|
58
58
|
| `memory-master` | Serial Write | write/consolidate memory entries, dedup, cross-project extraction |
|
|
59
59
|
| `context-master` | Parallel Read | analyze context usage, recommend compression, extract session knowledge |
|
|
60
|
+
| `explore-manager` | Parallel Read | WF-MAX W0: spawn 5-10 researchers, synthesize, report to CEO |
|
|
61
|
+
| `architect-manager` | Parallel Read | WF-MAX W1: spawn 3 architects, synthesize interface contracts |
|
|
62
|
+
| `implement-manager` | Serial Write | WF-MAX W2: spawn implementers (one file_claim each), merge results |
|
|
63
|
+
| `review-manager` | Parallel Read | WF-MAX W2R: spawn 3-4 reviewers, deduplicate, classify severity |
|
|
60
64
|
|
|
61
65
|
## Dispatch Rules
|
|
62
66
|
|