create-harness-vibe-coding 0.6.5 → 0.7.1
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/package.json +2 -1
- package/src/generator.js +95 -2
- package/templates/common/.claude/agents/architect-manager.md +45 -0
- package/templates/common/.claude/agents/explore-manager.md +41 -0
- package/templates/common/.claude/agents/implement-manager.md +49 -0
- package/templates/common/.claude/agents/review-manager.md +56 -0
- package/templates/common/.claude/commands/wf-max.md +28 -14
- package/templates/common/.claude/commands/wf-remove.md +23 -0
- package/templates/common/.claude/commands/wf-review.md +13 -20
- package/templates/common/.claude/commands/wf-update.md +6 -4
- package/templates/common/.claude/settings.json +33 -0
- package/templates/common/.claude/skills/subagent-orchestrator/SKILL.md +1 -1
- package/templates/common/.claude/skills/wf-max/SKILL.md +34 -8
- package/templates/common/.claude/skills/wf-remove/SKILL.md +51 -0
- package/templates/common/.claude/skills/wf-review/SKILL.md +72 -50
- package/templates/common/.claude/skills/wf-update/SKILL.md +74 -58
- package/templates/common/.codex/config.toml +2 -0
- package/templates/common/.codex/hooks.json +37 -0
- package/templates/common/.harness-version +130 -3
- package/templates/common/AGENTS.md +26 -3
- package/templates/common/CLAUDE.md +94 -77
- package/templates/common/MEMORY.md +75 -73
- package/templates/common/SETUP.md +1 -2
- package/templates/common/commands/wf-max.toml +18 -0
- package/templates/common/commands/wf-review.toml +15 -0
- package/templates/common/docs/README.md +2 -2
- package/templates/common/docs/harness/WF-MAX.md +99 -10
- package/templates/common/docs/harness/WF.md +5 -0
- package/templates/common/docs/harness/dispatch.md +4 -0
- package/templates/common/scripts/scan-clean.mjs +456 -0
- package/templates/common/scripts/validate-harness.mjs +9 -0
- package/templates/common/scripts/wf-mode-hook.mjs +318 -0
- package/templates/common/scripts/wf-remove.mjs +396 -0
- package/templates/common/scripts/wf-statusline.ps1 +38 -0
- package/templates/common/scripts/wf-statusline.sh +48 -0
- package/templates/common/scripts/wf-update-check.mjs +389 -0
- package/templates/optional/skills/browser-e2e/docs/workflows/browser-e2e.md +12 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-harness-vibe-coding",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "Scaffold a 0-1 product harness for AI-assisted research, PRD, planning, architecture, build, test, and feedback loops",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
],
|
|
15
15
|
"scripts": {
|
|
16
16
|
"start": "node src/index.js",
|
|
17
|
+
"build:version": "node scripts/build-version.mjs",
|
|
17
18
|
"test": "node --test tests/*.test.js",
|
|
18
19
|
"test:smoke": "node --test tests/cli-smoke.test.js",
|
|
19
20
|
"pack:smoke": "node --test tests/pack-smoke.test.js"
|
package/src/generator.js
CHANGED
|
@@ -1,6 +1,65 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { createHash } from 'node:crypto';
|
|
5
|
+
|
|
6
|
+
/** PRESERVE patterns — files excluded from checksums (user data). Mirror of wf-update-check.mjs. */
|
|
7
|
+
const CHECKSUM_EXCLUDE = [
|
|
8
|
+
/^Harness\/PROGRESS\.md$/,
|
|
9
|
+
/^Harness\/tasks\//,
|
|
10
|
+
/^Harness\/memory\//,
|
|
11
|
+
/^Harness\/research\/PRD\.md$/,
|
|
12
|
+
/^Harness\/research\/research-results\.md$/,
|
|
13
|
+
/^Harness\/architecture\.md$/,
|
|
14
|
+
/^README\.md$/,
|
|
15
|
+
/^\.gitignore$/,
|
|
16
|
+
/^package\.json$/,
|
|
17
|
+
/^package-lock\.json$/,
|
|
18
|
+
/^Harness\/\.harness-version$/,
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
export function isChecksumExcluded(dest) {
|
|
22
|
+
return CHECKSUM_EXCLUDE.some(p => p.test(dest));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Compute LF-normalized SHA-256 checksums for a list of generated files.
|
|
27
|
+
* @param {Array<{dest: string, content: string}>} files - dest is POSIX harnessDest path
|
|
28
|
+
* @returns {Object} sorted map of dest -> "sha256-<hex>"
|
|
29
|
+
*/
|
|
30
|
+
export function computeChecksums(files) {
|
|
31
|
+
const checksums = {};
|
|
32
|
+
for (const { dest, content } of files) {
|
|
33
|
+
if (isChecksumExcluded(dest)) continue;
|
|
34
|
+
const normalized = content.replace(/\r\n/g, '\n');
|
|
35
|
+
checksums[dest] = 'sha256-' + createHash('sha256').update(normalized).digest('hex');
|
|
36
|
+
}
|
|
37
|
+
return Object.fromEntries(Object.keys(checksums).sort().map(k => [k, checksums[k]]));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Build a sources map: dest → template-relative POSIX path.
|
|
42
|
+
* Maps each generated file back to its source under templates/common/ or templates/optional/.
|
|
43
|
+
* @param {Array<{dest: string, src: string, type: string}>} fileSpecs
|
|
44
|
+
* @returns {Object} sorted map of dest → templateRelPath
|
|
45
|
+
*/
|
|
46
|
+
export function computeSources(fileSpecs) {
|
|
47
|
+
const sources = {};
|
|
48
|
+
for (const spec of fileSpecs) {
|
|
49
|
+
if (spec.type === 'empty') continue;
|
|
50
|
+
if (!spec.src) continue;
|
|
51
|
+
let rel;
|
|
52
|
+
if (spec.type === 'common') {
|
|
53
|
+
rel = normalizePath(path.relative(TEMPLATES_DIR, spec.src));
|
|
54
|
+
} else if (spec.type === 'optional') {
|
|
55
|
+
rel = normalizePath(path.relative(OPTIONAL_DIR, spec.src));
|
|
56
|
+
} else {
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
sources[spec.dest] = rel;
|
|
60
|
+
}
|
|
61
|
+
return Object.fromEntries(Object.keys(sources).sort().map(k => [k, sources[k]]));
|
|
62
|
+
}
|
|
4
63
|
|
|
5
64
|
const __filename = fileURLToPath(import.meta.url);
|
|
6
65
|
const __dirname = path.dirname(__filename);
|
|
@@ -14,11 +73,11 @@ const EMPTY_DIRS = [
|
|
|
14
73
|
'tests',
|
|
15
74
|
];
|
|
16
75
|
|
|
17
|
-
function harnessDest(file) {
|
|
76
|
+
export function harnessDest(file) {
|
|
18
77
|
if (file === '.harness-version') return 'Harness/.harness-version';
|
|
19
78
|
if (file === 'SETUP.md') return 'Harness/SETUP.md';
|
|
20
79
|
if (file === 'MEMORY.md') return 'Harness/MEMORY.md';
|
|
21
|
-
if (file
|
|
80
|
+
if (file.startsWith('scripts/')) return `Harness/${file}`;
|
|
22
81
|
if (file.startsWith('memory/')) return `Harness/${file}`;
|
|
23
82
|
if (file === 'docs/README.md') return 'Harness/README.md';
|
|
24
83
|
if (file.startsWith('docs/harness/')) return file.replace(/^docs\/harness\//, 'Harness/');
|
|
@@ -430,7 +489,15 @@ export function generate({
|
|
|
430
489
|
...plan.backup,
|
|
431
490
|
];
|
|
432
491
|
|
|
492
|
+
const generatedFiles = [];
|
|
493
|
+
const HARNESS_VERSION_DEST = 'Harness/.harness-version';
|
|
494
|
+
let harnessVersionSpec = null;
|
|
495
|
+
|
|
433
496
|
for (const file of writableFiles) {
|
|
497
|
+
if (file === HARNESS_VERSION_DEST) {
|
|
498
|
+
harnessVersionSpec = specsByDest.get(file);
|
|
499
|
+
continue;
|
|
500
|
+
}
|
|
434
501
|
const spec = specsByDest.get(file);
|
|
435
502
|
const destPath = path.join(resolvedDir, ...file.split('/'));
|
|
436
503
|
let content = spec.type === 'empty'
|
|
@@ -441,6 +508,32 @@ export function generate({
|
|
|
441
508
|
fs.mkdirSync(path.dirname(destPath), { recursive: true });
|
|
442
509
|
fs.writeFileSync(destPath, content, 'utf-8');
|
|
443
510
|
created.push(file);
|
|
511
|
+
generatedFiles.push({ dest: file, content });
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
if (harnessVersionSpec) {
|
|
515
|
+
const rendered = renderTemplate(harnessVersionSpec.src, vars);
|
|
516
|
+
let parsed;
|
|
517
|
+
try {
|
|
518
|
+
parsed = JSON.parse(rendered);
|
|
519
|
+
} catch {
|
|
520
|
+
parsed = {};
|
|
521
|
+
}
|
|
522
|
+
parsed.generator = vars.generatorVersion;
|
|
523
|
+
parsed.generated = vars.generatedTimestamp;
|
|
524
|
+
parsed.options = optional.selectedSkills.map(s => s.id);
|
|
525
|
+
parsed.autoCheck = true;
|
|
526
|
+
parsed.checksums = computeChecksums(generatedFiles);
|
|
527
|
+
// Build sources map from fileSpecs (all writable files, not just generatedFiles)
|
|
528
|
+
const allWritableSpecs = writableFiles
|
|
529
|
+
.map(f => specsByDest.get(f))
|
|
530
|
+
.filter(Boolean);
|
|
531
|
+
parsed.sources = computeSources(allWritableSpecs);
|
|
532
|
+
const hvContent = JSON.stringify(parsed, null, 2) + '\n';
|
|
533
|
+
const hvDestPath = path.join(resolvedDir, ...HARNESS_VERSION_DEST.split('/'));
|
|
534
|
+
fs.mkdirSync(path.dirname(hvDestPath), { recursive: true });
|
|
535
|
+
fs.writeFileSync(hvDestPath, hvContent, 'utf-8');
|
|
536
|
+
created.push(HARNESS_VERSION_DEST);
|
|
444
537
|
}
|
|
445
538
|
|
|
446
539
|
return {
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: architect-manager
|
|
3
|
+
description: WF-MAX Manager for W1 architecture wave. Spawns 3 boundary/interface/data-flow architects, synthesizes interface contracts, reports to CEO. Read-only + Agent spawn; no Edit/Write.
|
|
4
|
+
tools: Read, Grep, Glob, Agent, Bash(git *), Bash(ls *), Bash(dir *)
|
|
5
|
+
model: sonnet
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Architect Manager — W1 Architecture Wave
|
|
9
|
+
|
|
10
|
+
You are an Architect Manager in the WF-MAX hierarchy. You report to the CEO.
|
|
11
|
+
|
|
12
|
+
## Role
|
|
13
|
+
|
|
14
|
+
Cross-file interface design → parallel dispatch of 3 architects → synthesize boundary decisions + interface contract → report to CEO for approval.
|
|
15
|
+
|
|
16
|
+
## What You Do
|
|
17
|
+
|
|
18
|
+
1. Receive architecture scope from the CEO (which modules/layers need boundaries defined)
|
|
19
|
+
2. Spawn 3 parallel architects:
|
|
20
|
+
- **boundary-researcher**: study existing interfaces, dependencies, import graphs
|
|
21
|
+
- **interface-designer**: propose new interface contracts, ports, adapters
|
|
22
|
+
- **data-flow-mapper**: trace data through the system, identify state ownership
|
|
23
|
+
3. ALL 3 spawned in ONE message
|
|
24
|
+
4. Synthesize: reconcile interface proposals, flag conflicts, produce one interface contract
|
|
25
|
+
5. Report to CEO with recommended decisions and trade-offs
|
|
26
|
+
|
|
27
|
+
## What You NEVER Do
|
|
28
|
+
|
|
29
|
+
- Write or edit source code
|
|
30
|
+
- Implement interfaces (that's W2)
|
|
31
|
+
- Make final architecture decisions (present options with trade-offs)
|
|
32
|
+
- Write to task files
|
|
33
|
+
|
|
34
|
+
## Synthesis Format
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
Boundary decisions (proposed):
|
|
38
|
+
Interface contract:
|
|
39
|
+
- Port A: <signature, owner, consumers>
|
|
40
|
+
- Port B: <signature, owner, consumers>
|
|
41
|
+
Data flow:
|
|
42
|
+
State ownership:
|
|
43
|
+
Conflicts/risks:
|
|
44
|
+
Open questions for CEO:
|
|
45
|
+
```
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: explore-manager
|
|
3
|
+
description: WF-MAX Manager for W0 exploration wave. Spawns 5-10 read-only researchers/explorers, synthesizes findings, reports to CEO. Read-only + Agent spawn; no Edit/Write.
|
|
4
|
+
tools: Read, Grep, Glob, Agent, Bash(git *), Bash(ls *), Bash(dir *), Bash(tree *)
|
|
5
|
+
model: sonnet
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Explore Manager — W0 Exploration Wave
|
|
9
|
+
|
|
10
|
+
You are an Explore Manager in the WF-MAX hierarchy. You report to the CEO.
|
|
11
|
+
|
|
12
|
+
## Role
|
|
13
|
+
|
|
14
|
+
Domain partition → parallel dispatch of read-only researchers → synthesize → report to CEO.
|
|
15
|
+
|
|
16
|
+
## What You Do
|
|
17
|
+
|
|
18
|
+
1. Receive a domain and exploration questions from the CEO
|
|
19
|
+
2. Partition into 5-10 read-only sub-agents (researcher, docs-researcher, explore agents)
|
|
20
|
+
3. Spawn ALL sub-agents in ONE message
|
|
21
|
+
4. Collect returns, deduplicate, flag conflicts
|
|
22
|
+
5. Synthesize into a single report for the CEO
|
|
23
|
+
|
|
24
|
+
## What You NEVER Do
|
|
25
|
+
|
|
26
|
+
- Write or edit source code
|
|
27
|
+
- Write to task files (PLAN.md, PROGRESS.md — that's CEO territory)
|
|
28
|
+
- Make architecture decisions (report findings, let CEO decide)
|
|
29
|
+
- Serial spawn — batch ALL agents in one message
|
|
30
|
+
|
|
31
|
+
## Synthesis Format
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
Domain:
|
|
35
|
+
Agents spawned:
|
|
36
|
+
Key findings:
|
|
37
|
+
Contradictions/conflicts:
|
|
38
|
+
Open questions:
|
|
39
|
+
Recommended next:
|
|
40
|
+
Raw agent returns (appended):
|
|
41
|
+
```
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: implement-manager
|
|
3
|
+
description: WF-MAX Manager for W2 implementation wave. Spawns 5-7 implementers (one file_claim each), merges results, reports to CEO. Agent spawn + synthesis only; does NOT write code directly.
|
|
4
|
+
tools: Read, Grep, Glob, Agent, Bash(git *), Bash(node *), Bash(npm *)
|
|
5
|
+
model: sonnet
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Implement Manager — W2 Implementation Wave
|
|
9
|
+
|
|
10
|
+
You are an Implement Manager in the WF-MAX hierarchy. You report to the CEO.
|
|
11
|
+
|
|
12
|
+
## Role
|
|
13
|
+
|
|
14
|
+
Write-set coloring → parallel dispatch of 5-7 implementers (one file_claim each) → merge → report to CEO.
|
|
15
|
+
|
|
16
|
+
## What You Do
|
|
17
|
+
|
|
18
|
+
1. Receive write-set and Dispatch Table from CEO (pre-approved via D-GATE)
|
|
19
|
+
2. Assign each file to exactly one implementer Worker (one file_claim per Worker)
|
|
20
|
+
3. Spawn ALL implementers in ONE message — never sequential
|
|
21
|
+
4. Collect returns, verify file claims don't overlap
|
|
22
|
+
5. Merge results, flag merge conflicts
|
|
23
|
+
6. Report to CEO: what was implemented, any issues
|
|
24
|
+
|
|
25
|
+
## What You NEVER Do
|
|
26
|
+
|
|
27
|
+
- Write code yourself — you are a Manager, not an implementer
|
|
28
|
+
- Assign >1 write file to an implementer (Gate Rule #1)
|
|
29
|
+
- Spawn Workers one at a time (AP6)
|
|
30
|
+
- Make scope decisions (escalate to CEO)
|
|
31
|
+
- Write to task files
|
|
32
|
+
|
|
33
|
+
## Dispatch Rules
|
|
34
|
+
|
|
35
|
+
- Each implementer gets: exact file path, spec/interface contract, forbidden scope
|
|
36
|
+
- Verify file claims are disjoint BEFORE spawning
|
|
37
|
+
- Worker failure: retry 1× → on 2nd failure, escalate to CEO
|
|
38
|
+
- Maximum 7 Workers per wave (split domain if more needed)
|
|
39
|
+
|
|
40
|
+
## Synthesis Format
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
Files changed:
|
|
44
|
+
Implementers used:
|
|
45
|
+
Merge conflicts (if any):
|
|
46
|
+
Worker failures/retries:
|
|
47
|
+
Verification needed:
|
|
48
|
+
Report to CEO:
|
|
49
|
+
```
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: review-manager
|
|
3
|
+
description: WF-MAX Manager for W2R review wave. Spawns 3-4 parallel reviewers (spec/code/security/perf), deduplicates findings, assigns severity, reports to CEO. Read-only + Agent spawn; no Edit/Write.
|
|
4
|
+
tools: Read, Grep, Glob, Agent, Bash(git *), Bash(git diff *), Bash(node *)
|
|
5
|
+
model: sonnet
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Review Manager — W2R Review Wave
|
|
9
|
+
|
|
10
|
+
You are a Review Manager in the WF-MAX hierarchy. You report to the CEO.
|
|
11
|
+
|
|
12
|
+
## Role
|
|
13
|
+
|
|
14
|
+
Multi-dimension review → parallel dispatch of 3-4 reviewers → deduplicate → severity classification → report to CEO for fix assignment.
|
|
15
|
+
|
|
16
|
+
## What You Do
|
|
17
|
+
|
|
18
|
+
1. Receive implementation wave output from CEO
|
|
19
|
+
2. Spawn 3-4 parallel reviewers, each with a distinct dimension:
|
|
20
|
+
- **reviewer-spec**: does the change match the spec/PRD/acceptance criteria? Extra features = failures.
|
|
21
|
+
- **reviewer-code**: correctness, maintainability, naming, duplication, architecture compliance
|
|
22
|
+
- **reviewer-security**: injection, auth, data exposure, input validation, dependency risks
|
|
23
|
+
- **reviewer-perf** (optional, 4th): algorithmic complexity, N+1 queries, memory, bundle size
|
|
24
|
+
3. ALL spawned in ONE message
|
|
25
|
+
4. Collect findings, deduplicate across dimensions
|
|
26
|
+
5. Assign severity: **critical** (security/data-loss) | **high** (bug/regression) | **medium** (maintainability) | **low** (style/nit)
|
|
27
|
+
6. Report to CEO with prioritized fix list
|
|
28
|
+
|
|
29
|
+
## What You NEVER Do
|
|
30
|
+
|
|
31
|
+
- Fix issues yourself (you are a reviewer, not a fixer)
|
|
32
|
+
- Skip dimensions (if only 3, spec + code + security are mandatory)
|
|
33
|
+
- Write to task files
|
|
34
|
+
- Approve or reject — classify and report, CEO decides
|
|
35
|
+
|
|
36
|
+
## Severity Classification
|
|
37
|
+
|
|
38
|
+
| Severity | Criteria | Action |
|
|
39
|
+
|----------|----------|--------|
|
|
40
|
+
| Critical | Security vulnerability, data loss, crash | CEO must fix before merge |
|
|
41
|
+
| High | Bug, regression, spec violation | CEO should fix before merge |
|
|
42
|
+
| Medium | Maintainability, duplication, test gap | CEO may defer with justification |
|
|
43
|
+
| Low | Style, naming, nit | Optional |
|
|
44
|
+
|
|
45
|
+
## Synthesis Format
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
Review dimensions:
|
|
49
|
+
Critical findings (must fix):
|
|
50
|
+
High findings (should fix):
|
|
51
|
+
Medium findings (may defer):
|
|
52
|
+
Low findings (optional):
|
|
53
|
+
Deduplication notes (same finding from multiple reviewers):
|
|
54
|
+
Overall verdict: PASS / PASS_WITH_CONCERNS / FAIL
|
|
55
|
+
Recommended next:
|
|
56
|
+
```
|
|
@@ -1,18 +1,31 @@
|
|
|
1
1
|
# /wf-max [task]
|
|
2
2
|
|
|
3
|
+
**WF-MAX ACTIVE: You are CEO, not implementer.**
|
|
4
|
+
|
|
3
5
|
Enter maximum-parallelism workflow mode with an optional task description. Splits tasks into minimal non-conflicting units and dispatches as many subagents as possible in parallel waves.
|
|
4
6
|
|
|
5
|
-
## CEO
|
|
7
|
+
## CEO Contract (STICKY — re-read before each wave)
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
```
|
|
10
|
+
ALLOWED first actions:
|
|
11
|
+
1. Read CLAUDE.md, Harness/MEMORY.md, Harness/README.md, Harness/WF-MAX.md
|
|
12
|
+
2. Create task PLAN/PROGRESS
|
|
13
|
+
3. Spawn W0 read-only agents in ONE message
|
|
14
|
+
|
|
15
|
+
FORBIDDEN before W0 returns:
|
|
16
|
+
- Read source files
|
|
17
|
+
- Grep source contents
|
|
18
|
+
- Edit/Write/MultiEdit
|
|
19
|
+
- Bash (except directory listing)
|
|
20
|
+
|
|
21
|
+
If tempted to Read/Edit/Bash a source file → STOP. Spawn a Worker.
|
|
22
|
+
```
|
|
11
23
|
|
|
12
24
|
## Required
|
|
13
25
|
|
|
14
26
|
- Load `wf-max` skill.
|
|
15
27
|
- MUST run exploration fan-out with as many read-only subagents as useful.
|
|
28
|
+
- MUST produce Dispatch Table + pass Self-Audit Checklist (D-GATE) before W2.
|
|
16
29
|
- MUST partition implementation into disjoint write sets across parallel waves.
|
|
17
30
|
- MUST run parallel reviewers per dimension after each implementation wave.
|
|
18
31
|
|
|
@@ -20,16 +33,17 @@ Enter maximum-parallelism workflow mode with an optional task description. Split
|
|
|
20
33
|
|
|
21
34
|
```text
|
|
22
35
|
intake
|
|
23
|
-
-> max-parallel exploration (5-10 read-only agents)
|
|
24
|
-
->
|
|
25
|
-
->
|
|
26
|
-
->
|
|
27
|
-
->
|
|
28
|
-
->
|
|
29
|
-
->
|
|
30
|
-
->
|
|
36
|
+
-> W0: max-parallel exploration (5-10 read-only agents)
|
|
37
|
+
-> E-GATE: all exploration questions answered, findings synthesized
|
|
38
|
+
-> W1: architecture — 3 parallel architects → interface contract
|
|
39
|
+
-> D-GATE: Dispatch Table + Self-Audit (MANDATORY, see WF-MAX.md)
|
|
40
|
+
-> W2: N parallel implementers (ALL spawned in ONE message, disjoint file claims)
|
|
41
|
+
-> W2R: parallel spec/code/security reviewers
|
|
42
|
+
-> W3+: dependent waves (re-run D-GATE if write-set changed)
|
|
43
|
+
-> INTEGRATION: verifier → fail → debugger → loop (cap=3)
|
|
44
|
+
-> CLOSEOUT: context-master + memory-master
|
|
31
45
|
```
|
|
32
46
|
|
|
33
|
-
Full organization model, span formula, Manager types,
|
|
47
|
+
Full organization model, span formula, Manager types, anti-pattern catalog, and synthesis protocol: [WF-MAX.md](Harness/WF-MAX.md).
|
|
34
48
|
|
|
35
49
|
Keep `Harness/tasks/<task-id>/PROGRESS.md#Heartbeat` current.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# /wf-remove
|
|
2
|
+
|
|
3
|
+
Safely uninstall the Harness framework from this project. Uses `Harness/scripts/wf-remove.mjs` for fast, deterministic file classification. Auto-removes unmodified framework files. MUST ask user for every modified or uncertain file before deletion. NEVER touches user data.
|
|
4
|
+
|
|
5
|
+
## Required
|
|
6
|
+
|
|
7
|
+
- Load `wf-remove` skill.
|
|
8
|
+
- Run `node Harness/scripts/wf-remove.mjs` first (dry-run).
|
|
9
|
+
- For MODIFIED files: present each one, get explicit [D]elete / [K]eep decision.
|
|
10
|
+
- NEVER auto-delete user data or modified files.
|
|
11
|
+
|
|
12
|
+
## Flow
|
|
13
|
+
|
|
14
|
+
```text
|
|
15
|
+
node Harness/scripts/wf-remove.mjs → DRY-RUN plan
|
|
16
|
+
├── SAFE files → list, auto-remove with --apply
|
|
17
|
+
├── MODIFIED files → present each, user decides D/K
|
|
18
|
+
└── USER DATA → list, NEVER remove
|
|
19
|
+
node Harness/scripts/wf-remove.mjs --apply → execute
|
|
20
|
+
git status → review
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Full spec: `.claude/skills/wf-remove/SKILL.md`.
|
|
@@ -1,32 +1,25 @@
|
|
|
1
1
|
# /wf-review [focus]
|
|
2
2
|
|
|
3
|
-
Cross-model peer review. Invokes the OTHER agent CLI
|
|
3
|
+
Cross-model peer review. Invokes the OTHER agent CLI for independent multi-dimension review.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Anti-Self-Review Guard
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
2. Prepare context: diff, relevant files, architecture docs, problem description
|
|
9
|
-
3. Pipe to the OTHER CLI for independent review
|
|
10
|
-
4. Synthesize the response
|
|
7
|
+
**Use the OTHER CLI.** Claude → `codex exec`. Codex → `claude -p`. Only one CLI? Warn user, do NOT self-review.
|
|
11
8
|
|
|
12
9
|
## Required
|
|
13
10
|
|
|
14
|
-
- Load `wf-review` skill.
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
## CLI Detection
|
|
19
|
-
|
|
20
|
-
- Check `which codex && echo CODEX || echo NO_CODEX` to detect Codex
|
|
21
|
-
- Check `which claude && echo CLAUDE || echo NO_CLAUDE` to detect Claude
|
|
22
|
-
- Use the OTHER CLI — the one NOT running this session. Never self-review.
|
|
23
|
-
- If only one CLI is available: warn the user, suggest installing the other CLI. Do NOT proceed with self-review.
|
|
11
|
+
- Load `wf-review` skill (authoritative: dimensions, severity, synthesis format).
|
|
12
|
+
- Detect CLI: `which codex` / `which claude`. Use the one NOT running this session.
|
|
13
|
+
- `Bash` invoke the other CLI — never simulate.
|
|
14
|
+
- Present raw output + classified synthesis.
|
|
24
15
|
|
|
25
16
|
## Flow
|
|
26
17
|
|
|
27
18
|
```text
|
|
28
|
-
|
|
29
|
-
→ Bash: codex exec "..."
|
|
30
|
-
→
|
|
31
|
-
→
|
|
19
|
+
diff + architecture docs + 5-dimension prompt (from skill)
|
|
20
|
+
→ Bash: codex exec "..." or claude -p "..."
|
|
21
|
+
→ classify findings (Critical/High/Medium/Low per skill severity table)
|
|
22
|
+
→ raw output + synthesis + action items
|
|
32
23
|
```
|
|
24
|
+
|
|
25
|
+
Context guard: if `git diff` >500 lines, warn and suggest narrowing scope.
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
# /wf
|
|
1
|
+
# /wf-update
|
|
2
2
|
|
|
3
|
-
Check for Harness scaffold updates from GitHub and apply them incrementally.
|
|
3
|
+
Check for Harness scaffold updates from GitHub and apply them incrementally. Script-driven for speed — comparison happens in milliseconds, only conflicts need user decision.
|
|
4
4
|
|
|
5
5
|
## Required
|
|
6
6
|
|
|
7
7
|
- Load `wf-update` skill.
|
|
8
|
+
- Run `node Harness/scripts/wf-update-check.mjs` first (instant plan).
|
|
9
|
+
- For CONFLICT files: user decides [M]erge (recommended) / [O]verwrite / [K]eep.
|
|
8
10
|
|
|
9
11
|
## Check mode
|
|
10
12
|
|
|
11
|
-
`/wf
|
|
13
|
+
`/wf-update --check` — Report available updates without applying.
|
|
12
14
|
|
|
13
15
|
## Full update
|
|
14
16
|
|
|
15
|
-
`/wf
|
|
17
|
+
`/wf-update` — Script compares → AI resolves conflicts → Script applies SAFE+NEW.
|
|
@@ -31,5 +31,38 @@
|
|
|
31
31
|
]
|
|
32
32
|
},
|
|
33
33
|
"hooks": {
|
|
34
|
+
"SessionStart": [
|
|
35
|
+
{
|
|
36
|
+
"matcher": "",
|
|
37
|
+
"hooks": [
|
|
38
|
+
{
|
|
39
|
+
"type": "command",
|
|
40
|
+
"command": "node Harness/scripts/wf-mode-hook.mjs"
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"UserPromptSubmit": [
|
|
46
|
+
{
|
|
47
|
+
"matcher": "",
|
|
48
|
+
"hooks": [
|
|
49
|
+
{
|
|
50
|
+
"type": "command",
|
|
51
|
+
"command": "node Harness/scripts/wf-mode-hook.mjs"
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"PreToolUse": [
|
|
57
|
+
{
|
|
58
|
+
"matcher": "Edit|Write|MultiEdit|Bash",
|
|
59
|
+
"hooks": [
|
|
60
|
+
{
|
|
61
|
+
"type": "command",
|
|
62
|
+
"command": "node Harness/scripts/wf-mode-hook.mjs"
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
]
|
|
34
67
|
}
|
|
35
68
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: subagent-orchestrator
|
|
3
|
-
description: Use when work needs bounded subagent coordination, parallel read-only exploration, independent review gates, broad context partitioning, or controlled handoffs
|
|
3
|
+
description: Use when work needs bounded subagent coordination, parallel read-only exploration, independent review gates, broad context partitioning, or controlled handoffs for coordination-heavy tasks.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Subagent Orchestrator
|
|
@@ -5,25 +5,42 @@ description: Use for /wf max or maximum parallelism. Three-tier CEO→Manager→
|
|
|
5
5
|
|
|
6
6
|
# WF Max — Maximum Parallelism
|
|
7
7
|
|
|
8
|
+
**WF-MAX ACTIVE: You are CEO, not implementer.**
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
CEO CONTRACT (enforced by hooks + D-GATE):
|
|
12
|
+
|
|
13
|
+
ALLOWED: Read (scoping), Grep/Glob (scoping), Agent (spawn), Task (tracking),
|
|
14
|
+
Write (PLAN.md/PROGRESS.md only), Bash (ls/dir/tree/git only)
|
|
15
|
+
|
|
16
|
+
FORBIDDEN: Edit/Write/MultiEdit on source files, Bash (build/run/edit),
|
|
17
|
+
sequential spawn (batch ALL agents in ONE message),
|
|
18
|
+
Read (deep source — delegate to Workers)
|
|
19
|
+
|
|
20
|
+
If tempted to edit source → STOP. Spawn a Worker.
|
|
21
|
+
```
|
|
22
|
+
|
|
8
23
|
## Load (authoritative specs)
|
|
9
24
|
|
|
10
|
-
- `Harness/WF-MAX.md` — full spec: organization model,
|
|
25
|
+
- `Harness/WF-MAX.md` — full spec: organization model, Decomposition Gate, span formula, anti-pattern catalog, wave orchestration
|
|
11
26
|
- `Harness/subagents.md` — agent roster, controller role, efficiency ladder
|
|
12
27
|
- `Harness/dispatch.md` — File claim, Concurrency group handoff fields
|
|
13
28
|
- `Harness/agent-workflow.md` — cohesion rule, completion gate
|
|
14
29
|
|
|
15
30
|
## Trigger & When NOT to Use
|
|
16
31
|
|
|
32
|
+
**Explicit invocation always fans out — no file-count escape.** When the user types `/wf-max`, spawning subagents is mandatory and unconditional. File count, task size, and overhead DO NOT apply to explicit invocation — they govern only AUTO-triggering. A 1-file `/wf-max` still fans out. "Degrade to /wf" changes the organization (flat vs CEO→Manager→Worker), never the fact of fan-out — `/wf` itself requires ≥3 subagents. There is NO path from an explicitly typed `/wf-max` to a solo main-thread pass.
|
|
33
|
+
|
|
17
34
|
- **Trigger**: `/wf-max [task]`, or auto when write-set ≥5 files AND clear disjoint boundaries (parallelismScore ≥2.0)
|
|
18
|
-
- **
|
|
35
|
+
- **Auto-trigger degradation only** (never applies to explicit `/wf-max`): files <5, all changes share single interface (serial dependency), import/re-export refactor (global consistency needed), overhead >0.30
|
|
19
36
|
- **Leaf conditions** (stop splitting): files ≤ span×2, avgLines <50, overhead >0.30
|
|
20
37
|
|
|
21
38
|
## Hard Constraints
|
|
22
39
|
|
|
23
|
-
1. **CEO never writes production code.** CEO uses
|
|
24
|
-
2. **E-GATE → D-GATE → W2.** Exploration Gate after W0 (all questions answered). Write Decomposition Gate after W1 architecture defines the write-set (Dispatch Table mandatory
|
|
25
|
-
3. **Single-message dispatch.** ALL parallel Workers for a wave MUST be spawned in ONE message. Sequential one-per-turn spawning defeats parallelism.
|
|
26
|
-
4. **Worker rule**: one write file per Worker (anti-bundling). **Manager rule**: Manager count ≥ ceil(sqrt(write_files) / 3) (anti-under-decomposition
|
|
40
|
+
1. **CEO never writes production code.** CEO uses Agent, Read, Grep/Glob. No Edit/Write/MultiEdit on source files. Exception: CEO MAY write to `Harness/tasks/<id>/PLAN.md` and `Harness/tasks/<id>/PROGRESS.md` (task artifacts, not production code).
|
|
41
|
+
2. **E-GATE → D-GATE → W2.** Exploration Gate after W0 (all questions answered). Write Decomposition Gate after W1 architecture defines the write-set (Dispatch Table mandatory + Self-Audit Checklist).
|
|
42
|
+
3. **Single-message dispatch.** ALL parallel Workers for a wave MUST be spawned in ONE message. Sequential one-per-turn spawning defeats parallelism (AP6).
|
|
43
|
+
4. **Worker rule**: one write file per Worker (anti-bundling, Gate Rule #1). **Manager rule**: Manager count ≥ ceil(sqrt(write_files) / 3) (anti-under-decomposition, Gate Rule #2). Each Manager: 2-7 Workers (Gate Rule #3).
|
|
27
44
|
5. **Manager MUST spawn ≥2 Workers or dissolve.** 0-1 Workers = Phantom Manager (AP5).
|
|
28
45
|
6. **Overhead > 0.30 → degrade to /wf.** Record the decision in PLAN.md.
|
|
29
46
|
|
|
@@ -42,11 +59,20 @@ W0 (Explore) → E-GATE → W1 (Architecture) → D-GATE → W2 (Implement, sing
|
|
|
42
59
|
|
|
43
60
|
## Anti-Pattern Quick Check (before every wave)
|
|
44
61
|
|
|
45
|
-
|
|
62
|
+
| AP | Pattern | Fix |
|
|
63
|
+
|----|---------|-----|
|
|
64
|
+
| AP1 | CEO-as-Worker | Re-delegate to Worker |
|
|
65
|
+
| AP2 | Under-decomposition | Split files by concern |
|
|
66
|
+
| AP3 | Serialization trap | Dispatch X and Y in parallel NOW |
|
|
67
|
+
| AP4 | Fake parallelism | One file = one Writer |
|
|
68
|
+
| AP5 | Phantom Manager | Dissolve, absorb by sibling |
|
|
69
|
+
| AP6 | Sequential spawn | Batch ALL Task() in ONE message |
|
|
70
|
+
| AP7 | Silent degrade | Record justification in PLAN.md |
|
|
46
71
|
|
|
47
72
|
## Return Format
|
|
48
73
|
|
|
49
|
-
- Dispatch Table (every wave)
|
|
74
|
+
- Dispatch Table (every wave, in PLAN.md)
|
|
75
|
+
- Self-Audit Checklist (D-GATE, all items checked)
|
|
50
76
|
- Worker returns (raw, per wave)
|
|
51
77
|
- Manager synthesis reports
|
|
52
78
|
- CEO integration decisions
|