@pilotspace/add 1.17.0 → 2.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 (114) hide show
  1. package/CHANGELOG.md +144 -0
  2. package/GETTING-STARTED.md +20 -64
  3. package/README.md +128 -56
  4. package/agents/add.md +68 -0
  5. package/bin/cli.js +86 -21
  6. package/package.json +2 -3
  7. package/personas-teacher/VENDOR.md +6 -0
  8. package/skill/add/SKILL.md +100 -134
  9. package/skill/add/adopt.md +28 -0
  10. package/skill/add/beyond.md +36 -0
  11. package/skill/add/deltas.md +25 -2
  12. package/skill/add/design.md +56 -74
  13. package/skill/add/{report-template.md → gate-udd.md} +28 -38
  14. package/skill/add/intake.md +56 -25
  15. package/skill/add/loop.md +32 -19
  16. package/skill/add/phases/build.md +78 -0
  17. package/skill/add/phases/direction.md +280 -0
  18. package/skill/add/phases/verify.md +160 -0
  19. package/skill/add/run.md +11 -18
  20. package/skill/add/terms.md +18 -0
  21. package/tooling/add.py +2383 -3261
  22. package/tooling/add_engine/autonomy.py +2 -37
  23. package/tooling/add_engine/components.py +4 -87
  24. package/tooling/add_engine/constants.py +145 -91
  25. package/tooling/add_engine/guidelines.py +9 -11
  26. package/tooling/add_engine/io_state.py +69 -2
  27. package/tooling/add_engine/predicates.py +90 -2
  28. package/tooling/add_engine/search.py +6 -6
  29. package/tooling/add_engine/taskdoc.py +15 -10
  30. package/tooling/templates/CONVENTIONS.md.tmpl +1 -1
  31. package/tooling/templates/GLOSSARY.md.tmpl +10 -4
  32. package/tooling/templates/MILESTONE.md.tmpl +20 -16
  33. package/tooling/templates/PLAN.md.tmpl +128 -0
  34. package/tooling/templates/PROJECT.md.tmpl +6 -1
  35. package/tooling/templates/PROMPT.persona.md.tmpl +17 -21
  36. package/tooling/templates/personas/_template.md.tmpl +33 -29
  37. package/tooling/templates/personas/build-engineer.md.tmpl +45 -0
  38. package/tooling/templates/personas/data-steward.md.tmpl +45 -0
  39. package/tooling/templates/personas/evidence-verifier.md.tmpl +45 -0
  40. package/tooling/templates/personas/platform-engineer.md.tmpl +45 -0
  41. package/tooling/templates/personas/product-lead.md.tmpl +51 -0
  42. package/tooling/templates/personas/quality-auditor.md.tmpl +47 -0
  43. package/tooling/templates/personas/release-manager.md.tmpl +52 -0
  44. package/tooling/templates/personas/security-gatekeeper.md.tmpl +45 -0
  45. package/tooling/templates/personas/software-architect.md.tmpl +45 -0
  46. package/tooling/templates/personas/stream-orchestrator.md.tmpl +44 -0
  47. package/tooling/templates/personas/technical-writer.md.tmpl +49 -0
  48. package/tooling/templates/personas/ux-experience-lead.md.tmpl +48 -0
  49. package/tooling/templates/specs/SPEC.md.tmpl +18 -0
  50. package/tooling/templates/udd-wireframe.md +1 -1
  51. package/agents/add-advisor.md +0 -31
  52. package/agents/add-build.md +0 -29
  53. package/agents/add-design.md +0 -32
  54. package/agents/add-persona.md +0 -33
  55. package/agents/add-verify.md +0 -36
  56. package/docs/00-introduction.md +0 -46
  57. package/docs/01-principles.md +0 -71
  58. package/docs/02-the-flow.md +0 -113
  59. package/docs/03-step-1-specify.md +0 -123
  60. package/docs/04-step-2-scenarios.md +0 -90
  61. package/docs/05-step-3-contract.md +0 -80
  62. package/docs/06-step-4-tests.md +0 -85
  63. package/docs/07-step-5-build.md +0 -82
  64. package/docs/08-step-6-verify.md +0 -105
  65. package/docs/09-the-loop.md +0 -75
  66. package/docs/10-setup-and-stages.md +0 -118
  67. package/docs/11-governance.md +0 -91
  68. package/docs/12-roles.md +0 -99
  69. package/docs/13-adoption.md +0 -67
  70. package/docs/14-foundation.md +0 -142
  71. package/docs/15-foundations-and-lineage.md +0 -106
  72. package/docs/16-releasing.md +0 -182
  73. package/docs/17-components.md +0 -143
  74. package/docs/18-personas.md +0 -80
  75. package/docs/README.md +0 -77
  76. package/docs/add-competencies.png +0 -0
  77. package/docs/add-flow.png +0 -0
  78. package/docs/add-foundation.png +0 -0
  79. package/docs/add-hierarchy.png +0 -0
  80. package/docs/add-milestone-task-lifecycle.png +0 -0
  81. package/docs/add-task-growth-wheel.png +0 -0
  82. package/docs/appendix-a-templates.md +0 -88
  83. package/docs/appendix-b-prompts.md +0 -154
  84. package/docs/appendix-c-glossary.md +0 -176
  85. package/docs/appendix-d-worked-example.md +0 -231
  86. package/docs/appendix-e-checklists.md +0 -92
  87. package/docs/appendix-f-requirements-matrix.md +0 -171
  88. package/docs/appendix-g-references.md +0 -106
  89. package/skill/add/advisor.md +0 -81
  90. package/skill/add/compact-foundation.md +0 -40
  91. package/skill/add/components.md +0 -52
  92. package/skill/add/confidence.md +0 -32
  93. package/skill/add/fold.md +0 -63
  94. package/skill/add/graduate.md +0 -39
  95. package/skill/add/phases/0-ground.md +0 -64
  96. package/skill/add/phases/0-setup.md +0 -103
  97. package/skill/add/phases/1-specify.md +0 -61
  98. package/skill/add/phases/2-scenarios.md +0 -48
  99. package/skill/add/phases/3-contract.md +0 -60
  100. package/skill/add/phases/4-tests.md +0 -61
  101. package/skill/add/phases/5-build.md +0 -62
  102. package/skill/add/phases/6-verify.md +0 -69
  103. package/skill/add/phases/7-observe.md +0 -45
  104. package/skill/add/phases/fast-lane.md +0 -34
  105. package/skill/add/release.md +0 -61
  106. package/skill/add/scope.md +0 -72
  107. package/skill/add/self-improve.md +0 -20
  108. package/skill/add/sensitivity.md +0 -51
  109. package/skill/add/setup-review.md +0 -48
  110. package/skill/add/soul.md +0 -58
  111. package/skill/add/streams.md +0 -269
  112. package/tooling/add_engine/release.py +0 -86
  113. package/tooling/templates/TASK.fast.md.tmpl +0 -78
  114. package/tooling/templates/TASK.md.tmpl +0 -181
@@ -1,106 +0,0 @@
1
- # 15 · Foundations & Lineage
2
-
3
- [← 14 The foundation](./14-foundation.md) · [Contents](./README.md) · Next: [Appendix A Templates →](./appendix-a-templates.md)
4
-
5
- ---
6
-
7
- ADD did not appear from nowhere. It sits where four currents meet: the **recursive
8
- self-improvement** thesis (AI that helps build the next AI), a decade of **autonomous and
9
- agentic** research, the **spec-driven development** movement (the specification, not the
10
- code, is the source of truth), and the **tests-first** discipline that constrains a
11
- generate→check→refine loop with executable tests — turning fluent model output into
12
- trustworthy software. This chapter tells that story; [Appendix G](./appendix-g-references.md)
13
- is the verified source list it cites into. Every `[Author Year]` here resolves to an entry
14
- there.
15
-
16
- ## The frame — "closing the loop"
17
-
18
- Anthropic's recursive-self-improvement picture runs from autonomous agents delegating to
19
- workers *today* toward a future where Claude improves Claude — *closing the loop* on the
20
- work of building AI itself [Favaro & Clark 2026]. That is the backdrop ADD is built for, and
21
- its position inside that picture is deliberately narrow: ADD is a **human-gated,
22
- evidence-trusted** instance of recursive self-improvement. The AI drives the whole inner
23
- cycle — specify → build → verify → observe — but a human owns the frozen contract and the
24
- verify gate, and trust comes from passing tests and re-resolved evidence, never from a
25
- diff that merely reads plausibly. The argument is not that the loop should stay open
26
- forever; it is that the loop should be *bounded by human direction* rather than left to run
27
- unattended [Amodei 2024]. ADD is one concrete shape for that bound.
28
-
29
- ## The four currents
30
-
31
- **Recursive self-improvement.** The mathematical anchor is the Gödel machine — a
32
- self-modifying agent that rewrites itself *only when it can prove the rewrite helps*
33
- [Schmidhuber 2003]. ADD enforces the same discipline socially rather than formally: the
34
- never-weaken-a-test rule is "only change on proof" expressed as a gate. The algorithmic kin
35
- arrived later — a scaffolding program that improves the code that improves code
36
- [Zelikman et al. 2023], a generate→critique→refine micro-loop [Madaan et al. 2023], agents
37
- that keep verbal reflections and retry [Shinn et al. 2023], an agent that grows a reusable
38
- skill library over time [Wang et al. 2023], and an evolutionary coder that beat a
39
- long-standing matrix-multiplication record under continuous checking
40
- [Novikov et al. 2025]. And where a self-rewarding loop has the model judge its own reward
41
- [Yuan et al. 2024], ADD diverges by design — it makes the tests and a human the reward
42
- signal, not the model's own opinion.
43
-
44
- **Autonomous and agentic workflows.** The architecture vocabulary comes from the canonical
45
- taxonomy of prompt-chaining, routing, orchestrator-workers, and the evaluator-optimizer loop
46
- [Schluntz & Zhang 2024] — where evaluator-optimizer *is* build→verify→refine and
47
- orchestrator-workers is ADD's wave parallelism. Underneath it sit the base agent loop of
48
- interleaved think→act→observe [Yao et al. 2022], the self-supervised tool use that lets an
49
- agent run its own tests and builds [Schick et al. 2023], and the designed agent–computer
50
- interface that materially lifts autonomous issue resolution [Yang et al. 2024] — the role
51
- ADD's `add.py` engine plays for the method. The production reports close the gap from theory
52
- to practice: checkpoints, subagents, and rollback for autonomous work [Anthropic 2025a], and
53
- a lead orchestrating subagents under an LLM judge [Anthropic 2025b].
54
-
55
- **Spec-driven development.** ADD's closest siblings are explicit specification systems.
56
- GitHub's **spec-kit** runs `constitution` → `specify` → `plan` → `tasks` → `implement` with
57
- the spec as the executable source of truth [GitHub 2025]; its launch framed task
58
- decomposition as "TDD for your AI agent" [Delimarsky 2025], and its rationale named the
59
- failure spec-driven work exists to solve — context degrading over a long session
60
- [Vesely 2025]. The academic vocabulary followed, with a taxonomy of Spec-First,
61
- Spec-Anchored, and Spec-as-Source rigor [Piskala 2026], and the pattern is converging across
62
- vendors [InfoQ 2025]. Nearest of all is **GSD** — a spec-driven, context-engineering system
63
- for the same Claude-Code niche [GSD 2025].
64
-
65
- **Tests-first and verification.** The empirical backbone is direct: supplying tests
66
- alongside the prompt measurably lifts pass rates [Mathews & Nagappan 2024], and the field's
67
- yardstick judges a fix solely by whether the project's own tests pass [Jimenez et al. 2023].
68
- "Done" means the tests pass — which is exactly how ADD gates a feature. The safety framing
69
- completes the current: human control and transparency made concrete [Anthropic 2025c], under
70
- a governance ceiling that grows *more* binding, not less, as the loop gets more capable
71
- [Anthropic 2026b].
72
-
73
- ## Where ADD diverges
74
-
75
- The shared lineage is real, but ADD is not a re-skin of its siblings. spec-kit stops at
76
- `implement`; GSD ends at verify. ADD closes the loop past both by adding three things
77
- neither spec-kit [GitHub 2025] nor GSD [GSD 2025] carries as a first-class gate:
78
-
79
- - a **failing-tests-first gate** — no build starts until the tests are red for the right
80
- reason, so the contract is proven executable before any code exists;
81
- - an **observe → `fold`** step — confirmed lessons learned consolidate back into a versioned
82
- foundation, so the method improves itself across loops (retrospective consolidation is the
83
- recursive-self-improvement current turned inward on ADD);
84
- - a **dynamic goal-loop** — the engine holds a milestone open and reopens tasks until its
85
- exit criteria are met, rather than declaring done when a checklist empties.
86
-
87
- ADD also deliberately targets **less doc-time than GSD** — a lean foundation and one human
88
- approval per task instead of a document per phase. The tests-first gate, the `fold`, and the
89
- goal-loop are ADD's contribution; everything beneath them is inherited.
90
-
91
- ## The evidence chain — the loop already runs
92
-
93
- The case that this is not speculative rests on three measured facts. First, the task
94
- time-horizon: the length of work models complete unaided keeps doubling [Favaro & Clark 2026].
95
- Second, the authorship share: by 2026 more than 80% of the code merged at Anthropic was
96
- Claude-authored [Favaro & Clark 2026]. Third, the **Automated Alignment Researchers** result:
97
- nine parallel Claude agents recovered roughly 97% of the human-expert gap on an alignment task
98
- in five days against the human team's seven [Anthropic 2026a] — parallel agents working under
99
- review, which is precisely ADD's wave-plus-verify shape. The loop already runs.
100
-
101
- What it does *not* yet supply is the discipline to trust the output. That is ADD's
102
- contribution: the frozen contract, the never-weaken-a-test rule, the evidence-over-inspection
103
- gate, and the security HARD-STOP that no autonomy level may auto-pass [Anthropic 2025c],
104
- held beneath the responsible-scaling governance ceiling [Anthropic 2026b]. As the loop grows
105
- more capable, those gates and the human-owned verify matter more, not less. ADD is the human-gated, evidence-trusted way to stand inside the
106
- closing loop and still own the result.
@@ -1,182 +0,0 @@
1
- # 16 · Releasing
2
-
3
- [← 15 Foundations & Lineage](./15-foundations-and-lineage.md) · [Contents](./README.md) · Next: [17 Components →](./17-components.md)
4
-
5
- ---
6
-
7
- The flow chapters ([03](./03-step-1-specify.md)–[08](./08-step-6-verify.md)) take one feature from
8
- spec to verified. The loop chapter ([09](./09-the-loop.md)) keeps a milestone going until its goal
9
- is met. The stages chapter ([10](./10-setup-and-stages.md)) graduates the project's rigor. None of
10
- them *ship*. This chapter names the act every project eventually performs and that the method, until
11
- now, never formalized: bundling closed milestones into a versioned, user-facing release whose notes
12
- are evidence-backed, whose risk is disclosed, and whose behaviour is then watched.
13
-
14
- Releasing is the **fifth scope level** — after setup, intake, the milestone loop, and stage graduation.
15
- Like every scope level it runs the same shape: **gather → propose → the human
16
- confirms → the engine records and enforces a floor.** And like graduation, it ends with an outward
17
- act the human owns. The operational recipe lives in the `release.md` skill guide; this chapter is the
18
- *why* behind it.
19
-
20
- ## 16.1 · Why release is its own scope level
21
-
22
- A number bump is not a release. A release is the moment one or more **closed milestones** become a
23
- versioned cut that real users can run. Three distinctions make it its own scope level:
24
-
25
- - **Milestone ≠ release.** A milestone is *feature-complete and consolidated* — its goal is met and
26
- its lessons are gathered into the foundation (see [14 · The foundation](./14-foundation.md) and the
27
- `fold.md` retrospective consolidation). A release is *shipped and watched*. The first is an internal
28
- state; the second faces outward.
29
- - **Graduation ≠ release.** Stage graduation moves the project's *rigor* (mvp → production); a release
30
- ships a *version*. The two axes are orthogonal: you cut a prototype preview, an mvp beta, and a
31
- production GA, each at its own stage. You release at every stage, not only at the end.
32
- - **A release bundles; it does not equal.** One version may attribute several milestones — "we shipped
33
- after a couple of milestones closed" is the normal case, not the exception. Forcing one release per
34
- milestone is the anti-pattern; the decoupling is the whole point.
35
-
36
- So release sits beside the other scope levels rather than inside any of them. The granularity ladder
37
- is now complete: intake → milestone → task, with stage graduation and release as the two cross-cutting
38
- levels that change *rigor* and ship *versions* respectively (see the **Scope level** entry in
39
- [Appendix C](./appendix-c-glossary.md)).
40
-
41
- ## 16.2 · The cue and the inventory — gather, never judge
42
-
43
- The trigger is a status line. When at least one milestone is `done`, archived, and not yet attributed
44
- to any release, `add.py status` prints:
45
-
46
- ```
47
- → releasable: N milestone(s) closed since last release
48
- ```
49
-
50
- That line is a **tally**, never a verdict. It counts archived-but-unreleased milestones; it is silent
51
- for a project that has never released or has already shipped everything (grandfathered — zero change).
52
- It says *there is something to consider*, not *you are ready*.
53
-
54
- To gather the cut's evidence, run `add.py release-report`. It clusters five labeled record-sets: the
55
- closed milestones since the last release · their **consolidated deltas** (the "what changed" record) ·
56
- the open `RISK-ACCEPTED` waivers riding into the release · any open security `HARD-STOP` (a blocker) ·
57
- the §2 scenarios to take live as monitors. The report **gathers; it does not judge** — there is no
58
- readiness score to read off, because a tally that pretended to be a verdict would invite reading the
59
- number instead of the evidence.
60
-
61
- The reuse claim, stated plainly: **the consolidated deltas are the changelog source.** You do not write
62
- release notes from memory. The foundation already recorded what changed when each milestone was
63
- consolidated (`fold.md`); the release surfaces it. This is why release runs *after* consolidation, not
64
- before. The lifecycle order is one line:
65
- `milestone-done → fold → compact → archive → (repeat ≥1×) → release → watch`.
66
-
67
- ## 16.3 · Drafting the notes and the version — the proposal
68
-
69
- From those record-sets you draft a [Keep a Changelog](https://keepachangelog.com/) entry: group the
70
- changes under Added / Changed / Fixed and name the headline capabilities concretely, in the user's
71
- language, not the commit's. Each bundled milestone's goal anchors one or more entries.
72
-
73
- Then propose the version. Semver is a decision the evidence informs but does not make for you: a
74
- breaking change is a MAJOR, a new capability a MINOR, a fix-only cut a PATCH. You propose the bump; the
75
- **human confirms it** — the version is a judgement, not a default the tool fills in.
76
-
77
- Both the notes and the version are *shown before they are asked about*. Present the drafted entry, the
78
- proposed version, and the waivers shipping in this cut via the report template — opening with the ARC
79
- (goal · done · plan) — and let the human approve once. The question is a summary to decide on; the
80
- artifact itself is rendered first, never pre-stamped.
81
-
82
- ## 16.4 · The floor — what the engine enforces
83
-
84
- `add.py release <version>` is **guarded**. Before it records anything it enforces a readiness floor,
85
- refusing with a non-zero exit and leaving every file byte-unchanged on any of four conditions:
86
-
87
- - `release_security_open` — an open security `HARD-STOP` exists. This is the non-negotiable one: a
88
- security finding is never shipped. Resolve it first, as a change request back to Specify.
89
- - `release_build_in_flight` — a build is in flight: a task sits in build/verify with no recorded green gate. A release ships on evidence, not on a plausible diff.
90
- - `release_no_closed_milestone` — nothing new since the last release. The cut would be a no-op; do not
91
- bump a version to mark time.
92
- - `release_undisclosed_waiver` — a `RISK-ACCEPTED` waiver rides into the release but is missing from the
93
- notes. Disclosure *is* the floor: a shipped risk the user cannot read about is a hidden risk.
94
-
95
- The security stop is **un-forceable.** `--force` exists for grandfathered and brownfield first-cuts —
96
- the same authority valve as `stage --force` ([10 · Setup and stages](./10-setup-and-stages.md)) — and
97
- it can override the other three rejects, but it can never override `release_security_open`. This mirrors
98
- the verify gate exactly ([08 · Verify](./08-step-6-verify.md)) and the governance ceiling that no
99
- autonomy level may lift ([11 · Governance](./11-governance.md)): a security `HARD-STOP` is the one
100
- outcome the method refuses to auto-pass, at verify and again at the cut.
101
-
102
- ## 16.5 · The cut versus the ship — the engine records, the human ships
103
-
104
- Only after the human confirms do you run the cut. And here is the line that keeps releasing honest:
105
- **the engine records; the human ships.**
106
-
107
- `add.py release <version>` **records** the marker. It prepends the entry to `CHANGELOG.md`, stamps one
108
- append-only row (newest-first, like the §Key Decisions log) into `RELEASES.md` — date · version ·
109
- milestones · waivers shipped · evidence — and attributes the bundled milestones to this version, so the
110
- cue stops firing for them. The ledger is the attribution source: a milestone is "released" because a
111
- `RELEASES.md` row says so, never because a file was edited to claim it.
112
-
113
- What the engine does **not** do is act outward. It **never tags, publishes, or deploys.** The outward
114
- act — `git tag`, `npm publish`, the deploy pipeline — is the human's, tool-agnostic, exactly as the
115
- method tool "never renders" in design and "never spawns" a subagent. Design-for-failure — timeouts,
116
- retries, rollback, a tested revert path — belongs in the pipeline the human owns, not in a method tool
117
- that has no business holding deploy credentials. The tag is the human-gated trigger; the record is the
118
- engine's receipt that the floor was met.
119
-
120
- > **A caveat worth one paragraph.** `add.py release` writes `CHANGELOG.md` at the **project root**. That
121
- > is the right default for most repositories. But a repo with a different changelog convention — for
122
- > instance a **nested-package** layout whose root `CHANGELOG.md` is a deliberate pointer to a package's
123
- > own changelog — will get release blocks *prepended above* its existing content rather than replacing
124
- > it (the writer preserves what is there; it does not clobber). Reconcile per repo: either let the root
125
- > file carry the canonical log, or point the human's publish step at the package changelog the team
126
- > treats as the source of truth.
127
-
128
- ## 16.6 · Watch and the hotfix path — re-entering observe
129
-
130
- A release is not the finish line; it is where the most reliable information finally appears. The §2
131
- scenarios that were pass/fail cases at build time become **live monitors** for the released version, and
132
- error-budget burn feeds the next loop. Live-registry and deploy confirmation are post-cut *evidence*,
133
- gathered after the tag — not unit tests pretending to be one.
134
-
135
- The unhappy path is first-class. A regression found in the wild re-enters at Specify as a **change
136
- request**, which narrows to a **hotfix release** — the same seven-step flow, scoped to the fix, cut as a
137
- PATCH. Releasing does not have a separate emergency mode; it has the ordinary flow at a tighter scope.
138
-
139
- Depth follows the stage, as everywhere in the method:
140
-
141
- - **prototype / poc** — a one-line preview note and a tag; no deploy ceremony. The point is feedback.
142
- - **mvp** — full notes, a tag, a guarded publish; watch the headline scenarios.
143
- - **production** — every step at full rigor: notes, tag, a deploy behind a rollback-tested pipeline,
144
- live scenario monitors, and error-budget watch. The hotfix path is a routine capability here, not a
145
- fire drill.
146
-
147
- ## 16.7 · The flow, in one arc
148
-
149
- One arc, seven steps:
150
-
151
- **cue → gather → draft notes → readiness floor → human confirms → cut → watch**
152
-
153
- 1. **cue** — `add.py status` prints `→ releasable: N` when an archived milestone is unreleased.
154
- 2. **gather** — `add.py release-report` clusters the five record-sets (gather, never judge).
155
- 3. **draft notes** — a Keep-a-Changelog entry drawn from the consolidated deltas; propose the version.
156
- 4. **readiness floor** — the four guarded rejects; the security stop is un-forceable.
157
- 5. **human confirms** — the notes, version, and waivers are shown, then approved once.
158
- 6. **cut** — `add.py release <version>` records the CHANGELOG block + the `RELEASES.md` row + attribution.
159
- 7. **watch** — the scenarios become monitors; a wild regression becomes a PATCH hotfix release.
160
-
161
- The recipe for each step — flags, the report's `--json` shape, the exact ledger row — lives in the
162
- `release.md` skill guide. This chapter is the reasoning; the guide is the procedure.
163
-
164
- ## 16.8 · Worked example — this method's own 1.5.0
165
-
166
- The repository already runs this by hand, which is the best evidence the flow is real. The
167
- `udd-design-loop` milestone closed (4/4) and consolidated into `foundation-version 33`. From those
168
- deltas the human drafted the `## [1.5.0]` changelog entry, bumped the three version sources in
169
- lockstep, and a forward-pinned `test_release_1_5_0.py` asserted in-repo readiness: the versions agree,
170
- the changelog lineage survives, the feature anchors are named, and the engine is untouched by the
171
- release. The cut itself — the `git tag` that triggers the npm and PyPI publish — stayed human-gated,
172
- and the live-registry confirmation was gathered *after* the tag as verify evidence, never as a unit
173
- test.
174
-
175
- That ritual is what this chapter formalizes. `release-report` gathers the inventory, the floor enforces
176
- the security stop and the disclosures, `add.py release` records the cut, and the human still owns the
177
- tag. The method releases itself the way it asks every project to release: gather the evidence, disclose
178
- the risk, record the marker, and let a person make the outward call.
179
-
180
- ---
181
-
182
- [← 15 Foundations & Lineage](./15-foundations-and-lineage.md) · [Contents](./README.md) · Next: [17 Components →](./17-components.md)
@@ -1,143 +0,0 @@
1
- # 17 · Components — monorepo and multi-repo
2
-
3
- [← 16 Releasing](./16-releasing.md) · [Contents](./README.md) · Next: [Appendix A Templates →](./appendix-a-templates.md)
4
-
5
- ---
6
-
7
- Most of this book treats a project as one codebase with one green bar. Real
8
- systems are rarely that tidy: a backend and a frontend, a shared library and two
9
- apps, or three services across three repos. ADD models all of these the same
10
- way — as a **graph of components**. A component owns a source root, its own
11
- green bar, and the contracts it produces or consumes. With that, **one milestone
12
- can ship a vertical slice across components** — a backend endpoint and the
13
- frontend that calls it — instead of splitting the slice across milestones.
14
-
15
- This pillar is **opt-in and additive**: a project that declares no components
16
- behaves exactly as the rest of the book describes. You reach for it only when a
17
- milestone genuinely spans more than one green bar.
18
-
19
- ## Declare the components
20
-
21
- Components are **declared, never inferred** — ADD does not scan `apps/*` and
22
- guess. You name them in `.add/components.toml`:
23
-
24
- ```toml
25
- [component.gateway]
26
- root = "apps/gateway"
27
- green_bar = "pytest + pyright"
28
-
29
- [component.dashboard]
30
- root = "apps/web"
31
- green_bar = "vitest + a11y"
32
- ```
33
-
34
- Each component owns a **root** (the source subtree it governs) and a
35
- **green-bar** (the suite + checks that prove *that* component healthy). A task
36
- binds to a component with a `component:` header line; the component's root is
37
- then added to the task's §5 Scope automatically. A project with no
38
- `components.toml`, or a task with no `component:` line, is byte-identical to a
39
- single-component project.
40
-
41
- ## Verify each task against its own green bar
42
-
43
- In a mixed milestone, a backend task and a frontend task pass on **different
44
- toolchains**. The verify gate enforces this per component: a task bound to
45
- `gateway` must cite its component's green-bar (`pytest + pyright`) in the §6
46
- Build-expectations evidence, or the gate refuses `component_green_bar_uncited`.
47
- The engine never *runs* the suite — that invariant holds here too. The AI runs
48
- the right suite for the bound component; the gate checks the **right bar was
49
- cited** in the evidence. Two tasks, one milestone, two green bars — each held to
50
- its own.
51
-
52
- At the gate the engine also **surfaces** the bound component's `verify` command —
53
- the literal suite to run (e.g. `pytest -q`) — beside the expected green-bar, and
54
- records it in the §6 gate record so the ledger shows which suite backed the gate.
55
- It prints *what* to run; it never runs it (NO-EXEC). In the fast lane the same
56
- `component:` affordance is available, so a small task in a monorepo can bind a
57
- component and get its bar and `verify` surfaced too.
58
-
59
- ## Freeze a contract between components
60
-
61
- When one component produces an interface another consumes, that boundary needs a
62
- **frozen, machine-checkable contract**. Declare it, name its producer and
63
- consumers:
64
-
65
- ```toml
66
- [contract.gateway-api]
67
- producer = "gateway"
68
- consumers = ["dashboard"]
69
- ```
70
-
71
- A task declares its role with a header line — `produces: gateway-api` or
72
- `consumes: gateway-api`. When the **producer** task freezes its §3 and crosses
73
- contract→tests, the engine writes an immutable snapshot at
74
- `.add/contracts/gateway-api.json` (id, producer, version, frozen date, and a
75
- hash over the frozen §3 shape). When a **consumer** task crosses contract→tests,
76
- it **pins** that live hash. If the producer later re-freezes a *changed* shape,
77
- `add.py check` flags every consumer `contract_consumer_stale` — a §7 delta to
78
- re-pin against the new shape. A missing or malformed snapshot is a HARD-STOP, not
79
- a guess: the consumer never builds against a shape that was never frozen.
80
-
81
- ## One milestone, a full-stack slice
82
-
83
- The reason to put a producer and a consumer in the *same* milestone is to ship a
84
- vertical slice — but the frontend must not commit to an endpoint the backend has
85
- not frozen yet. ADD enforces that ordering with a **hold**: a `consumes:` task
86
- cannot advance scenarios→contract (it cannot write its §3) while its producer's
87
- snapshot does not yet exist. The engine refuses `producer_contract_unfrozen` and
88
- the task stays at `scenarios`. Once the backend freezes its contract, the
89
- frontend proceeds and pins it. The slice is **ordered by the frozen contract**,
90
- all inside one milestone — the FE stays downstream of the BE endpoint, not split
91
- into a later milestone.
92
-
93
- The hold checks more than existence. Even once a snapshot exists, if a live
94
- producer task has *re-opened or drifted* its §3 — the snapshot no longer matches
95
- a frozen producer — the consumer is held `producer_contract_stale` rather than
96
- pinning a shape that is mid-change (the freeze-recency guard). Outside the hold,
97
- `add.py check` surfaces the softer `contract_producer_stale` (a live producer
98
- drifted past a pinned consumer) and `contract_snapshot_hashless` (a snapshot
99
- carrying no hash to verify against) as **never-red warnings** — measured and
100
- reported, never blocking.
101
-
102
- ## Across repositories: federation
103
-
104
- Components in separate repositories work the same way; only the
105
- **snapshot transport** differs. A consumer repo declares where a producer repo
106
- publishes its frozen contract:
107
-
108
- ```toml
109
- [federation.gateway-api]
110
- source = "../gateway/.add/contracts/gateway-api.json"
111
- pin = "v1" # optional — the version this repo expects
112
- ```
113
-
114
- `add.py federate pull gateway-api` reads that source, validates it (valid JSON,
115
- matching id, a hash, and — if `pin` is set — a matching version), and lands a
116
- **byte-for-byte copy** at the local `.add/contracts/gateway-api.json`. From
117
- there, the consuming repo's task holds and pins exactly as in a monorepo. The
118
- pull is **fail-loud by design**: an unknown id, an unreadable source, a `source`
119
- that **escapes the consumer repo's allowlist** (`federation_source_escapes` — the
120
- path is confined to a sibling of the repo root, so a `../../etc`-style traversal
121
- lands nothing), an invalid snapshot, or a version mismatch each HARD-STOPS — federation
122
- never builds an FE against a guessed, out-of-tree, or stale endpoint. The producer's snapshot
123
- is the published artifact; "publishing" is committing that file in the producer
124
- repo. Each repo keeps its own git-native `state.json`; federation transports only
125
- the immutable frozen shape, never shared mutable state.
126
-
127
- ## What this pillar is not
128
-
129
- - **Not auto-discovery.** Components are declared in `components.toml`, not
130
- inferred from the directory tree.
131
- - **Not a central server.** Federation copies an immutable snapshot between
132
- repos; there is no shared service and no shared mutable state.
133
- - **Not a new approval.** The component machinery rides the existing six-step
134
- flow and its single contract-freeze approval — it adds gates the engine
135
- enforces, not human checkpoints.
136
-
137
- The whole pillar is structure, not policy: who *owns* a component and how
138
- autonomy is set per component is the identity/governance story (chapters 11–12),
139
- layered on top of this graph.
140
-
141
- ---
142
-
143
- [← 16 Releasing](./16-releasing.md) · [Contents](./README.md) · Next: [Appendix A Templates →](./appendix-a-templates.md)
@@ -1,80 +0,0 @@
1
- # 18 · Personas — the project-fit learning loop
2
-
3
- [← 17 Components](./17-components.md) · [Contents](./README.md) · Next: [Appendix A Templates →](./appendix-a-templates.md)
4
-
5
- ---
6
-
7
- A **persona** is a project-fit requirements lens the agent adopts so its work matches *this*
8
- codebase's standards instead of a generic default. It is not a chat costume: a persona is a small,
9
- versioned file under `.add/personas/<slug>.md` with three machine-readable parts —
10
-
11
- - **Identity** — the stance the worker takes (e.g. *a payments engineer who treats money as exact*).
12
- - **Critical Rules** — the constraints that must hold (the non-negotiables for this domain).
13
- - **Success Metrics** — the measurable done-bar (what "good" looks like, in numbers where it can).
14
-
15
- The **persona loop** is how those files come to exist, improve, and get used: **seed → grow →
16
- apply**. The loop is opt-in and additive — a project with no personas behaves exactly as before.
17
-
18
- ## Where personas come from — the teacher
19
-
20
- ADD does not invent personas from nothing. It learns them from a **teacher**: a corpus of worked
21
- agent definitions that ADD ships as a vendored local library at `.add/personas-teacher/`.
22
- The teacher is read **off-build**, by the AI, while drafting a persona — it is a *source of ideas*,
23
- **never a runtime dependency**: nothing in the engine imports it, fetches it, or needs it present to
24
- run. You distil a teacher entry down to the three-part shape above and commit the result; from then
25
- on the project owns that persona outright.
26
-
27
- ## Seed — at setup
28
-
29
- The first personas are **seeded** during project setup, from the foundation (`PROJECT.md`'s domain
30
- and standards). Setup proposes a starter persona or two that fit the project's domain; the human
31
- confirms. Seeding writes `.add/personas/<slug>.md` and nothing else — no behaviour changes until a
32
- task actually applies one.
33
-
34
- ## Grow — observe → delta → consolidate
35
-
36
- Personas are **living documents**: they improve through the same loop the foundation uses. In a
37
- task's **observe** phase the AI emits a **persona delta** — a one-line, tagged proposal to add or
38
- sharpen a critical-rule, success-metric, anti-pattern, or ability, written `open` with evidence (just like a lesson learned).
39
- At a retrospective the human **consolidates** confirmed deltas into the persona file (the same
40
- `fold` step the foundation uses), bumping it forward. The consolidation is judgment-free
41
- transcription: the engine routes a confirmed delta into the named
42
- persona's `## Critical Rules`, `## Success Metrics`, `## Anti-patterns`, or `## Abilities` section and **never clobbers** existing content.
43
- So a persona gets *more* accurate every milestone instead of drifting.
44
-
45
- ## Apply — three surfaces
46
-
47
- A seeded, grown persona earns its keep when work adopts it. Three surfaces apply a persona, and all
48
- three treat it the same way — as **advice**, never authority:
49
-
50
- - **UDD (design).** At the design-definition loop a persona frames the requirements lens: which
51
- rules and metrics a UI/UX slice must satisfy for this project's users.
52
- - **advisor / streams (delegation).** When you delegate a piece of your plan to a subagent, its
53
- `<persona>` block **selects** the best-fit `.add/personas/<slug>.md` and the returned verdict
54
- **records** which persona did the work. The independent earned-green refute-read selects a
55
- **Code-Reviewer** persona whose findings carry severity markers — 🔴 blocker · 🟡 concern · 💭 note.
56
- The same canonical persona body rides every runner (Claude, Cursor, Copilot, Codex), so a
57
- **cross-runner subagent** behaves identically wherever it is spawned.
58
- - **build (overlay).** While building, the orchestrating agent may load the active persona as a
59
- domain identity **overlay** layered on `SOUL.md`: SOUL is the voice and trust rules; the persona is
60
- the domain stance. The overlay **never rewrites** SOUL.md (it is human-owned) and never overrides a
61
- trust rule.
62
-
63
- ## The non-negotiable — a persona never lowers a gate
64
-
65
- A persona changes *how carefully* the work is done; it never changes *what passes*. This is the one
66
- hard rule across every surface:
67
-
68
- - A **security** finding is always a **HARD-STOP**, whatever persona was adopted.
69
- - High-risk scope still escalates to the human; a stronger persona never buys back a gate.
70
- - The engine stays **NO-EXEC** throughout: it never spawns a subagent, never runs a persona, never
71
- reads one on the build path. Selecting, loading, and applying a persona is the orchestrating
72
- agent's judgment — the engine only records what was used (for the audit trail) and measures that
73
- the record is present; it never auto-passes on a persona's say-so.
74
-
75
- In short: a persona makes the agent *fit the project*. Direction, freezing, evidence, and the gate
76
- are exactly as strict as they were before — the loop adds expertise, not permission.
77
-
78
- ---
79
-
80
- [← 17 Components](./17-components.md) · [Contents](./README.md) · Next: [Appendix A Templates →](./appendix-a-templates.md)
package/docs/README.md DELETED
@@ -1,77 +0,0 @@
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
- **Lineage**
55
- - [15 · Foundations & Lineage](./15-foundations-and-lineage.md)
56
-
57
- **Releasing**
58
- - [16 · Releasing](./16-releasing.md)
59
-
60
- **Part IV — Reference**
61
- - [Appendix A · Templates](./appendix-a-templates.md)
62
- - [Appendix B · Prompt library](./appendix-b-prompts.md)
63
- - [Appendix C · Glossary](./appendix-c-glossary.md)
64
- - [Appendix D · The worked example, end to end](./appendix-d-worked-example.md)
65
- - [Appendix E · Checklists](./appendix-e-checklists.md)
66
- - [Appendix F · Document requirements matrix (Project → Milestone → Task)](./appendix-f-requirements-matrix.md)
67
- - [Appendix G · References & lineage](./appendix-g-references.md)
68
-
69
- ---
70
-
71
- ## Conventions used in this book
72
-
73
- - **▶ Example** marks the running worked example.
74
- - **Do / Don't** boxes give the rule in its shortest form.
75
- - 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`.
76
- - File names like `SPEC.md`, `features/*.feature`, `contracts/*` refer to the artifacts you create per feature; see [Appendix A](./appendix-a-templates.md).
77
- - 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
package/docs/add-flow.png DELETED
Binary file
Binary file
Binary file
Binary file