create-harness-vibe-coding 0.6.5 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/package.json +2 -1
  2. package/src/generator.js +95 -2
  3. package/templates/common/.claude/agents/architect-manager.md +45 -0
  4. package/templates/common/.claude/agents/explore-manager.md +41 -0
  5. package/templates/common/.claude/agents/implement-manager.md +49 -0
  6. package/templates/common/.claude/agents/review-manager.md +56 -0
  7. package/templates/common/.claude/commands/wf-max.md +28 -14
  8. package/templates/common/.claude/commands/wf-remove.md +23 -0
  9. package/templates/common/.claude/commands/wf-review.md +13 -20
  10. package/templates/common/.claude/commands/wf-update.md +6 -4
  11. package/templates/common/.claude/settings.json +33 -0
  12. package/templates/common/.claude/skills/subagent-orchestrator/SKILL.md +1 -1
  13. package/templates/common/.claude/skills/wf-max/SKILL.md +34 -8
  14. package/templates/common/.claude/skills/wf-remove/SKILL.md +51 -0
  15. package/templates/common/.claude/skills/wf-review/SKILL.md +72 -50
  16. package/templates/common/.claude/skills/wf-update/SKILL.md +74 -58
  17. package/templates/common/.codex/config.toml +2 -0
  18. package/templates/common/.codex/hooks.json +37 -0
  19. package/templates/common/.harness-version +130 -3
  20. package/templates/common/AGENTS.md +26 -3
  21. package/templates/common/CLAUDE.md +94 -77
  22. package/templates/common/MEMORY.md +75 -73
  23. package/templates/common/SETUP.md +1 -2
  24. package/templates/common/commands/wf-max.toml +18 -0
  25. package/templates/common/commands/wf-review.toml +15 -0
  26. package/templates/common/docs/README.md +2 -2
  27. package/templates/common/docs/harness/WF-MAX.md +99 -10
  28. package/templates/common/docs/harness/WF.md +5 -0
  29. package/templates/common/docs/harness/dispatch.md +4 -0
  30. package/templates/common/scripts/scan-clean.mjs +456 -0
  31. package/templates/common/scripts/validate-harness.mjs +9 -0
  32. package/templates/common/scripts/wf-mode-hook.mjs +318 -0
  33. package/templates/common/scripts/wf-remove.mjs +396 -0
  34. package/templates/common/scripts/wf-statusline.ps1 +38 -0
  35. package/templates/common/scripts/wf-statusline.sh +48 -0
  36. package/templates/common/scripts/wf-update-check.mjs +389 -0
  37. 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
- - `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.
11
- - `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.
12
- - `Harness/PROGRESS.md` is the global task index. Load at session start to see active task and task history.
13
- - If work spans more than one step, create a task capsule from `Harness/tasks/_template/` and update `Harness/tasks/<task-id>/PROGRESS.md`.
14
- - Use `/wf <task>`, `/wf-review [focus]`, `wf mode`, `workflow mode`, or `wk mode` for long, difficult, uncertain, multi-file, or repeated-failure work.
15
- - Use `subagent-orchestrator` and `Harness/subagents.md` when coordinating multiple subagents.
16
- - Use `/wf update` to check for and apply scaffold updates from GitHub. See `.claude/skills/wf-update/SKILL.md`.
17
- - Subagents are readers and reporters. Only the main agent writes to `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md`.
18
- - For memory writing and consolidation (repeated failures, user corrections, closeout), dispatch `memory-master`.
19
- - For context analysis and compression alerts (~85% window), dispatch `context-master`.
20
- - Universal rules live in `.claude/rules/ecc/common.md`.
21
- - Never bulk-read `Harness/`; route through `Harness/README.md` and `Harness/MEMORY.md`.
22
- - Scaffold source files live under `templates/common/` and `templates/optional/`; generated dogfood runtime files live under root `Harness/` and `.claude/`.
23
-
24
- ## 2. Think Before Coding
25
-
26
- - You must have **>=95% confidence** in user intent before writing implementation code.
27
- - If confidence is below 95%, stop and ask up to 3 blocking questions.
28
- - If multiple valid approaches exist and the choice affects architecture, scope, stack, or user-facing behavior, present trade-offs instead of picking silently.
29
- - State assumptions before implementation and record durable assumptions, decisions, blockers, handoffs, and verification evidence in `Harness/tasks/<task-id>/PLAN.md`.
30
- - If something is unclear, stop. Name what is unclear and ask instead of guessing.
31
- - Before asserting a fact about the codebase, read the file that proves it. If you cannot cite the file and line, do not assert.
32
-
33
- ## 3. Simplicity First
34
-
35
- - No features beyond what was asked.
36
- - No abstractions for single-use code.
37
- - No unrequested flexibility, configurability, or speculative error handling.
38
- - Use explicit interfaces or state models only when they protect a real boundary, clarify ownership, or make verification/recovery simpler.
39
- - If a simpler approach exists, say so and prefer the smallest change that satisfies the request.
40
- - If the solution is growing faster than the problem, reduce scope before coding more.
41
-
42
- ## 4. Surgical Changes
43
-
44
- - Touch only files and lines required by the task.
45
- - Do not improve adjacent code, comments, formatting, or architecture unless it is required for the task.
46
- - Match existing style even when you would choose a different style in a new project.
47
- - Clean up imports, variables, functions, and files made unused by your own changes; do not delete pre-existing dead code unless asked.
48
- - Keep every changed line traceable to the user's request.
49
-
50
- ## 5. Goal-Driven Execution
51
-
52
- - Define verifiable success criteria before implementation.
53
- - For bugs, reproduce the failure or document why reproduction is impossible before fixing.
54
- - 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.
55
- - State assumptions before implementation and record durable assumptions, decisions, blockers, handoffs, and verification evidence in `Harness/tasks/<task-id>/PLAN.md`.
56
- - Every task needs a test, build check, validator run, or recorded manual check.
57
- - Do not claim web/UI acceptance without real-browser evidence from Chrome DevTools, CDP, Playwright, or documented manual browser checks.
58
- - Do not place project build scripts, git conventions, run commands, or release process in this file. Put them in `README.md`.
59
- - Do not place code architecture here. Put architecture in `Harness/architecture.md` or the current feature doc.
60
- - 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.
61
-
62
- ## 6. Memory & Self-Learning
63
-
64
- - `Harness/MEMORY.md` is the resource index. Detailed durable memory lives in `Harness/memory/`.
65
- - **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`.
66
- - **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`.
67
- - **Agent lesson trigger**: record reusable lessons from review/debug loops in `Harness/memory/agent-lessons-patterns.md` when they would prevent recurrence.
68
- - **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.
69
- - **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`.
70
- - **Closeout trigger**: during WF closeout, dispatch `context-master` to extract durable knowledge, then `memory-master` to consolidate into `Harness/memory/*`.
71
- - Never record secrets, credentials, tokens, or private data in memory.
72
-
73
- ## 7. CEO Constraints
74
-
75
- - Never call `EnterPlanMode` delegate planning to `planner` subagents (see `Harness/WF.md`).
76
- - Never write code directly in `/wf` or `/wf-max` mode delegate all implementation to subagents (see `Harness/WF-MAX.md`).
77
- - **Enforcement**: `.claude/settings.json` denies `EnterPlanMode` via the `deny` list. No hooks or `allowTools` needed — the tool is blocked at the permission layer.
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
- Stack-specific agents can be added after the product shape is known.
21
-
22
- ## Skills (Workflows)
23
-
24
- - [WF Mode](WF.md) long-task workflow: exploration, second plan, implementation, review, verification, heartbeat, and recovery loop.
25
- - [subagent-orchestrator](../.claude/skills/subagent-orchestrator/SKILL.md) — controller-led subagent orchestration, parallel read-only passes, review gates, and recovery handoffs.
26
- - [wf-readme](../.claude/skills/wf-readme/SKILL.md) — README preservation, append-only development sections, structured tables, and approved architecture diagrams.
27
- - [wf-review](../.claude/skills/wf-review/SKILL.md) — cross-model peer review: invoke the other agent CLI (Codex/Claude) for independent review.
28
- - [wf-update](../.claude/skills/wf-update/SKILL.md) — GitHub-based incremental harness update, checksum comparison, and safe in-place updates.
29
- - [wf-learn](../.claude/skills/wf-learn/SKILL.md) — force memory learning cycle: context-master -> memory-master -> project + global memory.
30
- - [wf-max](../.claude/skills/wf-max/SKILL.md) — maximum-parallelism workflow: write-set coloring, wave dispatch, parallel review per dimension.
31
- - learn: /wf-learn
32
- - [wf-browser](../.claude/skills/wf-browser/SKILL.md) — AI-driven browser automation via Browser Use (89.1% WebVoyager): E2E testing, form filling, screenshots, web scraping. CLI mode (~50ms) + Python Agent API.
33
- - [browser-use](~/.claude/skills/browser-use/SKILL.md) — external user-level skill (auto-installed via `pip install browser-use[cli]`): CLI commands, browser profiles, cloud browsers, daemon management.
34
- - [browser-e2e](workflows/browser-e2e.md) — optional workflow contract: install guide, evidence contract, integration points, fallback paths.
35
-
36
- Stack-specific skills can be added after the product shape is known.
37
-
38
- ## Rules (Harness Constraints)
39
-
40
- Located under `.claude/rules/ecc/`, auto-loaded by the CC engine:
41
-
42
- - [common.md](../.claude/rules/ecc/common.md) universal harness constraints for context loading, verification, subagents, and security (alwaysApply: true)
43
- - Language-specific rules pending Claude Code initialization (e.g. python.md, typescript.md, etc.)
44
-
45
- ## Harness (Runtime)
46
-
47
- - [Docs router](README.md)
48
- - [WF mode](WF.md)
49
- - [WF Max mode](WF-MAX.md)
50
- - [0-1 lifecycle](lifecycle.md)
51
- - [Research protocol](research/README.md)
52
- - [Context loading protocol](context-loading.md)
53
- - [Dispatch protocol](dispatch.md)
54
- - [Subagent orchestration](subagents.md)
55
- - [Extension contract](extension.md)
56
- - [Architecture docs](architecture.md)
57
- - [Agent workflow](agent-workflow.md)
58
- - [Harness validator](scripts/validate-harness.mjs)
59
- - [Version file](.harness-version)
60
-
61
- ## Memory Folder
62
-
63
- - [Tool usage/reflections](memory/tool-usage-reflections.md) - repeated tool failures, better command patterns, environment-specific fixes.
64
- - [User corrections/preferences](memory/user-corrections-preferences.md) - repeated user corrections, durable preferences, common-sense course corrections.
65
- - [Agent lessons/patterns](memory/agent-lessons-patterns.md) - reusable lessons from review, debugging, validation, and handoff loops.
66
-
67
- Write to the memory folder when the guidance should survive chat context loss:
68
-
69
- - 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.
70
- - 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.
71
- - Use `memory/agent-lessons-patterns.md` when a review/debug loop yields a reusable lesson or regression guard.
72
- - Use this file for the resource index and routing pointers, not long-form lessons.
73
- - Never record secrets, credentials, tokens, or private data. If a memory is ambiguous, ask before writing.
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/harness-*/SKILL.md`, `.claude/skills/wf-update/SKILL.md`, and `.claude/skills/subagent-orchestrator/SKILL.md` — core harness skills and subagent orchestration
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
@@ -0,0 +1,18 @@
1
+ description = "Maximum parallelism: CEO→Manager→Worker hierarchy with D-GATE enforcement"
2
+ prompt = """
3
+ WF-MAX ACTIVE: You are CEO, not implementer.
4
+
5
+ ALLOWED first actions:
6
+ 1. Read CLAUDE.md, Harness/MEMORY.md, Harness/README.md, Harness/WF-MAX.md
7
+ 2. Create task PLAN/PROGRESS
8
+ 3. Spawn W0 read-only agents in ONE message
9
+
10
+ FORBIDDEN before W0 returns:
11
+ - Read source files deeply (scoping only via Grep/Glob)
12
+ - Edit / Write / MultiEdit on source files
13
+ - Bash (except ls/dir/tree/git status/git diff)
14
+
15
+ Loop: W0 Explore → E-GATE → W1 Architecture → D-GATE (Dispatch Table + Self-Audit) → W2 Implement (single-message dispatch) → W2R Review → W3+ dependent → Integration → Closeout
16
+
17
+ Full spec: Harness/WF-MAX.md
18
+ """
@@ -0,0 +1,15 @@
1
+ description = "Cross-model peer review — 5 dimensions with severity classification"
2
+ prompt = """
3
+ Cross-model peer review. Use the OTHER CLI for independent review.
4
+
5
+ Dimensions:
6
+ 1. Correctness — bugs, edge cases, race conditions, null/undefined, logic flaws?
7
+ 2. Security — injection, auth bypass, data exposure, input validation, unsafe deps?
8
+ 3. Architecture — boundary violations, coupling, state ownership, interface contract breaks?
9
+ 4. Performance — algorithmic complexity, N+1 queries, memory leaks?
10
+ 5. Tests — coverage gaps, missing edge cases, CI regressions?
11
+
12
+ Severity: Critical (security/data-loss/crash → must fix), High (bug/regression → should fix), Medium (maintainability → may defer), Low (style → optional)
13
+
14
+ Review CLI: use the OTHER one. Claude → codex exec. Codex → claude -p.
15
+ """
@@ -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 | [workflows/browser-e2e.md](workflows/browser-e2e.md), `.claude/skills/wf-browser/SKILL.md`, `~/.claude/skills/browser-use/SKILL.md` | CLI commands, screenshots, agent history, verification pass/fail evidence |
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 /wf update slash command bridge
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
- ## Span Formula
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
- span = min(ceil(sqrt(files)), domain_cap)
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 = 5-7
35
- Review: cap = 7-10
36
- Research: cap = 10-12
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: Explore-Mgr → N parallel researchers → synthesize → CEO
96
- W1: Architect-Mgr 3 parallel boundary decisions + interface contract CEO approval
97
- W2: Implement-Mgr → write-set coloringwave dispatch: N parallel implementers (disjoint file_claims) merge → CEO
98
- W2R: Review-Mgr 3-4 parallel reviewers dedupe + severityCEO assigns fixes
99
- W3+: Dependent implementation waves (repeat W2 pattern)
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 parallelboundary decisions + interface contractCEO approval
179
+ D-GATE: Write Decomposition Gate: CEO produces Dispatch Table + Self-AuditGATE 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