create-harness-vibe-coding 0.8.8 → 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 (80) hide show
  1. package/README-CN.md +7 -1
  2. package/README.md +21 -2
  3. package/docs/images/harness-icon.png +0 -0
  4. package/package.json +2 -1
  5. package/src/generator.js +36 -0
  6. package/src/index.js +72 -4
  7. package/templates/common/.claude/agents/architect.md +31 -31
  8. package/templates/common/.claude/agents/codebase-explorer.md +45 -0
  9. package/templates/common/.claude/agents/docs-researcher.md +41 -41
  10. package/templates/common/.claude/agents/memory-master.md +26 -8
  11. package/templates/common/.claude/agents/reviewer.md +34 -34
  12. package/templates/common/.claude/agents/task-scribe.md +70 -0
  13. package/templates/common/.claude/commands/wf-help.md +8 -4
  14. package/templates/common/.claude/commands/wf-update.md +24 -0
  15. package/templates/common/.claude/rules/ecc/common.md +15 -2
  16. package/templates/common/.claude/settings.json +13 -0
  17. package/templates/common/.claude/skills/subagent-orchestrator/SKILL.md +8 -4
  18. package/templates/common/.claude/skills/wf/SKILL.md +15 -8
  19. package/templates/common/.claude/skills/wf-auto/SKILL.md +3 -2
  20. package/templates/common/.claude/skills/wf-learn/SKILL.md +9 -2
  21. package/templates/common/.claude/skills/wf-max/SKILL.md +23 -5
  22. package/templates/common/.claude/skills/wf-update/SKILL.md +15 -2
  23. package/templates/common/.codex/hooks.json +17 -0
  24. package/templates/common/.harness-version +89 -44
  25. package/templates/common/.opencode/agents/architect.md +24 -24
  26. package/templates/common/.opencode/agents/codebase-explorer.md +45 -0
  27. package/templates/common/.opencode/agents/docs-researcher.md +34 -34
  28. package/templates/common/.opencode/agents/memory-master.md +26 -8
  29. package/templates/common/.opencode/agents/reviewer.md +27 -27
  30. package/templates/common/.opencode/agents/task-scribe.md +70 -0
  31. package/templates/common/.opencode/commands/wf-auto-spark.md +15 -0
  32. package/templates/common/.opencode/commands/wf-auto.md +15 -0
  33. package/templates/common/.opencode/commands/wf-help.md +8 -4
  34. package/templates/common/.opencode/commands/wf-learn.md +15 -0
  35. package/templates/common/.opencode/commands/wf-max.md +15 -0
  36. package/templates/common/.opencode/commands/wf-readme.md +15 -0
  37. package/templates/common/.opencode/commands/wf-remove.md +15 -0
  38. package/templates/common/.opencode/commands/wf-review.md +15 -0
  39. package/templates/common/.opencode/commands/wf-update.md +24 -0
  40. package/templates/common/.opencode/commands/wf.md +15 -0
  41. package/templates/common/.opencode/plugins/harness-wf-status.mjs +135 -0
  42. package/templates/common/AGENTS.md +2 -29
  43. package/templates/common/CLAUDE.md +35 -6
  44. package/templates/common/Harness/ACCEPTANCE_PROTOCOL.md +2 -2
  45. package/templates/common/{MEMORY.md → Harness/MEMORY.md} +16 -3
  46. package/templates/common/Harness/MEMORY_PROTOCOL.md +80 -30
  47. package/templates/common/Harness/README.md +50 -22
  48. package/templates/common/{SETUP.md → Harness/SETUP.md} +278 -276
  49. package/templates/common/Harness/TASK_ARCHIVE.md +56 -0
  50. package/templates/common/Harness/WF-AUTO-SPARK.md +5 -14
  51. package/templates/common/Harness/WF-AUTO.md +13 -76
  52. package/templates/common/Harness/WF-KERNEL.md +189 -0
  53. package/templates/common/Harness/WF-MAX.md +60 -328
  54. package/templates/common/Harness/WF-STATE.md +83 -0
  55. package/templates/common/Harness/WF.md +117 -237
  56. package/templates/common/Harness/agent-workflow.md +2 -2
  57. package/templates/common/Harness/context-loading.md +3 -3
  58. package/templates/common/Harness/dispatch.md +43 -35
  59. package/templates/common/Harness/scripts/archive-tasks.mjs +239 -0
  60. package/templates/common/{scripts → Harness/scripts}/scan-clean.mjs +28 -1
  61. package/templates/common/{scripts → Harness/scripts}/validate-harness.mjs +909 -699
  62. package/templates/common/Harness/scripts/wf-auto-update-prompt.mjs +258 -0
  63. package/templates/common/{scripts → Harness/scripts}/wf-update-check.mjs +40 -7
  64. package/templates/common/Harness/subagents.md +28 -27
  65. package/templates/common/Harness/tasks/_template/PLAN.md +5 -0
  66. package/templates/common/Harness/tasks/_template/STATE.json +23 -0
  67. package/templates/common/README.md +1 -1
  68. package/templates/common/memory/agent-lessons-patterns.md +9 -8
  69. package/templates/common/memory/routes.md +43 -0
  70. package/templates/common/memory/startup-hints.md +32 -0
  71. package/templates/common/memory/tool-usage-reflections.md +9 -8
  72. package/templates/common/memory/user-corrections-preferences.md +11 -9
  73. package/templates/optional/catalog.json +8 -0
  74. package/templates/optional/skills/browser-e2e/.claude/skills/browser-e2e/SKILL.md +42 -42
  75. package/templates/optional/skills/browser-e2e/.opencode/commands/wf-browser.md +15 -0
  76. package/templates/optional/skills/github-pr-review/.claude/skills/github-pr-review/SKILL.md +40 -40
  77. package/templates/optional/skills/python-backend/.claude/skills/python-backend/SKILL.md +40 -40
  78. package/templates/optional/skills/ts-react-frontend/.claude/skills/ts-react-frontend/SKILL.md +43 -43
  79. package/templates/optional/skills/ui-ux-review/.claude/skills/ui-ux-review/SKILL.md +40 -40
  80. /package/templates/common/{scripts → Harness/scripts}/wf-remove.mjs +0 -0
@@ -0,0 +1,70 @@
1
+ ---
2
+ name: task-scribe
3
+ description: Use to maintain Harness task state, heartbeat, dispatch ledger, evidence pointers, and compact PLAN/PROGRESS updates. Small-fast chore agent. Never edits source code.
4
+ tools: Read, Grep, Glob, Write, Edit
5
+ model: haiku
6
+ ---
7
+
8
+ # Task Scribe
9
+
10
+ You are a task-state maintenance agent for this project harness. You own durable task tracking. You never make product, architecture, or scope decisions.
11
+
12
+ ## Load First
13
+
14
+ - `Harness/tasks/<task-id>/STATE.json` (when active)
15
+ - `Harness/tasks/<task-id>/PLAN.md` (when active)
16
+ - `Harness/tasks/<task-id>/PROGRESS.md` (when active)
17
+ - `Harness/PROGRESS.md` (when syncing global task index)
18
+ - `Harness/tasks/<task-id>/ARTIFACTS.md` (when tracking evidence)
19
+ - `Harness/tasks/<task-id>/NOTES.md` (when recording structured notes)
20
+
21
+ ## Write Scope
22
+
23
+ Allowed writes ONLY:
24
+ - `Harness/PROGRESS.md` — update Active Task, Task Index rows
25
+ - `Harness/tasks/<task-id>/STATE.json` — update per controller structured update (phase, gate, queues, dispatchLedger, nextAction, acceptance, decisions, risks, artifacts)
26
+ - `Harness/tasks/<task-id>/PLAN.md` — update Goal, Decisions, Scope, Context, Memory Preflight, Agents, Verification, Risks sections (controller-supplied structured updates only)
27
+ - `Harness/tasks/<task-id>/PROGRESS.md` — update Status, Heartbeat, Tasks, Changes, Verification, Notes sections
28
+ - `Harness/tasks/<task-id>/ARTIFACTS.md` — record evidence pointers
29
+ - `Harness/tasks/<task-id>/NOTES.md` — record structured notes
30
+
31
+ Forbidden:
32
+ - Source code (any file outside the Harness/tasks/ capsule and Harness/PROGRESS.md)
33
+ - Product/architecture decisions
34
+ - AC or scope changes (unless controller provides exact structured update)
35
+ - Memory files (Harness/memory/*) — delegated to memory-master
36
+ - MEMORY.md index — delegated to memory-master
37
+
38
+ ## Compact Heartbeat
39
+
40
+ Maintain `PROGRESS.md#Heartbeat` with:
41
+ - Phase and active wave
42
+ - Blocker (if any)
43
+ - Next action
44
+ - Evidence path (file pointer, not full evidence content)
45
+ - Dispatch ledger summary: agent, role, model tier, status, evidence pointer
46
+
47
+ ## Dispatch Ledger
48
+
49
+ Track subagent dispatch in `PROGRESS.md` or `PLAN.md#Agents`:
50
+ - agent name, role, model tier, readSet, writeSet, status, evidence path
51
+ - Keep rows compact — one line per dispatch
52
+
53
+ ## Return Format
54
+
55
+ Return <= 200 tokens:
56
+ ```
57
+ Files written: [paths]
58
+ Updated sections: [list]
59
+ Next action: [one line]
60
+ Blocked: [true/false — if true, what is missing]
61
+ ```
62
+
63
+ ## Rules
64
+
65
+ - Never guess missing information. If controller-supplied data is incomplete, return BLOCKED with what is needed.
66
+ - If STATE.json, PLAN.md, and PROGRESS.md conflict (different phase, different gate status), return BLOCKED with the specific conflict. Do not resolve contradictions.
67
+ - Keep every entry compact — one or two lines per section update.
68
+ - Do not duplicate. If a section already has the exact information, skip it.
69
+ - Do not reorder existing entries without controller instruction.
70
+ - Do not delete entries unless controller explicitly says "delete".
@@ -6,15 +6,19 @@ do not dispatch agents, and do not edit files.
6
6
  | Command | Type | Usage | Purpose |
7
7
  | --- | --- | --- | --- |
8
8
  | `/wf-help` | direct command | `/wf-help` | Show this command table. |
9
- | `/wf <task>` | workflow skill | `/wf fix failing login flow` | Standard acceptance-driven workflow for long, uncertain, multi-file, browser/API, or recovery work. |
10
- | `/wf-max <task>` | workflow skill | `/wf-max refactor auth module` | WF strict superset: complete role chain plus maximum fan-out, CEO -> Manager -> Worker dispatch, cross-CLI overflow when the current runtime agent pool is exhausted. |
9
+ | `/wf <task>` | workflow skill | `/wf fix failing login flow` | Tiered WF: WF-Light (low-risk, planner/test/verifier), WF-Standard (multi-file, compact ACs), WF-Full (high-risk/cross-layer, full role chain). |
10
+ | `/wf-max <task>` | workflow skill | `/wf-max refactor auth module` | WF-Max-Useful default (fan-out only where independent), WF-Max-Strict override (unconditional fan-out). |
11
11
  | `/wf-auto` | workflow skill | `/wf-auto` | Perpetual adaptive auto-optimization using project evidence, dynamic probes, risk obligations, evidence ledger, and confirmation-based exhaustion. |
12
12
  | `/wf-auto-spark` | workflow skill | `/wf-auto-spark` | Perpetual inspiration mode with roadmap anchoring and external spark search. |
13
13
  | `/wf-review <focus>` | workflow skill | `/wf-review security and test coverage` | Cross-model peer review through the other CLI; use for second opinions and risk checks. |
14
14
  | `/wf-learn` | workflow skill | `/wf-learn` | Force context-master -> memory-master learning cycle after repeated failures or closeout. |
15
15
  | `/wf-readme <task>` | workflow skill | `/wf-readme polish quickstart` | Preserve, merge, or improve README docs without trampling existing project documentation. |
16
- | `/wf-update` | workflow skill | `/wf-update` | Check/apply Harness scaffold updates with safe file classification and conflict handling. |
16
+ | `/wf-update` | direct command | `/wf-update` | Check/apply Harness scaffold updates with safe file classification and conflict handling. |
17
17
  | `/wf-remove` | workflow skill | `/wf-remove` | Safely remove Harness files while preserving project/user data unless explicitly purged. |
18
18
 
19
19
  Source of truth: `Harness/README.md#Skill Commands` plus installed skills under
20
- `.claude/skills/`.
20
+ `.claude/skills/` (Claude Code) or `.agents/skills/` (Codex). In OpenCode the
21
+ same skills load from `.claude/skills/`, `.agents/skills/`, and `.opencode/skills/`.
22
+ In OpenCode, every workflow command above is also visible as a thin command
23
+ wrapper under `.opencode/commands/` (e.g. `/wf`, `/wf-max`); each wrapper only
24
+ routes to the matching skill adapter and does not duplicate the workflow.
@@ -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.
@@ -7,7 +7,9 @@ alwaysApply: true
7
7
 
8
8
  ## Context
9
9
 
10
- - Start with `CLAUDE.md`, `Harness/MEMORY.md`, and `Harness/README.md`.
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.
11
13
  - Do not bulk-read `Harness/`. Load by router trigger.
12
14
  - Keep `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md` current when work has multiple steps, files, or agents.
13
15
  - project files are the only durable communication channel. chat/subagent transcript state is non-authoritative.
@@ -20,6 +22,13 @@ alwaysApply: true
20
22
  - Bug fix: reproduction first.
21
23
  - Before release, add CI for the chosen stack and run the full verification path.
22
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
+
23
32
  ## Subagents
24
33
 
25
34
  - Use `Harness/subagents.md` before orchestrating multiple agents.
@@ -33,10 +42,14 @@ alwaysApply: true
33
42
 
34
43
  ## Memory
35
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.
36
48
  - Record a lightweight reflection in `Harness/memory/tool-usage-reflections.md` when the same tool/use pattern fails 3+ times.
37
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.
38
50
  - Record reusable review/debug lessons in `Harness/memory/agent-lessons-patterns.md`.
39
- - Keep memory entries concise and never include secrets.
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.
40
53
 
41
54
  ## Security
42
55
 
@@ -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 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, 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
@@ -18,7 +18,8 @@ description: Perpetual adaptive auto-optimization mode. Selects probes from proj
18
18
 
19
19
  - Claude `/wf-auto`
20
20
  - Codex `$wf-auto`
21
- - `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.
22
23
 
23
24
  Do not use when the user gives a bounded task, requests maximum parallelism
24
25
  (`/wf-max`), needs an urgent production hotfix, or the codebase is tiny enough
@@ -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,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
+ }