create-harness-vibe-coding 0.8.16 → 0.8.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README-CN.md +98 -127
  3. package/README.md +61 -42
  4. package/package.json +1 -1
  5. package/src/generator.js +15 -24
  6. package/src/index.js +1 -1
  7. package/templates/common/.claude/commands/wf-auto-spark.md +16 -0
  8. package/templates/common/.claude/commands/wf-auto.md +16 -0
  9. package/templates/{optional/skills/browser-e2e/.opencode → common/.claude}/commands/wf-browser.md +1 -1
  10. package/templates/common/.claude/commands/wf-help.md +9 -6
  11. package/templates/common/.claude/commands/wf-learn.md +16 -0
  12. package/templates/common/.claude/commands/wf-max.md +20 -0
  13. package/templates/common/.claude/commands/wf-readme.md +16 -0
  14. package/templates/common/.claude/commands/wf-remove.md +16 -0
  15. package/templates/common/.claude/commands/wf-review.md +16 -0
  16. package/templates/common/.claude/commands/wf.md +16 -0
  17. package/templates/common/.claude/rules/ecc/common.md +1 -1
  18. package/templates/common/.claude/skills/wf-browser/SKILL.md +176 -0
  19. package/templates/common/.claude/skills/wf-help/SKILL.md +30 -0
  20. package/templates/common/.claude/skills/wf-max/SKILL.md +21 -7
  21. package/templates/common/.codex/config.toml +3 -5
  22. package/templates/common/.harness-version +69 -36
  23. package/templates/common/.opencode/agents/architect-manager.md +7 -1
  24. package/templates/common/.opencode/agents/explore-manager.md +10 -1
  25. package/templates/common/.opencode/agents/implement-manager.md +5 -3
  26. package/templates/common/.opencode/agents/review-manager.md +5 -2
  27. package/templates/common/.opencode/commands/wf-browser.md +16 -0
  28. package/templates/common/.opencode/commands/wf-help.md +9 -6
  29. package/templates/common/.opencode/commands/wf-max.md +12 -7
  30. package/templates/common/CLAUDE.md +2 -2
  31. package/templates/common/Harness/MEMORY.md +3 -3
  32. package/templates/common/Harness/README.md +12 -11
  33. package/templates/common/Harness/ownership.manifest.json +77 -14
  34. package/templates/common/Harness/scripts/archive-tasks.mjs +12 -220
  35. package/templates/common/Harness/scripts/scan-clean.mjs +3 -9
  36. package/templates/common/Harness/scripts/task-state.mjs +889 -0
  37. package/templates/common/Harness/scripts/validate-harness.mjs +233 -28
  38. package/templates/common/Harness/scripts/wf-remove.mjs +3 -3
  39. package/templates/common/Harness/scripts/wf-update-check.mjs +3 -0
  40. package/templates/common/Harness/specs/guides/SETUP.md +2 -2
  41. package/templates/common/Harness/specs/protocols/TASK_ARCHIVE.md +43 -23
  42. package/templates/common/Harness/specs/runtime/dispatch.md +2 -2
  43. package/templates/common/Harness/specs/runtime/subagents.md +9 -5
  44. package/templates/common/Harness/specs/workflows/WF-AUTO.md +6 -6
  45. package/templates/common/Harness/specs/workflows/WF-KERNEL.md +1 -1
  46. package/templates/common/Harness/specs/workflows/WF-MAX.md +30 -2
  47. package/templates/common/Harness/specs/workflows/WF-STATE.md +89 -36
  48. package/templates/common/opencode.json +1 -0
  49. package/templates/optional/catalog.json +2 -9
  50. package/templates/optional/skills/browser-e2e/.claude/skills/browser-e2e/SKILL.md +0 -42
  51. package/templates/optional/skills/browser-e2e/.claude/skills/wf-browser/SKILL.md +0 -201
  52. package/templates/optional/skills/browser-e2e/Harness/workflows/browser-e2e.md +0 -119
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "generator": "0.8.16",
3
+ "generator": "0.8.17",
4
4
  "source": "https://raw.githubusercontent.com/LiWeny16/create-harness-vibe-coding/main/templates/common/",
5
- "generated": "2026-07-23T11:33:41.125Z",
5
+ "generated": "2026-07-26T09:26:35.146Z",
6
6
  "preserve": [
7
7
  "Harness/PROGRESS.md",
8
8
  "Harness/tasks/**",
@@ -191,6 +191,16 @@
191
191
  "kind": "skill",
192
192
  "overwrite": "safe"
193
193
  },
194
+ {
195
+ "path": ".agents/skills/wf-browser/SKILL.md",
196
+ "kind": "skill",
197
+ "overwrite": "safe"
198
+ },
199
+ {
200
+ "path": ".agents/skills/wf-help/SKILL.md",
201
+ "kind": "skill",
202
+ "overwrite": "safe"
203
+ },
194
204
  {
195
205
  "path": ".agents/skills/wf-learn/SKILL.md",
196
206
  "kind": "skill",
@@ -321,16 +331,61 @@
321
331
  "kind": "agent",
322
332
  "overwrite": "safe"
323
333
  },
334
+ {
335
+ "path": ".claude/commands/wf-auto-spark.md",
336
+ "kind": "command",
337
+ "overwrite": "safe"
338
+ },
339
+ {
340
+ "path": ".claude/commands/wf-auto.md",
341
+ "kind": "command",
342
+ "overwrite": "safe"
343
+ },
344
+ {
345
+ "path": ".claude/commands/wf-browser.md",
346
+ "kind": "command",
347
+ "overwrite": "safe"
348
+ },
324
349
  {
325
350
  "path": ".claude/commands/wf-help.md",
326
351
  "kind": "command",
327
352
  "overwrite": "safe"
328
353
  },
354
+ {
355
+ "path": ".claude/commands/wf-learn.md",
356
+ "kind": "command",
357
+ "overwrite": "safe"
358
+ },
359
+ {
360
+ "path": ".claude/commands/wf-max.md",
361
+ "kind": "command",
362
+ "overwrite": "safe"
363
+ },
364
+ {
365
+ "path": ".claude/commands/wf-readme.md",
366
+ "kind": "command",
367
+ "overwrite": "safe"
368
+ },
369
+ {
370
+ "path": ".claude/commands/wf-remove.md",
371
+ "kind": "command",
372
+ "overwrite": "safe"
373
+ },
374
+ {
375
+ "path": ".claude/commands/wf-review.md",
376
+ "kind": "command",
377
+ "overwrite": "safe"
378
+ },
329
379
  {
330
380
  "path": ".claude/commands/wf-update.md",
331
381
  "kind": "command",
332
382
  "overwrite": "safe"
333
383
  },
384
+ {
385
+ "path": ".claude/commands/wf.md",
386
+ "kind": "command",
387
+ "overwrite": "safe"
388
+ },
334
389
  {
335
390
  "path": ".claude/rules/ecc/common.md",
336
391
  "kind": "config",
@@ -366,6 +421,16 @@
366
421
  "kind": "skill",
367
422
  "overwrite": "safe"
368
423
  },
424
+ {
425
+ "path": ".claude/skills/wf-browser/SKILL.md",
426
+ "kind": "skill",
427
+ "overwrite": "safe"
428
+ },
429
+ {
430
+ "path": ".claude/skills/wf-help/SKILL.md",
431
+ "kind": "skill",
432
+ "overwrite": "safe"
433
+ },
369
434
  {
370
435
  "path": ".claude/skills/wf-learn/SKILL.md",
371
436
  "kind": "skill",
@@ -516,6 +581,11 @@
516
581
  "kind": "command",
517
582
  "overwrite": "safe"
518
583
  },
584
+ {
585
+ "path": ".opencode/commands/wf-browser.md",
586
+ "kind": "command",
587
+ "overwrite": "safe"
588
+ },
519
589
  {
520
590
  "path": ".opencode/commands/wf-help.md",
521
591
  "kind": "command",
@@ -591,6 +661,11 @@
591
661
  "kind": "script",
592
662
  "overwrite": "safe"
593
663
  },
664
+ {
665
+ "path": "Harness/scripts/task-state.mjs",
666
+ "kind": "script",
667
+ "overwrite": "safe"
668
+ },
594
669
  {
595
670
  "path": "Harness/scripts/validate-harness.mjs",
596
671
  "kind": "script",
@@ -763,18 +838,6 @@
763
838
  }
764
839
  ],
765
840
  "optionalOwned": [
766
- {
767
- "option": "browser-e2e",
768
- "paths": [
769
- ".agents/skills/browser-e2e/SKILL.md",
770
- ".agents/skills/wf-browser/SKILL.md",
771
- ".claude/skills/browser-e2e/SKILL.md",
772
- ".claude/skills/wf-browser/SKILL.md",
773
- ".opencode/commands/wf-browser.md",
774
- "Harness/workflows/browser-e2e.md"
775
- ],
776
- "overwrite": "safe-if-installed"
777
- },
778
841
  {
779
842
  "option": "github-pr-review",
780
843
  "paths": [
@@ -1,26 +1,21 @@
1
1
  #!/usr/bin/env node
2
- import fs from 'node:fs';
2
+ import { spawnSync } from 'node:child_process';
3
3
  import path from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
4
5
 
5
- const root = process.cwd();
6
- const tasksDir = path.join(root, 'Harness', 'tasks');
7
- const archiveDir = path.join(tasksDir, '_archive');
8
-
6
+ const __filename = fileURLToPath(import.meta.url);
7
+ const __dirname = path.dirname(__filename);
8
+ const taskState = path.join(__dirname, 'task-state.mjs');
9
9
  const args = process.argv.slice(2);
10
- const flags = {
11
- dryRun: !args.includes('--apply'),
12
- apply: args.includes('--apply'),
13
- json: args.includes('--json'),
14
- keep: parseInt(args.includes('--keep') ? args[args.indexOf('--keep') + 1] : '5', 10),
15
- task: args.includes('--task') ? args[args.indexOf('--task') + 1] : null,
16
- };
17
10
 
18
11
  if (args.includes('--help') || args.includes('-h')) {
19
12
  console.log(`Usage: node Harness/scripts/archive-tasks.mjs [options]
20
13
 
14
+ Compatibility entry for: node Harness/scripts/task-state.mjs archive [options]
15
+
21
16
  Options:
22
17
  --dry-run Show what would be archived without moving files (default)
23
- --apply Execute the archive moves
18
+ --apply Execute archive moves
24
19
  --keep <n> Keep at most <n> non-archived tasks (default: 5)
25
20
  --task <id> Archive only the specified task
26
21
  --json Output results as JSON
@@ -28,212 +23,9 @@ Options:
28
23
  process.exit(0);
29
24
  }
30
25
 
31
- const RESERVED = new Set(['_template', '_archive', 'auto']);
32
- const NEVER_ARCHIVE_STATUSES = new Set([
33
- 'active', 'blocked', 'in_progress', 'running', 'pending', 'needs-user-decision',
34
- ]);
35
- const SAFE_ARCHIVE_STATUSES = new Set([
36
- 'complete', 'verified', 'archived', 'abandoned', 'obsolete', 'done', 'closed', 'closeout',
37
- ]);
38
-
39
- function readStateJson(taskDir) {
40
- const statePath = path.join(tasksDir, taskDir, 'STATE.json');
41
- if (!fs.existsSync(statePath)) return null;
42
- try {
43
- return JSON.parse(fs.readFileSync(statePath, 'utf8'));
44
- } catch {
45
- return null;
46
- }
47
- }
48
-
49
- function readProgressPhase(taskDir) {
50
- const progressPath = path.join(tasksDir, taskDir, 'PROGRESS.md');
51
- if (!fs.existsSync(progressPath)) return null;
52
- const text = fs.readFileSync(progressPath, 'utf8');
53
- // Match "- Phase: X", "Phase: X", or "Current: X" (task capsules use all three).
54
- const match = text.match(/^(?:-\s*)?(?:Phase|Current(?: phase)?):\s*([A-Za-z_-]+)/mi);
55
- return match ? match[1].trim().toLowerCase() : null;
56
- }
57
-
58
- function canArchive(taskDir) {
59
- if (RESERVED.has(taskDir)) return { ok: false, reason: 'reserved directory' };
60
- if (taskDir.startsWith('_')) return { ok: false, reason: 'system directory' };
61
-
62
- const state = readStateJson(taskDir);
63
- const status = state?.status?.toLowerCase() || '';
64
- const phase = state?.phase?.toLowerCase() || '';
65
-
66
- if (NEVER_ARCHIVE_STATUSES.has(status)) {
67
- return { ok: false, reason: `status "${status}" is never auto-archived` };
68
- }
69
- if (NEVER_ARCHIVE_STATUSES.has(phase)) {
70
- return { ok: false, reason: `phase "${phase}" is never auto-archived` };
71
- }
72
-
73
- if (SAFE_ARCHIVE_STATUSES.has(status) || SAFE_ARCHIVE_STATUSES.has(phase)) {
74
- return { ok: true, reason: `status/phase allows archive` };
75
- }
76
-
77
- // Fallback: check PROGRESS.md phase
78
- const progressPhase = readProgressPhase(taskDir);
79
- if (progressPhase && SAFE_ARCHIVE_STATUSES.has(progressPhase)) {
80
- return { ok: true, reason: `PROGRESS.md phase "${progressPhase}" allows archive` };
81
- }
82
- if (progressPhase && NEVER_ARCHIVE_STATUSES.has(progressPhase)) {
83
- return { ok: false, reason: `PROGRESS.md phase "${progressPhase}" is never auto-archived` };
84
- }
85
-
86
- return { ok: false, reason: 'status indeterminate — requires manual review' };
87
- }
88
-
89
- function scandir(dir) {
90
- if (!fs.existsSync(dir)) return [];
91
- return fs.readdirSync(dir, { withFileTypes: true })
92
- .filter(e => e.isDirectory())
93
- .map(e => e.name);
94
- }
95
-
96
- function safeResolve(...segments) {
97
- const resolved = path.resolve(root, ...segments);
98
- const normalized = resolved.replace(/\\/g, '/');
99
- const tasksPrefix = tasksDir.replace(/\\/g, '/');
100
- if (!normalized.startsWith(tasksPrefix + '/') && normalized !== tasksPrefix) {
101
- throw new Error(`Path "${resolved}" is outside Harness/tasks/ — aborting`);
102
- }
103
- return resolved;
104
- }
105
-
106
- function mkdirIfMissing(dir) {
107
- if (!fs.existsSync(dir)) {
108
- if (flags.apply) {
109
- fs.mkdirSync(dir, { recursive: true });
110
- }
111
- return true;
112
- }
113
- return false;
114
- }
115
-
116
- function resultsToJson(results) {
117
- return JSON.stringify(results, null, 2);
118
- }
119
-
120
- // Main
121
- const taskDirs = scandir(tasksDir).filter(d => !RESERVED.has(d));
122
- const candidates = flags.task
123
- ? taskDirs.filter(d => d === flags.task)
124
- : taskDirs;
125
-
126
- if (flags.task && candidates.length === 0) {
127
- const msg = `Task "${flags.task}" not found in Harness/tasks/`;
128
- if (flags.json) console.log(resultsToJson({ error: msg }));
129
- else console.error(msg);
130
- process.exit(1);
131
- }
132
-
133
- const results = [];
134
- const skipped = [];
135
-
136
- // Read active task from PROGRESS.md
137
- const progressPath = path.join(root, 'Harness', 'PROGRESS.md');
138
- let activeTask = null;
139
- if (fs.existsSync(progressPath)) {
140
- const text = fs.readFileSync(progressPath, 'utf8');
141
- const match = text.match(/## Active Task\s*\n+\s*-\s*(.+)/);
142
- if (match) activeTask = match[1].trim();
143
- }
144
-
145
- const archiveable = [];
146
- for (const dir of candidates) {
147
- if (dir === activeTask) {
148
- skipped.push({ dir, reason: 'active task' });
149
- continue;
150
- }
151
- const result = canArchive(dir);
152
- if (result.ok) {
153
- archiveable.push(dir);
154
- } else {
155
- skipped.push({ dir, reason: result.reason });
156
- }
157
- }
158
-
159
- // Sort by modified time (oldest first) to archive oldest first
160
- archiveable.sort((a, b) => {
161
- const statA = fs.statSync(path.join(tasksDir, a));
162
- const statB = fs.statSync(path.join(tasksDir, b));
163
- return statA.mtimeMs - statB.mtimeMs;
26
+ const result = spawnSync(process.execPath, [taskState, 'archive', ...args], {
27
+ cwd: process.cwd(),
28
+ stdio: 'inherit',
164
29
  });
165
30
 
166
- // Determine how many to archive: keep `flags.keep` non-archived
167
- const currentNonArchived = taskDirs.length;
168
- const toArchiveCount = flags.task
169
- ? archiveable.length
170
- : Math.max(0, currentNonArchived - flags.keep);
171
-
172
- const toArchive = archiveable.slice(0, toArchiveCount);
173
-
174
- for (const dir of toArchive) {
175
- const stat = fs.statSync(path.join(tasksDir, dir));
176
- const year = new Date(stat.mtimeMs).getFullYear().toString();
177
- const src = safeResolve('Harness', 'tasks', dir);
178
- const destDir = safeResolve('Harness', 'tasks', '_archive', year);
179
- const dest = path.join(destDir, dir);
180
-
181
- if (flags.apply) {
182
- mkdirIfMissing(destDir);
183
- fs.renameSync(src, dest);
184
-
185
- // Update STATE.json status to archived
186
- const statePath = path.join(dest, 'STATE.json');
187
- if (fs.existsSync(statePath)) {
188
- try {
189
- const state = JSON.parse(fs.readFileSync(statePath, 'utf8'));
190
- state.status = 'archived';
191
- state.phase = 'archived';
192
- state.updatedAt = new Date().toISOString();
193
- fs.writeFileSync(statePath, JSON.stringify(state, null, 2) + '\n');
194
- } catch {
195
- // If STATE.json is broken, leave it alone
196
- }
197
- }
198
-
199
- results.push({ dir, year, action: 'archived', status: 'moved' });
200
- } else {
201
- results.push({ dir, year, action: 'would-archive', status: 'dry-run' });
202
- }
203
- }
204
-
205
- for (const s of skipped) {
206
- results.push({ dir: s.dir, year: null, action: 'skipped', status: s.reason });
207
- }
208
-
209
- // Update INDEX.md
210
- const indexPath = path.join(archiveDir, 'INDEX.md');
211
- const indexEntries = results
212
- .filter(r => r.action === 'archived')
213
- .map(r => `| ${r.dir} | ${r.year} | ${new Date().toISOString().split('T')[0]} |`);
214
-
215
- if (indexEntries.length > 0 && flags.apply) {
216
- mkdirIfMissing(archiveDir);
217
- const existingIndex = fs.existsSync(indexPath)
218
- ? fs.readFileSync(indexPath, 'utf8')
219
- : '| Task | Year | Archived |\n|------|------|----------|\n';
220
- const newEntries = indexEntries.join('\n') + '\n';
221
- fs.writeFileSync(indexPath, existingIndex + newEntries);
222
- }
223
-
224
- if (flags.json) {
225
- console.log(resultsToJson({
226
- scanned: candidates.length,
227
- archiveable: archiveable.length,
228
- toArchive: toArchive.length,
229
- skipped: skipped.length,
230
- dryRun: flags.dryRun,
231
- results,
232
- }));
233
- } else {
234
- if (flags.dryRun) console.log('[DRY RUN] No files moved. Use --apply to execute.');
235
- console.log(`Scanned: ${candidates.length}, Archiveable: ${archiveable.length}, To archive: ${toArchive.length}, Skipped: ${skipped.length}`);
236
- for (const r of results) {
237
- console.log(` ${r.action}: ${r.dir} (${r.status})${r.year ? ' → _archive/' + r.year : ''}`);
238
- }
239
- }
31
+ process.exit(result.status ?? 1);
@@ -120,18 +120,12 @@ function optionalSkillFromSource(source) {
120
120
  return match ? match[1] : null;
121
121
  }
122
122
 
123
+ const RETIRED_OPTION_IDS = new Set(['browser-e2e']);
124
+
123
125
  function isInstalledOptionalFile(file, localVersion) {
124
126
  const skillId = optionalSkillFromSource(localVersion?.sources?.[file]);
127
+ if (skillId && RETIRED_OPTION_IDS.has(skillId)) return false;
125
128
  if (skillId && selectedOptionIds(localVersion).has(skillId)) return true;
126
- // Also check if the file is in the optional file patterns (not tracked in common checksums)
127
- // e.g. .opencode/commands/wf-browser.md from browser-e2e
128
- const canonical = canonicalPath(file);
129
- if (/^\.opencode\/commands\/wf-browser\.md$/.test(canonical)) {
130
- return selectedOptionIds(localVersion).has('browser-e2e');
131
- }
132
- if (/^\.claude\/skills\/wf-browser\//.test(canonical)) {
133
- return selectedOptionIds(localVersion).has('browser-e2e');
134
- }
135
129
  return false;
136
130
  }
137
131