@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.
Files changed (53) hide show
  1. package/GETTING-STARTED.md +238 -0
  2. package/LICENSE +20 -0
  3. package/README.md +106 -0
  4. package/bin/cli.js +131 -0
  5. package/docs/00-introduction.md +46 -0
  6. package/docs/01-principles.md +71 -0
  7. package/docs/02-the-flow.md +93 -0
  8. package/docs/03-step-1-specify.md +117 -0
  9. package/docs/04-step-2-scenarios.md +78 -0
  10. package/docs/05-step-3-contract.md +78 -0
  11. package/docs/06-step-4-tests.md +71 -0
  12. package/docs/07-step-5-build.md +80 -0
  13. package/docs/08-step-6-verify.md +63 -0
  14. package/docs/09-the-loop.md +43 -0
  15. package/docs/10-setup-and-stages.md +75 -0
  16. package/docs/11-governance.md +87 -0
  17. package/docs/12-roles.md +99 -0
  18. package/docs/13-adoption.md +67 -0
  19. package/docs/14-foundation.md +121 -0
  20. package/docs/README.md +70 -0
  21. package/docs/add-competencies.png +0 -0
  22. package/docs/add-flow.png +0 -0
  23. package/docs/add-foundation.png +0 -0
  24. package/docs/add-hierarchy.png +0 -0
  25. package/docs/appendix-a-templates.md +88 -0
  26. package/docs/appendix-b-prompts.md +119 -0
  27. package/docs/appendix-c-glossary.md +85 -0
  28. package/docs/appendix-d-worked-example.md +152 -0
  29. package/docs/appendix-e-checklists.md +80 -0
  30. package/docs/appendix-f-requirements-matrix.md +170 -0
  31. package/package.json +47 -0
  32. package/skill/add/SKILL.md +118 -0
  33. package/skill/add/deltas.md +69 -0
  34. package/skill/add/fold.md +66 -0
  35. package/skill/add/intake.md +49 -0
  36. package/skill/add/phases/0-setup.md +35 -0
  37. package/skill/add/phases/1-specify.md +55 -0
  38. package/skill/add/phases/2-scenarios.md +36 -0
  39. package/skill/add/phases/3-contract.md +41 -0
  40. package/skill/add/phases/4-tests.md +37 -0
  41. package/skill/add/phases/5-build.md +38 -0
  42. package/skill/add/phases/6-verify.md +39 -0
  43. package/skill/add/phases/7-observe.md +32 -0
  44. package/skill/add/run.md +152 -0
  45. package/skill/add/scope.md +58 -0
  46. package/tooling/add.py +1573 -0
  47. package/tooling/templates/CONVENTIONS.md.tmpl +8 -0
  48. package/tooling/templates/GLOSSARY.md.tmpl +3 -0
  49. package/tooling/templates/MILESTONE.md.tmpl +25 -0
  50. package/tooling/templates/MODEL_REGISTRY.md.tmpl +6 -0
  51. package/tooling/templates/PROJECT.md.tmpl +42 -0
  52. package/tooling/templates/TASK.md.tmpl +111 -0
  53. package/tooling/templates/dependencies.allowlist.tmpl +2 -0
@@ -0,0 +1,75 @@
1
+ # 10 · Project setup and stages
2
+
3
+ [← 09 The loop](./09-the-loop.md) · [Contents](./README.md) · Next: [11 Governance →](./11-governance.md)
4
+
5
+ This chapter covers two operational matters: what you set up once per project, and how the same flow runs at different depths as a product matures.
6
+
7
+ ---
8
+
9
+ ## One-time setup
10
+
11
+ Before the first feature, establish the foundation the whole project depends on. Done once, it makes every later checkpoint enforceable automatically.
12
+
13
+ | Item | File | Purpose |
14
+ |------|------|---------|
15
+ | Repository + pipeline | — | runs the gates on every change |
16
+ | Conventions | `CONVENTIONS.md` | naming, layout, language, formatter — the survivor layer |
17
+ | Model record | `MODEL_REGISTRY.md` | which AI model and version the project uses, for reproducibility and audit |
18
+ | Dependency allow-list | `dependencies.allowlist` | the packages the AI may use; the pipeline rejects others |
19
+ | Prompt playbook | `playbook/` | the six prompts from [Appendix B](./appendix-b-prompts.md) |
20
+
21
+ **Setup exit check**
22
+
23
+ - [ ] The pipeline runs and is green on the empty skeleton.
24
+ - [ ] The model is pinned.
25
+ - [ ] The allow-list exists and the pipeline fails on any package outside it.
26
+ - [ ] The playbook is present.
27
+
28
+ Do not start a feature until the pipeline is green. It is the thing that will enforce every later exit check without anyone having to remember to.
29
+
30
+ ---
31
+
32
+ ## Stages: the same flow at increasing depth
33
+
34
+ A *stage* is one pass through the flow at a chosen depth. The steps never change between stages; what changes is how deeply you run each one. The instinct to skip steps for an early prototype is right in spirit but wrong in form — you do not skip steps, you run them lightly.
35
+
36
+ ### The depth matrix
37
+
38
+ Depth: **Deep** (full rigor) · **Core** (real but scoped) · **Light** (just enough) · **—** (skipped or stubbed).
39
+
40
+ | Step | Prototype | Proof of Concept | MVP | Production-Ready |
41
+ |------|:---------:|:----------------:|:---:|:----------------:|
42
+ | 1 Specify | Light | Deep (risky slice) | Deep | Deep |
43
+ | (design, if UI) | **Deep** | Light | Core | Deep |
44
+ | 2 Scenarios | Light | Core | Deep | Deep |
45
+ | 3 Contract | — | Core | Deep | Deep |
46
+ | 4 Tests | — | Core | Core | Deep |
47
+ | 5 Build | Light (throwaway) | Core | Core | Deep |
48
+ | 6 Verify | Light | Core | Core | Deep |
49
+ | Loop / operate | — | — | Light | Deep |
50
+ | **Typical time\*** | ~2–5 days | ~1–3 weeks | ~4–8 weeks | ~4–8+ weeks |
51
+ | **Code is** | disposable | disposable | kept | hardened |
52
+
53
+ \* *Ranges assume a small team on a single product slice. Scale by scope and by the number of parallel streams. The pace is set by judgment and review capacity, not by how fast the AI can type — adding more AI does not compress the human-led steps.*
54
+
55
+ ### Stage by stage
56
+
57
+ **Prototype — prove the experience.** Run the design deeply and everything else lightly; the code is throwaway. The achievement is that a stakeholder reacts to something tangible and a go/no-go on the concept becomes possible. Do not expect real data, tests, or anything that survives.
58
+
59
+ **Proof of Concept — retire the biggest technical risk.** Run the contract, tests, and build *deeply but only on the single riskiest slice*. The achievement is evidence that the hardest unknown is solvable, which turns an MVP estimate from hopeful into credible. Do not expect breadth or polish.
60
+
61
+ **MVP — deliver value to real users.** Run the full flow at a narrow scope — the first complete loop, including light observation. The achievement is real users getting value while you learn from them. Do not expect scale or full operational rigor.
62
+
63
+ **Production-Ready — run safely at scale.** Run every step at full rigor and deepen the operate-and-learn loop: service objectives, incident response, tested rollback, gradual delivery. The achievement is a system that is tested, secure, observable, and supportable. Do not expect "zero defects"; expect managed risk with a working feedback loop.
64
+
65
+ ### What carries forward
66
+
67
+ The durable thing is never the code:
68
+
69
+ | Transition | Discard | Keep |
70
+ |------------|---------|------|
71
+ | Prototype → POC | the prototype code | the validated experience (design, flows) |
72
+ | POC → MVP | the spike code | the validated approach + the risky-interface contract |
73
+ | MVP → Production | nothing | everything; the code is real and is hardened |
74
+
75
+ The survivor layer thickens as you move right: a prototype leaves you a validated design; a proof of concept adds a proven approach and a contract; the MVP adds real, kept code. By production, you are hardening, not rebuilding.
@@ -0,0 +1,87 @@
1
+ # 11 · Governance
2
+
3
+ [← 10 Setup and stages](./10-setup-and-stages.md) · [Contents](./README.md) · Next: [12 Roles →](./12-roles.md)
4
+
5
+ Governance is what keeps the method honest when a team runs it at speed. It is the same regardless of which AI tool writes the code, because it lives in the process and the pipeline, not in the agent.
6
+
7
+ ---
8
+
9
+ ## The autonomy ladder
10
+
11
+ How much the AI is allowed to do is not one switch; it is a setting chosen per area, rising with evidence and with your capacity to verify.
12
+
13
+ | Level | The AI… | A person… | Typical use |
14
+ |-------|---------|-----------|-------------|
15
+ | **Suggest** | proposes options | decides and writes | early, exploratory work |
16
+ | **Draft-and-review** | drafts artifacts | edits and approves each one | specs, scenarios, contracts |
17
+ | **Generate-behind-gate** | generates code | reviews the change; it merges only if the contract and tests pass | the normal build |
18
+ | **Auto-with-evidence** | generates and merges | samples and audits; auto-merge allowed only with a full evidence bundle attached | narrow, well-tested areas |
19
+
20
+ The governing rule, restated from the principles: **operate only at the level your review capacity can sustain.** If the AI produces more than the team can verify, drop a level.
21
+
22
+ The **per-scope default is auto-with-evidence behind a one-approval seam**: the AI drafts the front, a human approves the frozen contract once, and the build auto-gates on evidence. You *lower* a scope toward draft-and-review or suggest wherever risk is high or evidence is thin — and a high-risk or method-defining scope is *always* lowered (it is never auto-run). The default sets where you start; review capacity and risk set where you stay.
23
+
24
+ ## The gate-fail protocol and the three reports
25
+
26
+ Every checkpoint produces three short reports — **Test** (does it pass?), **Quality** (is it well-made and conformant?), and **Risk** (what could go wrong, and who owns it?) — and resolves to exactly one outcome:
27
+
28
+ - **`PASS`** — criteria met; proceed.
29
+ - **`RISK-ACCEPTED`** — proceed with a signed waiver carrying a named owner, a linked ticket, and an expiry. Allowed for non-security gaps only.
30
+ - **`HARD-STOP`** — cannot proceed. Triggered by any failing test or any security finding; overridable only by the most senior accountable owner, and never for security.
31
+
32
+ The rule behind the protocol is *no silent skips.* A report nobody is accountable for approving is just a document; an outcome with an owner is governance.
33
+
34
+ ### Why each step exists (institutional memory)
35
+
36
+ When someone proposes skipping a step "to go faster," this table is the answer:
37
+
38
+ | Step skipped | What happens | How you notice |
39
+ |--------------|--------------|----------------|
40
+ | Specify | the wrong thing gets built | shipped, but users do not use it |
41
+ | Scenarios | the feature is vague, edges missing | the AI keeps asking questions mid-build |
42
+ | Contract | interfaces drift | front, back, and AI disagree on shapes |
43
+ | Tests | AI code is uncontrollable | no way to know it is right but to test by hand |
44
+ | Verify (architecture check) | entropy explodes | the codebase is a tangle within months |
45
+ | Operate / loop | silent rot | the same incidents recur |
46
+
47
+ ## The continuous concerns
48
+
49
+ Four concerns are not steps but threads that run through every step, starting at project setup. Pulling them to the front ("shifting left") is far cheaper than bolting them on at the end.
50
+
51
+ | Concern | Begins at | Enforced at the build gate by |
52
+ |---------|-----------|-------------------------------|
53
+ | **Security** | setup (secret scanning, dependency allow-list) | zero high-severity findings; every AI-suggested package verified to exist |
54
+ | **Testing** | the scenarios step | coverage must not decrease; no test weakened to pass |
55
+ | **Observability** | setup (logging/metric conventions) | instrumentation present; service objectives verified after release |
56
+ | **Cost** | setup (an AI-usage budget per task) | a task may not exceed its budget without escalation |
57
+
58
+ ## AI-specific governance
59
+
60
+ A method built on AI agents needs controls older methods did not:
61
+
62
+ - **Pin the model.** Record the model and version; re-check the prompt library before adopting an upgrade. AI output is non-deterministic, so provenance matters.
63
+ - **Test the prompts.** The reusable instructions in `playbook/` are themselves artifacts: give each golden input/output cases, and re-check them when edited. A prompt that fails its check does not ship.
64
+ - **Guard the supply chain.** No package outside the allow-list without human approval; verify each suggested package actually exists, to defeat the risk of an agent inventing a plausible name an attacker has registered.
65
+ - **Track provenance and licensing.** License-scan both generated and pulled-in code; keep a record of what the AI produced.
66
+
67
+ ## Metrics that matter — and the anti-metrics
68
+
69
+ Measure the scarce things:
70
+
71
+ - **Contract stability** — how rarely the frozen contracts change; high churn is genuinely expensive.
72
+ - **Validated requirement coverage** — the share of rules confirmed against real behavior.
73
+ - **Review throughput** — the team's verification capacity, which sets the safe autonomy level.
74
+ - **Delivery and reliability** — lead time, deployment frequency, change-failure rate, time to recover.
75
+
76
+ Do **not** optimize: lines of AI code generated, code-reuse percentage, prompt counts, or velocity measured in code volume. These count the cheap, disposable thing and create incentives to keep bad code to protect a number.
77
+
78
+ ## Profiles: one method, three intensities
79
+
80
+ | | **Express** (startup) | **Standard** (most teams) | **Regulated** (audited) |
81
+ |---|---|---|---|
82
+ | Steps | combine Specify + Scenarios into a one-page brief; light contract | full flow | full flow, all `HARD-STOP` |
83
+ | Scenarios | happy path only | happy + key alternatives | exhaustive, incl. compliance |
84
+ | Autonomy ceiling | generate-behind-gate from day one | up to auto-with-evidence | generate-behind-gate max; the AI never merges its own work |
85
+ | Gate default | `RISK-ACCEPTED` allowed | `PASS` required to advance | `HARD-STOP`; full audit trail |
86
+
87
+ Choose the profile deliberately — a startup spike and a banking system are not the same risk — and run different products at different profiles as appropriate. The choice is owned by the delivery lead (see [12 Roles](./12-roles.md)).
@@ -0,0 +1,99 @@
1
+ # 12 · Roles and responsibilities
2
+
3
+ [← 11 Governance](./11-governance.md) · [Contents](./README.md) · Next: [13 Adoption →](./13-adoption.md)
4
+
5
+ Everyone on an AIDD team becomes, in part, a *verifier*; most also become *authors of the artifacts*. This chapter says what each role owns and does. Find your section; each answers the same three questions — what you do, when, and what "done" means for you.
6
+
7
+ ---
8
+
9
+ ## Product / Domain Owner
10
+
11
+ - **Mission:** ensure the right thing gets built. You guard the problem.
12
+ - **Leads:** Specify. **Contributes to:** Scenarios; the loop (deciding what the next cycle addresses).
13
+ - **Owns:** the problem definition, the glossary of domain terms, the prioritized backlog.
14
+ - **Done means:** the spec states real user value with no disputed terms and its assumptions ranked least-sure first — the one or two most likely wrong flagged with *why* and *what they cost*; after release, you have decided what the next loop must address.
15
+ - **Apply it:** run the Specify prompt against a real ticket or interview, then read the AI's least-sure flag *first* and decide the one or two load-bearing assumptions before skimming the low-stakes tail. If you cannot confirm a load-bearing rule, it is not ready to build.
16
+
17
+ ## Architect / Engineering Lead
18
+
19
+ - **Mission:** own the load-bearing surfaces and the checks that protect them.
20
+ - **Leads:** project setup; the Contract freeze. **Accountable for:** all the durable artifacts.
21
+ - **Owns:** `CONVENTIONS.md`, the contracts, the architecture check in verification, the model record.
22
+ - **Done means:** contracts are frozen and versioned; the architecture check runs in the pipeline; autonomy levels match the team's real review capacity.
23
+ - **Apply it:** treat the contract freeze as a one-way door. When a stream wants to change a frozen contract, route it as a change request that reopens Specify — never let code quietly move the surface.
24
+
25
+ ## Software Engineer (Senior)
26
+
27
+ - **Mission:** direct the build and hold quality at the architecture check.
28
+ - **Leads:** Build. **Contributes to:** Contract, Tests; reviews others' changes.
29
+ - **Owns:** the implementation, the architecture conformance check, the evidence bundle on each change.
30
+ - **Done means:** all tests pass without any test being weakened; coverage holds; architecture and security checks pass; a person has reviewed it.
31
+ - **Apply it:** work in small batches the review can keep up with, and never let the AI edit a test to make it pass — that is the cardinal sin of the build step.
32
+
33
+ ## Software Engineer (Junior)
34
+
35
+ - **Mission:** learn the craft by entering at the build end and growing toward judgment.
36
+ - **Leads:** nothing yet. **Contributes to:** Build (against handed-over specs and contracts), Tests.
37
+ - **Owns:** your tasks' code and tests; raising a flag when a spec is ambiguous — which is a contribution, not a failure.
38
+ - **Done means:** your task's tests pass honestly, your change has a clear evidence bundle, and a senior has reviewed it.
39
+ - **Apply it:** start with specs and contracts given to you and make red tests green without weakening them; over time move *up* toward design and specification as your judgment matures (see [13 Adoption](./13-adoption.md)).
40
+
41
+ ## QA / Test Engineer
42
+
43
+ - **Mission:** make "done" machine-checkable; you are the safety net for AI-written code.
44
+ - **Leads:** Tests. **Contributes to:** Scenarios (turning rules into checkable form); the loop (production monitors).
45
+ - **Owns:** the test suite, the scenario files, the coverage target, the test report at each gate.
46
+ - **Done means:** every scenario has a test that was red before the build; the suite is honest (nothing passes by default); coverage never regresses.
47
+ - **Apply it:** co-author the scenarios so the path from rule to test loses nothing, and confirm the suite fails for the *right* reason before the build begins.
48
+
49
+ ## Product Designer (UI/UX)
50
+
51
+ - **Mission:** ensure correct logic does not ship inside a poor experience.
52
+ - **Leads:** the design portion of Specify; the Prototype stage. **Contributes to:** Scenarios (experience-side rules).
53
+ - **Owns:** the user flows, the specification of every screen state, the design document, the clickable prototype.
54
+ - **Done means:** every screen has all its states designed; the prototype matches the scenarios; the self-critique for generic, low-effort output has passed.
55
+ - **Apply it:** in the Prototype stage you lead — make the experience tangible fast, and carry the design forward while the prototype code is discarded.
56
+
57
+ ## DevOps / SRE / Platform
58
+
59
+ - **Mission:** make the continuous concerns real and run the operate-and-learn loop.
60
+ - **Leads:** the loop / operations. **Contributes to:** setup (pipeline, observability conventions), Build (deployment, gradual delivery).
61
+ - **Owns:** gate enforcement in the pipeline, telemetry conventions, service-objective dashboards, rollback, the cost budget.
62
+ - **Done means:** the gate outcomes are enforced mechanically in the pipeline; instrumentation is required to pass the build gate; rollback is tested; objectives are observed after release.
63
+ - **Apply it:** wire the gate-fail protocol into the pipeline so a `HARD-STOP` is automatic, not a meeting, and shift security checks to setup rather than the end.
64
+
65
+ ## Security Engineer
66
+
67
+ - **Mission:** keep AI-written code from importing AI-shaped risk.
68
+ - **Leads:** the security thread. **Contributes to:** setup (allow-list, secret scanning), Specify (threat modeling), Build (scanning), AI governance.
69
+ - **Owns:** the dependency allow-list, the provenance and license record, the security report at each gate, the supply-chain policy.
70
+ - **Done means:** zero high-severity findings at the build gate; every AI-suggested dependency verified real and intended; generated and pulled-in code license-scanned.
71
+ - **Apply it:** assume the AI will at some point hardcode a secret and invent a package name; gate against both from setup, and keep security findings as `HARD-STOP`, never waivers.
72
+
73
+ ## Engineering Manager / Delivery Lead
74
+
75
+ - **Mission:** match intensity to risk, and protect verification capacity.
76
+ - **Leads:** profile selection and stage planning. **Contributes to:** unblocking every step; the loop (priorities).
77
+ - **Owns:** the chosen profile, the stage roadmap, the metrics dashboard.
78
+ - **Done means:** the team operates at an autonomy level its review capacity can sustain; metrics track the scarce things, not code volume; each stage exits on its real achievement, not a date.
79
+ - **Apply it:** choose the profile deliberately, and watch review throughput as the true measure of velocity — if AI output outpaces review, slow the engine rather than rushing the review.
80
+
81
+ ---
82
+
83
+ ## Responsibility matrix
84
+
85
+ `A` Accountable · `R` Responsible/Lead · `C` Consulted · `I` Informed
86
+
87
+ | Role | Setup | Specify | Scenarios | Contract | Tests | Build | Verify | Loop |
88
+ |------|:--:|:--:|:--:|:--:|:--:|:--:|:--:|:--:|
89
+ | Product / Domain | C | **R** | R | I | I | I | I | R |
90
+ | Architect / Lead | **R/A** | C | C | **R/A** | C | A | A | C |
91
+ | Engineer (Senior) | C | I | C | R | R | **R** | R | C |
92
+ | Engineer (Junior) | I | I | I | I | R | R | I | I |
93
+ | QA / Test | I | C | R | C | **R** | C | C | C |
94
+ | Designer | I | R (design) | R | C | I | I | I | I |
95
+ | DevOps / SRE | R | I | I | C | C | R | R | **R** |
96
+ | Security | R | C | I | C | C | R | R | C |
97
+ | EM / Delivery | C | C | C | C | C | C | C | C |
98
+
99
+ > If your role is only ever `I`, you are not yet using the method — find the step where your judgment *is* the gate.
@@ -0,0 +1,67 @@
1
+ # 13 · Adoption and onboarding
2
+
3
+ [← 12 Roles](./12-roles.md) · [Contents](./README.md) · Next: [14 The foundation →](./14-foundation.md)
4
+
5
+ How a team starts using AIDD, and how a new person becomes productive in it.
6
+
7
+ ---
8
+
9
+ ## A 90-day rollout
10
+
11
+ Adopt the method on one real product, not as an all-at-once mandate.
12
+
13
+ 1. **Days 1–15 — Set the foundation.** Stand up the one-time setup on one pilot service: conventions, glossary, dependency allow-list, model record, and the prompt playbook ([Appendix B](./appendix-b-prompts.md)).
14
+ 2. **Days 16–45 — One feature, end to end.** Run a single feature through the whole flow at the **Express** profile. Capture friction; tune the prompts' golden cases as you go.
15
+ 3. **Days 46–75 — Turn on the gates.** Wire the three reports and the gate-fail protocol into the pipeline; introduce the autonomy ladder at the generate-behind-gate level.
16
+ 4. **Days 76–90 — Promote.** Move the pilot to the **Standard** profile, draft the **Regulated** variant for any compliance-bound product, and publish the prompts as a shared, versioned playbook.
17
+
18
+ ## Choosing a profile
19
+
20
+ | Choose… | When… |
21
+ |---------|-------|
22
+ | **Express** | startup, spike, or internal tool; speed of learning dominates; small blast radius |
23
+ | **Standard** | a normal product with real users and ordinary risk |
24
+ | **Regulated** | finance, health, or anything audited; failure is expensive or legally consequential |
25
+
26
+ The choice is deliberate and owned by the delivery lead; different products can run at different profiles.
27
+
28
+ ## Onboarding: enter from the build end
29
+
30
+ The most common onboarding mistake is to start newcomers at the most abstract step. Specification and domain discovery require judgment a newcomer has not yet built. So bring people in from the *concrete* end and move them toward judgment:
31
+
32
+ 1. **Weeks 1–4 — Build and Tests.** Implement tasks against specs and contracts handed to you; write tests. Learn the architecture check and the evidence bundle.
33
+ 2. **Weeks 5–8 — Contract and design.** Start contributing to contracts and screen states; learn why the surface is frozen.
34
+ 3. **Weeks 9–12 — Scenarios and Specify.** Co-author scenarios and specs; practice removing ambiguity.
35
+ 4. **Beyond — Domain discovery.** The most abstract work comes last, once judgment is calibrated.
36
+
37
+ You graduate *up* the flow, from execution toward direction. Deciding what to build is the senior skill, not the entry skill.
38
+
39
+ ## Tool portability
40
+
41
+ The prompts are plain text that reference files in the repository, and the gates are enforced in the pipeline, not in the agent. So the method does not depend on any one AI coding tool — the agent is replaceable, the method is not. A conformant prompt is (1) tool-agnostic plain language, (2) anchored to repository files rather than chat memory, (3) self-describing about which model and exit criteria it assumes, and (4) checkable by the pipeline.
42
+
43
+ | Concern | Where it lives |
44
+ |---------|----------------|
45
+ | Prompt discovery | a folder convention in the repo (`playbook/`) |
46
+ | Context | repository files the prompt names explicitly |
47
+ | Gate enforcement | the build pipeline |
48
+
49
+ Switching tools changes the discovery convention and nothing structural.
50
+
51
+ ## First week, by role
52
+
53
+ | Role | First-week task |
54
+ |------|------------------|
55
+ | Product / Domain | run the Specify prompt on a real input; produce a glossary you would defend |
56
+ | Architect / Lead | stand up setup and freeze one contract; wire the architecture check into the pipeline |
57
+ | Engineer (Senior) | run the Build prompt on one small task; produce a full evidence bundle |
58
+ | Engineer (Junior) | take a handed-over spec; make a red test green without weakening it |
59
+ | QA / Test | convert one rule into a scenario, then a failing test |
60
+ | Designer | take a spec; produce flows, all screen states, and a clickable prototype |
61
+ | DevOps / SRE | wire one gate report into the pipeline; add secret-scan and allow-list to setup |
62
+ | Security | build the dependency allow-list; make security findings a `HARD-STOP` |
63
+ | EM / Delivery | choose the pilot's profile; stand up the review-throughput metric |
64
+
65
+ ---
66
+
67
+ > Adoption is a loop too. The method itself is a living document: every cycle should feed improvements back into your copy of these prompts and conventions.
@@ -0,0 +1,121 @@
1
+ # 14 · The foundation: project context across milestones
2
+
3
+ [← 13 Adoption](./13-adoption.md) · [Contents](./README.md) · Next: [Appendix A Templates →](./appendix-a-templates.md)
4
+
5
+ ---
6
+
7
+ ## The engine needs ground
8
+
9
+ The flow in [Part II](./02-the-flow.md) is the *engine*: Specify → Scenarios →
10
+ Contract → Tests → Build → Verify, run as a tight loop. TDD and ADD turn inside
11
+ that engine — write the failing test, let the AI generate code, repeat.
12
+
13
+ But an engine needs something to stand on. Every loop quietly assumes context that
14
+ no single task owns: *what the words mean*, *what we are building right now*, and
15
+ *how its users experience it*. When that context lives only in someone's head, each new session —
16
+ and each new milestone — starts cold, and the AI fills the gap with plausible
17
+ guesses. That is the same failure the method exists to prevent ([00](./00-introduction.md)),
18
+ one level up.
19
+
20
+ The **foundation** is the layer that holds this context and *outlives every
21
+ milestone*. It is not new ceremony; it is the [survivor layer](./appendix-f-requirements-matrix.md)
22
+ the method already names, made explicit as three concerns.
23
+
24
+ ## Three concerns, one foundation
25
+
26
+ ![The engine needs ground — the TDD ⇄ ADD engine runs on a DDD · SDD · UDD foundation: context feeds up, and any loop may send a correction back down](./add-foundation.png)
27
+
28
+ - **DDD — Domain.** The shared, precise language and the boundaries it lives in:
29
+ the core concepts, the modules/contexts they belong to, and the invariants that
30
+ must always hold — the domain model and context map behind the names. One name
31
+ per concept — the same names the spec, the contract, and the code all use. (The
32
+ [GLOSSARY](./appendix-c-glossary.md) holds the full term list; the foundation
33
+ holds the model those terms describe.)
34
+
35
+ - **SDD — Spec.** *The living document.* What is being built right now and what is
36
+ settled versus still open. This is not a frozen plan written once — it is the
37
+ layer that changes as the loop learns ([01](./01-principles.md)). In ADD it does
38
+ not duplicate the work; it **points** to the active milestone and the frozen
39
+ contracts that other tasks build against.
40
+
41
+ - **UDD — UI/UX.** *Users use the interface, not the spec.* The experience designed
42
+ before code: the **user flows** (happy and alternative paths), the **UI states**
43
+ every screen must handle (loading · empty · error · success), and a design source
44
+ of truth — a `DESIGN.md` or clickable prototype. The AI can generate a prototype
45
+ from a design system; a person owns the empathy — what the user is trying to do,
46
+ and what "good" feels like from their side. The scenarios ([04](./04-step-2-scenarios.md))
47
+ test that behaviour; the foundation keeps the design intent that makes a screen
48
+ worth building.
49
+
50
+ These three foundation competencies, together with the **TDD ⇄ ADD** engine of
51
+ [Part II](./02-the-flow.md), are ADD's five. The first four feed context to the
52
+ fifth, where the AI executes on it:
53
+
54
+ ![ADD's five competencies — DDD · SDD · UDD · TDD · ADD: the first four are human-led and feed context to ADD, which is AI-led under your direction](./add-competencies.png)
55
+
56
+ > The diagram's foundation (DDD · SDD · UDD) and the method's own words — survivor
57
+ > layer · living document · ubiquitous language — name the same three ideas. This
58
+ > chapter is where the diagram and the text finally meet.
59
+
60
+ ## One file, not three
61
+
62
+ A foundation that takes a week to write is a foundation no one keeps current. So
63
+ ADD realizes all three concerns as **one survivor document — `PROJECT.md`** — with
64
+ one short section each, plus an append-only record of key decisions:
65
+
66
+ ```
67
+ .add/PROJECT.md
68
+ ## Domain (DDD) — concepts · contexts · invariants
69
+ ## Spec / Living Document (SDD)— → active milestone + frozen contracts
70
+ ## Users (UDD) — UI/UX: user flows · states · DESIGN.md / prototype
71
+ ## Key Decisions — append-only: date · decision · why · outcome
72
+ ```
73
+
74
+ Keep it to one screen. If a section wants to grow into a manual, that is a signal
75
+ the detail belongs in a milestone or a contract, not the foundation. The foundation
76
+ is the *thin, durable* context the engine reads first — not a place to relocate the
77
+ work.
78
+
79
+ ## How it feeds the engine — and takes feedback back
80
+
81
+ The arrow runs both ways, which is the whole point of a re-entrant method:
82
+
83
+ - **Down → up.** At the start of any session or milestone, read `PROJECT.md`
84
+ before touching a task. It is the cheapest way to point the AI in the right
85
+ direction. `add.py status` prints a pointer to it for exactly this reason.
86
+ - **Up → down.** When a loop reveals that the domain model was wrong, the spec
87
+ stance has shifted, or a user assumption did not survive contact with reality,
88
+ you **stop and update the foundation** — then come forward again. A passing test
89
+ built on a broken foundation is still the wrong software, fast.
90
+
91
+ ## Where it sits in the hierarchy
92
+
93
+ The foundation is the **Project tier** of the document hierarchy
94
+ ([Appendix F](./appendix-f-requirements-matrix.md)) — created once, kept for the
95
+ life of the product, owned above any single milestone.
96
+
97
+ ![Three tiers of documents — Project (the foundation, .add/PROJECT.md) → Milestone → Task: scope narrows and lifespan shortens down the stack](./add-hierarchy.png)
98
+
99
+ | Tier | Lives in | Lifespan | Holds |
100
+ |------|----------|----------|-------|
101
+ | **Project** (foundation) | `.add/PROJECT.md` + survivor files | whole product | domain, spec stance, users, decisions |
102
+ | **Milestone** | `.add/milestones/<slug>/MILESTONE.md` | one depth-bounded goal | scope, shared contracts, exit criteria |
103
+ | **Task** | `.add/tasks/<slug>/TASK.md` | one feature | the seven-step artifacts |
104
+
105
+ A milestone is a *version bump* to the foundation, not a fresh start: when it
106
+ closes, fold what it validated into `PROJECT.md` (a decision, a settled domain
107
+ term, a confirmed user journey) and open the next one against the same, now-richer,
108
+ ground.
109
+
110
+ ## In the tooling
111
+
112
+ - `add.py init` scaffolds `PROJECT.md` as a survivor file — and, like every
113
+ survivor file, **never overwrites a hand-edited one**.
114
+ - `add.py status` shows a one-line pointer to the foundation, so a fresh session
115
+ re-orients on context before code.
116
+ - The guideline block written into `CLAUDE.md` / `AGENTS.md` tells any agent the
117
+ same thing: run `status`, read the foundation, then work the loop.
118
+
119
+ > **The thesis, one level up.** The engine builds the thing right; the foundation
120
+ > keeps the engine pointed at the right thing — across every milestone, not just
121
+ > the current one.
package/docs/README.md ADDED
@@ -0,0 +1,70 @@
1
+ # AI-Driven Development
2
+
3
+ ### A complete, practical book on building software when AI writes the code
4
+
5
+ **Edition:** 1.0 · **Type:** Methodology + operating manual
6
+
7
+ ---
8
+
9
+ ## What this book is
10
+
11
+ This is a complete guide to **AIDD (AI-Driven Development)** — a way of building software in which an AI agent writes most of the code and people do the two things AI cannot reliably do alone: decide *what* to build, and *verify* that what was built is correct.
12
+
13
+ It is written to be read once front to back, then kept open beside you as a working manual. The early chapters explain *why* the method has the shape it does; the middle chapters explain each step in detail; the later chapters explain how to operate it across a real team and product; the appendices are copy-paste reference material.
14
+
15
+ A single worked example — *transferring money between a user's own accounts* — runs through the entire book so that every abstract step has a concrete form you can see.
16
+
17
+ ## Who it is for
18
+
19
+ Anyone who builds software with AI in the loop: engineers, architects, testers, designers, product owners, and the managers who lead them. No part assumes you have read the others; cross-references point you to what you need.
20
+
21
+ ## The method in one paragraph
22
+
23
+ For every feature, before AI writes any code, you write four short artifacts in order — the rules it must obey, those rules as pass/fail scenarios, the data and interface contract, and the failing tests — and then you direct the AI to make the tests pass without changing them, and finally you verify the result through evidence rather than inspection. That ordered set of artifacts *is* the method. The code is disposable; the artifacts are the durable asset. Direction comes before speed, and trust comes from passing tests rather than from reading code and finding it plausible.
24
+
25
+ ## The flow
26
+
27
+ > **Specify → Scenarios → Contract → Tests → Build → Verify → observe, then repeat.**
28
+
29
+ ---
30
+
31
+ ## Table of contents
32
+
33
+ **Part I — Foundations**
34
+ - [00 · The shift: why AIDD exists](./00-introduction.md)
35
+ - [01 · Core principles](./01-principles.md)
36
+ - [02 · The flow, and what is disposable](./02-the-flow.md)
37
+
38
+ **Part II — The method, step by step**
39
+ - [03 · Step 1 — Specify](./03-step-1-specify.md)
40
+ - [04 · Step 2 — Scenarios](./04-step-2-scenarios.md)
41
+ - [05 · Step 3 — Contract](./05-step-3-contract.md)
42
+ - [06 · Step 4 — Tests](./06-step-4-tests.md)
43
+ - [07 · Step 5 — Build](./07-step-5-build.md)
44
+ - [08 · Step 6 — Verify](./08-step-6-verify.md)
45
+ - [09 · The loop — observe and learn](./09-the-loop.md)
46
+
47
+ **Part III — Operating the method**
48
+ - [10 · Project setup and stages](./10-setup-and-stages.md)
49
+ - [11 · Governance](./11-governance.md)
50
+ - [12 · Roles and responsibilities](./12-roles.md)
51
+ - [13 · Adoption and onboarding](./13-adoption.md)
52
+ - [14 · The foundation: project context across milestones](./14-foundation.md)
53
+
54
+ **Part IV — Reference**
55
+ - [Appendix A · Templates](./appendix-a-templates.md)
56
+ - [Appendix B · Prompt library](./appendix-b-prompts.md)
57
+ - [Appendix C · Glossary](./appendix-c-glossary.md)
58
+ - [Appendix D · The worked example, end to end](./appendix-d-worked-example.md)
59
+ - [Appendix E · Checklists](./appendix-e-checklists.md)
60
+ - [Appendix F · Document requirements matrix (Project → Milestone → Task)](./appendix-f-requirements-matrix.md)
61
+
62
+ ---
63
+
64
+ ## Conventions used in this book
65
+
66
+ - **▶ Example** marks the running worked example.
67
+ - **Do / Don't** boxes give the rule in its shortest form.
68
+ - A **gate** is a checkpoint with an explicit pass/fail exit. Its outcome is always one of `PASS`, `RISK-ACCEPTED` (a signed waiver), or `HARD-STOP`.
69
+ - File names like `SPEC.md`, `features/*.feature`, `contracts/*` refer to the artifacts you create per feature; see [Appendix A](./appendix-a-templates.md).
70
+ - Where this book uses a plain step name, the formal phase name (for teams mapping to a larger standard) appears once in [Appendix C](./appendix-c-glossary.md).
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,88 @@
1
+ # Appendix A · Templates
2
+
3
+ [← 13 Adoption](./13-adoption.md) · [Contents](./README.md) · Next: [Appendix B Prompts →](./appendix-b-prompts.md)
4
+
5
+ Copy-paste blanks. Project-level templates are filled once at setup; feature-level templates are filled once per feature.
6
+
7
+ ---
8
+
9
+ ## Project-level (set up once)
10
+
11
+ ### `CONVENTIONS.md`
12
+ ```
13
+ Language/framework: <e.g. Python 3.12 / FastAPI>
14
+ Folders: src/ tests/ contracts/ features/ playbook/
15
+ Naming: <file case>, <type case>, verbs for functions
16
+ Lint/format: <tools>, enforced in the pipeline
17
+ Errors: machine-readable error codes (string enums), never free text
18
+ Architecture: <layering and dependency rules>
19
+ ```
20
+
21
+ ### `MODEL_REGISTRY.md`
22
+ ```
23
+ Model: <name>
24
+ Version: <version/date>
25
+ Adopted: <date>
26
+ Notes: re-run the prompt golden-cases before changing this.
27
+ ```
28
+
29
+ ### `dependencies.allowlist`
30
+ ```
31
+ # one package per line; the pipeline rejects anything not listed
32
+ <package>==<version-or-range>
33
+ ```
34
+
35
+ ---
36
+
37
+ ## Feature-level (once per feature)
38
+
39
+ ### `SPEC.md`
40
+ ```
41
+ Feature: <name>
42
+ Framings weighed: <chosen> (chosen) · <alternative> · <alternative>
43
+ Must:
44
+ - <required behavior>
45
+ Reject:
46
+ - <bad input / situation> -> "<error_code>"
47
+ After:
48
+ - <state true once it succeeds>
49
+ Assumptions — least-sure first:
50
+ ⚠ <most-likely-wrong assumption> — least sure because <why>; if wrong: <cost>
51
+ - [x] <confirmed / low-stakes assumption> — <one line>
52
+ ```
53
+
54
+ ### `features/<name>.feature`
55
+ ```
56
+ Scenario: <short name>
57
+ Given <starting situation>
58
+ When <action>
59
+ Then <expected result>
60
+ And <what must remain unchanged> # when relevant
61
+ ```
62
+
63
+ ### `contracts/<name>.md`
64
+ ```
65
+ <METHOD> <path> body: { <fields> }
66
+ 200 -> { <success fields> }
67
+ 4xx -> { error: "<code>" | "<code>" }
68
+ Schema: <tables/fields touched, and access pattern>
69
+ Status: FROZEN @ v<n>
70
+ ```
71
+
72
+ ### `tests/<name>_test.<ext>` (stub)
73
+ ```
74
+ test_<scenario_name>:
75
+ arrange: <set up the Given>
76
+ act: <do the When>
77
+ assert: <check the Then>
78
+ assert: <check what must stay unchanged> # when relevant
79
+ ```
80
+
81
+ ### Gate outcome record
82
+ ```
83
+ Feature: <name> Step: <Specify|...|Verify> Date: <date>
84
+ Reports: Test=<pass/fail> Quality=<pass/fail> Risk=<summary>
85
+ Outcome: <PASS | RISK-ACCEPTED | HARD-STOP>
86
+ If RISK-ACCEPTED -> owner: <name> ticket: <link> expires: <date>
87
+ Reviewed by: <name>
88
+ ```