create-harness-vibe-coding 0.2.1 → 0.3.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 (51) hide show
  1. package/README-CN.md +58 -57
  2. package/README.md +108 -23
  3. package/package.json +1 -1
  4. package/src/generator.js +2 -0
  5. package/templates/common/.claude/agents/context-master.md +78 -0
  6. package/templates/common/.claude/agents/debugger.md +1 -1
  7. package/templates/common/.claude/agents/docs-researcher.md +1 -1
  8. package/templates/common/.claude/agents/implementer.md +1 -1
  9. package/templates/common/.claude/agents/memory-master.md +67 -0
  10. package/templates/common/.claude/agents/planner.md +1 -1
  11. package/templates/common/.claude/agents/researcher.md +1 -1
  12. package/templates/common/.claude/agents/test-writer.md +1 -1
  13. package/templates/common/.claude/agents/verifier.md +1 -1
  14. package/templates/common/.claude/commands/update.md +11 -0
  15. package/templates/common/.claude/commands/wf-max.md +28 -0
  16. package/templates/common/.claude/commands/wf.md +10 -4
  17. package/templates/common/.claude/rules/ecc/common.md +2 -2
  18. package/templates/common/.claude/skills/harness-build-loop/SKILL.md +2 -1
  19. package/templates/common/.claude/skills/harness-context/SKILL.md +2 -1
  20. package/templates/common/.claude/skills/harness-lifecycle/SKILL.md +2 -1
  21. package/templates/common/.claude/skills/harness-research/SKILL.md +2 -1
  22. package/templates/common/.claude/skills/harness-router/SKILL.md +1 -1
  23. package/templates/common/.claude/skills/readme-optimizer/SKILL.md +3 -2
  24. package/templates/common/.claude/skills/subagent-orchestrator/SKILL.md +5 -3
  25. package/templates/common/.claude/skills/wf-max/SKILL.md +95 -0
  26. package/templates/common/.claude/skills/wf-mode/SKILL.md +9 -4
  27. package/templates/common/.claude/skills/wf-update/SKILL.md +58 -0
  28. package/templates/common/.harness-version +8 -0
  29. package/templates/common/CLAUDE.md +14 -5
  30. package/templates/common/MEMORY.md +8 -1
  31. package/templates/common/README.md +2 -2
  32. package/templates/common/SETUP.md +24 -14
  33. package/templates/common/docs/README.md +28 -16
  34. package/templates/common/docs/features/_template.md +11 -1
  35. package/templates/common/docs/harness/PLAN.md +37 -88
  36. package/templates/common/docs/harness/PROGRESS.md +17 -0
  37. package/templates/common/docs/harness/WF-MAX.md +134 -0
  38. package/templates/common/docs/harness/WF.md +20 -9
  39. package/templates/common/docs/harness/agent-workflow.md +19 -7
  40. package/templates/common/docs/harness/architecture.md +1 -1
  41. package/templates/common/docs/harness/context-loading.md +17 -5
  42. package/templates/common/docs/harness/dispatch.md +13 -6
  43. package/templates/common/docs/harness/extension.md +4 -4
  44. package/templates/common/docs/harness/lifecycle.md +2 -2
  45. package/templates/common/docs/harness/subagents.md +25 -7
  46. package/templates/common/docs/research/README.md +3 -3
  47. package/templates/common/docs/tasks/_template/ARTIFACTS.md +3 -0
  48. package/templates/common/docs/tasks/_template/NOTES.md +3 -0
  49. package/templates/common/docs/tasks/_template/PLAN.md +40 -0
  50. package/templates/common/docs/tasks/_template/PROGRESS.md +29 -0
  51. package/templates/common/scripts/validate-harness.mjs +70 -7
@@ -2,7 +2,7 @@
2
2
 
3
3
  Purpose: route humans and agents to the smallest useful context. `Harness/README.md` is the primary router.
4
4
 
5
- Default load: `CLAUDE.md`, `Harness/MEMORY.md`, this file, and `Harness/PLAN.md` when work is active. Do not read the whole `Harness/` tree.
5
+ Default load: `CLAUDE.md`, `Harness/MEMORY.md`, this file, and `Harness/PROGRESS.md` when work is active. Do not read the whole `Harness/` tree.
6
6
 
7
7
  ## 0-1 Flow
8
8
 
@@ -17,7 +17,7 @@ For the full phase contract, load [lifecycle.md](lifecycle.md).
17
17
  - This file is a router, not a full spec.
18
18
  - If the task does not clearly match a row below, search by keywords before loading more docs.
19
19
  - project files are the only durable communication channel; chat/subagent transcript state is non-authoritative.
20
- - Important assumptions, decisions, blockers, evidence, and handoffs must be written to [PLAN.md](PLAN.md), the current feature doc, `Harness/MEMORY.md`, or `Harness/memory/*` as appropriate.
20
+ - Important assumptions, decisions, blockers, evidence, and handoffs must be written to the current task's `tasks/<id>/PROGRESS.md` and `tasks/<id>/PLAN.md`, the current feature doc, `Harness/MEMORY.md`, or `Harness/memory/*` as appropriate.
21
21
  - Build commands, git conventions, and release notes belong in root `README.md`, not `CLAUDE.md`.
22
22
  - README rewrites are optional project-doc work. Use `readme-optimizer` and preserve existing public docs unless the user approves a broader restructure.
23
23
  - Code architecture belongs in [architecture.md](architecture.md) or the current feature doc, not `CLAUDE.md`.
@@ -29,7 +29,7 @@ For the full phase contract, load [lifecycle.md](lifecycle.md).
29
29
  - Subagent orchestration methodology lives in [subagents.md](subagents.md).
30
30
  - Extension rules live in [extension.md](extension.md).
31
31
  - Context-loading rules live in [context-loading.md](context-loading.md).
32
- - Progress lives in [PLAN.md](PLAN.md) and the current feature doc.
32
+ - Progress lives in `Harness/PROGRESS.md`, `Harness/tasks/<task-id>/PROGRESS.md`, `Harness/tasks/<task-id>/PLAN.md`, and the current feature doc.
33
33
 
34
34
  ## Keyword Routing
35
35
 
@@ -43,7 +43,7 @@ rg -n "keyword1|keyword2|keyword3" CLAUDE.md README.md Harness
43
43
  ```
44
44
 
45
45
  3. Load only the top matching doc or the smallest matching doc pair.
46
- 4. If keyword search conflicts with the table below, follow the table and record the assumption in `Harness/PLAN.md`.
46
+ 4. If keyword search conflicts with the table below, follow the table and record the assumption in `Harness/tasks/<task-id>/PROGRESS.md`.
47
47
 
48
48
  Keywords are retrieval hints, not project facts.
49
49
 
@@ -51,7 +51,7 @@ Keywords are retrieval hints, not project facts.
51
51
 
52
52
  Load the matching row only. Add adjacent docs only when the loaded doc directly names them.
53
53
 
54
- Routing priority: if a request explicitly says `/wf`, `wf mode`, `workflow mode`, or `wk mode`, or is long, difficult, uncertain, repeated-failure, migration, architecture-heavy, browser-visible, or broad multi-agent implementation work, choose the WF row first. `wf-mode` may then delegate subagent coordination to `subagent-orchestrator`.
54
+ Routing priority: if a request explicitly says `/wf`, `/wf max`, `wf mode`, `workflow mode`, or `wk mode`, or is long, difficult, uncertain, repeated-failure, migration, architecture-heavy, browser-visible, or broad multi-agent implementation work, choose the WF row first. `wf-mode` MUST then delegate subagent coordination to `subagent-orchestrator`.
55
55
 
56
56
  | When to Read | Keywords | Load | Output |
57
57
  | --- | --- | --- | --- |
@@ -59,13 +59,14 @@ Routing priority: if a request explicitly says `/wf`, `wf mode`, `workflow mode`
59
59
  | Need market/tech direction | research, market, competitor, stack, library, pricing, policy | [research/README.md](research/README.md), [research/research-results.md](research/research-results.md) | research protocol, adopted/rejected choices |
60
60
  | Need MVP/spec | PRD, MVP, scope, requirement, acceptance, non-goal | [research/PRD.md](research/PRD.md) | one-page PRD with verifiable acceptance criteria |
61
61
  | Need architecture or boundaries | architecture, boundary, layer, domain, port, adapter, dependency | [architecture.md](architecture.md), [domain/ports.md](domain/ports.md) | layer map, ports, constraints |
62
- | Need WF mode | wf, /wf, wf mode, workflow mode, wk mode, long task, difficult, stuck, repeated failure | [WF.md](WF.md), [PLAN.md](PLAN.md) | exploration plan, second plan, heartbeat, recovery loop; explicit WF/WK loads subagent docs immediately |
63
- | Adding harness to existing project | existing project, onboarding, migrate, bootstrap, preserve, conflict | [extension.md](extension.md), [PLAN.md](PLAN.md), root `README.md` and package/CI files | discovered project facts, preserved config, manual registration plan |
64
- | README optimization | README, docs, quickstart, install docs, architecture diagram, command table, documentation polish | root `README.md`, `.claude/skills/readme-optimizer/SKILL.md`, [PLAN.md](PLAN.md), [architecture.md](architecture.md) as needed | approved README mode, preserved sections, proposed diff plan |
65
- | Need implementation plan | plan, task, write set, verify, milestone, progress | [PLAN.md](PLAN.md), [agent-workflow.md](agent-workflow.md) | tasks, write set, verification commands |
66
- | Need parallel agents | parallel, dispatch, handoff, write set, dependency, status | [subagents.md](subagents.md), [dispatch.md](dispatch.md), [context-loading.md](context-loading.md), [PLAN.md](PLAN.md) | orchestration plan, dispatch table, agent roles, read/write sets |
62
+ | Need WF mode | wf, /wf, wf mode, workflow mode, wk mode, long task, difficult, stuck, repeated failure | [WF.md](WF.md), [PROGRESS.md](PROGRESS.md), the current task `tasks/<id>/PROGRESS.md` and `tasks/<id>/PLAN.md` | exploration plan, second plan, heartbeat, recovery loop; explicit WF/WK loads subagent docs immediately |
63
+ | Need WF Max mode | /wf max, wf max, maximum parallelism, max parallel | [WF-MAX.md](WF-MAX.md), [WF.md](WF.md), [subagents.md](subagents.md), [dispatch.md](dispatch.md) | max-parallel exploration, write-set coloring, wave dispatch |
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
+ | README optimization | README, docs, quickstart, install docs, architecture diagram, command table, documentation polish | root `README.md`, `.claude/skills/readme-optimizer/SKILL.md`, [PROGRESS.md](PROGRESS.md), [architecture.md](architecture.md) as needed | approved README mode, preserved sections, proposed diff plan |
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
+ | Need parallel agents | parallel, dispatch, handoff, write set, dependency, status | [subagents.md](subagents.md), [dispatch.md](dispatch.md), [context-loading.md](context-loading.md), the current task `tasks/<id>/PROGRESS.md` and `tasks/<id>/PLAN.md` | orchestration plan, dispatch table, agent roles, read/write sets |
67
68
  | Adding stack-specific agents/skills | extension, agent, skill, rule, hook, stack-specific, compatibility | [extension.md](extension.md), [dispatch.md](dispatch.md) | compatible agents, skills, rules, hooks |
68
- | Optional workflow installed | workflow, optional, browser-e2e, ui-ux-review, github-pr-review, python-backend, ts-react-frontend | matching `workflows/*.md`, [extension.md](extension.md) | workflow-specific evidence, commands, fallback path |
69
+ | Optional workflow installed | workflow, optional, browser-e2e, 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
70
  | 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
71
  | 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 |
71
72
  | Need feature work | feature, implementation, TDD, test, review, closeout | [features/_template.md](features/_template.md), [agent-workflow.md](agent-workflow.md) | feature doc, tests, implementation loop |
@@ -73,6 +74,7 @@ Routing priority: if a request explicitly says `/wf`, `wf mode`, `workflow mode`
73
74
  | Stateful behavior changes | state, transition, guard, illegal transition, state machine | [state-machines.md](state-machines.md) | states, transitions, illegal transitions |
74
75
  | Review or release check | review, release, finding, risk, evidence, verification | [agent-workflow.md](agent-workflow.md), current feature doc | findings, verification evidence |
75
76
  | Harness readiness check | validate, readiness, placeholder, missing file, release gate | `Harness/scripts/validate-harness.mjs`, `Harness/scripts/validate-harness.mjs --strict` | missing files and unresolved project placeholders |
77
+ | Need harness update | update, /wf update, check for updates, harness version | `.claude/skills/wf-update/SKILL.md`, `Harness/.harness-version` | update plan, safe incremental update, merge candidates |
76
78
 
77
79
  ## Gates
78
80
 
@@ -85,11 +87,12 @@ Routing priority: if a request explicitly says `/wf`, `wf mode`, `workflow mode`
85
87
  - Unsure whether to open a feature doc? Read `agent-workflow.md` Section 1.
86
88
  - Do not spawn a subagent without a role, read boundary, write boundary, and return contract.
87
89
  - Do not run writing agents in parallel unless write sets are disjoint.
88
- - Before coordinating multiple agents, fill `PLAN.md#Parallel Dispatch` and follow `subagents.md` plus `dispatch.md`; if the work also matches WF triggers, enter WF mode first.
89
- - In WF mode, update `PLAN.md#Heartbeat` before long commands, after failures, and at closeout.
90
+ - Before coordinating multiple agents, fill `Harness/tasks/<task-id>/PLAN.md#Subagent Dispatch` and follow `subagents.md` plus `dispatch.md`; if the work also matches WF triggers, enter WF mode first.
91
+ - In WF mode, update `Harness/tasks/<task-id>/PROGRESS.md#Heartbeat` before long commands, after failures, and at closeout.
92
+ - In WF Max mode, never dispatch two implementers with overlapping file claims. Verify disjointness before each wave.
90
93
  - Do not add stack-specific agents or skills without following `extension.md`.
91
94
  - Do not close work without tests or recorded manual verification.
92
- - Do not mark work `Verified` until evidence is recorded in `PLAN.md` or the feature doc.
95
+ - Do not mark work `Verified` until evidence is recorded in the current task's `tasks/<id>/PROGRESS.md` and `tasks/<id>/PLAN.md` or the feature doc.
93
96
  - Run `node Harness/scripts/validate-harness.mjs` for scaffold structure; run `node Harness/scripts/validate-harness.mjs --strict` after bootstrap and before release.
94
97
  - If a doc still has `{{...}}`, treat that section as a template, not project fact.
95
98
 
@@ -98,8 +101,14 @@ Routing priority: if a request explicitly says `/wf`, `wf mode`, `workflow mode`
98
101
  ```text
99
102
  Harness/README.md router only
100
103
  Harness/MEMORY.md resource index
101
- Harness/PLAN.md active execution plan and heartbeat
104
+ Harness/PROGRESS.md global task index and cross-task decisions
105
+ Harness/tasks/<id>/PROGRESS.md per-task progress, phase, heartbeat
106
+ Harness/tasks/<id>/PLAN.md per-task implementation plan and evidence
107
+ Harness/tasks/_template/ task capsule template (copy to create new task)
102
108
  Harness/WF.md long-task workflow and recovery loop
109
+ Harness/WF-MAX.md max-parallelism workflow with wave dispatch
110
+ .claude/skills/wf-max/SKILL.md max-parallelism skill loader
111
+ .claude/commands/wf-max.md /wf max slash command bridge
103
112
  Harness/lifecycle.md 0-1 product flow
104
113
  Harness/subagents.md controller-led subagent orchestration
105
114
  Harness/context-loading.md dynamic loading and subagent packs
@@ -114,7 +123,7 @@ Harness/features/_template.md feature work packet
114
123
  Harness/research/README.md research protocol
115
124
  Harness/research/PRD.md product scope
116
125
  Harness/research/research-results.md research results
117
- Harness/workflows/*.md optional workflow evidence rules
126
+ Harness/workflows/*.md optional workflow evidence rules (if installed)
118
127
  Harness/memory/tool-usage-reflections.md repeated tool failures and better command patterns
119
128
  Harness/memory/user-corrections-preferences.md durable user corrections and preferences
120
129
  Harness/memory/agent-lessons-patterns.md reusable review/debug lessons
@@ -123,4 +132,7 @@ Harness/scripts/validate-harness.mjs lightweight harness gate
123
132
  .claude/skills/* skill-style dynamic loaders
124
133
  .claude/skills/readme-optimizer/SKILL.md README preservation and optional structure pass
125
134
  .claude/commands/wf.md slash command bridge into wf-mode
135
+ .claude/skills/wf-update/SKILL.md GitHub-based harness update
136
+ .claude/commands/update.md /wf update slash command bridge
137
+ Harness/.harness-version scaffold version and file checksums
126
138
  ```
@@ -34,7 +34,17 @@
34
34
  - [ ] {{ACCEPTANCE_CRITERION_2}}
35
35
  - [ ] {{ACCEPTANCE_CRITERION_3}}
36
36
 
37
- ### 1.5 UI Automation Hooks
37
+ ### 1.5 Optimistic UI Rollback
38
+
39
+ If any UI mutation happens before an async operation completes (DOM replacement,
40
+ state update, visual feedback), list the rollback path for when the operation fails:
41
+
42
+ | Mutation | Failure Recovery |
43
+ |----------|-----------------|
44
+ | {{MUTATION_1}} | {{ROLLBACK_1}} |
45
+ | Not applicable — no optimistic mutations are used. | |
46
+
47
+ ### 1.6 UI Automation Hooks
38
48
 
39
49
  For TS/React or browser workflows, define required stable accessible labels/roles and stable test hooks such as `data-testid` before implementation. These selectors must cover critical UI controls and states so CDP, Playwright, and manual verification can target inputs, buttons, filters, rows, empty/error/loading states, dialogs, navigation, and submitted/saved/error feedback without brittle DOM paths.
40
50
 
@@ -1,103 +1,52 @@
1
- # PLAN.md - Active Execution Plan
1
+ # PLAN.md DEPRECATED
2
2
 
3
- Use this file when work spans more than one step, one file, or one agent.
3
+ Workflow state has moved to task-capsule structure. Do not append new content here.
4
4
 
5
- ## Current Goal
5
+ Active state:
6
+ - `Harness/PROGRESS.md` — global task index and cross-task decisions
7
+ - `Harness/tasks/<task-id>/PROGRESS.md` — per-task progress, phase, heartbeat
8
+ - `Harness/tasks/<task-id>/PLAN.md` — per-task implementation plan, verification evidence
6
9
 
7
- {{CURRENT_GOAL}}
10
+ Templates:
11
+ - `Harness/tasks/_template/` — copy this directory to create a new task
8
12
 
9
- ## Phase
13
+ ## Legacy Content (historical reference only)
10
14
 
11
- Choose one: Idea / Research / PRD / Architecture / Plan / Build / Verify / Feedback.
15
+ The sections below are archived from the monolithic PLAN.md era. Active task data has been migrated to `Harness/tasks/`.
12
16
 
13
- Current: {{CURRENT_PHASE}}
17
+ ---
14
18
 
15
- ## Heartbeat
19
+ ### Historical: Dogfood Bootstrap
16
20
 
17
- Mode: normal
18
- Last beat: {{LAST_BEAT}}
19
- Current phase: {{CURRENT_PHASE}}
20
- Current blocker: {{CURRENT_BLOCKER_OR_NONE}}
21
- Next beat trigger: {{NEXT_BEAT_TRIGGER}}
22
- Failure count: 0
23
- Recovery action: {{RECOVERY_ACTION_OR_NONE}}
21
+ Goal: Dogfood the generated Harness scaffold inside this repository so future agents use root `Harness/` routing instead of stale `docs/harness/` guidance.
24
22
 
25
- Update this section before long commands, after long commands, before and after subagent handoffs, after failed verification, and before stopping for user input. In `wf-mode`, use this as the resume point after context loss or interruption.
23
+ **Success Criteria** (all verified):
24
+ - [x] Root `CLAUDE.md` routes through `Harness/MEMORY.md` and `Harness/README.md`
25
+ - [x] Root `MEMORY.md` no longer contains stale `docs/harness/` paths or template placeholders
26
+ - [x] Root `Harness/` and `.claude/` dogfood runtime assets exist
27
+ - [x] Harness strict validation passes
28
+ - [x] Repository tests pass
26
29
 
27
- ## Progress Rules
28
-
29
- - Phase tracks lifecycle progress.
30
- - Task status tracks execution progress.
31
- - Update before handoff, after verification, and when blocked.
32
-
33
- Allowed task statuses: Pending / In Progress / Blocked / Done / Verified.
34
-
35
- - Pending: not started.
36
- - In Progress: active work.
37
- - Blocked: needs user input or external change.
38
- - Done: task complete, evidence not final.
39
- - Verified: verification evidence is recorded.
40
-
41
- ## Success Criteria
42
-
43
- - [ ] {{CRITERION_1}}
44
- - [ ] {{CRITERION_2}}
45
- - [ ] {{CRITERION_3}}
46
-
47
- ## Scope
48
-
49
- Allowed write set:
50
- - `{{PATH_OR_GLOB}}`
51
-
52
- Forbidden:
53
- - {{OUT_OF_SCOPE}}
54
-
55
- ## Loaded Context
56
-
57
- Keep this list short. Add only docs/files used for the current phase.
58
-
59
- - `Harness/README.md`
60
- - `{{LOADED_DOC_OR_FILE}}`
61
-
62
- ## Tasks
63
-
64
- | # | Task | Owner | Verify | Status |
65
- | --- | --- | --- | --- | --- |
66
- | 1 | {{TASK}} | {{OWNER}} | `{{COMMAND_OR_CHECK}}` | Pending |
67
-
68
- ## Parallel Dispatch
69
-
70
- Use [subagents.md](subagents.md) and [dispatch.md](dispatch.md) when more than one agent or bounded pass is useful.
71
-
72
- | Task | Agent | Mode | Read Set | Write Set | Depends On | Output | Status |
73
- | --- | --- | --- | --- | --- | --- | --- | --- |
74
- | {{TASK}} | {{AGENT}} | Parallel Read / Serial Write / Isolated Worktree | `{{READ_SET}}` | `{{WRITE_SET_OR_NONE}}` | {{DEPENDENCY_OR_NONE}} | {{EXPECTED_OUTPUT}} | Pending |
75
-
76
- ## Subagent Synthesis
77
-
78
- Agents used:
79
- Findings accepted:
80
- Findings rejected:
81
- Conflicts:
82
- Decisions:
83
- Next write set:
84
- Verification path:
85
- Residual risk:
86
-
87
- ## Agent Handoffs
88
-
89
- | Agent | Role | Context Pack | Result |
90
- | --- | --- | --- | --- |
91
- | {{AGENT}} | {{ROLE}} | {{DOCS_OR_FILES}} | {{SUMMARY}} |
30
+ **Decisions:**
31
+ | Date | Decision | Reason |
32
+ |------|----------|--------|
33
+ | 2026-06-24 | Dogfood root `Harness/` while keeping templates under `templates/` | Separate package source from operating harness |
34
+ | 2026-06-24 | memory-master + context-master added to commonAgents | Global memory and context management |
92
35
 
93
- ## Decisions
36
+ ### Historical: WF Conflict Fix
94
37
 
95
- | Date | Decision | Reason |
96
- | --- | --- | --- |
97
- | {{YYYY-MM-DD}} | {{DECISION}} | {{REASON}} |
38
+ Goal: Fix WF-mode orphaned files and conflicts: align commands/wf.md, resolve subagent count tension, fix README "may" vs "MUST", add memory-master and context-master agents.
98
39
 
99
- ## Verification
40
+ **Subagent Dispatch:**
41
+ | Agent | Mode | Purpose | Status |
42
+ |-------|------|---------|--------|
43
+ | Subagent 1 | Serial Write | Create memory-master.md, context-master.md, update commands/wf.md | Verified |
44
+ | Subagent 2 | Serial Write | Fix agent-workflow.md, dispatch.md, README.md conflicts | Verified |
45
+ | Subagent 3 | Serial Write | Update WF.md, wf-mode/SKILL.md, subagents.md, MEMORY.md, context-loading.md, CLAUDE.md, validate-harness.mjs | Verified |
46
+ | Subagent 4 | Serial Write | Sync template changes to dogfood runtime files | Verified |
100
47
 
48
+ **Verification:**
101
49
  | Check | Result | Notes |
102
- | --- | --- | --- |
103
- | `{{CHECK}}` | Not run | {{NOTES}} |
50
+ |-------|--------|-------|
51
+ | `node Harness/scripts/validate-harness.mjs --strict` | Pass | all invariants preserved |
52
+ | `npm test` | Pass | 58/58 tests passed |
@@ -0,0 +1,17 @@
1
+ # PROGRESS.md
2
+
3
+ Global task index. Load at session start to see what is active and what was done.
4
+
5
+ ## Active Task
6
+
7
+ None — create a new task from `Harness/tasks/_template/` when work spans more than one step.
8
+
9
+ ## Task Index
10
+
11
+ | ID | Goal | Phase | Closed |
12
+ |----|------|-------|--------|
13
+
14
+ ## Cross-Task Decisions
15
+
16
+ | Date | Decision | Reason |
17
+ |------|----------|--------|
@@ -0,0 +1,134 @@
1
+ # WF-MAX — Maximum Parallelism Workflow
2
+
3
+ ## Trigger
4
+
5
+ - Explicit: `/wf max`
6
+ - Auto: WF task with write-set ≥5 files AND clear disjoint boundaries
7
+ - parallelismScore = (files × avgLines × 3 / 800) × independenceFactor
8
+ - spawn ≥2.0 | maybe 1.0-2.0 | skip <1.0 (degrade to /wf)
9
+
10
+ ## Companion Docs
11
+
12
+ - [subagents.md](subagents.md) — agent roster, controller role, efficiency ladder
13
+ - [dispatch.md](dispatch.md) — handoff format, File claim, Concurrency group fields
14
+ - [agent-workflow.md](agent-workflow.md) — build/test/review loop, cohesion rule, completion gate
15
+
16
+ ## Organization Model
17
+
18
+ ```
19
+ CEO(1) ──┬── Manager₁(span) ──┬── Worker₁..ₙ
20
+ │ └── Sub-Manager(span) → Worker₁..ₙ [depth ≥3]
21
+ └── Manager₂(span) ── Worker₁..ₙ
22
+ ```
23
+
24
+ - CEO: intent, scope, integration, final verification. Direct reports 3-5 Managers.
25
+ - Manager: domain partition → parallel dispatch → synthesize → report. Serial across domains; parallel within domain.
26
+ - 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
+ - depth ≥3: Manager spawns Sub-Manager (span ≤7) instead of Worker. Recursive until leaf condition met.
28
+
29
+ ## Span Formula
30
+
31
+ ```
32
+ span = min(ceil(sqrt(files)), domain_cap)
33
+ Architecture: cap = 3
34
+ Implementation: cap = 5-7
35
+ Review: cap = 7-10
36
+ Research: cap = 10-12
37
+ ```
38
+
39
+ ## Total Agents (recursive, scales to 1000)
40
+
41
+ ```
42
+ total(depth, span) = Σ span^L for L=0..depth
43
+ ```
44
+
45
+ - depth=0: CEO + Workers only (XS)
46
+ - depth=1: CEO + Managers + Workers
47
+ - depth=2: CEO + Managers + Workers
48
+ - depth≥3: CEO + Managers + Sub-Managers + Workers (recursive)
49
+ - no hard agent cap; recursion governed by leaf condition + overhead filter
50
+
51
+ ## Sizing Table
52
+
53
+ | Scale | Files | Depth | CEO | Mgrs | Workers | Total |
54
+ |-------|---------|-------|-----|------|---------|-------|
55
+ | XS | 1-4 | 0 | 1 | 0 | 1-3 | 2-4 |
56
+ | S | 5-12 | 1 | 1 | 2 | 6 | 9 |
57
+ | M | 13-30 | 1 | 1 | 3 | 15 | 19 |
58
+ | L | 31-60 | 2 | 1 | 5 | 35 | 41 |
59
+ | XL | 61-200 | 2 | 1 | 7 | 49 | 57 |
60
+ | XXL | 201-500 | 3 | 1 | 7 | 343 | 351 |
61
+ | XXXL | 501-1000| 3 | 1 | 7 | 686 | 694 |
62
+
63
+ - depth≥3: Managers spawn Sub-Managers (span≤7). No mixed Worker+Sub-Manager dispatch in same wave.
64
+
65
+ ## Leaf Condition (stop splitting)
66
+
67
+ - files ≤ span×2
68
+ - OR avgLines < 50
69
+ - OR overhead > 0.30 (degrade to /wf)
70
+
71
+ ## Manager Types (4)
72
+
73
+ | Type | Trigger | Span | Worker Roles |
74
+ |---------------|-------------------------------|------|---------------------------------------------------------------|
75
+ | Architect-Mgr | cross-file interfaces, new ports | 3 | boundary-researcher, interface-designer, data-flow-mapper |
76
+ | Implement-Mgr | write-set defined | 5-7 | implementer₁..ₙ (1 file_claim each) |
77
+ | Review-Mgr | implementation wave complete | 3-4 | reviewer-spec, reviewer-code, reviewer-security |
78
+ | Explore-Mgr | L+ project, uncertain scope | 5-10 | researcher₁..ₙ, domain-explorer₁..ₙ |
79
+
80
+ ## Manager Synthesis Protocol
81
+
82
+ ```
83
+ 1. COLLECT → await all Worker returns
84
+ 2. DEDUPLICATE → dedupe, merge overlap
85
+ 3. CONFLICT → flag contradictions (file_claim overlap, interface mismatch); no silent resolve
86
+ 4. SYNTHESIZE → single integrated artifact
87
+ 5. REPORT → CEO-actionable synthesis + raw Worker returns (audit)
88
+ ```
89
+
90
+ - Worker failure: retry 1× → on 2nd failure, Manager absorbs or escalates to CEO for replan.
91
+
92
+ ## Wave Orchestration
93
+
94
+ ```
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 coloring → wave dispatch: N parallel implementers (disjoint file_claims) → merge → CEO
98
+ W2R: Review-Mgr → 3-4 parallel reviewers → dedupe + severity → CEO assigns fixes
99
+ W3+: Dependent implementation waves (repeat W2 pattern)
100
+ INTEGRATION: CEO → verifier → fail → debugger → loop (cap=3)
101
+ CLOSEOUT: CEO → context-master + memory-master (direct, no Manager)
102
+ ```
103
+
104
+ - Wave scheduling: Managers serial across domains, Workers parallel within domain.
105
+ - CEO validates wave output before starting next wave. No pipelining.
106
+
107
+ ## Overhead & Cost Filter
108
+
109
+ ```
110
+ overhead(depth) = 0.10 (depth≤2) | 0.20 (depth=3) | 0.35 (depth≥4)
111
+ ```
112
+
113
+ - overhead > 0.30 → degrade to /wf
114
+ - independenceFactor: 1.0 (no deps) | 0.3-0.7 (shared imports)
115
+
116
+ ## When NOT to use /wf max
117
+
118
+ - files < 5 → use /wf
119
+ - all changes share single interface → serial dependency
120
+ - import/re-export refactor → global consistency required
121
+ - communication overhead > 30% → degrade
122
+
123
+ ## /wf vs /wf max
124
+
125
+ | Dimension | /wf | /wf max |
126
+ |------------------|------------------|----------------------------------|
127
+ | Organization | flat | CEO → Mgr → Worker (3-tier) |
128
+ | Exploration | 3-5 serial | Mgr → 10 parallel |
129
+ | Implementation | 1 serial | Mgr → N parallel (span 5-7) |
130
+ | Review | 1-2 serial gate | Mgr → 3-4 parallel dimensions |
131
+ | Span formula | none | sqrt(files) + domain cap |
132
+ | Recursive depth | 0 | 1-3 (scales to 1000 agents) |
133
+ | Context threshold| ~85% | ~70% |
134
+ | Granularity floor| none | <50 lines → no split |
@@ -13,6 +13,7 @@ Enter WF mode when any of these are true:
13
13
  - The task needs research, architecture judgment, browser/API validation, or migration planning.
14
14
  - Confidence in intent, architecture, or implementation is below 95%.
15
15
  - The same command, test, tool, or approach fails twice.
16
+ - The user explicitly says `/wf max` or `wf max` (for maximum-parallelism mode, see [WF-MAX.md](WF-MAX.md)).
16
17
 
17
18
  ## Multi-Subagent Requirement
18
19
 
@@ -21,9 +22,11 @@ WF mode requires multi-subagent orchestration by default.
21
22
  - Explicit `/wf`, `wf mode`, `workflow mode`, or `wk mode` MUST spawn at least 3 distinct subagents from `.claude/agents/` before second planning unless the runtime cannot spawn subagents.
22
23
  - Use a 7:3 collaboration bias: prefer multi-agent collaboration for long, uncertain, cross-file, cross-layer, browser/API, migration, or repeated-failure work; reserve solo mode for clearly local, low-risk, one-file tasks outside explicit WF/WK mode.
23
24
  - Default initial fan-out: `planner`, `researcher` or `docs-researcher`, and `architect`. Add `test-writer`, `reviewer`, `debugger`, or `verifier` when the phase needs them.
24
- - Record every dispatch or bounded-pass fallback in `Harness/PLAN.md#Parallel Dispatch`.
25
+ - Record every dispatch or bounded-pass fallback in `Harness/tasks/<task-id>/PLAN.md#Subagent Dispatch`.
25
26
  - If subagents are unavailable, emulate the same roles as separate bounded passes and record why the fallback was used.
26
27
 
28
+ For maximum-parallelism mode (write-set coloring, wave dispatch, parallel reviewers), use `/wf max` and see [WF-MAX.md](WF-MAX.md).
29
+
27
30
  ## WF Loop
28
31
 
29
32
  ```text
@@ -42,10 +45,10 @@ Intake
42
45
 
43
46
  ## Intake
44
47
 
45
- 1. Read `CLAUDE.md`, `Harness/MEMORY.md`, `Harness/README.md`, and `Harness/PLAN.md`.
48
+ 1. Read `CLAUDE.md`, `Harness/MEMORY.md`, `Harness/README.md`, `Harness/PROGRESS.md`, and the current task's `PROGRESS.md` and `PLAN.md` under `Harness/tasks/<task-id>/`.
46
49
  2. State the goal, non-goals, confidence level, known risks, and write boundaries.
47
50
  3. Ask up to three blocking questions only when the next action cannot reach 95% confidence.
48
- 4. Update `Harness/PLAN.md#Heartbeat` before dispatching agents or running long commands.
51
+ 4. Update `Harness/tasks/<task-id>/PROGRESS.md#Heartbeat` before dispatching agents or running long commands.
49
52
  5. Load `Harness/subagents.md` before coordinating multiple agents; explicit WF/WK mode always coordinates multiple roles.
50
53
 
51
54
  ## Exploration
@@ -59,13 +62,14 @@ Use parallel read-only subagents first. Explicit WF/WK mode starts with at least
59
62
  | `docs-researcher` | official docs, SDK/API versions, browser/tool limits | none unless returning a docs patch |
60
63
  | `architect` | boundaries, ports, data flow, state impact, migration risks | none unless returning a docs patch |
61
64
 
62
- Use local files first. Use web search, Tavily, TinyFish, GitHub, official docs, or user-provided links only when the decision needs current or external evidence. Record tool choice and limitations in `Harness/research/research-results.md` or `Harness/PLAN.md`.
65
+ Use local files first. Use web search, Tavily, TinyFish, GitHub, official docs, or user-provided links only when the decision needs current or external evidence. Record tool choice and limitations in `Harness/research/research-results.md` or `Harness/tasks/<task-id>/PLAN.md`.
63
66
 
64
67
  ## Subagent Orchestration
65
68
 
66
69
  Use `Harness/subagents.md` as the orchestration methodology and `Harness/dispatch.md` as the dispatch table protocol.
67
70
 
68
71
  - The main agent is the controller and owns synthesis, integration, and final verification.
72
+ - Subagents are readers and reporters. Only the main agent writes to task PROGRESS.md and PLAN.md. Subagents return PLAN patch suggestions which the main agent reviews before committing.
69
73
  - Parallelize read-only exploration; serialize writers unless write sets are disjoint and isolated.
70
74
  - Every subagent gets a dispatch pack with role, goal, read set, write set, forbidden scope, injected docs, evidence, stop condition, and return format.
71
75
  - After implementation, run spec review before code-quality or architecture review.
@@ -84,7 +88,7 @@ After exploration, synthesize:
84
88
  - verification path
85
89
  - rollback or recovery plan
86
90
 
87
- Write the result to `Harness/PLAN.md` before implementation.
91
+ Write the result to `Harness/tasks/<task-id>/PLAN.md` before implementation. Update `Harness/tasks/<task-id>/PROGRESS.md#Heartbeat`.
88
92
 
89
93
  ## Build And Review
90
94
 
@@ -111,20 +115,20 @@ For API changes, run the project API/integration test path or a documented real
111
115
 
112
116
  If verification fails:
113
117
 
114
- 1. Update `Harness/PLAN.md#Heartbeat` with failure count and blocker.
118
+ 1. Update `Harness/tasks/<task-id>/PROGRESS.md#Heartbeat` with failure count and blocker.
115
119
  2. Dispatch `debugger` with the failing command, error output, and smallest relevant files.
116
120
  3. Fix the smallest reproduced failure.
117
121
  4. Run reviewer again.
118
122
  5. Run verifier again.
119
123
  6. Repeat until verified or blocked by missing user input/external state.
120
124
 
121
- If the same failure class happens three times, stop blind fixes. Record evidence, likely root causes, attempted paths, and ask the user to choose among clear options.
125
+ If the same failure class happens three times, stop blind fixes. Before asking the user, dispatch `memory-master` to record the failure pattern, attempted paths, and root cause hypothesis to `Harness/memory/agent-lessons-patterns.md`. Then present evidence-backed options to the user.
122
126
 
123
127
  ## Heartbeat Protocol
124
128
 
125
129
  Heartbeat is a lightweight recovery protocol, not a background daemon.
126
130
 
127
- Update `Harness/PLAN.md#Heartbeat`:
131
+ Update `Harness/tasks/<task-id>/PROGRESS.md#Heartbeat`:
128
132
 
129
133
  - before a long command
130
134
  - after a long command
@@ -135,6 +139,8 @@ Update `Harness/PLAN.md#Heartbeat`:
135
139
 
136
140
  The agent may set the next beat interval by event instead of time, such as "after next test run", "after reviewer returns", or "after browser evidence is captured".
137
141
 
142
+ When context approaches ~85% of the window, dispatch `context-master` to analyze and append a compression suggestion to `Harness/tasks/<task-id>/PROGRESS.md#Heartbeat`. The suggestion is non-blocking; the controller checks it at the next natural pause point.
143
+
138
144
  ## Closeout
139
145
 
140
146
  Close only when:
@@ -143,4 +149,9 @@ Close only when:
143
149
  - reviewer has no unresolved critical/high findings
144
150
  - test/API/browser evidence is recorded
145
151
  - affected Harness docs are synced
146
- - `Harness/PLAN.md#Heartbeat` says the task is verified or lists the exact next recovery action
152
+ - `context-master` has analyzed the session and extracted durable knowledge
153
+ - `memory-master` has consolidated extracted knowledge into `Harness/memory/*` and `Harness/MEMORY.md`
154
+ - Current task PROGRESS.md and PLAN.md are archived under `Harness/tasks/<task-id>/` with Phase set to Verified
155
+ - `Harness/PROGRESS.md` task index is updated (Closed column filled, Active Task cleared or set to next task)
156
+ - `Harness/tasks/<task-id>/PROGRESS.md#Heartbeat` says the task is verified or lists the exact next recovery action
157
+ - `Harness/PROGRESS.md` task index reflects the closed task
@@ -5,16 +5,26 @@ Use when implementing, reviewing, debugging, or coordinating subagents.
5
5
  ## ReAct Loop
6
6
 
7
7
  ```text
8
- Observe -> Load minimal context -> Plan -> Act -> Verify -> Update Harness/PLAN.md
8
+ Observe -> Load minimal context -> Plan -> Act -> Verify -> Update Harness/tasks/<task-id>/PROGRESS.md
9
9
  ```
10
10
 
11
11
  If context grows, load [context-loading.md](context-loading.md) and split the work. If more than one agent is useful, load [subagents.md](subagents.md) and [dispatch.md](dispatch.md).
12
12
 
13
13
  ## Feature Packet
14
14
 
15
- Every PRD scope item (`research/PRD.md` Section 2) must have its own feature doc at `Harness/features/<name>.md` created from `Harness/features/_template.md`. One feature = one doc = one implementation unit. Do not code without a feature doc.
15
+ Every PRD scope item must be covered by a feature doc at `Harness/features/<name>.md`
16
+ created from `Harness/features/_template.md`. Do not code without a feature doc.
16
17
 
17
- Small scope is not an exception a short feature doc is better than none. If the work is truly too small for a full feature doc (single-file fix, no behavior change), it is not a PRD scope item.
18
+ **Cohesion rule**: if multiple PRD scope items share the same write set, the same
19
+ test/verification path, and the same review boundary, group them into a single
20
+ feature doc. The PRD owns scope decomposition; the feature doc owns the
21
+ implementation unit. The number of feature docs should reflect the number of
22
+ distinguishable implementation units, not the number of PRD checkboxes.
23
+
24
+ **Minimum bar**: a feature doc is still required when the implementation touches
25
+ more than one file or changes user-visible behavior. Only skip a feature doc
26
+ entirely when the work is a single-file fix with no behavior change — in that
27
+ case, record the change in `Harness/tasks/<task-id>/PLAN.md` instead.
18
28
 
19
29
  **New vs iterate**: if a PRD scope item has ≥85% overlap with an existing feature doc, open the existing doc, bump `Version`, and add a `## Changelog` entry. Only create a new file when the scope is substantially different. When unsure, ask.
20
30
 
@@ -58,16 +68,16 @@ Rules:
58
68
 
59
69
  ## Parallel Dispatch
60
70
 
61
- Use [subagents.md](subagents.md) and [dispatch.md](dispatch.md) for multi-agent work. Default to at most three active agents. Prefer parallel read-only work first, then serial writes.
71
+ Use [subagents.md](subagents.md) and [dispatch.md](dispatch.md) for multi-agent work. Default to at most three active agents (WF mode overrides this; see [WF.md](WF.md)). In `/wf max`, the CEO/Manager/Worker hierarchy in [WF-MAX.md](WF-MAX.md) overrides this limit entirely with wave-based parallel dispatch. Prefer parallel read-only work first, then serial writes.
62
72
 
63
73
  Every dispatched agent returns the handoff format defined in [dispatch.md](dispatch.md).
64
74
 
65
75
  ## Conflict Rule
66
76
 
67
- If PRD, Harness/PLAN.md, architecture, ports, tests, or code disagree:
77
+ If PRD, task PLAN.md, architecture, ports, tests, or code disagree:
68
78
 
69
79
  1. stop implementation
70
- 2. record the conflict in `Harness/PLAN.md` or the feature doc
80
+ 2. record the conflict in `Harness/tasks/<task-id>/PROGRESS.md` or the feature doc
71
81
  3. choose the smallest reversible decision
72
82
  4. ask the maintainer when user-visible behavior or security is affected
73
83
 
@@ -79,4 +89,6 @@ Close only when:
79
89
  - verification evidence is recorded
80
90
  - architecture, ports, data-flow, or state docs are synced if affected
81
91
  - no unresolved critical/high review findings remain
82
- - `Harness/PLAN.md` states the final status or next iteration
92
+ - any optimistic UI mutation has a declared and verified rollback path
93
+ - any file declared as DONE in PLAN.md or PROGRESS.md exists on disk (chat output is not durable evidence)
94
+ - `Harness/tasks/<task-id>/PROGRESS.md` states the final status or next iteration
@@ -60,7 +60,7 @@ State must have one owner, legal transitions, and observable recovery behavior.
60
60
  - Identify durable state, runtime cache, derived UI state, external system state, and audit/event history separately.
61
61
  - Name the owner of each state slice; do not let UI, application services, and infrastructure all mutate the same state directly.
62
62
  - Model long-running workflows with explicit states, guards, and failure transitions in `Harness/state-machines.md`.
63
- - Store resumable progress and recovery decisions in `Harness/PLAN.md#Heartbeat` or project-owned durable storage, not only in chat.
63
+ - Store resumable progress and recovery decisions in `Harness/tasks/<task-id>/PROGRESS.md#Heartbeat` or project-owned durable storage, not only in chat.
64
64
  - Keep state minimal: derive values when cheap, persist only what must survive reload, retry, or handoff.
65
65
 
66
66
  ---