create-harness-vibe-coding 0.8.13 → 0.8.17

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 (133) hide show
  1. package/CHANGELOG.md +174 -0
  2. package/README-CN.md +110 -107
  3. package/README.md +93 -44
  4. package/package.json +2 -1
  5. package/src/generator.js +609 -489
  6. package/src/index.js +5 -5
  7. package/templates/common/.claude/agents/architect-manager.md +1 -0
  8. package/templates/common/.claude/agents/architect.md +2 -1
  9. package/templates/common/.claude/agents/codebase-explorer.md +1 -0
  10. package/templates/common/.claude/agents/context-master.md +2 -1
  11. package/templates/common/.claude/agents/debugger.md +1 -0
  12. package/templates/common/.claude/agents/docs-researcher.md +2 -1
  13. package/templates/common/.claude/agents/explore-manager.md +1 -0
  14. package/templates/common/.claude/agents/implement-manager.md +1 -0
  15. package/templates/common/.claude/agents/implementer.md +1 -0
  16. package/templates/common/.claude/agents/memory-master.md +2 -1
  17. package/templates/common/.claude/agents/planner.md +3 -2
  18. package/templates/common/.claude/agents/reflector.md +1 -0
  19. package/templates/common/.claude/agents/researcher.md +1 -0
  20. package/templates/common/.claude/agents/review-manager.md +1 -0
  21. package/templates/common/.claude/agents/reviewer.md +2 -1
  22. package/templates/common/.claude/agents/task-scribe.md +1 -0
  23. package/templates/common/.claude/agents/tdd-guide.md +5 -4
  24. package/templates/common/.claude/agents/test-writer.md +6 -5
  25. package/templates/common/.claude/agents/verifier.md +1 -0
  26. package/templates/common/.claude/commands/wf-auto-spark.md +16 -0
  27. package/templates/common/.claude/commands/wf-auto.md +16 -0
  28. package/templates/{optional/skills/browser-e2e/.opencode → common/.claude}/commands/wf-browser.md +3 -2
  29. package/templates/common/.claude/commands/wf-help.md +9 -5
  30. package/templates/common/.claude/commands/wf-learn.md +16 -0
  31. package/templates/common/.claude/commands/wf-max.md +20 -0
  32. package/templates/common/.claude/commands/wf-readme.md +16 -0
  33. package/templates/common/.claude/commands/wf-remove.md +16 -0
  34. package/templates/common/.claude/commands/wf-review.md +16 -0
  35. package/templates/common/.claude/commands/wf-update.md +68 -10
  36. package/templates/common/.claude/commands/wf.md +16 -0
  37. package/templates/common/.claude/rules/ecc/common.md +6 -5
  38. package/templates/common/.claude/skills/subagent-orchestrator/SKILL.md +12 -6
  39. package/templates/common/.claude/skills/tdd/SKILL.md +5 -5
  40. package/templates/common/.claude/skills/wf/SKILL.md +13 -5
  41. package/templates/common/.claude/skills/wf-agents-docs/SKILL.md +119 -0
  42. package/templates/common/.claude/skills/wf-auto/SKILL.md +27 -7
  43. package/templates/common/.claude/skills/wf-auto-spark/SKILL.md +12 -5
  44. package/templates/common/.claude/skills/wf-browser/SKILL.md +176 -0
  45. package/templates/common/.claude/skills/wf-help/SKILL.md +30 -0
  46. package/templates/common/.claude/skills/wf-learn/SKILL.md +6 -0
  47. package/templates/common/.claude/skills/wf-max/SKILL.md +43 -14
  48. package/templates/common/.claude/skills/wf-readme/SKILL.md +8 -2
  49. package/templates/common/.claude/skills/wf-remove/SKILL.md +6 -0
  50. package/templates/common/.claude/skills/wf-review/SKILL.md +10 -3
  51. package/templates/common/.claude/skills/wf-update/SKILL.md +41 -4
  52. package/templates/common/.codex/config.toml +3 -5
  53. package/templates/common/.harness-version +326 -131
  54. package/templates/common/.opencode/agents/architect-manager.md +8 -1
  55. package/templates/common/.opencode/agents/architect.md +2 -1
  56. package/templates/common/.opencode/agents/codebase-explorer.md +1 -0
  57. package/templates/common/.opencode/agents/context-master.md +2 -1
  58. package/templates/common/.opencode/agents/debugger.md +1 -0
  59. package/templates/common/.opencode/agents/docs-researcher.md +2 -1
  60. package/templates/common/.opencode/agents/explore-manager.md +11 -1
  61. package/templates/common/.opencode/agents/implement-manager.md +6 -3
  62. package/templates/common/.opencode/agents/implementer.md +1 -0
  63. package/templates/common/.opencode/agents/memory-master.md +2 -1
  64. package/templates/common/.opencode/agents/planner.md +3 -2
  65. package/templates/common/.opencode/agents/reflector.md +1 -0
  66. package/templates/common/.opencode/agents/researcher.md +1 -0
  67. package/templates/common/.opencode/agents/review-manager.md +6 -2
  68. package/templates/common/.opencode/agents/reviewer.md +2 -1
  69. package/templates/common/.opencode/agents/task-scribe.md +1 -0
  70. package/templates/common/.opencode/agents/tdd-guide.md +5 -4
  71. package/templates/common/.opencode/agents/test-writer.md +6 -5
  72. package/templates/common/.opencode/agents/verifier.md +1 -0
  73. package/templates/common/.opencode/commands/wf-auto-spark.md +3 -2
  74. package/templates/common/.opencode/commands/wf-auto.md +3 -2
  75. package/templates/common/.opencode/commands/wf-browser.md +16 -0
  76. package/templates/common/.opencode/commands/wf-help.md +9 -5
  77. package/templates/common/.opencode/commands/wf-learn.md +3 -2
  78. package/templates/common/.opencode/commands/wf-max.md +12 -6
  79. package/templates/common/.opencode/commands/wf-readme.md +3 -2
  80. package/templates/common/.opencode/commands/wf-remove.md +3 -2
  81. package/templates/common/.opencode/commands/wf-review.md +3 -2
  82. package/templates/common/.opencode/commands/wf-update.md +68 -10
  83. package/templates/common/.opencode/commands/wf.md +3 -2
  84. package/templates/common/CLAUDE.md +15 -13
  85. package/templates/common/Harness/MEMORY.md +24 -21
  86. package/templates/common/Harness/README.md +50 -47
  87. package/templates/common/Harness/ownership.manifest.json +878 -0
  88. package/templates/common/Harness/{architecture.md → project/architecture.md} +1 -1
  89. package/templates/common/Harness/research/README.md +3 -3
  90. package/templates/common/Harness/scripts/archive-tasks.mjs +12 -220
  91. package/templates/common/Harness/scripts/context-budget.mjs +95 -0
  92. package/templates/common/Harness/scripts/l2-cache-telemetry.mjs +703 -0
  93. package/templates/common/Harness/scripts/scan-clean.mjs +16 -12
  94. package/templates/common/Harness/scripts/task-state.mjs +889 -0
  95. package/templates/common/Harness/scripts/validate-harness.mjs +553 -191
  96. package/templates/common/Harness/scripts/wf-remove.mjs +61 -35
  97. package/templates/common/Harness/scripts/wf-update-check.mjs +358 -45
  98. package/templates/common/Harness/settings.json +43 -0
  99. package/templates/common/Harness/{ECC-GUIDE.md → specs/guides/ECC-GUIDE.md} +4 -4
  100. package/templates/common/Harness/{SETUP.md → specs/guides/SETUP.md} +34 -37
  101. package/templates/common/Harness/{extension.md → specs/guides/extension.md} +3 -3
  102. package/templates/common/Harness/{lifecycle.md → specs/guides/lifecycle.md} +2 -2
  103. package/templates/common/Harness/specs/protocols/TASK_ARCHIVE.md +76 -0
  104. package/templates/common/Harness/{agent-workflow.md → specs/runtime/agent-workflow.md} +6 -6
  105. package/templates/common/Harness/{context-loading.md → specs/runtime/context-loading.md} +85 -21
  106. package/templates/common/Harness/{dispatch.md → specs/runtime/dispatch.md} +4 -3
  107. package/templates/common/Harness/{subagents.md → specs/runtime/subagents.md} +19 -10
  108. package/templates/common/Harness/{WF-AUTO-SPARK.md → specs/workflows/WF-AUTO-SPARK.md} +2 -2
  109. package/templates/common/Harness/{WF-AUTO.md → specs/workflows/WF-AUTO.md} +12 -7
  110. package/templates/common/Harness/{WF-KERNEL.md → specs/workflows/WF-KERNEL.md} +11 -1
  111. package/templates/common/Harness/{WF-MAX.md → specs/workflows/WF-MAX.md} +40 -7
  112. package/templates/common/Harness/specs/workflows/WF-STATE.md +141 -0
  113. package/templates/common/Harness/{WF.md → specs/workflows/WF.md} +12 -1
  114. package/templates/common/README.md +8 -6
  115. package/templates/common/memory/startup-hints.md +19 -17
  116. package/templates/common/opencode.json +1 -0
  117. package/templates/optional/catalog.json +2 -9
  118. package/templates/optional/skills/github-pr-review/.claude/skills/github-pr-review/SKILL.md +1 -1
  119. package/templates/optional/skills/python-backend/.claude/skills/python-backend/SKILL.md +1 -1
  120. package/templates/optional/skills/ts-react-frontend/.claude/skills/ts-react-frontend/SKILL.md +1 -1
  121. package/templates/optional/skills/ui-ux-review/.claude/skills/ui-ux-review/SKILL.md +1 -1
  122. package/templates/common/Harness/TASK_ARCHIVE.md +0 -56
  123. package/templates/common/Harness/WF-STATE.md +0 -83
  124. package/templates/optional/skills/browser-e2e/.claude/skills/browser-e2e/SKILL.md +0 -42
  125. package/templates/optional/skills/browser-e2e/.claude/skills/wf-browser/SKILL.md +0 -194
  126. package/templates/optional/skills/browser-e2e/Harness/workflows/browser-e2e.md +0 -119
  127. /package/templates/common/Harness/{ACCEPTANCE_PROTOCOL.md → specs/protocols/ACCEPTANCE_PROTOCOL.md} +0 -0
  128. /package/templates/common/Harness/{AGENT_ISOLATION.md → specs/protocols/AGENT_ISOLATION.md} +0 -0
  129. /package/templates/common/Harness/{DEBUG_PROTOCOL.md → specs/protocols/DEBUG_PROTOCOL.md} +0 -0
  130. /package/templates/common/Harness/{HARNESS_BRIDGE.md → specs/protocols/HARNESS_BRIDGE.md} +0 -0
  131. /package/templates/common/Harness/{MEMORY_PROTOCOL.md → specs/protocols/MEMORY_PROTOCOL.md} +0 -0
  132. /package/templates/common/Harness/{TDD-GUIDE.md → specs/protocols/TDD-GUIDE.md} +0 -0
  133. /package/templates/common/Harness/{WF-AUTO-ANGLES.md → specs/workflows/WF-AUTO-ANGLES.md} +0 -0
@@ -5,7 +5,7 @@ description: Test-driven development. Use when the user wants to build features
5
5
 
6
6
  # TDD Adapter
7
7
 
8
- Thin tool adapter. Authoritative guide: `Harness/TDD-GUIDE.md`.
8
+ Thin tool adapter. Authoritative guide: `Harness/specs/protocols/TDD-GUIDE.md`.
9
9
 
10
10
  ## Invocation
11
11
 
@@ -14,10 +14,10 @@ Thin tool adapter. Authoritative guide: `Harness/TDD-GUIDE.md`.
14
14
 
15
15
  ## Load
16
16
 
17
- 1. `Harness/ACCEPTANCE_PROTOCOL.md`
18
- 2. `Harness/HARNESS_BRIDGE.md`
19
- 3. `Harness/AGENT_ISOLATION.md`
20
- 4. `Harness/TDD-GUIDE.md`
17
+ 1. `Harness/specs/protocols/ACCEPTANCE_PROTOCOL.md`
18
+ 2. `Harness/specs/protocols/HARNESS_BRIDGE.md`
19
+ 3. `Harness/specs/protocols/AGENT_ISOLATION.md`
20
+ 4. `Harness/specs/protocols/TDD-GUIDE.md`
21
21
  5. ECC stack-specific testing rules (for example `typescript/testing.md`, `python/testing.md`)
22
22
  6. Current task `PLAN.md`
23
23
 
@@ -6,7 +6,7 @@ description: Use for /wf in Claude Code, $wf or /skills wf in Codex. WF is expli
6
6
  # WF Mode Adapter
7
7
 
8
8
  This skill is a thin tool adapter. The authoritative workflow lives in
9
- `Harness/WF.md`; do not duplicate or override it here.
9
+ `Harness/specs/workflows/WF.md`; do not duplicate or override it here.
10
10
 
11
11
  ## Invocation
12
12
 
@@ -27,14 +27,22 @@ This skill is a thin tool adapter. The authoritative workflow lives in
27
27
  2. `Harness/MEMORY.md` (index only per Memory Preflight)
28
28
  3. `Harness/README.md`
29
29
  4. `Harness/PROGRESS.md`
30
- 5. `Harness/WF.md`
31
- 6. `Harness/subagents.md` before any role split
30
+ 5. `Harness/specs/workflows/WF.md`
31
+ 6. `Harness/specs/runtime/subagents.md` before any role split
32
+
33
+ ## Cache Discipline
34
+
35
+ Follow `Harness/specs/runtime/context-loading.md#Cache-First Context Contract`: keep the
36
+ listed loads in order, load only routed skills/tools, append task state and
37
+ latest tool output after stable docs, and return compact evidence instead of
38
+ logs or transcripts.
32
39
 
33
40
  ## Rules
34
41
 
35
- - Create or update a task capsule under `Harness/tasks/<task-id>/`.
42
+ - Create or update a task capsule under `Harness/tasks/<task-id>/`; new task
43
+ ids MUST match `task-<verb>-<noun>[-detail]`.
36
44
  - 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).
37
- - Run the WF loop from `Harness/WF.md`: intake, bounded exploration, second
45
+ - Run the WF loop from `Harness/specs/workflows/WF.md`: intake, bounded exploration, second
38
46
  plan, implementation, review, verification, recovery, and closeout.
39
47
  - **Tier-aware acceptance**:
40
48
  - **WF-Light**: planner + test-writer + implementer + verifier suffice. Verification passes = closeout. Cross-review and reflector are NOT mandatory unless risk triggers them.
@@ -0,0 +1,119 @@
1
+ ---
2
+ name: wf-agents-docs
3
+ description: Source-backed CLI invocation guide for Claude Code, Codex, and OpenCode automation. Use when invoking peer CLIs, writing batch tests, collecting cache telemetry, debugging command-line flags, or documenting cross-runtime agent usage for Harness workflows.
4
+ ---
5
+
6
+ # WF Agents Docs
7
+
8
+ Use this skill before shelling out to `claude`, `codex`, or `opencode` from Harness workflows, peer review, cache tests, or automation scripts.
9
+
10
+ ## Source Order
11
+
12
+ 1. Prefer installed help: `claude --help`, `codex exec --help`, `opencode run --help`.
13
+ 2. Check official docs for flags that affect cost, auth, JSON, resume, tools/MCP, or telemetry.
14
+ 3. When adding automation, record command, source, stdout/stderr shape, and failed patterns.
15
+
16
+ ## Claude Code CLI
17
+
18
+ - Interactive: `claude`.
19
+ - Non-interactive JSON: pipe ASCII or UTF-8-safe stdin into `claude -p --output-format json`.
20
+ - Stream JSON requires verbose mode: `claude -p --output-format stream-json --verbose`.
21
+ - Continue/resume: `claude -c -p "..."` or `claude -p --resume <session-id> "..."`; for PowerShell automation, prefer stdin and validate non-empty JSON before parsing.
22
+ - Use `--max-budget-usd <amount>` in scripted probes.
23
+ - Use `--strict-mcp-config` without `--mcp-config` to ignore configured MCP servers for a run. Use `--safe-mode` only to disable project customizations. Use `--bare` only for minimal CLI probes, not for Harness/cache attribution, because it skips `CLAUDE.md`, skills, plugins, MCP, hooks, and auto memory.
24
+ - Use `--tools "Read,Grep,Glob"` or explicit `--allowedTools`/`--disallowedTools` for read-only probes.
25
+ - Prompt-cache telemetry appears in JSON `usage.cache_read_input_tokens` / `usage.cache_creation_input_tokens`, and in statusline `context_window.current_usage.*`.
26
+
27
+ ## Codex CLI
28
+
29
+ - Interactive: `codex`.
30
+ - Non-interactive: `codex exec "task"`.
31
+ - Read stdin as the full prompt: `cat prompt.txt | codex exec -`.
32
+ - Prompt plus stdin context: `some-command | codex exec "summarize this output"`.
33
+ - Machine output: `codex exec --json "task"` emits JSONL events; parse `turn.completed.usage`, including `cached_input_tokens` when present.
34
+ - Resume: `codex exec resume --last "..."` or `codex exec resume <SESSION_ID> "..."`.
35
+ - Permissions: default is read-only; set `--sandbox workspace-write` only when edits are required. Use `--ignore-user-config` / `--ignore-rules` for controlled automation.
36
+
37
+ ## OpenCode CLI
38
+
39
+ - Interactive: `opencode`.
40
+ - Non-interactive: `opencode run [message..]`.
41
+ - JSON events: `opencode run --format json "task"`.
42
+ - Resume: `opencode run --continue "..."` or `opencode run --session <id> "..."`.
43
+ - Peer role: `opencode run --agent reviewer --dir . "review prompt"`.
44
+ - Reuse a server to avoid MCP cold boot: `opencode serve`, then `opencode run --attach http://localhost:4096 "task"`.
45
+ - On Windows, first verify `opencode` exists before writing automation around it.
46
+
47
+ ## PowerShell Automation Rules
48
+
49
+ - Prefer stdin over trailing prompt args for `claude -p` in PowerShell.
50
+ - Use ASCII prompts or explicitly UTF-8-safe input for automated probes.
51
+ - Do not trust exit code alone. Fail on empty/non-JSON stdout or error/budget terminal fields.
52
+ - Avoid naming function parameters `$Args`; PowerShell treats `$Args` specially.
53
+ - Store telemetry outside the repo, e.g. `$HOME/.claude/cache-telemetry/*.json`, so git status does not perturb prefixes.
54
+
55
+ ## Evidence-Packet Review Pattern
56
+
57
+ For peer review, route smokes, cache analysis, and audits, gather evidence
58
+ first; the peer judges only the bounded packet.
59
+
60
+ - Gather paths, line snippets, command names, exits, and invariants with `rg`,
61
+ `node` scripts, validators, or small reads.
62
+ - Send only that packet. Exclude full docs, raw logs, timestamps, session IDs,
63
+ and screenshots unless they are the evidence.
64
+ - Prefer no tools for judgment-only review; otherwise allow only read-only
65
+ tools and name the exact read set.
66
+ - Controller accepts, rejects, or escalates findings. Peers do not own scope.
67
+
68
+ ## No Scratch-File Rule
69
+
70
+ - Do not write CLI probe output under `%TEMP%`, `$env:TEMP`, `/tmp`, or other
71
+ system temp directories.
72
+ - Prefer stdout, JSON/JSONL streaming, or in-memory parsing.
73
+ - Persistent repo evidence goes under `Harness/tasks/<task-id>/evidence/`.
74
+ - Cache telemetry may live under `$HOME/.claude/cache-telemetry/` to avoid repo
75
+ prompt-cache churn.
76
+ - Do not create prompt temp files. Use stdin.
77
+
78
+ ## Subagent Output Contract
79
+
80
+ Require bounded structured returns:
81
+
82
+ ```text
83
+ Agent: <claude|codex|opencode|role name>
84
+ Probe: <what was tested or reviewed>
85
+ Mode: <read-only|review|telemetry|implementation>
86
+ Files examined: <exact paths or none>
87
+ Evidence: <commands, exit codes, paths, line refs>
88
+ Passes: <confirmed invariants>
89
+ Findings: <severity, file/path, reason, suggested fix>
90
+ Risks: <residual uncertainty or none>
91
+ Tool/CLI issues: <auth, timeout, budget, JSON parse, MCP, or none>
92
+ Verdict: PASS | FAIL | BLOCKED
93
+ Next: <smallest next controller action>
94
+ ```
95
+
96
+ For JSON, use the same keys. Do not return transcripts, full file bodies, decorative logs, or speculation.
97
+
98
+ ## Cache Discipline
99
+
100
+ Follow `Harness/specs/runtime/context-loading.md#Cache-First Context Contract`: stable instructions first, volatile output in the dynamic suffix, and no provider cache claims without telemetry. Claude Code L2 uses `cache_read_input_tokens`; Codex JSONL may emit `cached_input_tokens`.
101
+
102
+ ## Batch-Test Pattern
103
+
104
+ 1. Probe command availability with `Get-Command claude,codex,opencode -ErrorAction SilentlyContinue`.
105
+ 2. Build a compact evidence packet before invoking peer agents; use the peer
106
+ only for judgment unless the test explicitly requires live agent discovery.
107
+ 3. Run a cold turn and capture session id.
108
+ 4. Resume that session for two warm turns.
109
+ 5. For each turn record input, cache creation, cache read, ratio, cost, model/session id, and exact flags.
110
+ 6. Compare against a control mode. Do not attribute a provider-wide cache feature to Harness unless the Harness-shaped run improves or stabilizes cache behavior against a comparable baseline.
111
+
112
+ ## Official References
113
+
114
+ - Claude Code CLI reference: https://code.claude.com/docs/en/cli-reference
115
+ - Claude Code prompt caching: https://code.claude.com/docs/en/prompt-caching
116
+ - Claude Code status line schema: https://code.claude.com/docs/en/statusline
117
+ - Codex CLI: https://developers.openai.com/codex/cli
118
+ - Codex non-interactive mode: https://learn.chatgpt.com/docs/non-interactive-mode
119
+ - OpenCode CLI: https://opencode.ai/docs/cli/
@@ -5,15 +5,32 @@ description: Perpetual adaptive auto-optimization mode. Selects probes from proj
5
5
 
6
6
  # WF Auto - Perpetual Auto-Optimization
7
7
 
8
+ ## Memory Preflight
9
+
10
+ 1. Load `CLAUDE.md`, `Harness/MEMORY.md` index only, then `Harness/README.md`
11
+ before planning, dispatch, edits, validation, or review.
12
+ 2. Load detailed `Harness/memory/*` files only when `MEMORY_PROTOCOL.md`
13
+ scenario hints match; otherwise record "memory hints: none".
14
+
8
15
  ## Load
9
16
 
10
- - `Harness/WF-AUTO.md`
11
- - `Harness/WF-AUTO-ANGLES.md`
12
- - `Harness/subagents.md`
13
- - `Harness/dispatch.md`
14
- - `Harness/agent-workflow.md`
17
+ - `CLAUDE.md`
18
+ - `Harness/MEMORY.md` (index only per Memory Preflight)
19
+ - `Harness/README.md`
20
+ - `Harness/specs/workflows/WF-AUTO.md`
21
+ - `Harness/specs/workflows/WF-AUTO-ANGLES.md`
22
+ - `Harness/specs/runtime/subagents.md`
23
+ - `Harness/specs/runtime/dispatch.md`
24
+ - `Harness/specs/runtime/agent-workflow.md`
15
25
  - `.claude/skills/wf-review/SKILL.md`
16
26
 
27
+ ## Cache Discipline
28
+
29
+ Follow `Harness/specs/runtime/context-loading.md#Cache-First Context Contract`: keep the
30
+ auto-mode docs in listed order, run selected probes only, append fresh probe
31
+ outputs last, and record compact evidence instead of carrying full logs between
32
+ cycles.
33
+
17
34
  ## Trigger
18
35
 
19
36
  - Claude `/wf-auto`
@@ -44,6 +61,9 @@ that auto scanning costs more than it helps.
44
61
  below 3.
45
62
  8. Intent Checkpoint is adaptive: 2 -> 5 -> 10 cycles, exactly two questions.
46
63
  9. Record compact evidence per cycle; do not paste full logs or transcripts.
64
+ 10. A bounded test tick still creates or updates `Harness/tasks/auto/PLAN.md`
65
+ and `Harness/tasks/auto/PROGRESS.md`; missing auto capsule evidence is a
66
+ failed cycle record.
47
67
 
48
68
  ## Loop
49
69
 
@@ -58,5 +78,5 @@ LOOP: next W0
58
78
 
59
79
  ## Return
60
80
 
61
- Report cycles run, findings addressed by source, evidence ledger, exhaustion
62
- evidence if any, weak spark count, final state, and residual risks.
81
+ Report cycles run, findings addressed by source, evidence ledger path/summary,
82
+ exhaustion evidence if any, weak spark count, final state, and residual risks.
@@ -5,7 +5,7 @@ description: Perpetual inspiration mode for /wf-auto-spark or $wf-auto-spark. In
5
5
 
6
6
  # WF-AUTO-SPARK Adapter
7
7
 
8
- The authoritative workflow lives in `Harness/WF-AUTO-SPARK.md`; this adapter
8
+ The authoritative workflow lives in `Harness/specs/workflows/WF-AUTO-SPARK.md`; this adapter
9
9
  only routes and summarizes hard constraints.
10
10
 
11
11
  ## Invocation
@@ -18,10 +18,17 @@ only routes and summarizes hard constraints.
18
18
  1. `CLAUDE.md`
19
19
  2. `Harness/MEMORY.md`
20
20
  3. `Harness/README.md`
21
- 4. `Harness/WF-AUTO-SPARK.md`
22
- 5. `Harness/WF-AUTO.md`
23
- 6. `Harness/subagents.md`
24
- 7. `Harness/dispatch.md`
21
+ 4. `Harness/specs/workflows/WF-AUTO-SPARK.md`
22
+ 5. `Harness/specs/workflows/WF-AUTO.md`
23
+ 6. `Harness/specs/runtime/subagents.md`
24
+ 7. `Harness/specs/runtime/dispatch.md`
25
+
26
+ ## Cache Discipline
27
+
28
+ Follow `Harness/specs/runtime/context-loading.md#Cache-First Context Contract`: keep roadmap
29
+ and workflow docs stable, put fresh spark search results in the dynamic suffix,
30
+ defer unused tools/skills, and let task-scribe write compact state instead of
31
+ replaying search transcripts.
25
32
 
26
33
  ## Rules
27
34
 
@@ -0,0 +1,176 @@
1
+ ---
2
+ name: wf-browser
3
+ description: Built-in browser automation and E2E verification workflow. Use for Claude /wf-browser, Codex $wf-browser or /skills wf-browser, Browser Use, Playwright, Chrome DevTools/CDP, screenshots, forms, UI verification, and browser-visible acceptance.
4
+ ---
5
+
6
+ # WF Browser
7
+
8
+ This skill is the single Browser E2E entry. Do not use or create a separate
9
+ browser E2E skill. The browser evidence contract lives here plus
10
+ `Harness/specs/protocols/HARNESS_BRIDGE.md`.
11
+
12
+ ## Invocation
13
+
14
+ - Claude Code: use `/wf-browser <task>` or select the `wf-browser` skill.
15
+ - Codex CLI or IDE: use `$wf-browser <task>` or `/skills` then choose `wf-browser`.
16
+ - OpenCode: use `/wf-browser <task>`.
17
+
18
+ ## Load
19
+
20
+ - `CLAUDE.md`
21
+ - `Harness/MEMORY.md` index only per Memory Preflight
22
+ - `Harness/README.md`
23
+ - `Harness/specs/protocols/HARNESS_BRIDGE.md`
24
+ - Project run/build/test instructions
25
+ - Official Browser Use skill text from `browser-use skill` when Browser Use is used
26
+
27
+ ## Cache Discipline
28
+
29
+ Follow `Harness/specs/runtime/context-loading.md#Cache-First Context Contract`: keep stable
30
+ workflow docs first, then append only the current URL, selectors, concise browser
31
+ state, screenshot paths, trace paths, and failing assertions. Do not paste full
32
+ accessibility trees, browser logs, screenshots, videos, or network dumps into
33
+ task state.
34
+
35
+ ## Browser Evidence Contract
36
+
37
+ Every browser-visible claim needs real browser evidence:
38
+
39
+ 1. URL and viewport/browser scope.
40
+ 2. Stable selector contract using `data-testid` and accessible labels/roles.
41
+ 3. Real interaction evidence from Browser Use, Playwright, Chrome DevTools/CDP,
42
+ or documented manual browser checks.
43
+ 4. Console and network checks for runtime exceptions, failed requests, and
44
+ frontend-backend side effects.
45
+ 5. Screenshot, trace, video, state snapshot, or command output path.
46
+ 6. AC-by-AC validation matrix when acceptance criteria exist.
47
+
48
+ No `data-testid` or stable accessible selector, no UI acceptance. No API
49
+ contract, no backend integration acceptance.
50
+
51
+ ## Controllable UI Contract
52
+
53
+ UI built for browser control must expose targetable, user-meaningful controls:
54
+
55
+ | Category | Required control surface |
56
+ | --- | --- |
57
+ | Inputs | `<label>` association or `aria-label`, `data-testid`, disabled/invalid states, deterministic placeholder only as fallback |
58
+ | Buttons | accessible name, `data-testid`, disabled/loading state, no icon-only button without `aria-label` |
59
+ | Filters | stable test id for input/menu/chip, selected state, clear/reset control |
60
+ | Rows/items | stable row/item test id plus durable item key such as `data-row-id`; avoid index-only targeting |
61
+ | Empty state | visible empty container with `data-testid="empty-state"` or feature-specific equivalent |
62
+ | Error state | inline error/toast/banner with stable test id and accessible role when appropriate |
63
+ | Loading state | stable spinner/skeleton/progress test id; verify duplicate submit prevention |
64
+
65
+ Required coverage targets: inputs, buttons, filters, rows, empty/error/loading states.
66
+
67
+ Selector priority:
68
+
69
+ 1. `data-testid`
70
+ 2. accessible labels/roles
71
+ 3. visible text for stable user-facing copy
72
+
73
+ Do not use generated class names, brittle CSS chains, XPath, DOM index selectors,
74
+ or raw coordinates as the primary test contract. Coordinates are acceptable only
75
+ after locating an element through the accessibility tree or when testing canvas
76
+ or other non-DOM UI.
77
+
78
+ ## Browser Use CLI
79
+
80
+ Use the current script-style Browser Use CLI; old `browser-use open/state/click/screenshot/input/wait` subcommands are removed from the current CLI and must not be used in new docs or tests.
81
+
82
+ Health check:
83
+
84
+ ```bash
85
+ browser-use --doctor
86
+ browser-use skill
87
+ ```
88
+
89
+ PowerShell smoke:
90
+
91
+ ```powershell
92
+ @'
93
+ new_tab("https://example.com")
94
+ wait_for_load()
95
+ print(page_info())
96
+ path = capture_screenshot("Harness/tasks/<task-id>/evidence/example.png")
97
+ print(path)
98
+ '@ | browser-use
99
+ ```
100
+
101
+ Bash smoke:
102
+
103
+ ```bash
104
+ browser-use <<'PY'
105
+ new_tab("https://example.com")
106
+ wait_for_load()
107
+ print(page_info())
108
+ path = capture_screenshot("Harness/tasks/<task-id>/evidence/example.png")
109
+ print(path)
110
+ PY
111
+ ```
112
+
113
+ Useful helpers include `new_tab(url)`, `goto_url(url)`, `page_info()`,
114
+ `capture_screenshot(path)`, `click_at_xy(x, y)`, `type_text(text)`,
115
+ `fill_input(selector, text)`, `press_key(key)`, `scroll(x, y)`, `js(code)`,
116
+ `cdp(method, ...)`, `wait_for_load()`, `wait_for_element(selector)`,
117
+ `list_tabs()`, `switch_tab(target)`, and `close_tab(target)`.
118
+
119
+ For local Chrome connection problems, run `browser-use --doctor`. If Chrome asks
120
+ to allow remote debugging, stop and ask the user to approve the browser prompt.
121
+
122
+ ## Playwright Test Pattern
123
+
124
+ Prefer Playwright for repeatable E2E tests and Browser Use/CDP for exploratory
125
+ or interactive checks.
126
+
127
+ ```ts
128
+ import { test, expect } from "@playwright/test";
129
+
130
+ test("AC-001 user can submit the form", async ({ page }) => {
131
+ const requests: Array<{ url: string; method: string; postData: string | null }> = [];
132
+ page.on("request", request => {
133
+ requests.push({
134
+ url: request.url(),
135
+ method: request.method(),
136
+ postData: request.postData(),
137
+ });
138
+ });
139
+
140
+ await page.goto("/example");
141
+ await page.getByTestId("email-input").fill("test@example.com");
142
+ await page.getByRole("button", { name: "Submit" }).click();
143
+
144
+ await expect(page.getByTestId("loading-spinner")).toBeHidden();
145
+ await expect(page.getByTestId("result-row")).toBeVisible();
146
+ expect(requests.some(request => request.url.includes("/api/example"))).toBe(true);
147
+ });
148
+ ```
149
+
150
+ ## Chrome DevTools / CDP Checklist
151
+
152
+ - [ ] Record URL, port, browser, and viewport.
153
+ - [ ] Verify available Browser Use, Playwright, CDP, MCP, or manual tooling.
154
+ - [ ] Check not just HTTP 200.
155
+ - [ ] Verify no runtime exceptions, console errors, and failed network requests.
156
+ - [ ] Confirm stable accessible labels/roles or `data-testid` on interactive elements.
157
+ - [ ] Test the critical flow end-to-end with real user actions.
158
+ - [ ] Capture screenshot, trace, video, state snapshot, or result artifact paths.
159
+ - [ ] Produce an AC-by-AC validation matrix.
160
+ - [ ] Clean up dev server or browser processes that the task started.
161
+
162
+ ## Security
163
+
164
+ - Never log or screenshot real credentials, API keys, tokens, or private data.
165
+ - Use placeholder credentials in examples.
166
+ - Ask before using a real Chrome profile because it contains cookies and private sessions.
167
+ - Ask before leaving a remote/cloud browser running.
168
+ - For scraping or repeated automated visits, confirm the user owns the target or has permission.
169
+
170
+ ## Return
171
+
172
+ - Commands or scripts run
173
+ - Selectors used
174
+ - Screenshot/trace/video/state paths
175
+ - Verified flows and AC matrix
176
+ - Failures and remaining risks
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: wf-help
3
+ description: Codex compatibility: use $wf-help or /skills wf-help in Codex to show the Harness WF command table. Claude Code and OpenCode use the direct /wf-help command.
4
+ ---
5
+
6
+ # WF Help Adapter
7
+
8
+ This skill is a Codex compatibility shim. It does not start WF mode, dispatch
9
+ agents, or edit files.
10
+
11
+ ## Invocation
12
+
13
+ - Codex CLI or IDE: use `$wf-help` or `/skills` then choose `wf-help`.
14
+ - Claude Code: use `/wf-help` direct command from `.claude/commands/wf-help.md`.
15
+ - OpenCode: use `/wf-help` direct command from `.opencode/commands/wf-help.md`.
16
+
17
+ ## Load
18
+
19
+ - `.claude/commands/wf-help.md`
20
+
21
+ ## Rules
22
+
23
+ Return the command table from `.claude/commands/wf-help.md` directly.
24
+ Do not load `Harness/MEMORY.md`, do not enter WF, and do not invoke workflow
25
+ skills while answering help.
26
+
27
+ ## Return
28
+
29
+ - WF command table
30
+ - One short note that Codex uses `$wf-*` or `/skills wf-*` for skill-backed entries
@@ -22,6 +22,12 @@ fallback.
22
22
  - `Harness/memory/agent-lessons-patterns.md`
23
23
  - Current `Harness/PROGRESS.md` and active task capsule, if any
24
24
 
25
+ ## Cache Discipline
26
+
27
+ Follow `Harness/specs/runtime/context-loading.md#Cache-First Context Contract`: load memory
28
+ indexes first, then only the routed detailed memory files; summarize durable
29
+ patterns by file path and signal instead of pasting session transcripts.
30
+
25
31
  ## Flow
26
32
 
27
33
  1. Analyze the session for repeated failures, durable user corrections, and
@@ -5,7 +5,7 @@ description: Use for /wf-max in Claude Code, $wf-max or /skills wf-max in Codex.
5
5
 
6
6
  # WF-MAX Adapter
7
7
 
8
- The authoritative workflow lives in `Harness/WF-MAX.md`; this adapter only
8
+ The authoritative workflow lives in `Harness/specs/workflows/WF-MAX.md`; this adapter only
9
9
  routes and summarizes hard constraints.
10
10
 
11
11
  ## Invocation
@@ -24,35 +24,50 @@ routes and summarizes hard constraints.
24
24
  1. `CLAUDE.md`
25
25
  2. `Harness/MEMORY.md` (index only per Memory Preflight)
26
26
  3. `Harness/README.md`
27
- 4. `Harness/WF-MAX.md`
28
- 5. `Harness/subagents.md`
29
- 6. `Harness/dispatch.md`
30
- 7. `Harness/agent-workflow.md`
27
+ 4. `Harness/specs/workflows/WF-MAX.md`
28
+ 5. `Harness/specs/runtime/subagents.md`
29
+ 6. `Harness/specs/runtime/dispatch.md`
30
+ 7. `Harness/specs/runtime/agent-workflow.md`
31
+
32
+ ## Cache Discipline
33
+
34
+ Follow `Harness/specs/runtime/context-loading.md#Cache-First Context Contract`: keep the
35
+ listed loads in order, defer unused skill/tool schemas, append volatile task
36
+ state and runtime facts last, and bound Worker returns through dispatch
37
+ `MaxReturnTokens`/`ReturnSchema`.
31
38
 
32
39
  ## Rules
33
40
 
34
41
  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
42
+ (`Harness/specs/workflows/WF-KERNEL.md`), then expands safe parallelism. WF-Max-Useful is
36
43
  default; WF-Max-Strict only on explicit strict request. Execution expands
37
44
  through:
38
45
 
46
+ - New task state directories MUST use task ids matching
47
+ `task-<verb>-<noun>[-detail]` under `Harness/tasks/<task-id>/`; never
48
+ create bare `fix-*` task ids.
39
49
  1. Global mode: `wf-max`
40
50
  2. Agent role: `ceo | manager | worker | reviewer | verifier | reflector`
41
51
  3. Dispatch permission: `writeSet`, `forbidden`, `verification`
42
52
 
43
53
  WF-Max-Useful (default): `/wf-max` fans out only where write sets or review
44
54
  lenses are meaningfully independent. Overhead > 0.30 degrades the wave.
55
+ Degrading fan-out does not authorize CEO source edits; source implementation
56
+ still goes through an implementer/Worker role, or the run records an honest
57
+ downgrade before editing.
45
58
 
46
59
  WF-Max-Strict (explicit override): user says `--strict`, `strict wf-max`, or
47
60
  `strict mode`. Unconditional fan-out per the original span formula.
48
61
 
49
62
  - CEO reads, plans, dispatches, synthesizes, and writes task state only. CEO
50
63
  never edits production source.
64
+ - Task-state updates must preserve required `Harness/PROGRESS.md` headings:
65
+ `## Active Task`, `## Task Index`, and `## Cross-Task Decisions`.
51
66
  - Workers edit only the dispatch `writeSet`; outside write set is blocked.
52
67
  - Managers coordinate and synthesize. Reviewers read/report only.
53
68
  - D-GATE is mandatory before implementation waves: dispatch table, AC IDs,
54
69
  disjoint file claims, self-audit, and reviewer plan.
55
- - Final acceptance is tier-aware per `Harness/WF-KERNEL.md`:
70
+ - Final acceptance is tier-aware per `Harness/specs/workflows/WF-KERNEL.md`:
56
71
  - WF-Light + `/wf-max`: verification + state evidence suffices unless risk
57
72
  triggers review/reflector.
58
73
  - WF-Standard + `/wf-max`: verifier evidence + one independent review PASS.
@@ -60,16 +75,30 @@ WF-Max-Strict (explicit override): user says `--strict`, `strict wf-max`, or
60
75
 
61
76
  ## Fan-Out Discipline
62
77
 
78
+ - MUST attempt native subagent fan-out before implementation planning is
79
+ considered complete. A solo controller path is allowed only after recording
80
+ `fanoutAttempted: true`, the runtime, channel tried, agents requested,
81
+ limit/cap facts, failure reason, and fallback path in task state.
63
82
  - Use as many useful subagents as the runtime safely allows.
64
- - Codex capacity may be configured through official `agents.max_threads` and
65
- `agents.max_depth`; generated Harness config defaults to
66
- `.codex/config.toml` with `max_threads = 12` and `max_depth = 1`.
83
+ - Claude Code documents session, concurrent, and spawn-depth subagent caps:
84
+ `CLAUDE_CODE_MAX_SUBAGENTS_PER_SESSION`,
85
+ `CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS`, and
86
+ `CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH`; Harness still enforces its lower
87
+ WF-MAX caps unless the user explicitly approves a task-local override.
88
+ - Codex capacity is configured through official
89
+ `agents.max_concurrent_threads_per_session`; `agents.max_threads` is a
90
+ legacy alias. Do not scaffold scalar `[agents]` caps into
91
+ `.codex/config.toml`; codex-cli 0.144.x can reject them during TUI
92
+ `skills/list`. Treat Codex capacity as a runtime probe and manage Harness
93
+ caps in the dispatch ledger unless the installed Codex version is verified
94
+ with `codex --strict-config doctor`.
95
+ - OpenCode uses `subagent_depth` for nesting. WF-MAX manager -> worker fan-out
96
+ requires `subagent_depth >= 2` plus manager `permission.task` allowlists; the
97
+ scaffold sets `subagent_depth = 2`.
67
98
  - Close completed agents before declaring the pool exhausted.
68
99
  - If Codex remains bottlenecked, ask the user before raising
69
- `agents.max_threads` above the scaffold default. Do not silently edit project
70
- or global Codex config.
71
- - Keep `agents.max_depth = 1` unless the user explicitly approves recursive
72
- delegation.
100
+ `agents.max_concurrent_threads_per_session`. Do not silently edit project or
101
+ global Codex config.
73
102
  - If the current runtime is exhausted, overflow to a peer CLI with explicit
74
103
  dispatch packets: `claude -p`, `codex exec`, or
75
104
  `opencode run --agent <role> --dir .`.
@@ -14,7 +14,13 @@ Improve `README.md` without breaking project-owned public docs.
14
14
  - CI files when present
15
15
  - `Harness/PROGRESS.md`
16
16
  - `Harness/tasks/<task-id>/PLAN.md` when available
17
- - `Harness/architecture.md` only when an architecture summary or diagram is requested
17
+ - `Harness/project/architecture.md` only when an architecture summary or diagram is requested
18
+
19
+ ## Cache Discipline
20
+
21
+ Follow `Harness/specs/runtime/context-loading.md#Cache-First Context Contract`: load project
22
+ facts in the listed order, inspect only relevant README/package/CI sections, and
23
+ keep unknowns or command output in the dynamic suffix.
18
24
 
19
25
  ## Mode
20
26
 
@@ -34,7 +40,7 @@ If unanswered, use Preserve + append.
34
40
  - Do not invent features, benchmarks, roadmap, support policy, badges, install commands, or CI status.
35
41
  - Use tables for command matrices, environment variables, endpoints, and deployment notes when facts are known.
36
42
  - 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.
43
+ - Keep detailed architecture in `Harness/project/architecture.md`; README may link to it or show a short overview.
38
44
  - Keep agent rules in `CLAUDE.md`/`AGENTS.md`, not README.
39
45
  - Record the chosen mode and any skipped README improvements in `Harness/tasks/<task-id>/PLAN.md` when available.
40
46
 
@@ -18,6 +18,12 @@ description: Use for /wf-remove in Claude Code, $wf-remove or /skills wf-remove
18
18
  - `Harness/.harness-version`
19
19
  - `Harness/scripts/wf-remove.mjs`
20
20
 
21
+ ## Cache Discipline
22
+
23
+ Follow `Harness/specs/runtime/context-loading.md#Cache-First Context Contract`: use the
24
+ script's compact JSON plan as the dynamic suffix, avoid manual directory dumps,
25
+ and keep user decisions in task progress rather than chat transcript.
26
+
21
27
  ## Flow
22
28
 
23
29
  1. On plain `/wf-remove`, run `node Harness/scripts/wf-remove.mjs --json` for
@@ -22,6 +22,13 @@ The main agent is the controller. It owns final decisions, accepted/rejected
22
22
  findings, fixes, release claims, and user-facing recommendations. Review
23
23
  agents only provide evidence-backed suggestions.
24
24
 
25
+ ## Cache Discipline
26
+
27
+ Follow `Harness/specs/runtime/context-loading.md#Cache-First Context Contract`: build review
28
+ context from changed-file lists, ACs, validation evidence, and targeted diffs;
29
+ avoid pasting unrelated history, full transcripts, or unused tool schemas into
30
+ the review prompt.
31
+
25
32
  ## Runtime Selection
26
33
 
27
34
  1. Build one review prompt containing the relevant diff, task acceptance
@@ -66,8 +73,8 @@ AgentName: reviewer
66
73
  Mode: read-only
67
74
  Objective: review the current diff for correctness, security, architecture,
68
75
  performance, tests, and spec/AC compliance
69
- Read set: changed files, tests, task PLAN/PROGRESS, Harness/agent-workflow.md,
70
- Harness/subagents.md, Harness/dispatch.md, architecture docs when affected
76
+ Read set: changed files, tests, task PLAN/PROGRESS, Harness/specs/runtime/agent-workflow.md,
77
+ Harness/specs/runtime/subagents.md, Harness/specs/runtime/dispatch.md, architecture docs when affected
71
78
  Write set: none
72
79
  Forbidden: file edits, git mutations, formatting-only advice, ungrounded claims
73
80
  ReturnSchema: findings by severity, file/line refs, missing verification,
@@ -80,6 +87,6 @@ deduplicate reviewer output and decide what to accept.
80
87
 
81
88
  ## Context
82
89
 
83
- Include the relevant diff, `Harness/architecture.md` when architecture is in
90
+ Include the relevant diff, `Harness/project/architecture.md` when architecture is in
84
91
  scope, and any task acceptance criteria. If the diff is too large, ask for a
85
92
  narrower scope before invoking a peer CLI or reviewer subagent.