@pilotspace/add 1.0.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/GETTING-STARTED.md +238 -0
- package/LICENSE +20 -0
- package/README.md +106 -0
- package/bin/cli.js +131 -0
- package/docs/00-introduction.md +46 -0
- package/docs/01-principles.md +71 -0
- package/docs/02-the-flow.md +93 -0
- package/docs/03-step-1-specify.md +117 -0
- package/docs/04-step-2-scenarios.md +78 -0
- package/docs/05-step-3-contract.md +78 -0
- package/docs/06-step-4-tests.md +71 -0
- package/docs/07-step-5-build.md +80 -0
- package/docs/08-step-6-verify.md +63 -0
- package/docs/09-the-loop.md +43 -0
- package/docs/10-setup-and-stages.md +75 -0
- package/docs/11-governance.md +87 -0
- package/docs/12-roles.md +99 -0
- package/docs/13-adoption.md +67 -0
- package/docs/14-foundation.md +121 -0
- package/docs/README.md +70 -0
- package/docs/add-competencies.png +0 -0
- package/docs/add-flow.png +0 -0
- package/docs/add-foundation.png +0 -0
- package/docs/add-hierarchy.png +0 -0
- package/docs/appendix-a-templates.md +88 -0
- package/docs/appendix-b-prompts.md +119 -0
- package/docs/appendix-c-glossary.md +85 -0
- package/docs/appendix-d-worked-example.md +152 -0
- package/docs/appendix-e-checklists.md +80 -0
- package/docs/appendix-f-requirements-matrix.md +170 -0
- package/package.json +47 -0
- package/skill/add/SKILL.md +118 -0
- package/skill/add/deltas.md +69 -0
- package/skill/add/fold.md +66 -0
- package/skill/add/intake.md +49 -0
- package/skill/add/phases/0-setup.md +35 -0
- package/skill/add/phases/1-specify.md +55 -0
- package/skill/add/phases/2-scenarios.md +36 -0
- package/skill/add/phases/3-contract.md +41 -0
- package/skill/add/phases/4-tests.md +37 -0
- package/skill/add/phases/5-build.md +38 -0
- package/skill/add/phases/6-verify.md +39 -0
- package/skill/add/phases/7-observe.md +32 -0
- package/skill/add/run.md +152 -0
- package/skill/add/scope.md +58 -0
- package/tooling/add.py +1573 -0
- package/tooling/templates/CONVENTIONS.md.tmpl +8 -0
- package/tooling/templates/GLOSSARY.md.tmpl +3 -0
- package/tooling/templates/MILESTONE.md.tmpl +25 -0
- package/tooling/templates/MODEL_REGISTRY.md.tmpl +6 -0
- package/tooling/templates/PROJECT.md.tmpl +42 -0
- package/tooling/templates/TASK.md.tmpl +111 -0
- package/tooling/templates/dependencies.allowlist.tmpl +2 -0
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
# Getting started with ADD — your first feature in ~10 minutes
|
|
2
|
+
|
|
3
|
+
This is a runnable walkthrough. Follow it top to bottom and you'll take one real
|
|
4
|
+
feature — *transfer money between a user's own accounts* (the book's worked
|
|
5
|
+
example) — from nothing to a verified, passing result, using the ADD method.
|
|
6
|
+
|
|
7
|
+
You'll learn the whole loop by doing it once:
|
|
8
|
+
|
|
9
|
+
> **Specify → Scenarios → Contract → Tests → Build → Verify → Observe**
|
|
10
|
+
|
|
11
|
+
ADD is **AI-first**: you talk to the agent and it drives the method — you don't
|
|
12
|
+
hand-type the commands. The commands below are the agent's hands (and your escape
|
|
13
|
+
hatch); the rest of this guide shows both so you can see what the agent does.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## The fast path — talk to the agent
|
|
18
|
+
|
|
19
|
+
After installing (step 1 below), the whole on-ramp is one move:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
in Claude Code: /add
|
|
23
|
+
you: "I want to let users transfer money between their own accounts."
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
From there the agent runs the **on-ramp** for you:
|
|
27
|
+
|
|
28
|
+
1. **Orient** — it reads `add.py status` (the resume point), never re-reading your repo.
|
|
29
|
+
2. **Intake** — it sizes your request into versioned scope and proposes a **milestone**
|
|
30
|
+
(goal · scope · breadth-first tasks · exit criteria). *You confirm the shape.*
|
|
31
|
+
3. **One-approval front** — for each task it drafts Spec + Scenarios + Contract + Tests
|
|
32
|
+
as one bundle. *You give one approval at the frozen contract.*
|
|
33
|
+
4. **Self-driving run** — build→verify runs to green; a security finding always stops
|
|
34
|
+
back to you.
|
|
35
|
+
|
|
36
|
+
So a milestone-sized feature is: **describe it → confirm the milestone → approve each
|
|
37
|
+
contract → review the result.** Everything between is the agent.
|
|
38
|
+
|
|
39
|
+
> New term: **On-ramp** — the install→first-milestone path. See `docs/appendix-c-glossary.md`.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 0 · Prerequisites
|
|
44
|
+
|
|
45
|
+
- **Node.js ≥ 16** (to install) and **Python 3.12+** (the tool is stdlib-only).
|
|
46
|
+
- A project folder. It can be empty or an existing repo.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## 1 · Install
|
|
51
|
+
|
|
52
|
+
From your project root:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npx @pilotspace/add init --name "My App" --stage prototype
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
This creates `.add/` (your runtime), drops the `add` skill into
|
|
59
|
+
`.claude/skills/add/`, and bundles the book into `.add/docs/`. Pick the stage that
|
|
60
|
+
matches your intent — `prototype`, `poc`, `mvp`, or `production`. You can change it
|
|
61
|
+
later with `python3 .add/tooling/add.py stage mvp`.
|
|
62
|
+
|
|
63
|
+
> Why stages exist: the steps never change, only how *deeply* you run them.
|
|
64
|
+
> See `.add/docs/10-setup-and-stages.md`.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## 2 · Orient — the command you'll use most
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
python3 .add/tooling/add.py status
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
`add.py status` is your home base. It reads `.add/state.json` and tells you the
|
|
75
|
+
project stage, the active task, and which phase you're in. **Start every session
|
|
76
|
+
with it** — that's how ADD resumes work without re-reading your whole repo.
|
|
77
|
+
|
|
78
|
+
> Tip: shorten typing with an alias — `alias add="python3 .add/tooling/add.py"` —
|
|
79
|
+
> then you can run `add status`, `add advance`, etc. The rest of this guide writes
|
|
80
|
+
> the full `python3 .add/tooling/add.py ...` form so copy-paste always works.
|
|
81
|
+
|
|
82
|
+
And when you're mid-task and unsure what the current phase needs, ask:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
python3 .add/tooling/add.py guide
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
`status` tells you *where* you are; `guide` tells you *what to do next* — the active
|
|
89
|
+
task's phase, the one concrete next action, the chapter to read, and the exact command
|
|
90
|
+
to run once that phase is done.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## 3 · Start your first feature
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
python3 .add/tooling/add.py new-task transfer --title "Transfer money between my accounts"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
This scaffolds `.add/tasks/transfer/TASK.md` — **one file holding all seven phase
|
|
101
|
+
sections** — plus empty `tests/` and `src/` folders, and makes it the active task
|
|
102
|
+
at phase `specify`.
|
|
103
|
+
|
|
104
|
+
Open `.add/tasks/transfer/TASK.md` in your editor. You'll fill it top to bottom.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Under the hood — the seven phases by hand (escape hatch)
|
|
109
|
+
|
|
110
|
+
Everything above is what the agent drives for you through the one-approval front. This
|
|
111
|
+
section is the **escape hatch**: the same seven phases run by hand, so you can see what
|
|
112
|
+
each one produces and step in manually whenever you want to. You never *have* to type
|
|
113
|
+
these — they are the agent's hands, and yours when you take the wheel.
|
|
114
|
+
|
|
115
|
+
The rhythm is always: **fill the section → run `python3 .add/tooling/add.py advance`.**
|
|
116
|
+
The tool keeps the `phase:` marker at the top of TASK.md in sync.
|
|
117
|
+
|
|
118
|
+
### Phase 1 — Specify (`docs/03-step-1-specify.md`)
|
|
119
|
+
|
|
120
|
+
Write the rules in **§1**. State what it *must* do, what it must *reject* (each
|
|
121
|
+
with a named error code), and what's true after success:
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
Must:
|
|
125
|
+
- move an amount from one of my accounts to another of mine
|
|
126
|
+
- amount > 0 ; source ≠ destination ; source has enough balance
|
|
127
|
+
After:
|
|
128
|
+
- source balance -= amount, destination balance += amount
|
|
129
|
+
Reject:
|
|
130
|
+
- amount <= 0 -> "amount_invalid"
|
|
131
|
+
- source == destination -> "same_account"
|
|
132
|
+
- balance < amount -> "insufficient_funds"
|
|
133
|
+
- account not mine -> "forbidden"
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Confirm every assumption (no FX, no daily limit in v1). Then:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
python3 .add/tooling/add.py advance
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Phase 2 — Scenarios (`docs/04-step-2-scenarios.md`)
|
|
143
|
+
|
|
144
|
+
In **§2**, turn each rule into a Given/When/Then. For every rejection, assert what
|
|
145
|
+
must stay **unchanged**:
|
|
146
|
+
|
|
147
|
+
```gherkin
|
|
148
|
+
Scenario: insufficient funds
|
|
149
|
+
Given A has 20, mine
|
|
150
|
+
When I transfer 50 from A to B
|
|
151
|
+
Then it is rejected "insufficient_funds"
|
|
152
|
+
And no balance changes
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Then `python3 .add/tooling/add.py advance`.
|
|
156
|
+
|
|
157
|
+
### Phase 3 — Contract (`docs/05-step-3-contract.md`)
|
|
158
|
+
|
|
159
|
+
In **§3**, fix the external shape and **freeze** it (`Status: FROZEN @ v1`):
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
POST /transfers body: { fromAccountId, toAccountId, amount }
|
|
163
|
+
200 -> { transferId, fromBalance, toBalance }
|
|
164
|
+
400 -> { error: "amount_invalid" | "same_account" | "insufficient_funds" }
|
|
165
|
+
403 -> { error: "forbidden" }
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
A frozen contract is the seam that makes the AI build safe. Then advance.
|
|
169
|
+
|
|
170
|
+
### Phase 4 — Tests, red first (`docs/06-step-4-tests.md`)
|
|
171
|
+
|
|
172
|
+
Write one test per scenario into `.add/tasks/transfer/tests/`, then **run them and
|
|
173
|
+
confirm they FAIL** — there's no code yet. A test that passes now is testing
|
|
174
|
+
nothing. This is red/green TDD: red before green. Then advance.
|
|
175
|
+
|
|
176
|
+
### Phase 5 — Build (`docs/07-step-5-build.md`)
|
|
177
|
+
|
|
178
|
+
Now let the AI write code into `.add/tasks/transfer/src/` until **every test
|
|
179
|
+
passes** — without changing any test or the frozen contract. Honor the safety rule
|
|
180
|
+
(here: debit + credit in one atomic transaction). Then advance.
|
|
181
|
+
|
|
182
|
+
### Phase 6 — Verify (`docs/08-step-6-verify.md`)
|
|
183
|
+
|
|
184
|
+
In **§6**, confirm the evidence (all green, nothing weakened) and check what tests
|
|
185
|
+
miss: concurrency, security, architecture. Record the gate — and close the task:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
python3 .add/tooling/add.py gate PASS
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
`gate PASS` marks the task `done`. (Use `gate HARD-STOP` to send it back to Build,
|
|
192
|
+
or `gate RISK-ACCEPTED` for a signed, non-security waiver.)
|
|
193
|
+
|
|
194
|
+
### Phase 7 — Observe (`docs/09-the-loop.md`)
|
|
195
|
+
|
|
196
|
+
In **§7**, note what to watch in production and the next spec delta. Every learning
|
|
197
|
+
becomes the next `new-task`. The flow is a loop, not a finish line.
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## 5 · Self-check
|
|
202
|
+
|
|
203
|
+
Confirm your project is internally consistent at any time:
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
python3 .add/tooling/add.py check
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
It verifies state is valid, every task has its TASK.md, and markers match. Exit
|
|
210
|
+
code 0 means healthy — handy as a CI gate.
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## 6 · Resume next session
|
|
215
|
+
|
|
216
|
+
Close your laptop, come back tomorrow, run:
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
python3 .add/tooling/add.py status
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
It tells you exactly where you left off and what to do next. No context rot — the
|
|
223
|
+
state lives on disk, not in a chat window.
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## 7 · Where to read more
|
|
228
|
+
|
|
229
|
+
You just ran the method; now read *why* it's shaped this way:
|
|
230
|
+
|
|
231
|
+
- The shift & principles — `.add/docs/00-introduction.md`, `.add/docs/01-principles.md`
|
|
232
|
+
- The flow end to end — `.add/docs/02-the-flow.md`
|
|
233
|
+
- Each step in depth — `.add/docs/03..09`
|
|
234
|
+
- Operating it on a team — `.add/docs/11-governance.md`, `.add/docs/12-roles.md`
|
|
235
|
+
- A fully worked example — `.add/docs/appendix-d-worked-example.md`
|
|
236
|
+
|
|
237
|
+
The rule to remember: **build the right thing (direction), prove it's right
|
|
238
|
+
(verification), and let the AI do the building in between.**
|
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Tin Dang
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# ADD — AI-Driven Development
|
|
2
|
+
|
|
3
|
+
> A minimal, state-tracked Claude Code skill for building software when the AI
|
|
4
|
+
> writes the code and **you** own the two things it cannot do alone: decide *what*
|
|
5
|
+
> to build, and *verify* it is correct.
|
|
6
|
+
|
|
7
|
+
ADD is the **orchestration engine** of the AIDD method. It sits on top of a
|
|
8
|
+
context foundation (DDD → SDD → UDD) and runs as a red/green TDD ↔ AI-build loop.
|
|
9
|
+
The full reasoning — *why* every rule exists — is the AIDD book bundled in
|
|
10
|
+
[`docs/`](./docs/README.md). Read it once; keep it open beside you.
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
Foundation (context): DDD · SDD · UDD
|
|
14
|
+
Engine (this skill): TDD ⇄ ADD
|
|
15
|
+
Flow per feature: Specify → Scenarios → Contract → Tests → Build → Verify → Observe ↻
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Why ADD (and why it is minimal)
|
|
19
|
+
|
|
20
|
+
Heavy doc-first methods burn your time writing documents and lose the thread
|
|
21
|
+
across sessions (context rot). ADD fixes both:
|
|
22
|
+
|
|
23
|
+
- **One file per feature.** Spec, scenarios, contract, test-plan, and gate record
|
|
24
|
+
all live inline in a single `TASK.md`. No sprawling doc tree.
|
|
25
|
+
- **State on disk, not in chat.** A Python tool tracks where you are in
|
|
26
|
+
`.add/state.json`, so a fresh session resumes with one command instead of
|
|
27
|
+
re-reading the repo.
|
|
28
|
+
- **Progressive disclosure.** The skill loads only the guide for the phase you are
|
|
29
|
+
in — the context window stays lean.
|
|
30
|
+
|
|
31
|
+
## Install
|
|
32
|
+
|
|
33
|
+
Pick your ecosystem — both install the same skill, tooling, and book:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Node / npm
|
|
37
|
+
npx @pilotspace/add init --name "My App" --stage prototype
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Python / pip
|
|
42
|
+
pip install add-method
|
|
43
|
+
add-method init --name "My App" --stage prototype
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**New here?** Follow the [10-minute Quickstart](./GETTING-STARTED.md) — it walks
|
|
47
|
+
your first feature end to end.
|
|
48
|
+
|
|
49
|
+
This installs:
|
|
50
|
+
|
|
51
|
+
| Path | What |
|
|
52
|
+
|------|------|
|
|
53
|
+
| `.claude/skills/add/` | the `add` skill Claude loads (thin router + per-phase guides) |
|
|
54
|
+
| `.add/tooling/add.py` | scaffolder + state tracker (Python, stdlib only) |
|
|
55
|
+
| `.add/docs/` | the AIDD book — the trust layer |
|
|
56
|
+
| `.add/state.json` | where the project is |
|
|
57
|
+
| `.add/CONVENTIONS.md`, `GLOSSARY.md`, `MODEL_REGISTRY.md`, `dependencies.allowlist` | survivor-layer files |
|
|
58
|
+
|
|
59
|
+
## Use it
|
|
60
|
+
|
|
61
|
+
ADD is AI-first: you talk to the agent; it drives the method. In Claude Code, run
|
|
62
|
+
**`/add`** and say what you want to build:
|
|
63
|
+
|
|
64
|
+
> `/add` — *"I want to let users transfer money between their own accounts."*
|
|
65
|
+
|
|
66
|
+
The agent orients from `state.json`, **sizes your request into a milestone** (you
|
|
67
|
+
confirm the shape), then drafts each feature's **one-approval front** — Spec +
|
|
68
|
+
Scenarios + Contract + Tests as one bundle — and you give **one approval at the
|
|
69
|
+
frozen contract**. A self-driving build→verify run takes it to green; security
|
|
70
|
+
findings always stop back to you.
|
|
71
|
+
|
|
72
|
+
Under the hood the agent runs the CLI as its hands — and you can hand-drive it too:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
python3 .add/tooling/add.py status # where am I? (resume point)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## The non-negotiables
|
|
79
|
+
|
|
80
|
+
1. **Direction before speed** — no Build until spec, scenarios, contract, and *red*
|
|
81
|
+
tests exist.
|
|
82
|
+
2. **Trust evidence, not inspection** — a feature is trusted because its tests pass
|
|
83
|
+
and the blind spots (concurrency, security, architecture) were checked.
|
|
84
|
+
3. **Never weaken a test or edit a frozen contract** to make the build pass.
|
|
85
|
+
4. **No silent skips** — every Verify records `PASS`, `RISK-ACCEPTED`, or
|
|
86
|
+
`HARD-STOP`. Security findings are always `HARD-STOP`.
|
|
87
|
+
5. **Ask, don't guess.**
|
|
88
|
+
|
|
89
|
+
## The artifacts survive; the code is disposable
|
|
90
|
+
|
|
91
|
+
The durable asset is the decisions — spec, scenarios, contract, tests. The code is
|
|
92
|
+
one implementation that satisfies them and can be regenerated. If the thing you'd
|
|
93
|
+
be upset to lose is "the code," you're still working the old way.
|
|
94
|
+
|
|
95
|
+
## Read the method
|
|
96
|
+
|
|
97
|
+
Start at [`docs/README.md`](./docs/README.md) — Foundations → the six steps →
|
|
98
|
+
operating it across a team → templates, prompts, and a full worked example.
|
|
99
|
+
|
|
100
|
+
## Develop
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
npm test # runs the Python tests for the tooling (red/green)
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
License: MIT.
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @pilotspace/add installer.
|
|
6
|
+
*
|
|
7
|
+
* npx @pilotspace/add init [targetDir] [--force] [--stage <stage>] [--name <name>]
|
|
8
|
+
*
|
|
9
|
+
* Installs the ADD skill + tooling + book into a target project:
|
|
10
|
+
* <target>/.claude/skills/add/ (the skill Claude loads)
|
|
11
|
+
* <target>/.add/tooling/ (add.py scaffolder + state tracker)
|
|
12
|
+
* <target>/.add/docs/ (the AIDD book — the trust layer)
|
|
13
|
+
* Then runs `add.py init` to create .add/state.json and survivor files.
|
|
14
|
+
*
|
|
15
|
+
* Zero npm dependencies. Designed for failure: verifies sources, never clobbers
|
|
16
|
+
* an existing state.json, and degrades gracefully if python3 is absent.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
const fs = require("fs");
|
|
20
|
+
const path = require("path");
|
|
21
|
+
const { spawnSync } = require("child_process");
|
|
22
|
+
|
|
23
|
+
const PKG_ROOT = path.resolve(__dirname, "..");
|
|
24
|
+
|
|
25
|
+
function log(msg) { process.stdout.write(msg + "\n"); }
|
|
26
|
+
function warn(msg) { process.stderr.write("warn: " + msg + "\n"); }
|
|
27
|
+
function fail(msg) { process.stderr.write("error: " + msg + "\n"); process.exit(1); }
|
|
28
|
+
|
|
29
|
+
function parseArgs(argv) {
|
|
30
|
+
const args = { _: [], force: false, stage: "prototype", name: null };
|
|
31
|
+
for (let i = 0; i < argv.length; i++) {
|
|
32
|
+
const a = argv[i];
|
|
33
|
+
if (a === "--force") args.force = true;
|
|
34
|
+
else if (a === "--stage") args.stage = argv[++i];
|
|
35
|
+
else if (a === "--name") args.name = argv[++i];
|
|
36
|
+
else if (a.startsWith("--")) warn("ignoring unknown flag " + a);
|
|
37
|
+
else args._.push(a);
|
|
38
|
+
}
|
|
39
|
+
return args;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function copyDir(src, dest, { skipIfExists } = {}) {
|
|
43
|
+
if (!fs.existsSync(src)) fail("missing packaged source: " + src);
|
|
44
|
+
if (skipIfExists && fs.existsSync(dest)) {
|
|
45
|
+
warn(dest + " exists — leaving it untouched");
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
fs.mkdirSync(path.dirname(dest), { recursive: true });
|
|
49
|
+
fs.cpSync(src, dest, { recursive: true });
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function hasPython() {
|
|
53
|
+
for (const py of ["python3", "python"]) {
|
|
54
|
+
const r = spawnSync(py, ["--version"], { stdio: "ignore" });
|
|
55
|
+
if (r.status === 0) return py;
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function cmdInit(args) {
|
|
61
|
+
const target = path.resolve(args._[0] || ".");
|
|
62
|
+
if (!fs.existsSync(target)) fail("target directory does not exist: " + target);
|
|
63
|
+
log("Installing ADD into " + target);
|
|
64
|
+
|
|
65
|
+
// 1. skill -> .claude/skills/add
|
|
66
|
+
copyDir(
|
|
67
|
+
path.join(PKG_ROOT, "skill", "add"),
|
|
68
|
+
path.join(target, ".claude", "skills", "add"),
|
|
69
|
+
{ skipIfExists: !args.force }
|
|
70
|
+
);
|
|
71
|
+
log(" ✓ skill -> .claude/skills/add/");
|
|
72
|
+
|
|
73
|
+
// 2. tooling -> .add/tooling (exclude tests from the installed copy)
|
|
74
|
+
const toolingDest = path.join(target, ".add", "tooling");
|
|
75
|
+
copyDir(path.join(PKG_ROOT, "tooling"), toolingDest, { skipIfExists: false });
|
|
76
|
+
// installed copy is runtime-only: drop ALL test files and any compiled cache
|
|
77
|
+
// (glob test_*.py — not just test_add.py — so no test leaks into installs)
|
|
78
|
+
fs.rmSync(path.join(toolingDest, "__pycache__"), { recursive: true, force: true });
|
|
79
|
+
for (const entry of fs.readdirSync(toolingDest)) {
|
|
80
|
+
if (/^test_.*\.py$/.test(entry)) {
|
|
81
|
+
fs.rmSync(path.join(toolingDest, entry), { force: true });
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
log(" ✓ tooling -> .add/tooling/add.py (+ templates)");
|
|
85
|
+
|
|
86
|
+
// 3. docs (the book / trust layer) -> .add/docs
|
|
87
|
+
copyDir(path.join(PKG_ROOT, "docs"), path.join(target, ".add", "docs"),
|
|
88
|
+
{ skipIfExists: false });
|
|
89
|
+
log(" ✓ trust docs -> .add/docs/ (the AIDD book)");
|
|
90
|
+
|
|
91
|
+
// 4. run add.py init (idempotent — add.py refuses to clobber state.json)
|
|
92
|
+
const py = hasPython();
|
|
93
|
+
const addPy = path.join(toolingDest, "add.py");
|
|
94
|
+
if (!py) {
|
|
95
|
+
warn("python3 not found — skipping `add.py init`.");
|
|
96
|
+
log("\nFinish setup manually once Python is available:");
|
|
97
|
+
log(" python3 .add/tooling/add.py init" +
|
|
98
|
+
(args.name ? ` --name "${args.name}"` : "") + ` --stage ${args.stage}`);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const initArgs = [addPy, "init", "--dir", target, "--stage", args.stage];
|
|
102
|
+
if (args.name) initArgs.push("--name", args.name);
|
|
103
|
+
if (args.force) initArgs.push("--force");
|
|
104
|
+
const r = spawnSync(py, initArgs, { stdio: "inherit" });
|
|
105
|
+
if (r.status !== 0 && r.status !== null) {
|
|
106
|
+
warn("`add.py init` exited non-zero (state may already exist). Run `add.py status` to check.");
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
log("\nDone. In Claude Code, the `add` skill is now installed.");
|
|
110
|
+
log("Next: open Claude Code, run `/add`, and say what you want to build —");
|
|
111
|
+
log(" the agent sizes it into a milestone and drives the build with you.");
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function main() {
|
|
115
|
+
const argv = process.argv.slice(2);
|
|
116
|
+
const cmd = argv[0] && !argv[0].startsWith("--") ? argv.shift() : "init";
|
|
117
|
+
const args = parseArgs(argv);
|
|
118
|
+
switch (cmd) {
|
|
119
|
+
case "init":
|
|
120
|
+
cmdInit(args);
|
|
121
|
+
break;
|
|
122
|
+
case "help":
|
|
123
|
+
case "--help":
|
|
124
|
+
log("usage: npx @pilotspace/add init [targetDir] [--force] [--stage <s>] [--name <n>]");
|
|
125
|
+
break;
|
|
126
|
+
default:
|
|
127
|
+
fail("unknown command '" + cmd + "'. Try: npx @pilotspace/add init");
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
main();
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# 00 · The shift: why AIDD exists
|
|
2
|
+
|
|
3
|
+
[Contents](./README.md) · Next: [01 Core principles →](./01-principles.md)
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Code became cheap
|
|
8
|
+
|
|
9
|
+
For the whole history of software, writing code was the slow, expensive, central act. Methodologies — waterfall, agile, and the rest — were arrangements for managing that expensive act: how to plan it, divide it, review it, and ship it.
|
|
10
|
+
|
|
11
|
+
AI changed the cost. An agent can now produce a working module in the time it takes to describe it. The marginal cost of *writing* a piece of code, and of *re-writing* it, has fallen close to zero.
|
|
12
|
+
|
|
13
|
+
When the cost of one activity collapses, value moves to whatever is still scarce. Three things remain scarce:
|
|
14
|
+
|
|
15
|
+
1. **Validated decisions** — knowing what should be built, and being right about it.
|
|
16
|
+
2. **Stable contracts** — the agreed interfaces and data shapes that everything else depends on.
|
|
17
|
+
3. **Verification capacity** — the rate at which people can confirm that what was produced is actually correct.
|
|
18
|
+
|
|
19
|
+
AIDD is a development method organized around protecting those three things, because they are now where the difficulty lives.
|
|
20
|
+
|
|
21
|
+
## The failure mode AIDD prevents
|
|
22
|
+
|
|
23
|
+
The naïve way to use an AI agent is to describe a feature in a sentence and accept whatever it returns. This works for a throwaway script and fails for real software, for one reason: **an AI agent is fast in whatever direction it is pointed.**
|
|
24
|
+
|
|
25
|
+
If the direction is vague, the agent does not slow down and ask. It produces a confident, plausible, complete-looking result that is subtly wrong — built on an assumption you never made, missing an edge case you never stated. Because it looks finished, the error survives a quick read and surfaces later, when it is expensive to fix.
|
|
26
|
+
|
|
27
|
+
Speed in the wrong direction is not progress; it is faster waste. The entire purpose of AIDD is to fix the direction *before* turning on the speed.
|
|
28
|
+
|
|
29
|
+
## Where value moves — and what that means for you
|
|
30
|
+
|
|
31
|
+
If writing code is no longer the scarce skill, then a software person's value is no longer "can write code." It is two new things:
|
|
32
|
+
|
|
33
|
+
- **Direction** — turning a fuzzy need into an unambiguous, buildable definition.
|
|
34
|
+
- **Verification** — establishing, through evidence, that the result is correct and safe.
|
|
35
|
+
|
|
36
|
+
This is not a smaller job than coding; it is a harder one. It is the part of engineering that was always the real work, now made explicit because the typing has been automated away.
|
|
37
|
+
|
|
38
|
+
## What this book gives you
|
|
39
|
+
|
|
40
|
+
The rest of the book is the practical consequence of the shift:
|
|
41
|
+
|
|
42
|
+
- A **flow** (Part II) that front-loads direction and back-loads AI execution, with verification built in.
|
|
43
|
+
- An **operating manual** (Part III) for running that flow across stages, roles, and risk levels.
|
|
44
|
+
- **Reference material** (Part IV) — templates, prompts, and a fully worked example — so the method is concrete from day one.
|
|
45
|
+
|
|
46
|
+
> **The thesis in one line.** Build the right thing (direction), prove it is right (verification), and let the AI do the building in between.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# 01 · Core principles
|
|
2
|
+
|
|
3
|
+
[← 00 The shift](./00-introduction.md) · [Contents](./README.md) · Next: [02 The flow →](./02-the-flow.md)
|
|
4
|
+
|
|
5
|
+
Everything in this book follows from a small set of principles. If a practice ever seems arbitrary, trace it back to one of these.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Direction before speed
|
|
10
|
+
|
|
11
|
+
An AI agent accelerates in whatever direction it is given. Therefore the direction must be fixed before the acceleration begins. In practice this means the early, human-led steps of the flow are not optional preamble — they are the steering, and the build step is the engine. You do not start the engine until the wheel is set.
|
|
12
|
+
|
|
13
|
+
**Consequence:** the specification, scenarios, and contract come *before* any code, every time.
|
|
14
|
+
|
|
15
|
+
## 2. Trust through evidence, not inspection
|
|
16
|
+
|
|
17
|
+
AI output is often wrong in ways that read as correct. You cannot establish correctness by reading the code and judging it plausible. You establish it by defining, in advance, what "correct" means — as automated tests — and confirming the code satisfies them, then checking by hand only the narrow set of things tests cannot catch.
|
|
18
|
+
|
|
19
|
+
**Consequence:** tests are written *before* the implementation, and a feature is trusted because its tests pass, not because someone reviewed it and liked it.
|
|
20
|
+
|
|
21
|
+
## 3. The artifacts survive; the code is disposable
|
|
22
|
+
|
|
23
|
+
The durable assets of a project are the decisions and agreements: the specification, the scenarios, the contract, the tests. The code is merely one implementation that satisfies them and can be regenerated at will. Protect the artifacts; treat the code as replaceable.
|
|
24
|
+
|
|
25
|
+
**Consequence:** effort goes into keeping contracts and specs stable and clear, not into preserving particular code. Metrics that count code volume or reuse measure the wrong thing.
|
|
26
|
+
|
|
27
|
+
## 4. The loop is re-entrant, not a waterfall
|
|
28
|
+
|
|
29
|
+
The flow has an order, but it is not a one-way march. Any step may reveal a gap in an earlier one — and when it does, you return to that earlier step, fix the artifact, and come forward again. The specification is a living document, not a frozen contract signed once.
|
|
30
|
+
|
|
31
|
+
**Consequence:** discovering a missing rule during the build is the method working, not failing. The only true one-way door is the frozen interface contract, and even that reopens through a deliberate change request.
|
|
32
|
+
|
|
33
|
+
## 5. Trust is earned per scope, not granted globally
|
|
34
|
+
|
|
35
|
+
How much you let the AI do is not a single switch. It is a setting that lives *per scope*, and it can differ from one part of the system to another. A well-tested, low-risk area may run at full autonomy while a new, high-risk one is held back.
|
|
36
|
+
|
|
37
|
+
The *default starting point* is a deliberate choice. A team that has built up evidence and tooling may **start a scope at auto** — the AI drafts the front, a human approves the frozen contract once, and the build runs and auto-gates on evidence — and *lower to conservative* wherever risk is high. (An earlier formulation started every scope conservative and made autonomy the earned exception; it is the same dial either way — what differs is which end you default to.) Two things never move with the default, whichever way it points: the contract-freeze seam stays human (the AI never freezes the interface it then builds against), and a high-risk scope is always lowered, never auto-run.
|
|
38
|
+
|
|
39
|
+
**Consequence:** autonomy is a per-scope setting you choose deliberately and can lower at any time; high-risk scope is held to a human gate regardless of the default (see [11 Governance](./11-governance.md)).
|
|
40
|
+
|
|
41
|
+
## 6. You cannot move faster than you can verify
|
|
42
|
+
|
|
43
|
+
When an agent produces more than the team can review, the excess is not speed — it is unreviewed risk accumulating. Verification capacity is the real ceiling on throughput.
|
|
44
|
+
|
|
45
|
+
But *verification* is not the same as *human reading*. The ceiling is what you can trust to a recorded standard, and automated verification raises it: a passing test suite, a contract check, an adversarial verifier are all verification, and they scale in a way human review cannot. This is only principle 2 taken to its limit. What automation cannot cover is the residue principle 2 names — the narrow set tests miss: security, concurrency, and architecture. That residue stays at human speed. So the rule sharpens: you may move as fast as your *automated* verification carries you, and no faster on the part only a human can check.
|
|
46
|
+
|
|
47
|
+
**Consequence:** if AI output outpaces verification, the correct response is to strengthen the automated checks or reduce the AI's autonomy — never to rush or skip. More autonomy is earned by more verification, not by a lower bar.
|
|
48
|
+
|
|
49
|
+
## 7. No silent skips
|
|
50
|
+
|
|
51
|
+
Every checkpoint resolves explicitly. A step is either passed, or passed with a recorded and signed acceptance of a known risk, or stopped. Nothing is quietly waved through.
|
|
52
|
+
|
|
53
|
+
An *automated* pass is still an explicit pass, not a skip — provided it records an outcome and escalates what it cannot judge. A gate may be resolved by evidence rather than by a person when that evidence is sufficient and the result is logged to an accountable owner: a named run, against a recorded standard, is as accountable as a signature. The line between a pass and a skip is the recorded outcome, not who signed it. The exception is absolute: security always escalates to a human and is never auto-passed — a security finding is a hard stop, whatever the evidence says.
|
|
54
|
+
|
|
55
|
+
**Consequence:** every gate produces a recorded outcome with an accountable owner — a person, or a named automated run — and security always stops for a person (see [11 Governance](./11-governance.md)).
|
|
56
|
+
|
|
57
|
+
## 8. Tool-agnostic by construction
|
|
58
|
+
|
|
59
|
+
The instructions you give the AI are plain text that reference files in the repository, not commands tied to one product. Enforcement of the gates lives in your build pipeline, not in the agent. This keeps the method portable: the agent is replaceable; the method is not.
|
|
60
|
+
|
|
61
|
+
**Consequence:** the same project works whether the team uses one AI coding tool or another, and switching tools changes nothing structural.
|
|
62
|
+
|
|
63
|
+
## 9. Two surfaces: the State you load, the Story you reference
|
|
64
|
+
|
|
65
|
+
A method that fills the context window with its own documentation defeats itself — the agent rots before it reaches the work. So ADD keeps two doc surfaces and never loads both. The **State surface** is everything an agent loads to do the work each session: the `add` skill itself (its router `SKILL.md` and the one phase currently in play) together with the lean, current operational docs — `PROJECT.md` (the foundation), the active `MILESTONE.md`, the active `TASK.md`, and `state.json`. The **Story surface** is this book: the whole method, read once by a person to understand and trust ADD, and thereafter **never auto-loaded** into agent context — only referenced by a pointer. Depth lives on the Story surface; leanness is enforced on the State surface; they never compete for the same tokens.
|
|
66
|
+
|
|
67
|
+
**Consequence:** the book can be as rich as trust requires without costing a single runtime token, while the loaded surface stays small enough never to rot. It is why the guideline block in `CLAUDE.md`/`AGENTS.md` *points* to `add.py status` and `PROJECT.md` rather than copying them.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
> **The principles, compressed.** Steer before you accelerate. Trust evidence, not impressions. Keep the decisions, throw away the code. Loop freely, but never skip silently. Load the State; reference the Story. Grant the AI only as much autonomy as you can verify.
|