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
@@ -0,0 +1,24 @@
1
+ # /wf-update
2
+
3
+ Run the Harness update checker script. Do not invoke a skill or start WF mode.
4
+
5
+ ## Flow
6
+
7
+ 1. Run `node Harness/scripts/wf-update-check.mjs --json` and use the `agent` block as the action plan.
8
+ 2. Preserve all PRESERVE files. Never overwrite user task, memory, research, README, package, or architecture files.
9
+ 3. If `agent.safeApplyCommand` is present, run it to apply SAFE/NEW files first.
10
+ 4. For conflicts, compare local with `templateHint` or `remoteUrl`, decide merge/keep-local/overwrite, and record via `--accept-local`, `--accept-merged`, or `--accept-template`.
11
+ 5. Run `node Harness/scripts/wf-update-check.mjs --finalize` after all conflicts resolved.
12
+ 6. After update, run `node Harness/scripts/validate-harness.mjs` and `node Harness/scripts/scan-clean.mjs`.
13
+
14
+ Codex users without a direct command surface: use `$wf-update` (skill path) or `node Harness/scripts/wf-update-check.mjs`.
15
+
16
+ ## Recovery
17
+
18
+ If the script reports `Harness/.harness-version not found` or the update checker script itself is missing (`Harness/scripts/wf-update-check.mjs`), the Harness install predates version-tracking. Recover by regenerating missing infrastructure without overwriting user files:
19
+
20
+ ```
21
+ npx create-harness-vibe-coding@latest <project-name> . -y --on-conflict skip
22
+ ```
23
+
24
+ This creates missing Harness files while preserving CLAUDE.md, README.md, tasks, memory, research, and all user data. After recovery, re-run the update check.
@@ -1,45 +1,58 @@
1
- ---
2
- description: "Universal harness constraints"
3
- alwaysApply: true
4
- ---
5
-
6
- # Universal Rules
7
-
8
- ## Context
9
-
10
- - Start with `CLAUDE.md`, `Harness/MEMORY.md`, and `Harness/README.md`.
11
- - Do not bulk-read `Harness/`. Load by router trigger.
12
- - Keep `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md` current when work has multiple steps, files, or agents.
13
- - project files are the only durable communication channel. chat/subagent transcript state is non-authoritative.
14
- - Important assumptions, decisions, blockers, evidence, and handoffs must be written to `Harness/tasks/<task-id>/PROGRESS.md`, `Harness/tasks/<task-id>/PLAN.md`, the current feature doc, `Harness/MEMORY.md`, or `Harness/memory/*` as appropriate.
15
-
16
- ## Verification
17
-
18
- - Define acceptance criteria before implementation.
19
- - New behavior: failing test first, or a written manual check if automation is not feasible yet.
20
- - Bug fix: reproduction first.
21
- - Before release, add CI for the chosen stack and run the full verification path.
22
-
23
- ## Subagents
24
-
25
- - Use `Harness/subagents.md` before orchestrating multiple agents.
26
- - Use `Harness/context-loading.md` before spawning.
27
- - Use `Harness/dispatch.md` before parallel or multi-agent work.
1
+ ---
2
+ description: "Universal harness constraints"
3
+ alwaysApply: true
4
+ ---
5
+
6
+ # Universal Rules
7
+
8
+ ## Context
9
+
10
+ - Start with `CLAUDE.md`. When `Harness/` exists, also read `Harness/memory/startup-hints.md` (L2 lightweight digest, not full router).
11
+ - When the user explicitly invokes a `/wf-*` command, load `Harness/MEMORY.md` and `Harness/README.md`.
12
+ - For simple single-step tasks without `/wf-*`, operate in direct mode: skip the Harness router and execute directly.
13
+ - Do not bulk-read `Harness/`. Load by router trigger.
14
+ - Keep `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md` current when work has multiple steps, files, or agents.
15
+ - project files are the only durable communication channel. chat/subagent transcript state is non-authoritative.
16
+ - Important assumptions, decisions, blockers, evidence, and handoffs must be written to `Harness/tasks/<task-id>/PROGRESS.md`, `Harness/tasks/<task-id>/PLAN.md`, the current feature doc, `Harness/MEMORY.md`, or `Harness/memory/*` as appropriate.
17
+
18
+ ## Verification
19
+
20
+ - Define acceptance criteria before implementation.
21
+ - New behavior: failing test first, or a written manual check if automation is not feasible yet.
22
+ - Bug fix: reproduction first.
23
+ - Before release, add CI for the chosen stack and run the full verification path.
24
+
25
+ ## Low-Noise Progress
26
+
27
+ - Keep intermediate user updates to 1-2 short sentences.
28
+ - Do not recap plans, paste logs, or narrate obvious file reads while working.
29
+ - Put the detailed summary in the final response: files changed, verification, risks, and commit hash when relevant.
30
+ - During long-running work, report only phase changes, blockers, failed commands, or user decisions needed.
31
+
32
+ ## Subagents
33
+
34
+ - Use `Harness/subagents.md` before orchestrating multiple agents.
35
+ - Use `Harness/context-loading.md` before spawning.
36
+ - Use `Harness/dispatch.md` before parallel or multi-agent work.
28
37
  - Use `Harness/extension.md` before adding stack-specific agents, skills, or rules.
29
- - Every subagent needs role, task, read boundary, write boundary, and return format.
30
- - Writing agents must run serially unless write sets are disjoint.
31
- - If the runtime cannot spawn subagents, emulate the same role pack in a separate bounded pass.
32
- - Main agent owns integration and final verification.
33
-
34
- ## Memory
35
-
36
- - Record a lightweight reflection in `Harness/memory/tool-usage-reflections.md` when the same tool/use pattern fails 3+ times.
37
- - Record repeated user corrections or durable preferences in `Harness/memory/user-corrections-preferences.md` when the user corrects the same assumption/pattern 2+ times.
38
- - Record reusable review/debug lessons in `Harness/memory/agent-lessons-patterns.md`.
39
- - Keep memory entries concise and never include secrets.
40
-
41
- ## Security
42
-
43
- - No secrets in source code.
44
- - Validate external input at system boundaries.
45
- - High-risk actions need explicit user approval or documented permission policy.
38
+ - Every subagent needs role, task, read boundary, write boundary, and return format.
39
+ - Writing agents must run serially unless write sets are disjoint.
40
+ - If the runtime cannot spawn subagents, emulate the same role pack in a separate bounded pass.
41
+ - Main agent owns integration and final verification.
42
+
43
+ ## Memory
44
+
45
+ - Detect memory candidates when user says: `remember`, `next time`, `don't`, `do not`, `never`, `always`, `I prefer`, `I want you to`, `记住`, `下次`, `以后`, `不要再`, `总是`, `永远不要`, `我偏好`, `我希望你以后`.
46
+ - Explicit user preference that is clear, safe, and scoped can be written to L3 immediately without waiting for `/wf-learn`.
47
+ - Use `Harness/memory/routes.md` for deterministic route matching before loading detailed L3 memory.
48
+ - Record a lightweight reflection in `Harness/memory/tool-usage-reflections.md` when the same tool/use pattern fails 3+ times.
49
+ - Record repeated user corrections or durable preferences in `Harness/memory/user-corrections-preferences.md` when the user corrects the same assumption/pattern 2+ times.
50
+ - Record reusable review/debug lessons in `Harness/memory/agent-lessons-patterns.md`.
51
+ - Never record task logs, process summaries, one-time emotions, transient notes, raw logs, or secrets.
52
+ - Keep memory entries compact and default to no date; only add date/timestamp for superseded, conflicting, or time-sensitive entries.
53
+
54
+ ## Security
55
+
56
+ - No secrets in source code.
57
+ - Validate external input at system boundaries.
58
+ - High-risk actions need explicit user approval or documented permission policy.
@@ -29,5 +29,18 @@
29
29
  "Read(**/*.key)",
30
30
  "Read(**/*.pem)"
31
31
  ]
32
+ },
33
+ "hooks": {
34
+ "UserPromptSubmit": [
35
+ {
36
+ "matcher": "",
37
+ "hooks": [
38
+ {
39
+ "type": "command",
40
+ "command": "node -e \"const fs=require('fs'),p=require('path'),cp=require('child_process');let d=process.env.CLAUDE_PROJECT_DIR||process.cwd();for(;;){const s=p.join(d,'Harness','scripts','wf-auto-update-prompt.mjs');if(fs.existsSync(s)){const r=cp.spawnSync(process.execPath,[s,'--format','claude'],{stdio:'inherit',cwd:d,env:process.env});process.exitCode=(r.status==null)?0:r.status;break}const u=p.dirname(d);if(u===d)break;d=u}\""
41
+ }
42
+ ]
43
+ }
44
+ ]
32
45
  }
33
46
  }
@@ -8,6 +8,12 @@ description: Use when work needs bounded subagent coordination, parallel read-on
8
8
  This skill is runtime-neutral. Claude Code and Codex expose different
9
9
  subagent surfaces; follow the same Harness role contract either way.
10
10
 
11
+ ## Memory Preflight
12
+
13
+ 1. Direct simple tasks and `/wf-help` are exempt.
14
+ 2. For non-direct work, load `CLAUDE.md`, `Harness/MEMORY.md` index only, then `Harness/README.md` before planning, dispatch, edits/deletes, validation, or peer review.
15
+ 3. Load `Harness/memory/*` only when `MEMORY_PROTOCOL.md` scenario hints match; otherwise record "memory hints: none".
16
+
11
17
  ## Load
12
18
 
13
19
  - `Harness/subagents.md`
@@ -16,7 +22,7 @@ subagent surfaces; follow the same Harness role contract either way.
16
22
  - `Harness/agent-workflow.md`
17
23
  - `Harness/PROGRESS.md`
18
24
  - Active `Harness/tasks/<task-id>/PROGRESS.md` and `PLAN.md`, when present
19
- - `Harness/WF.md` when in `/wf`, `wf mode`, `workflow mode`, or `wk mode`
25
+ - `Harness/WF.md` when in explicit `/wf`, `$wf`, or `/skills wf`
20
26
 
21
27
  ## Runtime Mapping
22
28
 
@@ -36,9 +42,7 @@ subagent surfaces; follow the same Harness role contract either way.
36
42
  integrates returns, and owns final verification.
37
43
  - Subagents or bounded passes are readers and reporters unless a write set is
38
44
  explicitly assigned and disjoint.
39
- - Explicit WF/WK mode requires complete role-chain coverage from intake through
40
- final acceptance: plan, research/docs research as needed, architecture, test,
41
- implement, independent validation, cross-review, reflector, and accept.
45
+ - Explicit WF/WF-MAX requires tier-specific role coverage per `Harness/WF.md`.
42
46
  - Every dispatch needs role, goal, mode, read set, write set, forbidden scope,
43
47
  injected docs, dependencies, evidence, stop condition, and return format.
44
48
  - Prefer parallel read-only exploration first. Serialize writers unless write
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: wf
3
- description: Use for /wf in Claude Code, $wf or /skills wf in Codex, or any long, uncertain, multi-file, migration, recovery, or architecture-heavy task that should follow Harness WF mode.
3
+ description: Use for /wf in Claude Code, $wf or /skills wf in Codex. WF is explicit only the user must type /wf, $wf, or /skills wf to enter.
4
4
  ---
5
5
 
6
6
  # WF Mode Adapter
@@ -15,10 +15,16 @@ This skill is a thin tool adapter. The authoritative workflow lives in
15
15
  - Codex app may also list enabled skills in the `/` menu, depending on the
16
16
  current surface and feature state.
17
17
 
18
+ ## Memory Preflight
19
+
20
+ 1. Direct simple tasks and `/wf-help` are exempt.
21
+ 2. For non-direct work, load `CLAUDE.md`, `Harness/MEMORY.md` index only, then `Harness/README.md` before planning, dispatch, edits/deletes, validation, or peer review.
22
+ 3. Load `Harness/memory/*` only when `MEMORY_PROTOCOL.md` scenario hints match; otherwise record "memory hints: none".
23
+
18
24
  ## Load
19
25
 
20
26
  1. `CLAUDE.md`
21
- 2. `Harness/MEMORY.md`
27
+ 2. `Harness/MEMORY.md` (index only per Memory Preflight)
22
28
  3. `Harness/README.md`
23
29
  4. `Harness/PROGRESS.md`
24
30
  5. `Harness/WF.md`
@@ -27,14 +33,15 @@ This skill is a thin tool adapter. The authoritative workflow lives in
27
33
  ## Rules
28
34
 
29
35
  - Create or update a task capsule under `Harness/tasks/<task-id>/`.
36
+ - Select the right WF tier: WF-Light (low-risk, planner/test/verifier), WF-Standard (multi-file, compact ACs, one review lens), WF-Full (high-risk/cross-layer, full role chain).
30
37
  - Run the WF loop from `Harness/WF.md`: intake, bounded exploration, second
31
38
  plan, implementation, review, verification, recovery, and closeout.
32
- - For explicit WF invocation, schedule the complete role chain at intake:
39
+ - **Tier-aware acceptance**:
40
+ - **WF-Light**: planner + test-writer + implementer + verifier suffice. Verification passes = closeout. Cross-review and reflector are NOT mandatory unless risk triggers them.
41
+ - **WF-Standard**: one independent review lens required. Reflector may be triggered by risk.
42
+ - **WF-Full**: cross-review + reflector PASS required before final acceptance.
43
+ - WF-Full requires the complete role chain at intake:
33
44
  plan, research/docs research as needed, architecture, test, implement,
34
- independent validation, cross-review, reflector, and final acceptance. Use
35
- real subagents when the runtime supports them; otherwise record bounded-pass
36
- fallback coverage in the task plan.
37
- - Do not mark accepted until cross-review passes and the reflector returns
38
- PASS.
45
+ independent validation, cross-review, reflector, and final acceptance.
39
46
  - Keep `Harness/tasks/<task-id>/PROGRESS.md#Heartbeat` current before long
40
47
  commands, after failures, and at closeout.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: wf-auto
3
- description: Perpetual auto-optimization mode. Never stops until 8-angle exhaustion. Inherits WF acceptance gates and subagent orchestration per cycle. Use for Claude /wf-auto, Codex $wf-auto, auto mode, or unbounded self-directed optimization.
3
+ description: Perpetual adaptive auto-optimization mode. Selects probes from project evidence instead of a fixed angle count. Inherits WF acceptance gates and subagent orchestration per cycle. Use for Claude /wf-auto, Codex $wf-auto. Explicit only — the user must type /wf-auto, $wf-auto, or /skills wf-auto.
4
4
  ---
5
5
 
6
6
  # WF Auto - Perpetual Auto-Optimization
@@ -8,6 +8,7 @@ description: Perpetual auto-optimization mode. Never stops until 8-angle exhaust
8
8
  ## Load
9
9
 
10
10
  - `Harness/WF-AUTO.md`
11
+ - `Harness/WF-AUTO-ANGLES.md`
11
12
  - `Harness/subagents.md`
12
13
  - `Harness/dispatch.md`
13
14
  - `Harness/agent-workflow.md`
@@ -17,7 +18,8 @@ description: Perpetual auto-optimization mode. Never stops until 8-angle exhaust
17
18
 
18
19
  - Claude `/wf-auto`
19
20
  - Codex `$wf-auto`
20
- - `wf auto`, `auto mode`, or a request for continuous self-directed improvement
21
+
22
+ Do not use unless the user explicitly invokes `/wf-auto`, `$wf-auto`, or `/skills wf-auto`. The phrases "auto mode", "never stop", "self-improve", "continuous optimize", "unbounded self-directed optimization" are NOT triggers — only an explicit command token enters WF-AUTO.
21
23
 
22
24
  Do not use when the user gives a bounded task, requests maximum parallelism
23
25
  (`/wf-max`), needs an urgent production hotfix, or the codebase is tiny enough
@@ -25,12 +27,13 @@ that auto scanning costs more than it helps.
25
27
 
26
28
  ## Hard Rules
27
29
 
28
- 1. Never stop except the A-GATE: all 8 angles empty, oracle empty, spark empty,
29
- and 2 confirmation rounds.
30
+ 1. Never stop except the Adaptive Coverage A-GATE: dynamic high-risk
31
+ obligations are covered, two different confirmation strategies are empty,
32
+ and unresolved uncertainty is recorded.
30
33
  2. CEO never edits production source. CEO may write only
31
34
  `Harness/tasks/auto/PLAN.md` and `Harness/tasks/auto/PROGRESS.md`.
32
- 3. Dispatch all W0 sources in one batch when the runtime allows it: 8 angles,
33
- oracle, and spark searchers.
35
+ 3. Build a project profile each W0 cycle and dispatch only the selected probes;
36
+ invoke oracle and spark searchers when evidence justifies them.
34
37
  4. One accepted finding per cycle: <=3 files and <=50 changed lines. Larger
35
38
  ideas escalate to `/wf` or `/wf-max`, then return to auto.
36
39
  5. Every accepted cycle inherits the full WF chain:
@@ -45,7 +48,7 @@ that auto scanning costs more than it helps.
45
48
  ## Loop
46
49
 
47
50
  ```text
48
- W0: SENSE (8 angles + oracle + spark sources)
51
+ W0: SENSE (adaptive probes + oracle + spark sources as triggered)
49
52
  A-GATE: continue, oracle, spark, confirm, or stop
50
53
  W1: PRIORITIZE one finding
51
54
  W2-W5: Mini PRD -> AC -> test/validation plan -> implementer -> verifier -> cross-review -> reflector PASS
@@ -10,9 +10,13 @@ consolidates. Use the active runtime's available subagent mechanism when
10
10
  present, otherwise emulate the same roles as bounded passes and record that
11
11
  fallback.
12
12
 
13
+ **Note:** Explicit user preferences (remember/next time/never/always/记住/下次/不要再) can be written immediately via candidate detection without waiting for `/wf-learn`. `/wf-learn` is for proactive pattern consolidation and closeout extraction.
14
+
13
15
  ## Load
14
16
 
15
17
  - `Harness/MEMORY.md`
18
+ - `Harness/memory/routes.md`
19
+ - `Harness/memory/startup-hints.md`
16
20
  - `Harness/memory/tool-usage-reflections.md`
17
21
  - `Harness/memory/user-corrections-preferences.md`
18
22
  - `Harness/memory/agent-lessons-patterns.md`
@@ -22,8 +26,11 @@ fallback.
22
26
 
23
27
  1. Analyze the session for repeated failures, durable user corrections, and
24
28
  reusable review/debug lessons.
25
- 2. Deduplicate against existing memory.
26
- 3. Write only concise, durable, non-secret lessons to `Harness/memory/*`.
29
+ 2. Check `Harness/memory/routes.md` for existing entries before writing.
30
+ 3. Deduplicate against existing memory.
31
+ 4. Write only concise, durable, non-secret lessons to `Harness/memory/*`.
32
+ Use compact format (default no date):
33
+ `- When <scenario>: <rule>. Avoid <over-application>. Signals: <signals>.`
27
34
 
28
35
  ## Return
29
36
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: wf-max
3
- description: Use for /wf-max in Claude Code, $wf-max or /skills wf-max in Codex, or maximum-parallelism Harness work with WF strict-superset gates and CEO -> manager -> worker decomposition.
3
+ description: Use for /wf-max in Claude Code, $wf-max or /skills wf-max in Codex. WF-MAX is explicit only the user must type /wf-max, $wf-max, or /skills wf-max.
4
4
  ---
5
5
 
6
6
  # WF-MAX Adapter
@@ -13,10 +13,16 @@ routes and summarizes hard constraints.
13
13
  - Claude Code: `/wf-max [task]`
14
14
  - Codex: `$wf-max` or `/skills` then choose `wf-max`
15
15
 
16
+ ## Memory Preflight
17
+
18
+ 1. Direct simple tasks and `/wf-help` are exempt.
19
+ 2. For non-direct work, load `CLAUDE.md`, `Harness/MEMORY.md` index only, then `Harness/README.md` before planning, dispatch, edits/deletes, validation, or peer review.
20
+ 3. Load `Harness/memory/*` only when `MEMORY_PROTOCOL.md` scenario hints match; otherwise record "memory hints: none".
21
+
16
22
  ## Load
17
23
 
18
24
  1. `CLAUDE.md`
19
- 2. `Harness/MEMORY.md`
25
+ 2. `Harness/MEMORY.md` (index only per Memory Preflight)
20
26
  3. `Harness/README.md`
21
27
  4. `Harness/WF-MAX.md`
22
28
  5. `Harness/subagents.md`
@@ -25,20 +31,32 @@ routes and summarizes hard constraints.
25
31
 
26
32
  ## Rules
27
33
 
28
- WF-MAX is a WF strict superset: every WF role, gate, and acceptance rule still
29
- applies, then execution expands through:
34
+ WF-MAX inherits the selected WF tier and the shared WF-KERNEL gates
35
+ (`Harness/WF-KERNEL.md`), then expands safe parallelism. WF-Max-Useful is
36
+ default; WF-Max-Strict only on explicit strict request. Execution expands
37
+ through:
30
38
 
31
39
  1. Global mode: `wf-max`
32
40
  2. Agent role: `ceo | manager | worker | reviewer | verifier | reflector`
33
41
  3. Dispatch permission: `writeSet`, `forbidden`, `verification`
34
42
 
43
+ WF-Max-Useful (default): `/wf-max` fans out only where write sets or review
44
+ lenses are meaningfully independent. Overhead > 0.30 degrades the wave.
45
+
46
+ WF-Max-Strict (explicit override): user says `--strict`, `strict wf-max`, or
47
+ `strict mode`. Unconditional fan-out per the original span formula.
48
+
35
49
  - CEO reads, plans, dispatches, synthesizes, and writes task state only. CEO
36
50
  never edits production source.
37
51
  - Workers edit only the dispatch `writeSet`; outside write set is blocked.
38
52
  - Managers coordinate and synthesize. Reviewers read/report only.
39
53
  - D-GATE is mandatory before implementation waves: dispatch table, AC IDs,
40
54
  disjoint file claims, self-audit, and reviewer plan.
41
- - Final acceptance requires verifier evidence, cross-review, and reflector PASS.
55
+ - Final acceptance is tier-aware per `Harness/WF-KERNEL.md`:
56
+ - WF-Light + `/wf-max`: verification + state evidence suffices unless risk
57
+ triggers review/reflector.
58
+ - WF-Standard + `/wf-max`: verifier evidence + one independent review PASS.
59
+ - WF-Full or risk-triggered `/wf-max`: cross-review PASS + reflector PASS.
42
60
 
43
61
  ## Fan-Out Discipline
44
62
 
@@ -1,49 +1,49 @@
1
- ---
2
- name: wf-readme
3
- description: Use when a project README already exists and the user asks to preserve, merge, modernize, optimize, or clarify repository documentation during harness install or documentation work.
4
- ---
5
-
6
- # README Optimizer
7
-
8
- Improve `README.md` without breaking project-owned public docs.
9
-
10
- ## Load
11
-
12
- - root `README.md`
13
- - package files and scripts (`package.json`, `pyproject.toml`, `go.mod`, etc.)
14
- - CI files when present
15
- - `Harness/PROGRESS.md`
16
- - `Harness/tasks/<task-id>/PLAN.md` when available
17
- - `Harness/architecture.md` only when an architecture summary or diagram is requested
18
-
19
- ## Mode
20
-
21
- Ask the user which mode they approve when the existing README is meaningful:
22
-
23
- | Mode | Use when | Allowed edit |
24
- | --- | --- | --- |
25
- | Preserve + append | default for existing projects | Add only a compact Development, Test, Build, Git, or Harness section |
26
- | Structure pass | README is stale, hard to scan, or missing operational docs | Reorganize with headings, tables, command blocks, and links while preserving facts |
27
- | Full rewrite | user explicitly wants a polished public README | Rewrite after approval; keep claims source-backed |
28
-
29
- If unanswered, use Preserve + append.
30
-
31
- ## Rules
32
-
33
- - Preserve existing product, package, API, and public-facing content unless the user approves a rewrite.
34
- - Do not invent features, benchmarks, roadmap, support policy, badges, install commands, or CI status.
35
- - Use tables for command matrices, environment variables, endpoints, and deployment notes when facts are known.
36
- - Use Mermaid or ASCII architecture diagrams only when the structure is observed or approved; label uncertain diagrams as proposed.
37
- - Keep detailed architecture in `Harness/architecture.md`; README may link to it or show a short overview.
38
- - Keep agent rules in `CLAUDE.md`/`AGENTS.md`, not README.
39
- - Record the chosen mode and any skipped README improvements in `Harness/tasks/<task-id>/PLAN.md` when available.
40
-
41
- ## Output
42
-
43
- Before broad edits, return:
44
-
45
- 1. chosen mode
46
- 2. sections to preserve
47
- 3. sections to add or reorganize
48
- 4. facts still unknown
49
- 5. verification command or manual review step
1
+ ---
2
+ name: wf-readme
3
+ description: Use when a project README already exists and the user asks to preserve, merge, modernize, optimize, or clarify repository documentation during harness install or documentation work.
4
+ ---
5
+
6
+ # README Optimizer
7
+
8
+ Improve `README.md` without breaking project-owned public docs.
9
+
10
+ ## Load
11
+
12
+ - root `README.md`
13
+ - package files and scripts (`package.json`, `pyproject.toml`, `go.mod`, etc.)
14
+ - CI files when present
15
+ - `Harness/PROGRESS.md`
16
+ - `Harness/tasks/<task-id>/PLAN.md` when available
17
+ - `Harness/architecture.md` only when an architecture summary or diagram is requested
18
+
19
+ ## Mode
20
+
21
+ Ask the user which mode they approve when the existing README is meaningful:
22
+
23
+ | Mode | Use when | Allowed edit |
24
+ | --- | --- | --- |
25
+ | Preserve + append | default for existing projects | Add only a compact Development, Test, Build, Git, or Harness section |
26
+ | Structure pass | README is stale, hard to scan, or missing operational docs | Reorganize with headings, tables, command blocks, and links while preserving facts |
27
+ | Full rewrite | user explicitly wants a polished public README | Rewrite after approval; keep claims source-backed |
28
+
29
+ If unanswered, use Preserve + append.
30
+
31
+ ## Rules
32
+
33
+ - Preserve existing product, package, API, and public-facing content unless the user approves a rewrite.
34
+ - Do not invent features, benchmarks, roadmap, support policy, badges, install commands, or CI status.
35
+ - Use tables for command matrices, environment variables, endpoints, and deployment notes when facts are known.
36
+ - Use Mermaid or ASCII architecture diagrams only when the structure is observed or approved; label uncertain diagrams as proposed.
37
+ - Keep detailed architecture in `Harness/architecture.md`; README may link to it or show a short overview.
38
+ - Keep agent rules in `CLAUDE.md`/`AGENTS.md`, not README.
39
+ - Record the chosen mode and any skipped README improvements in `Harness/tasks/<task-id>/PLAN.md` when available.
40
+
41
+ ## Output
42
+
43
+ Before broad edits, return:
44
+
45
+ 1. chosen mode
46
+ 2. sections to preserve
47
+ 3. sections to add or reorganize
48
+ 4. facts still unknown
49
+ 5. verification command or manual review step
@@ -1,10 +1,10 @@
1
- ---
2
- name: wf-remove
3
- description: Use for /wf-remove in Claude Code, $wf-remove or /skills wf-remove in Codex, or any request to uninstall Harness safely.
4
- ---
5
-
6
- # WF Remove Adapter
7
-
1
+ ---
2
+ name: wf-remove
3
+ description: Use for /wf-remove in Claude Code, $wf-remove or /skills wf-remove in Codex, or any request to uninstall Harness safely.
4
+ ---
5
+
6
+ # WF Remove Adapter
7
+
8
8
  ## Invocation
9
9
 
10
10
  - Claude Code: use `/wf-remove` or select the `wf-remove` skill.
@@ -1,14 +1,17 @@
1
1
  ---
2
2
  name: wf-update
3
- description: Use for /wf-update in Claude Code, $wf-update or /skills wf-update in Codex, or any request to check for or apply Harness scaffold updates.
3
+ description: Codex compatibility: use $wf-update or /skills wf-update in Codex. In Claude Code and OpenCode, /wf-update is a direct command (see .claude/commands/wf-update.md and .opencode/commands/wf-update.md).
4
4
  ---
5
5
 
6
6
  # WF Update Adapter
7
7
 
8
+ This skill is a Codex compatibility shim plus script-flow reference. Claude Code and OpenCode handle `/wf-update` as a direct command; do not route them through this skill.
9
+
8
10
  ## Invocation
9
11
 
10
- - Claude Code: use `/wf-update` or select the `wf-update` skill.
11
12
  - Codex CLI or IDE: use `$wf-update` or `/skills` then choose `wf-update`.
13
+ - Claude Code: `/wf-update` is a direct command. Use `.claude/commands/wf-update.md`, not this skill.
14
+ - OpenCode: `/wf-update` is a direct command. Use `.opencode/commands/wf-update.md`, not this skill.
12
15
 
13
16
  ## Load
14
17
 
@@ -37,6 +40,16 @@ description: Use for /wf-update in Claude Code, $wf-update or /skills wf-update
37
40
  JSON plan has zero conflicts.
38
41
  6. After update, run the validator and then scan-clean.
39
42
 
43
+ ## Recovery
44
+
45
+ If `Harness/scripts/wf-update-check.mjs` is missing (old install without updater), or `Harness/.harness-version` is missing or corrupted, do NOT reinstall from scratch. Recover by regenerating missing infrastructure:
46
+
47
+ ```
48
+ npx create-harness-vibe-coding@latest <project-name> . -y --on-conflict skip
49
+ ```
50
+
51
+ The `--on-conflict skip` policy preserves all existing user files (CLAUDE.md, README.md, tasks, memory, research, architecture) and only creates missing Harness infrastructure files. After recovery, re-run the update check.
52
+
40
53
  ## Return
41
54
 
42
55
  Report version, SAFE/NEW updates, conflicts and decisions, preserved files,
@@ -0,0 +1,17 @@
1
+ {
2
+ "hooks": {
3
+ "UserPromptSubmit": [
4
+ {
5
+ "hooks": [
6
+ {
7
+ "type": "command",
8
+ "command": "node \"$(git rev-parse --show-toplevel)/Harness/scripts/wf-auto-update-prompt.mjs\" --format codex",
9
+ "commandWindows": "powershell -NoProfile -ExecutionPolicy Bypass -Command \"$root=(git rev-parse --show-toplevel 2>$null); if (-not $root) { $root=(Get-Location).Path }; node (Join-Path $root 'Harness/scripts/wf-auto-update-prompt.mjs') --format codex\"",
10
+ "statusMessage": "Checking Harness updates",
11
+ "timeout": 35
12
+ }
13
+ ]
14
+ }
15
+ ]
16
+ }
17
+ }