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
@@ -0,0 +1,176 @@
1
+ # Subagent Orchestration
2
+
3
+ Purpose: coordinate subagents for speed without losing control of scope, evidence, or integration.
4
+
5
+ Use this file when work needs multiple roles, parallel reading, independent review, broad context, repeated failures, or `/wf`.
6
+
7
+ 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.
8
+
9
+ ## Source Attribution
10
+
11
+ This harness distills ideas from these sources. Keep the protocol local and conservative; do not import external runtimes by default.
12
+
13
+ | Source | Found By | Adopted Idea |
14
+ | --- | --- | --- |
15
+ | `superpowers:dispatching-parallel-agents` | local skill | Dispatch one agent per independent problem domain; give focused scope and exact context. |
16
+ | `superpowers:subagent-driven-development` | local skill | Fresh implementer per task; spec review before code-quality review; handle `DONE`, `DONE_WITH_CONCERNS`, `NEEDS_CONTEXT`, and `BLOCKED`. |
17
+ | [`flc1125/skills@subagent-orchestrator`](https://skills.sh/flc1125/skills/subagent-orchestrator) | `npx skills find "subagent orchestration"` | Explicit subagent invocation, role-specific prompts, tool permission awareness. |
18
+ | [`davila7/claude-code-templates@parallel-agents`](https://skills.sh/davila7/claude-code-templates/parallel-agents) | `npx skills find "parallel agents"` | Discovery -> domain agents -> synthesis; one unified synthesis instead of scattered reports. |
19
+ | [`ruvnet/ruflo@agent-workflow`](https://skills.sh/ruvnet/ruflo/agent-workflow) | `npx skills find "agent workflow"` | Workflow thinking: triggers, agent assignments, parallel processing, and stateful handoffs. |
20
+ | [`pcvelz/superpowers@subagent-driven-development`](https://skills.sh/pcvelz/superpowers/subagent-driven-development) | `npx skills find "subagent driven development"` | Implementer plus review gates for spec compliance and code quality. |
21
+ | [`oimiragieo/agent-studio`](https://skills.sh/oimiragieo/agent-studio/dispatching-parallel-agents) | Skills CLI / public docs | Router-subordinate architecture and durable handoff discipline. |
22
+ | [`subagent-orchestration-skill`](https://skills.rest/rjtaryn/skills/subagent-orchestration-skill) | public docs | Multi-stage executor, spec reviewer, code reviewer, circuit breaker, and escalation pattern. |
23
+
24
+ ## Controller Role
25
+
26
+ The main agent is the controller. It owns:
27
+
28
+ - intent confidence and user questions
29
+ - task decomposition
30
+ - read/write set boundaries
31
+ - dispatch table in `Harness/PLAN.md`
32
+ - integration of returned summaries
33
+ - final verification and closeout
34
+
35
+ Subagents provide bounded work. They do not own final scope, architecture, release claims, or user-facing decisions.
36
+
37
+ ## Built-in Agent Roster
38
+
39
+ Use the installed roster under `.claude/agents/` before inventing ad hoc roles.
40
+
41
+ | Agent | Default Use |
42
+ | --- | --- |
43
+ | `planner` | decompose goals, map unknowns, define success criteria and write sets |
44
+ | `researcher` | local/external ecosystem context, comparable projects, current facts |
45
+ | `docs-researcher` | official docs, SDK/API behavior, browser/tool constraints |
46
+ | `architect` | boundaries, interface decoupling, state ownership, data flow, migration risk |
47
+ | `test-writer` | failing tests, manual check contracts, browser/API evidence plan |
48
+ | `implementer` | bounded code or doc changes after the second plan |
49
+ | `reviewer` | spec compliance, code quality, maintainability, security, missing tests |
50
+ | `debugger` | reproduced failures, root cause isolation, smallest safe fix |
51
+ | `verifier` | command execution, real browser/API checks, final evidence |
52
+
53
+ ## WF Default Fan-Out
54
+
55
+ Explicit `/wf`, `wf mode`, `workflow mode`, or `wk mode` requires at least 3 distinct agents from `.claude/agents/` before second planning.
56
+
57
+ Default starter set:
58
+
59
+ - `planner` for decomposition and local map
60
+ - `architect` for boundaries, interfaces, and state impact
61
+ - `researcher` or `docs-researcher` depending whether the unknowns are project/ecosystem facts or official tool/API behavior
62
+
63
+ Then add phase-specific agents:
64
+
65
+ - `test-writer` before implementation
66
+ - `implementer` for the serial write lane
67
+ - `reviewer` for spec and code-quality gates
68
+ - `debugger` after a reproduced verification failure
69
+ - `verifier` for final command/browser/API evidence
70
+
71
+ The default decision ratio is a 7:3 collaboration bias: choose multi-agent collaboration for substantial or uncertain work about 70% of the time; choose solo mode only for clearly local, low-risk work that is not explicitly in WF/WK mode.
72
+
73
+ ## Efficiency Ladder
74
+
75
+ Choose the cheapest coordination level that is safe.
76
+
77
+ | Level | Use When | Pattern |
78
+ | --- | --- | --- |
79
+ | Solo pass | one file, low risk, clear intent | no subagent |
80
+ | Single reviewer | small change with meaningful risk | implement, then reviewer |
81
+ | Parallel read-only | broad reading, research, architecture, multiple independent failures | 2-3 read-only agents |
82
+ | Serial build lane | normal feature or fix | test-writer -> implementer -> reviewers -> verifier |
83
+ | Isolated lanes | disjoint write sets or competing approaches | separate worktrees, then review and merge |
84
+
85
+ Default for automatic WF triggers: 3-5 active read-only agents before second planning. For explicit WF/WK mode, never use the solo pass unless subagents are unavailable; use bounded role passes as the recorded fallback.
86
+
87
+ ## WF Orchestration Shape
88
+
89
+ ```text
90
+ controller intake
91
+ -> parallel planner/researcher/docs-researcher/architect subagents
92
+ -> controller synthesis
93
+ -> second plan with dependencies and write sets
94
+ -> test-writer
95
+ -> implementer
96
+ -> spec reviewer
97
+ -> code/architecture reviewer
98
+ -> verifier
99
+ -> if failed: debugger/fixer -> review -> verify -> loop
100
+ -> close with evidence
101
+ ```
102
+
103
+ Use this shape for `/wf`, long tasks, multi-file changes, architecture work, migrations, browser/API behavior, or repeated failures.
104
+
105
+ ## Dispatch Pack
106
+
107
+ Every subagent dispatch must be self-contained:
108
+
109
+ ```text
110
+ Role:
111
+ Goal:
112
+ Mode: read-only | write
113
+ Read set:
114
+ Write set:
115
+ Forbidden scope:
116
+ Injected docs:
117
+ Dependencies:
118
+ Expected evidence:
119
+ Stop condition:
120
+ Return format:
121
+ ```
122
+
123
+ Do not make a subagent rediscover the entire project or read the whole harness. Inject only the docs selected by `Harness/README.md` and `Harness/context-loading.md`.
124
+
125
+ ## Parallelism Rules
126
+
127
+ - Read-only agents may run in parallel.
128
+ - Writing agents run serially unless write sets are disjoint and the controller has chosen an isolated worktree.
129
+ - Reviewers may run in parallel after implementation, but spec compliance is evaluated before code-quality approval.
130
+ - Do not let two agents edit `Harness/PLAN.md`, `Harness/MEMORY.md`, or `Harness/memory/*` concurrently. The controller writes durable state.
131
+ - If two agents disagree, the controller records the conflict in `Harness/PLAN.md` and chooses the smallest reversible next step.
132
+
133
+ ## Review Gates
134
+
135
+ Implementation is not complete until both gates pass:
136
+
137
+ 1. **Spec review**: confirms the result matches the user request, PRD, feature doc, acceptance criteria, and non-goals. Extra features are failures.
138
+ 2. **Code-quality review**: checks correctness, maintainability, architecture, tests, security, and integration risk.
139
+
140
+ If either reviewer finds issues, the implementer or debugger fixes them and the same gate runs again. Do not move to verifier with open critical/high findings.
141
+
142
+ ## Subagent Status Handling
143
+
144
+ | Status | Controller Action |
145
+ | --- | --- |
146
+ | `DONE` | start review gates |
147
+ | `DONE_WITH_CONCERNS` | read concerns, decide whether to address before review, record in `PLAN.md` |
148
+ | `NEEDS_CONTEXT` | provide only missing context and re-dispatch |
149
+ | `BLOCKED` | change something: add context, split task, upgrade reasoning, use debugger, or ask user |
150
+
151
+ Never retry the same failed prompt unchanged.
152
+
153
+ ## Failure Recovery
154
+
155
+ - First failed verification: record evidence, dispatch debugger with the smallest reproduced failure.
156
+ - Second same-class failure: narrow scope, update `PLAN.md#Heartbeat`, and add a reviewer before another fix.
157
+ - Third same-class failure: stop blind fixes. Present evidence-backed options to the user.
158
+
159
+ The recovery loop must preserve the same evidence standard as the main workflow: real commands, real browser/API checks when applicable, and recorded logs or artifacts.
160
+
161
+ ## Synthesis Output
162
+
163
+ After subagents return, the controller writes one synthesis into `Harness/PLAN.md`:
164
+
165
+ ```text
166
+ Agents used:
167
+ Findings accepted:
168
+ Findings rejected:
169
+ Conflicts:
170
+ Decisions:
171
+ Next write set:
172
+ Verification path:
173
+ Residual risk:
174
+ ```
175
+
176
+ Only the synthesis and named files enter main context. Do not replay full subagent conversations.
@@ -15,7 +15,7 @@
15
15
 
16
16
  ### v0.1 Must Be Able To
17
17
 
18
- > Each item below must be split into a separate `docs/features/<name>.md` created from `docs/features/_template.md` before implementation begins. One feature = one doc = one implementation unit.
18
+ > Each item below must be split into a separate `Harness/features/<name>.md` created from `Harness/features/_template.md` before implementation begins. One feature = one doc = one implementation unit.
19
19
 
20
20
  - [ ] {{MUST_1}}
21
21
  - [ ] {{MUST_2}}
@@ -6,7 +6,7 @@ Purpose: guide agent research. Record conclusions in [research-results.md](resea
6
6
 
7
7
  Use this before PRD, stack choice, external API use, public dependency choice, pricing/legal/security assumptions, or any fact likely to change.
8
8
 
9
- Skip only when the task is local, narrow, and fully answerable from existing project files. Record the skip reason in `docs/harness/PLAN.md`.
9
+ Skip only when the task is local, narrow, and fully answerable from existing project files. Record the skip reason in `Harness/PLAN.md`.
10
10
 
11
11
  ## Research Agent
12
12
 
@@ -21,7 +21,7 @@ Built-in agents:
21
21
  - `.claude/agents/researcher.md`: product, market, open-source, dependency, pricing, policy, and ecosystem research.
22
22
  - `.claude/agents/docs-researcher.md`: official docs, API, SDK, config, limits, errors, and examples verification.
23
23
 
24
- For multi-agent research plus build work, create the dispatch table in `docs/harness/PLAN.md` and follow `docs/harness/dispatch.md`.
24
+ For multi-agent research plus build work, create the dispatch table in `Harness/PLAN.md` and follow `Harness/dispatch.md`.
25
25
 
26
26
  Research Agent input:
27
27
 
@@ -104,14 +104,14 @@ Use these patterns when turning research into PRD or feature docs:
104
104
 
105
105
  ## Write Target
106
106
 
107
- - Research process, queries, and limitations: this file or `docs/harness/PLAN.md`.
107
+ - Research process, queries, and limitations: this file or `Harness/PLAN.md`.
108
108
  - Final research decisions: [research-results.md](research-results.md).
109
109
  - Product scope: [PRD.md](PRD.md).
110
- - Architecture consequences: `docs/harness/architecture.md` and `docs/domain/ports.md`.
110
+ - Architecture consequences: `Harness/architecture.md` and `Harness/domain/ports.md`.
111
111
 
112
112
  ## Architecture Decision References
113
113
 
114
- When filling `docs/harness/architecture.md`, `docs/domain/ports.md`, and `docs/research/research-results.md`, use these high-trust sources as starting points. Search within them; do not read them whole.
114
+ When filling `Harness/architecture.md`, `Harness/domain/ports.md`, and `Harness/research/research-results.md`, use these high-trust sources as starting points. Search within them; do not read them whole.
115
115
 
116
116
  ### System Design & Architecture Patterns
117
117
 
@@ -7,7 +7,7 @@ const args = new Set(process.argv.slice(2));
7
7
  const strict = args.has('--strict') || args.has('--post-bootstrap');
8
8
 
9
9
  if (args.has('--help') || args.has('-h')) {
10
- console.log(`Usage: node scripts/validate-harness.mjs [--strict]
10
+ console.log(`Usage: node Harness/scripts/validate-harness.mjs [--strict]
11
11
 
12
12
  Default mode checks scaffold structure, links, agents, and skills.
13
13
  --strict also fails when project fact docs still contain unresolved {{TOKEN}} placeholders.
@@ -33,46 +33,53 @@ const commonSkills = [
33
33
  'harness-research',
34
34
  'harness-context',
35
35
  'harness-build-loop',
36
+ 'wf-mode',
37
+ 'subagent-orchestrator',
38
+ 'readme-optimizer',
36
39
  ];
37
40
 
38
41
  const memoryFiles = [
39
- 'memory/tool-usage-reflections.md',
40
- 'memory/user-corrections-preferences.md',
41
- 'memory/agent-lessons-patterns.md',
42
+ 'Harness/memory/tool-usage-reflections.md',
43
+ 'Harness/memory/user-corrections-preferences.md',
44
+ 'Harness/memory/agent-lessons-patterns.md',
42
45
  ];
43
46
 
44
47
  const required = [
45
48
  'AGENTS.md',
46
49
  'CLAUDE.md',
47
- 'MEMORY.md',
50
+ 'README.md',
51
+ 'Harness/MEMORY.md',
52
+ 'Harness/WF.md',
48
53
  ...memoryFiles,
49
54
  '.claude/settings.json',
55
+ '.claude/commands/wf.md',
50
56
  '.claude/rules/ecc/common.md',
51
57
  ...commonAgents.map(agent => `.claude/agents/${agent}.md`),
52
58
  ...commonSkills.map(skill => `.claude/skills/${skill}/SKILL.md`),
53
- 'docs/README.md',
54
- 'docs/harness/PLAN.md',
55
- 'docs/harness/lifecycle.md',
56
- 'docs/harness/dispatch.md',
57
- 'docs/harness/extension.md',
58
- 'docs/harness/context-loading.md',
59
- 'docs/harness/agent-workflow.md',
60
- 'docs/harness/architecture.md',
61
- 'docs/harness/data-flow.md',
62
- 'docs/harness/state-machines.md',
63
- 'docs/features/_template.md',
64
- 'docs/research/README.md',
65
- 'docs/research/research-results.md',
66
- 'docs/research/PRD.md',
67
- 'docs/domain/ports.md',
59
+ 'Harness/README.md',
60
+ 'Harness/PLAN.md',
61
+ 'Harness/lifecycle.md',
62
+ 'Harness/subagents.md',
63
+ 'Harness/dispatch.md',
64
+ 'Harness/extension.md',
65
+ 'Harness/context-loading.md',
66
+ 'Harness/agent-workflow.md',
67
+ 'Harness/architecture.md',
68
+ 'Harness/data-flow.md',
69
+ 'Harness/state-machines.md',
70
+ 'Harness/features/_template.md',
71
+ 'Harness/research/README.md',
72
+ 'Harness/research/research-results.md',
73
+ 'Harness/research/PRD.md',
74
+ 'Harness/domain/ports.md',
68
75
  ];
69
76
 
70
77
  const projectFacts = [
71
- 'docs/harness/PLAN.md',
72
- 'docs/research/PRD.md',
73
- 'docs/research/research-results.md',
74
- 'docs/harness/architecture.md',
75
- 'docs/domain/ports.md',
78
+ 'Harness/PLAN.md',
79
+ 'Harness/research/PRD.md',
80
+ 'Harness/research/research-results.md',
81
+ 'Harness/architecture.md',
82
+ 'Harness/domain/ports.md',
76
83
  ];
77
84
 
78
85
  const contextPacks = [
@@ -89,9 +96,10 @@ const contextPacks = [
89
96
  ];
90
97
 
91
98
  const durableCommunicationDocs = [
92
- 'docs/README.md',
93
- 'docs/harness/dispatch.md',
94
- 'docs/harness/context-loading.md',
99
+ 'Harness/README.md',
100
+ 'Harness/subagents.md',
101
+ 'Harness/dispatch.md',
102
+ 'Harness/context-loading.md',
95
103
  ];
96
104
 
97
105
  const errors = [];
@@ -141,14 +149,40 @@ function unresolvedTemplatePlaceholders(text) {
141
149
  return [...new Set(placeholders)];
142
150
  }
143
151
 
152
+ function registeredSkillFiles(...texts) {
153
+ const files = new Set();
154
+ const pattern = /(?:\.\.\/)?(\.claude\/skills\/[a-z0-9-]+\/SKILL\.md)/g;
155
+
156
+ for (const text of texts) {
157
+ for (const match of text.matchAll(pattern)) {
158
+ files.add(match[1]);
159
+ }
160
+ }
161
+
162
+ return [...files].sort();
163
+ }
164
+
165
+ function registeredWorkflowFiles(...texts) {
166
+ const files = new Set();
167
+ const pattern = /(?:Harness\/)?workflows\/([A-Za-z0-9._-]+\.md)/g;
168
+
169
+ for (const text of texts) {
170
+ for (const match of text.matchAll(pattern)) {
171
+ files.add(`Harness/workflows/${match[1]}`);
172
+ }
173
+ }
174
+
175
+ return [...files].sort();
176
+ }
177
+
144
178
  for (const rel of required) {
145
179
  if (!fs.existsSync(path.join(root, rel))) {
146
180
  errors.push(`missing required file: ${rel}`);
147
181
  }
148
182
  }
149
183
 
150
- if (fs.existsSync(path.join(root, 'docs/research/scaffolds.md'))) {
151
- errors.push('legacy research file should be renamed: docs/research/scaffolds.md -> docs/research/research-results.md');
184
+ if (fs.existsSync(path.join(root, 'Harness/research/scaffolds.md'))) {
185
+ errors.push('legacy research file should be renamed: Harness/research/scaffolds.md -> Harness/research/research-results.md');
152
186
  }
153
187
 
154
188
  if (strict) {
@@ -165,10 +199,10 @@ if (strict) {
165
199
  }
166
200
  }
167
201
 
168
- const docsReadme = read('docs/README.md');
202
+ const docsReadme = read('Harness/README.md');
169
203
  if (docsReadme) {
170
204
  for (const marker of ['## Keyword Routing', '## Load By Task', 'When to Read', 'Keywords']) {
171
- if (!docsReadme.includes(marker)) errors.push(`docs/README.md missing router marker: ${marker}`);
205
+ if (!docsReadme.includes(marker)) errors.push(`Harness/README.md missing router marker: ${marker}`);
172
206
  }
173
207
  }
174
208
 
@@ -179,50 +213,77 @@ for (const rel of durableCommunicationDocs) {
179
213
 
180
214
  requireText('CLAUDE.md', 'same tool/use pattern fails 3+ times', 'tool reflection trigger');
181
215
  requireText('CLAUDE.md', 'user corrects the same assumption/pattern 2+ times', 'user correction reflection trigger');
216
+ requireText('CLAUDE.md', 'If `Harness/` exists, this repository is governed by the Harness contract', 'Harness binding contract');
217
+ requireText('CLAUDE.md', 'Harness/MEMORY.md` is the memory/resource router', 'memory/resource router');
218
+ requireText('CLAUDE.md', 'Harness/README.md#Load By Task', 'Harness task router');
219
+ requireText('CLAUDE.md', 'Harness/SETUP.md` exists, follow it before normal project work', 'setup bootstrap contract');
220
+ requireText('CLAUDE.md', 'subagent-orchestrator` and `Harness/subagents.md', 'subagent orchestrator entry trigger');
221
+ for (const heading of ['## 2. Think Before Coding', '## 3. Simplicity First', '## 4. Surgical Changes', '## 5. Goal-Driven Execution']) {
222
+ requireText('CLAUDE.md', heading, `Karpathy-style rule heading: ${heading}`);
223
+ }
182
224
 
183
- const plan = read('docs/harness/PLAN.md');
225
+ const plan = read('Harness/PLAN.md');
184
226
  if (plan) {
185
- for (const heading of ['## Current Goal', '## Phase', '## Success Criteria', '## Loaded Context', '## Tasks', '## Parallel Dispatch', '## Verification']) {
186
- if (!plan.includes(heading)) errors.push(`docs/harness/PLAN.md missing heading: ${heading}`);
227
+ for (const heading of ['## Current Goal', '## Phase', '## Heartbeat', '## Success Criteria', '## Loaded Context', '## Tasks', '## Parallel Dispatch', '## Subagent Synthesis', '## Verification']) {
228
+ if (!plan.includes(heading)) errors.push(`Harness/PLAN.md missing heading: ${heading}`);
229
+ }
230
+ for (const marker of ['Next beat trigger', 'Recovery action']) {
231
+ if (!plan.includes(marker)) errors.push(`Harness/PLAN.md missing heartbeat marker: ${marker}`);
187
232
  }
188
233
  }
189
234
 
190
- const dispatch = read('docs/harness/dispatch.md');
235
+ const dispatch = read('Harness/dispatch.md');
191
236
  if (dispatch) {
192
237
  for (const agent of commonAgents) {
193
- if (!dispatch.includes(`\`${agent}\``)) errors.push(`docs/harness/dispatch.md missing common agent: ${agent}`);
238
+ if (!dispatch.includes(`\`${agent}\``)) errors.push(`Harness/dispatch.md missing common agent: ${agent}`);
194
239
  }
195
- if (!dispatch.includes('## Handoff Format')) errors.push('docs/harness/dispatch.md missing heading: ## Handoff Format');
240
+ if (!dispatch.includes('## Handoff Format')) errors.push('Harness/dispatch.md missing heading: ## Handoff Format');
196
241
  }
197
242
 
198
- const contextLoading = read('docs/harness/context-loading.md');
243
+ const contextLoading = read('Harness/context-loading.md');
199
244
  if (contextLoading) {
200
- if (!contextLoading.includes('docs/README.md` is the primary router')) {
201
- errors.push('docs/harness/context-loading.md must declare docs/README.md as the primary router');
245
+ if (!contextLoading.includes('Harness/README.md` is the primary router')) {
246
+ errors.push('Harness/context-loading.md must declare Harness/README.md as the primary router');
202
247
  }
203
248
  for (const pack of contextPacks) {
204
- if (!contextLoading.includes(pack)) errors.push(`docs/harness/context-loading.md missing subagent pack: ${pack}`);
249
+ if (!contextLoading.includes(pack)) errors.push(`Harness/context-loading.md missing subagent pack: ${pack}`);
205
250
  }
206
251
  }
207
252
 
208
- const memory = read('MEMORY.md');
253
+ const memory = read('Harness/MEMORY.md');
209
254
  if (memory) {
210
255
  for (const agent of commonAgents) {
211
256
  const rel = `.claude/agents/${agent}.md`;
212
- if (!memory.includes(rel)) errors.push(`MEMORY.md missing agent registration: ${rel}`);
257
+ if (!memory.includes(rel)) errors.push(`Harness/MEMORY.md missing agent registration: ${rel}`);
213
258
  }
214
259
  for (const skill of commonSkills) {
215
260
  const rel = `.claude/skills/${skill}/SKILL.md`;
216
- if (!memory.includes(rel)) errors.push(`MEMORY.md missing skill registration: ${rel}`);
261
+ if (!memory.includes(rel)) errors.push(`Harness/MEMORY.md missing skill registration: ${rel}`);
217
262
  }
218
263
  for (const rel of memoryFiles) {
219
- if (!memory.includes(rel)) errors.push(`MEMORY.md missing memory file registration: ${rel}`);
264
+ const relativeRel = rel.replace(/^Harness\//, '');
265
+ if (!memory.includes(rel) && !memory.includes(relativeRel)) {
266
+ errors.push(`Harness/MEMORY.md missing memory file registration: ${rel}`);
267
+ }
268
+ }
269
+ }
270
+
271
+ for (const workflow of listMarkdownFiles('Harness/workflows')) {
272
+ const relativeWorkflow = workflow.replace(/^Harness\//, '');
273
+ if (!docsReadme.includes(workflow) && !docsReadme.includes(relativeWorkflow) && !memory.includes(workflow) && !memory.includes(relativeWorkflow)) {
274
+ errors.push(`workflow is not registered in Harness/README.md or Harness/MEMORY.md: ${workflow}`);
275
+ }
276
+ }
277
+
278
+ for (const skillFile of registeredSkillFiles(docsReadme, memory)) {
279
+ if (!fs.existsSync(path.join(root, skillFile))) {
280
+ errors.push(`registered skill file is missing: ${skillFile}`);
220
281
  }
221
282
  }
222
283
 
223
- for (const workflow of listMarkdownFiles('docs/workflows')) {
224
- if (!docsReadme.includes(workflow) && !memory.includes(workflow)) {
225
- errors.push(`workflow is not registered in docs/README.md or MEMORY.md: ${workflow}`);
284
+ for (const workflowFile of registeredWorkflowFiles(docsReadme, memory)) {
285
+ if (!fs.existsSync(path.join(root, workflowFile))) {
286
+ errors.push(`registered workflow file is missing: ${workflowFile}`);
226
287
  }
227
288
  }
228
289
 
@@ -241,9 +302,9 @@ function requireUiSelectorContract(rel) {
241
302
  }
242
303
  }
243
304
 
244
- requireUiSelectorContract('docs/workflows/browser-e2e.md');
245
- requireUiSelectorContract('docs/workflows/ts-react-frontend.md');
246
- requireUiSelectorContract('docs/features/_template.md');
305
+ requireUiSelectorContract('Harness/workflows/browser-e2e.md');
306
+ requireUiSelectorContract('Harness/workflows/ts-react-frontend.md');
307
+ requireUiSelectorContract('Harness/features/_template.md');
247
308
 
248
309
  for (const skill of commonSkills) {
249
310
  const rel = `.claude/skills/${skill}/SKILL.md`;
@@ -287,9 +348,42 @@ for (const agent of commonAgents) {
287
348
  }
288
349
  }
289
350
 
290
- requireText('docs/harness/extension.md', 'Skills should extend the harness');
291
- requireText('docs/harness/agent-workflow.md', 'docs/harness/PLAN.md');
292
- requireText('docs/research/README.md', 'research-results.md');
351
+ requireText('Harness/extension.md', 'Skills should extend the harness');
352
+ requireText('Harness/agent-workflow.md', 'Harness/PLAN.md');
353
+ requireText('Harness/research/README.md', 'research-results.md');
354
+ requireText('Harness/WF.md', 'Ralph-style harness loop', 'WF loop description');
355
+ requireText('Harness/WF.md', 'Heartbeat Protocol', 'heartbeat protocol');
356
+ requireText('Harness/WF.md', 'WF mode requires multi-subagent orchestration by default', 'WF multi-subagent default');
357
+ requireText('Harness/WF.md', 'Explicit `/wf`, `wf mode`, `workflow mode`, or `wk mode` MUST spawn at least 3 distinct subagents', 'explicit WF/WK subagent minimum');
358
+ requireText('Harness/WF.md', '.claude/agents/', 'WF built-in agent roster path');
359
+ requireText('Harness/WF.md', '7:3 collaboration bias', 'WF collaboration bias');
360
+ requireText('Harness/README.md', '`/wf`, `wf mode`, `workflow mode`, or `wk mode`', 'WF/WK router aliases');
361
+ requireText('Harness/README.md', 'explicit WF/WK loads subagent docs immediately', 'explicit WF/WK router output');
362
+ requireText('.claude/skills/harness-router/SKILL.md', '`/wf`, `wf mode`, `workflow mode`, `wk mode`', 'harness-router WF/WK aliases');
363
+ requireText('.claude/skills/wf-mode/SKILL.md', 'Harness/WF.md', 'wf-mode loads WF document');
364
+ requireText('.claude/skills/wf-mode/SKILL.md', 'Harness/subagents.md', 'wf-mode loads subagent orchestration');
365
+ requireText('.claude/skills/wf-mode/SKILL.md', 'wk mode', 'wf-mode wk alias');
366
+ requireText('.claude/skills/wf-mode/SKILL.md', 'spawn at least 3 distinct subagents from `.claude/agents/`', 'wf-mode subagent minimum');
367
+ requireText('.claude/skills/subagent-orchestrator/SKILL.md', 'Harness/subagents.md', 'subagent-orchestrator loads subagents doc');
368
+ requireText('.claude/skills/subagent-orchestrator/SKILL.md', '.claude/agents/', 'subagent-orchestrator built-in agent roster path');
369
+ requireText('.claude/skills/subagent-orchestrator/SKILL.md', '`workflow mode`, `wk mode`', 'subagent-orchestrator WF/WK aliases');
370
+ requireText('.claude/skills/harness-context/SKILL.md', 'Harness/subagents.md', 'harness-context loads subagents doc');
371
+ requireText('.claude/skills/readme-optimizer/SKILL.md', 'README.md', 'readme-optimizer loads README');
372
+ requireText('.claude/skills/readme-optimizer/SKILL.md', 'Harness/architecture.md', 'readme-optimizer links architecture docs');
373
+ requireText('Harness/subagents.md', '## Source Attribution', 'subagent source attribution');
374
+ requireText('Harness/subagents.md', 'npx skills find', 'find-skills discovery attribution');
375
+ requireText('Harness/subagents.md', 'superpowers:dispatching-parallel-agents', 'parallel-agent source attribution');
376
+ requireText('Harness/subagents.md', 'superpowers:subagent-driven-development', 'subagent-driven source attribution');
377
+ requireText('Harness/subagents.md', '## Built-in Agent Roster', 'built-in agent roster');
378
+ requireText('Harness/subagents.md', '## WF Default Fan-Out', 'WF default fan-out');
379
+ requireText('Harness/subagents.md', '7:3 collaboration bias', 'subagent collaboration bias');
380
+ requireText('Harness/subagents.md', 'parallel planner/researcher/docs-researcher/architect subagents', 'WF roster orchestration shape');
381
+ requireText('Harness/subagents.md', '## Efficiency Ladder', 'subagent efficiency ladder');
382
+ requireText('Harness/subagents.md', '## Review Gates', 'subagent review gates');
383
+ requireText('Harness/architecture.md', '## 2. Interface Decoupling', 'architecture interface decoupling');
384
+ requireText('Harness/architecture.md', '## 3. State Design', 'architecture state design');
385
+ requireText('Harness/architecture.md', 'Avoid speculative abstraction', 'anti-overengineering architecture rule');
386
+ requireText('CLAUDE.md', 'Use explicit interfaces or state models only when they protect a real boundary', 'CLAUDE interface/state simplicity rule');
293
387
 
294
388
  if (errors.length) {
295
389
  console.error(`Harness validation failed${strict ? ' (strict)' : ''}:`);
@@ -299,5 +393,5 @@ if (errors.length) {
299
393
 
300
394
  console.log(`Harness validation passed${strict ? ' (strict)' : ''}.`);
301
395
  if (!strict) {
302
- console.log('Tip: run `node scripts/validate-harness.mjs --strict` after bootstrap to check unresolved project placeholders.');
396
+ console.log('Tip: run `node Harness/scripts/validate-harness.mjs --strict` after bootstrap to check unresolved project placeholders.');
303
397
  }
@@ -11,8 +11,8 @@ Use this skill when a change affects browser-visible behavior, navigation, forms
11
11
 
12
12
  ## Docs To Load
13
13
 
14
- - `docs/workflows/browser-e2e.md`
15
- - `docs/harness/PLAN.md`
14
+ - `Harness/workflows/browser-e2e.md`
15
+ - `Harness/PLAN.md`
16
16
  - Existing project test, build, and run instructions.
17
17
 
18
18
  ## Required Inputs
@@ -26,7 +26,7 @@ Use this skill when a change affects browser-visible behavior, navigation, forms
26
26
 
27
27
  - Browser test files in the project's existing test locations.
28
28
  - Evidence artifacts such as screenshots, traces, or reports in existing artifact folders.
29
- - Notes in `docs/harness/PLAN.md` when the active task asks for plan tracking.
29
+ - Notes in `Harness/PLAN.md` when the active task asks for plan tracking.
30
30
 
31
31
  ## Output Format
32
32
 
@@ -35,8 +35,8 @@ Include the selectors used for CDP/Playwright/manual verification.
35
35
 
36
36
  ## PLAN.md Updates
37
37
 
38
- Update `docs/harness/PLAN.md` only when executing a tracked plan item or recording evidence requested by the current task.
38
+ Update `Harness/PLAN.md` only when executing a tracked plan item or recording evidence requested by the current task.
39
39
 
40
40
  ## dispatch.md Usage
41
41
 
42
- Use `docs/harness/dispatch.md` only when splitting independent browser checks across workers is explicitly useful.
42
+ Use `Harness/dispatch.md` only when splitting independent browser checks across workers is explicitly useful.
@@ -19,7 +19,7 @@
19
19
  - Capture runtime exceptions, console errors, and failed network requests before and after the flow.
20
20
  - Interact through stable accessible labels/roles or `data-testid`, not brittle DOM paths.
21
21
  - Verify at least one critical flow end-to-end in the real browser target.
22
- - Save screenshot, trace, video, or result artifact paths and record them in `docs/harness/PLAN.md` or the feature doc.
22
+ - Save screenshot, trace, video, or result artifact paths and record them in `Harness/PLAN.md` or the feature doc.
23
23
  - Clean up any dev server or browser processes started for verification.
24
24
 
25
25
  ## Common Commands
@@ -11,8 +11,8 @@ Use this skill when reviewing a GitHub pull request, responding to PR feedback,
11
11
 
12
12
  ## Docs To Load
13
13
 
14
- - `docs/workflows/github-pr-review.md`
15
- - `docs/harness/PLAN.md`
14
+ - `Harness/workflows/github-pr-review.md`
15
+ - `Harness/PLAN.md`
16
16
  - Repository contribution, test, and review guidelines.
17
17
 
18
18
  ## Required Inputs
@@ -25,7 +25,7 @@ Use this skill when reviewing a GitHub pull request, responding to PR feedback,
25
25
 
26
26
  - Local files needed to address approved review feedback.
27
27
  - Review notes or evidence in existing docs only when requested.
28
- - `docs/harness/PLAN.md` when tracking review work.
28
+ - `Harness/PLAN.md` when tracking review work.
29
29
 
30
30
  ## Output Format
31
31
 
@@ -33,8 +33,8 @@ Return findings first by severity with file and line references, then open quest
33
33
 
34
34
  ## PLAN.md Updates
35
35
 
36
- Update `docs/harness/PLAN.md` only when the PR review is part of a tracked implementation plan.
36
+ Update `Harness/PLAN.md` only when the PR review is part of a tracked implementation plan.
37
37
 
38
38
  ## dispatch.md Usage
39
39
 
40
- Use `docs/harness/dispatch.md` when independent review areas can be assigned separately, such as backend, frontend, and CI.
40
+ Use `Harness/dispatch.md` when independent review areas can be assigned separately, such as backend, frontend, and CI.
@@ -11,8 +11,8 @@ Use this skill when changing Python API routes, service logic, persistence bound
11
11
 
12
12
  ## Docs To Load
13
13
 
14
- - `docs/workflows/python-backend.md`
15
- - `docs/harness/PLAN.md`
14
+ - `Harness/workflows/python-backend.md`
15
+ - `Harness/PLAN.md`
16
16
  - Project backend README, API docs, dependency files, and test configuration.
17
17
 
18
18
  ## Required Inputs
@@ -25,7 +25,7 @@ Use this skill when changing Python API routes, service logic, persistence bound
25
25
 
26
26
  - Python source, tests, fixtures, and backend docs in the task scope.
27
27
  - Local evidence artifacts such as test output snippets.
28
- - `docs/harness/PLAN.md` when the task requires plan tracking.
28
+ - `Harness/PLAN.md` when the task requires plan tracking.
29
29
 
30
30
  ## Output Format
31
31
 
@@ -33,8 +33,8 @@ Return files changed, API or behavior summary, tests run, important logs, migrat
33
33
 
34
34
  ## PLAN.md Updates
35
35
 
36
- Update `docs/harness/PLAN.md` only when executing a tracked plan item or recording required validation evidence.
36
+ Update `Harness/PLAN.md` only when executing a tracked plan item or recording required validation evidence.
37
37
 
38
38
  ## dispatch.md Usage
39
39
 
40
- Use `docs/harness/dispatch.md` for separable backend work such as API implementation, database changes, and test coverage.
40
+ Use `Harness/dispatch.md` for separable backend work such as API implementation, database changes, and test coverage.