create-harness-vibe-coding 0.8.0 → 0.8.2

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 (37) hide show
  1. package/README-CN.md +40 -24
  2. package/README.md +44 -20
  3. package/package.json +1 -1
  4. package/src/generator.js +1 -1
  5. package/src/index.js +211 -11
  6. package/src/prompts.js +1 -1
  7. package/templates/common/.claude/agents/tdd-guide.md +55 -0
  8. package/templates/common/.claude/settings.json +22 -0
  9. package/templates/common/.claude/skills/tdd/SKILL.md +30 -0
  10. package/templates/common/.claude/skills/wf-auto/SKILL.md +107 -0
  11. package/templates/common/.claude/skills/wf-auto-spark/SKILL.md +39 -0
  12. package/templates/common/.claude/skills/wf-max/SKILL.md +10 -2
  13. package/templates/common/.claude/skills/wf-remove/SKILL.md +12 -5
  14. package/templates/common/.claude/skills/wf-update/SKILL.md +12 -5
  15. package/templates/common/.codex/hooks.json +59 -37
  16. package/templates/common/.harness-version +48 -25
  17. package/templates/common/AGENTS.md +5 -5
  18. package/templates/common/CLAUDE.md +12 -17
  19. package/templates/common/Harness/ECC-GUIDE.md +246 -0
  20. package/templates/common/Harness/README.md +129 -130
  21. package/templates/common/Harness/TDD-GUIDE.md +83 -0
  22. package/templates/common/Harness/WF-AUTO-SPARK.md +297 -0
  23. package/templates/common/Harness/WF-AUTO.md +508 -0
  24. package/templates/common/Harness/WF-MAX.md +24 -0
  25. package/templates/common/Harness/context-loading.md +38 -1
  26. package/templates/common/Harness/dispatch.md +40 -40
  27. package/templates/common/Harness/subagents.md +7 -21
  28. package/templates/common/Harness/tasks/_template/NAMING.md +47 -0
  29. package/templates/common/MEMORY.md +73 -66
  30. package/templates/common/SETUP.md +98 -63
  31. package/templates/common/scripts/validate-harness.mjs +92 -58
  32. package/templates/common/scripts/wf-mode-hook.mjs +895 -318
  33. package/templates/common/scripts/wf-remove.mjs +301 -81
  34. package/templates/common/scripts/wf-statusline.ps1 +62 -38
  35. package/templates/common/scripts/wf-statusline.sh +67 -48
  36. package/templates/common/scripts/wf-update-check.mjs +179 -81
  37. package/templates/optional/catalog.json +5 -5
@@ -0,0 +1,297 @@
1
+ # WF-AUTO-SPARK — Perpetual Inspiration Mode
2
+
3
+ **Extension of `/wf-auto`. Never stops. Searches external sources for new ideas. Long-term roadmap with staged milestones. Goals adjustable but ≤50% deviation from North Star.**
4
+
5
+ ## Trigger
6
+
7
+ - User explicitly invokes `/wf-auto-spark` or `$wf-auto-spark`
8
+ - Auto-degrade from `/wf-auto` when user can't clarify direction at Re-Anchor Gate
9
+ - Auto-activate when 8-angle scan returns empty for 3+ consecutive cycles AND oracle also empty
10
+
11
+ ## Core Philosophy
12
+
13
+ **"Inspiration never runs dry, but direction must hold."**
14
+
15
+ Spark mode replaces the 8-angle internal scan with EXTERNAL inspiration search. Unlike vanilla `/wf-auto` which can stop when no internal improvements are found, spark mode NEVER stops — it always looks outward for the next idea.
16
+
17
+ But perpetual search without direction = drift. The **Roadmap** is the anchor.
18
+
19
+ ## Startup: Roadmap Declaration
20
+
21
+ Before first spark cycle, CEO MUST declare a roadmap. This is written to `Harness/tasks/auto/SPARK-ROADMAP.md`.
22
+
23
+ ### Roadmap Format
24
+
25
+ ```markdown
26
+ # Spark Roadmap: <descriptive title>
27
+
28
+ ## North Star (immutable without user consent)
29
+ <One sentence. The ultimate outcome this project is building toward.
30
+ Answers: "What does success look like in 6-12 months?">
31
+
32
+ ## Current Milestone: M<N>
33
+ **Goal**: <measurable outcome>
34
+ **Success criteria**: <how we know M<N> is done>
35
+ **Target cycles**: <expected spark cycles to complete>
36
+
37
+ ## Upcoming Milestones
38
+ | # | Goal | Success Criteria | Est. Cycles | Dependencies |
39
+ |---|------|-----------------|-------------|--------------|
40
+ | M2 | ... | ... | ... | M1 |
41
+ | M3 | ... | ... | ... | M2 |
42
+
43
+ ## Constraints
44
+ - Max deviation from North Star: 50% (checked per cycle and per milestone)
45
+ - Roadmap review: every 10 spark cycles or at milestone completion
46
+ - Milestones can be reordered, split, merged, or replaced (≤50% deviation)
47
+ - North Star change requires explicit user confirmation
48
+ ```
49
+
50
+ ### Roadmap Rules
51
+
52
+ 1. **North Star is near-immutable.** CEO can propose changes but MUST get user confirmation. No silent drift.
53
+ 2. **Milestones are flexible within 50% deviation.** CEO can adjust order, split, merge, or replace milestones as external inspiration reveals better paths — as long as the new direction is ≥50% aligned with the North Star.
54
+ 3. **Deviation is measured semantically**, not mechanically. CEO asks: "If the original North Star is X, does this milestone/change still move us toward X?" If the answer is "maybe, but mostly toward Y" → deviation exceeding 50% → REJECT.
55
+ 4. **Milestone completion triggers roadmap review.** Mark milestone done in SPARK-ROADMAP.md, update PROGRESS.md, and re-evaluate upcoming milestones against current state.
56
+
57
+ ## Spark Loop
58
+
59
+ ```text
60
+ STARTUP: Declare roadmap (North Star + Milestones) → user confirms
61
+
62
+ ┌─────────────────────────────────────────────────────────┐
63
+ │ SPARK: 8 parallel external searches → gather sparks │
64
+ │ ↓ │
65
+ │ FILTER: Keep only sparks relevant to project stack/size │
66
+ │ ↓ │
67
+ │ VALUE GATE: 4 hard questions for each spark │
68
+ │ 1. "Would this make a real difference to users?" │
69
+ │ 2. "Is this solving a real problem, or imagined?" │
70
+ │ 3. "Is this the RIGHT time?" │
71
+ │ 4. "Would the user nod or shrug if I explained it?" │
72
+ │ Only sparks passing ALL 4 survive. │
73
+ │ ↓ │
74
+ │ DEVIATION CHECK: Does this spark align ≥50% with │
75
+ │ North Star AND current milestone? │
76
+ │ If no → record "spark rejected: deviation >50%" │
77
+ │ ↓ │
78
+ │ PICK: Highest value × alignment spark │
79
+ │ ↓ │
80
+ │ IMPLEMENT: Bounded cycle (≤3 files, ≤50 lines net) │
81
+ │ ↓ │
82
+ │ REVIEW + VERIFY: Same two-gate review as WF-AUTO │
83
+ │ ↓ │
84
+ │ VALUE REFLECTION: CEO writes in PROGRESS.md │
85
+ │ "Driven by [source]. Matters because [reason]. │
86
+ │ Without this [consequence]. User notices [evidence]." │
87
+ │ ↓ │
88
+ │ MILESTONE CHECK: Is current milestone complete? │
89
+ │ Yes → update SPARK-ROADMAP.md, celebrate in PROGRESS │
90
+ │ No → continue │
91
+ │ ↓ │
92
+ │ RE-ANCHOR GATE (every 10 cycles): │
93
+ │ "Completed N cycles toward [milestone]. │
94
+ │ Recent changes: [summary]. │
95
+ │ Deviation from North Star: [X]%. │
96
+ │ Continue? Adjust milestones? Pause?" │
97
+ │ ├── User confirms → continue │
98
+ │ ├── User adjusts → update roadmap (≤50% deviation) │
99
+ │ └── User says stop → stop (only user can stop) │
100
+ │ ↓ │
101
+ └── LOOP → SPARK (never auto-stop) ┘
102
+ ```
103
+
104
+ ## Spark Sources (searched in parallel, read-only)
105
+
106
+ | # | Source | Tool | What It Finds |
107
+ |---|--------|------|---------------|
108
+ | 1 | **GitHub Trending** | WebSearch / Tavily | Popular repos in same language/stack, new patterns |
109
+ | 2 | **Ecosystem Pulse** | WebSearch / npm/PyPI | New libraries, version bumps, deprecated APIs replaced |
110
+ | 3 | **Best Practices** | WebSearch + Docs | Latest official recommendations, style guides, security advisories |
111
+ | 4 | **Competitor Analysis** | WebSearch | Similar open-source projects — what are they doing better? |
112
+ | 5 | **Real-world Issues** | GitHub Issues / Stack Overflow | Common pain points users report for similar projects |
113
+ | 6 | **Architecture Trends** | WebSearch | Emerging patterns (e.g., micro-frontends, island architecture, edge computing) |
114
+ | 7 | **Developer Experience** | WebSearch / Docs | New tooling, better CLI patterns, improved error messages |
115
+ | 8 | **Performance Benchmarks** | WebSearch | Industry benchmarks, optimization techniques, profiling tools |
116
+
117
+ ## Deviation Guard (50% Rule)
118
+
119
+ ### What "50% deviation" means
120
+
121
+ It's a semantic alignment check, not a mechanical metric. CEO evaluates:
122
+
123
+ 1. **Direction check**: "If the North Star is X, does this change move us closer to X?"
124
+ 2. **Intent check**: "Would someone who agreed with the original North Star agree with this change?"
125
+ 3. **Cumulative check**: "Over the last 10 cycles, have our changes collectively stayed ≥50% aligned with the North Star?"
126
+
127
+ ### Deviation scoring (CEO judgment, recorded in PROGRESS.md)
128
+
129
+ | Alignment | Score | Action |
130
+ |-----------|-------|--------|
131
+ | Directly advances North Star | 90-100% | Execute immediately |
132
+ | Supports North Star indirectly | 70-89% | Execute, note reasoning |
133
+ | Tangential but valuable | 50-69% | Execute with caution, flag in reflection |
134
+ | Mostly unrelated, minor value | 30-49% | SKIP — exceeds deviation budget |
135
+ | Contradicts North Star | 0-29% | REJECT — record in rejected-sparks log |
136
+
137
+ ### Deviation budget
138
+
139
+ - Per-cycle deviation cap: individual spark must score ≥50%
140
+ - Cumulative deviation: rolling 10-cycle average must score ≥65%
141
+ - If cumulative drops below 65% → force Re-Anchor Gate immediately (don't wait for 10-cycle interval)
142
+ - If user confirms current direction → reset rolling average
143
+
144
+ ### Milestone adjustment within 50%
145
+
146
+ Milestones CAN be changed without user confirmation IF:
147
+ - The new milestone still serves the North Star (≥50% alignment)
148
+ - CEO records the change and reasoning in SPARK-ROADMAP.md
149
+
150
+ Milestones CANNOT be changed without user confirmation IF:
151
+ - The new milestone changes the North Star itself
152
+ - Cumulative deviation would exceed 50%
153
+
154
+ ## Value Reflection (per cycle)
155
+
156
+ After EVERY spark cycle, CEO writes:
157
+
158
+ ```text
159
+ ## Cycle N — Value Reflection
160
+ Spark Source: [which of the 8 sources]
161
+ Change: [what was implemented]
162
+ Deviation Score: [X]% — [brief reasoning]
163
+ Why it matters: [concrete impact]
164
+ Without this: [consequence of not doing it]
165
+ User would notice: [evidence of user-visible improvement]
166
+ Milestone progress: [M<N>: X% complete]
167
+ Cumulative deviation (10-cycle): [X]%
168
+ ```
169
+
170
+ If CEO CANNOT write a convincing value reflection → spark was NOT valuable → record as rejected and move on.
171
+
172
+ ## Stop Condition
173
+
174
+ **Spark mode does NOT auto-stop.** Only these events stop it:
175
+
176
+ 1. User explicitly says "stop" or "exit spark mode"
177
+ 2. User says "stop" at Re-Anchor Gate
178
+ 3. Fatal error that prevents further operation (not just "no sparks found")
179
+
180
+ "No sparks found" → expand search: broader terms, adjacent ecosystems, deeper topics.
181
+
182
+ "No sparks pass Value Gate" → lower the bar slightly, or ask user: "I'm not finding high-value sparks. Adjust criteria or continue searching?"
183
+
184
+ ## Anti-Patterns
185
+
186
+ | # | Anti-Pattern | Symptom | Prevention |
187
+ |---|-------------|---------|------------|
188
+ | SP1 | **Shiny object syndrome** | Chasing every new library without filtering | Value Gate + Deviation Check |
189
+ | SP2 | **Fake value reflection** | Vague "this is better" without evidence | Require concrete metrics or user-visible impact |
190
+ | SP3 | **Copycat without context** | "Project X does Y so we should too" | Value Gate question 1 |
191
+ | SP4 | **Silent North Star drift** | Small changes accumulate, direction shifts without noticing | Cumulative deviation check every 10 cycles |
192
+ | SP5 | **Milestone rot** | Milestones become irrelevant but aren't updated | Milestone review at Re-Anchor Gate |
193
+ | SP6 | **Spark tunnel vision** | Only looking at one type of source | Rotate through all 8 sources, don't skip any for >3 cycles |
194
+
195
+ ## Integration with /wf-auto
196
+
197
+ ```text
198
+ /wf-auto (autonomous optimization)
199
+
200
+ Internal 8-angle scan per cycle
201
+
202
+ Re-Anchor Gate (every preset interval)
203
+ ├── User gives clear direction → refine, continue /wf-auto
204
+ ├── User says "I don't know" / vague → propose /wf-auto-spark
205
+ ├── User says "keep going" → extend interval, continue /wf-auto
206
+ └── User says "stop" → stop
207
+
208
+ /wf-auto-spark (perpetual inspiration)
209
+ ├── Has explicit roadmap + North Star
210
+ ├── External spark search replaces internal scan
211
+ ├── Deviation guard active
212
+ └── Never auto-stops
213
+ ```
214
+
215
+ ## Task Capsule & Recording
216
+
217
+ WF-AUTO-SPARK uses a dedicated task capsule at `Harness/tasks/auto/`. Shared with `/wf-auto` — same capsule, different operational mode.
218
+
219
+ ### Capsule Structure
220
+
221
+ | File | Purpose | Updated |
222
+ |------|---------|---------|
223
+ | `Harness/tasks/auto/SPARK-ROADMAP.md` | North Star + milestones + deviation log | At startup + every milestone change |
224
+ | `Harness/tasks/auto/PLAN.md` | Current cycle's change spec (write set, acceptance criteria) | Before each implementation |
225
+ | `Harness/tasks/auto/PROGRESS.md` | Cycle log, value reflections, cumulative stats, evidence | After each cycle |
226
+ | `Harness/PROGRESS.md` | Global task index — active spark session status | At session start, milestone, and stop |
227
+
228
+ ### Heartbeat Protocol (per cycle, in `PROGRESS.md`)
229
+
230
+ ```markdown
231
+ ## Cycle N — Spark Heartbeat
232
+ **Timestamp**: <ISO>
233
+ **Spark Source**: <1-8> — <what was searched>
234
+ **Deviation Score**: <X>% — <brief reasoning>
235
+ **Change**: <what was implemented, ≤3 files, ≤50 lines net>
236
+ **Write Set**: <files changed>
237
+
238
+ ### Value Reflection
239
+ **Why it matters**: <concrete impact>
240
+ **Without this**: <consequence>
241
+ **User would notice**: <evidence>
242
+
243
+ ### Milestone Progress
244
+ - Current: M<N> — <X>% complete
245
+ - Cumulative deviation (10-cycle): <X>%
246
+
247
+ ### Evidence
248
+ - Build: <pass/fail>
249
+ - Tests: <N passed / M failed>
250
+ - Manual check: <what was verified>
251
+ ```
252
+
253
+ ### PLAN.md Format (per cycle)
254
+
255
+ Before implementing, CEO writes one cycle plan:
256
+
257
+ ```markdown
258
+ # Cycle N Plan
259
+ **Date**: <ISO>
260
+ **Mode**: wf-auto-spark
261
+ **Spark Source**: <# and name>
262
+ **Finding**: <what external search found>
263
+ **Planned Change**: <concise description>
264
+ **Write Set**: <≤3 files>
265
+ **Acceptance Criteria**: <how to verify success>
266
+ **Deviation Check**: <alignment score %> — <reasoning>
267
+ ```
268
+
269
+ ### Global PROGRESS.md Linkage
270
+
271
+ `Harness/PROGRESS.md` is updated when:
272
+ - **Session start**: add `| auto-spark | <task-id> | active | <North Star summary> |`
273
+ - **Milestone complete**: update status with milestone result
274
+ - **Session stop**: mark status with final milestone + reason (user stop / exhausted)
275
+
276
+ ### Stop / Resume Continuity
277
+
278
+ When spark mode stops (user says stop, session ends, or crash):
279
+ 1. Last `PROGRESS.md` heartbeat is the checkpoint
280
+ 2. `SPARK-ROADMAP.md` preserves North Star + milestone state
281
+ 3. On resume: read SPARK-ROADMAP.md, read last heartbeat, continue from last milestone
282
+ 4. If `Harness/PROGRESS.md` shows session is still "active", auto-resume spark mode on SessionStart
283
+ 5. CEO checks: "Last session stopped at cycle N, milestone M<X> at Y%. Continue or adjust?"
284
+
285
+ This replaces the broken `/wf-auto` auto-continue. No silent drift across sessions.
286
+
287
+ ## Files
288
+
289
+ | File | Purpose |
290
+ |------|---------|
291
+ | `Harness/WF-AUTO-SPARK.md` | This spec |
292
+ | `Harness/tasks/auto/SPARK-ROADMAP.md` | Active roadmap (created at startup) |
293
+ | `Harness/tasks/auto/PLAN.md` | Per-cycle change spec |
294
+ | `Harness/tasks/auto/PROGRESS.md` | Cycle log, heartbeat, evidence ledger |
295
+ | `Harness/PROGRESS.md` | Global task index linkage |
296
+ | `.claude/skills/wf-auto-spark/SKILL.md` | Claude Code skill loader |
297
+ | `.agents/skills/wf-auto-spark/SKILL.md` | Codex skill loader (mirror) |