@pilotspace/add 1.2.0 → 1.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/CHANGELOG.md +122 -0
- package/GETTING-STARTED.md +26 -0
- package/README.md +16 -3
- package/bin/cli.js +85 -8
- package/docs/02-the-flow.md +4 -1
- package/docs/03-step-1-specify.md +2 -0
- package/docs/06-step-4-tests.md +8 -0
- package/docs/07-step-5-build.md +2 -0
- package/docs/08-step-6-verify.md +11 -0
- package/docs/09-the-loop.md +3 -1
- package/docs/10-setup-and-stages.md +1 -1
- package/docs/11-governance.md +4 -0
- package/docs/appendix-c-glossary.md +16 -1
- package/docs/appendix-e-checklists.md +14 -2
- package/package.json +1 -1
- package/skill/add/SKILL.md +18 -5
- package/skill/add/advisor.md +75 -0
- package/skill/add/compact-foundation.md +53 -0
- package/skill/add/confidence.md +48 -0
- package/skill/add/fold.md +4 -4
- package/skill/add/phases/0-ground.md +68 -0
- package/skill/add/phases/0-setup.md +52 -3
- package/skill/add/phases/1-specify.md +7 -0
- package/skill/add/phases/2-scenarios.md +2 -0
- package/skill/add/phases/3-contract.md +5 -1
- package/skill/add/phases/4-tests.md +2 -0
- package/skill/add/phases/5-build.md +24 -0
- package/skill/add/phases/6-verify.md +18 -0
- package/skill/add/phases/7-observe.md +7 -0
- package/skill/add/run.md +48 -5
- package/skill/add/soul.md +77 -0
- package/skill/add/streams.md +65 -9
- package/tooling/add.py +1715 -64
- package/tooling/templates/DESIGN.md.tmpl +66 -0
- package/tooling/templates/GLOSSARY.md.tmpl +11 -1
- package/tooling/templates/PROJECT.md.tmpl +3 -1
- package/tooling/templates/SOUL.md.tmpl +40 -0
- package/tooling/templates/TASK.md.tmpl +23 -4
- package/tooling/templates/catalog.sample.json +38 -0
- package/tooling/templates/prototype.sample.json +48 -0
- package/tooling/templates/tokens.sample.json +55 -0
- package/tooling/templates/udd-catalog.md +122 -0
- package/tooling/templates/udd-tokens.md +79 -0
package/skill/add/SKILL.md
CHANGED
|
@@ -20,7 +20,7 @@ You are the orchestrator. ADD keeps the AI fast *and* safe by fixing direction
|
|
|
20
20
|
the result through passing evidence rather than a plausible-looking diff.
|
|
21
21
|
|
|
22
22
|
**One file = one task.** Each feature lives in a single `.add/tasks/<slug>/TASK.md`
|
|
23
|
-
with seven sections. You fill them top to bottom; the Python tool tracks where
|
|
23
|
+
with a §0 ground preamble and seven step sections. You fill them top to bottom; the Python tool tracks where
|
|
24
24
|
you are so context never rots across sessions.
|
|
25
25
|
|
|
26
26
|
## Always start here (orient — do not skip)
|
|
@@ -31,6 +31,11 @@ Run the tool to find the resume point instead of re-reading the repo:
|
|
|
31
31
|
python3 .add/tooling/add.py status
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
+
`status` points at two things to read when orienting: `.add/PROJECT.md` (the foundation) and
|
|
35
|
+
`.add/SOUL.md` (your **voice** — tone, communication style, what keeps the human's trust). Read
|
|
36
|
+
`.add/SOUL.md` each session and let it shape how you speak; it is human-owned and self-improving
|
|
37
|
+
(the `soul-self-improve` path proposes voice deltas the human confirms).
|
|
38
|
+
|
|
34
39
|
- **No `.add/state.json` yet** (a fresh install drops tooling + docs but does *not* init — so `status` says
|
|
35
40
|
`no .add/ project found`) → enter **autonomous setup**: YOU run init yourself —
|
|
36
41
|
`add.py init --name "<inferred>" --stage <picked> --await-lock` (don't tell the human to) — then read
|
|
@@ -61,6 +66,7 @@ Load the phase guide **only for the phase you are in** (progressive disclosure):
|
|
|
61
66
|
| Phase | Guide | Produces (TASK.md section) | Who leads |
|
|
62
67
|
|-------|-------|----------------------------|-----------|
|
|
63
68
|
| setup | `phases/0-setup.md` | `.add/` + living docs + first §1–§3 + `SETUP-REVIEW.md` | AI drafts → **human locks** (the baseline approval) |
|
|
69
|
+
| ground | `phases/0-ground.md` | §0 GROUND map (real files · symbols · the anchors §3 cites) | **AI** (the §0 preamble — no new gate) |
|
|
64
70
|
| specify | `phases/1-specify.md` | §1 rules + ranked lowest-confidence flag | AI drafts (co-specify)† |
|
|
65
71
|
| scenarios | `phases/2-scenarios.md` | §2 Given/When/Then | AI drafts† |
|
|
66
72
|
| contract | `phases/3-contract.md` | §3 frozen shape | AI drafts → **human approves once** (the decision point)† |
|
|
@@ -73,7 +79,7 @@ Load the phase guide **only for the phase you are in** (progressive disclosure):
|
|
|
73
79
|
contract freeze** (the decision point), presented lowest-confidence-first. See `run.md`.
|
|
74
80
|
‡ **Verify auto-gate (v6–v7).** Under `autonomy: auto` (the default) a run may auto-PASS on
|
|
75
81
|
complete evidence — recorded as *auto-resolved*, an explicit PASS, not a skip. **Security always
|
|
76
|
-
escalates** (HARD-STOP); so do concurrency / architecture residue and `conservative`
|
|
82
|
+
escalates** (HARD-STOP); so do concurrency / architecture residue and a lowered autonomy level (`conservative` / `manual`).
|
|
77
83
|
See `run.md`.
|
|
78
84
|
|
|
79
85
|
Whenever you present a decision point to the human in chat (intake · bundle approval · gate ·
|
|
@@ -85,13 +91,20 @@ In **observe**, also emit **lessons learned** — learnings tagged by which of t
|
|
|
85
91
|
(`DDD · SDD · UDD · TDD · ADD`) they improve — so the foundation self-improves across loops.
|
|
86
92
|
You write them as `open`; the human consolidates them into `PROJECT.md`. Read `deltas.md` for the
|
|
87
93
|
grammar and the status lifecycle. At milestone close (or on demand), run the retrospective consolidation that
|
|
88
|
-
gathers confirmed deltas into a versioned foundation — read `fold.md`.
|
|
94
|
+
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`).
|
|
95
|
+
|
|
96
|
+
Observe also tunes your **voice**: propose a confirmable **voice delta** from the human's wordings +
|
|
97
|
+
flow that, once they confirm, rewrites `SOUL.md` (the human is the only writer) — read `soul.md`.
|
|
89
98
|
|
|
90
99
|
## Beyond the bundle — load on demand
|
|
91
100
|
|
|
92
101
|
Once **§3 CONTRACT is FROZEN**, the build→verify half is a dynamic, auto-gated run
|
|
93
|
-
(`autonomy: auto` default, lowered to `conservative` for a human gate) — read `run.md`. To
|
|
94
|
-
pipeline several ready tasks behind their own frozen contracts, read `streams.md`.
|
|
102
|
+
(`autonomy: auto` default, lowered to `conservative` or `manual` for a human gate) — read `run.md`. To
|
|
103
|
+
pipeline several ready tasks behind their own frozen contracts, read `streams.md`. To delegate
|
|
104
|
+
one piece of your plan to a subagent that follows it — when to spawn, the plan-following prompt
|
|
105
|
+
template, the tier pick — read `advisor.md`; and at any decision point self-score your draft
|
|
106
|
+
(0–1 across six dimensions, refine if any < 0.9) with `confidence.md`. Both are advisory: the
|
|
107
|
+
engine never spawns, and the self-score is never a gate.
|
|
95
108
|
|
|
96
109
|
When a milestone's tasks are all done but its **goal** (the `MILESTONE.md` exit criteria) is not
|
|
97
110
|
yet met, `milestone-done` holds the milestone open — read `loop.md` for the dynamic loop that turns
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Advisor — spawning one subagent to follow your plan
|
|
2
|
+
|
|
3
|
+
The **advisor** strategy is for the orchestrating agent: spawn a *single* subagent to execute
|
|
4
|
+
one piece of your plan, then merge its verdict back in. It is the single-subagent companion to
|
|
5
|
+
`streams.md` — streams pipelines *many* independent tasks in parallel worktrees; the advisor
|
|
6
|
+
delegates *one* well-scoped piece (a sweep, a review, a batch) while you stay in the loop. The
|
|
7
|
+
engine never spawns; this is your judgment to make per step.
|
|
8
|
+
|
|
9
|
+
## When to spawn — and when not
|
|
10
|
+
|
|
11
|
+
Spawn a subagent when the piece is **separable and worth the round-trip**:
|
|
12
|
+
|
|
13
|
+
- **Broad / expensive sweep** — gather a wide map cheaply, return a compact result (the `0-ground`
|
|
14
|
+
broad sweep is the canonical case).
|
|
15
|
+
- **Independent adversarial review** — a fresh context argues *against* your result (the `6-verify`
|
|
16
|
+
earned-green refute-read), so the check is not graded by the author.
|
|
17
|
+
- **A well-scoped delegable batch** — a self-contained slice with a clear contract and return shape.
|
|
18
|
+
- **Context offload** — work that would bloat your context but compresses to a small verdict.
|
|
19
|
+
|
|
20
|
+
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 and a fresh context — pay it only when
|
|
22
|
+
the piece is big or independent enough to earn it. When in doubt, do it in-context.
|
|
23
|
+
|
|
24
|
+
## The plan-following prompt template
|
|
25
|
+
|
|
26
|
+
Give the subagent the *piece of your plan it owns* and a fixed return shape. This reuses
|
|
27
|
+
`streams.md`'s worker-contract tags for a single advisory subagent — the contract is identical
|
|
28
|
+
on any runner; only the spawn adapter (see `streams.md`) changes.
|
|
29
|
+
|
|
30
|
+
```xml
|
|
31
|
+
<objective>
|
|
32
|
+
Execute THIS piece of the orchestrator's plan: {{PIECE}}. You own only this piece — not the
|
|
33
|
+
surrounding decisions. Return a verdict; do not record state.
|
|
34
|
+
</objective>
|
|
35
|
+
|
|
36
|
+
<persona>
|
|
37
|
+
You are a {{DOMAIN}} engineer. Correctness over speed; a wrong-but-plausible result is expensive.
|
|
38
|
+
Work step by step, following the plan:
|
|
39
|
+
1. Load the context files; confirm you understand the piece you own.
|
|
40
|
+
2. Do the work in small steps, honoring the orchestrator's plan and constraints.
|
|
41
|
+
3. Self-score your result with confidence.md; if any dimension < 0.9, refine before returning.
|
|
42
|
+
</persona>
|
|
43
|
+
|
|
44
|
+
<context_files>
|
|
45
|
+
the plan / task files the piece needs (read-only unless the piece says otherwise)
|
|
46
|
+
</context_files>
|
|
47
|
+
|
|
48
|
+
<return>
|
|
49
|
+
End with a structured verdict the orchestrator parses and RECORDS:
|
|
50
|
+
{ piece, result, evidence, confidence: {per-dimension 0–1}, open_questions }.
|
|
51
|
+
Do NOT run add.py or write any shared state — you propose, the orchestrator records.
|
|
52
|
+
</return>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Choosing the model — vendor-neutral tiers
|
|
56
|
+
|
|
57
|
+
Reuse `streams.md`'s tiers, never a new vocabulary: **mid** (Claude Code: `sonnet`) for ordinary,
|
|
58
|
+
well-scoped pieces with a clear contract; **top** (Claude Code: `opus`) for complex, ambiguous, or
|
|
59
|
+
cross-cutting pieces. The tier maps to the runner's model id through the same adapter `streams.md`
|
|
60
|
+
defines. A stronger model never buys back a human gate: high-risk scope still escalates.
|
|
61
|
+
|
|
62
|
+
## The hard rule — you delegate, you do not abdicate
|
|
63
|
+
|
|
64
|
+
<constraints>
|
|
65
|
+
The engine never spawns — spawning is the orchestrating agent's choice (tool-agnostic). And:
|
|
66
|
+
- the subagent PROPOSES; the orchestrator RECORDS — a worker never runs add.py or writes shared
|
|
67
|
+
state (state.json, MILESTONE.md, a sibling's files): you read its verdict and record the outcome;
|
|
68
|
+
- delegation never lowers a gate — a SECURITY finding still HARD-STOPs, and high-risk scope still
|
|
69
|
+
escalates to the human, whoever (or whatever tier) did the work;
|
|
70
|
+
- the spawned subagent returns its confidence.md self-score; a low score is a signal to refine or
|
|
71
|
+
re-spawn, never a pass.
|
|
72
|
+
</constraints>
|
|
73
|
+
|
|
74
|
+
> Used per step: each phase guide's Advisor hook points here, so an agent spawns in the idiom of
|
|
75
|
+
> the phase it is in (see the per-step hooks).
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Foundation compaction — collapse the stable tail
|
|
2
|
+
|
|
3
|
+
This is the **retrospective shrink**. `fold.md` PREPENDS new learnings (newest-first); foundation
|
|
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.
|
|
6
|
+
|
|
7
|
+
You (the AI) **gather and propose**; the **human confirms**; you then write the settled line. This is a
|
|
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).
|
|
10
|
+
|
|
11
|
+
## When
|
|
12
|
+
|
|
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.
|
|
15
|
+
|
|
16
|
+
## Eligibility (one shared test)
|
|
17
|
+
|
|
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`).
|
|
21
|
+
|
|
22
|
+
## The ritual
|
|
23
|
+
|
|
24
|
+
1. **Gather** — collect the stable, shipped, zero-residue tail of the target spec (its oldest entries).
|
|
25
|
+
2. **Propose** — draft the per-spec rolled-up settled line (see the shapes below) and show the human.
|
|
26
|
+
3. **Confirm** — the human accepts or declines. No write happens without confirmation.
|
|
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.
|
|
29
|
+
|
|
30
|
+
## Per-spec rolled-line shapes (from the frozen compaction-contract)
|
|
31
|
+
|
|
32
|
+
- **PROJECT.md §Spec** — a run of stable `[folded fv N..M]` bullets → `settled fvN–fvM — <theme> (see git)`.
|
|
33
|
+
- **PROJECT.md §Key-Decisions** — matching shipped rows → one `| settled <dateA>–<dateB> | <N> decisions rolled | … | see git |` row at the tail.
|
|
34
|
+
- **CONVENTIONS.md** — a run of stable `(TAG)` learnings → `- settled conventions <range> — <N> rules (see git)`.
|
|
35
|
+
- **GLOSSARY.md** — a verbose, stable definition → its terse canonical line + `(rationale: see git)`. *(forward-looking — small today.)*
|
|
36
|
+
- **MODEL_REGISTRY.md** — superseded model rows → `Prior models: <list> (see git)`. *(forward-looking — nothing to compact yet.)*
|
|
37
|
+
|
|
38
|
+
## Preservation (every collapse)
|
|
39
|
+
|
|
40
|
+
- **Never delete** — summarize and point; a settled line is lossy on prose, lossless on traceability.
|
|
41
|
+
- A surviving **git**/archive pointer is mandatory (`trail-loss` if dropped).
|
|
42
|
+
- **OPEN residues stay** live; the audit trail is summarized-not-deleted.
|
|
43
|
+
|
|
44
|
+
## Reject codes (judgment-checked — the AI proposes, the human confirms)
|
|
45
|
+
|
|
46
|
+
- `open-residue-version` — the entry is unshipped or has ≥1 open delta/residue; leave it live.
|
|
47
|
+
- `trail-loss` — the collapse would drop the git/archive pointer or the audit summary.
|
|
48
|
+
- `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,48 @@
|
|
|
1
|
+
# Confidence — the self-score that aims attention
|
|
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.
|
|
7
|
+
|
|
8
|
+
## The six dimensions
|
|
9
|
+
|
|
10
|
+
Score each from 0 to 1 (0–1), honestly, on the artifact you are about to hand over:
|
|
11
|
+
|
|
12
|
+
- **Completeness** — did it cover every rule, scenario, and rejection the task asked for?
|
|
13
|
+
- **Clarity** — would the next reader understand it without you in the room?
|
|
14
|
+
- **Practicality** — is it feasible and implementable as written, against the real code?
|
|
15
|
+
- **Optimization** — does it balance correctness, simplicity, and cost — no gold-plating, no corner cut?
|
|
16
|
+
- **Edge cases** — did it name the failure modes, the concurrency, the empty/oversized inputs?
|
|
17
|
+
- **Self-evaluation** — does it carry its own refine step — a way to catch its own mistakes?
|
|
18
|
+
|
|
19
|
+
If **any** dimension scores **< 0.9**, refine the artifact before you present it (or before you
|
|
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.
|
|
22
|
+
|
|
23
|
+
## Where it plugs in
|
|
24
|
+
|
|
25
|
+
- It **feeds the lowest-confidence flag** (run.md · phases/1-specify.md): the lowest-scoring
|
|
26
|
+
dimension or point is what you surface ⚠-first at the contract freeze. The self-score is the
|
|
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.
|
|
32
|
+
|
|
33
|
+
## The hard rule — advisory, never a gate
|
|
34
|
+
|
|
35
|
+
<constraints>
|
|
36
|
+
The confidence self-score is advisory only — it is never a gate. It never:
|
|
37
|
+
- auto-PASSes a verify or blocks a run — the verify outcome rests on evidence (passing tests,
|
|
38
|
+
the non-functional review), not on a number the agent assigned itself;
|
|
39
|
+
- 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).
|
|
42
|
+
|
|
43
|
+
What it MAY do: aim the lowest-confidence flag, trigger a refine pass, and recommend lowering
|
|
44
|
+
the autonomy level. The gate itself stays evidence-based and human-owned.
|
|
45
|
+
</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).
|
package/skill/add/fold.md
CHANGED
|
@@ -19,7 +19,7 @@ lives here so the engine stays judgment-free.
|
|
|
19
19
|
2. **Group** — bucket them by competency (`DDD · SDD · UDD · TDD · ADD`).
|
|
20
20
|
3. **Propose** — for each, draft the exact foundation edit (see routing) and show the human.
|
|
21
21
|
4. **Confirm** — the human accepts or declines each delta. No write happens without this.
|
|
22
|
-
5. **Write** —
|
|
22
|
+
5. **Write** — prepend the accepted edits at the top (newest-first), flip each delta's status, and bump the version.
|
|
23
23
|
|
|
24
24
|
## Consolidation routing (every competency has a home)
|
|
25
25
|
|
|
@@ -31,15 +31,15 @@ lives here so the engine stays judgment-free.
|
|
|
31
31
|
| `TDD` | `CONVENTIONS.md` | append a testing convention (no PROJECT.md section — it is the engine) |
|
|
32
32
|
| `ADD` | `CONVENTIONS.md` | append a build/harness convention (likewise the engine) |
|
|
33
33
|
|
|
34
|
-
**Every** consolidation — whatever the competency — ALSO
|
|
34
|
+
**Every** consolidation — whatever the competency — ALSO prepends one row at the TOP of `PROJECT.md` **§Key Decisions** (newest-first)
|
|
35
35
|
(date · decision · why · outcome): the universal, auditable trail of what the foundation learned.
|
|
36
36
|
|
|
37
37
|
## Status transitions & version
|
|
38
38
|
|
|
39
|
-
- on **confirm**: the delta moves `open` → `folded` (and its edit is
|
|
39
|
+
- on **confirm**: the delta moves `open` → `folded` (and its edit is prepended at the top of the routed target, newest-first).
|
|
40
40
|
- on **decline**: the delta moves `open` → `rejected` and is **left in place** — never deleted —
|
|
41
41
|
so "we considered this and chose not to act" stays auditable.
|
|
42
|
-
- a consolidation is **append-only**: it
|
|
42
|
+
- a consolidation is **append-only (newest-first)**: it PREPENDS new bullets/rows at the top and never silently rewrites existing foundation text — EXCEPT via the recorded **compaction door** (`compact-foundation.md`): eligible (shipped + zero open residues) stable entries collapse upward into a rolled-up settled line at the tail. Reject: `open-residue-version` · `trail-loss` · `wrong-order`.
|
|
43
43
|
- each consolidation session **bumps** the `foundation-version:` marker in `PROJECT.md` by one (monotonic int).
|
|
44
44
|
|
|
45
45
|
## Reject codes (the AI is first check, the human the backstop)
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Phase 0 — Ground (the real codebase)
|
|
2
|
+
|
|
3
|
+
Goal: before you specify anything, gather the REAL current working folder the task will
|
|
4
|
+
touch — the actual files, symbols, signatures, docs, todos, config, data, patterns, and conventions — so the
|
|
5
|
+
contract, tests, and build are grounded in what exists, not in what you assume.
|
|
6
|
+
Fill **§0 GROUND** in TASK.md. Ground is a per-task preamble to the seven steps;
|
|
7
|
+
it is **AI-owned** — no human gate here (the one approval stays at the §3 freeze).
|
|
8
|
+
|
|
9
|
+
If you cannot name the files and symbols the task touches, you do not yet understand
|
|
10
|
+
the work — gathering them IS the job, not a detour.
|
|
11
|
+
|
|
12
|
+
## Gather (in TASK.md §0)
|
|
13
|
+
|
|
14
|
+
- **Touches** — the real files · symbols · signatures the task will read or change,
|
|
15
|
+
named from the actual code (use your code-navigation tools — grep / symbol search,
|
|
16
|
+
never memory). Each as `path:symbol — what it is / how it is keyed`.
|
|
17
|
+
- **Context (working folder)** — beyond code, the NON-code artifacts the task touches:
|
|
18
|
+
docs/textbase (README · `*.md` · design notes) · TODOs (`TODO.md` · `FIXME`/`TODO`/`HACK`
|
|
19
|
+
comments · task lists) · config/manifests (configs · `.env.example` · `pyproject`/`package`
|
|
20
|
+
· CI) · data/fixtures (samples · fixtures · schemas). Gather only the TASK-SPECIFIC
|
|
21
|
+
delta — never index the whole repo.
|
|
22
|
+
- **Honors** — the patterns and conventions the work must respect, cited from
|
|
23
|
+
`PROJECT.md` / `CONVENTIONS.md`. Gather only the TASK-SPECIFIC delta — never
|
|
24
|
+
re-derive the architecture or re-run the setup brownfield scan.
|
|
25
|
+
- **Anchors the contract cites** — the specific symbols §3 CONTRACT will name. The
|
|
26
|
+
contract may cite only anchors that appear here.
|
|
27
|
+
|
|
28
|
+
**How — gather efficiently:** for the BROAD sweep, prefer a small-model subagent / fast
|
|
29
|
+
index / skim (offload to a cheap context, return a compact map); then DEEPEN on what THIS
|
|
30
|
+
task specifically needs — never lock a shallow first pass. A recommendation: the engine
|
|
31
|
+
never spawns a subagent (tool-agnostic), so the orchestrating agent chooses.
|
|
32
|
+
|
|
33
|
+
## Greenfield / first task
|
|
34
|
+
|
|
35
|
+
The first task of a project runs ground too. When there is little or no code yet
|
|
36
|
+
(greenfield), or you are mid-setup, your grounding IS the foundation docs / brownfield
|
|
37
|
+
scan you just produced — point at them; do not re-scan. An honest "new module, no
|
|
38
|
+
existing code; honors CONVENTIONS.md §X" is a complete grounding.
|
|
39
|
+
|
|
40
|
+
## AI prompt
|
|
41
|
+
|
|
42
|
+
<prompt>
|
|
43
|
+
Role: an engineer who reads the real code before designing against it.
|
|
44
|
+
Read first: PROJECT.md · CONVENTIONS.md · the actual files the task touches.
|
|
45
|
+
Objective: fill §0 GROUND with the real files/symbols/signatures + the conventions to
|
|
46
|
+
honor + the anchor points the contract will cite — gathered from the codebase, never assumed.
|
|
47
|
+
Steps:
|
|
48
|
+
0. Sweep broad cheaply first — prefer a small-model subagent / fast index / skim — then deepen task-specifically.
|
|
49
|
+
1. Locate the files and symbols the task reads or changes (code tools, not memory).
|
|
50
|
+
2. Record their signatures / how they are keyed; cite the conventions to honor (task delta only).
|
|
51
|
+
3. Name the anchors §3 will cite.
|
|
52
|
+
Never: invent a file, symbol, or signature you have not opened.
|
|
53
|
+
</prompt>
|
|
54
|
+
|
|
55
|
+
## Exit gate
|
|
56
|
+
|
|
57
|
+
<exit_gate>
|
|
58
|
+
- [ ] The real files/symbols the task touches are named (from the code, not assumed).
|
|
59
|
+
- [ ] The conventions to honor are cited (task-delta only; no architecture re-scan).
|
|
60
|
+
- [ ] The anchors §3 will cite are listed — §3 names only anchors that exist here.
|
|
61
|
+
</exit_gate>
|
|
62
|
+
|
|
63
|
+
> **Advisor · Confidence** — a broad sweep is the canonical spawn case (advisor.md); self-score your grounding before you specify against it (confidence.md).
|
|
64
|
+
|
|
65
|
+
## Next
|
|
66
|
+
|
|
67
|
+
`python3 .add/tooling/add.py advance` → read `phases/1-specify.md`.
|
|
68
|
+
Book: `docs/02-the-flow.md` (the flow; ground is the §0 preamble to the seven steps).
|
|
@@ -49,13 +49,40 @@ Ask only the live ones; skip what the request already answers. Rank your drafts
|
|
|
49
49
|
one notation every scope level shares — `⚠ <assumption> — lowest confidence because <why>; if wrong: <cost>` — and
|
|
50
50
|
tag thin or inferred answers `guessed`.
|
|
51
51
|
|
|
52
|
+
## 2c · Domain deep-dive — per-drive, across multiple turns (deepens §2b)
|
|
53
|
+
|
|
54
|
+
§2b gets a foundation from one question per lens; this step DEEPENS it across **multiple
|
|
55
|
+
turns**, one deep-dive per **drive** — naming all four, including the one §2b's lens list omitted:
|
|
56
|
+
|
|
57
|
+
| Drive | Deepen |
|
|
58
|
+
|-------|--------|
|
|
59
|
+
| **DDD** (domain) | core nouns → model: the entities, the invariants, the bounded edges |
|
|
60
|
+
| **SDD** (spec) | the milestone outcome → the behaviors and the explicit non-goals |
|
|
61
|
+
| **UDD** (users) | the primary user → the jobs, the surface, the one flow that must feel right |
|
|
62
|
+
| **TDD** (trust) | what "done & trusted" means: the risks to prove, the evidence that closes them |
|
|
63
|
+
|
|
64
|
+
Capture each surfaced decision as an **ADR** (architecture decision record) into `PROJECT.md`
|
|
65
|
+
**Key Decisions** as it lands — the Decisions lens becomes explicit ADR capture (the *why*, not just the *what*).
|
|
66
|
+
|
|
67
|
+
**Under `autonomy: auto` with full context, auto-complete all four drives in one pass** — draft
|
|
68
|
+
each without stopping to interview, still lowest-confidence-first, surfacing the top **flag**. Ask
|
|
69
|
+
only the live drives; skip what the request already answered. This deepens **drafting**, never the
|
|
70
|
+
gate: auto-complete NEVER skips the human baseline approval — the `lock` (§4) stays the one decision.
|
|
71
|
+
|
|
52
72
|
## 3 · Draft to the lock (both paths)
|
|
53
73
|
|
|
54
74
|
1. **Fill the living documentation** (it outlives all code): `.add/PROJECT.md` (the foundation — Domain · Spec/active
|
|
55
75
|
milestone · UI/UX · Key Decisions, one screen), `CONVENTIONS.md`, `GLOSSARY.md`, `MODEL_REGISTRY.md`,
|
|
56
|
-
`dependencies.allowlist
|
|
57
|
-
|
|
58
|
-
|
|
76
|
+
`dependencies.allowlist`, and — for a UI project — `DESIGN.md` (the design source of truth: identity ·
|
|
77
|
+
principles · screens · the named-set foundation pointers + render recipe; delete it if there's no UI).
|
|
78
|
+
Brownfield: from the code. Greenfield: from the interview, gaps flagged `guessed`.
|
|
79
|
+
2. **Propose, then size it.** You just read the codebase (brownfield) or interviewed (greenfield) — so
|
|
80
|
+
don't silently draft. First float a **kickoff suggestion** for the first milestone the human reacts to:
|
|
81
|
+
a **goal** (one outcome sentence), a **flow** (the breadth-first task order that gets there), and
|
|
82
|
+
**scenarios** (concrete examples of what the user can DO once it ships). Keep it a lightweight react-to
|
|
83
|
+
sketch — a few bullets, NOT the frozen `MILESTONE.md` or per-task §2 suites. This is show-before-ask:
|
|
84
|
+
the human reacts (confirm / adjust / redirect); you do not auto-create. On their reaction, draft its
|
|
85
|
+
`MILESTONE.md` (read `scope.md`) — goal · scope · exit criteria · breadth-first tasks.
|
|
59
86
|
3. **Create the first task and draft its candidate specification bundle.** `new-task` is allowed pre-lock:
|
|
60
87
|
```bash
|
|
61
88
|
python3 .add/tooling/add.py new-task <slug> --title "<first feature>"
|
|
@@ -66,6 +93,28 @@ tag thin or inferred answers `guessed`.
|
|
|
66
93
|
4. **Write `.add/SETUP-REVIEW.md`** per `setup-review.md`: every decision you drafted (foundation, scope,
|
|
67
94
|
first contract), **lowest-confidence-first**, each tagged `guessed` | `evidence-grounded`.
|
|
68
95
|
|
|
96
|
+
## Run mode — how the build will be driven (propose parallel + auto; confirm to keep)
|
|
97
|
+
|
|
98
|
+
Before the lock, surface ONE more choice so the human is aware of how ADD will drive the build:
|
|
99
|
+
the **run mode**. Two settings compose it — the **autonomy** level (`add.py autonomy`, run.md: who owns
|
|
100
|
+
the verify gate) and **streams** (`add.py waves` + `streams.md`: whether independent tasks pipeline).
|
|
101
|
+
Show this table so the human sees the flow behavior of each, then PROPOSE the default:
|
|
102
|
+
|
|
103
|
+
| Run mode | Human gates that fire | Concurrency / flow behavior |
|
|
104
|
+
|----------|-----------------------|-----------------------------|
|
|
105
|
+
| **sequential · manual/conservative** | the contract freeze **and** every Verify, one task at a time | one task start-to-finish before the next; safest, slowest; the reviewer waits on each build |
|
|
106
|
+
| **parallel · auto** *(proposed default)* | the contract freeze **only** — Verify auto-PASSes on complete evidence (security/residue still escalate) | `add.py waves` schedules independent tasks into waves; builds overlap behind their frozen contracts while you review one bundle; the reviewer is never blocked on a build |
|
|
107
|
+
|
|
108
|
+
**Propose `parallel + auto` as the default, and ask the human to confirm-to-keep** (or downgrade in
|
|
109
|
+
one step — `add.py autonomy set conservative --project`, or just run tasks one at a time). This is a
|
|
110
|
+
confirm, never a silent flip. Record the chosen mode in **`PROJECT.md` Key Decisions** (e.g. "run mode:
|
|
111
|
+
parallel + auto (opt-out), confirmed by <name>") so every later session inherits it.
|
|
112
|
+
|
|
113
|
+
What the default does **not** change: the irreducible floor still holds — **one human approval per
|
|
114
|
+
contract** fires no matter the mode. `auto` + `parallel` change the *order and throttle* of the build
|
|
115
|
+
(which tasks run when, and who gates Verify), never *whether* the contract decision point fires. A
|
|
116
|
+
high-risk task still refuses `auto` and forces a lowered rung (run.md guard).
|
|
117
|
+
|
|
69
118
|
## 4 · The one human gate — the baseline approval
|
|
70
119
|
|
|
71
120
|
Open the report with the ARC (goal · done · plan) per `report-template.md`, then present
|
|
@@ -15,6 +15,11 @@ understand the feature — that is information, not an obstacle. Stop and ask.
|
|
|
15
15
|
2. **Converge** — draft §1, then RANK where your confidence is lowest (below).
|
|
16
16
|
3. **Validate** — present the ranked uncertainty first; the user confirms, corrects, or sends back.
|
|
17
17
|
|
|
18
|
+
**Identity is direction, not default (UDD).** For UI/design work, identity values — the brand
|
|
19
|
+
color, the core palette, the typeface — are human-owned. Surface them for discussion during
|
|
20
|
+
Diverge; never assume a brand value. The UDD token dialect checks a token's *shape*; its *value*
|
|
21
|
+
is the user's call (`udd-tokens.md`).
|
|
22
|
+
|
|
18
23
|
## Produce (in TASK.md §1)
|
|
19
24
|
|
|
20
25
|
<output_format>
|
|
@@ -58,6 +63,8 @@ Never: resolve an ambiguity by guessing.
|
|
|
58
63
|
"none material" that still names the single biggest risk (never a blank "none").
|
|
59
64
|
</exit_gate>
|
|
60
65
|
|
|
66
|
+
> **Advisor · Confidence** — for an unfamiliar domain, spawn a researcher (advisor.md); self-score the spec and let the lowest dimension aim your ⚠ flag (confidence.md).
|
|
67
|
+
|
|
61
68
|
## Next
|
|
62
69
|
|
|
63
70
|
`python3 .add/tooling/add.py advance` → read `phases/2-scenarios.md`.
|
|
@@ -40,6 +40,8 @@ Never: settle for a vague result ("then it works") — results must be specific
|
|
|
40
40
|
- [ ] Every rejection asserts what stays unchanged.
|
|
41
41
|
</exit_gate>
|
|
42
42
|
|
|
43
|
+
> **Advisor · Confidence** — delegate a wide scenario sweep when the surface is large (advisor.md); score Edge cases honestly — a missing case surfaces there first (confidence.md).
|
|
44
|
+
|
|
43
45
|
## Next
|
|
44
46
|
|
|
45
47
|
`python3 .add/tooling/add.py advance` → read `phases/3-contract.md`.
|
|
@@ -22,10 +22,11 @@ whole bundle (§1–§4). Before asking for it, present the bundle **lowest-conf
|
|
|
22
22
|
most likely wrong (`⚠ [spec|scenario|contract|test] … — because …; if wrong: …`) — aim the human's
|
|
23
23
|
eye before they freeze. Open that report with the ARC (goal · done · plan) per `report-template.md` so the
|
|
24
24
|
human sees the goal this freeze serves and the plan beyond it, not just the bundle. See `run.md`.
|
|
25
|
+
The approval also freezes the §5 Scope (may touch) + Strategy declarations — the bundle covers them.
|
|
25
26
|
|
|
26
27
|
## The freeze review checklist
|
|
27
28
|
|
|
28
|
-
The human's one minute, aimed. Walk these
|
|
29
|
+
The human's one minute, aimed. Walk these seven before saying yes:
|
|
29
30
|
|
|
30
31
|
- **⚠ flags first** — read the lowest-confidence flags; accept each knowing its cost if wrong.
|
|
31
32
|
The engine refuses an unflagged freeze before build: a frozen §3 with no well-formed
|
|
@@ -34,6 +35,7 @@ The human's one minute, aimed. Walk these six before saying yes:
|
|
|
34
35
|
- **Intent** — does §1 say what you actually want built (and is anything you expected missing)?
|
|
35
36
|
- **Cases** — does every Must and Reject have an observable §2 scenario you care about?
|
|
36
37
|
- **Shape** — glossary names, error codes, additive vs breaking: is THIS the shape to freeze?
|
|
38
|
+
- **Grounded** — does §3 cite anchors that exist in the §0 GROUND map (real files/symbols), not invented ones? `status`/`check` surface this — measure, never block.
|
|
37
39
|
- **Risk** — is this scope high-risk or method-defining? Then require
|
|
38
40
|
`risk: high · autonomy: conservative` in the TASK.md header — the engine refuses an unguarded completion.
|
|
39
41
|
- **Tests** — will §4 go red for the right reason, asserting behavior rather than internals?
|
|
@@ -64,6 +66,8 @@ Never: change a frozen contract — a change reopens Specify.
|
|
|
64
66
|
- [ ] Every spec rejection has a contracted response.
|
|
65
67
|
</exit_gate>
|
|
66
68
|
|
|
69
|
+
> **Advisor · Confidence** — a second opinion on a risky shape is worth a spawn (advisor.md); a low self-score is your cue to lower autonomy before you freeze (confidence.md).
|
|
70
|
+
|
|
67
71
|
## Next
|
|
68
72
|
|
|
69
73
|
`python3 .add/tooling/add.py advance` → read `phases/4-tests.md`.
|
|
@@ -55,6 +55,8 @@ Never: implement the feature, or assert on internals.
|
|
|
55
55
|
- [ ] Coverage target recorded.
|
|
56
56
|
</exit_gate>
|
|
57
57
|
|
|
58
|
+
> **Advisor · Confidence** — spawn a test-author for a broad red suite (advisor.md); score Completeness — one test per scenario, every rejection covered (confidence.md).
|
|
59
|
+
|
|
58
60
|
## Next
|
|
59
61
|
|
|
60
62
|
`python3 .add/tooling/add.py advance` → read `phases/5-build.md`.
|
|
@@ -10,6 +10,21 @@ Pick ONE task-sized slice, restate the tests it must satisfy, implement, run
|
|
|
10
10
|
tests, iterate to green. Keep each batch small enough to review in full — you
|
|
11
11
|
cannot move faster than you can verify.
|
|
12
12
|
|
|
13
|
+
## Declaring the scope of impact (Scope + Strategy)
|
|
14
|
+
|
|
15
|
+
§5 of TASK.md opens with two declarations, drafted WITH the specification bundle
|
|
16
|
+
and frozen by the one §3 approval — never invented mid-build:
|
|
17
|
+
|
|
18
|
+
- **Scope (may touch)** — the allowlist of every file the build may write
|
|
19
|
+
(backticked tokens; grammar in the template comment). During build, needing a
|
|
20
|
+
file outside the declared Scope is a **STOP → change request** back to Specify,
|
|
21
|
+
never improvisation.
|
|
22
|
+
- **Strategy (ordered batches)** — the planned build order. Guidance, not
|
|
23
|
+
enforced: it aims the small-batches loop, it does not gate it.
|
|
24
|
+
|
|
25
|
+
Deferral, named: the engine gate (touched ⊆ declared) lands in the
|
|
26
|
+
`scope-gate-enforce` task — until it ships this section is prose discipline.
|
|
27
|
+
|
|
13
28
|
## The cardinal rule
|
|
14
29
|
|
|
15
30
|
**Never weaken or delete a test to make it pass, and never edit the frozen
|
|
@@ -36,9 +51,12 @@ Never: change a test or the contract; use a package off the allow-list; or push
|
|
|
36
51
|
- [ ] Coverage did not decrease.
|
|
37
52
|
- [ ] No test and no contract modified by the AI.
|
|
38
53
|
- [ ] No dependency outside the allow-list.
|
|
54
|
+
- [ ] No file outside the declared §5 Scope was touched.
|
|
39
55
|
- [ ] Change small enough to review in full.
|
|
40
56
|
</exit_gate>
|
|
41
57
|
|
|
58
|
+
> **Advisor · Confidence** — delegate an independent, well-scoped batch (advisor.md); self-score before you present green, and refine while it is cheap (confidence.md).
|
|
59
|
+
|
|
42
60
|
## Next
|
|
43
61
|
|
|
44
62
|
`python3 .add/tooling/add.py advance` → read `phases/6-verify.md`.
|
|
@@ -46,3 +64,9 @@ Book: `docs/07-step-5-build.md`.
|
|
|
46
64
|
|
|
47
65
|
> Under `autonomy: auto` (the default) Build and Verify run together as one dynamic,
|
|
48
66
|
> evidence-auto-gated run — not two manual stops. See `run.md`.
|
|
67
|
+
>
|
|
68
|
+
> **Honest redo.** If the verify gate finds a confirmed cheat (a tamper, or a reported
|
|
69
|
+
> earned-green failure), the task returns HERE for an honest redo — revert the tampered
|
|
70
|
+
> file or de-overfit src, then advance again. This is the bounded self-heal loop (`run.md`),
|
|
71
|
+
> capped: after the cap a confirmed cheat HARD-STOPs to the human. Never weaken a test or
|
|
72
|
+
> edit the frozen contract to pass.
|
|
@@ -47,6 +47,22 @@ Record it in the §6 **Deep checks** block — where each new symbol is called (
|
|
|
47
47
|
search), the dead-code scan result, or the prose you read in full and what it confirmed.
|
|
48
48
|
An unfilled Deep checks block is a **shallow verify**, not a PASS.
|
|
49
49
|
|
|
50
|
+
## Part four — was the green earned?
|
|
51
|
+
|
|
52
|
+
A green suite proves the tests pass — not that the build EARNED them. Three judgment cheats
|
|
53
|
+
pass the unchanged suite without earning it: src overfit to the test fixtures (special-cased
|
|
54
|
+
to the literal inputs, not the general behavior §1 asked for), vacuous asserts (tautological —
|
|
55
|
+
green even against an empty implementation), and real logic stubbed away (the function returns
|
|
56
|
+
a constant the tests happen to accept). These cheats are invisible to the mechanical tamper
|
|
57
|
+
tripwire, which only sees edited files. Score them with an adversarial refute-read: an
|
|
58
|
+
independent reviewer — a subagent under `autonomy: auto` is recommended, the engine never
|
|
59
|
+
spawns one — prompted to argue the green was NOT earned from outside the build context. This
|
|
60
|
+
is the verify-gate, whole-suite specialization of run.md's adversarial verify (see run.md), not
|
|
61
|
+
a new discipline. A confirmed earned-green failure is HARD-STOP-class: never auto-passed, never
|
|
62
|
+
RISK-ACCEPTED — but a first cheat is a chance to redo: a confirmed cheat (mechanical tamper or a
|
|
63
|
+
reported earned-green failure) enters the bounded self-heal loop — it returns to build for an honest
|
|
64
|
+
redo, and only after the loop's cap does it HARD-STOP to the human (the loop lives in run.md).
|
|
65
|
+
|
|
50
66
|
## Record exactly one outcome (no silent pass)
|
|
51
67
|
|
|
52
68
|
When you present this gate to the human, open with the ARC (goal · done · plan) per
|
|
@@ -66,6 +82,8 @@ before the ask — per that file's reconcile rule (verify is where a flag-vs-dig
|
|
|
66
82
|
(under `autonomy: auto` with no residue) the run auto-resolved as the accountable owner.
|
|
67
83
|
</exit_gate>
|
|
68
84
|
|
|
85
|
+
> **Advisor · Confidence** — the earned-green refute-read is the canonical adversarial spawn (advisor.md); score the verdict before you record the gate (confidence.md).
|
|
86
|
+
|
|
69
87
|
```bash
|
|
70
88
|
python3 .add/tooling/add.py gate PASS # marks the task done
|
|
71
89
|
# or: add.py gate RISK-ACCEPTED | add.py gate HARD-STOP (return to Build)
|
|
@@ -12,6 +12,11 @@ about the feature finally appears. Fill **§7** in TASK.md.
|
|
|
12
12
|
one is a signal), latency of the risky operation under load.
|
|
13
13
|
3. **Draft the next spec delta** — every defect, surprise, or new need becomes a
|
|
14
14
|
concrete change that re-enters the flow at Specify (a new task).
|
|
15
|
+
4. **Propose a voice delta** — you just worked a whole task alongside the human, so
|
|
16
|
+
notice where your voice diverged from theirs (their wordings + flow) and propose a
|
|
17
|
+
confirmable **voice delta** that tunes `SOUL.md`. Emit it `open`; the human confirms;
|
|
18
|
+
only then do you rewrite the routed SOUL.md section. Read `soul.md` for the grammar,
|
|
19
|
+
the routing, and the human-is-only-writer rule.
|
|
15
20
|
|
|
16
21
|
## AI prompt
|
|
17
22
|
|
|
@@ -34,6 +39,8 @@ Never: auto-roll-back — recommend; a human owns the production decision.
|
|
|
34
39
|
- [ ] A reviewed spec delta captured (becomes the next `new-task`).
|
|
35
40
|
</exit_gate>
|
|
36
41
|
|
|
42
|
+
> **Advisor · Confidence** — spawn a reviewer to mine the run for lessons (advisor.md); score Self-evaluation — did this loop teach the foundation? (confidence.md).
|
|
43
|
+
|
|
37
44
|
## Next
|
|
38
45
|
|
|
39
46
|
Loop. The artifacts you built are living documents the next cycle refines.
|