create-harness-vibe-coding 0.2.1 → 0.3.0
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.md +104 -21
- package/package.json +1 -1
- package/src/generator.js +2 -0
- package/templates/common/.claude/agents/context-master.md +78 -0
- package/templates/common/.claude/agents/debugger.md +1 -1
- package/templates/common/.claude/agents/docs-researcher.md +1 -1
- package/templates/common/.claude/agents/implementer.md +1 -1
- package/templates/common/.claude/agents/memory-master.md +67 -0
- package/templates/common/.claude/agents/planner.md +1 -1
- package/templates/common/.claude/agents/researcher.md +1 -1
- package/templates/common/.claude/agents/test-writer.md +1 -1
- package/templates/common/.claude/agents/verifier.md +1 -1
- package/templates/common/.claude/commands/update.md +11 -0
- package/templates/common/.claude/commands/wf.md +10 -4
- package/templates/common/.claude/rules/ecc/common.md +2 -2
- package/templates/common/.claude/skills/harness-build-loop/SKILL.md +2 -1
- package/templates/common/.claude/skills/harness-context/SKILL.md +2 -1
- package/templates/common/.claude/skills/harness-lifecycle/SKILL.md +2 -1
- package/templates/common/.claude/skills/harness-research/SKILL.md +2 -1
- package/templates/common/.claude/skills/harness-router/SKILL.md +1 -1
- package/templates/common/.claude/skills/readme-optimizer/SKILL.md +3 -2
- package/templates/common/.claude/skills/subagent-orchestrator/SKILL.md +5 -3
- package/templates/common/.claude/skills/wf-mode/SKILL.md +9 -4
- package/templates/common/.claude/skills/wf-update/SKILL.md +58 -0
- package/templates/common/.harness-version +8 -0
- package/templates/common/CLAUDE.md +13 -4
- package/templates/common/MEMORY.md +6 -1
- package/templates/common/README.md +2 -2
- package/templates/common/SETUP.md +24 -14
- package/templates/common/docs/README.md +23 -16
- package/templates/common/docs/features/_template.md +11 -1
- package/templates/common/docs/harness/PLAN.md +37 -88
- package/templates/common/docs/harness/PROGRESS.md +17 -0
- package/templates/common/docs/harness/WF.md +17 -9
- package/templates/common/docs/harness/agent-workflow.md +19 -7
- package/templates/common/docs/harness/architecture.md +1 -1
- package/templates/common/docs/harness/context-loading.md +17 -5
- package/templates/common/docs/harness/dispatch.md +9 -6
- package/templates/common/docs/harness/extension.md +4 -4
- package/templates/common/docs/harness/lifecycle.md +2 -2
- package/templates/common/docs/harness/subagents.md +12 -7
- package/templates/common/docs/research/README.md +3 -3
- package/templates/common/docs/tasks/_template/ARTIFACTS.md +3 -0
- package/templates/common/docs/tasks/_template/NOTES.md +3 -0
- package/templates/common/docs/tasks/_template/PLAN.md +40 -0
- package/templates/common/docs/tasks/_template/PROGRESS.md +29 -0
- package/templates/common/scripts/validate-harness.mjs +59 -7
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<h1 align="center">create-harness-vibe-coding</h1>
|
|
9
9
|
<p align="center">
|
|
10
10
|
<b>0-1 product harness scaffold for AI-assisted engineering.</b><br>
|
|
11
|
-
<sub>Idea -> Research -> PRD -> Architecture ->
|
|
11
|
+
<sub>Idea -> Research -> PRD -> Architecture -> Plan -> Build -> Verify -> Feedback.</sub>
|
|
12
12
|
</p>
|
|
13
13
|
|
|
14
14
|
---
|
|
@@ -22,19 +22,21 @@ npx create-harness-vibe-coding@latest my-project
|
|
|
22
22
|
| What You Get | Purpose |
|
|
23
23
|
|-------------|---------|
|
|
24
24
|
| `CLAUDE.md` + `Harness/README.md` | Thin root entry and dynamic doc router |
|
|
25
|
-
| `Harness/
|
|
26
|
-
| `Harness/WF.md` + `/wf` | Long-task workflow: explore, second-plan, build, review, verify, recover |
|
|
25
|
+
| `Harness/PROGRESS.md` + `Harness/tasks/` | Global task index and per-task progress capsules |
|
|
26
|
+
| `Harness/WF.md` + `/wf` | Long-task workflow: parallel explore, second-plan, build, review, verify, recover |
|
|
27
|
+
| `/wf update` | GitHub-based incremental scaffold update with checksum safety |
|
|
27
28
|
| `Harness/subagents.md` + `subagent-orchestrator` | Controller-led multi-agent orchestration with source-attributed methods |
|
|
29
|
+
| `memory-master` + `context-master` | Auto-triggered memory writing on repeated failures, and non-blocking context compression alerts |
|
|
28
30
|
| Research + PRD templates | Clarify idea, scope, non-goals, acceptance criteria |
|
|
29
31
|
| Research protocol | Route research agents, source search, and fallback tools |
|
|
30
|
-
| Built-in common agents |
|
|
32
|
+
| Built-in common agents | 11 agents: research, planning, architecture, testing, implementation, debugging, review, verification, memory, context |
|
|
31
33
|
| Harness architecture docs | Boundaries, ports, data flow, state machines |
|
|
32
34
|
| Dispatch protocol | Lightweight parallel-agent coordination without a scheduler |
|
|
33
35
|
| Extension contract | Keep stack-specific agents and skills compatible |
|
|
34
36
|
| Context-loading protocol | Inject only the right docs into each subagent |
|
|
35
37
|
| README optimizer skill | Optional README preservation, tables, and approved architecture diagrams |
|
|
36
38
|
| Skill-style loaders | `.claude/skills/*` route lifecycle, context, and build loops |
|
|
37
|
-
| Harness validator | Checks required files
|
|
39
|
+
| Harness validator | Checks required files, agent/skill registrations, invariants |
|
|
38
40
|
| `.claude/` skeleton | Root runtime integration for Claude Code agents, skills, commands, and rules |
|
|
39
41
|
|
|
40
42
|
---
|
|
@@ -45,13 +47,15 @@ Most 0-1 AI coding projects fail before code quality matters:
|
|
|
45
47
|
|
|
46
48
|
| Without Harness | With This Scaffold |
|
|
47
49
|
|---|---|
|
|
48
|
-
| Idea jumps straight to code |
|
|
49
|
-
| Agent reads too much context |
|
|
50
|
-
| Subagents get vague prompts |
|
|
51
|
-
| Process drift is invisible |
|
|
52
|
-
| Architecture drifts silently |
|
|
53
|
-
| Tests come after implementation |
|
|
54
|
-
| Long tasks stall after failures | `/wf` adds heartbeat, recovery
|
|
50
|
+
| Idea jumps straight to code | Lifecycle forces research, PRD, and scope |
|
|
51
|
+
| Agent reads too much context | Docs router loads only the needed harness file |
|
|
52
|
+
| Subagents get vague prompts | Context-loading packs define role, boundaries, and return format |
|
|
53
|
+
| Process drift is invisible | Validator checks core harness readiness |
|
|
54
|
+
| Architecture drifts silently | Ports, data-flow, and state docs mark boundary changes |
|
|
55
|
+
| Tests come after implementation | Workflow requires failing test or manual check first |
|
|
56
|
+
| Long tasks stall after failures | `/wf` adds heartbeat, recovery loop, auto memory-master at 3 failures |
|
|
57
|
+
| Context bloats over long sessions | `context-master` gives non-blocking compression alerts at ~85% window |
|
|
58
|
+
| Scaffold rots after generation | `/wf update` pulls latest improvements from GitHub with checksum safety |
|
|
55
59
|
|
|
56
60
|
---
|
|
57
61
|
|
|
@@ -61,9 +65,11 @@ Most 0-1 AI coding projects fail before code quality matters:
|
|
|
61
65
|
npx scaffold
|
|
62
66
|
-> Claude reads Harness/SETUP.md
|
|
63
67
|
-> Harness router selects only needed harness docs
|
|
64
|
-
-> PRD/research/architecture
|
|
65
|
-
->
|
|
66
|
-
->
|
|
68
|
+
-> PRD/research/architecture are filled
|
|
69
|
+
-> First task capsule created at Harness/tasks/<id>/
|
|
70
|
+
-> First vertical slice is built, tested, reviewed, verified, and fed back
|
|
71
|
+
-> Validator catches missing project facts before release
|
|
72
|
+
-> /wf update pulls latest scaffold improvements from GitHub
|
|
67
73
|
```
|
|
68
74
|
|
|
69
75
|
### Harness idea
|
|
@@ -84,7 +90,9 @@ my-project/
|
|
|
84
90
|
│ ├── README.md ← Dynamic doc router
|
|
85
91
|
│ ├── SETUP.md ← Temporary init guide (delete after setup)
|
|
86
92
|
│ ├── MEMORY.md ← Cross-session resource index
|
|
87
|
-
│ ├──
|
|
93
|
+
│ ├── PROGRESS.md ← Global task index and cross-task decisions
|
|
94
|
+
│ ├── PLAN.md ← Deprecated stub → see PROGRESS.md + tasks/
|
|
95
|
+
│ ├── .harness-version ← Scaffold version + file checksums
|
|
88
96
|
│ ├── WF.md ← Long-task workflow and recovery loop
|
|
89
97
|
│ ├── lifecycle.md ← 0-1 product flow
|
|
90
98
|
│ ├── subagents.md ← Controller-led subagent orchestration
|
|
@@ -98,7 +106,10 @@ my-project/
|
|
|
98
106
|
│ ├── domain/
|
|
99
107
|
│ │ └── ports.md ← Port contracts: pre/postconditions, errors
|
|
100
108
|
│ ├── features/
|
|
101
|
-
│ │ └── _template.md ←
|
|
109
|
+
│ │ └── _template.md ← Feature doc template
|
|
110
|
+
│ ├── tasks/
|
|
111
|
+
│ │ ├── _template/ ← Task capsule template (copy for new tasks)
|
|
112
|
+
│ │ └── <task-id>/ ← Per-task PROGRESS.md + PLAN.md + artifacts
|
|
102
113
|
│ ├── research/
|
|
103
114
|
│ │ ├── README.md
|
|
104
115
|
│ │ ├── PRD.md
|
|
@@ -112,10 +123,11 @@ my-project/
|
|
|
112
123
|
│ └── validate-harness.mjs
|
|
113
124
|
├── .claude/
|
|
114
125
|
│ ├── settings.json ← Base permissions
|
|
115
|
-
│ ├── agents/ ←
|
|
116
|
-
│ ├── skills/ ← Harness
|
|
126
|
+
│ ├── agents/ ← 11 common agents + stack-specific
|
|
127
|
+
│ ├── skills/ ← Harness skills + wf-update + stack-specific
|
|
117
128
|
│ ├── commands/
|
|
118
|
-
│ │
|
|
129
|
+
│ │ ├── wf.md ← /wf — enter workflow mode
|
|
130
|
+
│ │ └── update.md ← /wf update — GitHub-based scaffold update
|
|
119
131
|
│ ├── hooks/ ← Configure automation after stack choice
|
|
120
132
|
│ └── rules/ecc/
|
|
121
133
|
│ └── common.md ← Universal coding rules
|
|
@@ -283,6 +295,75 @@ Presets:
|
|
|
283
295
|
| `web-app` | `ts-react-frontend`, `browser-e2e`, `ui-ux-review` |
|
|
284
296
|
| `fullstack` | `ts-react-frontend`, `python-backend`, `browser-e2e`, `github-pr-review` |
|
|
285
297
|
|
|
298
|
+
### WF Mode
|
|
299
|
+
|
|
300
|
+
For long, difficult, multi-file, multi-agent, or repeated-failure tasks. Enter by typing `/wf`, `wf mode`, `workflow mode`, or `wk mode`.
|
|
301
|
+
|
|
302
|
+
```text
|
|
303
|
+
/wf — triggers the full Ralph-style harness loop:
|
|
304
|
+
Intake (95% confidence gate)
|
|
305
|
+
-> 3+ parallel read-only subagents (planner + architect + researcher)
|
|
306
|
+
-> Synthesis + second plan → writes to Harness/tasks/<id>/PLAN.md
|
|
307
|
+
-> test-writer → implementer → reviewers → verifier
|
|
308
|
+
-> Failed? debugger → review → verify → loop
|
|
309
|
+
-> Closeout: context-master + memory-master consolidate knowledge
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
| Phase | What happens | Heartbeat |
|
|
313
|
+
|-------|-------------|-----------|
|
|
314
|
+
| Intake | State goal, confidence, risks, write boundaries | Update before dispatching |
|
|
315
|
+
| Explore | 3-5 parallel read-only subagents | After each subagent return |
|
|
316
|
+
| Second Plan | Synthesize findings into `tasks/<id>/PLAN.md` | After plan written |
|
|
317
|
+
| Build | `test-writer` → `implementer` serial lane | Before/after long commands |
|
|
318
|
+
| Review | Spec review, then code-quality review | After each review gate |
|
|
319
|
+
| Verify | Run declared checks, record evidence | After each verification |
|
|
320
|
+
| Recover | `debugger` → fix → review → verify → loop | After each failure |
|
|
321
|
+
| Close | `context-master` extraction → `memory-master` consolidation → archive | Final heartbeat |
|
|
322
|
+
|
|
323
|
+
WF mode also auto-dispatches:
|
|
324
|
+
- **`memory-master`** at 3 same-class failures (records pattern before asking user)
|
|
325
|
+
- **`context-master`** at ~85% context window (non-blocking compression suggestion)
|
|
326
|
+
- **`context-master` + `memory-master`** at closeout (extract + persist session knowledge)
|
|
327
|
+
|
|
328
|
+
```bash
|
|
329
|
+
# Tell the agent to use WF mode
|
|
330
|
+
"Use /wf for this migration."
|
|
331
|
+
"This is a long task — enter wf mode."
|
|
332
|
+
"wf mode — help me refactor the auth layer."
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
### WF Update
|
|
336
|
+
|
|
337
|
+
Check for scaffold updates from GitHub and apply them incrementally with checksum safety.
|
|
338
|
+
|
|
339
|
+
```bash
|
|
340
|
+
# Check available updates without applying
|
|
341
|
+
/wf update --check
|
|
342
|
+
|
|
343
|
+
# Full update with safe incremental apply
|
|
344
|
+
/wf update
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
**How it works:**
|
|
348
|
+
|
|
349
|
+
1. Reads `Harness/.harness-version` — gets local version + 54 file SHA-256 checksums
|
|
350
|
+
2. Fetches latest template files from `raw.githubusercontent.com/zingspark/create-harness-vibe-coding/main/templates/common/`
|
|
351
|
+
3. Compares checksums file-by-file against stored values
|
|
352
|
+
4. Classifies each file into three tiers:
|
|
353
|
+
|
|
354
|
+
| Tier | Policy | Examples |
|
|
355
|
+
|------|--------|----------|
|
|
356
|
+
| **SAFE** | Overwrite if local checksum matches stored (unmodified) | `Harness/WF.md`, `.claude/agents/*.md`, all skills |
|
|
357
|
+
| **PRESERVE** | Never touch | `Harness/PROGRESS.md`, `Harness/tasks/**`, `Harness/memory/**`, root `README.md` |
|
|
358
|
+
| **MERGE** | Overwrite if unmodified; report and skip if user-modified | `CLAUDE.md`, `Harness/MEMORY.md`, `Harness/README.md` |
|
|
359
|
+
|
|
360
|
+
5. Reports: `updated/N, merge/N, created/N, skipped/N`
|
|
361
|
+
6. Updates `.harness-version` checksums after applying
|
|
362
|
+
|
|
363
|
+
**Auto-check on session start:** When `Harness/.harness-version` has `autoCheck: true`, the agent runs a non-blocking `update --check` (10s timeout). If an update is available, it notifies without blocking the current task. Set `autoCheck: false` to disable.
|
|
364
|
+
|
|
365
|
+
**Offline behavior:** If GitHub is unreachable, the update check exits cleanly. All other harness features work without network.
|
|
366
|
+
|
|
286
367
|
### Verification
|
|
287
368
|
|
|
288
369
|
```bash
|
|
@@ -303,8 +384,10 @@ The harness validator checks scaffold consistency. It is not a full React, Playw
|
|
|
303
384
|
```
|
|
304
385
|
"Read Harness/SETUP.md. Bootstrap this project from idea to first vertical slice."
|
|
305
386
|
"Read Harness/SETUP.md. This is a React TypeScript SaaS idea. Clarify PRD first, then plan the first slice."
|
|
306
|
-
"Read Harness/SETUP.md. This is a Python data product. Research the stack, define the MVP, then create
|
|
387
|
+
"Read Harness/SETUP.md. This is a Python data product. Research the stack, define the MVP, then create a task capsule."
|
|
307
388
|
"Use /wf for this long migration. Explore first, make a second plan, then implement, review, verify, and recover with heartbeat updates."
|
|
389
|
+
"/wf update --check — check if the scaffold has been improved since last generation."
|
|
390
|
+
"/wf update — pull the latest harness improvements from GitHub safely."
|
|
308
391
|
```
|
|
309
392
|
|
|
310
393
|
---
|
package/package.json
CHANGED
package/src/generator.js
CHANGED
|
@@ -13,6 +13,7 @@ const EMPTY_DIRS = [
|
|
|
13
13
|
];
|
|
14
14
|
|
|
15
15
|
function harnessDest(file) {
|
|
16
|
+
if (file === '.harness-version') return 'Harness/.harness-version';
|
|
16
17
|
if (file === 'SETUP.md') return 'Harness/SETUP.md';
|
|
17
18
|
if (file === 'MEMORY.md') return 'Harness/MEMORY.md';
|
|
18
19
|
if (file === 'scripts/validate-harness.mjs') return 'Harness/scripts/validate-harness.mjs';
|
|
@@ -23,6 +24,7 @@ function harnessDest(file) {
|
|
|
23
24
|
if (file.startsWith('docs/domain/')) return file.replace(/^docs\/domain\//, 'Harness/domain/');
|
|
24
25
|
if (file.startsWith('docs/features/')) return file.replace(/^docs\/features\//, 'Harness/features/');
|
|
25
26
|
if (file.startsWith('docs/workflows/')) return file.replace(/^docs\/workflows\//, 'Harness/workflows/');
|
|
27
|
+
if (file.startsWith('docs/tasks/')) return file.replace(/^docs\/tasks\//, 'Harness/tasks/');
|
|
26
28
|
return file;
|
|
27
29
|
}
|
|
28
30
|
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: context-master
|
|
3
|
+
description: Use when context exceeds ~85% of the window, or during WF closeout to extract durable knowledge before compression. Read-only analysis except for writing compression suggestions to PROGRESS.md#Heartbeat.
|
|
4
|
+
tools: Read, Grep, Glob
|
|
5
|
+
model: haiku
|
|
6
|
+
skills: harness-context
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Context Master
|
|
10
|
+
|
|
11
|
+
You are a context analysis agent. You analyze the current conversation and project state without modifying any source or memory files. Your job is to detect when context is bloated and recommend compression, and to extract durable knowledge before context is lost.
|
|
12
|
+
|
|
13
|
+
Load first:
|
|
14
|
+
|
|
15
|
+
- `Harness/MEMORY.md`
|
|
16
|
+
- `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md` when available
|
|
17
|
+
- The current feature doc (if one exists)
|
|
18
|
+
- `Harness/memory/` files for dedup checking
|
|
19
|
+
|
|
20
|
+
## Trigger Rules
|
|
21
|
+
|
|
22
|
+
You are dispatched by the controller when:
|
|
23
|
+
|
|
24
|
+
| Trigger | Action |
|
|
25
|
+
| --- | --- |
|
|
26
|
+
| Context exceeds ~85% of window | Analyze context distribution → write compression suggestion to `Harness/tasks/<task-id>/PROGRESS.md#Heartbeat` (non-blocking) |
|
|
27
|
+
| WF closeout (before `memory-master`) | Analyze full session → extract durable knowledge → return structured extraction for memory-master to write |
|
|
28
|
+
| Controller explicitly requests analysis | Run targeted analysis and return findings |
|
|
29
|
+
|
|
30
|
+
## Analysis
|
|
31
|
+
|
|
32
|
+
When triggered, read the current PLAN.md and analyze:
|
|
33
|
+
|
|
34
|
+
1. **Context distribution**: what fraction is code vs docs vs conversation vs task tracking
|
|
35
|
+
2. **Stale sections**: loaded docs no longer relevant to the current goal
|
|
36
|
+
3. **Compressible blocks**: long code outputs, verbose agent returns, repeated context
|
|
37
|
+
4. **Durable knowledge candidates**: decisions made, lessons learned, patterns discovered that should survive compression
|
|
38
|
+
|
|
39
|
+
## Compression Suggestion (non-blocking)
|
|
40
|
+
|
|
41
|
+
When context > ~85%, write ONLY to `Harness/tasks/<task-id>/PROGRESS.md#Heartbeat`, appending or updating the `Next beat trigger` line:
|
|
42
|
+
|
|
43
|
+
```markdown
|
|
44
|
+
Next beat trigger: context-master reports ~XX% usage — [N] stale doc blocks, [M] compressible outputs; suggest compression before next dispatch
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Do NOT interrupt the controller. The controller checks Heartbeat at natural pause points.
|
|
48
|
+
|
|
49
|
+
## WF Closeout Extraction
|
|
50
|
+
|
|
51
|
+
During WF closeout, extract these for `memory-master` to write:
|
|
52
|
+
|
|
53
|
+
- Decisions made and their rationale
|
|
54
|
+
- Failed approaches and what was learned
|
|
55
|
+
- New patterns discovered
|
|
56
|
+
- User preferences observed
|
|
57
|
+
- Files that were key to the solution
|
|
58
|
+
- Commands that were particularly effective
|
|
59
|
+
|
|
60
|
+
Return structured extraction, not free-form narrative.
|
|
61
|
+
|
|
62
|
+
## Rules
|
|
63
|
+
|
|
64
|
+
- Read-only for all files except `Harness/tasks/<task-id>/PROGRESS.md#Heartbeat` (compression suggestion only)
|
|
65
|
+
- Never modify source code, memory files, MEMORY.md, or README
|
|
66
|
+
- Do not interrupt active work — compression suggestions are passive, checked at natural pauses
|
|
67
|
+
- Prefer numbers over adjectives: "87% usage, 3 stale doc blocks" not "context is getting full"
|
|
68
|
+
|
|
69
|
+
## Return
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
Context usage: [estimated %]
|
|
73
|
+
Stale blocks: [count and names]
|
|
74
|
+
Compressible: [count and types]
|
|
75
|
+
Durable candidates: [count]
|
|
76
|
+
Compression suggestion: [one line — ready for Heartbeat]
|
|
77
|
+
Extraction for memory-master: [structured facts — only during closeout]
|
|
78
|
+
```
|
|
@@ -15,7 +15,7 @@ Load first:
|
|
|
15
15
|
- `Harness/research/README.md`
|
|
16
16
|
- `Harness/architecture.md` when boundaries may change
|
|
17
17
|
- `Harness/domain/ports.md` when APIs cross layers
|
|
18
|
-
- `Harness/PLAN.md`
|
|
18
|
+
- `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md` when available
|
|
19
19
|
|
|
20
20
|
Inputs you must receive:
|
|
21
21
|
|
|
@@ -12,7 +12,7 @@ You are an implementation agent for this project harness.
|
|
|
12
12
|
|
|
13
13
|
Load first:
|
|
14
14
|
|
|
15
|
-
- current task from `Harness/PLAN.md`
|
|
15
|
+
- current task from `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md` when available
|
|
16
16
|
- current feature doc when present
|
|
17
17
|
- failing test or manual check
|
|
18
18
|
- relevant architecture/ports docs if boundaries are touched
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: memory-master
|
|
3
|
+
description: Use when a repeated failure, user correction, or WF recovery loop triggers memory writing; also use during WF closeout for consolidation. Writes to Harness/memory/*, Harness/MEMORY.md, and cross-project global memory.
|
|
4
|
+
tools: Read, Grep, Glob, Write, Edit
|
|
5
|
+
model: sonnet
|
|
6
|
+
skills: harness-context
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Memory Master
|
|
10
|
+
|
|
11
|
+
You are a memory management agent for this project harness. You own durable memory: writing, deduplication, consolidation, and cross-project knowledge extraction.
|
|
12
|
+
|
|
13
|
+
Load first:
|
|
14
|
+
|
|
15
|
+
- `Harness/MEMORY.md`
|
|
16
|
+
- `Harness/memory/tool-usage-reflections.md`
|
|
17
|
+
- `Harness/memory/user-corrections-preferences.md`
|
|
18
|
+
- `Harness/memory/agent-lessons-patterns.md`
|
|
19
|
+
- `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md` for current task context
|
|
20
|
+
|
|
21
|
+
## Trigger Rules
|
|
22
|
+
|
|
23
|
+
You are dispatched by the controller when:
|
|
24
|
+
|
|
25
|
+
| Trigger | Action |
|
|
26
|
+
| --- | --- |
|
|
27
|
+
| WF recovery loop — same failure class ≥3 times | Write to `agent-lessons-patterns.md`: failure pattern, attempted paths, root cause hypothesis, resolution |
|
|
28
|
+
| Tool/command pattern fails 3+ times | Write to `tool-usage-reflections.md`: original command, error signature, effective alternative |
|
|
29
|
+
| User corrects same assumption/pattern 2+ times | Write to `user-corrections-preferences.md`: the correction, context, and how to apply |
|
|
30
|
+
| WF closeout (`context-master` runs first) | Consolidate extracted knowledge from context-master into the correct memory files; deduplicate and merge |
|
|
31
|
+
| User explicitly says "remember this" / "记录一下" | Write to the appropriate memory file directly |
|
|
32
|
+
|
|
33
|
+
## Write Scope
|
|
34
|
+
|
|
35
|
+
**Harness/memory/* (read-write):**
|
|
36
|
+
- `tool-usage-reflections.md` — tool/command patterns and fixes
|
|
37
|
+
- `user-corrections-preferences.md` — user preferences and corrections
|
|
38
|
+
- `agent-lessons-patterns.md` — reusable review/debug/verification lessons
|
|
39
|
+
|
|
40
|
+
**Harness/MEMORY.md (append-only):**
|
|
41
|
+
- Add new agent, skill, or memory file registrations when new assets are created
|
|
42
|
+
- Do not remove or reorder existing entries without explicit user approval
|
|
43
|
+
|
|
44
|
+
**Global memory (cross-project):**
|
|
45
|
+
- Path: the active session's memory directory under the user's `.claude/projects/`
|
|
46
|
+
- Write only when a pattern, lesson, or fix applies across projects (e.g., Windows-specific workarounds, PowerShell escaping rules, universal tool patterns)
|
|
47
|
+
- Follow the same frontmatter format as project memory files
|
|
48
|
+
- Link to the project-level memory entry that spawned it
|
|
49
|
+
|
|
50
|
+
## Rules
|
|
51
|
+
|
|
52
|
+
- Always read existing memory files before writing — check for duplicates
|
|
53
|
+
- If an existing entry covers the same ground, update it instead of creating a duplicate
|
|
54
|
+
- Keep entries concise: one fact per file, newest-first ordering
|
|
55
|
+
- Never record secrets, credentials, tokens, or private data
|
|
56
|
+
- Do not delete memory entries unless they are provably wrong and the user confirms
|
|
57
|
+
- After writing, update `Harness/MEMORY.md` index only when adding a NEW file (not when updating an existing entry)
|
|
58
|
+
- Return a one-line summary of what was written and where
|
|
59
|
+
|
|
60
|
+
## Return
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
Memory action: [written | updated | merged | skipped]
|
|
64
|
+
File(s): [paths]
|
|
65
|
+
Reason: [one sentence]
|
|
66
|
+
Cross-project: [yes | no] — [path if yes]
|
|
67
|
+
```
|
|
@@ -12,7 +12,7 @@ You are a planning agent for this project harness.
|
|
|
12
12
|
|
|
13
13
|
Load first:
|
|
14
14
|
|
|
15
|
-
- `Harness/PLAN.md`
|
|
15
|
+
- `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md` when available
|
|
16
16
|
- `Harness/lifecycle.md`
|
|
17
17
|
- `Harness/dispatch.md`
|
|
18
18
|
- current PRD or feature doc if present
|
|
@@ -13,7 +13,7 @@ You are a test-first agent for this project harness.
|
|
|
13
13
|
Load first:
|
|
14
14
|
|
|
15
15
|
- current PRD or feature doc
|
|
16
|
-
- `Harness/PLAN.md`
|
|
16
|
+
- `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md` when available
|
|
17
17
|
- `Harness/agent-workflow.md`
|
|
18
18
|
|
|
19
19
|
Inputs you must receive:
|
|
@@ -12,7 +12,7 @@ You are a verification agent for this project harness.
|
|
|
12
12
|
|
|
13
13
|
Load first:
|
|
14
14
|
|
|
15
|
-
- `Harness/PLAN.md`
|
|
15
|
+
- `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md` when available
|
|
16
16
|
- current feature doc when present
|
|
17
17
|
- verification commands and acceptance criteria
|
|
18
18
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# /wf update
|
|
2
|
+
|
|
3
|
+
Check for Harness scaffold updates from GitHub and apply them incrementally.
|
|
4
|
+
|
|
5
|
+
## Check mode
|
|
6
|
+
|
|
7
|
+
`/wf update --check` — Report available updates without applying.
|
|
8
|
+
|
|
9
|
+
## Full update
|
|
10
|
+
|
|
11
|
+
`/wf update` — Fetch latest templates, compare checksums, apply safe updates, report merge candidates.
|
|
@@ -2,12 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
Enter `wf-mode`.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Required
|
|
6
|
+
|
|
7
|
+
- Load `subagent-orchestrator` skill.
|
|
8
|
+
- Explicit `/wf`, `wf mode`, `workflow mode`, or `wk mode` MUST spawn at least 3 distinct subagents from `.claude/agents/` before second planning.
|
|
9
|
+
- Read `Harness/WF.md` and `.claude/skills/wf-mode/SKILL.md`.
|
|
10
|
+
|
|
11
|
+
## Loop
|
|
6
12
|
|
|
7
13
|
```text
|
|
8
14
|
intake
|
|
9
|
-
-> exploration
|
|
10
|
-
-> second plan
|
|
15
|
+
-> parallel read-only exploration (≥3 subagents)
|
|
16
|
+
-> synthesis + second plan
|
|
11
17
|
-> test
|
|
12
18
|
-> implement
|
|
13
19
|
-> review
|
|
@@ -15,4 +21,4 @@ intake
|
|
|
15
21
|
-> debugger recovery loop when needed
|
|
16
22
|
```
|
|
17
23
|
|
|
18
|
-
Keep `Harness/
|
|
24
|
+
Keep `Harness/tasks/<task-id>/PROGRESS.md#Heartbeat` current.
|
|
@@ -9,9 +9,9 @@ alwaysApply: true
|
|
|
9
9
|
|
|
10
10
|
- Start with `CLAUDE.md`, `Harness/MEMORY.md`, and `Harness/README.md`.
|
|
11
11
|
- Do not bulk-read `Harness/`. Load by router trigger.
|
|
12
|
-
- Keep `Harness/PLAN.md` current when work has multiple steps, files, or agents.
|
|
12
|
+
- Keep `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md` current when work has multiple steps, files, or agents.
|
|
13
13
|
- project files are the only durable communication channel. chat/subagent transcript state is non-authoritative.
|
|
14
|
-
- Important assumptions, decisions, blockers, evidence, and handoffs must be written to `Harness/PLAN.md`, the current feature doc, `Harness/MEMORY.md`, or `Harness/memory/*` as appropriate.
|
|
14
|
+
- Important assumptions, decisions, blockers, evidence, and handoffs must be written to `Harness/tasks/<task-id>/PROGRESS.md`, `Harness/tasks/<task-id>/PLAN.md`, the current feature doc, `Harness/MEMORY.md`, or `Harness/memory/*` as appropriate.
|
|
15
15
|
|
|
16
16
|
## Verification
|
|
17
17
|
|
|
@@ -10,7 +10,8 @@ Load:
|
|
|
10
10
|
- `Harness/agent-workflow.md`
|
|
11
11
|
- `Harness/subagents.md` when more than one agent, reviewer, or recovery pass is useful
|
|
12
12
|
- `Harness/dispatch.md` when more than one agent is useful
|
|
13
|
-
- `Harness/
|
|
13
|
+
- `Harness/PROGRESS.md`
|
|
14
|
+
- `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md` when available
|
|
14
15
|
- current feature doc if present
|
|
15
16
|
|
|
16
17
|
Follow:
|
|
@@ -10,7 +10,8 @@ Load:
|
|
|
10
10
|
- `Harness/subagents.md`
|
|
11
11
|
- `Harness/context-loading.md`
|
|
12
12
|
- `Harness/dispatch.md` when more than one agent is useful
|
|
13
|
-
- `Harness/
|
|
13
|
+
- `Harness/PROGRESS.md`
|
|
14
|
+
- `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md` when available
|
|
14
15
|
- current feature doc if present
|
|
15
16
|
|
|
16
17
|
For each subagent or bounded pass, provide:
|
|
@@ -11,6 +11,6 @@ description: Use at the start of any task, or when unsure which harness document
|
|
|
11
11
|
- `/wf`, `wf mode`, `workflow mode`, `wk mode`, long, difficult, uncertain, repeated-failure, migration, architecture-heavy, browser-visible, or broad multi-agent implementation work routes to `wf-mode` first.
|
|
12
12
|
- Bounded subagent-only coordination routes to `subagent-orchestrator`.
|
|
13
13
|
4. Load only the listed primary doc(s). Let `wf-mode` decide when to load subagent docs.
|
|
14
|
-
5. If the task grows, update `Harness/
|
|
14
|
+
5. If the task grows, update `Harness/tasks/<task-id>/PROGRESS.md` and use `harness-context`.
|
|
15
15
|
|
|
16
16
|
Do not bulk-read `Harness/`.
|
|
@@ -12,7 +12,8 @@ Improve `README.md` without breaking project-owned public docs.
|
|
|
12
12
|
- root `README.md`
|
|
13
13
|
- package files and scripts (`package.json`, `pyproject.toml`, `go.mod`, etc.)
|
|
14
14
|
- CI files when present
|
|
15
|
-
- `Harness/
|
|
15
|
+
- `Harness/PROGRESS.md`
|
|
16
|
+
- `Harness/tasks/<task-id>/PLAN.md` when available
|
|
16
17
|
- `Harness/architecture.md` only when an architecture summary or diagram is requested
|
|
17
18
|
|
|
18
19
|
## Mode
|
|
@@ -35,7 +36,7 @@ If unanswered, use Preserve + append.
|
|
|
35
36
|
- Use Mermaid or ASCII architecture diagrams only when the structure is observed or approved; label uncertain diagrams as proposed.
|
|
36
37
|
- Keep detailed architecture in `Harness/architecture.md`; README may link to it or show a short overview.
|
|
37
38
|
- Keep agent rules in `CLAUDE.md`/`AGENTS.md`, not README.
|
|
38
|
-
- Record the chosen mode and any skipped README improvements in `Harness/PLAN.md
|
|
39
|
+
- Record the chosen mode and any skipped README improvements in `Harness/tasks/<task-id>/PLAN.md` when available.
|
|
39
40
|
|
|
40
41
|
## Output
|
|
41
42
|
|
|
@@ -10,14 +10,16 @@ Load:
|
|
|
10
10
|
- `Harness/subagents.md`
|
|
11
11
|
- `Harness/dispatch.md`
|
|
12
12
|
- `Harness/context-loading.md`
|
|
13
|
-
- `Harness/
|
|
13
|
+
- `Harness/PROGRESS.md`
|
|
14
|
+
- `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md` when active
|
|
14
15
|
- `Harness/agent-workflow.md`
|
|
15
16
|
- `Harness/WF.md` when in `/wf`, `wf mode`, `workflow mode`, `wk mode`, or recovery loop
|
|
16
17
|
- `.claude/agents/` roster names before choosing roles
|
|
17
18
|
|
|
18
19
|
Follow:
|
|
19
20
|
|
|
20
|
-
- The main agent is the controller. It decomposes work, writes `Harness/PLAN.md`, integrates returns, and owns final verification.
|
|
21
|
+
- The main agent is the controller. It decomposes work, writes `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md`, integrates returns, and owns final verification.
|
|
22
|
+
- Subagents are readers and reporters. Only the controller writes to task state files.
|
|
21
23
|
- Use the efficiency ladder in `Harness/subagents.md`: solo pass -> single reviewer -> parallel read-only -> serial build lane -> isolated lanes.
|
|
22
24
|
- Explicit WF/WK mode requires at least 3 distinct agents from `.claude/agents/` before second planning.
|
|
23
25
|
- Prefer the built-in roles `planner`, `researcher`, `docs-researcher`, `architect`, `test-writer`, `implementer`, `reviewer`, `debugger`, and `verifier` before inventing custom roles.
|
|
@@ -26,7 +28,7 @@ Follow:
|
|
|
26
28
|
- Use two review gates after implementation: spec review first, then code-quality or architecture review.
|
|
27
29
|
- If verification fails, dispatch debugger/fixer with the smallest reproduced failure, then re-review and re-verify.
|
|
28
30
|
- If subagents are unavailable, emulate the same roles as separate bounded passes and record that fallback.
|
|
29
|
-
- When used outside `wf-mode`, update `Harness/PLAN.md#
|
|
31
|
+
- When used outside `wf-mode`, update `Harness/tasks/<task-id>/PLAN.md#Subagent Dispatch`; update `Harness/tasks/<task-id>/PROGRESS.md#Heartbeat` only if an active heartbeat/recovery loop exists.
|
|
30
32
|
|
|
31
33
|
Return:
|
|
32
34
|
|
|
@@ -8,7 +8,8 @@ description: Use for /wf, wf mode, workflow mode, wk mode, long difficult tasks,
|
|
|
8
8
|
Load:
|
|
9
9
|
|
|
10
10
|
- `Harness/WF.md`
|
|
11
|
-
- `Harness/
|
|
11
|
+
- `Harness/PROGRESS.md`
|
|
12
|
+
- `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md` when active
|
|
12
13
|
- `Harness/agent-workflow.md` when implementation, review, or verification starts
|
|
13
14
|
- `Harness/subagents.md`, `Harness/dispatch.md`, and `Harness/context-loading.md` immediately for explicit WF/WK mode; otherwise only when coordinating subagents or bounded role passes
|
|
14
15
|
- current feature doc when one exists
|
|
@@ -24,25 +25,29 @@ intake + 95% confidence gate
|
|
|
24
25
|
-> bounded implementation
|
|
25
26
|
-> review
|
|
26
27
|
-> verification
|
|
27
|
-
-> debugger recovery loop when verification fails
|
|
28
|
+
-> debugger recovery loop when verification fails (dispatch memory-master after 3 same-class failures)
|
|
29
|
+
-> context-master session analysis + knowledge extraction
|
|
30
|
+
-> memory-master consolidation
|
|
28
31
|
-> close with evidence
|
|
29
32
|
```
|
|
30
33
|
|
|
31
34
|
Rules:
|
|
32
35
|
|
|
33
|
-
- Update `Harness/
|
|
36
|
+
- Update `Harness/tasks/<task-id>/PROGRESS.md#Heartbeat` before long commands, after failures, before handoff, and at closeout.
|
|
34
37
|
- Explicit `/wf`, `wf mode`, `workflow mode`, or `wk mode` MUST use `subagent-orchestrator` and spawn at least 3 distinct subagents from `.claude/agents/` before second planning.
|
|
35
38
|
- Use the 7:3 collaboration bias from `Harness/WF.md`: default to multi-agent collaboration for substantial work; use solo mode only for clearly small/local tasks outside explicit WF/WK mode.
|
|
36
39
|
- Use `subagent-orchestrator` and `Harness/subagents.md` when the task has broad reading, cross-layer impact, independent review needs, or repeated failures.
|
|
40
|
+
- Subagents return findings and PLAN patch suggestions. Only the main agent writes to task PROGRESS.md and PLAN.md.
|
|
37
41
|
- If subagents are unavailable, emulate the same roles as separate bounded passes.
|
|
38
42
|
- Do not claim browser/UI acceptance without real-browser evidence from Chrome DevTools, CDP, Playwright, or documented manual browser checks.
|
|
39
43
|
- If `Harness/workflows/browser-e2e.md` is not installed, use `Harness/WF.md#Browser And API Evidence` as the fallback evidence contract or ask the user before adding the optional workflow.
|
|
40
|
-
- If the same failure class happens three times,
|
|
44
|
+
- If the same failure class happens three times, dispatch `memory-master` to record the failure pattern first, then ask the user with evidence-backed options.
|
|
41
45
|
|
|
42
46
|
Return:
|
|
43
47
|
|
|
44
48
|
- changed files
|
|
45
49
|
- agents or bounded passes used
|
|
50
|
+
- memory-master / context-master dispatches
|
|
46
51
|
- commands run
|
|
47
52
|
- browser/API evidence when applicable
|
|
48
53
|
- review findings
|