create-harness-vibe-coding 0.8.8 → 0.8.10
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.
- package/README-CN.md +8 -2
- package/README.md +22 -3
- package/docs/images/harness-icon.png +0 -0
- package/package.json +3 -1
- package/src/generator.js +36 -0
- package/src/index.js +72 -4
- package/templates/common/.claude/agents/architect.md +31 -31
- package/templates/common/.claude/agents/codebase-explorer.md +45 -0
- package/templates/common/.claude/agents/docs-researcher.md +41 -41
- package/templates/common/.claude/agents/memory-master.md +26 -8
- package/templates/common/.claude/agents/reviewer.md +34 -34
- package/templates/common/.claude/agents/task-scribe.md +70 -0
- package/templates/common/.claude/commands/wf-help.md +9 -5
- package/templates/common/.claude/commands/wf-update.md +24 -0
- package/templates/common/.claude/rules/ecc/common.md +15 -2
- package/templates/common/.claude/settings.json +13 -0
- package/templates/common/.claude/skills/subagent-orchestrator/SKILL.md +10 -6
- package/templates/common/.claude/skills/wf/SKILL.md +15 -8
- package/templates/common/.claude/skills/wf-auto/SKILL.md +3 -2
- package/templates/common/.claude/skills/wf-learn/SKILL.md +9 -2
- package/templates/common/.claude/skills/wf-max/SKILL.md +26 -8
- package/templates/common/.claude/skills/wf-review/SKILL.md +63 -12
- package/templates/common/.claude/skills/wf-update/SKILL.md +15 -2
- package/templates/common/.codex/hooks.json +17 -0
- package/templates/common/.harness-version +93 -48
- package/templates/common/.opencode/agents/architect.md +24 -24
- package/templates/common/.opencode/agents/codebase-explorer.md +45 -0
- package/templates/common/.opencode/agents/docs-researcher.md +34 -34
- package/templates/common/.opencode/agents/memory-master.md +26 -8
- package/templates/common/.opencode/agents/reviewer.md +27 -27
- package/templates/common/.opencode/agents/task-scribe.md +70 -0
- package/templates/common/.opencode/commands/wf-auto-spark.md +15 -0
- package/templates/common/.opencode/commands/wf-auto.md +15 -0
- package/templates/common/.opencode/commands/wf-help.md +9 -5
- package/templates/common/.opencode/commands/wf-learn.md +15 -0
- package/templates/common/.opencode/commands/wf-max.md +15 -0
- package/templates/common/.opencode/commands/wf-readme.md +15 -0
- package/templates/common/.opencode/commands/wf-remove.md +15 -0
- package/templates/common/.opencode/commands/wf-review.md +15 -0
- package/templates/common/.opencode/commands/wf-update.md +24 -0
- package/templates/common/.opencode/commands/wf.md +15 -0
- package/templates/common/.opencode/plugins/harness-wf-status.mjs +126 -0
- package/templates/common/AGENTS.md +2 -29
- package/templates/common/CLAUDE.md +35 -6
- package/templates/common/Harness/ACCEPTANCE_PROTOCOL.md +2 -2
- package/templates/common/{MEMORY.md → Harness/MEMORY.md} +17 -4
- package/templates/common/Harness/MEMORY_PROTOCOL.md +80 -30
- package/templates/common/Harness/README.md +53 -25
- package/templates/common/{SETUP.md → Harness/SETUP.md} +278 -276
- package/templates/common/Harness/TASK_ARCHIVE.md +56 -0
- package/templates/common/Harness/WF-AUTO-ANGLES.md +1 -1
- package/templates/common/Harness/WF-AUTO-SPARK.md +5 -14
- package/templates/common/Harness/WF-AUTO.md +22 -84
- package/templates/common/Harness/WF-KERNEL.md +189 -0
- package/templates/common/Harness/WF-MAX.md +60 -328
- package/templates/common/Harness/WF-STATE.md +83 -0
- package/templates/common/Harness/WF.md +117 -237
- package/templates/common/Harness/agent-workflow.md +2 -2
- package/templates/common/Harness/context-loading.md +3 -3
- package/templates/common/Harness/dispatch.md +43 -35
- package/templates/common/Harness/scripts/archive-tasks.mjs +239 -0
- package/templates/common/{scripts → Harness/scripts}/scan-clean.mjs +29 -1
- package/templates/common/{scripts → Harness/scripts}/validate-harness.mjs +921 -699
- package/templates/common/Harness/scripts/wf-auto-update-prompt.mjs +258 -0
- package/templates/common/{scripts → Harness/scripts}/wf-remove.mjs +1 -0
- package/templates/common/{scripts → Harness/scripts}/wf-update-check.mjs +163 -52
- package/templates/common/Harness/subagents.md +36 -28
- package/templates/common/Harness/tasks/_template/PLAN.md +5 -0
- package/templates/common/Harness/tasks/_template/STATE.json +23 -0
- package/templates/common/README.md +2 -2
- package/templates/common/memory/agent-lessons-patterns.md +9 -8
- package/templates/common/memory/routes.md +43 -0
- package/templates/common/memory/startup-hints.md +32 -0
- package/templates/common/memory/tool-usage-reflections.md +9 -8
- package/templates/common/memory/user-corrections-preferences.md +11 -9
- package/templates/optional/catalog.json +8 -0
- package/templates/optional/skills/browser-e2e/.claude/skills/browser-e2e/SKILL.md +42 -42
- package/templates/optional/skills/browser-e2e/.opencode/commands/wf-browser.md +15 -0
- package/templates/optional/skills/github-pr-review/.claude/skills/github-pr-review/SKILL.md +40 -40
- package/templates/optional/skills/python-backend/.claude/skills/python-backend/SKILL.md +40 -40
- package/templates/optional/skills/ts-react-frontend/.claude/skills/ts-react-frontend/SKILL.md +43 -43
- package/templates/optional/skills/ui-ux-review/.claude/skills/ui-ux-review/SKILL.md +40 -40
|
@@ -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
|
+
mode: subagent
|
|
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".
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Run perpetual inspiration mode via the wf-auto-spark skill
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /wf-auto-spark
|
|
6
|
+
|
|
7
|
+
This is a **workflow command**, not a direct command. Do not execute it as a
|
|
8
|
+
static help or script command.
|
|
9
|
+
|
|
10
|
+
1. Load `CLAUDE.md`, `Harness/MEMORY.md` (index only per Memory Preflight), then `Harness/README.md`.
|
|
11
|
+
2. Execute per the skill adapter `.claude/skills/wf-auto-spark/SKILL.md` (mirror: `.agents/skills/wf-auto-spark/SKILL.md`).
|
|
12
|
+
3. Do not duplicate the workflow here. The skill adapter and `Harness/WF-AUTO-SPARK.md` are authoritative.
|
|
13
|
+
|
|
14
|
+
If this runtime cannot invoke the skill directly, read
|
|
15
|
+
`.claude/skills/wf-auto-spark/SKILL.md` and follow it in place.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Run perpetual adaptive auto-optimization via the wf-auto skill
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /wf-auto
|
|
6
|
+
|
|
7
|
+
This is a **workflow command**, not a direct command. Do not execute it as a
|
|
8
|
+
static help or script command.
|
|
9
|
+
|
|
10
|
+
1. Load `CLAUDE.md`, `Harness/MEMORY.md` (index only per Memory Preflight), then `Harness/README.md`.
|
|
11
|
+
2. Execute per the skill adapter `.claude/skills/wf-auto/SKILL.md` (mirror: `.agents/skills/wf-auto/SKILL.md`).
|
|
12
|
+
3. Do not duplicate the workflow here. The skill adapter and `Harness/WF-AUTO.md` are authoritative.
|
|
13
|
+
|
|
14
|
+
If this runtime cannot invoke the skill directly, read
|
|
15
|
+
`.claude/skills/wf-auto/SKILL.md` and follow it in place.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Show the Harness WF command table
|
|
3
3
|
---
|
|
4
|
+
# /wf-help
|
|
4
5
|
|
|
5
6
|
Return this help table directly. Do not invoke a skill, do not start WF mode,
|
|
6
7
|
do not dispatch agents, and do not edit files.
|
|
@@ -8,16 +9,19 @@ do not dispatch agents, and do not edit files.
|
|
|
8
9
|
| Command | Type | Usage | Purpose |
|
|
9
10
|
| --- | --- | --- | --- |
|
|
10
11
|
| `/wf-help` | direct command | `/wf-help` | Show this command table. |
|
|
11
|
-
| `/wf <task>` | workflow skill | `/wf fix failing login flow` |
|
|
12
|
-
| `/wf-max <task>` | workflow skill | `/wf-max refactor auth module` | WF
|
|
13
|
-
| `/wf-auto` | workflow skill | `/wf-auto` | Perpetual auto-optimization
|
|
12
|
+
| `/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). |
|
|
13
|
+
| `/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). |
|
|
14
|
+
| `/wf-auto` | workflow skill | `/wf-auto` | Perpetual adaptive auto-optimization using project evidence, dynamic probes, risk obligations, evidence ledger, and confirmation-based exhaustion. |
|
|
14
15
|
| `/wf-auto-spark` | workflow skill | `/wf-auto-spark` | Perpetual inspiration mode with roadmap anchoring and external spark search. |
|
|
15
|
-
| `/wf-review <focus>` | workflow skill | `/wf-review security and test coverage` |
|
|
16
|
+
| `/wf-review <focus>` | workflow skill | `/wf-review security and test coverage` | Peer CLI review through Claude/Codex/OpenCode, with reviewer subagent fallback. |
|
|
16
17
|
| `/wf-learn` | workflow skill | `/wf-learn` | Force context-master -> memory-master learning cycle after repeated failures or closeout. |
|
|
17
18
|
| `/wf-readme <task>` | workflow skill | `/wf-readme polish quickstart` | Preserve, merge, or improve README docs without trampling existing project documentation. |
|
|
18
|
-
| `/wf-update` |
|
|
19
|
+
| `/wf-update` | direct command | `/wf-update` | Check/apply Harness scaffold updates with safe file classification and conflict handling. |
|
|
19
20
|
| `/wf-remove` | workflow skill | `/wf-remove` | Safely remove Harness files while preserving project/user data unless explicitly purged. |
|
|
20
21
|
|
|
21
22
|
Source of truth: `Harness/README.md#Skill Commands` plus installed skills under
|
|
22
23
|
`.claude/skills/` (Claude Code) or `.agents/skills/` (Codex). In OpenCode the
|
|
23
24
|
same skills load from `.claude/skills/`, `.agents/skills/`, and `.opencode/skills/`.
|
|
25
|
+
In OpenCode, every workflow command above is also visible as a thin command
|
|
26
|
+
wrapper under `.opencode/commands/` (e.g. `/wf`, `/wf-max`); each wrapper only
|
|
27
|
+
routes to the matching skill adapter and does not duplicate the workflow.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Run the context-master -> memory-master learning cycle via the wf-learn skill
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /wf-learn
|
|
6
|
+
|
|
7
|
+
This is a **workflow command**, not a direct command. Do not execute it as a
|
|
8
|
+
static help or script command.
|
|
9
|
+
|
|
10
|
+
1. Load `CLAUDE.md`, `Harness/MEMORY.md` (index only per Memory Preflight), then `Harness/README.md`.
|
|
11
|
+
2. Execute per the skill adapter `.claude/skills/wf-learn/SKILL.md` (mirror: `.agents/skills/wf-learn/SKILL.md`).
|
|
12
|
+
3. Do not duplicate the workflow here. The skill adapter and `Harness/MEMORY_PROTOCOL.md` are authoritative.
|
|
13
|
+
|
|
14
|
+
If this runtime cannot invoke the skill directly, read
|
|
15
|
+
`.claude/skills/wf-learn/SKILL.md` and follow it in place.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Run the WF-MAX maximum-safe-parallelism workflow via the wf-max skill
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /wf-max
|
|
6
|
+
|
|
7
|
+
This is a **workflow command**, not a direct command. Do not execute it as a
|
|
8
|
+
static help or script command.
|
|
9
|
+
|
|
10
|
+
1. Load `CLAUDE.md`, `Harness/MEMORY.md` (index only per Memory Preflight), then `Harness/README.md`.
|
|
11
|
+
2. Execute per the skill adapter `.claude/skills/wf-max/SKILL.md` (mirror: `.agents/skills/wf-max/SKILL.md`).
|
|
12
|
+
3. Do not duplicate the workflow here. The skill adapter and `Harness/WF-MAX.md` are authoritative.
|
|
13
|
+
|
|
14
|
+
If this runtime cannot invoke the skill directly, read
|
|
15
|
+
`.claude/skills/wf-max/SKILL.md` and follow it in place.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Run the README preservation and improvement workflow via the wf-readme skill
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /wf-readme
|
|
6
|
+
|
|
7
|
+
This is a **workflow command**, not a direct command. Do not execute it as a
|
|
8
|
+
static help or script command.
|
|
9
|
+
|
|
10
|
+
1. Load `CLAUDE.md`, `Harness/MEMORY.md` (index only per Memory Preflight), then `Harness/README.md`.
|
|
11
|
+
2. Execute per the skill adapter `.claude/skills/wf-readme/SKILL.md` (mirror: `.agents/skills/wf-readme/SKILL.md`).
|
|
12
|
+
3. Do not duplicate the workflow here. The skill adapter and the project root \`README.md\` ownership rules are authoritative.
|
|
13
|
+
|
|
14
|
+
If this runtime cannot invoke the skill directly, read
|
|
15
|
+
`.claude/skills/wf-readme/SKILL.md` and follow it in place.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Run safe harness removal via the wf-remove skill
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /wf-remove
|
|
6
|
+
|
|
7
|
+
This is a **workflow command**, not a direct command. Do not execute it as a
|
|
8
|
+
static help or script command.
|
|
9
|
+
|
|
10
|
+
1. Load `CLAUDE.md`, `Harness/MEMORY.md` (index only per Memory Preflight), then `Harness/README.md`.
|
|
11
|
+
2. Execute per the skill adapter `.claude/skills/wf-remove/SKILL.md` (mirror: `.agents/skills/wf-remove/SKILL.md`).
|
|
12
|
+
3. Do not duplicate the workflow here. The skill adapter and `Harness/scripts/wf-remove.mjs` are authoritative.
|
|
13
|
+
|
|
14
|
+
If this runtime cannot invoke the skill directly, read
|
|
15
|
+
`.claude/skills/wf-remove/SKILL.md` and follow it in place.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Run peer CLI or reviewer-subagent review via the wf-review skill
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /wf-review
|
|
6
|
+
|
|
7
|
+
This is a **workflow command**, not a direct command. Do not execute it as a
|
|
8
|
+
static help or script command.
|
|
9
|
+
|
|
10
|
+
1. Load `CLAUDE.md`, `Harness/MEMORY.md` (index only per Memory Preflight), then `Harness/README.md`.
|
|
11
|
+
2. Execute per the skill adapter `.claude/skills/wf-review/SKILL.md` (mirror: `.agents/skills/wf-review/SKILL.md`).
|
|
12
|
+
3. Do not duplicate the workflow here. The skill adapter and the wf-review peer-review contract are authoritative.
|
|
13
|
+
|
|
14
|
+
If this runtime cannot invoke the skill directly, read
|
|
15
|
+
`.claude/skills/wf-review/SKILL.md` and follow it in place.
|
|
@@ -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.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Run the tiered WF workflow (WF-Light/Standard/Full) via the wf skill
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /wf
|
|
6
|
+
|
|
7
|
+
This is a **workflow command**, not a direct command. Do not execute it as a
|
|
8
|
+
static help or script command.
|
|
9
|
+
|
|
10
|
+
1. Load `CLAUDE.md`, `Harness/MEMORY.md` (index only per Memory Preflight), then `Harness/README.md`.
|
|
11
|
+
2. Execute per the skill adapter `.claude/skills/wf/SKILL.md` (mirror: `.agents/skills/wf/SKILL.md`).
|
|
12
|
+
3. Do not duplicate the workflow here. The skill adapter and `Harness/WF.md` are authoritative.
|
|
13
|
+
|
|
14
|
+
If this runtime cannot invoke the skill directly, read
|
|
15
|
+
`.claude/skills/wf/SKILL.md` and follow it in place.
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { spawnSync } from 'node:child_process';
|
|
3
|
+
import { resolve } from 'node:path';
|
|
4
|
+
|
|
5
|
+
const WF_COMMANDS = new Map([
|
|
6
|
+
['wf', 'WF'],
|
|
7
|
+
['wf-max', 'WF-MAX'],
|
|
8
|
+
['wf-auto', 'WF-AUTO'],
|
|
9
|
+
['wf-auto-spark', 'WF-AUTO-SPARK'],
|
|
10
|
+
['wf-review', 'WF-REVIEW'],
|
|
11
|
+
['wf-learn', 'WF-LEARN'],
|
|
12
|
+
['wf-readme', 'WF-README'],
|
|
13
|
+
['wf-remove', 'WF-REMOVE'],
|
|
14
|
+
['wf-browser', 'WF-BROWSER'],
|
|
15
|
+
]);
|
|
16
|
+
|
|
17
|
+
function commandName(value) {
|
|
18
|
+
return String(value || '').trim().replace(/^\/+/, '').split(/\s+/)[0];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function runtimeDir(root) {
|
|
22
|
+
return resolve(root, 'Harness', '.runtime');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function modePath(root) {
|
|
26
|
+
return resolve(runtimeDir(root), 'current-mode.json');
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function writeMode(root, mode, sessionID) {
|
|
30
|
+
mkdirSync(runtimeDir(root), { recursive: true });
|
|
31
|
+
writeFileSync(modePath(root), JSON.stringify({
|
|
32
|
+
active: true,
|
|
33
|
+
mode,
|
|
34
|
+
sessionID,
|
|
35
|
+
startedAt: new Date().toISOString(),
|
|
36
|
+
surface: 'opencode',
|
|
37
|
+
}, null, 2) + '\n', 'utf-8');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function readMode(root) {
|
|
41
|
+
try {
|
|
42
|
+
return JSON.parse(readFileSync(modePath(root), 'utf-8'));
|
|
43
|
+
} catch {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function clearMode(root) {
|
|
49
|
+
try {
|
|
50
|
+
rmSync(modePath(root), { force: true });
|
|
51
|
+
} catch {
|
|
52
|
+
// Best effort only.
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function runUpdatePrompt(root, prompt = '', hookEventName = 'opencode.startup') {
|
|
57
|
+
const script = resolve(root, 'Harness', 'scripts', 'wf-auto-update-prompt.mjs');
|
|
58
|
+
if (!existsSync(script)) return null;
|
|
59
|
+
const result = spawnSync(process.execPath, [script, '--format', 'json'], {
|
|
60
|
+
cwd: root,
|
|
61
|
+
input: JSON.stringify({
|
|
62
|
+
cwd: root,
|
|
63
|
+
hook_event_name: hookEventName,
|
|
64
|
+
prompt,
|
|
65
|
+
}),
|
|
66
|
+
encoding: 'utf-8',
|
|
67
|
+
timeout: 35000,
|
|
68
|
+
});
|
|
69
|
+
if (result.error || !result.stdout?.trim()) return null;
|
|
70
|
+
try {
|
|
71
|
+
return JSON.parse(result.stdout);
|
|
72
|
+
} catch {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
async function showToast(client, directory, body) {
|
|
78
|
+
try {
|
|
79
|
+
await client.tui.showToast({
|
|
80
|
+
body,
|
|
81
|
+
query: { directory },
|
|
82
|
+
});
|
|
83
|
+
} catch {
|
|
84
|
+
// TUI may not be attached, for example during non-interactive runs.
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export const HarnessWfStatusPlugin = async ({ client, directory, worktree }) => {
|
|
89
|
+
const root = worktree || directory || process.cwd();
|
|
90
|
+
const startupUpdate = runUpdatePrompt(root);
|
|
91
|
+
if (startupUpdate?.message) {
|
|
92
|
+
await showToast(client, root, {
|
|
93
|
+
title: 'Harness update available',
|
|
94
|
+
message: startupUpdate.message,
|
|
95
|
+
variant: 'warning',
|
|
96
|
+
duration: 12000,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return {
|
|
101
|
+
'command.execute.before': async (input) => {
|
|
102
|
+
const mode = WF_COMMANDS.get(commandName(input.command));
|
|
103
|
+
if (!mode) return;
|
|
104
|
+
writeMode(root, mode, input.sessionID);
|
|
105
|
+
await showToast(client, root, {
|
|
106
|
+
title: 'Harness',
|
|
107
|
+
message: `${mode} mode on`,
|
|
108
|
+
variant: 'info',
|
|
109
|
+
duration: 8000,
|
|
110
|
+
});
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
event: async ({ event }) => {
|
|
114
|
+
if (event.type !== 'session.idle') return;
|
|
115
|
+
const mode = readMode(root);
|
|
116
|
+
if (!mode?.active) return;
|
|
117
|
+
clearMode(root);
|
|
118
|
+
await showToast(client, root, {
|
|
119
|
+
title: 'Harness',
|
|
120
|
+
message: `${mode.mode} mode cleared`,
|
|
121
|
+
variant: 'success',
|
|
122
|
+
duration: 5000,
|
|
123
|
+
});
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
};
|
|
@@ -1,32 +1,5 @@
|
|
|
1
1
|
# AGENTS.md
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Codex compatibility entry. Do not put workflow rules, role rules, command tables, or Harness routing here.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Read `CLAUDE.md` first, then `Harness/MEMORY.md`, then `Harness/README.md`.
|
|
8
|
-
Do not bulk-read `Harness/`. Let `Harness/README.md#Load By Task` route you.
|
|
9
|
-
|
|
10
|
-
## WF-MAX Role Contract (READ FIRST)
|
|
11
|
-
|
|
12
|
-
`/wf-max` activates WF-MAX global mode. Top-level orchestrator is **CEO** - reads, plans, dispatches. Delegated Workers follow dispatch packet (writeSet, forbidden, verification). **Global mode != every agent is CEO.**
|
|
13
|
-
Closeout still requires reviewer cross-review, verifier evidence, and reflector PASS before final acceptance.
|
|
14
|
-
|
|
15
|
-
| ALLOWED (W0 CEO) | FORBIDDEN (always on source) |
|
|
16
|
-
|---|---|
|
|
17
|
-
| Read Harness docs, CLAUDE.md | Edit / Write / MultiEdit |
|
|
18
|
-
| Grep/Glob for scoping | Bash (except `ls`/`dir`/`tree`/`git`) |
|
|
19
|
-
| Agent spawn (ONE message) | Deep source reads -> delegate to Worker |
|
|
20
|
-
| Write PLAN.md / PROGRESS.md | Sequential spawn (AP6) |
|
|
21
|
-
|
|
22
|
-
**Tempted to edit source? STOP. Spawn a Worker with explicit writeSet.**
|
|
23
|
-
|
|
24
|
-
## Key Commands
|
|
25
|
-
|
|
26
|
-
| Command | Purpose |
|
|
27
|
-
|---------|---------|
|
|
28
|
-
| `/wf-help` | Direct help table for all Harness WF commands |
|
|
29
|
-
| `/wf-max [task]` | WF strict superset: complete role chain plus maximum parallelism (CEO -> Manager -> Worker, current runtime subagents first, cross-CLI overflow) |
|
|
30
|
-
| `/wf-review [focus]` | Cross-model peer review (use OTHER CLI) |
|
|
31
|
-
| `/wf <task>` | Standard workflow mode |
|
|
32
|
-
| `/wf-auto` | Perpetual auto-optimization |
|
|
5
|
+
Read `CLAUDE.md` and follow it as the single source of startup, routing, workflow, and safety instructions. If this file conflicts with `CLAUDE.md`, `CLAUDE.md` wins.
|
|
@@ -1,18 +1,40 @@
|
|
|
1
1
|
# CLAUDE.md
|
|
2
2
|
|
|
3
|
+
This repository dogfoods the generated Harness scaffold. Scaffold source files live under `templates/common/` and `templates/optional/`; generated dogfood runtime files live under root `Harness/` and `.claude/`.
|
|
4
|
+
|
|
3
5
|
## 1. Harness Binding & Startup
|
|
4
6
|
|
|
5
7
|
If `Harness/` exists, this repository is governed by the Harness contract.
|
|
6
8
|
|
|
9
|
+
At session start, after loading `CLAUDE.md`, read `Harness/memory/startup-hints.md` (L2 lightweight digest, 5-10 hints). This is NOT loading `Harness/MEMORY.md`, `Harness/README.md`, or PROGRESS — it is a minimal startup hint file only.
|
|
10
|
+
|
|
7
11
|
Use **direct mode** for simple, single-step, low-risk requests: commit, push, one-line fix, file read, code question, git log, git status, or similar small operations.
|
|
8
12
|
|
|
9
13
|
In direct mode, do not load the full Harness router. Inspect only the files needed for the task and execute directly.
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+
Complex work may use direct planning, task capsules, tests, and subagents without entering WF. WF mode is explicit only: the user must type `/wf`, `$wf`, `/skills wf`, `/wf-max`, `$wf-max`, `/skills wf-max`, `/wf-auto`, `$wf-auto`, `/skills wf-auto`, `/wf-auto-spark`, `$wf-auto-spark`, or `/skills wf-auto-spark` to enter WF. No other phrasing, complexity heuristic, or inferred intent triggers WF.
|
|
16
|
+
|
|
17
|
+
`/wf-help` and `/wf-update` are **direct commands** — do NOT load `Harness/MEMORY.md`, do NOT enter WF, do NOT invoke a skill. Execute them immediately as static help / script commands respectively.
|
|
18
|
+
|
|
19
|
+
For actual workflow commands (`/wf`, `/wf-max`, `/wf-auto`, `/wf-review`, `/wf-learn`, `/wf-readme`, `/wf-remove`, `/wf-browser`, `/wf-auto-spark`), load `Harness/MEMORY.md` first, then `Harness/README.md`.
|
|
20
|
+
|
|
21
|
+
### Active Task Resume
|
|
22
|
+
|
|
23
|
+
If the user says "continue", "resume", "last task", "current task", "status", "where were we", or similar resume language, or the current work is not a simple direct task:
|
|
12
24
|
|
|
13
|
-
|
|
25
|
+
1. Read `Harness/PROGRESS.md` → find Active Task.
|
|
26
|
+
2. If Active Task exists, read `Harness/tasks/<active-task>/STATE.json` first.
|
|
27
|
+
3. Read `Harness/tasks/<active-task>/PROGRESS.md`.
|
|
28
|
+
4. Read `Harness/tasks/<active-task>/PLAN.md` only if decisions or scope need review.
|
|
29
|
+
5. From STATE.json, recover: phase, gate, tier, ready/running/blocked/done queues, activeQuestion, nextAction.
|
|
30
|
+
6. Do NOT bulk-read `Harness/tasks/` to find context. Use the active pointer.
|
|
31
|
+
7. Direct simple tasks may skip STATE/PLAN/PROGRESS unless the user says "continue"/"resume".
|
|
14
32
|
|
|
15
|
-
|
|
33
|
+
See `Harness/WF-STATE.md` for the full state machine contract. Completed/abandoned tasks are archived to `Harness/tasks/_archive/` per `Harness/TASK_ARCHIVE.md`.
|
|
34
|
+
|
|
35
|
+
Use **/wf** for multi-step work that needs structured coordination. Use **/wf-max** for maximum-parallelism with CEO/Manager/Worker decomposition. See `Harness/WF.md` for tier selection (WF-Light, WF-Standard, WF-Full) and `Harness/WF-MAX.md` for fan-out rules (WF-Max-Useful, WF-Max-Strict).
|
|
36
|
+
|
|
37
|
+
`Harness/SETUP.md` is a bootstrap-only document: it exists only while the harness install is not yet finalized. If it exists, finish the bootstrap it describes once, then delete or archive it. Installed projects must not keep `Harness/SETUP.md` in the startup path, and normal sessions must not route through it.
|
|
16
38
|
|
|
17
39
|
### 1a. WF-MAX Role Contract
|
|
18
40
|
|
|
@@ -26,7 +48,7 @@ Each Worker dispatch must define: role, objective, allowed writeSet, forbidden f
|
|
|
26
48
|
|
|
27
49
|
Workers may edit only inside their assigned writeSet. Reviewers and verifiers must be independent from the Worker whose output they evaluate.
|
|
28
50
|
|
|
29
|
-
Detailed WF-MAX role rules live in `Harness/WF-MAX.md
|
|
51
|
+
Detailed WF-MAX role rules live in `Harness/WF-KERNEL.md`, `Harness/WF-MAX.md`, and `Harness/subagents.md`.
|
|
30
52
|
|
|
31
53
|
## 2. Think Before Coding
|
|
32
54
|
|
|
@@ -58,14 +80,21 @@ Detailed WF-MAX role rules live in `Harness/WF-MAX.md` and `Harness/subagents.md
|
|
|
58
80
|
|
|
59
81
|
- Define verifiable success criteria before implementation.
|
|
60
82
|
- For bugs, reproduce the failure or document why reproduction is impossible before fixing.
|
|
61
|
-
- For multi-step work, keep `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md` current.
|
|
62
|
-
- State assumptions before implementation and record durable assumptions, decisions, blockers, handoffs, and verification evidence in `Harness/tasks/<task-id>/PLAN.md`.
|
|
83
|
+
- For multi-step work, keep `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md` current. Only the controller or task-scribe writes task state; subagents return suggestions only.
|
|
84
|
+
- State assumptions before implementation and record only durable assumptions, decisions, blockers, handoffs, and verification evidence in `Harness/tasks/<task-id>/PLAN.md`.
|
|
63
85
|
- Every task needs a test, build check, validator run, or recorded manual check.
|
|
64
86
|
- Do not claim web/UI acceptance without real-browser evidence from Chrome DevTools, CDP, Playwright, or documented manual browser checks.
|
|
65
87
|
- Do not place project build scripts, git conventions, run commands, or release process in this file. Put them in `README.md`.
|
|
66
88
|
- Do not place code architecture here. Put architecture in `Harness/architecture.md` or the current feature doc.
|
|
67
89
|
- If this file has accumulated unrelated project notes, pause and propose moving them to the right place: `README.md` for development operations, `Harness/architecture.md` for architecture, `Harness/WF.md` or `Harness/workflows/` for workflow rules.
|
|
68
90
|
|
|
91
|
+
## 5a. Low-Noise Progress
|
|
92
|
+
|
|
93
|
+
- Keep intermediate user updates to 1-2 short sentences.
|
|
94
|
+
- Do not recap the plan, paste logs, or narrate obvious file reads between steps.
|
|
95
|
+
- Save full detail for the final response: changed files, verification results, risks, and commit hash when relevant.
|
|
96
|
+
- For long-running work, report only meaningful phase changes, blockers, failed commands, or user decisions needed.
|
|
97
|
+
|
|
69
98
|
## 6. Memory & Self-Learning
|
|
70
99
|
|
|
71
100
|
`Harness/MEMORY.md` is the memory and resource router. Detailed durable memory lives under `Harness/memory/`.
|
|
@@ -27,8 +27,8 @@ Mode differences are organizational only:
|
|
|
27
27
|
|
|
28
28
|
| Mode | Organization | Same Acceptance Flow |
|
|
29
29
|
| --- | --- | --- |
|
|
30
|
-
| `/wf` / `$wf` |
|
|
31
|
-
| `/wf-max` / `$wf-max` |
|
|
30
|
+
| `/wf` / `$wf` | WF-KERNEL tier selection (WF-Light / WF-Standard / WF-Full); WF-Full uses the complete role chain | yes |
|
|
31
|
+
| `/wf-max` / `$wf-max` | WF kernel plus CEO -> Manager -> Worker fan-out; WF-Max-Useful by default, WF-Max-Strict only on explicit strict request | yes |
|
|
32
32
|
| `/wf-auto` / `$wf-auto` | Repeating optimization loop | yes, per cycle |
|
|
33
33
|
|
|
34
34
|
## Gates
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# MEMORY.md - create-harness-vibe-coding Project Resource Index
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> `CLAUDE.md` is the session entry router; `Harness/README.md` is the Harness documentation index. This file persists cross-session context: resource index, user preferences, tool usage standards.
|
|
4
4
|
> Detailed memory lives in `Harness/memory/`. Keep entries short, newest first, and free of secrets.
|
|
5
5
|
|
|
6
6
|
## Agents (Sub-agents)
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
- [reviewer](../.claude/agents/reviewer.md) - read-only spec/AC and code/architecture/test review.
|
|
17
17
|
- [verifier](../.claude/agents/verifier.md) - verification commands and AC evidence matrix.
|
|
18
18
|
- [reflector](../.claude/agents/reflector.md) - closeout synthesis, contradiction check, and final acceptance gate verdict.
|
|
19
|
+
- [task-scribe](../.claude/agents/task-scribe.md) - task state, heartbeat, dispatch ledger, evidence pointers — small-fast chore agent.
|
|
20
|
+
- [codebase-explorer](../.claude/agents/codebase-explorer.md) - scoped read-only source exploration, file discovery, symbol tracing — small-fast.
|
|
19
21
|
- [memory-master](../.claude/agents/memory-master.md) - memory writing, dedup, consolidation, and cross-project knowledge extraction.
|
|
20
22
|
- [context-master](../.claude/agents/context-master.md) - context analysis, compression alerts, and session knowledge extraction for memory-master.
|
|
21
23
|
- [explore-manager](../.claude/agents/explore-manager.md) - WF-MAX W0 exploration: spawn 5-10 read-only researchers, synthesize, report to CEO.
|
|
@@ -27,14 +29,14 @@ Stack-specific agents can be added after the product shape is known.
|
|
|
27
29
|
|
|
28
30
|
## Skills (Workflows)
|
|
29
31
|
|
|
30
|
-
- [WF Mode](WF.md) -
|
|
32
|
+
- [WF Mode](WF.md) - WF-KERNEL tiered orchestration: WF-Light (minimal roles), WF-Standard (adds review), WF-Full (complete role chain incl. reflector and cross-review).
|
|
31
33
|
- [wf](../.claude/skills/wf/SKILL.md) - Claude Code WF skill command; mirrored for Codex at `../.agents/skills/wf/SKILL.md`.
|
|
32
34
|
- [subagent-orchestrator](../.claude/skills/subagent-orchestrator/SKILL.md) - controller-led subagent orchestration, parallel read-only passes, review gates, and recovery handoffs.
|
|
33
35
|
- [wf-readme](../.claude/skills/wf-readme/SKILL.md) - README preservation, append-only development sections, structured tables, and approved architecture diagrams.
|
|
34
|
-
- [wf-review](../.claude/skills/wf-review/SKILL.md) -
|
|
36
|
+
- [wf-review](../.claude/skills/wf-review/SKILL.md) - peer review: prefer another agent CLI (Claude/Codex/OpenCode); otherwise use the installed reviewer role as an independent subagent context. Controller decides.
|
|
35
37
|
- [wf-update](../.claude/skills/wf-update/SKILL.md) - GitHub-based incremental harness update, checksum comparison, and safe in-place updates.
|
|
36
38
|
- [wf-learn](../.claude/skills/wf-learn/SKILL.md) - force memory learning cycle: context-master -> memory-master -> project + global memory.
|
|
37
|
-
- [wf-max](../.claude/skills/wf-max/SKILL.md) - WF
|
|
39
|
+
- [wf-max](../.claude/skills/wf-max/SKILL.md) - WF kernel + maximum safe fan-out: WF-Max-Useful by default (fan out only where independent), WF-Max-Strict only on explicit strict request; current runtime subagents first, peer-CLI overflow when available.
|
|
38
40
|
- [wf-auto](../.claude/skills/wf-auto/SKILL.md) - perpetual adaptive auto-optimization: evidence-selected probes, dynamic obligations, intent checkpoints, evidence ledger.
|
|
39
41
|
- [wf-auto-spark](../.claude/skills/wf-auto-spark/SKILL.md) - perpetual inspiration mode: external spark search, long-term roadmap with staged milestones, <=50% deviation guard.
|
|
40
42
|
- [tdd](../.claude/skills/tdd/SKILL.md) - acceptance-driven TDD: AC-linked RED tests, real UI clicks for browser-visible behavior, Playwright/CDP evidence, and configured coverage gate.
|
|
@@ -48,6 +50,8 @@ Codex repo-skill mirrors live under `../.agents/skills/` with the same skill nam
|
|
|
48
50
|
|
|
49
51
|
Stack-specific skills can be added after the product shape is known.
|
|
50
52
|
|
|
53
|
+
- [browser-e2e](workflows/browser-e2e.md)
|
|
54
|
+
|
|
51
55
|
## Rules (Harness Constraints)
|
|
52
56
|
|
|
53
57
|
Located under `.claude/rules/ecc/`, auto-loaded by the CC engine:
|
|
@@ -65,6 +69,9 @@ Located under `.claude/rules/ecc/`, auto-loaded by the CC engine:
|
|
|
65
69
|
- [Memory protocol](MEMORY_PROTOCOL.md)
|
|
66
70
|
- [WF mode](WF.md)
|
|
67
71
|
- [WF Max mode](WF-MAX.md)
|
|
72
|
+
- [WF kernel contract](WF-KERNEL.md)
|
|
73
|
+
- [WF state machine / resume](WF-STATE.md)
|
|
74
|
+
- [Task archive mechanism](TASK_ARCHIVE.md)
|
|
68
75
|
- [0-1 lifecycle](lifecycle.md)
|
|
69
76
|
- [Research protocol](research/README.md)
|
|
70
77
|
- [Context loading protocol](context-loading.md)
|
|
@@ -79,6 +86,12 @@ Located under `.claude/rules/ecc/`, auto-loaded by the CC engine:
|
|
|
79
86
|
|
|
80
87
|
## Memory Folder
|
|
81
88
|
|
|
89
|
+
> L2 startup digest: `memory/startup-hints.md` — lightweight hints loaded at session start.
|
|
90
|
+
> L3 route index: `memory/routes.md` — scenario hit-rules index (not detailed memory).
|
|
91
|
+
> L3 detailed files: loaded only when scenario matches via routes.
|
|
92
|
+
|
|
93
|
+
- [Startup hints](memory/startup-hints.md) - L2 lightweight startup digest (5-10 hints, no dates). Loaded at Harness session start; not a replacement for full router.
|
|
94
|
+
- [Memory routes](memory/routes.md) - L3 route index with signals/scoring/avoid rules. Not detailed memory — hit-rules only.
|
|
82
95
|
- [Tool usage/reflections](memory/tool-usage-reflections.md) - repeated tool failures, better command patterns, environment-specific fixes.
|
|
83
96
|
- [User corrections/preferences](memory/user-corrections-preferences.md) - repeated user corrections, durable preferences, common-sense course corrections.
|
|
84
97
|
- [Agent lessons/patterns](memory/agent-lessons-patterns.md) - reusable lessons from review, debugging, validation, and handoff loops.
|