create-harness-vibe-coding 0.8.7 → 0.8.9

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 (126) hide show
  1. package/README-CN.md +163 -105
  2. package/README.md +179 -244
  3. package/bin/create-harness-vibe-coding.js +2 -2
  4. package/docs/images/harness-architecture-light.png +0 -0
  5. package/docs/images/harness-architecture.drawio +164 -0
  6. package/docs/images/harness-icon.png +0 -0
  7. package/package.json +47 -44
  8. package/src/generator.js +41 -5
  9. package/src/index.js +86 -13
  10. package/src/prompts.js +37 -37
  11. package/templates/common/.claude/agents/architect-manager.md +45 -45
  12. package/templates/common/.claude/agents/architect.md +31 -31
  13. package/templates/common/.claude/agents/codebase-explorer.md +45 -0
  14. package/templates/common/.claude/agents/context-master.md +75 -75
  15. package/templates/common/.claude/agents/debugger.md +41 -41
  16. package/templates/common/.claude/agents/docs-researcher.md +41 -41
  17. package/templates/common/.claude/agents/explore-manager.md +41 -41
  18. package/templates/common/.claude/agents/implement-manager.md +49 -49
  19. package/templates/common/.claude/agents/implementer.md +40 -40
  20. package/templates/common/.claude/agents/memory-master.md +82 -64
  21. package/templates/common/.claude/agents/planner.md +34 -34
  22. package/templates/common/.claude/agents/researcher.md +41 -41
  23. package/templates/common/.claude/agents/review-manager.md +56 -56
  24. package/templates/common/.claude/agents/reviewer.md +34 -34
  25. package/templates/common/.claude/agents/task-scribe.md +70 -0
  26. package/templates/common/.claude/agents/verifier.md +29 -29
  27. package/templates/common/.claude/commands/wf-help.md +9 -5
  28. package/templates/common/.claude/commands/wf-update.md +24 -0
  29. package/templates/common/.claude/rules/ecc/common.md +57 -44
  30. package/templates/common/.claude/settings.json +13 -0
  31. package/templates/common/.claude/skills/subagent-orchestrator/SKILL.md +8 -4
  32. package/templates/common/.claude/skills/wf/SKILL.md +15 -8
  33. package/templates/common/.claude/skills/wf-auto/SKILL.md +10 -7
  34. package/templates/common/.claude/skills/wf-learn/SKILL.md +9 -2
  35. package/templates/common/.claude/skills/wf-max/SKILL.md +23 -5
  36. package/templates/common/.claude/skills/wf-readme/SKILL.md +49 -49
  37. package/templates/common/.claude/skills/wf-remove/SKILL.md +7 -7
  38. package/templates/common/.claude/skills/wf-update/SKILL.md +15 -2
  39. package/templates/common/.codex/hooks.json +17 -0
  40. package/templates/common/.harness-version +130 -45
  41. package/templates/common/.opencode/agents/architect-manager.md +52 -0
  42. package/templates/common/.opencode/agents/architect.md +35 -0
  43. package/templates/common/.opencode/agents/codebase-explorer.md +45 -0
  44. package/templates/common/.opencode/agents/context-master.md +81 -0
  45. package/templates/common/.opencode/agents/debugger.md +43 -0
  46. package/templates/common/.opencode/agents/docs-researcher.md +42 -0
  47. package/templates/common/.opencode/agents/explore-manager.md +49 -0
  48. package/templates/common/.opencode/agents/implement-manager.md +56 -0
  49. package/templates/common/.opencode/agents/implementer.md +42 -0
  50. package/templates/common/.opencode/agents/memory-master.md +88 -0
  51. package/templates/common/.opencode/agents/planner.md +38 -0
  52. package/templates/common/.opencode/agents/reflector.md +39 -0
  53. package/templates/common/.opencode/agents/researcher.md +42 -0
  54. package/templates/common/.opencode/agents/review-manager.md +63 -0
  55. package/templates/common/.opencode/agents/reviewer.md +37 -0
  56. package/templates/common/.opencode/agents/task-scribe.md +70 -0
  57. package/templates/common/.opencode/agents/tdd-guide.md +83 -0
  58. package/templates/common/.opencode/agents/test-writer.md +54 -0
  59. package/templates/common/.opencode/agents/verifier.md +37 -0
  60. package/templates/common/.opencode/commands/wf-auto-spark.md +15 -0
  61. package/templates/common/.opencode/commands/wf-auto.md +15 -0
  62. package/templates/common/.opencode/commands/wf-help.md +27 -0
  63. package/templates/common/.opencode/commands/wf-learn.md +15 -0
  64. package/templates/common/.opencode/commands/wf-max.md +15 -0
  65. package/templates/common/.opencode/commands/wf-readme.md +15 -0
  66. package/templates/common/.opencode/commands/wf-remove.md +15 -0
  67. package/templates/common/.opencode/commands/wf-review.md +15 -0
  68. package/templates/common/.opencode/commands/wf-update.md +24 -0
  69. package/templates/common/.opencode/commands/wf.md +15 -0
  70. package/templates/common/.opencode/plugins/harness-wf-status.mjs +135 -0
  71. package/templates/common/AGENTS.md +2 -29
  72. package/templates/common/CLAUDE.md +114 -88
  73. package/templates/common/Harness/ACCEPTANCE_PROTOCOL.md +2 -2
  74. package/templates/common/{MEMORY.md → Harness/MEMORY.md} +17 -4
  75. package/templates/common/Harness/MEMORY_PROTOCOL.md +80 -30
  76. package/templates/common/Harness/PROGRESS.md +17 -17
  77. package/templates/common/Harness/README.md +58 -19
  78. package/templates/common/{SETUP.md → Harness/SETUP.md} +278 -276
  79. package/templates/common/Harness/TASK_ARCHIVE.md +56 -0
  80. package/templates/common/Harness/WF-AUTO-ANGLES.md +170 -0
  81. package/templates/common/Harness/WF-AUTO-SPARK.md +10 -19
  82. package/templates/common/Harness/WF-AUTO.md +93 -167
  83. package/templates/common/Harness/WF-KERNEL.md +189 -0
  84. package/templates/common/Harness/WF-MAX.md +60 -328
  85. package/templates/common/Harness/WF-STATE.md +83 -0
  86. package/templates/common/Harness/WF.md +117 -237
  87. package/templates/common/Harness/agent-workflow.md +2 -2
  88. package/templates/common/Harness/architecture.md +124 -124
  89. package/templates/common/Harness/context-loading.md +111 -111
  90. package/templates/common/Harness/dispatch.md +43 -35
  91. package/templates/common/Harness/extension.md +66 -66
  92. package/templates/common/Harness/lifecycle.md +20 -20
  93. package/templates/common/Harness/research/PRD.md +56 -56
  94. package/templates/common/Harness/research/README.md +169 -169
  95. package/templates/common/Harness/research/research-results.md +66 -66
  96. package/templates/common/Harness/scripts/archive-tasks.mjs +239 -0
  97. package/templates/common/{scripts → Harness/scripts}/scan-clean.mjs +443 -416
  98. package/templates/common/{scripts → Harness/scripts}/validate-harness.mjs +691 -452
  99. package/templates/common/Harness/scripts/wf-auto-update-prompt.mjs +258 -0
  100. package/templates/common/{scripts → Harness/scripts}/wf-remove.mjs +56 -39
  101. package/templates/common/{scripts → Harness/scripts}/wf-update-check.mjs +632 -599
  102. package/templates/common/Harness/subagents.md +215 -214
  103. package/templates/common/Harness/tasks/_template/ARTIFACTS.md +2 -2
  104. package/templates/common/Harness/tasks/_template/NOTES.md +2 -2
  105. package/templates/common/Harness/tasks/_template/PLAN.md +5 -0
  106. package/templates/common/Harness/tasks/_template/STATE.json +23 -0
  107. package/templates/common/README.md +37 -37
  108. package/templates/common/memory/agent-lessons-patterns.md +22 -21
  109. package/templates/common/memory/routes.md +43 -0
  110. package/templates/common/memory/startup-hints.md +32 -0
  111. package/templates/common/memory/tool-usage-reflections.md +22 -21
  112. package/templates/common/memory/user-corrections-preferences.md +23 -21
  113. package/templates/common/opencode.json +19 -0
  114. package/templates/optional/catalog.json +49 -33
  115. package/templates/optional/skills/browser-e2e/.claude/skills/browser-e2e/SKILL.md +42 -42
  116. package/templates/optional/skills/browser-e2e/.claude/skills/wf-browser/SKILL.md +193 -193
  117. package/templates/optional/skills/browser-e2e/.opencode/commands/wf-browser.md +15 -0
  118. package/templates/optional/skills/browser-e2e/Harness/workflows/browser-e2e.md +48 -48
  119. package/templates/optional/skills/github-pr-review/.claude/skills/github-pr-review/SKILL.md +40 -40
  120. package/templates/optional/skills/github-pr-review/Harness/workflows/github-pr-review.md +28 -28
  121. package/templates/optional/skills/python-backend/.claude/skills/python-backend/SKILL.md +40 -40
  122. package/templates/optional/skills/python-backend/Harness/workflows/python-backend.md +34 -34
  123. package/templates/optional/skills/ts-react-frontend/.claude/skills/ts-react-frontend/SKILL.md +43 -43
  124. package/templates/optional/skills/ts-react-frontend/Harness/workflows/ts-react-frontend.md +34 -34
  125. package/templates/optional/skills/ui-ux-review/.claude/skills/ui-ux-review/SKILL.md +40 -40
  126. package/templates/optional/skills/ui-ux-review/Harness/workflows/ui-ux-review.md +26 -26
@@ -1,6 +1,6 @@
1
1
  # MEMORY.md - create-harness-vibe-coding Project Resource Index
2
2
 
3
- > The project fact source is reached via `CLAUDE.md -> Harness/README.md`. This file persists cross-session context: resource index, user preferences, tool usage standards.
3
+ > `CLAUDE.md` is the session entry router; `Harness/README.md` is the Harness documentation index. This file persists cross-session context: resource index, user preferences, tool usage standards.
4
4
  > Detailed memory lives in `Harness/memory/`. Keep entries short, newest first, and free of secrets.
5
5
 
6
6
  ## Agents (Sub-agents)
@@ -16,6 +16,8 @@
16
16
  - [reviewer](../.claude/agents/reviewer.md) - read-only spec/AC and code/architecture/test review.
17
17
  - [verifier](../.claude/agents/verifier.md) - verification commands and AC evidence matrix.
18
18
  - [reflector](../.claude/agents/reflector.md) - closeout synthesis, contradiction check, and final acceptance gate verdict.
19
+ - [task-scribe](../.claude/agents/task-scribe.md) - task state, heartbeat, dispatch ledger, evidence pointers — small-fast chore agent.
20
+ - [codebase-explorer](../.claude/agents/codebase-explorer.md) - scoped read-only source exploration, file discovery, symbol tracing — small-fast.
19
21
  - [memory-master](../.claude/agents/memory-master.md) - memory writing, dedup, consolidation, and cross-project knowledge extraction.
20
22
  - [context-master](../.claude/agents/context-master.md) - context analysis, compression alerts, and session knowledge extraction for memory-master.
21
23
  - [explore-manager](../.claude/agents/explore-manager.md) - WF-MAX W0 exploration: spawn 5-10 read-only researchers, synthesize, report to CEO.
@@ -27,15 +29,15 @@ Stack-specific agents can be added after the product shape is known.
27
29
 
28
30
  ## Skills (Workflows)
29
31
 
30
- - [WF Mode](WF.md) - complete role chain: plan, research/docs, architecture, test, implement, validation, cross-review, reflector, acceptance.
32
+ - [WF Mode](WF.md) - WF-KERNEL tiered orchestration: WF-Light (minimal roles), WF-Standard (adds review), WF-Full (complete role chain incl. reflector and cross-review).
31
33
  - [wf](../.claude/skills/wf/SKILL.md) - Claude Code WF skill command; mirrored for Codex at `../.agents/skills/wf/SKILL.md`.
32
34
  - [subagent-orchestrator](../.claude/skills/subagent-orchestrator/SKILL.md) - controller-led subagent orchestration, parallel read-only passes, review gates, and recovery handoffs.
33
35
  - [wf-readme](../.claude/skills/wf-readme/SKILL.md) - README preservation, append-only development sections, structured tables, and approved architecture diagrams.
34
36
  - [wf-review](../.claude/skills/wf-review/SKILL.md) - cross-model peer review: invoke the other agent CLI (Codex/Claude) for independent review.
35
37
  - [wf-update](../.claude/skills/wf-update/SKILL.md) - GitHub-based incremental harness update, checksum comparison, and safe in-place updates.
36
38
  - [wf-learn](../.claude/skills/wf-learn/SKILL.md) - force memory learning cycle: context-master -> memory-master -> project + global memory.
37
- - [wf-max](../.claude/skills/wf-max/SKILL.md) - WF strict superset: complete role chain plus maximum parallelism, current runtime subagents first, cross-CLI overflow when available.
38
- - [wf-auto](../.claude/skills/wf-auto/SKILL.md) - perpetual auto-optimization: bounded ticks, 8-angle internal scan, intent checkpoints, evidence ledger.
39
+ - [wf-max](../.claude/skills/wf-max/SKILL.md) - WF kernel + maximum safe fan-out: WF-Max-Useful by default (fan out only where independent), WF-Max-Strict only on explicit strict request; current runtime subagents first, cross-CLI overflow when available.
40
+ - [wf-auto](../.claude/skills/wf-auto/SKILL.md) - perpetual adaptive auto-optimization: evidence-selected probes, dynamic obligations, intent checkpoints, evidence ledger.
39
41
  - [wf-auto-spark](../.claude/skills/wf-auto-spark/SKILL.md) - perpetual inspiration mode: external spark search, long-term roadmap with staged milestones, <=50% deviation guard.
40
42
  - [tdd](../.claude/skills/tdd/SKILL.md) - acceptance-driven TDD: AC-linked RED tests, real UI clicks for browser-visible behavior, Playwright/CDP evidence, and configured coverage gate.
41
43
  - [wf-remove](../.claude/skills/wf-remove/SKILL.md) - safely remove Harness framework files (SAFE/MODIFIED/USER classes), auto-prune empty directories, backup option.
@@ -48,6 +50,8 @@ Codex repo-skill mirrors live under `../.agents/skills/` with the same skill nam
48
50
 
49
51
  Stack-specific skills can be added after the product shape is known.
50
52
 
53
+ - [browser-e2e](workflows/browser-e2e.md)
54
+
51
55
  ## Rules (Harness Constraints)
52
56
 
53
57
  Located under `.claude/rules/ecc/`, auto-loaded by the CC engine:
@@ -65,6 +69,9 @@ Located under `.claude/rules/ecc/`, auto-loaded by the CC engine:
65
69
  - [Memory protocol](MEMORY_PROTOCOL.md)
66
70
  - [WF mode](WF.md)
67
71
  - [WF Max mode](WF-MAX.md)
72
+ - [WF kernel contract](WF-KERNEL.md)
73
+ - [WF state machine / resume](WF-STATE.md)
74
+ - [Task archive mechanism](TASK_ARCHIVE.md)
68
75
  - [0-1 lifecycle](lifecycle.md)
69
76
  - [Research protocol](research/README.md)
70
77
  - [Context loading protocol](context-loading.md)
@@ -79,6 +86,12 @@ Located under `.claude/rules/ecc/`, auto-loaded by the CC engine:
79
86
 
80
87
  ## Memory Folder
81
88
 
89
+ > L2 startup digest: `memory/startup-hints.md` — lightweight hints loaded at session start.
90
+ > L3 route index: `memory/routes.md` — scenario hit-rules index (not detailed memory).
91
+ > L3 detailed files: loaded only when scenario matches via routes.
92
+
93
+ - [Startup hints](memory/startup-hints.md) - L2 lightweight startup digest (5-10 hints, no dates). Loaded at Harness session start; not a replacement for full router.
94
+ - [Memory routes](memory/routes.md) - L3 route index with signals/scoring/avoid rules. Not detailed memory — hit-rules only.
82
95
  - [Tool usage/reflections](memory/tool-usage-reflections.md) - repeated tool failures, better command patterns, environment-specific fixes.
83
96
  - [User corrections/preferences](memory/user-corrections-preferences.md) - repeated user corrections, durable preferences, common-sense course corrections.
84
97
  - [Agent lessons/patterns](memory/agent-lessons-patterns.md) - reusable lessons from review, debugging, validation, and handoff loops.
@@ -4,27 +4,35 @@ Purpose: record durable lessons from acceptance, validation, and debug work with
4
4
 
5
5
  Memory is downstream of evidence. It records reusable patterns, not raw transcripts.
6
6
 
7
+ ## L1/L2/L3 Memory Architecture
8
+
9
+ - **L1 = File/Project Facts**: CLAUDE.md, Harness/README.md, PROGRESS/task capsules. Always loaded when relevant.
10
+ - **L2 = Startup Digest**: `Harness/memory/startup-hints.md`. Lightweight hints loaded at session start. Not a replacement for full router.
11
+ - **L3 = Detailed Durable Memory**: `Harness/memory/*.md` files. Loaded only when scenario matches via `routes.md`.
12
+
7
13
  ## When To Write Memory
8
14
 
9
15
  Write memory when any condition applies:
10
16
 
11
- - the same tool or command pattern fails 3+ times
12
- - the user corrects the same assumption or preference 2+ times
13
- - a review/debug loop reveals a reusable lesson
14
- - WF closeout extracts durable acceptance, validation, or debug knowledge
17
+ - **Explicit user preference**: 用户显式说 remember/next time/never/always/记住/下次/不要再 时,清晰、安全、场景明确可立即写入 L3 (explicit user preference can be written immediately when safe and scoped)
18
+ - **Repeated implicit correction**: 同一假设/模式被纠正 2+ 次 — user corrects the same assumption or preference 2+ times
19
+ - **Tool/command pattern fails 3+ times**: 同类工具/命令失败 3+ 次 — same tool or command pattern fails 3+ times
20
+ - **Review/debug/validation lesson**: 只有可复用、能防回归时才写
21
+ - **WF closeout**: context-master 提取 durable knowledge 后写入
15
22
 
16
23
  ## What To Record
17
24
 
18
- Memory entries should be short, newest-first, and AC-aware when possible:
25
+ Memory entries should be short and AC-aware when possible. Use **compact format** (default no date):
19
26
 
20
27
  ```markdown
21
- ## 2026-07-02 - Playwright login validation needs network trace
22
-
23
- - Context: AC-003 passed visually but failed API payload validation.
24
- - Lesson: For login flows, require CDP/Playwright request assertions in addition to DOM checks.
25
- - Applies to: `ACCEPTANCE_PROTOCOL.md`, `HARNESS_BRIDGE.md`
28
+ - When <scenario>: <rule>. Avoid <over-application>. Signals: <signals>.
26
29
  ```
27
30
 
31
+ Only use date/timestamp headings when:
32
+ - Entry supersedes prior conflicting guidance
33
+ - Time-sensitive context (version, deprecation)
34
+ - Conflict resolution needed
35
+
28
36
  Good memory:
29
37
 
30
38
  - failure mode
@@ -39,38 +47,61 @@ Bad memory:
39
47
  - full logs when a summary is enough
40
48
  - transient speculation
41
49
  - implementation summaries with no reusable lesson
50
+ - task logs, process summaries, one-time emotions
42
51
 
43
- ## Closeout Flow
52
+ ## Memory Candidate Detection
44
53
 
45
- For WF closeout:
54
+ **Explicit trigger phrases** (中英文):
55
+ - 英文: remember, next time, don't, do not, never, always, I prefer, I want you to
56
+ - 中文: 记住, 下次, 以后, 不要再, 总是, 永远不要, 我偏好, 我希望你以后
46
57
 
47
- ```text
48
- context-master
49
- -> extract durable acceptance/debug/validation lessons
50
- -> memory-master
51
- -> deduplicate
52
- -> write concise memory entry
58
+ **Decision flow**:
59
+ ```
60
+ detect candidate -> classify target file -> safety filter -> dedup -> write/update -> return concise summary
53
61
  ```
54
62
 
55
- Memory Master writes to:
63
+ - **Explicit user preference**: can be written immediately when safe and scoped
64
+ - **Repeated implicit correction**: still requires 2+ occurrences
65
+ - **Tool failure**: 3+ same failures required
66
+ - **Review/debug lesson**: only when reusable and regression-preventing
56
67
 
57
- - `Harness/memory/tool-usage-reflections.md`
58
- - `Harness/memory/user-corrections-preferences.md`
59
- - `Harness/memory/agent-lessons-patterns.md`
60
- - `Harness/MEMORY.md` only for routing/index updates
68
+ ## Memory Routing (L3)
61
69
 
62
- ## Scenario Memory Hints
70
+ Routes are defined in `Harness/memory/routes.md`. Not detailed memory, but hit-rules index.
71
+
72
+ **Scenario pack**: intent / files / commands / signals / risk
73
+
74
+ **Scoring**:
75
+ - +4 exact file/path match
76
+ - +3 explicit trigger phrase match
77
+ - +3 command/error signature match
78
+ - +2 workflow/mode match
79
+ - +1 keyword overlap
80
+ - -4 avoid match
81
+
82
+ **Thresholds**:
83
+ - score >= 5: load matching entry/file section
84
+ - score 3-4: load route summary only
85
+ - score < 3: load nothing
86
+
87
+ **Hard triggers** (bypass scoring):
88
+ - Explicit user memory statement → user-corrections-preferences.md
89
+ - Same command fails 3x → tool-usage-reflections.md
90
+ - Review/debug/validation reusable lesson → agent-lessons-patterns.md
91
+ - Modifying hook-related files → load only-wf-auto hook lesson
92
+ - /wf-learn → full learning cycle
63
93
 
64
- Controllers, context-master, or memory-master may load a compact memory hint
65
- when the current task matches a known scenario. Hints must be scenario-specific
66
- and must not dump full memory files into context.
94
+ **Load logging**: always state `memory hints loaded: <id> because <signal>`
67
95
 
68
- Scenario hints are allowed when they help the current task avoid a known failure
69
- mode:
96
+ No embedding; keep stable, explainable, token-efficient.
97
+
98
+ ## Scenario Memory Hints
99
+
100
+ Controllers, context-master, or memory-master may load a compact memory hint when the current task matches a known scenario.
70
101
 
71
102
  | Scenario | Load Or Hint |
72
103
  | --- | --- |
73
- | new session / startup | `Harness/MEMORY.md` index only |
104
+ | new session / startup | `Harness/memory/startup-hints.md` (L2 digest) |
74
105
  | same tool or command error repeats | matching entries from `memory/tool-usage-reflections.md` |
75
106
  | user repeats a correction or preference | matching entries from `memory/user-corrections-preferences.md` |
76
107
  | review/debug/validation failure | matching entries from `memory/agent-lessons-patterns.md` |
@@ -87,6 +118,25 @@ Hint rules:
87
118
  - never inject secrets, credentials, tokens, private data, or raw transcripts
88
119
  - memory-master owns writes; controller/context-master route context
89
120
 
121
+ ## Closeout Flow
122
+
123
+ For WF closeout:
124
+
125
+ ```text
126
+ context-master
127
+ -> extract durable acceptance/debug/validation lessons
128
+ -> memory-master
129
+ -> deduplicate
130
+ -> write concise entry
131
+ ```
132
+
133
+ Memory Master writes to:
134
+
135
+ - `Harness/memory/tool-usage-reflections.md`
136
+ - `Harness/memory/user-corrections-preferences.md`
137
+ - `Harness/memory/agent-lessons-patterns.md`
138
+ - `Harness/MEMORY.md` only for routing/index updates
139
+
90
140
  ## Memory Write Flow
91
141
 
92
142
  Memory write triggers must never append raw logs directly to memory files.
@@ -1,17 +1,17 @@
1
- # PROGRESS.md
2
-
3
- Global task index. Load at session start to see what is active and what was done.
4
-
5
- ## Active Task
6
-
7
- None — create a new task from `Harness/tasks/_template/` when work spans more than one step.
8
-
9
- ## Task Index
10
-
11
- | ID | Goal | Phase | Closed |
12
- |----|------|-------|--------|
13
-
14
- ## Cross-Task Decisions
15
-
16
- | Date | Decision | Reason |
17
- |------|----------|--------|
1
+ # PROGRESS.md
2
+
3
+ Global task index. Load at session start to see what is active and what was done.
4
+
5
+ ## Active Task
6
+
7
+ None — create a new task from `Harness/tasks/_template/` when work spans more than one step.
8
+
9
+ ## Task Index
10
+
11
+ | ID | Goal | Phase | Closed |
12
+ |----|------|-------|--------|
13
+
14
+ ## Cross-Task Decisions
15
+
16
+ | Date | Decision | Reason |
17
+ |------|----------|--------|
@@ -1,8 +1,43 @@
1
1
  # create-harness-vibe-coding - Harness Router
2
2
 
3
- Purpose: route humans and agents to the smallest useful context. `Harness/README.md` is the primary router.
3
+ Purpose: route humans and agents to the smallest useful context. `CLAUDE.md` is the session entry router; `Harness/README.md` is the primary Harness documentation router.
4
4
 
5
- Default load: `CLAUDE.md`, `Harness/MEMORY.md`, this file, and `Harness/PROGRESS.md` when work is active. Do not read the whole `Harness/` tree.
5
+ Default load: `CLAUDE.md`. For workflow commands (`/wf`, `/wf-max`, `/wf-auto`, `/wf-review`, `/wf-learn`, `/wf-readme`, `/wf-remove`, `/wf-browser`, `/wf-auto-spark`), also load `Harness/MEMORY.md` (index only per Memory Preflight), this file, and `Harness/PROGRESS.md` when work is active.
6
+
7
+ `/wf-help` and `/wf-update` are **direct commands**: skip the router, do NOT load `Harness/MEMORY.md`, do NOT enter WF, execute immediately.
8
+
9
+ Do not read the whole `Harness/` tree.
10
+
11
+ ## Resume Routing / Active Task Resume
12
+
13
+ `Harness/PROGRESS.md` is the global active pointer. `Harness/tasks/<task-id>/STATE.json` is the machine-readable resume entry.
14
+
15
+ On session start (new window, reopen, resume):
16
+ 1. If the user says "continue", "resume", "last task", "current task", "status", or the work is not a simple direct task, read `Harness/PROGRESS.md`.
17
+ 2. Find the Active Task, then read `Harness/tasks/<active-task>/STATE.json` first.
18
+ 3. From STATE.json, determine:
19
+ - Current phase — what was in progress
20
+ - activeQuestion — is a user answer needed before proceeding?
21
+ - ready queue — can work be dispatched immediately?
22
+ - running items — need result confirmation?
23
+ - blocked — what's blocking?
24
+ - nextAction — what to do next
25
+ 4. Do NOT discover context by reading all task directories. Use the active pointer.
26
+ 5. Direct simple tasks may skip STATE/PLAN/PROGRESS unless the user says "continue"/"resume".
27
+
28
+ See `Harness/WF-STATE.md` for the full state machine contract and enums.
29
+
30
+ ## Direct Mode (Degradation Path)
31
+
32
+ When the user does NOT explicitly invoke `/wf-*`, `$wf-*`, `/skills wf`, `/skills wf-max`, or say `wf` / `wf-max`, the request is handled in **direct mode**. Skip the router entirely. Execute the task. Do not load `Harness/MEMORY.md`, `Harness/README.md`, or `Harness/PROGRESS.md`.
33
+
34
+ Complex work may use direct planning, task capsules, tests, and subagents without entering WF.
35
+
36
+ Escalate to the router (next section) only when:
37
+ - User explicitly invokes `/wf`, `/wf-max`, `$wf`, `$wf-max`, `/skills wf`, `/skills wf-max`, or says `wf` / `wf-max`
38
+ - User invokes another workflow `/wf-*` command (NOT `/wf-help` or `/wf-update` — those are direct commands)
39
+
40
+ `/wf-help` and `/wf-update` are direct commands executed immediately without router load.
6
41
 
7
42
  ## 0-1 Flow
8
43
 
@@ -55,37 +90,39 @@ Keywords are retrieval hints, not project facts.
55
90
 
56
91
  Load the matching row only. Add adjacent docs only when the loaded doc directly names them.
57
92
 
58
- Routing priority: if a request explicitly says `/wf <task>`, `$wf`, `wf mode`, `workflow mode`, or `wk mode`, or is long, difficult, uncertain, repeated-failure, migration, architecture-heavy, browser-visible, or broad multi-agent implementation work, choose the WF row first. Load `Harness/WF.md` directly, then delegate subagent coordination to `subagent-orchestrator`. If the request says `/wf-auto`, `$wf-auto`, `wf auto`, or `auto mode`, choose the WF-AUTO row and load `Harness/WF-AUTO.md`.
93
+ Routing priority: **direct mode is the default** when no explicit WF token is present. Complex tasks may still plan, test, and use subagents without entering WF. If a request contains an explicit WF token (`/wf`, `$wf`, `/skills wf`, `/wf-max`, `$wf-max`, `/skills wf-max`), follow the WF contract. WF mode has three tiers: **WF-Light** (low-risk, explicit `/wf` — planner/test/verifier; no mandatory research/architecture/cross-review/reflector), **WF-Standard** (multi-file or behavior change compact ACs, one implementer, one independent validation/review), **WF-Full** (high-risk, cross-layer, security/data-loss, browser/API, ambiguous architecture, or user asks for full role chain). `/wf-max` has two modes: **WF-Max-Useful** (default fan-out only where write sets or review lenses are meaningfully independent) and **WF-Max-Strict** (explicit strict override preserving unconditional fan-out).
59
94
 
60
95
  | When to Read | Keywords | Load | Output |
61
96
  | --- | --- | --- | --- |
97
+ | **Direct mode (default)** | simple, single-step, low-risk, commit, push, one-line, read, question, status, no /wf-* command | Nothing beyond CLAUDE.md | Direct execution; no router load |
62
98
  | Raw idea or vague product request | idea, vague, clarify, goal, non-goal, lifecycle | [lifecycle.md](lifecycle.md), [research/PRD.md](research/PRD.md) | clarified goal, non-goals, first questions |
63
99
  | Need market/tech direction | research, market, competitor, stack, library, pricing, policy | [research/README.md](research/README.md), [research/research-results.md](research/research-results.md) | research protocol, adopted/rejected choices |
64
100
  | Need MVP/spec | PRD, MVP, scope, requirement, acceptance, non-goal | [research/PRD.md](research/PRD.md), [ACCEPTANCE_PROTOCOL.md](ACCEPTANCE_PROTOCOL.md) | Mini PRD with AC IDs and verifiable acceptance criteria |
65
101
  | Need architecture or boundaries | architecture, boundary, layer, port, adapter, dependency | [architecture.md](architecture.md) | layer map, ports, constraints |
66
102
  | Need WF command help | /wf-help, wf help, command list, list wf commands | `.claude/commands/wf-help.md` | direct command table; no skill invocation |
67
- | Need WF mode | wf, /wf, $wf, wf mode, workflow mode, wk mode, long task, difficult, stuck, repeated failure | [WF.md](WF.md), [PROGRESS.md](PROGRESS.md), the current task `tasks/<id>/PROGRESS.md` and `tasks/<id>/PLAN.md` | complete role chain, heartbeat, recovery loop; explicit WF/WK loads subagent docs immediately |
68
- | Need perpetual auto-optimization | /wf-auto, $wf-auto, wf auto, auto mode, never stop, self-improve, continuous optimize | [WF-AUTO.md](WF-AUTO.md), [subagents.md](subagents.md), [dispatch.md](dispatch.md) | perpetual loop, bounded ticks, optional wf-auto-only hook exception, 8-angle scan, spark search, intent checkpoint, evidence ledger; CEO never writes code |
69
- | Need perpetual inspiration mode | /wf-auto-spark, $wf-auto-spark, wf auto spark, spark mode, external inspiration, discover mode, never stop | [WF-AUTO-SPARK.md](WF-AUTO-SPARK.md), [WF-AUTO.md](WF-AUTO.md), [subagents.md](subagents.md), [dispatch.md](dispatch.md) | roadmap-anchored: North Star + milestones; external spark search; <=50% deviation guard; never auto-stops |
70
- | Need WF-MAX mode | /wf-max, $wf-max, wf max, maximum parallelism, CEO, Manager, Worker, fan-out | [WF-MAX.md](WF-MAX.md), [subagents.md](subagents.md), [dispatch.md](dispatch.md) | WF strict superset: complete role chain plus maximum fan-out, current runtime subagents first, cross-CLI overflow when available |
103
+ | Need WF mode (explicit only) | /wf, $wf, /skills wf (explicit user token only) | [WF.md](WF.md), [WF-KERNEL.md](WF-KERNEL.md), [PROGRESS.md](PROGRESS.md), the current task `tasks/<id>/PROGRESS.md` and `tasks/<id>/PLAN.md` | dynamic ready-queue orchestration, tier-gated acceptance |
104
+ | Need perpetual auto-optimization | /wf-auto, $wf-auto, /skills wf-auto (explicit user token only) | [WF-AUTO.md](WF-AUTO.md), [WF-AUTO-ANGLES.md](WF-AUTO-ANGLES.md), [subagents.md](subagents.md), [dispatch.md](dispatch.md) | perpetual loop, adaptive probe selection, dynamic risk obligations, spark search, intent checkpoint, evidence ledger; CEO never writes code |
105
+ | Need perpetual inspiration mode | /wf-auto-spark, $wf-auto-spark, /skills wf-auto-spark (explicit user token only) | [WF-AUTO-SPARK.md](WF-AUTO-SPARK.md), [WF-AUTO.md](WF-AUTO.md), [subagents.md](subagents.md), [dispatch.md](dispatch.md) | roadmap-anchored: North Star + milestones; external spark search; <=50% deviation guard; never auto-stops |
106
+ | Need WF-MAX mode (explicit only) | /wf-max, $wf-max, /skills wf-max (explicit user token only) | [WF-MAX.md](WF-MAX.md), [WF-KERNEL.md](WF-KERNEL.md), [subagents.md](subagents.md), [dispatch.md](dispatch.md) | /wf kernel + max safe fan-out (WF-Max-Useful default, WF-Max-Strict override) |
71
107
  | Need peer review | /wf-review, $wf-review, peer review, second opinion, cross-check, stuck | `.claude/skills/wf-review/SKILL.md`, `.agents/skills/wf-review/SKILL.md`, `Harness/README.md` | cross-model multi-dimension review with severity classification |
72
108
  | Adding harness to existing project | existing project, onboarding, migrate, bootstrap, preserve, conflict | [extension.md](extension.md), [PROGRESS.md](PROGRESS.md), root `README.md` and package/CI files | discovered project facts, preserved config, manual registration plan |
73
109
  | README optimization | README, docs, quickstart, install docs, architecture diagram, command table, documentation polish | root `README.md`, `.claude/skills/wf-readme/SKILL.md`, [PROGRESS.md](PROGRESS.md), [architecture.md](architecture.md) as needed | approved README mode, preserved sections, proposed diff plan |
74
110
  | Need implementation plan | plan, task, write set, verify, milestone, progress | [PROGRESS.md](PROGRESS.md), the current task `tasks/<id>/PROGRESS.md` and `tasks/<id>/PLAN.md`, [agent-workflow.md](agent-workflow.md), [ACCEPTANCE_PROTOCOL.md](ACCEPTANCE_PROTOCOL.md) | tasks, AC IDs, write set, verification commands |
111
+ | Browser E2E testing or automation | /wf-browser, browser, e2e, web automation, form fill, screenshot verify, page test, browser test, Playwright AI, Browser Use, CDP | browser-e2e workflow, [HARNESS_BRIDGE.md](HARNESS_BRIDGE.md), wf-browser skill, Browser Use skill | UI/API contract, CLI commands, screenshots, traces, validation matrix |
75
112
  | Optional workflow installed | workflow, optional, ui-ux-review, github-pr-review, python-backend, ts-react-frontend | matching `workflows/*.md` (if installed), [extension.md](extension.md) | workflow-specific evidence, commands, fallback path |
76
113
  | Need durable memory or reflection | memory, remember, preference, correction, tool failure, lesson, reflection, scenario memory | [MEMORY.md](MEMORY.md), [MEMORY_PROTOCOL.md](MEMORY_PROTOCOL.md), `Harness/memory/tool-usage-reflections.md`, `Harness/memory/user-corrections-preferences.md`, `Harness/memory/agent-lessons-patterns.md` | concise newest-first memory entry, scenario memory hint, or no-op rationale |
77
114
  | Need subagents | subagent, role pack, context, inject, return format, orchestrator, isolation | [subagents.md](subagents.md), [context-loading.md](context-loading.md), [dispatch.md](dispatch.md), [AGENT_ISOLATION.md](AGENT_ISOLATION.md) | controller plan, role-specific context pack, isolation-aware dispatch pack |
78
115
  | Need feature work | feature, implementation, TDD, test, review, closeout | [tasks/_template/PLAN.md](tasks/_template/PLAN.md), [agent-workflow.md](agent-workflow.md), [TDD-GUIDE.md](TDD-GUIDE.md), [ACCEPTANCE_PROTOCOL.md](ACCEPTANCE_PROTOCOL.md) | task plan, AC-linked RED tests, implementation loop |
79
116
  | Review or release check | review, release, finding, risk, evidence, verification | [agent-workflow.md](agent-workflow.md), current feature doc | findings, verification evidence |
80
117
  | Harness readiness check | validate, readiness, placeholder, missing file, release gate | `Harness/scripts/validate-harness.mjs`, `Harness/scripts/validate-harness.mjs --strict` | structural install check; strict bootstrap/release placeholder check |
81
- | Need harness update | /wf-update, $wf-update, update, check for updates, harness version | `.claude/skills/wf-update/SKILL.md`, `.agents/skills/wf-update/SKILL.md`, `Harness/.harness-version`, `Harness/scripts/wf-update-check.mjs` | script-driven comparison, SAFE/CONFLICT/PRESERVE classification, user decides conflicts |
118
+ | Need harness update | /wf-update, $wf-update, update, check for updates, harness version | `.claude/commands/wf-update.md`, `.opencode/commands/wf-update.md`, `Harness/.harness-version`, `Harness/scripts/wf-update-check.mjs`; Codex fallback: `.claude/skills/wf-update/SKILL.md` | script-driven comparison, SAFE/CONFLICT/PRESERVE classification, user decides conflicts |
82
119
  | Need harness removal | /wf-remove, $wf-remove, wf remove, remove harness, uninstall harness | `.claude/skills/wf-remove/SKILL.md`, `.agents/skills/wf-remove/SKILL.md`, `Harness/scripts/wf-remove.mjs` | safe removal plan: auto-remove SAFE, confirm MODIFIED, never touch USER DATA |
83
120
 
84
121
  ## Gates
85
122
 
86
123
  - Move phases in order unless the user asks for a fast lane.
87
- - Use `/wf <task>` in Claude Code, `$wf` in Codex, `/wf-max [task]` or `$wf-max`, `wf mode`, `workflow mode`, or `wk mode` when a task is long, difficult, uncertain, multi-file, or repeatedly failing.
88
- - Use `/wf-auto` for perpetual self-directed optimization that never stops until 8-angle exhaustion.
124
+ - Use `/wf <task>` in Claude Code or `$wf` in Codex, or `/wf-max [task]` / `$wf-max` for maximum-parallelism mode. WF mode is explicit only. WF-Light for low-risk, WF-Standard for multi-file, WF-Full for high-risk/cross-layer. `/wf-max` defaults to useful-fanout (WF-Max-Useful); use explicit `--strict` or "strict wf-max" for unconditional fan-out (WF-Max-Strict).
125
+ - Use `/wf-auto` for perpetual self-directed optimization. It selects probes from project evidence and stops only after dynamic risk obligations and two different empty confirmation passes are recorded.
89
126
  - **WF-MAX Role Contract**: Three-layer architecture: global mode (`wf-max`), agent role (`ceo|manager|worker|verifier|reviewer|reflector`), dispatch permission (`writeSet`, `forbidden`, `verification`). CEO never writes source code. Workers edit only dispatch.writeSet. Compliance is checked through dispatch packets, independent review, validation evidence, and task capsules. See `CLAUDE.md#1a`.
90
127
  - **WF-REVIEW Anti-Self-Review**: Must invoke the OTHER CLI (Codex -> Claude, or Claude -> Codex). Same-model simulation is forbidden.
91
128
  - WF-MAX has no runtime hook state. The durable state is the task capsule, dispatch table, review findings, and validation evidence. The only runtime hook exception in Harness is the optional `/wf-auto` bounded tick hook described in `WF-AUTO.md`.
@@ -111,35 +148,37 @@ Routing priority: if a request explicitly says `/wf <task>`, `$wf`, `wf mode`, `
111
148
  | Category | Files |
112
149
  |----------|-------|
113
150
  | **Router + Index** | `README.md`, `MEMORY.md`, `PROGRESS.md` |
114
- | **Task Capsule** | `tasks/<id>/PROGRESS.md`, `tasks/<id>/PLAN.md`, `tasks/_template/` |
115
- | **Workflows** | `WF.md`, `WF-MAX.md`, `WF-AUTO.md`, `WF-AUTO-SPARK.md` |
151
+ | **Task Capsule** | `tasks/<id>/PROGRESS.md`, `tasks/<id>/PLAN.md`, `tasks/<id>/STATE.json`, `tasks/_template/` |
152
+ | **Workflows** | `WF.md`, `WF-KERNEL.md`, `WF-STATE.md`, `WF-MAX.md`, `WF-AUTO.md`, `WF-AUTO-SPARK.md` |
116
153
  | **Protocols** | `ACCEPTANCE_PROTOCOL.md`, `AGENT_ISOLATION.md`, `HARNESS_BRIDGE.md`, `DEBUG_PROTOCOL.md`, `MEMORY_PROTOCOL.md` |
117
- | **Guides** | `ECC-GUIDE.md`, `TDD-GUIDE.md`, `lifecycle.md`, `architecture.md` |
118
- | **Orchestration** | `subagents.md`, `context-loading.md`, `dispatch.md`, `agent-workflow.md`, `extension.md` |
154
+ | **Guides** | `ECC-GUIDE.md`, `TDD-GUIDE.md`, `lifecycle.md`, `architecture.md`, `TASK_ARCHIVE.md` |
155
+ | **Orchestration** | `subagents.md`, `context-loading.md`, `dispatch.md`, `agent-workflow.md`, `extension.md`, `WF-STATE.md` |
119
156
  | **Research** | `research/README.md`, `research/PRD.md`, `research/research-results.md` |
120
157
  | **Acceptance Templates** | `templates/PRD.template.md`, `templates/ACCEPTANCE.template.md`, `templates/UI_CONTRACT.template.md`, `templates/API_CONTRACT.template.md`, `templates/TEST_PLAN.template.md`, `templates/PLAYWRIGHT_SPEC.template.ts`, `templates/VALIDATION_REPORT.template.md` |
121
158
  | **Memory** | `memory/tool-usage-reflections.md`, `memory/user-corrections-preferences.md`, `memory/agent-lessons-patterns.md` |
122
- | **Scripts** | `scripts/validate-harness.mjs`, `scripts/wf-update-check.mjs`, `scripts/wf-remove.mjs` |
159
+ | **Scripts** | `scripts/validate-harness.mjs`, `scripts/wf-update-check.mjs`, `scripts/wf-remove.mjs`, `scripts/archive-tasks.mjs` |
123
160
  | **Runtime** | `.harness-version` |
124
161
  | **Agents + Skills** | `.claude/agents/*`, `.claude/skills/*`, `.agents/skills/*` |
125
- | **Direct Commands** | `.claude/commands/wf-help.md` |
162
+ | **Direct Commands** | `.claude/commands/wf-help.md`, `.claude/commands/wf-update.md`, `.opencode/commands/wf-help.md`, `.opencode/commands/wf-update.md` |
126
163
 
127
164
  ## Direct Commands
128
165
 
129
166
  | Command | Purpose |
130
167
  |---|---|
131
168
  | `/wf-help` | Directly returns a table of all Harness WF commands, usage, and purpose. It does not invoke a skill or start a workflow. |
169
+ | `/wf-update` | Script-driven harness update: fetch + compare + apply. Direct command for Claude Code and OpenCode; skill path available for Codex compatibility. |
132
170
 
133
171
  ## Skill Commands
134
172
 
135
173
  | Claude Code | Codex | Purpose |
136
174
  |---|---|---|
137
- | `/wf <task>` | `$wf <task>` | Complete role chain: plan, research/docs, architecture, test, implement, validation, cross-review, reflector, acceptance |
138
- | `/wf-max [task]` | `$wf-max [task]` | WF strict superset with maximum parallelism: CEO -> Manager -> Worker, cross-CLI overflow |
139
- | `/wf-auto` | `$wf-auto` | Perpetual auto-optimization: never stops until 8-angle exhaustion |
175
+ | `/wf <task>` | `$wf <task>` | Tiered WF: WF-Light (low-risk, planner/test/verifier), WF-Standard (multi-file, compact ACs), WF-Full (high-risk/cross-layer, full role chain) |
176
+ | `/wf-max [task]` | `$wf-max [task]` | WF-Max-Useful default (fan-out only where independent), WF-Max-Strict override (unconditional fan-out) |
177
+ | `/wf-auto` | `$wf-auto` | Perpetual adaptive auto-optimization: dynamic probes, risk obligations, evidence-based exhaustion |
140
178
  | `/wf-auto-spark` | `$wf-auto-spark` | Perpetual inspiration: spark search, roadmap-anchored, <=50% deviation guard, never auto-stops |
141
179
  | `/wf-review [focus]` | `$wf-review [focus]` | Cross-model peer review via Codex <-> Claude |
142
180
  | `/wf-learn` | `$wf-learn` | Force learning cycle: context-master -> memory-master |
181
+ | `/wf-browser [task]` | `$wf-browser [task]` | AI-driven browser automation for E2E testing |
143
182
  | `/wf-readme [task]` | `$wf-readme [task]` | README preservation, merge, and documentation improvement workflow |
144
183
  | `/wf-update` | `$wf-update` | Script-driven harness update: fetch + compare + apply |
145
184
  | `/wf-remove` | `$wf-remove` | Safe harness removal: auto-delete SAFE, confirm MODIFIED, preserve USER DATA |