@pilotspace/add 1.8.0 → 1.10.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/CHANGELOG.md +109 -0
- package/bin/cli.js +137 -2
- package/docs/16-releasing.md +2 -2
- package/docs/17-components.md +125 -0
- package/docs/appendix-c-glossary.md +8 -0
- package/package.json +2 -2
- package/skill/add/SKILL.md +90 -116
- package/skill/add/adopt.md +13 -34
- package/skill/add/advisor.md +9 -10
- package/skill/add/compact-foundation.md +21 -34
- package/skill/add/components.md +54 -0
- package/skill/add/confidence.md +9 -25
- package/skill/add/deltas.md +12 -28
- package/skill/add/design.md +26 -32
- package/skill/add/fold.md +26 -51
- package/skill/add/graduate.md +18 -54
- package/skill/add/intake.md +30 -34
- package/skill/add/loop.md +30 -34
- package/skill/add/phases/0-ground.md +6 -14
- package/skill/add/phases/0-setup.md +30 -81
- package/skill/add/phases/1-specify.md +7 -22
- package/skill/add/phases/2-scenarios.md +1 -3
- package/skill/add/phases/3-contract.md +8 -22
- package/skill/add/phases/4-tests.md +3 -6
- package/skill/add/phases/5-build.md +8 -22
- package/skill/add/phases/6-verify.md +14 -49
- package/skill/add/phases/7-observe.md +1 -3
- package/skill/add/phases/fast-lane.md +31 -0
- package/skill/add/release.md +36 -90
- package/skill/add/report-template.md +41 -126
- package/skill/add/run.md +89 -159
- package/skill/add/scope.md +40 -89
- package/skill/add/setup-review.md +10 -27
- package/skill/add/soul.md +17 -36
- package/skill/add/streams.md +90 -149
- package/tooling/add.py +804 -14
- package/tooling/templates/TASK.fast.md.tmpl +72 -0
- package/tooling/templates/TASK.md.tmpl +1 -1
package/skill/add/SKILL.md
CHANGED
|
@@ -15,79 +15,64 @@ user-invocable: true
|
|
|
15
15
|
when_to_use: "Invoke in any repo with a `.add/` directory, or when the user wants spec/tests-first feature work, resumes ADD work, or asks to start/advance a task."
|
|
16
16
|
category: workflows
|
|
17
17
|
keywords: [add, aidd, ai-driven-development, spec-first, tdd, contract, scenarios, verify, milestone, task-orchestration]
|
|
18
|
-
argument-hint: "
|
|
18
|
+
argument-hint: "status | init | continue | [describe new short goals or expectation]"
|
|
19
19
|
license: MIT
|
|
20
20
|
metadata:
|
|
21
21
|
author: add
|
|
22
|
-
version: "1.
|
|
22
|
+
version: "1.8.0"
|
|
23
23
|
---
|
|
24
24
|
|
|
25
25
|
# ADD — the orchestration engine
|
|
26
26
|
|
|
27
27
|
You are the orchestrator. ADD keeps the AI fast *and* safe by fixing direction
|
|
28
|
-
(spec, scenarios, contract, failing tests) **before** the build, and trusting
|
|
29
|
-
|
|
28
|
+
(spec, scenarios, contract, failing tests) **before** the build, and trusting the
|
|
29
|
+
result through passing evidence rather than a plausible-looking diff.
|
|
30
30
|
|
|
31
|
-
**One file = one task.** Each feature
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
**One file = one task.** Each feature is one `.add/tasks/<slug>/TASK.md` — a §0 ground
|
|
32
|
+
preamble plus seven step sections, filled top to bottom. The Python tool tracks where you
|
|
33
|
+
are so context never rots across sessions.
|
|
34
34
|
|
|
35
35
|
## Always start here (orient — do not skip)
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
engine is in this project before anything else:
|
|
37
|
+
Engine: `.add/tooling/add.py` · book: `.add/docs/`. Ensure the engine is in the project first:
|
|
39
38
|
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
- It exists → go straight to `status` below.
|
|
40
|
+
- It does NOT (ADD installed as a Claude Code plugin — engine + book ride in the plugin) →
|
|
41
|
+
materialize once: `node "${CLAUDE_PLUGIN_ROOT}/bin/cli.js" init --no-skill`. That drops
|
|
42
|
+
`.add/tooling/` (engine) + `.add/docs/` (book) + the agent-agnostic `CLAUDE.md` block — like an
|
|
43
|
+
npm/pip install; the skill stays in the plugin, nothing duplicated.
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
node "${CLAUDE_PLUGIN_ROOT}/bin/cli.js" init --no-skill
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
That drops `.add/tooling/` (the engine) and `.add/docs/` (the book) here, so the engine,
|
|
50
|
-
the book, and the agent-agnostic guideline block in `CLAUDE.md` all work for every agent
|
|
51
|
-
and for a human at the shell — exactly like an npm or pip install. The skill itself stays
|
|
52
|
-
in the plugin, so nothing is duplicated.
|
|
53
|
-
|
|
54
|
-
Run the tool to find the resume point instead of re-reading the repo:
|
|
45
|
+
Find the resume point from the tool, not by re-reading the repo:
|
|
55
46
|
|
|
56
47
|
```bash
|
|
57
48
|
python3 .add/tooling/add.py status
|
|
58
49
|
```
|
|
59
50
|
|
|
60
|
-
`status`
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
(the `soul-self-improve` path proposes voice deltas the human confirms).
|
|
64
|
-
|
|
65
|
-
- **No `.add/state.json` yet** (a fresh install drops tooling + docs but does *not* init — so `status` says
|
|
66
|
-
`no .add/ project found`) → enter **autonomous setup**: first, if `.add/.intent` exists, read it — the
|
|
67
|
-
one-line first-build intent the user gave the installer (a NOTE, never an init trigger) — and let it seed
|
|
68
|
-
your kickoff suggestion (`phases/0-setup.md`); then YOU run init yourself —
|
|
69
|
-
`add.py init --name "<inferred>" --stage <picked> --await-lock` (don't tell the human to) — then read
|
|
70
|
-
`phases/0-setup.md` and draft the foundation + first scope + first contract through to the human baseline approval.
|
|
71
|
-
- **A task is active** → open `.add/tasks/<active>/TASK.md`, look at its `phase:`
|
|
72
|
-
marker, and read the matching `phases/<n>-<phase>.md`. Work *only* that phase.
|
|
73
|
-
- **No active task** → first SIZE the request (see Intake below), then create the
|
|
74
|
-
right scope: `python3 .add/tooling/add.py new-task <slug> --title "..."`.
|
|
51
|
+
`status` names two files to read when orienting: `.add/PROJECT.md` (the foundation) and `.add/SOUL.md`
|
|
52
|
+
(your **voice** — tone, style, what keeps the human's trust; read it each session — human-owned and
|
|
53
|
+
self-improving via the `soul-self-improve` path). Then branch on state:
|
|
75
54
|
|
|
76
|
-
|
|
55
|
+
- **No `.add/state.json` yet** (`status` says `no .add/ project found`) → **autonomous setup**: if
|
|
56
|
+
`.add/.intent` exists, read it — the installer's one-line first-build intent (a NOTE, never an init
|
|
57
|
+
trigger) — to seed your kickoff; then YOU run init — `add.py init --name "<inferred>" --stage <picked>
|
|
58
|
+
--await-lock` — and read `phases/0-setup.md` to draft the foundation + §1–§3 through to the human
|
|
59
|
+
baseline approval.
|
|
60
|
+
- **A task is active** → open its `.add/tasks/<active>/TASK.md`, read the `phase:` marker, load the
|
|
61
|
+
matching `phases/<n>-<phase>.md`. Work *only* that phase.
|
|
62
|
+
- **No active task** → first SIZE the request (Intake below), then `add.py new-task <slug> --title "..."`.
|
|
77
63
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
`intake.md` for the rubric, the tie-break order, and worked examples. A question or
|
|
83
|
-
unsharp intent? **Interview before you size** — explore and suggest first (`intake.md`).
|
|
64
|
+
**Quick ref** — `status` resume · `init` bootstrap · `advance` continue · `gate PASS` at verify.
|
|
65
|
+
**Opt-in flags** (human picks, never auto): `new-task --fast` = fast lane (minimal template, freeze-gated) · `new-milestone --await-confirm` = confirm-gate the milestone's tasks.
|
|
66
|
+
|
|
67
|
+
## Intake — size a request before creating scope
|
|
84
68
|
|
|
85
|
-
|
|
86
|
-
`
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
69
|
+
Classify a raw request BEFORE any milestone or task: read `intake.md`, place it in one bucket —
|
|
70
|
+
`new-major` · `sub-milestone` · `task` · `change-request` — propose `{ bucket, rationale, command }`;
|
|
71
|
+
the human confirms. A question or unsharp intent? **Interview before you size** (`intake.md`). Once
|
|
72
|
+
`new-major`/`sub-milestone`, draft the `MILESTONE.md` (goal · scope · exit criteria · breadth-first
|
|
73
|
+
tasks) — read `scope.md`. Create it `new-milestone --await-confirm`, then `milestone-confirm <slug>`
|
|
74
|
+
gates `new-task` until the parent is agreed. For `task`/`change-request`: `add.py new-task` then the
|
|
75
|
+
first phase guide.
|
|
91
76
|
|
|
92
77
|
## The flow and which file to load
|
|
93
78
|
|
|
@@ -106,77 +91,67 @@ Load the phase guide **only for the phase you are in** (progressive disclosure):
|
|
|
106
91
|
| observe | `phases/7-observe.md` | §7 spec delta | human + AI |
|
|
107
92
|
|
|
108
93
|
† **The specification bundle (v7).** §1–§4 are one bundle; the human gives **one approval at the
|
|
109
|
-
contract freeze
|
|
110
|
-
‡ **Verify auto-gate (v6–v7).** Under `autonomy: auto` (
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
gathers confirmed deltas into a versioned foundation — read `fold.md`. Then (or on demand) compact the stable tail of each foundation spec into a rolled-up settled line — read `compact-foundation.md` (a SEPARATE step, run after `fold.md`).
|
|
125
|
-
|
|
126
|
-
Observe also tunes your **voice**: propose a confirmable **voice delta** from the human's wordings +
|
|
127
|
-
flow that, once they confirm, rewrites `SOUL.md` (the human is the only writer) — read `soul.md`.
|
|
94
|
+
contract freeze**, lowest-confidence-first — see `run.md`.
|
|
95
|
+
‡ **Verify auto-gate (v6–v7).** Under `autonomy: auto` (default) a run may auto-PASS on complete
|
|
96
|
+
evidence (*auto-resolved* — an explicit PASS, not a skip). **Security always escalates** (HARD-STOP);
|
|
97
|
+
so do concurrency / architecture residue and a lowered autonomy level (`conservative` / `manual`) — `run.md`.
|
|
98
|
+
|
|
99
|
+
At every human decision point (intake · bundle approval · gate · milestone close) follow
|
|
100
|
+
`report-template.md`: open with the ARC (goal · done · plan, engine-sourced), then SUMMARY → DECISION →
|
|
101
|
+
FLAGS → DECIDED → EVIDENCE → NEXT; show-before-ask; never pre-stamp; the question is a summary, never the artifact.
|
|
102
|
+
|
|
103
|
+
In **observe**, emit **lessons learned** tagged by which of the five (`DDD · SDD · UDD · TDD · ADD`)
|
|
104
|
+
they improve (write them `open`; the human consolidates into `PROJECT.md`) — grammar + lifecycle in
|
|
105
|
+
`deltas.md`. At milestone close (or on demand) the retrospective consolidation gathers confirmed deltas
|
|
106
|
+
into a versioned foundation — `fold.md`; then (separately, after) compact each foundation spec's stable
|
|
107
|
+
tail — `compact-foundation.md`. Observe also tunes your voice: propose a confirmable voice delta that,
|
|
108
|
+
once the human confirms, rewrites `SOUL.md` (the human is the only writer) — `soul.md`.
|
|
128
109
|
|
|
129
110
|
## Beyond the bundle — load on demand
|
|
130
111
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
level: gather `release-report` → draft notes from the consolidated deltas → meet the readiness floor
|
|
157
|
-
(security HARD-STOP is un-forceable) → human confirms → `add.py release <version>` records the cut
|
|
158
|
-
(CHANGELOG + `RELEASES.md` ledger + milestone attribution) → watch. The engine records; the human runs
|
|
159
|
-
the tag / publish / deploy. A release bundles ≥1 milestone and is orthogonal to stage.
|
|
112
|
+
- **§3 CONTRACT FROZEN** → build→verify is a dynamic, auto-gated run (`autonomy: auto` default; lower to
|
|
113
|
+
`conservative`/`manual` for a human gate) — `run.md`. Pipeline several ready tasks behind their frozen
|
|
114
|
+
contracts — `streams.md`. Delegate one piece of your plan to a subagent (when to spawn, the prompt
|
|
115
|
+
template, the tier) — `advisor.md`. Self-score a draft (0–1 across six dimensions, refine if any < 0.9)
|
|
116
|
+
— `confidence.md`. Both advisory: the engine never spawns; the self-score is never a gate.
|
|
117
|
+
- **Small, low-risk task**, less ceremony → the **fast lane**: `new-task --fast` scaffolds the minimal
|
|
118
|
+
`TASK.fast.md`, bundle approved in one freeze — `phases/fast-lane.md`. Floor held (frozen contract ·
|
|
119
|
+
red test · verify gate; `--fast` is freeze-gated under any milestone). Collapse, never skip; opt-in.
|
|
120
|
+
- **UI feature** at specify → the **design-definition loop** (UDD): review the domain → research and
|
|
121
|
+
reuse components → wireframe → a real captured screen the human confirms **before** build — `design.md`.
|
|
122
|
+
Tool-agnostic; the engine never renders.
|
|
123
|
+
- Tasks all done but the milestone **goal** unmet → `milestone-done` holds it open; the loop turns open
|
|
124
|
+
deltas + extras into the next tasks (you propose, the human confirms) until the goal is met — `loop.md`.
|
|
125
|
+
- `status` prints **`MVP covered → propose graduation`** (every milestone done AND stage criteria all
|
|
126
|
+
`[x]`) → `graduate.md`: `graduation-report` → co-specify interview → draft ≥1 production milestone →
|
|
127
|
+
human confirm → then `stage production`. Guarded (`stage_no_roadmap`); the FINAL step, never a bare flip.
|
|
128
|
+
- `status` prints **`→ releasable: N milestone(s) closed since last release`** → `release.md` (the 5th
|
|
129
|
+
scope level): `release-report` → draft notes from the consolidated deltas → meet the readiness floor
|
|
130
|
+
(security HARD-STOP is un-forceable) → human confirms → `add.py release <version>` records the cut
|
|
131
|
+
(CHANGELOG + `RELEASES.md` ledger + milestone attribution). The engine records; the human runs the
|
|
132
|
+
tag / publish / deploy. A release bundles ≥1 milestone and is orthogonal to stage.
|
|
133
|
+
- **Monorepo / multi-repo** — a milestone spans more than one green bar (a BE + its FE, services across
|
|
134
|
+
repos) → the **component pillar**: declare components in `.add/components.toml`, gate each task on its
|
|
135
|
+
component's green-bar, freeze cross-component contracts (`produces:`/`consumes:`), hold the FE until the
|
|
136
|
+
BE freezes, and `federate pull` a contract across repos — `components.md`. Opt-in; no components = today.
|
|
160
137
|
|
|
161
138
|
## Non-negotiable rules (from the method)
|
|
162
139
|
|
|
163
140
|
<constraints>
|
|
164
141
|
1. **Direction before speed.** Never start Build until §1–§4 exist and tests are red.
|
|
165
|
-
2. **Trust evidence, not inspection.** A feature is trusted because its tests pass
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
3. **Never weaken a test or edit a frozen contract to make the build pass.** That
|
|
169
|
-
|
|
170
|
-
4. **No silent skips.** Every Verify ends in exactly one recorded outcome:
|
|
171
|
-
|
|
172
|
-
finding is always `HARD-STOP`.
|
|
142
|
+
2. **Trust evidence, not inspection.** A feature is trusted because its tests pass and the
|
|
143
|
+
non-functional risks (concurrency, security, architecture) were checked — not because the code
|
|
144
|
+
reads plausibly.
|
|
145
|
+
3. **Never weaken a test or edit a frozen contract to make the build pass.** That inverts the method.
|
|
146
|
+
A real change is a *change request* back to Specify.
|
|
147
|
+
4. **No silent skips.** Every Verify ends in exactly one recorded outcome: `PASS`, `RISK-ACCEPTED`
|
|
148
|
+
(signed, non-security only), or `HARD-STOP`. A security finding is always `HARD-STOP`.
|
|
173
149
|
5. **Ask, don't guess.** If a requirement is unclear, stop and ask the user.
|
|
174
150
|
</constraints>
|
|
175
151
|
|
|
176
152
|
## Advancing
|
|
177
153
|
|
|
178
|
-
After a phase's exit gate is met, advance the state (this also syncs the marker
|
|
179
|
-
inside TASK.md):
|
|
154
|
+
After a phase's exit gate is met, advance the state (this also syncs the TASK.md marker):
|
|
180
155
|
|
|
181
156
|
```bash
|
|
182
157
|
python3 .add/tooling/add.py advance # next phase of the active task
|
|
@@ -186,17 +161,16 @@ python3 .add/tooling/add.py use <slug> # switch the active task (e.g. ac
|
|
|
186
161
|
|
|
187
162
|
## Depth by stage
|
|
188
163
|
|
|
189
|
-
The steps never change; their depth does
|
|
164
|
+
The steps never change; their depth does (read the stage from `add.py status`):
|
|
190
165
|
|
|
191
166
|
- **prototype** — run light; code is throwaway; design/experience is the point.
|
|
192
167
|
- **poc** — run contract/tests/build deeply on the single riskiest slice only.
|
|
193
168
|
- **mvp** — full flow, narrow scope, light observation.
|
|
194
|
-
- **production** — every step at full rigor + the observe loop. Reach it via the
|
|
195
|
-
orchestration
|
|
196
|
-
`stage production` flip — the transition is guarded behind a human-confirmed roadmap.
|
|
169
|
+
- **production** — every step at full rigor + the observe loop. Reach it via the `graduate.md`
|
|
170
|
+
orchestration when status shows `MVP covered → propose graduation`, never a bare `stage production` flip.
|
|
197
171
|
|
|
198
172
|
## The method rationale
|
|
199
173
|
|
|
200
|
-
The full method (the *why* behind every rule) is the AIDD book in `.add/docs/`.
|
|
201
|
-
|
|
202
|
-
|
|
174
|
+
The full method (the *why* behind every rule) is the AIDD book in `.add/docs/`. When a phase decision is
|
|
175
|
+
genuinely unclear, read the linked chapter — each phase guide points to its chapter. Do not duplicate
|
|
176
|
+
the book here; load it on demand.
|
package/skill/add/adopt.md
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
# Adopt — map an existing repo into the foundation (silent)
|
|
2
2
|
|
|
3
|
-
When ADD is pointed at a repo that already has code, onboarding is **silent**: the code
|
|
4
|
-
answers the questions a greenfield interview would ask, so you read it rather than ask.
|
|
5
|
-
This is the **brownfield path** of setup (the greenfield path keeps the 4-lens interview —
|
|
6
|
-
see `phases/0-setup.md`). You fill the living-documentation files from evidence, then stop at the one
|
|
7
|
-
human gate: the **baseline approval** (`add.py lock`).
|
|
3
|
+
When ADD is pointed at a repo that already has code, onboarding is **silent**: the code answers the questions a greenfield interview would ask, so you read it rather than ask. This is the **brownfield path** of setup. You fill the living-documentation files from evidence, then stop at the one human gate: the **baseline approval** (`add.py lock`).
|
|
8
4
|
|
|
9
5
|
## The signal — and arming the gate
|
|
10
6
|
|
|
@@ -14,54 +10,37 @@ Enter a brownfield repo with `--await-lock`:
|
|
|
14
10
|
python3 .add/tooling/add.py init --await-lock
|
|
15
11
|
```
|
|
16
12
|
|
|
17
|
-
`--await-lock`
|
|
18
|
-
— the engine then refuses a second task, crossing into build, and recording a gate until you
|
|
19
|
-
`lock`. And init, being brownfield-aware, prints a line that begins:
|
|
13
|
+
`--await-lock` seeds an **unlocked** setup, *arming the baseline-approval gate* — the engine refuses crossing into build until you `lock`. Init prints:
|
|
20
14
|
|
|
21
15
|
```
|
|
22
16
|
brownfield: existing code detected — the `add` skill maps it into your foundation …
|
|
23
17
|
```
|
|
24
18
|
|
|
25
|
-
That line is your cue
|
|
26
|
-
a plain `init` writes no setup and is grandfathered-locked, so its gate never arms *and* the
|
|
27
|
-
closing `lock` below would refuse with `already_locked`. The engine only *detects* the existing
|
|
28
|
-
code (a mechanical fact); it never reads or fills it — interpreting it is your job.
|
|
19
|
+
That line is your cue. **Always use `--await-lock` for brownfield**: a plain `init` is grandfathered-locked, so its gate never arms *and* the closing `lock` would refuse with `already_locked`.
|
|
29
20
|
|
|
30
21
|
## The silent mapping
|
|
31
22
|
|
|
32
|
-
Fill each living-doc file in `.add/` from what the code
|
|
23
|
+
Fill each living-doc file in `.add/` from what the code shows — **ask nothing**:
|
|
33
24
|
|
|
34
25
|
| Living doc | Read it from |
|
|
35
26
|
|----------|--------------|
|
|
36
|
-
| `PROJECT.md` (foundation) |
|
|
37
|
-
| `CONVENTIONS.md` |
|
|
38
|
-
| `GLOSSARY.md` |
|
|
39
|
-
| `MODEL_REGISTRY.md` | leave the active model record; note any AI-authored code you
|
|
40
|
-
| `dependencies.allowlist` |
|
|
41
|
-
|
|
42
|
-
Two rules that never bend:
|
|
27
|
+
| `PROJECT.md` (foundation) | domain nouns, entry points, README, first milestone the code implies |
|
|
28
|
+
| `CONVENTIONS.md` | languages, folder layout, naming, lint config, error style in the tree |
|
|
29
|
+
| `GLOSSARY.md` | recurring names in modules, models, and public APIs (one name per concept) |
|
|
30
|
+
| `MODEL_REGISTRY.md` | leave the active model record; note any AI-authored code you detect |
|
|
31
|
+
| `dependencies.allowlist` | manifests already in the repo (package.json, pyproject, go.mod, …) |
|
|
43
32
|
|
|
44
33
|
<constraints>
|
|
45
|
-
1. **Never clobber a living doc.** `init` already skips any living-doc file that exists; if a human
|
|
46
|
-
|
|
47
|
-
2. **Tag every drafted decision `evidence-grounded` vs `guessed`.** A line you read from the
|
|
48
|
-
code is *evidence-grounded* (cite the file). A line you inferred because the code was silent
|
|
49
|
-
is *guessed*. The human's single baseline approval is only honest if they can see which is which —
|
|
50
|
-
the guesses are what they actually need to check. (The tags feed `SETUP-REVIEW.md`.)
|
|
34
|
+
1. **Never clobber a living doc.** `init` already skips any living-doc file that exists; if a human already wrote `PROJECT.md`, READ it, do not overwrite it. Add, never replace.
|
|
35
|
+
2. **Tag every drafted decision `evidence-grounded` vs `guessed`.** A line you read from the code is *evidence-grounded* (cite the file). A line you inferred because the code was silent is *guessed*. The human's single baseline approval is only honest if they can see which is which — the guesses are what they actually need to check. (The tags feed `SETUP-REVIEW.md`.)
|
|
51
36
|
</constraints>
|
|
52
37
|
|
|
53
38
|
## Where it ends — the baseline approval
|
|
54
39
|
|
|
55
|
-
Brownfield onboarding draws no per-step approvals
|
|
56
|
-
first milestone's scope and the first task's candidate specification bundle exactly as greenfield does, and
|
|
57
|
-
present it all at **one** human gate. The human reviews the decisions (lowest-confidence / `guessed`
|
|
58
|
-
first) and confirms in conversation; you run the lock with their name:
|
|
40
|
+
Brownfield onboarding draws no per-step approvals: map the foundation, draft the first milestone's scope and first task's candidate specification bundle, then present it all at **one** human gate. The human reviews decisions (`guessed` first) and confirms; you run the lock:
|
|
59
41
|
|
|
60
42
|
```bash
|
|
61
43
|
python3 .add/tooling/add.py lock --by "<name>"
|
|
62
44
|
```
|
|
63
45
|
|
|
64
|
-
`lock` freezes the foundation + scope + first contract in one atomic write and opens the build.
|
|
65
|
-
Until it is run, the engine refuses a second task, crossing into build, and recording a gate —
|
|
66
|
-
so nothing is built on an unreviewed map. That gate is the only thing brownfield onboarding asks
|
|
67
|
-
of a human; everything before it, you did from the code.
|
|
46
|
+
`lock` freezes the foundation + scope + first contract in one atomic write and opens the build. Until it runs, the engine refuses crossing into build.
|
package/skill/add/advisor.md
CHANGED
|
@@ -10,16 +10,15 @@ engine never spawns; this is your judgment to make per step.
|
|
|
10
10
|
|
|
11
11
|
Spawn a subagent when the piece is **separable and worth the round-trip**:
|
|
12
12
|
|
|
13
|
-
- **Broad / expensive sweep** — gather a wide map cheaply, return a compact result
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
earned-green refute-read), so the check is not graded by the author.
|
|
13
|
+
- **Broad / expensive sweep** — gather a wide map cheaply, return a compact result.
|
|
14
|
+
- **Independent adversarial review** — a fresh context argues *against* your result (the
|
|
15
|
+
`6-verify` earned-green refute-read), so the check is not graded by the author.
|
|
17
16
|
- **A well-scoped delegable batch** — a self-contained slice with a clear contract and return shape.
|
|
18
17
|
- **Context offload** — work that would bloat your context but compresses to a small verdict.
|
|
19
18
|
|
|
20
19
|
Do **not** spawn when the work is narrow and cheap enough to do in-context: a small sweep, a
|
|
21
|
-
two-file read, a quick edit. A spawn costs a round-trip
|
|
22
|
-
|
|
20
|
+
two-file read, a quick edit. A spawn costs a round-trip — pay it only when the piece is big or
|
|
21
|
+
independent enough to earn it. When in doubt, do it in-context.
|
|
23
22
|
|
|
24
23
|
## The plan-following prompt template
|
|
25
24
|
|
|
@@ -54,10 +53,10 @@ Do NOT run add.py or write any shared state — you propose, the orchestrator re
|
|
|
54
53
|
|
|
55
54
|
## Choosing the model — vendor-neutral tiers
|
|
56
55
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
Pick the tier from `streams.md`'s vocabulary: **mid** for an ordinary, well-scoped piece; **top**
|
|
57
|
+
for a complex, ambiguous, or cross-cutting one. The tier→model-id mapping and the spawn adapter
|
|
58
|
+
live there — one home, not repeated here. A stronger model never buys back a human gate: high-risk
|
|
59
|
+
scope still escalates.
|
|
61
60
|
|
|
62
61
|
## The hard rule — you delegate, you do not abdicate
|
|
63
62
|
|
|
@@ -1,53 +1,40 @@
|
|
|
1
1
|
# Foundation compaction — collapse the stable tail
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
compaction later COLLAPSES the stable tail of each foundation spec into a rolled-up settled line — so
|
|
5
|
-
PROJECT.md, CONVENTIONS.md, GLOSSARY.md, and MODEL_REGISTRY.md keep to one screen as the project grows.
|
|
3
|
+
`fold.md` PREPENDS new learnings (newest-first); foundation compaction COLLAPSES the stable tail of each foundation spec into a rolled-up settled line — keeping PROJECT.md, CONVENTIONS.md, GLOSSARY.md, and MODEL_REGISTRY.md to one screen as the project grows.
|
|
6
4
|
|
|
7
|
-
You
|
|
8
|
-
**convention**, not a command — there is no `add.py compact-foundation` (the engine stays judgment-free).
|
|
9
|
-
It is DISTINCT from the engine `add.py compact <slug>` (the archive recovery-bundle move).
|
|
5
|
+
You **gather and propose**; the **human confirms**; you then write the settled line. This is a **convention**, not a command — there is no `add.py compact-foundation`. It is DISTINCT from engine `add.py compact <slug>` (the archive recovery-bundle move).
|
|
10
6
|
|
|
11
7
|
## When
|
|
12
8
|
|
|
13
|
-
At **milestone close** (after `fold.md`) or **on demand** when a spec has grown past one screen.
|
|
14
|
-
Compaction is a SEPARATE step from `fold.md` — never merged into the retrospective consolidation.
|
|
9
|
+
At **milestone close** (after `fold.md`) or **on demand** when a spec has grown past one screen. Always a SEPARATE step from `fold.md`.
|
|
15
10
|
|
|
16
|
-
## Eligibility
|
|
11
|
+
## Eligibility
|
|
17
12
|
|
|
18
|
-
An entry is compaction-eligible **IFF** its milestone is **shipped** (done/archived) **AND** it carries
|
|
19
|
-
**zero open residues**/deltas. An unshipped or open-residue entry is NOT eligible — leave it live
|
|
20
|
-
(`open-residue-version`).
|
|
13
|
+
An entry is compaction-eligible **IFF** its milestone is **shipped** (done/archived) **AND** it carries **zero open residues**/deltas. Unshipped or open-residue entries are NOT eligible (`open-residue-version`).
|
|
21
14
|
|
|
22
15
|
## The ritual
|
|
23
16
|
|
|
24
|
-
1. **Gather** — collect the stable, shipped, zero-residue tail of the target spec
|
|
25
|
-
2. **Propose** — draft the per-spec rolled-up settled line
|
|
26
|
-
3. **Confirm** —
|
|
27
|
-
4. **Write** — replace the collapsed tail with ONE settled line at the BOTTOM (newest-first: live records
|
|
28
|
-
stay on top, the settled line anchors at the tail), carrying a git/archive pointer.
|
|
17
|
+
1. **Gather** — collect the stable, shipped, zero-residue tail of the target spec.
|
|
18
|
+
2. **Propose** — draft the per-spec rolled-up settled line and show the human.
|
|
19
|
+
3. **Confirm** — no write happens without confirmation.
|
|
20
|
+
4. **Write** — replace the collapsed tail with ONE settled line at the BOTTOM (newest-first: live records stay on top, settled line anchors at the tail), carrying a git/archive pointer.
|
|
29
21
|
|
|
30
|
-
## Per-spec rolled-line shapes
|
|
22
|
+
## Per-spec rolled-line shapes
|
|
31
23
|
|
|
32
|
-
- **PROJECT.md §Spec** —
|
|
33
|
-
- **PROJECT.md §Key-Decisions** —
|
|
34
|
-
- **CONVENTIONS.md** —
|
|
35
|
-
- **GLOSSARY.md** —
|
|
36
|
-
- **MODEL_REGISTRY.md** — superseded model rows → `Prior models: <list> (see git)`.
|
|
24
|
+
- **PROJECT.md §Spec** — `[folded fv N..M]` bullets → `settled fvN–fvM — <theme> (see git)`.
|
|
25
|
+
- **PROJECT.md §Key-Decisions** — shipped rows → `| settled <dateA>–<dateB> | <N> decisions rolled | … | see git |` at the tail.
|
|
26
|
+
- **CONVENTIONS.md** — `(TAG)` learnings → `- settled conventions <range> — <N> rules (see git)`.
|
|
27
|
+
- **GLOSSARY.md** — verbose stable definition → terse canonical line + `(rationale: see git)`.
|
|
28
|
+
- **MODEL_REGISTRY.md** — superseded model rows → `Prior models: <list> (see git)`.
|
|
37
29
|
|
|
38
|
-
## Preservation
|
|
30
|
+
## Preservation
|
|
39
31
|
|
|
40
32
|
- **Never delete** — summarize and point; a settled line is lossy on prose, lossless on traceability.
|
|
41
|
-
- A
|
|
42
|
-
-
|
|
33
|
+
- A git/archive pointer is mandatory (`trail-loss` if dropped).
|
|
34
|
+
- OPEN residues stay live.
|
|
43
35
|
|
|
44
|
-
## Reject codes
|
|
36
|
+
## Reject codes
|
|
45
37
|
|
|
46
|
-
- `open-residue-version` —
|
|
47
|
-
- `trail-loss` — the collapse would drop the git/archive pointer or
|
|
38
|
+
- `open-residue-version` — entry is unshipped or has ≥1 open delta/residue; leave it live.
|
|
39
|
+
- `trail-loss` — the collapse would drop the git/archive pointer or audit summary.
|
|
48
40
|
- `wrong-order` — a record is not newest-first, or the settled line is not at the tail.
|
|
49
|
-
|
|
50
|
-
## Distinct from `add.py compact`
|
|
51
|
-
|
|
52
|
-
Foundation compaction ≠ engine `add.py compact <slug>`. It mirrors `fold.md`'s "AI proposes, human
|
|
53
|
-
confirms" voice and stays convention-guided — no engine command, no `add.py check` enforcement.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Components — monorepo and multi-repo slices
|
|
2
|
+
|
|
3
|
+
Opt-in pillar for a milestone that spans **more than one green bar** — a backend
|
|
4
|
+
and its frontend, a shared lib and two apps, services across repos. A project
|
|
5
|
+
that declares no components is byte-identical to a single-codebase project. Reach
|
|
6
|
+
for this only when one milestone genuinely crosses components. Full narrative:
|
|
7
|
+
book chapter `17-components.md`.
|
|
8
|
+
|
|
9
|
+
## Declare (never inferred)
|
|
10
|
+
|
|
11
|
+
`.add/components.toml`:
|
|
12
|
+
|
|
13
|
+
```toml
|
|
14
|
+
[component.gateway]
|
|
15
|
+
root = "apps/gateway"
|
|
16
|
+
green-bar = "pytest + pyright"
|
|
17
|
+
[component.dashboard]
|
|
18
|
+
root = "apps/web"
|
|
19
|
+
green-bar = "vitest + a11y"
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
A task binds with a `component: <name>` header line → that root joins its §5
|
|
23
|
+
Scope, and verify holds it to that component's green-bar.
|
|
24
|
+
|
|
25
|
+
## The loop
|
|
26
|
+
|
|
27
|
+
1. **Per-component verify.** A bound task must CITE its component's green-bar in
|
|
28
|
+
the §6 Build-expectations evidence, or the gate refuses
|
|
29
|
+
`component_green_bar_uncited`. The engine never runs the suite — you run the
|
|
30
|
+
right one; the gate checks the right bar was cited.
|
|
31
|
+
2. **Freeze a cross-component contract.** Declare `[contract.<id>]`
|
|
32
|
+
(producer + consumers). A task names its role `produces: <id>` / `consumes: <id>`.
|
|
33
|
+
The producer's freeze (contract→tests) writes the immutable snapshot
|
|
34
|
+
`.add/contracts/<id>.json`; the consumer pins its hash. A changed re-freeze
|
|
35
|
+
flags consumers `contract_consumer_stale`; a missing/malformed snapshot
|
|
36
|
+
HARD-STOPS — never build against an unfrozen shape.
|
|
37
|
+
3. **One milestone, full slice.** A `consumes:` task is HELD from advancing
|
|
38
|
+
scenarios→contract (`producer_contract_unfrozen`) until the producer's
|
|
39
|
+
snapshot exists. The FE stays downstream of the frozen BE endpoint, in one
|
|
40
|
+
milestone.
|
|
41
|
+
4. **Across repos — federate.** A consumer repo declares `[federation.<id>]`
|
|
42
|
+
(`source` + optional `pin`); `add.py federate pull <id>` validates and lands a
|
|
43
|
+
byte-for-byte copy of the producer repo's published snapshot locally, where it
|
|
44
|
+
behaves as in a monorepo. Fail-loud: unknown id / unreadable source / invalid
|
|
45
|
+
snapshot / version mismatch each HARD-STOPS and lands nothing.
|
|
46
|
+
|
|
47
|
+
## Hold the line
|
|
48
|
+
|
|
49
|
+
- **Declared, not inferred** — no scanning `apps/*`.
|
|
50
|
+
- **No central server / no shared mutable state** — federation copies an
|
|
51
|
+
immutable snapshot; each repo keeps its own git-native `state.json`.
|
|
52
|
+
- **No new approval** — these are engine-enforced gates on the existing six-step
|
|
53
|
+
flow, not extra human checkpoints. Ownership/autonomy per component is the
|
|
54
|
+
identity story (`streams.md`, governance), layered on this graph.
|
package/skill/add/confidence.md
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
# Confidence — the self-score that aims attention
|
|
2
2
|
|
|
3
|
-
The **confidence self-score** is an *advisory* check an agent runs on its own drafted artifact
|
|
4
|
-
— a spec, a contract, a build, or a verdict returned by a spawned subagent — *before* it
|
|
5
|
-
presents it. It sharpens the draft and aims the reader's eye at the soft spots; it is never a
|
|
6
|
-
gate. Score it privately, refine while it is cheap, then surface what stayed uncertain.
|
|
3
|
+
The **confidence self-score** is an *advisory* check an agent runs on its own drafted artifact — a spec, a contract, a build, or a subagent verdict — *before* presenting it. It sharpens the draft and aims the reader's eye at the soft spots; it is never a gate.
|
|
7
4
|
|
|
8
5
|
## The six dimensions
|
|
9
6
|
|
|
10
|
-
Score each
|
|
7
|
+
Score each 0–1 honestly on the artifact you are about to hand over:
|
|
11
8
|
|
|
12
9
|
- **Completeness** — did it cover every rule, scenario, and rejection the task asked for?
|
|
13
10
|
- **Clarity** — would the next reader understand it without you in the room?
|
|
@@ -16,33 +13,20 @@ Score each from 0 to 1 (0–1), honestly, on the artifact you are about to hand
|
|
|
16
13
|
- **Edge cases** — did it name the failure modes, the concurrency, the empty/oversized inputs?
|
|
17
14
|
- **Self-evaluation** — does it carry its own refine step — a way to catch its own mistakes?
|
|
18
15
|
|
|
19
|
-
If **any** dimension scores **< 0.9**, refine the artifact before
|
|
20
|
-
return from a spawned subagent), then re-score. The point is to spend the cheap iteration now,
|
|
21
|
-
not after a human has read past the weak spot.
|
|
16
|
+
If **any** dimension scores **< 0.9**, refine the artifact before presenting, then re-score.
|
|
22
17
|
|
|
23
18
|
## Where it plugs in
|
|
24
19
|
|
|
25
|
-
- It **feeds the lowest-confidence flag** (run.md ·
|
|
26
|
-
|
|
27
|
-
private computation; the lowest-confidence flag is the public surfacing of its weakest point —
|
|
28
|
-
this rubric only *aims* that flag, it does not redefine it.
|
|
29
|
-
- A persistently low score on a risky scope is a signal to **recommend lowering the autonomy
|
|
30
|
-
level** (auto → conservative / manual; run.md). Recommend it — never force it; choosing the
|
|
31
|
-
autonomy level stays the human's call.
|
|
20
|
+
- It **feeds the lowest-confidence flag** (run.md · 1-specify.md): the lowest-scoring dimension is what you surface ⚠-first at the contract freeze.
|
|
21
|
+
- A persistently low score on a risky scope is a signal to **recommend** lowering the autonomy level (auto → conservative / manual; run.md). Recommend it — the autonomy level stays the human's call.
|
|
32
22
|
|
|
33
23
|
## The hard rule — advisory, never a gate
|
|
34
24
|
|
|
35
25
|
<constraints>
|
|
36
|
-
The confidence self-score is advisory only —
|
|
37
|
-
- auto-
|
|
38
|
-
the non-functional review), not on a number the agent assigned itself;
|
|
26
|
+
The confidence self-score is advisory only — never a gate. It never:
|
|
27
|
+
- auto-pass a verify or block a run — the verify outcome rests on evidence (passing tests, the non-functional review), not a self-assigned number;
|
|
39
28
|
- substitutes for evidence or for the human decision point;
|
|
40
|
-
- is recorded as a score the human "agreed to" — a self-asserted score that gated would only
|
|
41
|
-
move an unread approval one level up (run.md).
|
|
29
|
+
- is recorded as a score the human "agreed to" — a self-asserted score that gated would only move an unread approval one level up (run.md).
|
|
42
30
|
|
|
43
|
-
What it MAY do: aim the lowest-confidence flag, trigger a refine pass, and recommend
|
|
44
|
-
the autonomy level. The gate itself stays evidence-based and human-owned.
|
|
31
|
+
What it MAY do: aim the lowest-confidence flag, trigger a refine pass, and recommend an autonomy adjustment. The gate itself stays evidence-based and human-owned.
|
|
45
32
|
</constraints>
|
|
46
|
-
|
|
47
|
-
> Used per step: each phase guide's Confidence hook points here, so an agent self-scores in the
|
|
48
|
-
> idiom of the phase it is in (see the per-step hooks).
|