@oneie/claude 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +16 -0
- package/.mcp.json +12 -0
- package/README.md +204 -0
- package/agents/w1-recon.md +102 -0
- package/agents/w2-decide.md +164 -0
- package/agents/w3-edit.md +91 -0
- package/agents/w4-verify.md +416 -0
- package/commands/browser.md +55 -0
- package/commands/cc-connect.md +67 -0
- package/commands/claw.md +135 -0
- package/commands/close.md +143 -0
- package/commands/create.md +78 -0
- package/commands/deploy.md +415 -0
- package/commands/do-autonomous.md +80 -0
- package/commands/do-improve.md +51 -0
- package/commands/do-show.md +89 -0
- package/commands/do.md +226 -0
- package/commands/improve.md +99 -0
- package/commands/kill.md +45 -0
- package/commands/release.md +144 -0
- package/commands/see.md +161 -0
- package/commands/setup.md +75 -0
- package/commands/sync.md +185 -0
- package/hooks/hooks.json +90 -0
- package/hooks/lib/signal.sh +28 -0
- package/hooks/scripts/design-check.sh +83 -0
- package/hooks/scripts/post-edit-check.sh +32 -0
- package/hooks/scripts/session-end-verify.sh +51 -0
- package/hooks/scripts/session-start.sh +88 -0
- package/hooks/scripts/stop-reflect.sh +95 -0
- package/hooks/scripts/sync-todo-docs.sh +46 -0
- package/hooks/scripts/task-complete-verify.sh +52 -0
- package/hooks/scripts/tool-signal.sh +48 -0
- package/package.json +33 -0
- package/rules/api.md +50 -0
- package/rules/astro.md +206 -0
- package/rules/design.md +221 -0
- package/rules/documentation.md +218 -0
- package/rules/engine.md +297 -0
- package/rules/react.md +137 -0
- package/rules/ui.md +82 -0
- package/scripts/cc-connect.sh +345 -0
- package/scripts/do-analyze.sh +42 -0
- package/scripts/do-folder.sh +63 -0
- package/scripts/do-prove.sh +51 -0
- package/scripts/do-reconcile.sh +28 -0
- package/scripts/do-smoke.sh +60 -0
- package/scripts/do-survey.sh +30 -0
- package/scripts/do-tier.sh +43 -0
- package/skills/build/SKILL.md +52 -0
- package/skills/cloudflare/SKILL.md +503 -0
- package/skills/dev/SKILL.md +58 -0
- package/skills/do/SKILL.md +24 -0
- package/skills/oneie/SKILL.md +51 -0
- package/skills/perf/SKILL.md +45 -0
- package/skills/signal/SKILL.md +108 -0
- package/skills/sui/SKILL.md +441 -0
- package/skills/tutorial/SKILL.md +96 -0
- package/skills/typecheck/SKILL.md +66 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# /do autonomous loop
|
|
2
|
+
|
|
3
|
+
Loaded by `do.md` for empty invocation or `--once` flag.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Loop
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
W0: bun run verify (once per session, skip if already passed)
|
|
11
|
+
|
|
12
|
+
ORIENT: Read docs/TODO.md
|
|
13
|
+
→ note the active front (Atomicity / Vocabulary / New Surfaces)
|
|
14
|
+
→ note the Top 15 priority list
|
|
15
|
+
→ let this shape which task you pick
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
loop:
|
|
20
|
+
SENSE: GET http://localhost:4321/api/tasks
|
|
21
|
+
Sort by priority (effective = score + strength − resistance)
|
|
22
|
+
Skip blocked tasks (blockedBy non-empty)
|
|
23
|
+
|
|
24
|
+
SELECT: Pick highest unblocked (P0 > P1, attractive > ready > exploratory)
|
|
25
|
+
If all blocked: GET /api/state → follow pheromone highways (deadlock escape)
|
|
26
|
+
|
|
27
|
+
EXECUTE:
|
|
28
|
+
BRIEF (before touching any file):
|
|
29
|
+
source = task.source
|
|
30
|
+
If source missing: grep -l "{task.name}" docs/*-todo.md
|
|
31
|
+
Read docs/{source}-todo.md:
|
|
32
|
+
• frontmatter source_of_truth → spec docs to pre-load
|
|
33
|
+
• find checkbox matching task.name → note exit criteria + "See also"
|
|
34
|
+
Read each source_of_truth entry (first 80 lines each)
|
|
35
|
+
WORK: run W1-W4 against the briefing above
|
|
36
|
+
W1 targets files named in task description + source_of_truth
|
|
37
|
+
W4 exit gate: composite ≥ 0.65 AND exit criteria from TODO section
|
|
38
|
+
|
|
39
|
+
VERIFY: bun tsc --noEmit on touched files
|
|
40
|
+
|
|
41
|
+
MARK: POST http://localhost:4321/api/tasks/{id}/complete
|
|
42
|
+
|
|
43
|
+
CLOSE: POST http://localhost:4321/api/loop/cycle-close {
|
|
44
|
+
slug,
|
|
45
|
+
kind: "code",
|
|
46
|
+
scores: { security, stability, simplicity, speed }
|
|
47
|
+
}
|
|
48
|
+
composite = 0.35·security + 0.30·stability + 0.25·simplicity + 0.10·speed
|
|
49
|
+
composite ≥ 0.65 → mark(loop:cycle:{slug}, composite × 5)
|
|
50
|
+
composite < 0.65 → warn equivalents (route back to W3, max 3 W4 loops)
|
|
51
|
+
Response: { ok, slug, kind, composite, gate: "pass"|"fail", marks: { cycle, namespaced } }
|
|
52
|
+
|
|
53
|
+
Note: /api/loop/close (without "cycle-") is a different endpoint —
|
|
54
|
+
it manages WorkLoop session/stage tracking. Don't confuse them.
|
|
55
|
+
|
|
56
|
+
FEEDBACK: POST http://localhost:4321/api/signal {
|
|
57
|
+
receiver: 'loop:feedback',
|
|
58
|
+
data: {
|
|
59
|
+
tags: task.tags,
|
|
60
|
+
strength: rubricAvg,
|
|
61
|
+
content: { task_id, rubric, outcome: 'result' }
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
strength >= 0.65 → mark each tag path
|
|
65
|
+
strength < 0.65 → warn(0.5) each tag path
|
|
66
|
+
Always emit — even timeout, even dissolved. Every loop closes.
|
|
67
|
+
|
|
68
|
+
GROW: GET http://localhost:4321/api/highways → report learned paths
|
|
69
|
+
|
|
70
|
+
→ repeat
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
After each task: report name, strength, priority, tests passed, unlocked tasks.
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## `--once`
|
|
78
|
+
|
|
79
|
+
Single iteration: pick one task → execute → mark → stop.
|
|
80
|
+
Report: name, strength, priority, tests, deterministic outcome (result/timeout/dissolved/failure).
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# /do --improve
|
|
2
|
+
|
|
3
|
+
Loaded by `do.md` for `--improve` flag. Runs meta-improvement on do.md itself
|
|
4
|
+
when drift signals accumulate.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Signal source (checks in order, first hit wins)
|
|
9
|
+
|
|
10
|
+
1. `signals.jsonl` — read `loop:drift:*` entries if file exists
|
|
11
|
+
2. `learnings.md` — read all `drift:` entries (polling fallback)
|
|
12
|
+
|
|
13
|
+
Group by wave+dim+tag_combo. For each group with count ≥ 2, run a one-cycle
|
|
14
|
+
meta-improvement plan on `do.md`:
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## The improvement cycle
|
|
19
|
+
|
|
20
|
+
**W1:** recon the drifting wave section (Haiku — what does the current instruction say?)
|
|
21
|
+
|
|
22
|
+
**W2:** decide a targeted edit to the agent prompt for that wave.
|
|
23
|
+
W2 edit scope (hard limit): may only propose edits to agent instruction text
|
|
24
|
+
(what agents are told to do, how to format output, what to read).
|
|
25
|
+
**Never propose changes to:**
|
|
26
|
+
- Gate thresholds (composite ≥ 0.65, severity > 0.5, relevance < 0.4 — these are numeric gate controls)
|
|
27
|
+
- Escape conditions (zero-findings guard, max W4 loops = 3, double-anchor-miss halt)
|
|
28
|
+
- The invariant list itself
|
|
29
|
+
If in doubt: if the proposed change alters a number that controls when the loop stops or passes, it is forbidden. Escalate to user.
|
|
30
|
+
|
|
31
|
+
**Snapshot:** Before W3 spawns, record current do.md content in session dict `improve_snapshot`.
|
|
32
|
+
|
|
33
|
+
**W3:** edit do.md (anchor pre-validated first, within W2 scope constraints).
|
|
34
|
+
|
|
35
|
+
**W4:** adversarial verify — check these invariants are preserved:
|
|
36
|
+
- never skip W2
|
|
37
|
+
- always spawn W1+W3 in a single message
|
|
38
|
+
- gate thresholds unchanged (0.65 / 0.5 / 0.4 values must appear verbatim)
|
|
39
|
+
- relevance threshold unchanged (< 0.4 must appear verbatim)
|
|
40
|
+
- escape conditions unchanged
|
|
41
|
+
- W2 scope constraint present and unmodified
|
|
42
|
+
**Threshold disguise check:** scan diff for protected values (0.65, 0.5, 0.4, 3) in control-flow or gate logic. Values in informational prose are fine; flag only if inside a conditional or gate definition.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Outcomes
|
|
47
|
+
|
|
48
|
+
- **W4 pass:** mark drift entries `resolved` in learnings.md.
|
|
49
|
+
- **W4 fail:** restore `improve_snapshot`, log `improve: rollback`. Retry once — W2 re-reads W4 failure report, produces revised proposal; W3 applies; W4 re-verifies.
|
|
50
|
+
- **W4 fails on retry:** restore snapshot, escalate to user. Do not retry again.
|
|
51
|
+
- **W4 fails twice total:** escalate. Loop cannot self-fix this pattern.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# /do --show mode
|
|
2
|
+
|
|
3
|
+
Loaded by `do.md` when plan frontmatter has `show: true` or `--show` flag is passed.
|
|
4
|
+
Default behavior for `/do <plan> --auto` on show-plans. The loop runs every cycle without
|
|
5
|
+
intervention; pauses at each cycle close to render a cycle frame. Press Ctrl-C to stop;
|
|
6
|
+
otherwise auto-continues to the next cycle.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## The cycle frame format
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
╭──────────────── C{n} / {plan-slug} / {cycle-name} ────────────────╮
|
|
14
|
+
│ ✓ Cycle {n} of {N} complete rubric: 0.XX │
|
|
15
|
+
│ │
|
|
16
|
+
│ Wave gates (W0 → W4) │
|
|
17
|
+
│ ─────────────── │
|
|
18
|
+
│ W0 bun run verify ✓ {pass}/{total} │
|
|
19
|
+
│ W1 recon ✓ {N} files ({hits} cache hits) │
|
|
20
|
+
│ W2 decide ✓ {decisions} decisions ⬇ {Z} new │
|
|
21
|
+
│ W3 edit (parallel) ✓ {marked}/{dissolved-retried} │
|
|
22
|
+
│ W4 verify (scoped) ✓ +{Δ} tests, biome+tsc clean │
|
|
23
|
+
│ │
|
|
24
|
+
│ Rubric │
|
|
25
|
+
│ ─────── │
|
|
26
|
+
│ security {0.XX} stability {0.XX} simplicity {0.XX} speed {0.XX} │
|
|
27
|
+
│ composite {0.XX} ✓ above 0.65 gate │
|
|
28
|
+
│ │
|
|
29
|
+
│ Speed │
|
|
30
|
+
│ ───── │
|
|
31
|
+
│ {metric} {value} (target {budget} {✓|✗}) │
|
|
32
|
+
│ │
|
|
33
|
+
│ What this unlocks │
|
|
34
|
+
│ ───────────────── │
|
|
35
|
+
│ 👤 customer {one sentence — what a human can now do} │
|
|
36
|
+
│ 🤖 agent {one sentence — what an agent can now do} │
|
|
37
|
+
│ │
|
|
38
|
+
│ Lifecycle [✓] {stage 1} → [✓] ... → [ ] {next stage} │
|
|
39
|
+
│ │
|
|
40
|
+
│ Next: C{n+1} — {next cycle name + one-line preview} │
|
|
41
|
+
│ │
|
|
42
|
+
│ Continuing in --auto... (Ctrl-C to stop) │
|
|
43
|
+
╰───────────────────────────────────────────────────────────────────╯
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
After the final cycle, render a **lifecycle replay**: a short narrative walking the
|
|
47
|
+
customer + agent through every stage the build now supports, in order.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## What goes in each section
|
|
52
|
+
|
|
53
|
+
| Section | Source | Rule |
|
|
54
|
+
|---|---|---|
|
|
55
|
+
| Wave gates | telemetry from each wave's logger | one line per wave, ✓/✗ + one number; W2 also shows `⬇ Z new` (new primitives through compress check) |
|
|
56
|
+
| Rubric | W4 markDims output | four numbers + composite + gate-pass |
|
|
57
|
+
| Speed | `/api/speed` budgets for this cycle | only metrics this cycle changed |
|
|
58
|
+
| What unlocks | plan's `lifecycle_show` frontmatter block | two sentences — customer + agent |
|
|
59
|
+
| Lifecycle | plan's `lifecycle: [stages]` frontmatter | checkbox row, ✓ done / [ ] pending |
|
|
60
|
+
| Next | next unchecked cycle + first task | one line; if last cycle, render lifecycle replay |
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Frontmatter required for show mode
|
|
65
|
+
|
|
66
|
+
```yaml
|
|
67
|
+
show: true
|
|
68
|
+
lifecycle: [stage-1, stage-2, stage-3, stage-4, stage-5]
|
|
69
|
+
lifecycle_show:
|
|
70
|
+
C1:
|
|
71
|
+
customer: "{one sentence — concrete user, concrete action}"
|
|
72
|
+
agent: "{one sentence — concrete agent, concrete capability}"
|
|
73
|
+
unlocks_stage: "stage-1"
|
|
74
|
+
C2:
|
|
75
|
+
customer: "..."
|
|
76
|
+
agent: "..."
|
|
77
|
+
unlocks_stage: "stage-2"
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
If `show: true` but no `lifecycle_show` block: render frame with `(no lifecycle narration)` and warn.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Self-correcting hook
|
|
85
|
+
|
|
86
|
+
Each frame emits `ui:do:show:rendered { cycle, rubric, lifecycle_stage }`.
|
|
87
|
+
Ctrl-C'd frames → `warn(0.5)` on the cycle's tag — a rendered frame that's stopped is a
|
|
88
|
+
signal something looked wrong. Future cycles with similar tags raise their
|
|
89
|
+
security/stability bar at W2.
|
package/commands/do.md
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
# /do — idea to shipped (v2, lifecycle-first)
|
|
2
|
+
|
|
3
|
+
**One command.** Type `/do "<an idea>"` and it walks the whole build lifecycle from wherever the idea is: it agrees a goal, then walks the artifact spine — promise → spec → todo → code → tests → proof → docs → release — **writing whatever is missing, skipping whatever exists.** Point it at a bare idea and it writes everything. Point it at code with no tests or docs and it backfills just those.
|
|
4
|
+
|
|
5
|
+
The human owns one thing: the goal sentence. `/do` owns everything below it.
|
|
6
|
+
|
|
7
|
+
> Narrative for humans: `text/000-do.md`. Per-stage template/skill/agent routing: `plans/templates.md`. This file is what `/do` executes.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Two principles, underneath every phase
|
|
12
|
+
|
|
13
|
+
**Progressive disclosure.** Each phase loads only what it needs. Recon reads the last few turns + the most relevant files, never the whole history. A reference doc loads only when the work touches it. Skills are invoked, not inlined. Widen context only on a miss.
|
|
14
|
+
|
|
15
|
+
**Parallel agents at the right model · effort.** Reach for the cheapest tool that can answer, then run as many as the work allows in one message. Two dials:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
bash none bit-equal checks, greps, schema validation, test exit codes
|
|
19
|
+
Haiku low | medium recon (low) · binary judgment / rubric (medium)
|
|
20
|
+
Sonnet low | medium mechanical edit (low) · genuine restructure / prose (medium)
|
|
21
|
+
Opus high | xhigh architecture (high) · substrate / schema reconciliation (xhigh)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Fan-out: independent agents in ONE message, capped by the plan's `parallel_budget`. Recon + verify fan wide (Haiku × N). Edits run one-per-file (Sonnet × N). Only the design decision (Opus) stays single — understanding is not delegable.
|
|
25
|
+
|
|
26
|
+
### Fast & lean — the token economy (automatic, never a flag)
|
|
27
|
+
|
|
28
|
+
Comprehensive and fast are not in tension: the **tier decides which gates run**, so a typo never pays for a feature's pipeline.
|
|
29
|
+
|
|
30
|
+
| Lever | Fires at | Saves by |
|
|
31
|
+
|---|---|---|
|
|
32
|
+
| Tier prune | Step 1 | PATCH walks `code` only; a gate never runs above the phases it guards |
|
|
33
|
+
| Tool ladder | every decision | bash → Haiku → Sonnet → Opus; stop at the first that decides |
|
|
34
|
+
| **TRIVIAL fast-path** | BUILD | **0 agent spawns** — read ≤3 files inline, edit, bash verify, inline rubric, 1 learnings line |
|
|
35
|
+
| Recon cache | W1 | KV `recon:{sha}:{sha}` hit (<14d) → skip re-read, `mark(recon:hit)` |
|
|
36
|
+
| Verify-only-changed | W3→W4 | dependency cone from `git diff`; full verify only at cycle close |
|
|
37
|
+
| Cross-cycle pre-warm | W4 close | one fire-and-forget Haiku pre-reads the next cycle's W1 targets |
|
|
38
|
+
| Recon cap | W1 | 400-word receipt; high-signal slices → `.w2-spec.json`, not the raw dump |
|
|
39
|
+
| Write-once state | per cycle | `.w2-spec`/`.w3-receipts` read by path, never re-derived after compaction |
|
|
40
|
+
| `cost:cycle` gradient | close | spend → pheromone; future SELECT routes toward cheap-and-effective paths |
|
|
41
|
+
|
|
42
|
+
A cycle that runs **zero LLM calls** is a *good* cycle. The comprehensiveness lives in the gates (DoD, rubric, doc-sync, ANALYZE, PROVE); the tier decides how many of them you pay for.
|
|
43
|
+
|
|
44
|
+
### Maximize parallelism — read the graph, reject imaginary blockers
|
|
45
|
+
|
|
46
|
+
Every multi-cycle plan carries a **Mermaid dependency graph**. `/do` reads it to fire the **maximum safe fan-out**: cycles with no edge between them run their waves *at the same time*, and their independent edits merge into ONE spawn message. The default is parallel — serial is the exception you must justify.
|
|
47
|
+
|
|
48
|
+
```mermaid
|
|
49
|
+
graph TD
|
|
50
|
+
C1[C1 foundation] --> C2[C2]
|
|
51
|
+
C1 --> C3[C3]
|
|
52
|
+
C1 --> C4[C4]
|
|
53
|
+
C2 --> C5[C5 composes]
|
|
54
|
+
C3 --> C5
|
|
55
|
+
C4 --> C5
|
|
56
|
+
C5 --> C6[C6 polish]
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
C2·C3·C4 are siblings → their W1/W2 run concurrently and their W3a edits merge into one message. C5 waits *only* because it reads files C2–C4 write.
|
|
60
|
+
|
|
61
|
+
**The only valid arrow.** `C_n → C_m` exists **only** when C_m reads a file C_n writes. Before drawing one, fill the blank or delete it:
|
|
62
|
+
> `C_n → C_m because C_m imports/reads {exact file path} that C_n creates.`
|
|
63
|
+
|
|
64
|
+
**Imaginary blockers — reject on sight** (full list in `plans/template-todo.md`): "same feature area" · "same folder" · "both touch the DB" (unless the *same* entity) · "logical/reading order" · "don't want too many agents at once" (`parallel_budget` already caps it) · "want to review C_n first" (policy, not a dependency) · "C_m depends on what we *learn* in C_n" (W2 learning ≠ a file dependency).
|
|
65
|
+
|
|
66
|
+
**Cross-cycle W3 batch (the big win).** A batch of 3 cycles with 8 + 6 + 4 independent edits = **18 `w3-edit` agents in ONE message**, not 3 sequential rounds. Only a named same-file collision serializes (→ W3b). Same rule for waves: W1 recon across all cycles in a batch is one Haiku spawn; W4 rubric is 5 Haiku × N cycles in one message — all capped by `parallel_budget`.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Step 0 — Classify the input
|
|
71
|
+
|
|
72
|
+
| Input | Treat as | Entry |
|
|
73
|
+
|---|---|---|
|
|
74
|
+
| bare text (`"add usage billing"`) | **IDEA** (default) | walk the spine from the top |
|
|
75
|
+
| `<slug>` or a `plans/*.md` path | existing work | resolve its slug, walk from the first gap |
|
|
76
|
+
| `--auto` | run all cycles of a todo continuously | BUILD engine, trust-aware |
|
|
77
|
+
| `--wave N` | force one wave of a todo | BUILD engine |
|
|
78
|
+
|
|
79
|
+
Derive the **slug** from the idea: kebab-case, 2–4 words (`"add usage billing"` → `usage-billing`). Every artifact on the spine is keyed by this slug.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Step 1 — Goal + tier (the one human gate)
|
|
84
|
+
|
|
85
|
+
1. **Restate as a goal**, one sentence: *"a {persona} can {outcome} they couldn't before."* Not "ship X" — "user can do Y" / "system enforces Z".
|
|
86
|
+
2. **Size the tier** (the token economy — automatic, never a human choice):
|
|
87
|
+
```bash
|
|
88
|
+
.claude/scripts/do-tier.sh --intent "<idea>" $(git diff --name-only 2>/dev/null)
|
|
89
|
+
```
|
|
90
|
+
Emits **tier** (PATCH | FIX | FEATURE | SCHEMA), the **pruned spine** (which stops run), the **inner classifier** (TRIVIAL | SIMPLE | COMPLEX for BUILD), and a **token ceiling**. Default down when unsure — an under-built FIX reopens cheaply at PROVE; an over-built PATCH is tokens you can't refund.
|
|
91
|
+
3. **Confirm once** — goal sentence + tier, in a single `AskUserQuestion`. Never interrogate. A pre-agreed backlog item auto-skips this gate.
|
|
92
|
+
|
|
93
|
+
The pruned spine by tier:
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
PATCH code (edit + W4 verify gate; 0 spawns)
|
|
97
|
+
FIX survey → [investigate if legacy] → code → tests → prove
|
|
98
|
+
FEATURE promise → survey → spec ▸clarify → todo ▸analyze → code → tests → proof → docs → release
|
|
99
|
+
SCHEMA = FEATURE + substrate reconcile at max
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
`investigate` rides any tier when the work touches code we didn't just write — it's the "understand before you change" step, not a separate tier.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Step 2 — Walk the artifact spine (presence-check · backfill · skip)
|
|
107
|
+
|
|
108
|
+
For each **enabled** stop (per the pruned spine), in order: check if its artifact exists. **Exists → skip. Missing → write it with the owner below.** A stop whose artifact is present is a phase already done; resume is free, no `--from` flag.
|
|
109
|
+
|
|
110
|
+
| Stop | Presence check | Missing → write with | Owner · model · effort |
|
|
111
|
+
|---|---|---|---|
|
|
112
|
+
| **promise** | `test -f text/<slug>.md` | `writer` skill + `text/template-frame.md` | sonnet · medium |
|
|
113
|
+
| **survey** | `do-survey.sh` (4 surfaces) | reuse verdict (expose / extend / build / drop) → the gap list, not the whole idea, feeds the spec | `w1-recon`, `Explore` · haiku · low |
|
|
114
|
+
| **investigate** *(fix / legacy only)* | code we didn't just write | forensic recon → root cause (not symptom) + blast radius + the `must_not_break` line | `w1-recon` · haiku→sonnet · medium |
|
|
115
|
+
| **spec** | `test -f plans/<slug>.md` | Opus + `plans/template-spec.md` (designs the gap list; pre-mortem + decisions live in the template), then `do-reconcile.sh` | opus · high |
|
|
116
|
+
| ↳ *CLARIFY* | spec has `## Clarifications` (FEATURE/SCHEMA) | ≤5 `AskUserQuestion`, written back into the spec | opus · high |
|
|
117
|
+
| **todo** | `test -f plans/<slug>-todo.md` | `/create todo` + `plans/template-todo.md` | sonnet · medium |
|
|
118
|
+
| ↳ *ANALYZE* | — | `do-analyze.sh plans/<slug>-todo.md` — CRITICAL exit 1 blocks BUILD | bash · none |
|
|
119
|
+
| **code** | survey verdict = `build` (≥70% match → `expose`/`extend` instead) | the BUILD engine (Step 3) | sonnet · low–medium |
|
|
120
|
+
| **tests** | test file in the repo folder | test-first, one assertion per deliverable | sonnet · low |
|
|
121
|
+
| **proof** | proof artifact captured | `do-prove.sh` (browser / curl / contract / sync) + `accessibility`; **promise-check** the shipped thing against `text/<slug>.md`; FEATURE/SCHEMA built in a worktree → **merge to trunk only on PROVE pass**, abandon on fail | sonnet · low |
|
|
122
|
+
| **docs** | feature doc + runbook exist | `tutorial` + `writer` — written against the *proven* behavior | sonnet · medium |
|
|
123
|
+
| **release** | changelog / README row | `/release` + adoption signal | sonnet · low |
|
|
124
|
+
|
|
125
|
+
**Proof before docs.** PROVE can fail and loop back to BUILD; docs written first would describe behavior that isn't final. Document what's proven, then ship.
|
|
126
|
+
|
|
127
|
+
The two `↳` rows are **gates, not artifacts**: CLARIFY edits the spec in place (FEATURE/SCHEMA only); ANALYZE is read-only and blocks only on CRITICAL. Each real stop closes by leaving **one durable artifact on disk** — that artifact is the skip-check next time.
|
|
128
|
+
|
|
129
|
+
**FRAME first (for FEATURE/SCHEMA).** The promise (`text/<slug>.md`) is what PROVE later checks the shipped feature against. If you can't state what the user gets, halt — the idea isn't ready to build. PATCH/FIX have no promise to keep, so they skip it.
|
|
130
|
+
|
|
131
|
+
**Before BUILD — EQUIP (skill-check).** Infer skills from the task tags → `ls .claude/skills/{name}/` → **ready** (proceed) / **stale** (warn, proceed) / **missing** (offer to add). Block only if a required skill is missing.
|
|
132
|
+
|
|
133
|
+
**Checkboxes — the file is the progress bar.** Every actionable item is a `[ ]`, and `/do` flips it to `[x]` the **moment** that action finishes — never batched at the end, never "I'll tick them next time." A user reading the todo mid-run sees exactly where the fan-out is.
|
|
134
|
+
|
|
135
|
+
| When | Ticked by |
|
|
136
|
+
|---|---|
|
|
137
|
+
| a W1 recon agent returns findings for a file | `/do` after the agent settles |
|
|
138
|
+
| a W2 verdict / diff spec / doc-plan resolves | `/do` inline |
|
|
139
|
+
| a W3 edit agent reports success on a file | `/do` after the agent settles |
|
|
140
|
+
| a W4 check passes (verify · demo · doc-sync · rubric · ratchet) | `/do` after the bash exits 0 |
|
|
141
|
+
| all of a wave's items are `[x]` | the wave header (derived) |
|
|
142
|
+
| all 4 waves `[x]` | the cycle header (derived) |
|
|
143
|
+
| all cycles in a batch `[x]` | the batch header (derived) |
|
|
144
|
+
|
|
145
|
+
Forward-only — a `[x]` is never un-ticked except by `/do --wave N --redo`. If an action has no checkbox, it isn't tracked, and untracked work is the loudest smell. Full granularity table in `plans/template-todo.md`.
|
|
146
|
+
|
|
147
|
+
After the spine: **LEARN / close** — write one `learnings.md` entry (slug, tier, composite, deliverable, proof line), emit `signal("cost:cycle", {tokens, model, composite})`, delete `.w3-receipts.json`, write `.do-trust.json {level, consecutive, composite}`, and append `.w4-improvements.json` (an open item recurring in 3+ consecutive cycles = systemic gap → emit `substrate:systemic-gap`; next W1 reads it as a mandatory recon target).
|
|
148
|
+
|
|
149
|
+
**Plan-outcome kill-switch (zero LLM).** Re-run the plan's `outcome:` command every cycle close. Exit 0 → the goal is met: remaining cycles enter justify-or-drop (default drop), `--auto` halts. Over the tier ceiling → `warn` + justify. Weak rubric 3× → halt, the *plan* is wrong, not the code. Goal-drift (outcome fails 3× with green rubrics) → force a re-plan.
|
|
150
|
+
|
|
151
|
+
**`--auto` continuation (trust-aware, reads `.do-trust.json`).** `trusted` (composite ≥ 0.85 × 3+) → start the next cycle immediately. `standard` (0.65–0.85) → continue. `cautious` (< 0.65 × 2) → halt, run `/do next` to resume. Absent file → `standard`.
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Step 3 — The BUILD engine (W0 → W4)
|
|
156
|
+
|
|
157
|
+
Runs only when the spine reaches `code`. Folder-aware: there is **no root `package.json`** — resolve the target repo folder from the touched files.
|
|
158
|
+
|
|
159
|
+
**W0 — Baseline.**
|
|
160
|
+
```bash
|
|
161
|
+
RESOLVED=$(printf '%s\n' $CYCLE_TARGET_PATHS | .claude/scripts/do-folder.sh)
|
|
162
|
+
echo "$RESOLVED" | jq -se 'all(.doc_only)' >/dev/null \
|
|
163
|
+
&& echo "doc-only — skip bun verify" \
|
|
164
|
+
|| echo "$RESOLVED" | jq -r 'select(.verify).folder' | while read -r f; do ( cd "$f" && bun run verify ) || exit 1; done
|
|
165
|
+
TSC=$(bunx tsc --noEmit 2>&1 | grep -c "error TS" || echo 0) # write .w0-baseline.json {tscErrors, loc, tests}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
**W1 — Recon.** Read `.w4-improvements.json` open items first — they're mandatory recon targets. Check the recon cache (KV `recon:{sha}:{sha}` <14d) → hit skips the re-read. ≤5 files → read inline. ≥6 → spawn `w1-recon` (Haiku · low) for ALL files in ONE message; each returns structured findings; skip `relevance_score < 0.4`; all-filtered → halt and broaden (zero-findings guard). Receipt capped at 400 words; persist high-signal slices into `.w2-spec.json`. *(The `w1-recon` agent carries the two-track existing-code + primitive-inventory contract.)*
|
|
169
|
+
|
|
170
|
+
**W2 — Decide (never delegated — Opus · high).** Write the goal/deliverable/UX gate (3 sentences) first. Then: reconcile names against `dictionary.md`; run the **compress check** before any new primitive (name 3 existing primitives that compose it → `compose` removes it from the diff, `new` needs a one-line justification + same-diff doc edit). The pre-mortem + trade-offs were already captured at the `spec` stop (`template-spec.md`) — carry the failure modes forward as test cases, don't redo them. Classify each W1 finding Act / Keep / Defer. Output diff specs + write `.w2-spec.json` (+ `.w2-doc-plan.json` if a doc trigger fires). *(The `w2-decide` agent carries the compose-target table — which canonical doc to check per primitive type — plus context-triggers for surgical doc injection.)*
|
|
171
|
+
|
|
172
|
+
**W3 — Edit (Sonnet × N parallel).** Soft-resume first: if `.w3-receipts.json` has fewer receipts than `.w2-spec.json` diff specs, a prior W3 was interrupted — skip W0–W2 and resume from the first unapplied spec. Pre-validate every anchor with `grep -qF` in parallel. No file overlap → spawn all `w3-edit` agents in ONE message (W3a). Overlap → W3a (independent) then W3b (same-file, sequential). Append a receipt per edit; anchor miss twice → halt, ask user. Build every UI state (empty / loading / error / edge), not just the happy path.
|
|
173
|
+
|
|
174
|
+
**W4 — Verify (bash first, zero tokens).**
|
|
175
|
+
```bash
|
|
176
|
+
( cd $folder && bun run verify ) # biome + tsc + vitest
|
|
177
|
+
$(cycle.demo.command) # the goal gate — exit 0 = pass
|
|
178
|
+
# doc-sync gate (reads .w2-doc-plan.json): stale-name=0, links ok, contract mtime current
|
|
179
|
+
DELTA_TSC=$((TSC_NOW - TSC_BASELINE)) # hard gate: ≤ 0, no new type errors ever
|
|
180
|
+
```
|
|
181
|
+
Rubric (inline for TRIVIAL/SIMPLE; for COMPLEX spawn 6 Haiku · medium — goal-fit, security, stability, simplicity, speed, adversarial — alongside `pr-review-toolkit` (code-reviewer, silent-failure-hunter, type-design-analyzer) + `find-bugs` + `accessibility` on UI):
|
|
182
|
+
```
|
|
183
|
+
composite = 0.35·goal-fit + 0.20·security + 0.20·stability + 0.15·simplicity + 0.10·speed
|
|
184
|
+
gate: composite ≥ 0.65 AND goal-fit ≥ 0.50 (hard) AND no adversarial > 0.5 AND delta_tsc ≤ 0
|
|
185
|
+
```
|
|
186
|
+
Verify scope is the **dependency cone** of `git diff` (full verify only at cycle close — speed). Then compress sweep (ts-prune + noUnusedLocals → delete orphans/dead code), write `.w4-improvements.json`, and fire one pre-warm Haiku at the next cycle's W1 targets. Verify or demo failure on touched files → W3.5 (one Sonnet per dirty file), max 3 W4 loops then halt.
|
|
187
|
+
|
|
188
|
+
**Testing policy** (full detail in `plans/template-todo.md`): Vitest-first; Playwright only when the cycle declares `requires_playwright: true`; one goal-based `expect()` per deliverable (assert the destination, not the path); ≤1 test file per cycle; a cycle needing >5 tasks splits unless `mode: lean`; N-variant split-test → winner `mark()`, losers `warn(0.5)`.
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## Definition of done (tier-scaled — `/do` ticks these automatically)
|
|
193
|
+
|
|
194
|
+
1. The agreed goal is met (goal-fit gate). 2. Every shippable deliverable has a test asserting it. 3. No regression — tests green, `delta_tsc ≤ 0`, `must_not_break` preserved. 4. Proven live, matches the promise. 5. Docs in sync. 6. Full coverage, no orphan tasks. 7. Rubric clears the bar. 8. Closed loop — recorded result + one learnings entry.
|
|
195
|
+
|
|
196
|
+
PATCH clears {1,2,3,8}. FEATURE clears all eight.
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Non-negotiable rules
|
|
201
|
+
|
|
202
|
+
- **Never skip W2.** Understanding is not delegable.
|
|
203
|
+
- **Default to parallel.** Spawn W1, W3, and W4-rubric agents in a **single message** — across cycles in a batch, not just within one. An arrow exists only when you can name the file one cycle writes and the next reads; reject every imaginary blocker.
|
|
204
|
+
- **Tick the moment it lands.** Flip `[ ]`→`[x]` as each agent/check settles — never batch at the end. The file is the progress bar.
|
|
205
|
+
- **FRAME before code (FEATURE/SCHEMA)** — no *feature* ships without a stated promise. PATCH/FIX skip FRAME by design.
|
|
206
|
+
- **Closed loop** — every cycle ends in `mark`/`warn`, never a silent return.
|
|
207
|
+
- **Cheapest tool that decides wins** — a phase that needs no LLM call is the best kind.
|
|
208
|
+
- **W4 max 3 loops**, then halt and report.
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## Available to /do — the toolbox
|
|
213
|
+
|
|
214
|
+
**Scripts** (`.claude/scripts/`): `do-tier.sh` (tier + pruned spine + classifier + ceiling) · `do-folder.sh` (folder-aware verify/build) · `do-survey.sh` (reuse verdict) · `do-reconcile.sh` (substrate dim/verb/dead-name gate) · `do-analyze.sh` (spec↔todo coverage gate) · `do-prove.sh` (surface-detect proof) · `do-smoke.sh` (deterministic outcome).
|
|
215
|
+
|
|
216
|
+
**Templates**: `text/template-frame.md` (promise) · `plans/template-spec.md` (design + pre-mortem + decisions) · `plans/template-todo.md` (plan + parallel budget + testing policy) · `plans/agent-template.md` (agent definition).
|
|
217
|
+
|
|
218
|
+
**Agents**: `w1-recon` · `w2-decide` · `w3-edit` · `w4-verify` · `Explore` · `Plan` · `pr-review-toolkit:*` (code-reviewer, silent-failure-hunter, type-design-analyzer, pr-test-analyzer, code-simplifier) · `find-bugs`.
|
|
219
|
+
|
|
220
|
+
**Skills** (per-stage routing in `plans/templates.md`): FRAME → `writer`, `copywriting` · SPEC → `typedb`, `signal` · BUILD → `astro`, `react19`, `shadcn`, `ai-ui`, `ai-sdk`, `reactflow`, `hono`, `cloudflare`, `wrangler`, `durable-objects` · TEST → `vitest`, `playwright-best-practices`, `webapp-testing` · VERIFY → `accessibility`, `find-bugs`, `perf`, `typecheck` · TEACH → `tutorial`, `writer`.
|
|
221
|
+
|
|
222
|
+
**State files** (write-once, read-by-path — compaction-proof): `.w0-baseline.json` · `.w2-spec.json` · `.w2-doc-plan.json` · `.w3-receipts.json` · `.do-trust.json` · `.w4-improvements.json`.
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
*`/do` is `select()` made human-readable: idea in, shipped-and-proven feature out. The path remembers every execution.*
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# /improve
|
|
2
|
+
|
|
3
|
+
Close the feedback loop opened by `stop-reflect.sh` and `session-start.sh`. Reads `.claude/improvements.queue.md`, presents each proposal, promotes accepted ones to the right target.
|
|
4
|
+
|
|
5
|
+
The hooks open the loop. This command closes it.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Loop
|
|
10
|
+
|
|
11
|
+
1. Read `.claude/improvements.queue.md`. Empty → emit `improve:none`, exit.
|
|
12
|
+
2. Parse: each `## YYYY-MM-DDTHH:MM:SSZ` header begins a session block; each `- **kind** ...` line is one proposal.
|
|
13
|
+
3. For each proposal (oldest first, batched by session):
|
|
14
|
+
- Show the proposal verbatim
|
|
15
|
+
- Ask the user: **apply** / **defer** / **drop**
|
|
16
|
+
4. On **apply**:
|
|
17
|
+
- Detect target file from the proposal text (table below)
|
|
18
|
+
- Apply the change via Edit (or surface the diff if it needs human anchoring)
|
|
19
|
+
- Move the proposal to `.claude/improvements.archive.md` with footer `→ applied {target}:{line} {YYYY-MM-DD}`
|
|
20
|
+
5. On **defer**: skip; line stays in the queue for next pass.
|
|
21
|
+
6. On **drop**: move to archive with footer `→ dropped {YYYY-MM-DD} (reason)`.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Target resolution
|
|
26
|
+
|
|
27
|
+
Proposals come in three kinds (set by `stop-reflect.sh`):
|
|
28
|
+
|
|
29
|
+
| Proposal kind | Detection | Target |
|
|
30
|
+
|---|---|---|
|
|
31
|
+
| `**convention**` | `\.claude/(rules\|skills\|agents)/...` or `CLAUDE\.md` in path | the named file — promote the rule into its body |
|
|
32
|
+
| `**new primitive**` | `\.claude/(skills\|rules\|agents\|hooks)/[^/]+\.(md\|sh)` | the index in `one-ie/.claude/CLAUDE.md` — add a one-line entry |
|
|
33
|
+
| `**doc-drift**` | `<subdir>/CLAUDE.md` named | that CLAUDE.md — surface a 3-line summary of the most impactful code changes and ask the user which (if any) belong in the contract |
|
|
34
|
+
|
|
35
|
+
If detection fails, the user is asked: "which file should this update?" Free-text answer accepted.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Examples
|
|
40
|
+
|
|
41
|
+
**Convention proposal:**
|
|
42
|
+
```
|
|
43
|
+
- **convention** `.claude/rules/api.md` — review: did this change introduce a rule the broader team should know?
|
|
44
|
+
```
|
|
45
|
+
→ `apply` opens `.claude/rules/api.md`, asks user for the rule text (one sentence), appends to the closest section.
|
|
46
|
+
|
|
47
|
+
**New primitive proposal:**
|
|
48
|
+
```
|
|
49
|
+
- **new primitive** `.claude/skills/perf.md` — add a one-line entry to the index.
|
|
50
|
+
```
|
|
51
|
+
→ `apply` opens `one-ie/.claude/CLAUDE.md`, finds the skills index, appends `| /perf | ...` row.
|
|
52
|
+
|
|
53
|
+
**Doc-drift proposal:**
|
|
54
|
+
```
|
|
55
|
+
- **doc-drift** `agents/CLAUDE.md` not updated despite 5 file changes under `^agents/src/`. Review.
|
|
56
|
+
```
|
|
57
|
+
→ `apply` runs `git log --oneline -5 -- agents/src/` (or `find agents/src -mtime -7`), summarises the 5 changes, and asks: "Does `agents/CLAUDE.md` need any of these reflected? If yes, paste the line(s) to add." User pastes; command Edits.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Closed-loop signal
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"receiver": "improve:session:ok",
|
|
66
|
+
"data": {
|
|
67
|
+
"tags": ["improve"],
|
|
68
|
+
"weight": 1,
|
|
69
|
+
"content": {
|
|
70
|
+
"applied": N,
|
|
71
|
+
"deferred": M,
|
|
72
|
+
"dropped": K,
|
|
73
|
+
"archive_lines_added": APPLIED + DROPPED
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
`applied > 0` → also emit one `mark` per `target_file` so the substrate learns which docs absorb improvement signal most often.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Out of scope
|
|
84
|
+
|
|
85
|
+
- Auto-applying without user review. The queue is a candidate list, not a worklist.
|
|
86
|
+
- Editing user-scoped memory (`~/.claude/projects/.../memory/`). That's manual.
|
|
87
|
+
- Pulling in changes from anywhere except `.claude/improvements.queue.md`.
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## When to run
|
|
92
|
+
|
|
93
|
+
- After 3+ proposals accumulate (the `session-start.sh` banner will say so).
|
|
94
|
+
- Before any significant refactor — clearing the queue first prevents stale proposals against old code.
|
|
95
|
+
- After a quarterly skill / CLAUDE.md audit — surface what's accumulated.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
*Stop-reflect writes. Session-start surfaces. Improve closes. The path remembers what the system learned about itself.*
|
package/commands/kill.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# /kill — Reset dev environment
|
|
2
|
+
|
|
3
|
+
Stop all Astro dev servers (ports 4321–4329) and wrangler (8787), clear node + astro + vite + wrangler caches, run `bun install`, then `bun run dev`.
|
|
4
|
+
|
|
5
|
+
Use when HMR is broken, Vite re-optimization desyncs deps (duplicate React `useContext` is null, `createRoot` not exported with two `?v=hash` URLs), ghost ports refuse to release, or the user says "kill", "nuke", "reset dev", or "full clean rebuild".
|
|
6
|
+
|
|
7
|
+
Scope is `one.ie/web/` only.
|
|
8
|
+
|
|
9
|
+
## What it does (in order)
|
|
10
|
+
|
|
11
|
+
1. **Kill** any process bound to ports 4321–4329 (Astro) and 8787 (wrangler), plus lingering `astro dev` / `wrangler dev` / `vite` / `workerd` processes
|
|
12
|
+
2. **Clear** caches only — `.astro`, `node_modules/.vite`, `node_modules/.astro`, `dist` (preserves `node_modules` + `bun.lock` so install is fast; preserves `.wrangler/state` to keep local KV/D1/R2/DO data)
|
|
13
|
+
3. **Reinstall** via `bun install`
|
|
14
|
+
4. **Start** `bun run dev`
|
|
15
|
+
|
|
16
|
+
## One-shot command
|
|
17
|
+
|
|
18
|
+
Run this exactly:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
cd /Users/toc/Server/one-ie/one.ie/web && \
|
|
22
|
+
(lsof -ti:4321,4322,4323,4324,4325,4326,4327,4328,4329,8787 2>/dev/null | xargs kill -9 2>/dev/null; \
|
|
23
|
+
pkill -f "astro dev" 2>/dev/null; \
|
|
24
|
+
pkill -f "wrangler dev" 2>/dev/null; \
|
|
25
|
+
pkill -f "vite" 2>/dev/null; \
|
|
26
|
+
pkill -f "workerd" 2>/dev/null; true) && \
|
|
27
|
+
rm -rf .astro node_modules/.vite node_modules/.astro dist && \
|
|
28
|
+
bun install && \
|
|
29
|
+
bun run dev
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Start the final `bun run dev` in the background (`run_in_background: true`) so you can monitor logs and confirm the server is up on 4321.
|
|
33
|
+
|
|
34
|
+
## When NOT to use
|
|
35
|
+
|
|
36
|
+
- Cache-only fix would do → `rm -rf node_modules/.vite .astro && bun run dev` (~3s); this is ~30s
|
|
37
|
+
- Production / deploy issues → use `/deploy` or `/build`
|
|
38
|
+
- TypeScript errors only → use `/typecheck`; cache reset won't fix code
|
|
39
|
+
- Dependency version drift suspected → manually `rm -rf node_modules bun.lock && bun install` (this command preserves both)
|
|
40
|
+
|
|
41
|
+
## Diagnostic order (cheapest first)
|
|
42
|
+
|
|
43
|
+
1. `rm -rf node_modules/.vite .astro && bun run dev` — clears Vite + Astro cache only (~3s)
|
|
44
|
+
2. **This command** — kills servers + clears caches + reinstall (~30s)
|
|
45
|
+
3. Full nuke: `rm -rf node_modules bun.lock .astro dist && bun install && bun run dev` (~90s) — only if dependency tree itself is suspect
|