create-harness-vibe-coding 0.1.10 → 0.2.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 (52) hide show
  1. package/README-CN.md +94 -0
  2. package/README.md +86 -35
  3. package/package.json +3 -2
  4. package/src/generator.js +72 -12
  5. package/src/index.js +30 -11
  6. package/templates/common/.claude/agents/architect.md +4 -4
  7. package/templates/common/.claude/agents/debugger.md +1 -1
  8. package/templates/common/.claude/agents/docs-researcher.md +4 -4
  9. package/templates/common/.claude/agents/implementer.md +1 -1
  10. package/templates/common/.claude/agents/planner.md +3 -3
  11. package/templates/common/.claude/agents/researcher.md +4 -4
  12. package/templates/common/.claude/agents/reviewer.md +1 -1
  13. package/templates/common/.claude/agents/test-writer.md +2 -2
  14. package/templates/common/.claude/agents/verifier.md +1 -1
  15. package/templates/common/.claude/commands/wf.md +18 -0
  16. package/templates/common/.claude/rules/ecc/common.md +11 -10
  17. package/templates/common/.claude/skills/harness-build-loop/SKILL.md +4 -3
  18. package/templates/common/.claude/skills/harness-context/SKILL.md +4 -3
  19. package/templates/common/.claude/skills/harness-lifecycle/SKILL.md +3 -3
  20. package/templates/common/.claude/skills/harness-research/SKILL.md +4 -4
  21. package/templates/common/.claude/skills/harness-router/SKILL.md +7 -5
  22. package/templates/common/.claude/skills/readme-optimizer/SKILL.md +48 -0
  23. package/templates/common/.claude/skills/subagent-orchestrator/SKILL.md +39 -0
  24. package/templates/common/.claude/skills/wf-mode/SKILL.md +50 -0
  25. package/templates/common/AGENTS.md +2 -2
  26. package/templates/common/CLAUDE.md +40 -73
  27. package/templates/common/MEMORY.md +32 -27
  28. package/templates/common/README.md +41 -0
  29. package/templates/common/SETUP.md +101 -74
  30. package/templates/common/docs/README.md +71 -54
  31. package/templates/common/docs/domain/ports.md +4 -1
  32. package/templates/common/docs/features/_template.md +10 -10
  33. package/templates/common/docs/harness/PLAN.md +25 -2
  34. package/templates/common/docs/harness/WF.md +146 -0
  35. package/templates/common/docs/harness/agent-workflow.md +8 -8
  36. package/templates/common/docs/harness/architecture.md +31 -7
  37. package/templates/common/docs/harness/context-loading.md +16 -16
  38. package/templates/common/docs/harness/data-flow.md +1 -1
  39. package/templates/common/docs/harness/dispatch.md +5 -2
  40. package/templates/common/docs/harness/extension.md +14 -14
  41. package/templates/common/docs/harness/lifecycle.md +2 -2
  42. package/templates/common/docs/harness/state-machines.md +8 -0
  43. package/templates/common/docs/harness/subagents.md +176 -0
  44. package/templates/common/docs/research/PRD.md +1 -1
  45. package/templates/common/docs/research/README.md +5 -5
  46. package/templates/common/scripts/validate-harness.mjs +150 -56
  47. package/templates/optional/skills/browser-e2e/.claude/skills/browser-e2e/SKILL.md +5 -5
  48. package/templates/optional/skills/browser-e2e/docs/workflows/browser-e2e.md +1 -1
  49. package/templates/optional/skills/github-pr-review/.claude/skills/github-pr-review/SKILL.md +5 -5
  50. package/templates/optional/skills/python-backend/.claude/skills/python-backend/SKILL.md +5 -5
  51. package/templates/optional/skills/ts-react-frontend/.claude/skills/ts-react-frontend/SKILL.md +5 -5
  52. package/templates/optional/skills/ui-ux-review/.claude/skills/ui-ux-review/SKILL.md +5 -5
@@ -1,6 +1,6 @@
1
1
  # {{FEATURE_NAME}}
2
2
 
3
- > **When to use**: Every PRD scope item in `research/PRD.md` Section 2 must have a feature doc — either a new one from this template, or an iteration on an existing one. Do not code a PRD scope item without a corresponding features doc.
3
+ > **When to use**: Every PRD scope item in `Harness/research/PRD.md` Section 2 must have a feature doc — either a new one from this template, or an iteration on an existing one. Do not code a PRD scope item without a corresponding features doc.
4
4
  >
5
5
  > **New vs iterate**: If the scope item has ≥85% overlap with an existing feature doc, iterate the existing doc (bump `Version`, add a `## Changelog` entry). If overlap is below 85%, create a new file from this template. When in doubt, ask the user.
6
6
 
@@ -52,10 +52,10 @@ For TS/React or browser workflows, define required stable accessible labels/role
52
52
 
53
53
  | Area | Impacted? | Notes |
54
54
  | --- | --- | --- |
55
- | `harness/architecture.md` | {{YES_NO}} | {{NOTE}} |
56
- | `domain/ports.md` | {{YES_NO}} | {{NOTE}} |
57
- | `harness/data-flow.md` | {{YES_NO}} | {{NOTE}} |
58
- | `harness/state-machines.md` | {{YES_NO}} | {{NOTE}} |
55
+ | `Harness/architecture.md` | {{YES_NO}} | {{NOTE}} |
56
+ | `Harness/domain/ports.md` | {{YES_NO}} | {{NOTE}} |
57
+ | `Harness/data-flow.md` | {{YES_NO}} | {{NOTE}} |
58
+ | `Harness/state-machines.md` | {{YES_NO}} | {{NOTE}} |
59
59
  | tests | {{YES_NO}} | {{NOTE}} |
60
60
 
61
61
  ### 2.2 Allowed Write Set
@@ -132,11 +132,11 @@ Estimate the context budget for this feature. If the main agent would need to re
132
132
 
133
133
  ### 4.3 Docs Sync
134
134
 
135
- - [ ] `harness/architecture.md`
136
- - [ ] `domain/ports.md`
137
- - [ ] `harness/data-flow.md`
138
- - [ ] `harness/state-machines.md`
139
- - [ ] `research/research-results.md`
135
+ - [ ] `Harness/architecture.md`
136
+ - [ ] `Harness/domain/ports.md`
137
+ - [ ] `Harness/data-flow.md`
138
+ - [ ] `Harness/state-machines.md`
139
+ - [ ] `Harness/research/research-results.md`
140
140
  - [ ] Not needed because {{REASON}}
141
141
 
142
142
  ### 4.4 Decision Log
@@ -12,6 +12,18 @@ Choose one: Idea / Research / PRD / Architecture / Plan / Build / Verify / Feedb
12
12
 
13
13
  Current: {{CURRENT_PHASE}}
14
14
 
15
+ ## Heartbeat
16
+
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}}
24
+
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.
26
+
15
27
  ## Progress Rules
16
28
 
17
29
  - Phase tracks lifecycle progress.
@@ -44,7 +56,7 @@ Forbidden:
44
56
 
45
57
  Keep this list short. Add only docs/files used for the current phase.
46
58
 
47
- - `docs/README.md`
59
+ - `Harness/README.md`
48
60
  - `{{LOADED_DOC_OR_FILE}}`
49
61
 
50
62
  ## Tasks
@@ -55,12 +67,23 @@ Keep this list short. Add only docs/files used for the current phase.
55
67
 
56
68
  ## Parallel Dispatch
57
69
 
58
- Use [dispatch.md](dispatch.md) when more than one agent or bounded pass is useful.
70
+ Use [subagents.md](subagents.md) and [dispatch.md](dispatch.md) when more than one agent or bounded pass is useful.
59
71
 
60
72
  | Task | Agent | Mode | Read Set | Write Set | Depends On | Output | Status |
61
73
  | --- | --- | --- | --- | --- | --- | --- | --- |
62
74
  | {{TASK}} | {{AGENT}} | Parallel Read / Serial Write / Isolated Worktree | `{{READ_SET}}` | `{{WRITE_SET_OR_NONE}}` | {{DEPENDENCY_OR_NONE}} | {{EXPECTED_OUTPUT}} | Pending |
63
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
+
64
87
  ## Agent Handoffs
65
88
 
66
89
  | Agent | Role | Context Pack | Result |
@@ -0,0 +1,146 @@
1
+ # WF Mode - Long Task Workflow
2
+
3
+ Use this when work is long, difficult, uncertain, multi-file, multi-agent, or user-triggered with `/wf`, `wf mode`, `workflow mode`, or `wk mode`.
4
+
5
+ This is a Ralph-style harness loop: keep moving through evidence, bounded exploration, second planning, implementation, review, verification, and recovery instead of stalling on the first obstacle.
6
+
7
+ ## Trigger
8
+
9
+ Enter WF mode when any of these are true:
10
+
11
+ - The user explicitly says `/wf`, `wf mode`, `workflow mode`, `wk mode`, or asks for the full workflow.
12
+ - The task needs more than one step, more than three files, or more than one subsystem.
13
+ - The task needs research, architecture judgment, browser/API validation, or migration planning.
14
+ - Confidence in intent, architecture, or implementation is below 95%.
15
+ - The same command, test, tool, or approach fails twice.
16
+
17
+ ## Multi-Subagent Requirement
18
+
19
+ WF mode requires multi-subagent orchestration by default.
20
+
21
+ - 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
+ - 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
+ - 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
+ - If subagents are unavailable, emulate the same roles as separate bounded passes and record why the fallback was used.
26
+
27
+ ## WF Loop
28
+
29
+ ```text
30
+ Intake
31
+ -> confidence gate
32
+ -> parallel planner / researcher / docs-researcher / architect subagents
33
+ -> synthesis
34
+ -> second plan
35
+ -> test-writer
36
+ -> implementer
37
+ -> reviewers
38
+ -> verifier
39
+ -> if failed: debugger -> review -> e2e/API verification -> loop
40
+ -> close with evidence
41
+ ```
42
+
43
+ ## Intake
44
+
45
+ 1. Read `CLAUDE.md`, `Harness/MEMORY.md`, `Harness/README.md`, and `Harness/PLAN.md`.
46
+ 2. State the goal, non-goals, confidence level, known risks, and write boundaries.
47
+ 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.
49
+ 5. Load `Harness/subagents.md` before coordinating multiple agents; explicit WF/WK mode always coordinates multiple roles.
50
+
51
+ ## Exploration
52
+
53
+ Use parallel read-only subagents first. Explicit WF/WK mode starts with at least three distinct `.claude/agents/` roles before the second plan. For automatic WF triggers, default to 3-5 active agents unless the task is clearly small enough for the solo exception.
54
+
55
+ | Agent | Purpose | Writes |
56
+ | --- | --- | --- |
57
+ | `planner` | map local project facts, commands, app entry points, existing docs, and initial decomposition | none |
58
+ | `researcher` | product, ecosystem, dependency, and external context | none unless returning a docs patch |
59
+ | `docs-researcher` | official docs, SDK/API versions, browser/tool limits | none unless returning a docs patch |
60
+ | `architect` | boundaries, ports, data flow, state impact, migration risks | none unless returning a docs patch |
61
+
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`.
63
+
64
+ ## Subagent Orchestration
65
+
66
+ Use `Harness/subagents.md` as the orchestration methodology and `Harness/dispatch.md` as the dispatch table protocol.
67
+
68
+ - The main agent is the controller and owns synthesis, integration, and final verification.
69
+ - Parallelize read-only exploration; serialize writers unless write sets are disjoint and isolated.
70
+ - Every subagent gets a dispatch pack with role, goal, read set, write set, forbidden scope, injected docs, evidence, stop condition, and return format.
71
+ - After implementation, run spec review before code-quality or architecture review.
72
+ - If subagents are unavailable, emulate the same roles as bounded passes and record the fallback.
73
+
74
+ ## Second Plan
75
+
76
+ After exploration, synthesize:
77
+
78
+ - facts found
79
+ - assumptions
80
+ - risks
81
+ - accepted/rejected options
82
+ - tasks
83
+ - read/write sets
84
+ - verification path
85
+ - rollback or recovery plan
86
+
87
+ Write the result to `Harness/PLAN.md` before implementation.
88
+
89
+ ## Build And Review
90
+
91
+ 1. `test-writer` defines a failing test or written manual check first.
92
+ 2. `implementer` changes only the declared write set.
93
+ 3. At least one `reviewer` checks diff, architecture, risks, and missing tests.
94
+ 4. For cross-layer or risky work, run separate reviewers for architecture and test adequacy.
95
+ 5. `verifier` runs the declared checks and records exact evidence.
96
+
97
+ ## Browser And API Evidence
98
+
99
+ For browser-visible changes, typecheck/build/unit tests are not enough. Use Chrome DevTools, CDP, Playwright, or a documented real-browser run:
100
+
101
+ - start the app and record URL/port
102
+ - click through the critical flow
103
+ - capture frontend console/runtime errors
104
+ - capture failed network requests
105
+ - collect backend logs when the flow crosses an API
106
+ - record screenshot, trace, video, or manual evidence path
107
+
108
+ For API changes, run the project API/integration test path or a documented real request against a local service and record request, response, logs, and failure behavior.
109
+
110
+ ## Recovery Loop
111
+
112
+ If verification fails:
113
+
114
+ 1. Update `Harness/PLAN.md#Heartbeat` with failure count and blocker.
115
+ 2. Dispatch `debugger` with the failing command, error output, and smallest relevant files.
116
+ 3. Fix the smallest reproduced failure.
117
+ 4. Run reviewer again.
118
+ 5. Run verifier again.
119
+ 6. Repeat until verified or blocked by missing user input/external state.
120
+
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.
122
+
123
+ ## Heartbeat Protocol
124
+
125
+ Heartbeat is a lightweight recovery protocol, not a background daemon.
126
+
127
+ Update `Harness/PLAN.md#Heartbeat`:
128
+
129
+ - before a long command
130
+ - after a long command
131
+ - before spawning subagents
132
+ - after integrating subagent returns
133
+ - after each failed verification
134
+ - before stopping for user input
135
+
136
+ 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
+
138
+ ## Closeout
139
+
140
+ Close only when:
141
+
142
+ - acceptance criteria are satisfied
143
+ - reviewer has no unresolved critical/high findings
144
+ - test/API/browser evidence is recorded
145
+ - affected Harness docs are synced
146
+ - `Harness/PLAN.md#Heartbeat` says the task is verified or lists the exact next recovery action
@@ -5,14 +5,14 @@ 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 docs/harness/PLAN.md
8
+ Observe -> Load minimal context -> Plan -> Act -> Verify -> Update Harness/PLAN.md
9
9
  ```
10
10
 
11
- If context grows, load [context-loading.md](context-loading.md) and split the work. If more than one agent is useful, load [dispatch.md](dispatch.md).
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 `docs/features/<name>.md` created from `docs/features/_template.md`. One feature = one doc = one implementation unit. Do not code without a feature doc.
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.
16
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
18
 
@@ -32,7 +32,7 @@ PRD/feature packet
32
32
 
33
33
  ## Subagent Use
34
34
 
35
- Use subagents when a task needs broad reading, parallel work, cross-layer changes, independent review, or isolated debugging.
35
+ Use subagents when a task needs broad reading, parallel work, cross-layer changes, independent review, or isolated debugging. Follow [subagents.md](subagents.md) for controller-led orchestration and [dispatch.md](dispatch.md) for the dispatch table.
36
36
 
37
37
  Before spawn, define:
38
38
 
@@ -58,16 +58,16 @@ Rules:
58
58
 
59
59
  ## Parallel Dispatch
60
60
 
61
- Use [dispatch.md](dispatch.md) for multi-agent work. Default to at most three active agents. Prefer parallel read-only work first, then serial writes.
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.
62
62
 
63
63
  Every dispatched agent returns the handoff format defined in [dispatch.md](dispatch.md).
64
64
 
65
65
  ## Conflict Rule
66
66
 
67
- If PRD, docs/harness/PLAN.md, architecture, ports, tests, or code disagree:
67
+ If PRD, Harness/PLAN.md, architecture, ports, tests, or code disagree:
68
68
 
69
69
  1. stop implementation
70
- 2. record the conflict in `docs/harness/PLAN.md` or the feature doc
70
+ 2. record the conflict in `Harness/PLAN.md` or the feature doc
71
71
  3. choose the smallest reversible decision
72
72
  4. ask the maintainer when user-visible behavior or security is affected
73
73
 
@@ -79,4 +79,4 @@ Close only when:
79
79
  - verification evidence is recorded
80
80
  - architecture, ports, data-flow, or state docs are synced if affected
81
81
  - no unresolved critical/high review findings remain
82
- - `docs/harness/PLAN.md` states the final status or next iteration
82
+ - `Harness/PLAN.md` states the final status or next iteration
@@ -41,9 +41,33 @@
41
41
 
42
42
  ---
43
43
 
44
- ## 2. Harness Core Components
44
+ ## 2. Interface Decoupling
45
45
 
46
- ### 2.1 Runner / Loop
46
+ Use interfaces or ports to protect real boundaries, not to create abstraction for its own sake.
47
+
48
+ - Define a port when code crosses a layer, process, network, storage, SDK, browser, or permission boundary.
49
+ - Keep domain and application logic independent from infrastructure adapters.
50
+ - Pass data through explicit contracts instead of reaching into another feature's internals.
51
+ - Prefer direct calls inside the same cohesive module when there is only one caller, one implementation, and no boundary to protect.
52
+ - Avoid speculative abstraction: do not add factories, plugin systems, service locators, generic repositories, or config layers until the feature has a concrete second use or a real testability/replacement need.
53
+
54
+ ---
55
+
56
+ ## 3. State Design
57
+
58
+ State must have one owner, legal transitions, and observable recovery behavior.
59
+
60
+ - Identify durable state, runtime cache, derived UI state, external system state, and audit/event history separately.
61
+ - Name the owner of each state slice; do not let UI, application services, and infrastructure all mutate the same state directly.
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.
64
+ - Keep state minimal: derive values when cheap, persist only what must survive reload, retry, or handoff.
65
+
66
+ ---
67
+
68
+ ## 4. Harness Core Components
69
+
70
+ ### 4.1 Runner / Loop
47
71
 
48
72
  - **Responsibility**: Drives a task from input to completion: loading context, calling application use-cases, handling stop conditions.
49
73
  - **Design Decision**:
@@ -51,28 +75,28 @@
51
75
  - Stop conditions are explicitly modeled — Rationale: prevents agent loops from running indefinitely or silently half-completing
52
76
  - **Does NOT handle**: Business rules, domain object creation details, external service implementations
53
77
 
54
- ### 2.2 Permission Policy
78
+ ### 4.2 Permission Policy
55
79
 
56
80
  - **Responsibility**: Decides whether a given tool, file, network, or external action is allowed to execute.
57
81
  - **Design Decision**:
58
82
  - High-risk actions are denied by default, allow rules are explicitly declared — Rationale: the platform must first guarantee security boundaries
59
83
  - **Does NOT handle**: Judging whether a business action is correct
60
84
 
61
- ### 2.3 Event Bus / Audit Trail
85
+ ### 4.3 Event Bus / Audit Trail
62
86
 
63
87
  - **Responsibility**: Records task lifecycle, tool invocations, failures, human approvals, and final results.
64
88
  - **Design Decision**:
65
89
  - Events are append-only, audit records cannot be overwritten in place — Rationale: facilitates replay, debugging, and post-mortem analysis
66
90
  - **Does NOT handle**: Saving final data on behalf of business systems
67
91
 
68
- ### 2.4 State / Checkpoint Store
92
+ ### 4.4 State / Checkpoint Store
69
93
 
70
94
  - **Responsibility**: Saves recoverable state, context summaries, task progress, and interrupt points.
71
95
  - **Design Decision**:
72
96
  - State format must be serializable — Rationale: enables replay, resume, testing, and migration
73
97
  - **Does NOT handle**: Long-term business database modeling
74
98
 
75
- ### 2.5 Tool Registry
99
+ ### 4.5 Tool Registry
76
100
 
77
101
  - **Responsibility**: Registers callable tools along with their input/output contracts, permission labels, and error semantics.
78
102
  - **Design Decision**:
@@ -81,7 +105,7 @@
81
105
 
82
106
  ---
83
107
 
84
- ## 3. Architectural Constraints (Non-Negotiable)
108
+ ## 5. Architectural Constraints (Non-Negotiable)
85
109
 
86
110
  - `domain/` only defines business models, business invariants, and port protocols; does not import `harness/`, `infrastructure/`, or `interfaces/`.
87
111
  - `harness/` may orchestrate workflows, security gates, auditing, and stop conditions, but must not determine business meaning.
@@ -4,20 +4,20 @@ Use when context is growing, subagents are needed, or an agent is unsure which h
4
4
 
5
5
  ## Routing Authority
6
6
 
7
- `docs/README.md` is the primary router. This file is a secondary context-splitting protocol for subagents and long tasks.
7
+ `Harness/README.md` is the primary router. This file is a secondary context-splitting protocol for subagents and long tasks.
8
8
 
9
- If this file and `docs/README.md` disagree, follow `docs/README.md`, record the assumption in `docs/harness/PLAN.md`, and update this file later.
9
+ If this file and `Harness/README.md` disagree, follow `Harness/README.md`, record the assumption in `Harness/PLAN.md`, and update this file later.
10
10
 
11
- project files are the only durable communication channel; chat/subagent transcript state is non-authoritative. Important assumptions, decisions, blockers, evidence, and handoffs must be written to `docs/harness/PLAN.md`, the current feature doc, `MEMORY.md`, or `memory/*` as appropriate.
11
+ project files are the only durable communication channel; chat/subagent transcript state is non-authoritative. Important assumptions, decisions, blockers, evidence, and handoffs must be written to `Harness/PLAN.md`, the current feature doc, `Harness/MEMORY.md`, or `Harness/memory/*` as appropriate.
12
12
 
13
13
  ## Main Context
14
14
 
15
15
  Always keep:
16
16
 
17
17
  - `CLAUDE.md`
18
- - `MEMORY.md`
19
- - `docs/README.md`
20
- - `docs/harness/PLAN.md` when active
18
+ - `Harness/MEMORY.md`
19
+ - `Harness/README.md`
20
+ - `Harness/PLAN.md` when active
21
21
  - current feature doc when active
22
22
 
23
23
  Load other docs only by trigger.
@@ -26,16 +26,16 @@ Load other docs only by trigger.
26
26
 
27
27
  | Trigger | Load |
28
28
  | --- | --- |
29
- | idea, scope, MVP | `docs/harness/lifecycle.md`, `docs/research/PRD.md` |
30
- | research, competitors, stack choice | `docs/research/README.md`, `docs/research/research-results.md` |
31
- | official docs, API, SDK, version, limits | `docs/research/README.md`, `docs/harness/architecture.md`, `docs/domain/ports.md` as needed |
32
- | layer, dependency, module boundary | `docs/harness/architecture.md`, `docs/domain/ports.md` |
33
- | task split, owner, write set | `docs/harness/PLAN.md`, `docs/harness/agent-workflow.md` |
34
- | parallel agents, dispatch, worktree decision | `docs/harness/dispatch.md`, `docs/harness/PLAN.md` |
35
- | memory, repeated tool failure, repeated user correction, reusable lesson | `MEMORY.md`, the relevant `memory/*.md` file |
36
- | event, retry, failure path | `docs/harness/data-flow.md` |
37
- | status, transition, resume | `docs/harness/state-machines.md` |
38
- | subagent spawn | this file plus the role pack below |
29
+ | idea, scope, MVP | `Harness/lifecycle.md`, `Harness/research/PRD.md` |
30
+ | research, competitors, stack choice | `Harness/research/README.md`, `Harness/research/research-results.md` |
31
+ | official docs, API, SDK, version, limits | `Harness/research/README.md`, `Harness/architecture.md`, `Harness/domain/ports.md` as needed |
32
+ | layer, dependency, module boundary | `Harness/architecture.md`, `Harness/domain/ports.md` |
33
+ | task split, owner, write set | `Harness/PLAN.md`, `Harness/agent-workflow.md` |
34
+ | parallel agents, dispatch, worktree decision | `Harness/subagents.md`, `Harness/dispatch.md`, `Harness/PLAN.md` |
35
+ | memory, repeated tool failure, repeated user correction, reusable lesson | `Harness/MEMORY.md`, the relevant `Harness/memory/*.md` file |
36
+ | event, retry, failure path | `Harness/data-flow.md` |
37
+ | status, transition, resume | `Harness/state-machines.md` |
38
+ | subagent spawn | `Harness/subagents.md`, this file plus the role pack below |
39
39
 
40
40
  ## Subagent Packs
41
41
 
@@ -1,7 +1,7 @@
1
1
  # Data Flow — {{projectName}}
2
2
 
3
3
  > **Purpose**: Define the complete lifecycle of each event/request — happy path + all failure branches.
4
- > **This is the most important file in the entire docs folder** — what AI most often invents during implementation is failure-path behavior. Write it clearly and it won't.
4
+ > **This is the most important runtime-flow file in `Harness/`** — what AI most often invents during implementation is failure-path behavior. Write it clearly and it won't.
5
5
  >
6
6
  > Philosophy source: EventCatalog pattern + arc42 Chapter 6 (Runtime View).
7
7
 
@@ -2,13 +2,15 @@
2
2
 
3
3
  Purpose: coordinate a small set of subagents without building a scheduler.
4
4
 
5
+ Use [subagents.md](subagents.md) for orchestration strategy. Use this file for the dispatch table, handoff format, and status protocol.
6
+
5
7
  Use when work needs parallel reading, independent review, cross-layer analysis, or more than one bounded implementation pass.
6
8
 
7
9
  ## Principles
8
10
 
9
11
  - Main agent owns the final decision, integration, and verification.
10
12
  - project files are the only durable communication channel; chat/subagent transcript state is non-authoritative.
11
- - Important assumptions, decisions, blockers, evidence, and handoffs must be written to `docs/harness/PLAN.md`, the current feature doc, `MEMORY.md`, or `memory/*` as appropriate.
13
+ - Important assumptions, decisions, blockers, evidence, and handoffs must be written to `Harness/PLAN.md`, the current feature doc, `Harness/MEMORY.md`, or `Harness/memory/*` as appropriate.
12
14
  - Prefer three or fewer active agents.
13
15
  - Read-only agents may run in parallel.
14
16
  - Writing agents run serially unless write sets are disjoint.
@@ -20,6 +22,7 @@ Use when work needs parallel reading, independent review, cross-layer analysis,
20
22
  ```text
21
23
  Goal
22
24
  -> Fill PLAN tasks and Parallel Dispatch
25
+ -> Apply subagents.md efficiency ladder
23
26
  -> Run parallel read-only agents
24
27
  -> Main agent integrates findings
25
28
  -> Test Writer defines failing test or manual check
@@ -78,7 +81,7 @@ PLAN patch:
78
81
  ```
79
82
 
80
83
  Use `Files changed: none` for read-only agents. Use `PLAN patch: none` when no state update is needed.
81
- If a handoff matters after context loss, write it to `docs/harness/PLAN.md`, the current feature doc, or `memory/*`; do not rely on chat transcript state.
84
+ If a handoff matters after context loss, write it to `Harness/PLAN.md`, the current feature doc, or `Harness/memory/*`; do not rely on chat transcript state.
82
85
 
83
86
  ## Statuses
84
87
 
@@ -8,12 +8,12 @@ Use during setup whenever adding assets from ECC, SuperClaude, toolboxes, or loc
8
8
 
9
9
  Extensions must preserve project and harness ownership boundaries.
10
10
 
11
- - Preserve existing `.claude/`, `CLAUDE.md`, `AGENTS.md`, `.gitignore`, `docs/README.md`, `docs/workflows/*.md`, settings, hooks, and local rules unless the user explicitly requests an overwrite.
11
+ - Preserve existing `.claude/`, `CLAUDE.md`, `AGENTS.md`, `.gitignore`, `Harness/README.md`, `Harness/workflows/*.md`, settings, hooks, and local rules unless the user explicitly requests an overwrite.
12
12
  - Treat existing project config as project fact. Read it before adding assets, then adapt new assets to the project instead of replacing the project.
13
- - Register added agents, skills, workflows, rules, and hooks in `MEMORY.md` and this docs router where applicable.
14
- - Added assets may extend `.claude/skills/`, `.claude/agents/`, `.claude/rules/`, or `docs/workflows/`, but they must not replace core harness docs.
15
- - Core harness docs are `docs/README.md`, `docs/harness/PLAN.md`, `docs/harness/context-loading.md`, `docs/harness/dispatch.md`, `docs/harness/agent-workflow.md`, and this file.
16
- - If an optional workflow needs a new command or tool, document the command and fallback in `docs/workflows/<name>.md` instead of changing core harness behavior.
13
+ - Register added agents, skills, workflows, rules, and hooks in `Harness/MEMORY.md` and this docs router where applicable.
14
+ - Added assets may extend `.claude/skills/`, `.claude/agents/`, `.claude/rules/`, or `Harness/workflows/`, but they must not replace core harness docs.
15
+ - Core harness docs are `Harness/README.md`, `Harness/PLAN.md`, `Harness/subagents.md`, `Harness/context-loading.md`, `Harness/dispatch.md`, `Harness/agent-workflow.md`, and this file.
16
+ - If an optional workflow needs a new command or tool, document the command and fallback in `Harness/workflows/<name>.md` instead of changing core harness behavior.
17
17
 
18
18
  ## Agent Contract
19
19
 
@@ -44,7 +44,7 @@ Agent body must state:
44
44
  - allowed write set or read-only
45
45
  - forbidden scope
46
46
  - verification or evidence
47
- - return format from [dispatch.md](dispatch.md)
47
+ - return format from [subagents.md](subagents.md) and [dispatch.md](dispatch.md)
48
48
 
49
49
  ## Skill Contract
50
50
 
@@ -55,10 +55,10 @@ Every added skill must state:
55
55
  - required inputs
56
56
  - allowed writes
57
57
  - output format
58
- - whether to update `docs/harness/PLAN.md`
59
- - whether to use [dispatch.md](dispatch.md)
58
+ - whether to update `Harness/PLAN.md`
59
+ - whether to use [subagents.md](subagents.md) and [dispatch.md](dispatch.md)
60
60
 
61
- Skills should extend the harness. They should not replace `docs/README.md`, `PLAN.md`, `context-loading.md`, `dispatch.md`, or `agent-workflow.md`.
61
+ Skills should extend the harness. They should not replace `Harness/README.md`, `PLAN.md`, `subagents.md`, `context-loading.md`, `dispatch.md`, or `agent-workflow.md`.
62
62
 
63
63
  ## Rules
64
64
 
@@ -72,8 +72,8 @@ Skills should extend the harness. They should not replace `docs/README.md`, `PLA
72
72
 
73
73
  After adding assets:
74
74
 
75
- - list agents in `MEMORY.md#Agents`
76
- - list skills in `MEMORY.md#Skills`
77
- - list workflows by path in `MEMORY.md` or `docs/README.md`
78
- - update `docs/harness/PLAN.md` when the asset affects current work
79
- - run `node scripts/validate-harness.mjs`
75
+ - list agents in `Harness/MEMORY.md#Agents`
76
+ - list skills in `Harness/MEMORY.md#Skills`
77
+ - list workflows by path in `Harness/MEMORY.md` or `Harness/README.md`
78
+ - update `Harness/PLAN.md` when the asset affects current work
79
+ - run `node Harness/scripts/validate-harness.mjs`
@@ -9,8 +9,8 @@ Use when starting a new product, clarifying a vague idea, or deciding the next p
9
9
  | Idea | user intent | problem, target user, non-goals | unclear points asked or assumptions recorded |
10
10
  | Research | problem and constraints | `research/research-results.md` | `research/README.md` followed; at least 3 references or explicit reason not possible |
11
11
  | PRD | research decision | `research/PRD.md` | MVP, non-goals, acceptance criteria are verifiable |
12
- | Architecture | PRD | `harness/architecture.md`, `domain/ports.md` | boundaries and first ports are defined |
13
- | Plan | PRD and architecture | `docs/harness/PLAN.md`, optional `docs/harness/dispatch.md`, one `docs/features/<name>.md` per PRD scope item | tasks have owners, write sets, verification |
12
+ | Architecture | PRD | `Harness/architecture.md`, `Harness/domain/ports.md` | boundaries and first ports are defined |
13
+ | Plan | PRD and architecture | `Harness/PLAN.md`, optional `Harness/dispatch.md`, one `Harness/features/<name>.md` per PRD scope item | tasks have owners, write sets, verification |
14
14
  | Build | plan and tests | minimal vertical slice | tests or manual checks prove behavior |
15
15
  | Verify | implementation | review findings, test evidence | no unresolved critical/high findings |
16
16
  | Feedback | verified slice | next iteration or release decision | learnings recorded in PRD, PLAN, or MEMORY |
@@ -10,6 +10,14 @@
10
10
 
11
11
  Fill out each stateful component using this format:
12
12
 
13
+ Before defining states, name the state owner and persistence level. State that crosses agent handoff, retry, browser session, API workflow, or release boundary must have explicit transitions; temporary derived state should stay local and should not become a new state machine.
14
+
15
+ ### State Ownership
16
+
17
+ | State Slice | Owner | Persistence | Notes |
18
+ | --- | --- | --- | --- |
19
+ | `{{STATE_SLICE}}` | `{{OWNER}}` | durable / runtime / derived / external | {{NOTES}} |
20
+
13
21
  ### State Enumeration
14
22
 
15
23
  | State | Description | Entry Condition | Exit Condition |