create-harness-vibe-coding 0.8.5 → 0.8.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +20 -4
  2. package/package.json +1 -1
  3. package/src/generator.js +30 -11
  4. package/src/index.js +129 -5
  5. package/templates/common/.claude/agents/reflector.md +35 -0
  6. package/templates/common/.claude/agents/verifier.md +5 -3
  7. package/templates/common/.claude/commands/wf-help.md +1 -2
  8. package/templates/common/.claude/skills/subagent-orchestrator/SKILL.md +10 -4
  9. package/templates/common/.claude/skills/wf/SKILL.md +7 -3
  10. package/templates/common/.claude/skills/wf-auto/SKILL.md +59 -107
  11. package/templates/common/.claude/skills/wf-auto-spark/SKILL.md +19 -17
  12. package/templates/common/.claude/skills/wf-max/SKILL.md +40 -21
  13. package/templates/common/.claude/skills/wf-update/SKILL.md +9 -4
  14. package/templates/common/.codex/config.toml +5 -0
  15. package/templates/common/.harness-version +36 -34
  16. package/templates/common/AGENTS.md +26 -25
  17. package/templates/common/CLAUDE.md +10 -9
  18. package/templates/common/Harness/ACCEPTANCE_PROTOCOL.md +12 -4
  19. package/templates/common/Harness/README.md +12 -13
  20. package/templates/common/Harness/WF-AUTO-SPARK.md +18 -1
  21. package/templates/common/Harness/WF-AUTO.md +518 -492
  22. package/templates/common/Harness/WF-MAX.md +284 -232
  23. package/templates/common/Harness/WF.md +47 -29
  24. package/templates/common/Harness/agent-workflow.md +108 -76
  25. package/templates/common/Harness/dispatch.md +96 -95
  26. package/templates/common/Harness/extension.md +1 -1
  27. package/templates/common/Harness/subagents.md +78 -56
  28. package/templates/common/Harness/tasks/_template/ARTIFACTS.md +1 -1
  29. package/templates/common/Harness/tasks/_template/NOTES.md +1 -1
  30. package/templates/common/Harness/tasks/_template/PLAN.md +53 -60
  31. package/templates/common/Harness/tasks/_template/PROGRESS.md +26 -29
  32. package/templates/common/MEMORY.md +26 -29
  33. package/templates/common/SETUP.md +29 -22
  34. package/templates/common/scripts/scan-clean.mjs +80 -41
  35. package/templates/common/scripts/validate-harness.mjs +101 -31
  36. package/templates/common/scripts/wf-remove.mjs +279 -278
  37. package/templates/common/scripts/wf-update-check.mjs +395 -195
  38. package/templates/optional/skills/browser-e2e/.claude/skills/wf-browser/SKILL.md +1 -1
  39. package/templates/optional/skills/browser-e2e/Harness/workflows/browser-e2e.md +57 -21
package/README.md CHANGED
@@ -18,7 +18,7 @@ npx create-harness-vibe-coding@latest my-project
18
18
 
19
19
  ## Your Agent Knows What to Do
20
20
 
21
- Already have a project? **Don't read the docs**. Paste this sentence. Your agent handles the rest.
21
+ Already have a project? Paste this sentence. Your agent should use the script-first fast path: dry-run JSON first, read only files named in `agent.aiMergeRequired`, then run the structural validator.
22
22
 
23
23
  ```text
24
24
  Read and follow https://github.com/zingspark/create-harness-vibe-coding exactly to configure this project with create-harness-vibe-coding.
@@ -41,7 +41,7 @@ Chinese README: [README-CN.md](README-CN.md)
41
41
  | `subagent-orchestrator` | Runs parallel agents without collision |
42
42
  | `memory-master` + `context-master` | Learns from failures, compresses when full |
43
43
  | PRD + Research templates | Asks "what" and "why" before coding |
44
- | 11 built-in agents | Research, plan, architect, test, build, review, debug, verify |
44
+ | 16 built-in agents | Research, plan, architecture, TDD, build, review, debug, verify, memory/context, WF-MAX managers |
45
45
  | Architecture docs | Knows where boundaries live |
46
46
  | Context-loading protocol | Loads only the docs each agent needs |
47
47
  | `.claude/` + `.agents/skills/` | Claude Code and Codex skill adapters over the same Harness docs |
@@ -125,10 +125,15 @@ npx create-harness-vibe-coding@latest my-app . -y --dry-run --json
125
125
 
126
126
  # Add only what's missing. Never overwrite.
127
127
  npx create-harness-vibe-coding@latest my-app . -y --on-conflict skip --json
128
+
129
+ # Install-complete structural gate.
130
+ node Harness/scripts/validate-harness.mjs
128
131
  ```
129
132
 
130
133
  The JSON output is the agent's install report: `scan` replaces hand-written root probes, `plan.create` is script-owned, and `agent.aiMergeRequired` is the only list that needs semantic AI review. Do not read package source or templates unless `agent.aiMergeRequired` names a conflicting file.
131
134
 
135
+ For existing projects, a passing non-strict validator is the install-complete gate. `--strict` is the bootstrap/release gate and may fail until PRD, research, and architecture placeholders have been resolved from real project facts.
136
+
132
137
  `npx` is an install and safe-merge entry, not an update engine for an already installed Harness. Once `Harness/` exists, use `/wf-update` in Claude Code, `$wf-update` in Codex, or `node Harness/scripts/wf-update-check.mjs`; root entry conflicts such as `CLAUDE.md`, `AGENTS.md`, `.claude/`, `.agents/`, `.codex/`, and local Harness docs need agent-mediated merge decisions.
133
138
 
134
139
  | Flag | Does |
@@ -182,6 +187,14 @@ npx create-harness-vibe-coding@latest my-app . -y --dry-run --json
182
187
 
183
188
  Use `scan.markers` instead of manual top-level probes. Ask **at most 3 blocking questions** before touching files. Files in `plan.create` are handled by the script; only files in `agent.aiMergeRequired` need AI comparison and user-supervised merge decisions.
184
189
 
190
+ Fast path for an existing project with no installed `Harness/`:
191
+
192
+ 1. Run the dry-run JSON command.
193
+ 2. Run the JSON `agent.safeMergeCommand` to create only missing files.
194
+ 3. Patch only files listed in `agent.aiMergeRequired`; preserve project-owned content.
195
+ 4. Run `node Harness/scripts/validate-harness.mjs`.
196
+ 5. Stop and report install status. Defer `--strict` until bootstrap fills project-fact placeholders.
197
+
185
198
  Ask these only when they affect writes:
186
199
 
187
200
  - If `CLAUDE.md` or `AGENTS.md` already exists, should missing Harness guidance be merged, kept separate, or skipped?
@@ -205,7 +218,10 @@ Harness docs always live in root `Harness/`; do not route Harness files through
205
218
  # In this package repo
206
219
  npm test
207
220
 
208
- # In a generated project after bootstrap
221
+ # In an existing project immediately after safe-merge install
222
+ node Harness/scripts/validate-harness.mjs
223
+
224
+ # In a generated project after bootstrap, or before release
209
225
  node Harness/scripts/validate-harness.mjs --strict
210
226
  ```
211
227
 
@@ -229,7 +245,7 @@ my-project/
229
245
  │ ├── memory/ ← Durable self-learning
230
246
  │ └── scripts/ ← Validator
231
247
  ├── .claude/
232
- │ ├── agents/ ← 11 common agents
248
+ │ ├── agents/ ← 16 built-in agents
233
249
  │ ├── skills/ ← Claude Code skill commands
234
250
  │ └── rules/ ← Universal coding rules
235
251
  ├── .agents/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-harness-vibe-coding",
3
- "version": "0.8.5",
3
+ "version": "0.8.7",
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": {
package/src/generator.js CHANGED
@@ -350,8 +350,9 @@ function nextBackupPath(destPath) {
350
350
  }
351
351
 
352
352
  function registerOptionalContent(file, content, selectedSkills) {
353
- if (!selectedSkills.length) return content;
354
-
353
+ if (!selectedSkills.length) return content;
354
+ const hasBrowserE2e = selectedSkills.some(skill => skill.id === 'browser-e2e');
355
+
355
356
  if (file === 'Harness/MEMORY.md') {
356
357
  const lines = selectedSkills.map(skill => (
357
358
  `- [${skill.id}](../.claude/skills/${skill.id}/SKILL.md) - ${skill.description} Codex mirror: [${skill.id}](../.agents/skills/${skill.id}/SKILL.md). Workflow: [workflows/${skill.id}.md](workflows/${skill.id}.md)`
@@ -360,15 +361,33 @@ function registerOptionalContent(file, content, selectedSkills) {
360
361
  'Stack-specific skills can be added after the product shape is known.',
361
362
  `Installed optional skills:\n\n${lines.join('\n')}\n\nStack-specific skills can be added after the product shape is known.`,
362
363
  );
363
- }
364
-
365
- if (file === 'Harness/README.md') {
366
- const lines = selectedSkills.map(skill => (
367
- `- [${skill.title}](workflows/${skill.id}.md) - ${skill.description}`
368
- ));
369
- return `${content.trimEnd()}\n\n## Installed Optional Workflows\n\n${lines.join('\n')}\n`;
370
- }
371
-
364
+ }
365
+
366
+ if (file === 'Harness/README.md') {
367
+ const lines = selectedSkills.map(skill => (
368
+ `- [${skill.title}](workflows/${skill.id}.md) - ${skill.description}`
369
+ ));
370
+ let next = content;
371
+ if (hasBrowserE2e) {
372
+ next = next.replace(
373
+ '| Optional workflow installed |',
374
+ '| Browser E2E testing or automation | /wf-browser, $wf-browser, browser, e2e, web automation, screenshot verify, page test, browser test, Playwright, CDP | [workflows/browser-e2e.md](workflows/browser-e2e.md), [HARNESS_BRIDGE.md](HARNESS_BRIDGE.md) | UI/API contract, CLI commands, screenshots, traces, validation matrix |\n| Optional workflow installed |',
375
+ );
376
+ next = next.replace(
377
+ '| `/wf-readme [task]` |',
378
+ '| `/wf-browser [task]` | `$wf-browser [task]` | Optional browser automation/E2E workflow when `browser-e2e` is installed |\n| `/wf-readme [task]` |',
379
+ );
380
+ }
381
+ return `${next.trimEnd()}\n\n## Installed Optional Workflows\n\n${lines.join('\n')}\n`;
382
+ }
383
+
384
+ if (file === '.claude/commands/wf-help.md' && hasBrowserE2e) {
385
+ return content.replace(
386
+ '| `/wf-readme <task>` |',
387
+ '| `/wf-browser <task>` | optional workflow skill | `/wf-browser verify checkout flow` | Browser automation/E2E workflow with real UI interaction, screenshots, traces, and CDP/network evidence. |\n| `/wf-readme <task>` |',
388
+ );
389
+ }
390
+
372
391
  return content;
373
392
  }
374
393
 
package/src/index.js CHANGED
@@ -2,9 +2,13 @@
2
2
  import * as p from '@clack/prompts';
3
3
  import fs from 'node:fs';
4
4
  import path from 'node:path';
5
+ import { spawnSync } from 'node:child_process';
5
6
  import pc from 'picocolors';
6
7
  import { askConflictPolicy, askOptionalSelections, askProjectName, askTargetDir } from './prompts.js';
7
8
  import { generate, getOptionalCatalog } from './generator.js';
9
+
10
+ const UPDATE_SUCCESS_STATUSES = new Set(['up-to-date', 'update-available', 'partial-update']);
11
+ const UPDATE_FAILURE_STATUSES = new Set(['error', 'offline', 'template-remote', 'downgrade-refused']);
8
12
 
9
13
  // ── CLI flags ──────────────────────────────────────────────
10
14
  const raw = process.argv.slice(2);
@@ -85,6 +89,10 @@ if (generationOptions.json) {
85
89
  const projectName = argName || DEFAULT_NAME;
86
90
  const targetDir = argDir || `./${projectName}`;
87
91
  const scan = scanTarget(targetDir);
92
+ if (scan.hasHarness) {
93
+ printJsonResult(createUpdateSwitchResult(scan, { json: true }));
94
+ process.exit(0);
95
+ }
88
96
  const result = generate({ projectName, targetDir, ...generationOptions });
89
97
  result.scan = createJsonScan(scan);
90
98
  result.agent = createAgentGuidance(result, {
@@ -108,11 +116,16 @@ console.log('');
108
116
  let projectName, targetDir;
109
117
 
110
118
  // Non-interactive: positionals provided OR -y/--yes flag set
111
- if (argName || skipPrompts) {
112
- projectName = argName || DEFAULT_NAME;
113
- targetDir = argDir || `./${projectName}`;
114
-
115
- console.log(pc.dim('────────────────────────────────────────────'));
119
+ if (argName || skipPrompts) {
120
+ projectName = argName || DEFAULT_NAME;
121
+ targetDir = argDir || `./${projectName}`;
122
+ const scan = scanTarget(targetDir);
123
+
124
+ if (scan.hasHarness) {
125
+ process.exit(runUpdateSwitch(scan, { json: false }));
126
+ }
127
+
128
+ console.log(pc.dim('────────────────────────────────────────────'));
116
129
  console.log(` Project ${pc.green(projectName)}`);
117
130
  console.log(` Directory ${pc.green(targetDir)}`);
118
131
  console.log(` Creates ${pc.cyan('CLAUDE.md, README.md, Harness/PROGRESS.md, Harness/, .claude/, .agents/, tests/')}`);
@@ -159,6 +172,10 @@ if (argName || skipPrompts) {
159
172
  const scan = scanTarget(targetDir);
160
173
  printScan(scan);
161
174
 
175
+ if (scan.hasHarness) {
176
+ process.exit(runUpdateSwitch(scan, { json: false }));
177
+ }
178
+
162
179
  if (!generationOptions.dryRun && !conflictPolicyProvided && scan.needsConflictPolicy) {
163
180
  try {
164
181
  generationOptions.onConflict = await askConflictPolicy(scan);
@@ -429,6 +446,113 @@ function printJsonResult(result) {
429
446
  }
430
447
  }
431
448
 
449
+ function runUpdateSwitch(scan, { json }) {
450
+ const updateResult = createUpdateSwitchResult(scan, { json });
451
+ if (json) {
452
+ printJsonResult(updateResult);
453
+ return updateResult.success ? 0 : 1;
454
+ }
455
+
456
+ console.log('');
457
+ console.log(pc.yellow('Existing Harness detected. Switching to wf-update check.'));
458
+ console.log(pc.dim(`Directory ${scan.resolvedDir}`));
459
+ console.log(pc.dim('Command node Harness/scripts/wf-update-check.mjs'));
460
+ console.log('');
461
+
462
+ if (!updateResult.success && updateResult.error) {
463
+ console.error(pc.red(updateResult.error));
464
+ return 1;
465
+ }
466
+
467
+ if (updateResult.stdout) process.stdout.write(updateResult.stdout);
468
+ if (updateResult.stderr) process.stderr.write(updateResult.stderr);
469
+ return updateResult.exitCode ?? 0;
470
+ }
471
+
472
+ function getUpdateStatusError(update) {
473
+ if (!update || typeof update !== 'object' || typeof update.status !== 'string') {
474
+ return 'Update checker did not return a machine-readable status.';
475
+ }
476
+ if (UPDATE_FAILURE_STATUSES.has(update.status)) {
477
+ return `Update checker reported ${update.status}${update.message ? `: ${update.message}` : ''}`;
478
+ }
479
+ if (!UPDATE_SUCCESS_STATUSES.has(update.status)) {
480
+ return `Update checker returned unrecognized status: ${update.status}`;
481
+ }
482
+ return null;
483
+ }
484
+
485
+ function createUpdateSwitchResult(scan, { json }) {
486
+ const args = ['Harness/scripts/wf-update-check.mjs'];
487
+ if (json) args.push('--json');
488
+
489
+ const scriptPath = path.join(scan.resolvedDir, 'Harness', 'scripts', 'wf-update-check.mjs');
490
+ const command = `node ${args.join(' ')}`;
491
+ const base = {
492
+ success: false,
493
+ mode: 'update',
494
+ scan: createJsonScan(scan),
495
+ agent: {
496
+ sourceOfTruth: 'Existing Harness detected; install automatically switched to the target update checker. Do not continue install writes.',
497
+ updateCommand: json
498
+ ? 'node Harness/scripts/wf-update-check.mjs --json'
499
+ : 'node Harness/scripts/wf-update-check.mjs',
500
+ next: [
501
+ {
502
+ action: 'update',
503
+ command: json
504
+ ? 'node Harness/scripts/wf-update-check.mjs --json'
505
+ : 'node Harness/scripts/wf-update-check.mjs',
506
+ reason: 'Harness already exists, so updates must use the installed Harness update flow.',
507
+ },
508
+ ],
509
+ },
510
+ };
511
+
512
+ if (!fs.existsSync(scriptPath)) {
513
+ return {
514
+ ...base,
515
+ error: 'Existing Harness detected, but Harness/scripts/wf-update-check.mjs was not found. Install writes were skipped; inspect the existing Harness before updating manually.',
516
+ errors: ['Harness/scripts/wf-update-check.mjs not found'],
517
+ };
518
+ }
519
+
520
+ const result = spawnSync(process.execPath, args, {
521
+ cwd: scan.resolvedDir,
522
+ encoding: 'utf8',
523
+ });
524
+ const stdout = result.stdout || '';
525
+ const stderr = result.stderr || '';
526
+ const status = result.status ?? 1;
527
+
528
+ let update = undefined;
529
+ if (json && stdout.trim()) {
530
+ try {
531
+ update = JSON.parse(stdout.trim());
532
+ } catch {
533
+ update = { rawOutput: stdout };
534
+ }
535
+ }
536
+
537
+ const errors = [];
538
+ if (status !== 0) errors.push(`Update checker exited with status ${status}`);
539
+ if (json) {
540
+ const statusError = getUpdateStatusError(update);
541
+ if (statusError) errors.push(statusError);
542
+ }
543
+
544
+ return {
545
+ ...base,
546
+ success: errors.length === 0,
547
+ exitCode: status,
548
+ command,
549
+ stdout,
550
+ stderr,
551
+ ...(json ? { update } : {}),
552
+ ...(errors.length === 0 ? {} : { error: errors[0], errors }),
553
+ };
554
+ }
555
+
432
556
  function scanTarget(targetDir) {
433
557
  const resolvedDir = path.resolve(process.cwd(), targetDir);
434
558
  const exists = fs.existsSync(resolvedDir);
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: reflector
3
+ description: Use after verification and cross-review to synthesize findings, detect unresolved risk, and decide whether work may enter final acceptance.
4
+ tools: Read, Grep, Glob
5
+ model: sonnet
6
+ ---
7
+
8
+ # Reflector
9
+
10
+ You are the final reflection agent for the Harness workflow.
11
+
12
+ Load first:
13
+
14
+ - current task `PLAN.md` and `PROGRESS.md`
15
+ - acceptance criteria and contracts
16
+ - verifier evidence
17
+ - reviewer findings
18
+ - relevant diff or changed file list
19
+
20
+ Rules:
21
+
22
+ - Do not write files.
23
+ - Do not rerun implementation or verification.
24
+ - Check whether spec review and code/architecture/test review both passed.
25
+ - Treat contradictory reviewer or verifier output as unresolved until the controller resolves it.
26
+ - Reject closeout if evidence is missing, tests are only syntax-level for UI/API behavior, or critical/high findings remain.
27
+ - Prefer a short verdict over a long essay.
28
+
29
+ Return:
30
+
31
+ - verdict: PASS, RETURN_TO_DEBUG, or BLOCKED
32
+ - unresolved risks
33
+ - missing evidence
34
+ - whether final acceptance may proceed
35
+ - one-line memory candidate if a durable lesson was found
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: verifier
3
- description: Use to run verification commands, inspect results, and record evidence before marking work Done or Verified.
3
+ description: Use to run verification commands, inspect results, and record evidence. Final acceptance still waits for cross-review PASS and reflector PASS.
4
4
  tools: Read, Grep, Glob, Bash
5
5
  model: sonnet
6
6
  ---
@@ -20,8 +20,10 @@ Rules:
20
20
  - Do not write code.
21
21
  - Run only declared verification commands unless asked to expand coverage.
22
22
  - If a command is unavailable, record why and suggest a manual check.
23
- - Mark results as pass, fail, or not run with notes.
24
- - Do not mark work verified without evidence.
23
+ - Mark results as pass, fail, or not run with notes.
24
+ - Do not mark work verified without evidence.
25
+ - Do not claim final acceptance. Verification evidence is necessary but final
26
+ acceptance waits for cross-review PASS and reflector PASS.
25
27
 
26
28
  Return:
27
29
 
@@ -7,12 +7,11 @@ do not dispatch agents, and do not edit files.
7
7
  | --- | --- | --- | --- |
8
8
  | `/wf-help` | direct command | `/wf-help` | Show this command table. |
9
9
  | `/wf <task>` | workflow skill | `/wf fix failing login flow` | Standard acceptance-driven workflow for long, uncertain, multi-file, browser/API, or recovery work. |
10
- | `/wf-max <task>` | workflow skill | `/wf-max refactor auth module` | Maximum-parallelism workflow with CEO -> Manager -> Worker dispatch, write-set coloring, independent review, and validation. |
10
+ | `/wf-max <task>` | workflow skill | `/wf-max refactor auth module` | WF strict superset: complete role chain plus maximum fan-out, CEO -> Manager -> Worker dispatch, cross-CLI overflow when the current runtime agent pool is exhausted. |
11
11
  | `/wf-auto` | workflow skill | `/wf-auto` | Perpetual auto-optimization loop using bounded cycles, 8-angle exhaustion, evidence ledger, and optional wf-auto-only tick hook. |
12
12
  | `/wf-auto-spark` | workflow skill | `/wf-auto-spark` | Perpetual inspiration mode with roadmap anchoring and external spark search. |
13
13
  | `/wf-review <focus>` | workflow skill | `/wf-review security and test coverage` | Cross-model peer review through the other CLI; use for second opinions and risk checks. |
14
14
  | `/wf-learn` | workflow skill | `/wf-learn` | Force context-master -> memory-master learning cycle after repeated failures or closeout. |
15
- | `/wf-browser <task>` | optional workflow skill | `/wf-browser verify checkout flow` | Browser automation/E2E workflow with real UI interaction, screenshots, traces, and CDP/network evidence when installed. |
16
15
  | `/wf-readme <task>` | workflow skill | `/wf-readme polish quickstart` | Preserve, merge, or improve README docs without trampling existing project documentation. |
17
16
  | `/wf-update` | workflow skill | `/wf-update` | Check/apply Harness scaffold updates with safe file classification and conflict handling. |
18
17
  | `/wf-remove` | workflow skill | `/wf-remove` | Safely remove Harness files while preserving project/user data unless explicitly purged. |
@@ -24,6 +24,10 @@ subagent surfaces; follow the same Harness role contract either way.
24
24
  subagent/task tool.
25
25
  - Codex: use the available subagent tool or role mechanism in the current
26
26
  surface. If unavailable, emulate the same roles as separate bounded passes.
27
+ - WF-MAX cross-CLI overflow: prefer the current runtime's subagents first; if that pool
28
+ is exhausted, overflow to the other CLI with explicit dispatch packets
29
+ (Codex -> `claude -p`, Claude -> available Codex CLI such as `codex exec`)
30
+ before bounded-pass fallback.
27
31
  - In every runtime, record fallback and role coverage in the task plan.
28
32
 
29
33
  ## Rules
@@ -32,14 +36,16 @@ subagent surfaces; follow the same Harness role contract either way.
32
36
  integrates returns, and owns final verification.
33
37
  - Subagents or bounded passes are readers and reporters unless a write set is
34
38
  explicitly assigned and disjoint.
35
- - Explicit WF/WK mode requires at least three distinct role passes before the
36
- second plan.
39
+ - Explicit WF/WK mode requires complete role-chain coverage from intake through
40
+ final acceptance: plan, research/docs research as needed, architecture, test,
41
+ implement, independent validation, cross-review, reflector, and accept.
37
42
  - Every dispatch needs role, goal, mode, read set, write set, forbidden scope,
38
43
  injected docs, dependencies, evidence, stop condition, and return format.
39
44
  - Prefer parallel read-only exploration first. Serialize writers unless write
40
45
  sets are disjoint and isolated.
41
- - After implementation, run a spec review gate and a code/architecture review
42
- gate before final verification.
46
+ - After implementation, run independent spec/AC and code/architecture/test
47
+ review gates. Final acceptance is blocked until cross-review passes and the
48
+ reflector returns PASS.
43
49
 
44
50
  ## Return
45
51
 
@@ -29,8 +29,12 @@ This skill is a thin tool adapter. The authoritative workflow lives in
29
29
  - Create or update a task capsule under `Harness/tasks/<task-id>/`.
30
30
  - Run the WF loop from `Harness/WF.md`: intake, bounded exploration, second
31
31
  plan, implementation, review, verification, recovery, and closeout.
32
- - For explicit WF invocation, use at least three distinct role passes before
33
- the second plan. Use real subagents when the runtime supports them; otherwise
34
- record a bounded-pass fallback in the task plan.
32
+ - For explicit WF invocation, schedule the complete role chain at intake:
33
+ plan, research/docs research as needed, architecture, test, implement,
34
+ independent validation, cross-review, reflector, and final acceptance. Use
35
+ real subagents when the runtime supports them; otherwise record bounded-pass
36
+ fallback coverage in the task plan.
37
+ - Do not mark accepted until cross-review passes and the reflector returns
38
+ PASS.
35
39
  - Keep `Harness/tasks/<task-id>/PROGRESS.md#Heartbeat` current before long
36
40
  commands, after failures, and at closeout.
@@ -1,107 +1,59 @@
1
- ---
2
- name: wf-auto
3
- description: Perpetual auto-optimization mode. Never stops — continuously improves code until 8-angle exhaustion. Adaptive checkpoints, external spark search, evidence ledger. Use for Claude /wf-auto, Codex $wf-auto, auto mode, or when the user wants unbounded self-directed optimization.
4
- ---
5
-
6
- # WF Auto Perpetual Auto-Optimization
7
-
8
- ## Load (authoritative specs)
9
-
10
- - `Harness/WF-AUTO.md` — full spec: perpetual loop, state machine, 8-angle exhaustion gate, cross-model oracle, spark candidate provider, Value Gate scoring, evidence ledger, Intent Checkpoints, anti-patterns, safety controls
11
- - `Harness/subagents.md` — agent roster, controller role, efficiency ladder
12
- - `Harness/dispatch.md` — handoff format, File claim, Concurrency group fields
13
- - `Harness/agent-workflow.md` — build/review/test loop, cohesion rule, completion gate
14
- - `.claude/skills/wf-review/SKILL.md` — cross-model invocation pattern (used by the oracle step)
15
-
16
- ## Trigger & When NOT to Use
17
-
18
- - **Trigger**: Claude `/wf-auto`, Codex `$wf-auto`, `wf auto`, `auto mode`, or user wants continuous self-directed improvement
19
- - **Do NOT use**: user has a specific bounded task (use `/wf`), task needs maximum parallelism (use `/wf-max`), production hotfix needed urgently, codebase <100 lines
20
-
21
- ## State Machine
22
-
23
- ```
24
- auto.internal auto.spark auto.checkpoint auto.exhausted → paused
25
- ```
26
-
27
- CEO tracks state in `Harness/tasks/auto/PROGRESS.md`. Transitions are CEO-owned.
28
-
29
- ## Hard Constraints
30
-
31
- 1. **NEVER STOP except A-GATE.** No "task complete" early exit. The Angle Exhaustion Gate (internal + oracle + spark all empty, 3 confirm rounds) is the ONLY permitted stop.
32
- 2. **CEO never writes production code.** CEO uses Task, Read, Grep/Glob. No Edit/Write/Bash on source files. Exception: CEO MAY write to `Harness/tasks/auto/PROGRESS.md` and `Harness/tasks/auto/PLAN.md`.
33
- 3. **ALL sources in ONE message per cycle.** 8 angles + oracle + spark searchers. Batching is mandatory.
34
- 4. **ONE finding per cycle.** One change, ≤3 files, 50 lines diff. Big ideas (>50 lines) escalate to /wf or /wf-max then return.
35
- 5. **Two-gate review every cycle.** Spec review before code-quality review. No skipping.
36
- 6. **A-GATE has 3 tiers.** All 8 exhausted → Cross-Model Oracle → Spark search → 2 confirmation rounds → STOP.
37
- 7. **Value Gate is scored, not binary.** 5 dimensions (Impact, Evidence, Fit, Timing, Cost/Risk), 1-5 each. Pass: ≥18/25 AND no dimension <3.
38
- 8. **Intent Checkpoint is adaptive.** 2→5→10 cycles. Exactly 2 questions: "Still aligned?" + "What should change?" Early on drift signals.
39
- 9. **Evidence ledger per cycle.** Source, evidence type, expected impact, verification method, measured result, verdict. Track weak spark count.
40
-
41
- ## The 8 Angles (quick reference)
42
-
43
- | # | Angle | Finds |
44
- |---|-------|-------|
45
- | 1 | Correctness | Bugs, edge cases, null safety, race conditions |
46
- | 2 | Performance | Slow paths, memory, algorithmic complexity |
47
- | 3 | Security | Injection, auth, secrets, dependency CVEs |
48
- | 4 | Maintainability | Clarity, DRY, coupling, naming, dead code |
49
- | 5 | Test Coverage | Missing tests, weak assertions, flaky tests |
50
- | 6 | Architecture | Boundaries, dependency direction, layer discipline |
51
- | 7 | UX / DX | Error messages, API ergonomics, documentation |
52
- | 8 | Robustness | Resilience, retry, observability, recovery |
53
-
54
- ## Spark Sources (when internal + oracle empty)
55
-
56
- | # | Source | Evidence Weight |
57
- |---|--------|-----------------|
58
- | 1 | Official Docs & Advisories | HIGH |
59
- | 2 | Ecosystem Pulse | MEDIUM |
60
- | 3 | GitHub Trending (same stack) | LOW-MEDIUM |
61
- | 4 | Best Practices (latest) | MEDIUM |
62
- | 5 | Competitor/Peer Projects | LOW |
63
- | 6 | Real-world Issues | MEDIUM |
64
- | 7 | Architecture Trends | LOW |
65
- | 8 | Performance Benchmarks | MEDIUM |
66
-
67
- Source-quality: official docs > blog posts. Trending ≠ correct. Competitor behavior is hypothesis only. Every spark MUST cite source with URL and date.
68
-
69
- ## Perpetual Loop
70
-
71
- ```
72
- W0: SENSE (8 angles + oracle + 8 spark sources, all parallel)
73
- A-GATE [findings? → W1 | all empty? → oracle → spark → confirm ×2 → STOP]
74
- CHECKPOINT [every 2→5→10 cycles, 2 questions]
75
- W1: PRIORITIZE (across internal + oracle + spark)
76
- W2: IMPLEMENT → W3: REVIEW → W4: DEBUG → W5: VERIFY
77
- RECORD + EVIDENCE LEDGER → LOOP W0
78
- ```
79
-
80
- ## Cycle Recording
81
-
82
- Every cycle writes to `Harness/tasks/auto/PROGRESS.md`:
83
- - Cycle number, timestamp, state
84
- - Source (internal/oracle/spark-*), source citation
85
- - Finding, change description, files changed
86
- - Value Gate scores (if spark candidate)
87
- - Review result, verification evidence
88
- - Evidence Ledger: evidence type, expected impact, verification method, measured result, verdict
89
-
90
- ## Safety
91
-
92
- - ≤3 files, ≤50 lines per cycle
93
- - Big ideas (>50 lines) escalate to /wf or /wf-max, then return to auto
94
- - Destructive changes flagged with rollback plan
95
- - IDLE alarm after 5 empty cycles → re-scope → A-GATE candidate
96
- - Spark stop: 5 failed Value Gates OR 3 weak measured impacts OR 2 repeated source families empty
97
- - User can interrupt at any time
98
-
99
- ## Return Format
100
-
101
- - Total cycles run
102
- - Findings addressed per source (internal / oracle / spark)
103
- - Evidence ledger with measured impacts
104
- - Exhaustion evidence (3-round confirmation)
105
- - Weak spark count
106
- - Final codebase state
107
- - Residual risk assessment
1
+ ---
2
+ name: wf-auto
3
+ description: Perpetual auto-optimization mode. Never stops until 8-angle exhaustion. Inherits WF acceptance gates and subagent orchestration per cycle. Use for Claude /wf-auto, Codex $wf-auto, auto mode, or unbounded self-directed optimization.
4
+ ---
5
+
6
+ # WF Auto - Perpetual Auto-Optimization
7
+
8
+ ## Load
9
+
10
+ - `Harness/WF-AUTO.md`
11
+ - `Harness/subagents.md`
12
+ - `Harness/dispatch.md`
13
+ - `Harness/agent-workflow.md`
14
+ - `.claude/skills/wf-review/SKILL.md`
15
+
16
+ ## Trigger
17
+
18
+ - Claude `/wf-auto`
19
+ - Codex `$wf-auto`
20
+ - `wf auto`, `auto mode`, or a request for continuous self-directed improvement
21
+
22
+ Do not use when the user gives a bounded task, requests maximum parallelism
23
+ (`/wf-max`), needs an urgent production hotfix, or the codebase is tiny enough
24
+ that auto scanning costs more than it helps.
25
+
26
+ ## Hard Rules
27
+
28
+ 1. Never stop except the A-GATE: all 8 angles empty, oracle empty, spark empty,
29
+ and 2 confirmation rounds.
30
+ 2. CEO never edits production source. CEO may write only
31
+ `Harness/tasks/auto/PLAN.md` and `Harness/tasks/auto/PROGRESS.md`.
32
+ 3. Dispatch all W0 sources in one batch when the runtime allows it: 8 angles,
33
+ oracle, and spark searchers.
34
+ 4. One accepted finding per cycle: <=3 files and <=50 changed lines. Larger
35
+ ideas escalate to `/wf` or `/wf-max`, then return to auto.
36
+ 5. Every accepted cycle inherits the full WF chain:
37
+ `Mini PRD -> AC IDs -> test/validation plan -> implementer -> verifier ->
38
+ cross-review -> reflector PASS -> evidence ledger -> next W0`.
39
+ 6. Review is mandatory: spec review, code-quality review, then reflector.
40
+ 7. Value Gate is scored for spark candidates: pass is >=18/25 and no dimension
41
+ below 3.
42
+ 8. Intent Checkpoint is adaptive: 2 -> 5 -> 10 cycles, exactly two questions.
43
+ 9. Record compact evidence per cycle; do not paste full logs or transcripts.
44
+
45
+ ## Loop
46
+
47
+ ```text
48
+ W0: SENSE (8 angles + oracle + spark sources)
49
+ A-GATE: continue, oracle, spark, confirm, or stop
50
+ W1: PRIORITIZE one finding
51
+ W2-W5: Mini PRD -> AC -> test/validation plan -> implementer -> verifier -> cross-review -> reflector PASS
52
+ RECORD: evidence ledger
53
+ LOOP: next W0
54
+ ```
55
+
56
+ ## Return
57
+
58
+ Report cycles run, findings addressed by source, evidence ledger, exhaustion
59
+ evidence if any, weak spark count, final state, and residual risks.