@oneie/claude 0.3.1 → 0.4.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/agents/w1-recon.md +9 -2
- package/agents/w2-decide.md +40 -9
- package/agents/w3-edit.md +34 -4
- package/agents/w4-verify.md +112 -15
- package/commands/do-autonomous.md +1 -1
- package/commands/do.md +84 -46
- package/commands/skill-create.md +4 -4
- package/commands/sync.md +7 -7
- package/hooks/hooks.json +14 -0
- package/hooks/scripts/compact-hint.sh +36 -0
- package/hooks/scripts/config-protect.sh +56 -0
- package/hooks/scripts/stop-reflect.sh +3 -3
- package/hooks/scripts/sync-todo-docs.sh +1 -1
- package/package.json +2 -1
- package/rules/documentation.md +18 -18
- package/rules/engine.md +2 -2
- package/scripts/do-auto.sh +5 -5
- package/scripts/do-folder.sh +1 -1
- package/scripts/do-prove.sh +10 -27
- package/scripts/do-reconcile.sh +212 -19
- package/scripts/do-smoke.sh +65 -25
- package/scripts/do-survey.sh +1 -1
- package/scripts/do-tier.sh +1 -1
- package/scripts/w4-rubric.ts +1 -1
- package/skills/oneie/SKILL.md +4 -4
- package/skills/signal/SKILL.md +2 -2
- package/skills/sui/SKILL.md +1 -1
- package/templates/template-agent.md +50 -0
- package/templates/template-feature.md +27 -0
- package/templates/template-plan.md +75 -0
- package/templates/template-teach.md +59 -0
- package/templates/template-tests.md +43 -0
- package/templates/template-todo.md +781 -0
package/commands/do.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
# /do — idea to shipped (v2, lifecycle-first)
|
|
2
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 —
|
|
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 — **making each artifact true** — 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
|
+
For each artifact on the spine: `true(artifact) ≡ exists(artifact) ∧ reconciles(artifact, canon)`. Missing → write. Stale → rewrite. True → skip.
|
|
4
6
|
|
|
5
7
|
The human owns one thing: the goal sentence. `/do` owns everything below it.
|
|
6
8
|
|
|
7
|
-
> Narrative for humans: `text/
|
|
9
|
+
> Narrative for humans: `text/do.md`. Per-stage template/skill/agent routing: `text/templates-plan.md`. This file is what `/do` executes.
|
|
8
10
|
|
|
9
11
|
---
|
|
10
12
|
|
|
@@ -21,7 +23,22 @@ Sonnet low | medium mechanical edit (low) · genuine restructure / prose (
|
|
|
21
23
|
Opus high | xhigh architecture (high) · substrate / schema reconciliation (xhigh)
|
|
22
24
|
```
|
|
23
25
|
|
|
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
|
|
26
|
+
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 W2 stays single — understanding is not delegable, but it runs as a **spawned single Opus `w2-decide` agent**, not inline. The conductor/session model runs Sonnet; W2 stays Opus·high. W2 is in the spawn list (W1·**W2**·W3·W4-rubric); the "never delegated → run inline" constraint is replaced by "stays single — one Opus agent, never fanned."
|
|
27
|
+
|
|
28
|
+
### The coherence ratchet
|
|
29
|
+
|
|
30
|
+
`reconciles` is not pass/fail in isolation — it is **monotonic**. A write may leave the system *more* coherent or equally coherent. Never less.
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
types — zero new tsc errors (the original ratchet)
|
|
34
|
+
names — converge to the dictionary (no new synonym, no dead name)
|
|
35
|
+
primitives— net new ≤ 0 (compose 3 existing before adding 1)
|
|
36
|
+
schema — extend, never fork (one model, not two)
|
|
37
|
+
surfaces — reachable, never orphaned (registered + linked, never dangling)
|
|
38
|
+
docs — synced, never stale (no broken link, no lie)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
This is what *"every line makes the system stronger"* means mechanically: coherence is a gate the loop runs, not a hope. The ratchet can tighten the system; it can never loosen it.
|
|
25
42
|
|
|
26
43
|
### Fast & lean — the token economy (automatic, never a flag)
|
|
27
44
|
|
|
@@ -42,7 +59,7 @@ Comprehensive and fast are not in tension: the **tier decides which gates run**,
|
|
|
42
59
|
| Write-once state | per cycle | `.w2-spec`/`.w3-receipts` read by path, never re-derived after compaction |
|
|
43
60
|
| `cost:cycle` gradient | close | spend → pheromone; future SELECT routes toward cheap-and-effective paths |
|
|
44
61
|
|
|
45
|
-
A cycle that runs **zero LLM calls** is a *good* cycle. The comprehensiveness lives in the gates (DoD, rubric,
|
|
62
|
+
A cycle that runs **zero LLM calls** is a *good* cycle. The comprehensiveness lives in the gates (DoD, rubric, RECONCILES, ANALYZE, PROVE); the tier decides how many of them you pay for.
|
|
46
63
|
|
|
47
64
|
### Maximize parallelism — read the graph, reject imaginary blockers
|
|
48
65
|
|
|
@@ -64,7 +81,7 @@ C2·C3·C4 are siblings → their W1/W2 run concurrently and their W3a edits mer
|
|
|
64
81
|
**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:
|
|
65
82
|
> `C_n → C_m because C_m imports/reads {exact file path} that C_n creates.`
|
|
66
83
|
|
|
67
|
-
**Imaginary blockers — reject on sight** (full list in `
|
|
84
|
+
**Imaginary blockers — reject on sight** (full list in `text/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).
|
|
68
85
|
|
|
69
86
|
**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`.
|
|
70
87
|
|
|
@@ -75,7 +92,7 @@ C2·C3·C4 are siblings → their W1/W2 run concurrently and their W3a edits mer
|
|
|
75
92
|
| Input | Treat as | Entry |
|
|
76
93
|
|---|---|---|
|
|
77
94
|
| bare text (`"add usage billing"`) | **IDEA** (default) | walk the spine from the top |
|
|
78
|
-
| `<slug>` or a `
|
|
95
|
+
| `<slug>` or a `text/*.md` path | existing work | resolve its slug; ≥2 incomplete cycles → auto context-isolated loop, else walk from the first gap inline |
|
|
79
96
|
| `--wave N` | force one wave of a todo | BUILD engine |
|
|
80
97
|
| `--next-cycle` | *(internal)* run one batch then exit — the loop's recursion guard, set by `do-auto.sh`; never typed by a human | BUILD engine |
|
|
81
98
|
| `--auto` | *(legacy alias)* same as a bare multi-cycle `/do <slug>` — the loop is automatic now | BUILD engine, trust-aware |
|
|
@@ -97,40 +114,43 @@ Derive the **slug** from the idea: kebab-case, 2–4 words (`"add usage billing"
|
|
|
97
114
|
The pruned spine by tier:
|
|
98
115
|
|
|
99
116
|
```
|
|
100
|
-
PATCH
|
|
101
|
-
FIX
|
|
102
|
-
FEATURE
|
|
103
|
-
SCHEMA = FEATURE +
|
|
117
|
+
PATCH AIM → BUILD → VERIFY (edit + W4 verify gate; 0 spawns)
|
|
118
|
+
FIX AIM → SURVEY → [INVESTIGATE] → BUILD → TEST → PROVE → LEARN
|
|
119
|
+
FEATURE AIM → PROMISE → SURVEY → DESIGN ▸clarify → PLAN ▸analyze → BUILD → TEST → VERIFY → PROVE → TEACH → SHIP → LEARN
|
|
120
|
+
SCHEMA = FEATURE + Substrate reconcile at max
|
|
104
121
|
```
|
|
105
122
|
|
|
106
|
-
`
|
|
123
|
+
`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.
|
|
107
124
|
|
|
108
125
|
---
|
|
109
126
|
|
|
110
127
|
## Step 2 — Walk the artifact spine (presence-check · backfill · skip)
|
|
111
128
|
|
|
112
|
-
For each **enabled** stop (per the pruned spine), in order: check if its artifact exists. **
|
|
129
|
+
For each **enabled** stop (per the pruned spine), in order: check if its artifact exists and reconciles with its canon. **True → skip. Missing or stale → write/rewrite with the owner below.**
|
|
113
130
|
|
|
114
131
|
| Stop | Presence check | Missing → write with | Owner · model · effort |
|
|
115
132
|
|---|---|---|---|
|
|
116
|
-
| **
|
|
117
|
-
| **
|
|
118
|
-
| **
|
|
119
|
-
| **
|
|
120
|
-
|
|
|
121
|
-
|
|
|
122
|
-
|
|
|
123
|
-
|
|
|
124
|
-
| **
|
|
125
|
-
| **
|
|
126
|
-
| **
|
|
127
|
-
| **
|
|
133
|
+
| **AIM** | goal + tier confirmed | `AskUserQuestion` (one) | — |
|
|
134
|
+
| **PROMISE** | `test -f text/<slug>.md` | `writer` skill + `text/template-feature.md` | sonnet · medium |
|
|
135
|
+
| **SURVEY** | `do-survey.sh` (4 surfaces) | reuse verdict (expose / extend / build / drop) → the gap list, not the whole idea, feeds the design | `w1-recon`, `Explore` · haiku · low |
|
|
136
|
+
| **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 |
|
|
137
|
+
| **DESIGN** | `test -f text/<slug>-plan.md` | Opus + `text/template-plan.md` (designs the gap list; pre-mortem + decisions live in the template), then `do-reconcile.sh substrate` + `do-reconcile.sh dictionary` | opus · high |
|
|
138
|
+
| ↳ *CLARIFY* | plan has `## Clarifications` (FEATURE/SCHEMA) | ≤5 `AskUserQuestion`, written back into the plan | opus · high |
|
|
139
|
+
| **PLAN** | `test -f text/<slug>-todo.md` | `/create todo` + `text/template-todo.md` | sonnet · medium |
|
|
140
|
+
| ↳ *ANALYZE* | — | `do-analyze.sh text/<slug>-todo.md` — CRITICAL exit 1 blocks BUILD | bash · none |
|
|
141
|
+
| **BUILD** | survey verdict = `build` (≥70% match → `expose`/`extend` instead) | the BUILD engine (Step 3) | sonnet · low–medium |
|
|
142
|
+
| **TEST** | test file in the repo folder | test-first, one assertion per deliverable | sonnet · low |
|
|
143
|
+
| **VERIFY** | rubric + ratchet pass | `do-reconcile.sh <canon>` per category + rubric composite ≥ 0.65 | haiku · medium |
|
|
144
|
+
| **PROVE** | proof artifact captured | `do-prove.sh` (browser / curl / contract / sync) + `accessibility`; the shipped thing checked against `text/<slug>.md`. A multi-cycle plan already built on its own `do/<slug>` branch (worktree isolation — see context isolation below); PROVE is the gate that branch must clear before a human merges it to trunk | sonnet · low |
|
|
145
|
+
| **TEACH** | feature doc + runbook exist | `tutorial` + `writer` — written against the *proven* behavior | sonnet · medium |
|
|
146
|
+
| **SHIP** | changelog / README row | `/release` + adoption signal | sonnet · low |
|
|
147
|
+
| **LEARN** | learnings entry written | close: learnings + cost signal + trust write | — |
|
|
128
148
|
|
|
129
149
|
**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.
|
|
130
150
|
|
|
131
|
-
The two `↳` rows are **gates, not artifacts**: CLARIFY edits the
|
|
151
|
+
The two `↳` rows are **gates, not artifacts**: CLARIFY edits the plan 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.
|
|
132
152
|
|
|
133
|
-
**
|
|
153
|
+
**PROMISE 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.
|
|
134
154
|
|
|
135
155
|
**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.
|
|
136
156
|
|
|
@@ -139,20 +159,20 @@ The two `↳` rows are **gates, not artifacts**: CLARIFY edits the spec in place
|
|
|
139
159
|
| When | Ticked by |
|
|
140
160
|
|---|---|
|
|
141
161
|
| a W1 recon agent returns findings for a file | `/do` after the agent settles |
|
|
142
|
-
| a W2 verdict / diff spec / doc-plan resolves | `/do`
|
|
162
|
+
| a W2 verdict / diff spec / doc-plan resolves | `/do` after the spawned W2 agent settles |
|
|
143
163
|
| a W3 edit agent reports success on a file | `/do` after the agent settles |
|
|
144
|
-
| a W4 check passes (verify · demo ·
|
|
164
|
+
| a W4 check passes (verify · demo · RECONCILES · rubric · ratchet) | `/do` after the bash exits 0 |
|
|
145
165
|
| all of a wave's items are `[x]` | the wave header (derived) |
|
|
146
166
|
| all 4 waves `[x]` | the cycle header (derived) |
|
|
147
167
|
| all cycles in a batch `[x]` | the batch header (derived) |
|
|
148
168
|
|
|
149
|
-
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 `
|
|
169
|
+
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 `text/template-todo.md`.
|
|
150
170
|
|
|
151
171
|
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).
|
|
152
172
|
|
|
153
173
|
**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.
|
|
154
174
|
|
|
155
|
-
**One command, complexity-sized.** `/do <anything>` is the only thing a human types — an idea, a slug, or a `
|
|
175
|
+
**One command, complexity-sized.** `/do <anything>` is the only thing a human types — an idea, a slug, or a `text/<slug>-todo.md` path. The tier sizes the work and the spine prunes itself: a typo is edited and verified inline (one cycle, no loop); a feature writes its promise, plan, todo, tests, and docs and then runs every cycle. The human never picks the mode, never types a flag, never runs a second command.
|
|
156
176
|
|
|
157
177
|
**Context isolation is automatic for multi-cycle plans.** When `/do` resolves to a todo with **≥2 incomplete cycles**, it does not run them inline — it hands the loop to the internal engine so every cycle gets a **fresh context**:
|
|
158
178
|
|
|
@@ -170,7 +190,7 @@ A **single** incomplete cycle (or a PATCH/FIX) runs inline — there's nothing t
|
|
|
170
190
|
**`--next-cycle` is internal.** It means "run one batch, tick boxes, exit — do **not** loop." Only `do-auto.sh` passes it; it is the recursion guard that keeps a fresh `/do` from re-entering the loop. A human never types it.
|
|
171
191
|
|
|
172
192
|
State that survives the reset (all on disk — the loop is stateless in memory):
|
|
173
|
-
- `
|
|
193
|
+
- `text/<slug>-todo.md` — checked boxes are the progress bar; the next `/do --next-cycle` reads them and skips completed cycles automatically
|
|
174
194
|
- `.do-trust.json` — trust level and consecutive score history (drives auto-continue vs halt)
|
|
175
195
|
- `.w4-improvements.json` — open items that become mandatory W1 targets next cycle
|
|
176
196
|
- `.w2-spec.json` / `.w3-receipts.json` — write-once state for soft-resume within a cycle
|
|
@@ -193,7 +213,7 @@ This compounds with the W1 cache and W4 rubric cache: a cycle 6 run with context
|
|
|
193
213
|
|
|
194
214
|
## Step 3 — The BUILD engine (W0 → W4)
|
|
195
215
|
|
|
196
|
-
Runs only when the spine reaches `
|
|
216
|
+
Runs only when the spine reaches `BUILD`. Folder-aware: there is **no root `package.json`** — resolve the target repo folder from the touched files.
|
|
197
217
|
|
|
198
218
|
**W0 — Baseline.**
|
|
199
219
|
```bash
|
|
@@ -218,15 +238,23 @@ bun .claude/scripts/w1-recon.ts --targets "$FILES" --mode RECON
|
|
|
218
238
|
```
|
|
219
239
|
Script exits 2 if `ANTHROPIC_API_KEY` is absent → fall back to spawning `w1-recon` agent (Haiku · low) for ALL files in ONE message. Either path: 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.)*
|
|
220
240
|
|
|
221
|
-
**W2 — Decide (
|
|
241
|
+
**W2 — Decide (spawned single Opus `w2-decide` agent — Opus · high).** W2 is NOT run inline; the conductor spawns one `w2-decide` agent at Opus·high and waits for its result. Understanding is not delegable; it stays single, never fanned — but pinning it to the conductor process is not required. The conductor/session model runs Sonnet; W2 stays Opus. W2 writes 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 DESIGN stop (`template-plan.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). Pin the **Interface Contract** (shared names, CLI signatures, decisions that multiple downstream tasks reference — pins let them run parallel, not serial). Emit the maximal-width batch DAG (arrow test applied: arrows exist only where one cycle reads a file another writes). *(The `w2-decide` agent carries the compose-target table — which canonical doc to check per primitive type — plus context-triggers for surgical doc injection.)*
|
|
222
242
|
|
|
223
|
-
**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.
|
|
243
|
+
**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. Surfaces are built in category order: `schema → types → receiver/SDK → API route → component → page → route registered → nav entry → inbound links → states`.
|
|
224
244
|
|
|
225
245
|
**W4 — Verify (bash first, zero tokens).**
|
|
226
246
|
```bash
|
|
227
247
|
( cd $folder && bun run verify ) # biome + tsc + vitest
|
|
228
248
|
$(cycle.demo.command) # the goal gate — exit 0 = pass
|
|
229
|
-
#
|
|
249
|
+
# RECONCILES gate: per-category reconcile calls
|
|
250
|
+
do-reconcile.sh types # tsc delta ≤ 0
|
|
251
|
+
do-reconcile.sh dictionary # no dead name, no new synonym
|
|
252
|
+
do-reconcile.sh substrate <file> # DATA tasks — schema extended, not forked
|
|
253
|
+
do-reconcile.sh sdk <file> # GATEWAY tasks — joins a receiver
|
|
254
|
+
do-reconcile.sh navigation <surface> # SURFACE tasks — registered + ≥1 inbound link
|
|
255
|
+
do-reconcile.sh design <file> # SURFACE tasks — composes shadcn/tokens
|
|
256
|
+
do-reconcile.sh authority <file> # GATEWAY tasks — walk-up resolves, no ad-hoc
|
|
257
|
+
# TEACH tasks: do-reconcile.sh dictionary + do-reconcile.sh types on doc files
|
|
230
258
|
DELTA_TSC=$((TSC_NOW - TSC_BASELINE)) # hard gate: ≤ 0, no new type errors ever
|
|
231
259
|
```
|
|
232
260
|
Rubric (inline for TRIVIAL/SIMPLE; for COMPLEX — run the SDK script first (6 Haiku in parallel, rubric + spec block cached across all calls):
|
|
@@ -240,44 +268,54 @@ gate: composite ≥ 0.65 AND goal-fit ≥ 0.50 (hard) AND no adversarial > 0
|
|
|
240
268
|
```
|
|
241
269
|
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.
|
|
242
270
|
|
|
243
|
-
**Testing policy** (full detail in `
|
|
271
|
+
**Testing policy** (full detail in `text/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)`.
|
|
244
272
|
|
|
245
273
|
---
|
|
246
274
|
|
|
247
275
|
## Definition of done (tier-scaled — `/do` ticks these automatically)
|
|
248
276
|
|
|
249
|
-
|
|
277
|
+
| # | Done means | Gate |
|
|
278
|
+
|---|---|---|
|
|
279
|
+
| 1 | The agreed goal is met | RUBRIC goal-fit |
|
|
280
|
+
| 2 | Every shippable deliverable has a test asserting it | ANALYZE + TEST |
|
|
281
|
+
| 3 | No regression — ratchet held, `must_not_break` preserved | RECONCILES |
|
|
282
|
+
| 4 | Proven live, reachable, matches the promise | PROVE |
|
|
283
|
+
| 5 | Surfaces wired into navigation, not orphaned | RECONCILES (Navigation) |
|
|
284
|
+
| 6 | Docs in sync — no stale name, no dead link | RECONCILES (Docs) |
|
|
285
|
+
| 7 | Rubric clears the bar | RUBRIC |
|
|
286
|
+
| 8 | Loop closed — result + learning recorded | LEARN |
|
|
250
287
|
|
|
251
|
-
PATCH clears {1,
|
|
288
|
+
PATCH clears {1, 3, 7, 8}. FEATURE clears all eight. Same bar, scaled to the work.
|
|
252
289
|
|
|
253
290
|
---
|
|
254
291
|
|
|
255
292
|
## Non-negotiable rules
|
|
256
293
|
|
|
257
|
-
- **Never skip W2.** Understanding is not delegable.
|
|
258
|
-
- **Default to parallel.** Spawn W1, W3, and W4-rubric agents
|
|
294
|
+
- **Never skip W2.** Understanding is not delegable — spawn the single Opus `w2-decide` agent; never inline it, never fan it.
|
|
295
|
+
- **Default to parallel.** Spawn W1, **W2**, W3, and W4-rubric agents — across cycles in a batch, not just within one. W2 is in the spawn list; the conductor runs Sonnet. An arrow exists only when you can name the file one cycle writes and the next reads; reject every imaginary blocker.
|
|
259
296
|
- **Tick the moment it lands.** Flip `[ ]`→`[x]` as each agent/check settles — never batch at the end. The file is the progress bar.
|
|
260
|
-
- **
|
|
297
|
+
- **PROMISE before code (FEATURE/SCHEMA)** — no feature ships without a stated promise. PATCH/FIX skip PROMISE by design.
|
|
261
298
|
- **Closed loop** — every cycle ends in `mark`/`warn`, never a silent return.
|
|
262
299
|
- **Cheapest tool that decides wins** — a phase that needs no LLM call is the best kind.
|
|
263
300
|
- **W4 max 3 loops**, then halt and report.
|
|
264
301
|
- **One command.** A human types `/do <anything>` and nothing else. Complexity sizing, spine pruning, and (for multi-cycle plans) the context-isolated loop are all automatic — never a flag, never a second command.
|
|
265
302
|
- **Every cycle gets a fresh context.** A multi-cycle `/do` runs each cycle in a clean subprocess via the internal loop. Prior-cycle conversation is noise; the todo checkboxes are the only state that carries forward.
|
|
303
|
+
- **Coherence ratchet is a hard gate.** Every write must leave types / names / primitives / schema / surfaces / docs equal or more coherent than before. The ratchet can tighten; it can never loosen.
|
|
266
304
|
|
|
267
305
|
---
|
|
268
306
|
|
|
269
307
|
## Available to /do — the toolbox
|
|
270
308
|
|
|
271
|
-
**Scripts** (`.claude/scripts/`): `do-auto.sh` (*internal* — the context-isolated, worktree-isolated loop `/do` drives for multi-cycle plans; builds on branch `do/<slug>`, merges to trunk only on a human's say-so) · `do-tier.sh` (tier + pruned spine + classifier + ceiling) · `do-folder.sh` (folder-aware verify/build) · `do-survey.sh` (reuse verdict) · `do-reconcile.sh
|
|
309
|
+
**Scripts** (`.claude/scripts/`): `do-auto.sh` (*internal* — the context-isolated, worktree-isolated loop `/do` drives for multi-cycle plans; builds on branch `do/<slug>`, merges to trunk only on a human's say-so) · `do-tier.sh` (tier + pruned spine + classifier + ceiling) · `do-folder.sh` (folder-aware verify/build) · `do-survey.sh` (reuse verdict) · `do-reconcile.sh <canon>` (**one predicate over 7 canons** — `substrate|dictionary|authority|sdk|design|navigation|types` — subsumes the old RECONCILE, COMPRESS, PROMISE-CHECK, DOC-SYNC gates; `navigation` branch enforces surface reachability; `--self-test` drives fixtures) · `do-analyze.sh` (deliverable↔cycle coverage gate) · `do-prove.sh` (surface-detect proof — pure PROVE, promise-check moved into `do-reconcile.sh design`) · `do-smoke.sh` (deterministic outcome — drives ≥1 fixture per canon branch + orphan/reachable nav fixtures) · `w1-recon.ts` (prompt-cached recon) · `w4-rubric.ts` (cached parallel rubric).
|
|
272
310
|
|
|
273
|
-
**Templates**: `text/template-
|
|
311
|
+
**Templates**: `text/template-feature.md` (promise/PROMISE) · `text/template-plan.md` (design + pre-mortem + decisions/DESIGN) · `text/template-todo.md` (plan + parallel budget + testing policy/PLAN) · `text/template-agent.md` (agent definition/BUILD).
|
|
274
312
|
|
|
275
|
-
**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`.
|
|
313
|
+
**Agents**: `w1-recon` · `w2-decide` (spawned single Opus; carries the full W2 contract — compress check, Interface Contract pin, maximal batch DAG) · `w3-edit` · `w4-verify` · `Explore` · `Plan` · `pr-review-toolkit:*` (code-reviewer, silent-failure-hunter, type-design-analyzer, pr-test-analyzer, code-simplifier) · `find-bugs`.
|
|
276
314
|
|
|
277
|
-
**Skills** (per-stage routing in `
|
|
315
|
+
**Skills** (per-stage routing in `text/templates-plan.md`): PROMISE → `writer`, `copywriting` · DESIGN → `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`.
|
|
278
316
|
|
|
279
317
|
**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`.
|
|
280
318
|
|
|
281
319
|
---
|
|
282
320
|
|
|
283
|
-
*`/do` is `select()` made human-readable: idea in, shipped-and-proven feature out. The path remembers every execution.*
|
|
321
|
+
*`/do` is `select()` made human-readable: idea in, shipped-and-proven feature out. Each artifact is made true — exists and agrees with its canon. The path remembers every execution.*
|
package/commands/skill-create.md
CHANGED
|
@@ -23,11 +23,11 @@ If `[slug]` is omitted, derive it from the most recent `learnings.md` entry
|
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
25
|
# Last learnings entry
|
|
26
|
-
tail -5
|
|
26
|
+
tail -5 text/learnings.md
|
|
27
27
|
|
|
28
28
|
# Recent cycle diff (what actually changed)
|
|
29
29
|
git diff HEAD~1 HEAD --stat
|
|
30
|
-
git diff HEAD~1 HEAD -- $(git diff HEAD~1 HEAD --name-only | grep -v '
|
|
30
|
+
git diff HEAD~1 HEAD -- $(git diff HEAD~1 HEAD --name-only | grep -v 'text/\|text/' | head -20)
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
**Step 2 — Extract the pattern (Haiku · low)**
|
|
@@ -72,7 +72,7 @@ Use this template:
|
|
|
72
72
|
**Step 5 — Close**
|
|
73
73
|
|
|
74
74
|
Emit `signal("learning:harden", 1, "skill=<slug>")` and append one line to
|
|
75
|
-
`
|
|
75
|
+
`text/learnings.md`:
|
|
76
76
|
|
|
77
77
|
```
|
|
78
78
|
- YYYY-MM-DD · skill:<slug> · crystallised from <source-slug> · source=skill-create
|
|
@@ -96,5 +96,5 @@ Emit `signal("learning:harden", 1, "skill=<slug>")` and append one line to
|
|
|
96
96
|
## Close
|
|
97
97
|
|
|
98
98
|
After writing the skill file: `[ ] skill-create:<slug> done` appended to
|
|
99
|
-
`
|
|
99
|
+
`text/learnings.md`, signal emitted, session stop-reflect will pick it up as
|
|
100
100
|
a new primitive on the next session start.
|
package/commands/sync.md
CHANGED
|
@@ -10,8 +10,8 @@ Reconcile substrate state — tick loops, absorb markdown, propagate knowledge.
|
|
|
10
10
|
|------|------|------|
|
|
11
11
|
| *(default)* | Tick all loops + scan docs + todos + agents | L1-L7 |
|
|
12
12
|
| `tick` | Fire all L1-L7 loops once (one full growth cycle) | L1-L7 |
|
|
13
|
-
| `docs` | Scan `
|
|
14
|
-
| `todos` | Scan `
|
|
13
|
+
| `docs` | Scan `text/*.md` → memory → TypeDB | L6 |
|
|
14
|
+
| `todos` | Scan `text/*-todo.md` → tasks → TypeDB + KV | L1 |
|
|
15
15
|
| `tasks [dir]` | Import reusable task templates from `tasks/` (or `[dir]`) → world-scoped tasks + skills + capabilities | L1 |
|
|
16
16
|
| `agents` | Scan `agents/**/*.md` → units → TypeDB | L1 |
|
|
17
17
|
| `fade` | Fire L3 only — asymmetric decay | L3 |
|
|
@@ -41,8 +41,8 @@ Individual noun invocations target a single loop layer; default runs all of them
|
|
|
41
41
|
### *(default)*
|
|
42
42
|
|
|
43
43
|
1. `bun run verify` — W0 gate (skip if already passed this session)
|
|
44
|
-
2. Scan `
|
|
45
|
-
3. Scan `
|
|
44
|
+
2. Scan `text/*-todo.md` → parse checkboxes → POST `/api/tasks/sync`
|
|
45
|
+
3. Scan `text/*.md` → extract concepts → write to memory → TypeDB
|
|
46
46
|
4. Scan `agents/**/*.md` → parse frontmatter → sync units + skills
|
|
47
47
|
5. GET `http://localhost:4321/api/tick?interval=0` — fire all L1-L7 loops
|
|
48
48
|
6. Report:
|
|
@@ -73,14 +73,14 @@ Individual noun invocations target a single loop layer; default runs all of them
|
|
|
73
73
|
|
|
74
74
|
### docs
|
|
75
75
|
|
|
76
|
-
1. Scan all `
|
|
76
|
+
1. Scan all `text/*.md` files via `src/engine/doc-scan.ts`
|
|
77
77
|
2. Extract key concepts, verify doc-code alignment
|
|
78
78
|
3. Write to memory → TypeDB
|
|
79
79
|
4. Report: docs scanned, gaps found, TypeDB writes
|
|
80
80
|
|
|
81
81
|
### todos
|
|
82
82
|
|
|
83
|
-
1. Scan all `
|
|
83
|
+
1. Scan all `text/*-todo.md` files via `src/engine/task-parse.ts` (`scanTodos()`)
|
|
84
84
|
2. POST to `http://localhost:4321/api/tasks/sync` (hash-gated: skips if data unchanged)
|
|
85
85
|
3. KV update (~10ms), async TypeDB sync (~100ms)
|
|
86
86
|
4. Report:
|
|
@@ -129,7 +129,7 @@ Optional: `description`, `tags`, `wave`, `value`, `effort`, `phase`, `persona`,
|
|
|
129
129
|
**Why this noun exists:** Stage 1 (LIST) of the trade lifecycle needs inventory.
|
|
130
130
|
A new seller world with zero listings is a dead market. Reusable task templates
|
|
131
131
|
are pre-packaged LIST entries — import the catalog, your world has a starter
|
|
132
|
-
set of listings ready to receive offers. See `
|
|
132
|
+
set of listings ready to receive offers. See `text/trade-lifecycle-todo.md § Cycle 6`.
|
|
133
133
|
|
|
134
134
|
### agents
|
|
135
135
|
|
package/hooks/hooks.json
CHANGED
|
@@ -9,6 +9,20 @@
|
|
|
9
9
|
"command": "bash \"$CLAUDE_PLUGIN_ROOT/hooks/scripts/gate-guard.sh\"",
|
|
10
10
|
"timeout": 5000,
|
|
11
11
|
"blocking": true
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"id": "hook:config-protect",
|
|
15
|
+
"type": "command",
|
|
16
|
+
"command": "bash \"$CLAUDE_PLUGIN_ROOT/hooks/scripts/config-protect.sh\"",
|
|
17
|
+
"timeout": 5000,
|
|
18
|
+
"blocking": true
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"id": "hook:compact-hint",
|
|
22
|
+
"type": "command",
|
|
23
|
+
"command": "bash \"$CLAUDE_PLUGIN_ROOT/hooks/scripts/compact-hint.sh\"",
|
|
24
|
+
"timeout": 3000,
|
|
25
|
+
"blocking": false
|
|
12
26
|
}
|
|
13
27
|
]
|
|
14
28
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# COMPACT-HINT — PreToolUse: suggest /compact when context is large.
|
|
3
|
+
#
|
|
4
|
+
# Non-blocking — writes one line to stderr, fires at most once per session.
|
|
5
|
+
# Threshold: 400KB transcript (~80-120k tokens depending on content density).
|
|
6
|
+
#
|
|
7
|
+
# Disable: ECC_DISABLED_HOOKS=hook:compact-hint
|
|
8
|
+
|
|
9
|
+
# shellcheck source=lib/hook.sh
|
|
10
|
+
_HOOK_LIB="${CLAUDE_PLUGIN_ROOT:-$CLAUDE_PROJECT_DIR/.claude}/hooks/lib"
|
|
11
|
+
source "$_HOOK_LIB/hook.sh"
|
|
12
|
+
is_hook_disabled "hook:compact-hint" && exit 0
|
|
13
|
+
|
|
14
|
+
PAYLOAD="${1:-}"
|
|
15
|
+
[[ -z "$PAYLOAD" ]] && exit 0
|
|
16
|
+
|
|
17
|
+
# Locate the transcript — from hook JSON or env var (Claude Code sets both)
|
|
18
|
+
TRANSCRIPT=$(printf '%s' "$PAYLOAD" | jq -r '.transcript_path // .transcriptPath // empty' 2>/dev/null)
|
|
19
|
+
[[ -z "$TRANSCRIPT" ]] && TRANSCRIPT="${CLAUDE_TRANSCRIPT_PATH:-}"
|
|
20
|
+
[[ -z "$TRANSCRIPT" || ! -f "$TRANSCRIPT" ]] && exit 0
|
|
21
|
+
|
|
22
|
+
SIZE=$(wc -c < "$TRANSCRIPT" 2>/dev/null | tr -d ' ')
|
|
23
|
+
[[ -z "$SIZE" || "$SIZE" -lt 400000 ]] && exit 0
|
|
24
|
+
|
|
25
|
+
# Fire at most once per session
|
|
26
|
+
SESSION_KEY=$(hook_session_key "$PAYLOAD")
|
|
27
|
+
FLAG="/tmp/oneie-compact-hint-${SESSION_KEY}"
|
|
28
|
+
[[ -f "$FLAG" ]] && exit 0
|
|
29
|
+
touch "$FLAG"
|
|
30
|
+
|
|
31
|
+
SIZE_KB=$(( SIZE / 1024 ))
|
|
32
|
+
echo "" >&2
|
|
33
|
+
echo "⚡ Context is ~${SIZE_KB}KB — run /compact before the next big edit to keep responses fast and cheap." >&2
|
|
34
|
+
echo "" >&2
|
|
35
|
+
|
|
36
|
+
exit 0
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# CONFIG-PROTECT — PreToolUse(Edit|Write): block lint/type config weakening.
|
|
3
|
+
#
|
|
4
|
+
# Prevents introducing "off"/"warn" rules or disabling strict flags in
|
|
5
|
+
# biome.json, tsconfig*.json, or .eslintrc* files.
|
|
6
|
+
#
|
|
7
|
+
# Why: W4 verify uses biome + tsc as hard gates. Weakening the config
|
|
8
|
+
# is equivalent to deleting the gate. Fix the code — not the rules.
|
|
9
|
+
# If a rule genuinely needs changing, explain it in the PR description.
|
|
10
|
+
#
|
|
11
|
+
# Disable: ECC_DISABLED_HOOKS=hook:config-protect
|
|
12
|
+
|
|
13
|
+
# shellcheck source=lib/hook.sh
|
|
14
|
+
_HOOK_LIB="${CLAUDE_PLUGIN_ROOT:-$CLAUDE_PROJECT_DIR/.claude}/hooks/lib"
|
|
15
|
+
source "$_HOOK_LIB/hook.sh"
|
|
16
|
+
is_hook_disabled "hook:config-protect" && exit 0
|
|
17
|
+
|
|
18
|
+
PAYLOAD="${1:-}"
|
|
19
|
+
[[ -z "$PAYLOAD" ]] && exit 0
|
|
20
|
+
|
|
21
|
+
TOOL=$(printf '%s' "$PAYLOAD" | jq -r '.tool_name // empty' 2>/dev/null)
|
|
22
|
+
case "$TOOL" in Edit|Write) ;; *) exit 0 ;; esac
|
|
23
|
+
|
|
24
|
+
FILE=$(printf '%s' "$PAYLOAD" | jq -r '.tool_input.file_path // empty' 2>/dev/null)
|
|
25
|
+
[[ -z "$FILE" ]] && exit 0
|
|
26
|
+
|
|
27
|
+
# Only gate known config files
|
|
28
|
+
case "$(basename "$FILE")" in
|
|
29
|
+
biome.json|biome.*.json|\
|
|
30
|
+
tsconfig.json|tsconfig.*.json|\
|
|
31
|
+
.eslintrc|.eslintrc.json|.eslintrc.js|.eslintrc.cjs|.eslintrc.mjs) ;;
|
|
32
|
+
*) exit 0 ;;
|
|
33
|
+
esac
|
|
34
|
+
|
|
35
|
+
# For Edit: compare old_string vs new_string — block only if weakening is NEW.
|
|
36
|
+
# For Write: check the whole content.
|
|
37
|
+
if [[ "$TOOL" == "Edit" ]]; then
|
|
38
|
+
OLD=$(printf '%s' "$PAYLOAD" | jq -r '.tool_input.old_string // empty' 2>/dev/null)
|
|
39
|
+
NEW=$(printf '%s' "$PAYLOAD" | jq -r '.tool_input.new_string // empty' 2>/dev/null)
|
|
40
|
+
[[ -z "$NEW" ]] && exit 0
|
|
41
|
+
# Only block if the weakening pattern appears in NEW but not in OLD
|
|
42
|
+
_has_weakening() { printf '%s' "$1" | grep -qE '"(off|warn)"|"noErrors":\s*true|"strict":\s*false|"skipLibCheck":\s*true|"noUnusedLocals":\s*false|"noImplicitAny":\s*false|"allowJs":\s*true'; }
|
|
43
|
+
_has_weakening "$OLD" && exit 0 # already present — not introducing it
|
|
44
|
+
_has_weakening "$NEW" || exit 0 # not in new content — safe
|
|
45
|
+
else
|
|
46
|
+
# Write: check full content
|
|
47
|
+
CONTENT=$(printf '%s' "$PAYLOAD" | jq -r '.tool_input.content // empty' 2>/dev/null)
|
|
48
|
+
[[ -z "$CONTENT" ]] && exit 0
|
|
49
|
+
printf '%s' "$CONTENT" | grep -qE '"(off|warn)"|"noErrors":\s*true|"strict":\s*false|"skipLibCheck":\s*true|"noUnusedLocals":\s*false|"noImplicitAny":\s*false|"allowJs":\s*true' || exit 0
|
|
50
|
+
fi
|
|
51
|
+
|
|
52
|
+
FNAME=$(basename "$FILE")
|
|
53
|
+
printf '%s' "$(jq -nc --arg f "$FNAME" --arg path "$FILE" \
|
|
54
|
+
'{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":
|
|
55
|
+
("[Config-Guard] Weakening \($f) is not allowed.\n\nW4 verify uses biome + tsc as hard gates — disabling rules deletes the gate.\nFix the code, not the config.\n\nIf this change is genuinely intentional, explain it in the PR description, then\ndisable for this session: ECC_DISABLED_HOOKS=hook:config-protect")}}')"
|
|
56
|
+
exit 0
|
|
@@ -75,11 +75,11 @@ check_drift '^api/src/' 'api/CLAUDE.md'
|
|
|
75
75
|
|
|
76
76
|
# (4) Completed /do cycle → suggest /skill-create to crystallise the pattern.
|
|
77
77
|
# Heuristic: learnings.md was touched AND W3 edited >=3 non-plan/non-text files.
|
|
78
|
-
if echo "$CHANGED" | grep -qF '
|
|
79
|
-
CYCLE_FILES=$(echo "$CHANGED" | grep -vE '^
|
|
78
|
+
if echo "$CHANGED" | grep -qF 'text/learnings.md'; then
|
|
79
|
+
CYCLE_FILES=$(echo "$CHANGED" | grep -vE '^text/|^text/|^\.claude/' | wc -l | awk '{print $1}')
|
|
80
80
|
if [ "$CYCLE_FILES" -ge 3 ]; then
|
|
81
81
|
# Extract the cycle slug from the last learnings entry
|
|
82
|
-
CYCLE_SLUG=$(grep -oE 'cycle [0-9]+|· [a-z][a-z0-9-]+'
|
|
82
|
+
CYCLE_SLUG=$(grep -oE 'cycle [0-9]+|· [a-z][a-z0-9-]+' text/learnings.md 2>/dev/null | tail -1 | sed 's/^· //')
|
|
83
83
|
BUF+="- **skill-create** cycle closed with ${CYCLE_FILES} file(s) changed — run \`/skill-create ${CYCLE_SLUG}\` to crystallise the pattern as a reusable skill.\n"
|
|
84
84
|
PROPOSALS=$((PROPOSALS + 1))
|
|
85
85
|
fi
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oneie/claude",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "ONE Claude Code plugin — /do lifecycle, W1-W4 BUILD engine, ONE substrate via MCP, signals, and rules",
|
|
5
5
|
"files": [
|
|
6
6
|
".claude-plugin",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"rules",
|
|
12
12
|
"hooks",
|
|
13
13
|
"scripts",
|
|
14
|
+
"templates",
|
|
14
15
|
"README.md"
|
|
15
16
|
],
|
|
16
17
|
"peerDependencies": {
|
package/rules/documentation.md
CHANGED
|
@@ -16,12 +16,12 @@ Before any code is written, explicitly list which docs will change:
|
|
|
16
16
|
### Documentation Updates (W2)
|
|
17
17
|
|
|
18
18
|
**New docs:**
|
|
19
|
-
- `
|
|
19
|
+
- `text/feature.md` — {purpose}
|
|
20
20
|
|
|
21
21
|
**Docs modified:**
|
|
22
|
-
- `
|
|
23
|
-
- `
|
|
24
|
-
- `
|
|
22
|
+
- `text/dictionary-plan.md` — add term {name}
|
|
23
|
+
- `text/routing-plan.md` — update loop L{N}
|
|
24
|
+
- `text/rubrics-plan.md` — add dimension {name}
|
|
25
25
|
|
|
26
26
|
**Schema changes:**
|
|
27
27
|
- New TypeDB entities, D1 migrations, TypeQL functions
|
|
@@ -37,12 +37,12 @@ Before any code is written, explicitly list which docs will change:
|
|
|
37
37
|
|
|
38
38
|
| Code File | Related Doc |
|
|
39
39
|
|-----------|-------------|
|
|
40
|
-
| `nanoclaw/src/types.ts` | `
|
|
41
|
-
| `src/engine/world.ts` | `
|
|
42
|
-
| `src/engine/loop.ts` | `
|
|
43
|
-
| `src/pages/api/*.ts` | `
|
|
44
|
-
| `src/schema/*.tql` | `
|
|
45
|
-
| Feature-specific file | `
|
|
40
|
+
| `nanoclaw/src/types.ts` | `text/dictionary-plan.md` — add new type terms |
|
|
41
|
+
| `src/engine/world.ts` | `text/DSL-plan.md` — update signal grammar |
|
|
42
|
+
| `src/engine/loop.ts` | `text/routing-plan.md` — update L1-L7 loops |
|
|
43
|
+
| `src/pages/api/*.ts` | `text/lifecycle-plan.md` — update lifecycle stage |
|
|
44
|
+
| `src/schema/*.tql` | `text/one-ontology.md` — update dimension/entity |
|
|
45
|
+
| Feature-specific file | `text/feature.md` — update feature spec |
|
|
46
46
|
|
|
47
47
|
**Pattern:** If you're adding a new field to a TypeScript interface, add it to the doc that defines that interface. If you're changing a loop, update the loop diagram in the doc.
|
|
48
48
|
|
|
@@ -54,7 +54,7 @@ Before any code is written, explicitly list which docs will change:
|
|
|
54
54
|
|
|
55
55
|
1. **Terminology** — All renamed concepts updated everywhere
|
|
56
56
|
```bash
|
|
57
|
-
grep -r "old-name"
|
|
57
|
+
grep -r "old-name" text/ -- ignore new-name where intentional (dead names)
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
2. **Examples** — Code examples in docs match actual implementation
|
|
@@ -125,10 +125,10 @@ After W4 completes, auto-run consistency checks:
|
|
|
125
125
|
|
|
126
126
|
```bash
|
|
127
127
|
# Terminology consistency
|
|
128
|
-
grep -r "old-term"
|
|
128
|
+
grep -r "old-term" text/ | flag if > 0 (not on deadname list)
|
|
129
129
|
|
|
130
130
|
# Cross-references
|
|
131
|
-
markdown-link-check
|
|
131
|
+
markdown-link-check text/*.md
|
|
132
132
|
|
|
133
133
|
# Metaphor alignment (if touching signal/path semantics)
|
|
134
134
|
grep -l "signal\|strength\|resistance" src/changed-files.txt | xargs -I {} \
|
|
@@ -151,9 +151,9 @@ grep "rubric\|dimension" src/changed-files.txt | flag for rubrics.md review
|
|
|
151
151
|
- None (extends existing types)
|
|
152
152
|
|
|
153
153
|
**Docs modified:**
|
|
154
|
-
- `
|
|
155
|
-
- `
|
|
156
|
-
- `
|
|
154
|
+
- `text/dictionary-plan.md` — add "Rich Messages" section, explain `data.rich` convention
|
|
155
|
+
- `text/rich-messages.md` — add PaymentMetadata type, Payment flow section
|
|
156
|
+
- `text/template-todo.md` — add "Documentation Updates (W2 + W4)" section
|
|
157
157
|
|
|
158
158
|
**Schema changes:**
|
|
159
159
|
- `nanoclaw/src/types.ts` — RichMessage.thread, RichMessage.payment added (Cycle 1 & 3)
|
|
@@ -197,9 +197,9 @@ When running `/do {name}-todo.md`, the workflow enforces:
|
|
|
197
197
|
| feature doc named in plan | feature doc | sync verb/component/endpoint counts |
|
|
198
198
|
| rename across W3 | every `**/*.md` containing old name | inline replace (auto-grep) |
|
|
199
199
|
|
|
200
|
-
Anchor mismatch → log to `
|
|
200
|
+
Anchor mismatch → log to `text/improvements.md` for manual W2 next cycle (no halt — the cycle still closes; the propagate task surfaces next iteration).
|
|
201
201
|
|
|
202
|
-
**Learnings entry** (append to `
|
|
202
|
+
**Learnings entry** (append to `text/learnings.md` on each close):
|
|
203
203
|
|
|
204
204
|
```
|
|
205
205
|
- YYYY-MM-DD · cycle N · wave N|gate · {one sentence} · rubric=0.NN · source=w1|w2|w3|w4|cycle
|