create-harness-vibe-coding 0.8.2 → 0.8.4

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 (55) hide show
  1. package/README-CN.md +2 -2
  2. package/README.md +2 -3
  3. package/package.json +1 -2
  4. package/src/generator.js +4 -5
  5. package/templates/common/.claude/agents/context-master.md +3 -2
  6. package/templates/common/.claude/agents/memory-master.md +3 -2
  7. package/templates/common/.claude/agents/tdd-guide.md +45 -19
  8. package/templates/common/.claude/agents/test-writer.md +52 -38
  9. package/templates/common/.claude/commands/wf-help.md +21 -0
  10. package/templates/common/.claude/rules/ecc/common.md +1 -1
  11. package/templates/common/.claude/settings.json +33 -90
  12. package/templates/common/.claude/skills/tdd/SKILL.md +18 -11
  13. package/templates/common/.claude/skills/wf-auto/SKILL.md +1 -1
  14. package/templates/common/.codex/config.toml +0 -2
  15. package/templates/common/.harness-version +55 -37
  16. package/templates/common/AGENTS.md +7 -6
  17. package/templates/common/CLAUDE.md +3 -4
  18. package/templates/common/Harness/ACCEPTANCE_PROTOCOL.md +170 -0
  19. package/templates/common/Harness/AGENT_ISOLATION.md +73 -0
  20. package/templates/common/Harness/DEBUG_PROTOCOL.md +64 -0
  21. package/templates/common/Harness/ECC-GUIDE.md +4 -4
  22. package/templates/common/Harness/HARNESS_BRIDGE.md +128 -0
  23. package/templates/common/Harness/MEMORY_PROTOCOL.md +114 -0
  24. package/templates/common/Harness/README.md +31 -16
  25. package/templates/common/Harness/TDD-GUIDE.md +138 -56
  26. package/templates/common/Harness/WF-AUTO.md +77 -16
  27. package/templates/common/Harness/WF-MAX.md +81 -22
  28. package/templates/common/Harness/WF.md +38 -18
  29. package/templates/common/Harness/agent-workflow.md +47 -22
  30. package/templates/common/Harness/context-loading.md +33 -32
  31. package/templates/common/Harness/dispatch.md +10 -4
  32. package/templates/common/Harness/extension.md +3 -3
  33. package/templates/common/Harness/lifecycle.md +19 -13
  34. package/templates/common/Harness/research/PRD.md +18 -9
  35. package/templates/common/Harness/subagents.md +41 -14
  36. package/templates/common/Harness/tasks/_template/NAMING.md +2 -2
  37. package/templates/common/Harness/tasks/_template/PLAN.md +53 -11
  38. package/templates/common/Harness/templates/ACCEPTANCE.template.md +20 -0
  39. package/templates/common/Harness/templates/API_CONTRACT.template.md +40 -0
  40. package/templates/common/Harness/templates/PLAYWRIGHT_SPEC.template.ts +21 -0
  41. package/templates/common/Harness/templates/PRD.template.md +45 -0
  42. package/templates/common/Harness/templates/TEST_PLAN.template.md +14 -0
  43. package/templates/common/Harness/templates/UI_CONTRACT.template.md +11 -0
  44. package/templates/common/Harness/templates/VALIDATION_REPORT.template.md +20 -0
  45. package/templates/common/MEMORY.md +14 -3
  46. package/templates/common/README.md +1 -1
  47. package/templates/common/SETUP.md +24 -20
  48. package/templates/common/scripts/validate-harness.mjs +134 -41
  49. package/templates/common/scripts/wf-remove.mjs +6 -2
  50. package/templates/optional/skills/browser-e2e/Harness/workflows/browser-e2e.md +11 -3
  51. package/templates/optional/skills/ts-react-frontend/Harness/workflows/ts-react-frontend.md +1 -1
  52. package/templates/common/.codex/hooks.json +0 -59
  53. package/templates/common/scripts/wf-mode-hook.mjs +0 -895
  54. package/templates/common/scripts/wf-statusline.ps1 +0 -62
  55. package/templates/common/scripts/wf-statusline.sh +0 -67
@@ -8,14 +8,14 @@ This scaffold is a 0-1 product harness:
8
8
 
9
9
  - short agent entry files
10
10
  - dynamic docs router
11
- - PRD, research protocol, architecture, ports, data-flow, state templates
11
+ - Mini PRD, acceptance protocol, UI/API contracts, research protocol, architecture, ports, data-flow, state templates
12
12
  - active `Harness/PROGRESS.md`
13
13
  - `Harness/MEMORY.md` plus a `Harness/memory/` folder for durable self-learning, user corrections, and tool reflections
14
14
  - built-in common agents
15
15
  - subagent orchestration and context-loading protocol
16
16
  - skill-style dynamic loaders in `.claude/skills/` for Claude Code and `.agents/skills/` for Codex
17
17
  - lightweight harness validator
18
- - test/review/feedback loop
18
+ - acceptance/test/review/debug/memory loop
19
19
 
20
20
  It does not guess your stack or business domain. The agent MUST detect or ask, then install the right ECC rules for the project.
21
21
 
@@ -26,7 +26,7 @@ Start Claude Code or Codex, then say:
26
26
  ```text
27
27
  Read Harness/SETUP.md. Bootstrap this project as a 0-1 product harness.
28
28
  Use Harness/README.md as the router. Keep context small.
29
- First clarify the idea, then create PRD, research, architecture, Harness/PROGRESS.md and the first per-task plan, and the first vertical-slice task.
29
+ First clarify the idea, then create Mini PRD, acceptance criteria, UI/API contracts, test plan, research, architecture, Harness/PROGRESS.md, the first per-task plan, and the first vertical-slice task.
30
30
  ```
31
31
 
32
32
  ## Required Bootstrap Sequence
@@ -34,16 +34,19 @@ First clarify the idea, then create PRD, research, architecture, Harness/PROGRES
34
34
  Claude must follow this order:
35
35
 
36
36
  0. **ECC Stack Configuration** — Detect the project's tech stack. If the repo is empty or has no stack markers (`package.json`, `go.mod`, `pyproject.toml`, `Cargo.toml`, `Gemfile`, `composer.json`, `build.gradle`, etc.), ask the user: "What's your tech stack? (language/framework)" Then install the matching ECC rule sets from `~/.claude/rules/ecc/`. See `Harness/ECC-GUIDE.md` for the stack→rules mapping. Minimum: always install `common/`. Verify with `ls .claude/rules/ecc/`.
37
- 1. Read `CLAUDE.md`, `Harness/MEMORY.md`, `Harness/README.md`, and `Harness/lifecycle.md`. Load `Harness/memory/*` only when the router or memory trigger applies.
38
- 2. Ask up to 3 blocking product questions. If not blocked, record assumptions in `Harness/tasks/<task-id>/PLAN.md`.
39
- 3. Fill `Harness/research/PRD.md` with MVP, non-goals, and acceptance criteria.
40
- 4. Read `Harness/research/README.md`, then fill `Harness/research/research-results.md` with adopted/rejected research choices.
41
- 5. Fill `Harness/architecture.md`.
42
- 6. Create a task capsule from `Harness/tasks/_template/` and fill the first vertical-slice plan in `Harness/tasks/<task-id>/PLAN.md`.
43
- 7. Use `Harness/subagents.md`, `Harness/context-loading.md`, and `Harness/dispatch.md` when explicit WF/WK mode or any spawned subagents are involved.
44
- 9. Implement only after a failing test or manual verification step is defined.
45
- 10. Run `node Harness/scripts/validate-harness.mjs --strict`.
46
- 11. Record final verification and next feedback step in `Harness/tasks/<task-id>/PROGRESS.md`. If repeated tool failures, repeated user corrections, or reusable review/debug lessons appeared, record the concise reflection in the relevant `Harness/memory/` file.
37
+ 1. Read `CLAUDE.md`, `Harness/MEMORY.md`, `Harness/README.md`, `Harness/lifecycle.md`, and `Harness/ACCEPTANCE_PROTOCOL.md`. Load `Harness/memory/*` only when the router or memory trigger applies.
38
+ 2. Ask up to 3 blocking product questions. If not blocked, record assumptions in `Harness/tasks/<task-id>/PLAN.md`.
39
+ 3. Fill `Harness/research/PRD.md` or the first task PLAN with Mini PRD fields: goal, scope, non-scope, user flow, UI elements, API behavior, acceptance criteria, and verification commands.
40
+ 4. Read `Harness/research/README.md`, then fill `Harness/research/research-results.md` with adopted/rejected research choices.
41
+ 5. Create AC IDs, UI/API contract tables, and a test plan before implementation. Use `Harness/templates/*` when helpful.
42
+ 6. Fill `Harness/architecture.md`.
43
+ 7. Create a task capsule from `Harness/tasks/_template/` and fill the first vertical-slice plan in `Harness/tasks/<task-id>/PLAN.md`.
44
+ 8. Use `Harness/AGENT_ISOLATION.md`, `Harness/subagents.md`, `Harness/context-loading.md`, and `Harness/dispatch.md` when explicit WF/WK mode or any spawned subagents are involved.
45
+ 9. Implement only after PRD-GATE, AC-GATE, CONTRACT-GATE, and TEST-GATE pass.
46
+ 10. Independently validate with an AC-by-AC result matrix; use `Harness/HARNESS_BRIDGE.md` for browser/API/CDP flows.
47
+ 11. For `/wf-auto` or memory scenario hints, read `Harness/WF-AUTO.md` and `Harness/MEMORY_PROTOCOL.md`; do not enable a background runner by default. The only allowed runtime hook is the optional `/wf-auto` bounded tick hook.
48
+ 11. Run `node Harness/scripts/validate-harness.mjs --strict`.
49
+ 12. Record final verification and next feedback step in `Harness/tasks/<task-id>/PROGRESS.md`. If repeated tool failures, repeated user corrections, or reusable review/debug lessons appeared, record the concise reflection in the relevant `Harness/memory/` file.
47
50
 
48
51
  ## Install or Upgrade Path
49
52
 
@@ -61,7 +64,7 @@ When adding this harness to a project that already has source code, docs, CI, or
61
64
  1. Get the machine-readable install report first with `npx create-harness-vibe-coding@latest <project-name> <target-dir> -y --dry-run --on-conflict skip --json`. Use `scan.markers` and `agent.aiMergeRequired` instead of hand-written root probes for install decisions. Do manual project-fact reading only after the script has created missing Harness files.
62
65
  2. Record discovered facts and open questions in `Harness/tasks/<task-id>/PROGRESS.md` before changing harness docs.
63
66
  3. Fill `Harness/research/PRD.md`, `Harness/research/research-results.md`, `Harness/architecture.md` from observed project facts plus explicit user input.
64
- 4. Existing configuration is project fact. Do not overwrite `CLAUDE.md`, `AGENTS.md`, `.claude/`, `.agents/`, `.codex/`, `.gitignore`, settings, hooks, package files, CI, docs routers, workflow docs, or installed skills/plugins/rules unless the user explicitly approves that exact overwrite.
67
+ 4. Existing configuration is project fact. Do not overwrite `CLAUDE.md`, `AGENTS.md`, `.claude/`, `.agents/`, `.codex/`, `.gitignore`, settings, package files, CI, docs routers, workflow docs, or installed skills/plugins/rules unless the user explicitly approves that exact overwrite.
65
68
  5. When a harness file conflicts with an existing file, preserve the existing file and register any missing harness guidance manually using `Harness/extension.md`.
66
69
  6. Run `node Harness/scripts/validate-harness.mjs --strict` after project-fact placeholders have been resolved or intentionally recorded as open. Use the non-strict validator only for early structural checks.
67
70
 
@@ -174,8 +177,9 @@ Each template doc contains `{{PLACEHOLDER}}` markers. Below is what every placeh
174
177
  - `{{MUST_1..3}}`: concrete, testable MVP items (checkbox form)
175
178
  - `{{NON_GOAL_1..3}}`: explicitly out-of-scope items
176
179
  - `{{USER_ROLE}}`, `{{SCENARIO}}`, `{{FREQUENCY}}`, `{{PAIN}}`: one row per user type
177
- - `{{ACCEPTANCE_1..3}}`: verifiable project-level acceptance criteria
178
- - `{{DIMENSION}}`, `{{TARGET}}`, `{{MEASUREMENT}}`: non-functional requirements (perf, security, etc.)
180
+ - `AC-001..003`: verifiable project-level acceptance criteria written as Given/When/Then summaries
181
+ - UI/API contract requirements: stable selectors, endpoint contracts, state changes, and evidence methods for relevant AC IDs
182
+ - `{{DIMENSION}}`, `{{TARGET}}`, `{{MEASUREMENT}}`: non-functional requirements (perf, security, etc.)
179
183
 
180
184
  **`Harness/research/research-results.md`** — Tech decisions. Research before filling:
181
185
  - Use `Harness/research/README.md` as the research protocol.
@@ -210,7 +214,7 @@ False confidence is worse than a question. If you catch yourself thinking "this
210
214
 
211
215
  ## How to Find Proper Skills
212
216
 
213
- After the architecture stage reveals your stack, inspect existing `.claude/skills/`, `.agents/skills/`, plugins, hooks, and custom rules before recommending anything. Skills teach Claude Code and Codex domain-specific patterns, testing conventions, and design rules, but duplicate skills create routing noise.
217
+ After the architecture stage reveals your stack, inspect existing `.claude/skills/`, `.agents/skills/`, plugins, and custom rules before recommending anything. Skills teach Claude Code and Codex domain-specific patterns, testing conventions, and design rules, but duplicate skills create routing noise.
214
218
 
215
219
  **Built-in route**: invoke the `/find-skills` skill (or say "help me find skills for X"). Examples:
216
220
 
@@ -239,13 +243,13 @@ ECC and Superpowers overlap ~80% in topic coverage but serve different purposes:
239
243
  | | ECC Rules | Superpowers Skills |
240
244
  |---|------|------|
241
245
  | **Role** | Coding STANDARD (what to enforce) | Coding GUIDE (how to execute) |
242
- | **Enforcement** | Hooks (PreToolUse/PostToolUse), validator | Agent self-discipline |
246
+ | **Enforcement** | Validator plus documented command evidence | Agent self-discipline |
243
247
  | **Scope** | Universal + per-language (TS/Python/Go/...) | Universal (no language specifics) |
244
248
  | **TDD** | `testing.md`: coverage ≥80%, AAA pattern | `test-driven-development`: red-green-refactor workflow |
245
249
  | **Code Review** | `code-review.md`: severity levels, checklist | `requesting-code-review`: dispatch reviewer subagent |
246
250
  | **Subagents** | `subagents.md` + `dispatch.md`: role packs, write sets | `subagent-driven-development`: two-stage review after each task |
247
251
  | **Verification** | `testing.md` + `agent-workflow.md`: evidence before claims | `verification-before-completion`: verification before claiming done |
248
- | **Unique** | Design quality, performance budgets, security CSP, per-language idioms, hooks | Brainstorming, git worktrees |
252
+ | **Unique** | Design quality, performance budgets, security CSP, per-language idioms | Brainstorming, git worktrees |
249
253
 
250
254
  **Installation rule:**
251
255
  1. **ECC is mandatory.** Install `common/` + stack-specific rules during bootstrap step 0. See `Harness/ECC-GUIDE.md`.
@@ -267,7 +271,7 @@ This scaffold includes built-in harness skills in `.claude/skills/*` and mirrore
267
271
 
268
272
  ## Optional Agent Assets
269
273
 
270
- After the product shape is known, Claude Code may also install or copy stack-specific agents, rules, and hooks into `.claude/`. Codex-discoverable workflow skills belong in `.agents/skills/`. Follow `Harness/extension.md` for every added asset.
274
+ After the product shape is known, Claude Code may also install or copy stack-specific agents and rules into `.claude/`. Codex-discoverable workflow skills belong in `.agents/skills/`. Follow `Harness/extension.md` for every added asset.
271
275
 
272
276
  Examples:
273
277
 
@@ -33,11 +33,12 @@ const commonAgents = [
33
33
  'review-manager',
34
34
  ];
35
35
 
36
- const commonSkills = [
37
- 'wf',
38
- 'wf-update',
39
- 'wf-max',
40
- 'wf-review',
36
+ const commonSkills = [
37
+ 'wf',
38
+ 'tdd',
39
+ 'wf-update',
40
+ 'wf-max',
41
+ 'wf-review',
41
42
  'wf-learn',
42
43
  'subagent-orchestrator',
43
44
  'wf-readme',
@@ -56,14 +57,26 @@ const required = [
56
57
  'AGENTS.md',
57
58
  'CLAUDE.md',
58
59
  'README.md',
59
- 'Harness/MEMORY.md',
60
- 'Harness/WF.md',
61
- 'Harness/WF-MAX.md',
62
- ...memoryFiles,
63
- '.codex/config.toml',
64
- '.codex/hooks.json',
65
- '.claude/settings.json',
66
- '.claude/rules/ecc/common.md',
60
+ 'Harness/MEMORY.md',
61
+ 'Harness/WF.md',
62
+ 'Harness/WF-MAX.md',
63
+ 'Harness/ACCEPTANCE_PROTOCOL.md',
64
+ 'Harness/AGENT_ISOLATION.md',
65
+ 'Harness/HARNESS_BRIDGE.md',
66
+ 'Harness/DEBUG_PROTOCOL.md',
67
+ 'Harness/MEMORY_PROTOCOL.md',
68
+ 'Harness/templates/PRD.template.md',
69
+ 'Harness/templates/ACCEPTANCE.template.md',
70
+ 'Harness/templates/UI_CONTRACT.template.md',
71
+ 'Harness/templates/API_CONTRACT.template.md',
72
+ 'Harness/templates/TEST_PLAN.template.md',
73
+ 'Harness/templates/PLAYWRIGHT_SPEC.template.ts',
74
+ 'Harness/templates/VALIDATION_REPORT.template.md',
75
+ ...memoryFiles,
76
+ '.codex/config.toml',
77
+ '.claude/settings.json',
78
+ '.claude/commands/wf-help.md',
79
+ '.claude/rules/ecc/common.md',
67
80
  ...commonAgents.map(agent => `.claude/agents/${agent}.md`),
68
81
  ...commonSkills.map(skill => `.claude/skills/${skill}/SKILL.md`),
69
82
  ...commonSkills.map(skill => `.agents/skills/${skill}/SKILL.md`),
@@ -78,8 +91,8 @@ const required = [
78
91
  'Harness/architecture.md',
79
92
  'Harness/research/README.md',
80
93
  'Harness/research/research-results.md',
81
- 'Harness/research/PRD.md',
82
- 'Harness/scripts/wf-update-check.mjs',
94
+ 'Harness/research/PRD.md',
95
+ 'Harness/scripts/wf-update-check.mjs',
83
96
  'Harness/scripts/wf-remove.mjs',
84
97
  'Harness/scripts/scan-clean.mjs',
85
98
  'Harness/.harness-version',
@@ -121,11 +134,16 @@ function read(rel) {
121
134
  return fs.existsSync(file) ? fs.readFileSync(file, 'utf8') : '';
122
135
  }
123
136
 
124
- function requireText(rel, text, label = text) {
125
- const body = read(rel);
126
- if (body && !body.includes(text)) errors.push(`${rel} missing ${label}`);
127
- }
128
-
137
+ function requireText(rel, text, label = text) {
138
+ const body = read(rel);
139
+ if (body && !body.includes(text)) errors.push(`${rel} missing ${label}`);
140
+ }
141
+
142
+ function forbidText(rel, text, label = text) {
143
+ const body = read(rel);
144
+ if (body && body.includes(text)) errors.push(`${rel} contains forbidden ${label}`);
145
+ }
146
+
129
147
  function frontmatterField(text, field) {
130
148
  const match = text.match(new RegExp(`^${field}:\\s*(.+)$`, 'm'));
131
149
  return match ? match[1].trim() : '';
@@ -209,11 +227,25 @@ function registeredWorkflowFiles(...texts) {
209
227
  return [...files].sort();
210
228
  }
211
229
 
212
- for (const rel of required) {
213
- if (!fs.existsSync(path.join(root, rel))) {
214
- errors.push(`missing required file: ${rel}`);
215
- }
216
- }
230
+ for (const rel of required) {
231
+ if (!fs.existsSync(path.join(root, rel))) {
232
+ errors.push(`missing required file: ${rel}`);
233
+ }
234
+ }
235
+
236
+ const removedHookArtifacts = [
237
+ 'Harness/HOOK_PROTOCOL.md',
238
+ 'Harness/scripts/wf-mode-hook.mjs',
239
+ 'Harness/scripts/wf-statusline.sh',
240
+ 'Harness/scripts/wf-statusline.ps1',
241
+ 'tests/e2e-wf-hooks.test.mjs',
242
+ ];
243
+
244
+ for (const rel of removedHookArtifacts) {
245
+ if (fs.existsSync(path.join(root, rel))) {
246
+ errors.push(`removed hook artifact should not exist: ${rel}`);
247
+ }
248
+ }
217
249
 
218
250
  // Task capsule template files
219
251
  const taskTemplateDir = path.join(root, 'Harness', 'tasks', '_template');
@@ -285,8 +317,9 @@ requireText('CLAUDE.md', 'user corrects the same assumption/pattern 2+ times', '
285
317
  requireText('CLAUDE.md', 'If `Harness/` exists, this repository is governed by the Harness contract', 'Harness binding contract');
286
318
  requireText('CLAUDE.md', 'Harness/MEMORY.md` is the memory/resource router', 'memory/resource router');
287
319
  requireText('CLAUDE.md', 'Harness/README.md#Load By Task', 'Harness task router');
288
- requireText('CLAUDE.md', 'Harness/SETUP.md` exists, follow it before normal project work', 'setup bootstrap contract');
289
- requireText('CLAUDE.md', 'subagent-orchestrator` and `Harness/subagents.md', 'subagent orchestrator entry trigger');
320
+ requireText('CLAUDE.md', 'Harness/SETUP.md` exists, follow it before normal project work', 'setup bootstrap contract');
321
+ requireText('Harness/SETUP.md', 'Harness/MEMORY_PROTOCOL.md', 'setup memory protocol reference');
322
+ requireText('CLAUDE.md', 'subagent-orchestrator` and `Harness/subagents.md', 'subagent orchestrator entry trigger');
290
323
  requireText('CLAUDE.md', 'Harness/PROGRESS.md` is the global task index', 'PROGRESS global task index');
291
324
  requireText('CLAUDE.md', 'Harness/tasks/', 'task capsule directory reference');
292
325
  requireText('CLAUDE.md', 'Subagents are readers and reporters', 'subagent state committer rule');
@@ -443,17 +476,20 @@ for (const agent of commonAgents) {
443
476
  }
444
477
  }
445
478
 
446
- requireText('Harness/extension.md', 'Skills should extend the harness');
447
- requireText('Harness/agent-workflow.md', 'Harness/tasks/<task-id>/PROGRESS.md');
448
- requireText('Harness/research/README.md', 'research-results.md');
479
+ requireText('Harness/extension.md', 'Skills should extend the harness');
480
+ requireText('Harness/agent-workflow.md', 'Harness/tasks/<task-id>/PROGRESS.md');
481
+ requireText('Harness/agent-workflow.md', 'TDD-GUIDE.md', 'agent workflow loads TDD guide');
482
+ requireText('Harness/agent-workflow.md', 'real user-path test', 'agent workflow real user path requirement');
483
+ requireText('Harness/research/README.md', 'research-results.md');
449
484
  requireText('Harness/WF.md', 'Ralph-style harness loop', 'WF loop description');
450
485
  requireText('Harness/WF.md', 'Heartbeat Protocol', 'heartbeat protocol');
451
486
  requireText('Harness/WF.md', 'WF mode requires multi-subagent orchestration by default', 'WF multi-subagent default');
452
487
  requireText('Harness/WF.md', 'Explicit `/wf`, `$wf`, `wf mode`, `workflow mode`, or `wk mode` MUST use at least 3 distinct role passes', 'explicit WF/WK role-pass minimum');
453
488
  requireText('Harness/WF.md', '.claude/agents/', 'WF built-in agent roster path');
454
- requireText('Harness/WF.md', 'Collaboration decision tree', 'WF decision tree');
455
- requireText('Harness/WF.md', 'Harness/tasks/', 'WF task directory reference');
456
- requireText('Harness/README.md', '`wf mode`, `workflow mode`, or `wk mode`', 'WF/WK router aliases');
489
+ requireText('Harness/WF.md', 'Collaboration decision tree', 'WF decision tree');
490
+ requireText('Harness/WF.md', 'Harness/tasks/', 'WF task directory reference');
491
+ requireText('Harness/WF.md', 'IMPLEMENT-GATE', 'WF implement gate naming');
492
+ requireText('Harness/README.md', '`wf mode`, `workflow mode`, or `wk mode`', 'WF/WK router aliases');
457
493
  requireText('Harness/README.md', 'explicit WF/WK loads subagent docs immediately', 'explicit WF/WK router output');
458
494
  requireText('.claude/skills/wf/SKILL.md', 'Harness/WF.md', 'wf skill loads core WF doc');
459
495
  requireText('.agents/skills/wf/SKILL.md', 'Harness/WF.md', 'Codex wf skill loads core WF doc');
@@ -483,16 +519,73 @@ requireText('Harness/WF-MAX.md', 'agent role', 'WF-MAX agent role separation');
483
519
  requireText('Harness/WF-MAX.md', 'write-set coloring', 'WF-MAX coloring algorithm');
484
520
  requireText('Harness/WF-MAX.md', 'wave dispatch', 'WF-MAX wave dispatch');
485
521
  requireText('Harness/README.md', '/wf-max', 'wf max router alias');
486
- requireText('Harness/README.md', 'WF-MAX.md', 'WF-MAX router reference');
487
- requireText('Harness/subagents.md', 'Max parallelism', 'subagents max parallelism row');
522
+ requireText('Harness/README.md', 'WF-MAX.md', 'WF-MAX router reference');
523
+ requireText('Harness/README.md', 'ACCEPTANCE_PROTOCOL.md', 'acceptance protocol router reference');
524
+ requireText('Harness/README.md', 'TDD-GUIDE.md', 'TDD guide router reference');
525
+ requireText('Harness/ACCEPTANCE_PROTOCOL.md', 'PRD-GATE', 'acceptance PRD gate');
526
+ requireText('Harness/ACCEPTANCE_PROTOCOL.md', 'AC-GATE', 'acceptance AC gate');
527
+ requireText('Harness/ACCEPTANCE_PROTOCOL.md', 'Acceptance Result', 'acceptance result matrix');
528
+ requireText('Harness/ACCEPTANCE_PROTOCOL.md', 'Syntax-only checks', 'syntax-only checks are not browser acceptance evidence');
529
+ requireText('Harness/AGENT_ISOLATION.md', 'implementer', 'agent isolation implementer rule');
530
+ requireText('Harness/HARNESS_BRIDGE.md', 'Network Trace Collector', 'harness bridge network trace collector');
531
+ requireText('Harness/WF-AUTO.md', 'Intent Checkpoint', 'wf-auto intent checkpoint');
532
+ requireText('Harness/MEMORY_PROTOCOL.md', 'Scenario Memory Hints', 'memory protocol scenario hints');
533
+ requireText('Harness/MEMORY_PROTOCOL.md', 'WF closeout', 'memory protocol WF closeout injection row');
534
+ requireText('Harness/MEMORY_PROTOCOL.md', 'memory-master owns writes', 'memory protocol memory write ownership');
535
+ requireText('Harness/TDD-GUIDE.md', 'Browser/UI Acceptance TDD Gate', 'browser UI acceptance TDD gate');
536
+ requireText('Harness/TDD-GUIDE.md', 'syntax-only', 'syntax-only acceptance prohibition');
537
+ requireText('Harness/TDD-GUIDE.md', 'Playwright/CDP', 'Playwright/CDP acceptance requirement');
538
+ requireText('Harness/TDD-GUIDE.md', 'AC-by-AC result matrix', 'AC-by-AC TDD evidence matrix');
539
+ requireText('Harness/tasks/_template/PLAN.md', 'User Action / API Request', 'task template user action/API test-plan column');
540
+ requireText('Harness/templates/TEST_PLAN.template.md', 'syntax-only checks', 'test plan template syntax-only prohibition');
541
+ requireText('.claude/skills/tdd/SKILL.md', 'Harness/ACCEPTANCE_PROTOCOL.md', 'tdd skill loads acceptance protocol');
542
+ requireText('.claude/skills/tdd/SKILL.md', 'Harness/HARNESS_BRIDGE.md', 'tdd skill loads harness bridge');
543
+ requireText('.claude/skills/tdd/SKILL.md', 'No syntax-only acceptance', 'tdd skill forbids syntax-only acceptance');
544
+ requireText('.claude/agents/tdd-guide.md', 'Browser Acceptance Rules', 'tdd-guide browser acceptance rules');
545
+ requireText('.claude/agents/tdd-guide.md', 'real user actions', 'tdd-guide real user action requirement');
546
+ requireText('.claude/agents/test-writer.md', 'Harness/ACCEPTANCE_PROTOCOL.md', 'test-writer loads acceptance protocol');
547
+ requireText('.claude/agents/test-writer.md', 'real user-path test', 'test-writer real user path requirement');
548
+ requireText('.claude/agents/test-writer.md', 'network URL, method, payload', 'test-writer network assertion requirement');
549
+ requireText('Harness/DEBUG_PROTOCOL.md', 'Layer Classification', 'debug layer classification');
550
+ requireText('Harness/MEMORY_PROTOCOL.md', 'AC ID', 'memory AC traceability');
551
+ requireText('Harness/subagents.md', 'Max parallelism', 'subagents max parallelism row');
488
552
  requireText('Harness/dispatch.md', 'Concurrency group', 'dispatch concurrency group field');
489
553
  requireText('Harness/dispatch.md', 'File claim', 'dispatch file claim field');
490
- requireText('CLAUDE.md', '/wf-max', 'wf max startup instruction');
491
- requireText('CLAUDE.md', 'three-layer architecture', 'CLAUDE.md three-layer role architecture');
492
- requireText('Harness/scripts/wf-mode-hook.mjs', 'agentRole', 'hook agentRole validation');
493
- requireText('Harness/scripts/wf-mode-hook.mjs', 'writeSet', 'hook writeSet enforcement');
494
-
495
- if (errors.length) {
554
+ requireText('CLAUDE.md', '/wf-max', 'wf max startup instruction');
555
+ requireText('.claude/commands/wf-help.md', 'Do not invoke a skill', 'wf-help direct command boundary');
556
+ requireText('.claude/commands/wf-help.md', '| `/wf-help` |', 'wf-help command row');
557
+ requireText('.claude/commands/wf-help.md', '| `/wf-max <task>` |', 'wf-help wf-max row');
558
+ requireText('.claude/commands/wf-help.md', '| `/wf-auto` |', 'wf-help wf-auto row');
559
+ requireText('.claude/commands/wf-help.md', '| `/wf-readme <task>` |', 'wf-help wf-readme row');
560
+ requireText('Harness/README.md', '## Direct Commands', 'direct commands section');
561
+ requireText('Harness/README.md', '.claude/commands/wf-help.md', 'wf-help router reference');
562
+ requireText('CLAUDE.md', 'three-layer architecture', 'CLAUDE.md three-layer role architecture');
563
+ requireText('CLAUDE.md', 'not hook-enforced', 'CLAUDE no-hook role enforcement statement');
564
+ requireText('Harness/README.md', 'no runtime hook state', 'README no-hook runtime statement');
565
+ requireText('Harness/WF-AUTO.md', 'WF-AUTO Hook Exception', 'wf-auto-only hook exception');
566
+ requireText('Harness/WF-AUTO.md', 'only `/wf-auto` may use a runtime hook', 'wf-auto-only hook boundary');
567
+ forbidText('CLAUDE.md', 'Enforced by hooks', 'WF-MAX hook enforcement claim');
568
+ forbidText('CLAUDE.md', 'WF-MAX hooks', 'WF-MAX hook enforcement claim');
569
+ forbidText('Harness/README.md', 'PreToolUse hook', 'WF-MAX PreToolUse hook claim');
570
+ forbidText('Harness/README.md', 'SessionStart hook', 'WF-MAX SessionStart hook claim');
571
+ forbidText('Harness/README.md', 'hook-managed', 'hook-managed runtime claim');
572
+ forbidText('Harness/README.md', 'HOOK_PROTOCOL.md', 'removed hook protocol reference');
573
+ forbidText('Harness/WF-AUTO.md', 'Hook-Assisted Long Loop', 'wf-auto hook loop section');
574
+ forbidText('Harness/MEMORY_PROTOCOL.md', 'Hooks may', 'hook-triggered memory claim');
575
+ forbidText('.claude/settings.json', 'wf-mode-hook.mjs', 'Claude WF hook command registration');
576
+ forbidText('.codex/hooks.json', 'wf-mode-hook.mjs', 'Codex WF hook command registration');
577
+ const codexHookConfig = read('.codex/hooks.json');
578
+ const claudeSettings = read('.claude/settings.json');
579
+ if (codexHookConfig && !codexHookConfig.includes('wf-auto')) {
580
+ errors.push('.codex/hooks.json may only exist for a wf-auto hook configuration');
581
+ }
582
+ if (claudeSettings.includes('"hooks"') && !claudeSettings.includes('wf-auto')) {
583
+ errors.push('.claude/settings.json hooks may only be used for wf-auto');
584
+ }
585
+ if (read('.codex/config.toml').includes('hooks = true') && !codexHookConfig.includes('wf-auto')) {
586
+ errors.push('.codex/config.toml may enable hooks only with a wf-auto hook configuration');
587
+ }
588
+ if (errors.length) {
496
589
  console.error(`Harness validation failed${strict ? ' (strict)' : ''}:`);
497
590
  for (const error of errors) console.error(`- ${error}`);
498
591
  process.exit(1);
@@ -108,6 +108,7 @@ const CLEANUP_DIRS = [
108
108
  '.claude/agents',
109
109
  '.claude/skills/wf-auto',
110
110
  '.claude/skills/wf-browser',
111
+ '.claude/skills/tdd',
111
112
  '.claude/skills/wf',
112
113
  '.claude/skills/wf-learn',
113
114
  '.claude/skills/wf-max',
@@ -118,6 +119,7 @@ const CLEANUP_DIRS = [
118
119
  '.claude/skills/subagent-orchestrator',
119
120
  '.agents/skills/wf-auto',
120
121
  '.agents/skills/wf-browser',
122
+ '.agents/skills/tdd',
121
123
  '.agents/skills/wf',
122
124
  '.agents/skills/wf-learn',
123
125
  '.agents/skills/wf-max',
@@ -302,6 +304,8 @@ async function main() {
302
304
  const extraPatterns = [
303
305
  '.claude/skills/wf/SKILL.md',
304
306
  '.agents/skills/wf/SKILL.md',
307
+ '.claude/skills/tdd/SKILL.md',
308
+ '.agents/skills/tdd/SKILL.md',
305
309
  '.claude/skills/wf-auto/SKILL.md',
306
310
  '.agents/skills/wf-auto/SKILL.md',
307
311
  'Harness/WF-AUTO.md',
@@ -375,7 +379,7 @@ async function main() {
375
379
  }
376
380
  }
377
381
 
378
- // Also check for .claude/settings.json (might have user hooks)
382
+ // Also check for .claude/settings.json (might have user permissions)
379
383
  const settingsFile = resolve(ROOT, '.claude', 'settings.json');
380
384
  if (existsSync(settingsFile)) {
381
385
  const settingsHash = sha256File(settingsFile);
@@ -386,7 +390,7 @@ async function main() {
386
390
  const idx = safe.findIndex(s => s.file === '.claude/settings.json');
387
391
  if (idx >= 0) {
388
392
  safe.splice(idx, 1);
389
- modified.push({ file: '.claude/settings.json', currentHash: settingsHash, storedHash: storedSettingsHash, reason: 'user modified settings (may contain hooks/permissions)' });
393
+ modified.push({ file: '.claude/settings.json', currentHash: settingsHash, storedHash: storedSettingsHash, reason: 'user modified settings (may contain permissions)' });
390
394
  }
391
395
  }
392
396
  }
@@ -17,7 +17,7 @@ Browser evidence in this project follows the contract:
17
17
  2. **CLI mode is preferred for deterministic steps** — use `browser-use open/state/click/screenshot` for predictable flows
18
18
  3. **Agent mode is for dynamic exploration** — use Browser Use Agent API when the page structure is unknown or changing
19
19
  4. **Evidence goes to the task directory** — `Harness/tasks/<task-id>/evidence/*.png`
20
- 5. **Stable UI selector contract** — Stable accessible labels/roles and stable test hooks such as `data-testid` are required for critical UI controls and states: inputs, buttons, filters, rows, empty/error/loading states.
20
+ 5. **Stable UI selector contract** — Stable accessible labels/roles and stable test selectors such as `data-testid` are required for critical UI controls and states: inputs, buttons, filters, rows, empty/error/loading states.
21
21
 
22
22
  ## Chrome DevTools / CDP / MCP Checklist
23
23
 
@@ -30,7 +30,14 @@ Browser evidence in this project follows the contract:
30
30
  - [ ] Capture screenshot, trace, video, or result artifact paths
31
31
  - [ ] Clean up any dev server or browser processes
32
32
 
33
- ## Quick Install
33
+ ### Harness Bridge
34
+
35
+ For frontend-backend flows, use `Harness/HARNESS_BRIDGE.md` to validate UI
36
+ selectors, API payloads, seeded data, runtime state probes, and CDP/network
37
+ traces. Browser validation must produce an AC-by-AC result matrix when the task
38
+ has acceptance criteria.
39
+
40
+ ## Quick Install
34
41
 
35
42
  ```bash
36
43
  # One-time setup
@@ -58,7 +65,8 @@ If `browser-use` is not installed, fall back to:
58
65
 
59
66
  ## Integration Points
60
67
 
61
- - **WF mode**: when browser-visible changes are made, follow the evidence contract in `Harness/WF.md#Browser And API Evidence`
68
+ - **WF mode**: when browser-visible changes are made, follow the evidence contract in `Harness/WF.md#Browser And API Evidence`
69
+ - **Harness Bridge**: use `Harness/HARNESS_BRIDGE.md` for UI contract, API contract, seeded test data, runtime state probes, and network trace collection.
62
70
  - **wf-browser**: Claude Code uses `.claude/skills/wf-browser/SKILL.md`; Codex uses `.agents/skills/wf-browser/SKILL.md`. Both load this workflow.
63
71
  - **MEMORY.md**: registered as optional workflow skill
64
72
  - **README.md**: routing table row "Browser E2E testing or automation" → browser-e2e
@@ -7,7 +7,7 @@
7
7
  - Real-browser smoke or screenshot evidence for user-visible changes.
8
8
  - Console/runtime error check result for the changed screen or flow.
9
9
  - Notes on responsive behavior and important interaction states.
10
- - Stable accessible labels/roles and stable test hooks such as `data-testid` are required for critical UI controls and states: inputs, buttons, filters, rows, empty/error/loading states.
10
+ - Stable accessible labels/roles and stable test selectors such as `data-testid` are required for critical UI controls and states: inputs, buttons, filters, rows, empty/error/loading states.
11
11
 
12
12
  Typecheck, build, and unit tests are necessary signals but are not enough for user-visible React changes. Before claiming UI acceptance, load the app in a real browser by Playwright, Chrome DevTools/CDP, or a documented manual run and capture screenshot/trace/console evidence.
13
13
  For TS/React UI work, capture the selector contract in the feature doc before implementation so tests and manual checks can target stable selectors instead of component internals or brittle DOM paths.
@@ -1,59 +0,0 @@
1
- {
2
- "hooks": {
3
- "SessionStart": [
4
- {
5
- "matcher": "",
6
- "hooks": [
7
- {
8
- "type": "command",
9
- "command": "node Harness/scripts/wf-mode-hook.mjs"
10
- }
11
- ]
12
- }
13
- ],
14
- "UserPromptSubmit": [
15
- {
16
- "matcher": "",
17
- "hooks": [
18
- {
19
- "type": "command",
20
- "command": "node Harness/scripts/wf-mode-hook.mjs"
21
- }
22
- ]
23
- }
24
- ],
25
- "PreToolUse": [
26
- {
27
- "matcher": "Edit|Write|MultiEdit|Bash",
28
- "hooks": [
29
- {
30
- "type": "command",
31
- "command": "node Harness/scripts/wf-mode-hook.mjs"
32
- }
33
- ]
34
- }
35
- ],
36
- "PostToolUse": [
37
- {
38
- "matcher": "",
39
- "hooks": [
40
- {
41
- "type": "command",
42
- "command": "node Harness/scripts/wf-mode-hook.mjs"
43
- }
44
- ]
45
- }
46
- ],
47
- "Stop": [
48
- {
49
- "matcher": "",
50
- "hooks": [
51
- {
52
- "type": "command",
53
- "command": "node Harness/scripts/wf-mode-hook.mjs"
54
- }
55
- ]
56
- }
57
- ]
58
- }
59
- }