@pilotspace/add 1.16.1 → 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 (113) hide show
  1. package/CHANGELOG.md +227 -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 +229 -29
  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 -37
  14. package/skill/add/intake.md +65 -29
  15. package/skill/add/loop.md +35 -23
  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 +13 -30
  20. package/skill/add/terms.md +18 -0
  21. package/tooling/add.py +2520 -2933
  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 +153 -87
  25. package/tooling/add_engine/guidelines.py +9 -11
  26. package/tooling/add_engine/io_state.py +82 -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 +35 -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 -31
  55. package/agents/add-verify.md +0 -34
  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 -80
  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 -59
  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 -47
  104. package/skill/add/phases/fast-lane.md +0 -31
  105. package/skill/add/release.md +0 -61
  106. package/skill/add/scope.md +0 -72
  107. package/skill/add/sensitivity.md +0 -51
  108. package/skill/add/setup-review.md +0 -48
  109. package/skill/add/soul.md +0 -58
  110. package/skill/add/streams.md +0 -268
  111. package/tooling/add_engine/release.py +0 -86
  112. package/tooling/templates/TASK.fast.md.tmpl +0 -77
  113. package/tooling/templates/TASK.md.tmpl +0 -216
@@ -1,8 +1,8 @@
1
- # Chat reports — the decision-point template (for the AI, not for add.py)
1
+ # Gate reports — the text-mode UDD gate surface (for the AI, not add.py)
2
2
 
3
- The engine renders artifacts (`report`, `report --decide`, `status`); this file governs the CHAT MESSAGE you wrap around them.
3
+ The engine renders artifacts (`report`, `report --decide`, `status`); this file governs the CHAT MESSAGE you wrap around them. Use it at every human gate; its UDD-family design home is `design.md`.
4
4
 
5
- Use it every time you report at or near a human gate.
5
+ **The fitting persona owns the gate report** these are PRINCIPLES, not a fixed template: CONVEY the content below, but the persona owns structure, order, and cadence per project. The layout shown is a sensible DEFAULT; the four floors (below) it may never drop.
6
6
 
7
7
  ## The decision banner — rendered first, above everything
8
8
 
@@ -11,11 +11,11 @@ Every report at a human gate opens with a banner line, so a human scanning a lon
11
11
  ```
12
12
  ════════════════════════════════════════════════════════════════
13
13
  PLAN · <task/milestone title, bold> · <gate name> → APPROVE?
14
- 📄 <task's TASK.md path> · <milestone's MILESTONE.md path>
14
+ 📄 <task's PLAN.md path> · <milestone's MILESTONE.md path>
15
15
  ════════════════════════════════════════════════════════════════
16
16
  ```
17
17
 
18
- - The title is the real H1 from TASK.md/MILESTONE.md, **bolded** — not the bare slug.
18
+ - The title is the real H1 from PLAN.md/MILESTONE.md, **bolded** — not the bare slug.
19
19
  - The path line names the actual file(s) so the human can open them directly; omit the milestone half for a milestone-free/fast task.
20
20
  - Any `§`-numbered section named anywhere in the report (SHAPE, FLAGS, APPROVE, NEXT) is **bolded** — e.g. `**§3 CONTRACT**` — so a scanning eye finds exactly which part of the file is in play.
21
21
 
@@ -29,7 +29,7 @@ ARC goal: <the milestone / project goal this decision serves>
29
29
  plan: <this gate → the next step → the goal>
30
30
  ```
31
31
 
32
- - **goal** — read from `m-goal` in `add.py status`; never re-typed from memory.
32
+ - **goal** — read from `m-goal` in `add.py status --all`; never from memory.
33
33
  - **done** — proven progress only: exit-criteria met/total, tasks done, what this gate proves. An honest fact, never a hope.
34
34
  - **plan** — this gate → the next step → the goal, mirroring the rollup's `DECIDE NEXT` line.
35
35
 
@@ -37,11 +37,6 @@ The arc is required at every human gate: **baseline-lock · contract-freeze · v
37
37
 
38
38
  Its facts are engine-sourced (goal = `m-goal` · done = exit-criteria + tasks done · plan = `DECIDE NEXT`); if your arc and `add.py` disagree, the engine wins.
39
39
 
40
- ### Per-gate examples
41
-
42
- - **verify** — `goal:` ship the decision arc · `done:` report-arc tests 6/6 green · `plan:` PASS → wire the arc into every gate → goal.
43
- - **contract-freeze** — `goal:` … · `done:` bundle drafted, lowest-confidence flag surfaced · `plan:` freeze §3 → build → goal.
44
-
45
40
  ## PLAN / SHAPE — when there's more than one step, or a shape to freeze
46
41
 
47
42
  Render one of these (never both) right after the ARC, whenever the message needs to show more than a single fact — a multi-task breakdown, a roadmap, mid-milestone orientation, or (at a contract freeze) the shape itself:
@@ -62,16 +57,15 @@ SHAPE <task title, bold> — v<N> (DRAFT — not yet frozen)
62
57
  <error case / reject token> <what triggers it>
63
58
  ```
64
59
 
65
- - **Collapse done to a count.** Never enumerate finished tasks by name the human already trusts what's shipped; re-listing it is noise.
66
- - **Cap live items at ~5–7**, in dependency order; footer `+N more queued` rather than listing everything.
67
- - **One line per item** slug + what it does or blocks on; never restate the whole TASK.md.
68
- - **Glyphs are fixed** — done · 🔄 active/in-progress · pending · blocked or flagged. Do not invent new glyphs.
69
- - **Sourced from the engine, summarized by you** — pull from `add.py status`'s `tasks:`/`streams:` output; never paste it verbatim into chat.
70
- - **SHAPE is freeze-only** — the concrete thing being locked, so the human reviews the actual shape, not just commentary about it.
60
+ - **Collapse done to a count** (never enumerate finished); **cap live items ~5–7**, dependency-ordered, footer `+N more queued`; one line each never restate the PLAN.md.
61
+ - **Glyphs fixed** done · 🔄 active · pending · blocked/flagged; never invent new ones.
62
+ - **Sourced from `add.py status`, summarized by you** never pasted raw into chat.
63
+ - **SHAPE is freeze-only** — the concrete shape being locked, so the human reviews it, not commentary.
64
+ - **BUILD PLAN is the HOW** — at a freeze `report --decide` also renders the §3 Build-strategy (Scope · batches · Persona · Spawn) as a `BUILD PLAN (§3 …)` block, so the human approves how the build runs, not only the SHAPE; placeholders skipped.
71
65
 
72
- ## The report blocks, in order
66
+ ## The report blocks what to convey (you own the order)
73
67
 
74
- Render every block (write "none" rather than dropping one); add MORE when needed.
68
+ A gate report CONVEYS these; the persona owns the order and may merge, reorder, or trim to fit the project — conveying each (write "none" rather than silently dropping one), never dropping a floor. A sensible default order follows, not a mandate; add MORE when needed.
75
69
 
76
70
  ```
77
71
  SUMMARY one line: intent + target + where we are + what we done
@@ -82,16 +76,11 @@ APPROVE what you need from the human (or "none — FYI") — exactly one — s
82
76
  NEXT the recommended next actions, ranked (top ▶ highlighted, bolded) + what each unlocks
83
77
  ```
84
78
 
85
- 1. **SUMMARY** — one line: intent + target + position. **Never optional** even when PLAN/SHAPE already carries most of the context, SUMMARY still renders as its own line; it is never merged into or silently replaced by another block.
86
- 2. **FLAGS** — lowest-confidence first, each with *why* and *cost if wrong*. Where TASK.md markers exist (`⚠` / `- [~]` / `- [ ]`), quote verbatim and keep document order.
87
- 3. **DECIDED** — high-confidence autonomous calls, highest-confidence first, each with *why* it was safe. "none" when none. NEVER list a security / residue / lowered-autonomy call here.
88
- 4. **EVIDENCE** — engine-sourced facts from `add.py` output, never re-typed.
89
- 5. **APPROVE** — as a **guided decision**: one `▶ … (recommended)` + 1–3 described alternatives. Exactly one per report, or "none — FYI". Rendered last among the core blocks — the actual interactive ask fires only after everything above it (show-before-ask).
90
- 6. **NEXT** — ranked next actions, top one marked `▶` with what it unlocks. Mirror the rollup's `DECIDE NEXT` for the top action; overrule it only with a stated reason. **Informational, not a second gate**.
79
+ - **SUMMARY** never optional — one line even when PLAN/SHAPE carries the context. **FLAGS** lowest-confidence-first (why + cost-if-wrong; quote PLAN.md `⚠` / `- [~]` / `- [ ]` verbatim). **DECIDED** highest-confidence-first ("none" when none; never a security / residue / lowered-autonomy call). **EVIDENCE** engine-sourced, never re-typed. **APPROVE** the guided ask, last, after show-before-ask. **NEXT** ranked recommendations, not a second gate. **The ask itself** is a summary, never the artifact.
91
80
 
92
81
  ### Beyond the core blocks
93
82
 
94
- When a report needs more — a `RISK` ledger, a `DIFF`, a `SCOPE` map — add an extra block (SCREAMING-CASE label · one-line intent · engine-sourced where possible) AFTER EVIDENCE and BEFORE APPROVE. Add only when it carries what the core blocks don't; never pad; never drop a core block.
83
+ When a report needs more — a `RISK` ledger, a `DIFF`, a `SCOPE` map — add an extra block (SCREAMING-CASE label · one-line intent · engine-sourced) AFTER EVIDENCE and BEFORE APPROVE. Add only when it carries what the core blocks don't; never pad; never drop a core block.
95
84
 
96
85
  ### The APPROVE block as a guided choice
97
86
 
@@ -104,26 +93,28 @@ APPROVE <the question>
104
93
  <one-line description>
105
94
  ```
106
95
 
107
- - **Exactly one** option carries `▶ … (recommended)`. `confidence.md` self-score informs which; the human overrides freely.
108
- - **1–3 real alternatives** only — no strawmen; if there is genuinely one path, show one — never invent filler to reach three.
109
- - **Every option is described** pick and each alternative carry a one-line description.
110
- - **Human gates only** — render at `[human gate]` points; not at `[you drive]` steps.
96
+ - **Exactly one** `▶ … (recommended)` (per the confidence self-score, `phases/direction.md`; human overrides) + **1–3 real alternatives**, each described — no strawmen. **Human gates only** (`[human gate]`, not `[you drive]`). As an `AskUserQuestion` picker: recommended first with `(Recommended)`; else a numbered/`▶` menu. The question is a summary, never the artifact — intent + what "yes" means + flag count.
97
+
98
+ ## The four floorsthe persona owns the form, never these
111
99
 
112
- **The ask itself** — when the APPROVE block becomes an `AskUserQuestion` picker: recommended option goes first with `(Recommended)` suffix. On tools without `AskUserQuestion`, render as a numbered/`▶` menu. The question is a summary, never the artifact intent + what "yes" means + the flag count.
100
+ Whatever shape the persona renders per project, it MUST hold all four:
101
+ - **show-before-ask** · **one-approval-at-the-freeze** · **never-pre-stamp** a human decision point
102
+ - **security = HARD-STOP** — the one **un-persona-negotiable** floor: a security finding is never persona-softened (the human alone may strike this carve-out). The "## Hard rules" below detail how they play out.
113
103
 
114
104
  ## Hard rules
115
105
 
116
106
  <constraints>
117
107
  - **Summary-first.** Never bury the decision under a task list or a diff.
118
- - **Show before ask.** Render the artifact (digest · diff · report) before any approval question. PLAN/SHAPE counts as the artifact here too.
108
+ - **Show before ask.** Render the artifact (digest · diff · report) before any approval question; PLAN/SHAPE counts too.
119
109
  - **Guided decision.** At a `[human gate]`, APPROVE is a guided choice — one `▶ … (recommended)` + 1–3 described alternatives; never a bare next step.
120
- - **Reconcile the count.** FLAGS must reconcile with `add.py report --decide`'s open-item count before the ask. Engine wins if prose disagrees — fix the data, not the sentence.
110
+ - **Reconcile the count.** FLAGS must reconcile with `add.py report --decide`'s open-item count before the ask. Engine wins on disagreement — fix the data, not the sentence.
121
111
  - **Never pre-stamp a human decision point.** Freeze / gate / lock fields stay DRAFT or blank until the answer returns: show → ask → stamp → advance.
122
- - **Never dump raw engine output as the plan.** Summarize `add.py status`/`report` through PLAN/SHAPE (or prose) — the engine's full verbosity is for `add.py` itself, not the chat message wrapped around it.
112
+ - **Never dump raw engine output as the plan.** Summarize `add.py status`/`report` through PLAN/SHAPE (or prose) — the engine's verbosity is for `add.py`, not the chat wrapped around it.
123
113
  - **One report per decision point.** After an approval, point at the frozen artifact — do not re-render the bundle.
114
+ - **Batch, don't serialize.** N same-gate decisions ready together (intake items · ready-to-freeze contracts) render as ONE report: PLAN lists each with its own lowest-confidence flag; APPROVE covers the batch in one ask, any item held back by name.
124
115
  - **Honest scope.** "Done" means the request, not the last task: report "task 2/3", never "done" while approved scope remains.
125
- - **The question is a summary, never the artifact.** A compact SUMMARY · FLAGS block sits in chat immediately before the ask; the question text itself is two lines at most — intent + what "yes" means + flag count — pointing at the report above.
126
- - **NEXT is not a second gate.** The single decision stays in APPROVE; NEXT is ranked recommendations only.
116
+ - **The question is a summary, never the artifact.** A compact SUMMARY · FLAGS block sits in chat immediately before the ask; the question text itself is two lines at most — intent + what "yes" means + the flag count — pointing at the report above.
117
+ - **NEXT is not a second gate.** The decision stays in APPROVE; NEXT is ranked recommendations only.
127
118
  - **DECIDED never holds a gate-class call.** Security / residue / lowered-autonomy calls escalate in APPROVE.
128
- - **Recorded, not just performed.** Rendering this template at a gate is recorded, not assumed — TASK.md's `Reported: yes` (§3/§6) is the mechanical trace; `add.py audit` surfaces an unrecorded one (`contract_report_unrecorded` / `verify_report_unrecorded`), a spot-audit the backstop.
119
+ - **Recorded, not just performed.** A gate render is recorded, not assumed — PLAN.md `Reported: yes` (§3/§6) is the trace; a human spot-audit is the backstop for a missed render.
129
120
  </constraints>
@@ -4,14 +4,52 @@ Before a task exists, ADD turns a raw request into correctly-sized, versioned sc
4
4
  **intake level** (the per-task flow is phases 0–7; intake is the step *before* a task). You
5
5
  (the AI) **propose**; the human **confirms**. Never create scope without a confirmed proposal.
6
6
 
7
+ ## Analyze the request before you size it
8
+
9
+ A raw request is rarely a task yet — it is intent wrapped in prose. ADD's first job is not to
10
+ route it but to *read it into a task shape*. Do this BEFORE any bucket or interview:
11
+
12
+ 1. **Restate the intent** in one line — the outcome the human wants, in their world, not the
13
+ mechanism. If you cannot state it, it is underspecified → `ask_human` (never guess it).
14
+ 2. **Extract the latent requirements** — the acceptance signals hiding in the ask ("fast",
15
+ "secure", "works like X") are the measurable Targets in disguise; name each one explicitly.
16
+ 3. **Name the unstated** — the assumptions, defaults, and edge behavior the prose skips. These
17
+ become the interview agenda below; surface them, never silently fill them.
18
+ 4. **Surface the hidden work** — the migrations, new contract surface, and risks a naive read
19
+ misses. This is what separates a real task from a wish, and what escalates sensitivity.
20
+
21
+ This analysis IS the task's raw material: the restated intent seeds §1 grounding, the latent
22
+ requirements seed the §3 Target, the unstated becomes what the interview settles. Sizing (below)
23
+ only decides *where* the task lives — the analysis decides *what it is*. Skipping it is how a
24
+ vague prompt becomes a mis-sized, under-specified task.
25
+
7
26
  ## Interview before you size
8
27
 
9
- Run `add.py search <keyword> [<keyword> ...]` first — it surfaces overlapping/prior work in one
10
- command instead of a full manual re-read. When the request arrives as a question, or its intent is
11
- not sharp enough to place in one bucket: explore it WITH the user before classifying. Reflect the intent you heard, name what seems in and
12
- out of scope, and offer 2–3 sized options with your own recommendation. Only then emit
13
- `{ bucket, rationale, command }`. `ask_human` stays the floor: when interviewing cannot sharpen the
14
- request, reject — never guess a bucket.
28
+ Run `add.py search <keyword> ...` first — it surfaces overlapping/prior work in one command. When
29
+ the request is a question or won't place in one bucket, explore it WITH the user first: reflect
30
+ the intent, name in/out of scope, offer 2–3 sized options with a recommendation. Only then emit
31
+ `{ bucket, rationale, command }`. `ask_human` stays the floor: if interviewing can't sharpen it,
32
+ reject never guess a bucket.
33
+
34
+ ## The inline lane — below the bucket floor
35
+
36
+ Buckets create versioned scope; some changes are too small to deserve any. After the
37
+ interview sharpens the request, judge the lane FIRST — you (the AI) route it, silently:
38
+
39
+ **Inline fits when ALL hold**: one file or a few adjacent ones · behavior the current specs
40
+ already cover (a typo, a wording fix, a config value, a mechanical rename) · no new contract
41
+ surface anyone else consumes · sensitivity mechanical. Then: **no task, no milestone** — make
42
+ the edit directly, and leave the receipt:
43
+
44
+ 1. the **git diff** is the change record (commit it as usual);
45
+ 2. `add.py delta-append <dd> "<lesson>"` files what was learned into the living 5-DD spec —
46
+ the spec diff IS the approval artifact; a lane run that teaches nothing appends nothing.
47
+
48
+ **The floor is closed**: a change touching **security · data · architecture** ALWAYS escalates
49
+ to a real task — never inline, no matter how small (security stays HARD-STOP everywhere).
50
+ New behavior, a new/changed contract, or anything you would want a frozen §3 for → bucket it.
51
+ The route is yours, the veto is not: the human saying "make it a task" overrides the lane,
52
+ always. When in doubt, bucket — the lane is for changes whose whole story fits in a diff.
15
53
 
16
54
  ## The four buckets
17
55
 
@@ -29,16 +67,23 @@ already-frozen scope?" → if yes it is a `change-request` (never re-size frozen
29
67
  Only if no, apply the size test: a new theme → `new-major`; a slice of a live theme → `sub-milestone`;
30
68
  fits the active milestone → `task`.
31
69
 
32
- **One-task gap rule.** If the request is ONE task but does NOT fit the active milestone's stated
33
- scope, do not force it into `sub-milestone` (which requires "too big for one task"): create a new
34
- micro-milestone to house it (`new-milestone` + `new-task`) that gives the task ledger attribution
35
- and clear exit criteria without inflating scope.
70
+ **Size the freeze, not the template (task bucket only).** ONE atomic template serves every task;
71
+ single behavior · no new contract surface others consume · sensitivity mechanical propose drafting
72
+ the whole Direction bundle in one pass to a single freeze. Any doubt draft §1–§4 beat by beat.
73
+
74
+ **One-task gap rule.** ONE task that does NOT fit the active milestone's scope: never force it
75
+ into `sub-milestone` — create a micro-milestone to house it (`new-milestone` + `new-task`) for
76
+ ledger attribution + clear exit criteria without inflating scope.
77
+
78
+ **Batched intake.** N same-bucket items arriving together classify as ONE proposal: one report,
79
+ one human confirm covering the batch — never N sequential asks. Mixed buckets stay
80
+ `split_required`.
36
81
 
37
82
  ## What you emit (the proposal)
38
83
 
39
- Present the proposal via `report-template.md` — open with the ARC (goal · done · plan): the goal this
84
+ Present the proposal via `gate-udd.md` — open with the ARC (goal · done · plan): the goal this
40
85
  request serves, what is already covered, and the plan the chosen bucket sets up. Render it as a guided
41
- choice — the recommended bucket + its described alternatives (per `report-template.md`). For every
86
+ choice — the recommended bucket + its described alternatives (per `gate-udd.md`). For every
42
87
  request, emit ONE of:
43
88
 
44
89
  - **a classification** — `{ bucket, rationale, command }` — `rationale` names WHY (the theme, the
@@ -55,29 +100,20 @@ request, emit ONE of:
55
100
  </reject_codes>
56
101
 
57
102
  When confirmed, record the `rationale` in the artifact you create or affect — the new MILESTONE.md
58
- goal/body, the new TASK.md, or a note in the affected TASK.md — never in state.json.
103
+ goal/body, the new PLAN.md, or a note in the affected PLAN.md — never in state.json.
59
104
 
60
105
  ## Roadmap — a request that is several milestones
61
106
 
62
- Some requests decompose into **N>1 milestones of the same line** — a roadmap, not one milestone.
107
+ Some requests decompose into **N>1 milestones of the same line** — a roadmap.
63
108
  Don't create only the first and lose the rest. Instead:
64
109
 
65
110
  1. **Propose** the roadmap — the ordered milestone list, each with a one-line goal.
66
- 2. **Confirm** — the human confirms the roadmap before anything is created. Never auto-create N
67
- milestones unprompted the intake floor (`ask_human`) still holds.
111
+ 2. **Confirm** — the human confirms before anything is created; never auto-create N
112
+ milestones unprompted (the `ask_human` floor holds).
68
113
  3. **Create** all N on confirm — the first with `add.py new-milestone <slug>` (active), the rest
69
114
  with `add.py new-milestone --queued <slug>` (status `queued`, not focused).
70
- 4. **Promote** one at a time as each is started, `add.py activate <slug>` flips it queued→active.
71
- You work one active milestone at a time; the queue is the agreed backlog, surfaced at resume.
72
-
73
- This is NOT `split_required`: that code is for a request spanning **different buckets** (propose the
74
- smallest correctly-sized set). A roadmap is several milestones of the **same line**, created queued.
75
-
76
- ## Worked examples (from this project's own history)
115
+ 4. **Promote** — `add.py activate <slug>` flips each queued→active as started; one active
116
+ milestone at a time, the queue is the agreed backlog surfaced at resume.
77
117
 
78
- | request | bucket | rationale |
79
- |---------|--------|-----------|
80
- | give ADD a hosted web dashboard | new-major | a new product theme no active milestone's goal covers → a fresh major line (v5) |
81
- | add the build corridor + tests-red-before-build | sub-milestone | a slice of the live v4 "self-driving" theme, too big for one task → v4-2 |
82
- | expose owner/stop as --json | task | fits the active v4-1 (intake interface) scope → one task |
83
- | guide --json phase/gate should be nullable | change-request | changes the FROZEN machine-state-json contract → reopen its CONTRACT, do not make a new milestone |
118
+ NOT `split_required` (that is for a request spanning **different buckets**); a roadmap is
119
+ several milestones of the **same line**, created queued.
package/skill/add/loop.md CHANGED
@@ -1,38 +1,37 @@
1
1
  # The dynamic loop — open deltas and extras become the next tasks
2
2
 
3
- A milestone is not done when its tasks are done it is done when its **GOAL** is met.
4
- This guide drives a milestone toward that goal: turn what each task leaves behind (open lessons,
5
- and work discovered but out of scope) into the next tasks, and keep going until the exit criteria
6
- are all met.
3
+ A milestone is done when its **GOAL** is met, not when its tasks are.
4
+ This guide drives toward that goal: turn what each task leaves behind (open lessons,
5
+ work discovered out of scope) into the next tasks until the exit criteria are all met.
7
6
 
8
7
  You **gather and propose**; the **human confirms**; the existing `add.py new-task`
9
- creates each one. The engine never decides what the next task is — that is judgment.
8
+ creates each one. The engine never decides the next task — that's judgment.
10
9
 
11
10
  ## The goal-gate (what holds the loop open)
12
11
 
13
- `add.py milestone-done <slug>` REFUSES to close a milestone while its exit criteria are not
14
- all met — it stops with `milestone_goal_unmet` and the milestone stays active. The exit-criteria
12
+ `add.py milestone-done <slug>` REFUSES to close a milestone while its exit criteria aren't
13
+ all met — it stops with `milestone_goal_unmet`, the milestone stays active. The exit-criteria
15
14
  checkboxes in `MILESTONE.md` ARE the human's goal-met affirmation: the engine reads the
16
- `- [x]`/`- [ ]` tally, it never judges whether the goal is met. Checking the last box is the
15
+ `- [x]`/`- [ ]` tally, never judging whether the goal is met. Checking the last box is the
17
16
  deliberate act that releases the gate.
18
17
 
19
18
  The gate fires only when criteria exist. A milestone with no exit-criteria checkboxes closes as
20
- before — write criteria into `MILESTONE.md` if you want the goal-gate to hold the milestone open.
19
+ before — write criteria into `MILESTONE.md` to hold the milestone open.
21
20
 
22
- `milestone-done` is the only way a milestone reaches `done`; `archive-milestone` and `compact`
23
- both refuse a milestone that is not done. The one gate is enough — there is no quiet way around it.
21
+ `milestone-done` is the only way a milestone reaches `done`; `archive-milestone`
22
+ refuses a milestone not done. The one gate is enough — no quiet way around it.
24
23
 
25
24
  ## The loop
26
25
 
27
- When every task is done but the goal is not, `add.py status` shows
28
- `goal not met (m/n exit criteria)`. That is the cue:
26
+ Every task done but not the goal? `add.py status` shows
27
+ `goal not met (m/n exit criteria)`. That's the cue:
29
28
 
30
29
  1. **Gather** the carried inventory:
31
- - open lessons — `add.py deltas` (the §7 OBSERVE deltas still `open`);
30
+ - open lessons — `add.py deltas` (§7 deltas still `open`);
32
31
  - the planned-but-unscaffolded tasks — the plan-vs-state line in `add.py status`;
33
32
  - any reopened task — one a deepened verify returned to the flow (see below).
34
33
  2. **Propose** the next tasks: for each carried item worth doing now, draft a one-line task
35
- (slug + title + why) and show the human. Group the trivial ones; do not propose noise.
34
+ (slug + title + why) and show the human. Group trivial ones; no noise.
36
35
  3. **Confirm** — the human accepts, edits, or declines each. No task is created without this.
37
36
  4. **Create** each accepted task — `add.py new-task <slug> --title "..."` — and run it through
38
37
  the normal flow (specify → … → verify).
@@ -41,18 +40,31 @@ When every task is done but the goal is not, `add.py status` shows
41
40
  - **Fill the ship review first** — write the milestone's `## Close — ship review` section:
42
41
  **Ship by domain** — what changed per bounded context (`tooling` · `skill` · `book`, or
43
42
  "untouched"); **Cross-task evidence** — one row per task (`gate` · `tests` · `residue`);
44
- and the **Goal met?** map — each exit criterion tied to the evidence that satisfies it.
45
- This is the whole-milestone cross-task evidence the human READS; it is evidence, not a gate.
43
+ and the **Goal met?** map — each exit criterion tied to its evidence.
44
+ This is the whole-milestone cross-task evidence the human READS evidence, not a gate.
46
45
  - **Check the boxes** — read that evidence, then check the exit-criteria boxes in `MILESTONE.md`
47
- (the single affirmation), and `add.py milestone-done <slug>` succeeds (then consolidate open
48
- deltas and archivethe `milestone-done fold → compact → archive` lifecycle, per
49
- `fold.md` · `compact-foundation.md`).
46
+ (the single affirmation), and `add.py milestone-done <slug>` succeeds (then file the open
47
+ deltas into their living specs `add.py delta-append` and archive).
50
48
  - **Define the release steps** — write the milestone's `## Release steps` (merge is one small
51
- step among them; PR, asset export, tag/publish are others). These **feed** the release scope —
52
- read `release.md` for the cut; loop.md never re-specifies it.
53
- Present the close via `report-template.md` — open with the ARC (goal · done · plan),
49
+ step among them; PR, asset export, tag/publish are others). The human owns the cut;
50
+ loop.md never re-specifies it.
51
+ Present the close via `gate-udd.md` — open with the ARC (goal · done · plan),
54
52
  render as a guided choice — **before `milestone-done`/`archive-milestone` run, not after.**
55
53
 
54
+ ## Route reflection (GEPA) — the routes learn at close
55
+
56
+ `add.py deltas` ends with the **route scoreboard**: per-lane evidence (gated · outcome mix ·
57
+ heals · median age) rolled up from `.add/traces/route-outcomes.jsonl` — one line the engine
58
+ appends at every recorded gate. At close, reflect on it GEPA-style under the PM persona:
59
+
60
+ - **keep** a route rule whose lane cut heals/age with no gate regressions;
61
+ - **prune** a rule no trace ever took (it never fired);
62
+ - **propose** each change as `add.py delta-append add "<route-rule delta>"`, evidence cited.
63
+
64
+ The **human folds** ratified rules into `.add/personas/<slug>.md` — the only mutation path
65
+ (never-clobber). Personas never touch frozen contracts, tests, the SKILL core, or the
66
+ security HARD-STOP.
67
+
56
68
  ## Reopen is the verb; this loop is the trigger
57
69
 
58
70
  When a deepened verify finds a criterion unmet on a task already marked done,
@@ -0,0 +1,78 @@
1
+ # Build — AI writes the code (the beat you drive to green)
2
+
3
+ Objective: implement the feature so EVERY failing test passes — without changing any
4
+ test or the contract. This is the only phase the AI leads; §1–§4 removed all
5
+ ambiguity. Write code into `.add/tasks/<slug>/src/`.
6
+
7
+ ## Work in small batches
8
+
9
+ Pick ONE task-sized slice, restate its tests, implement, iterate to green —
10
+ each batch small enough to review in full.
11
+
12
+ ## Declaring the scope of impact (Scope + Strategy)
13
+
14
+ §5's declarations are drafted with the bundle and frozen by the §3 approval — never invented mid-build:
15
+
16
+ - **Scope (may touch)** — the allowlist the build may write (backticked tokens); a file outside it is a **STOP → change request** back to Specify.
17
+ - **Strategy (ordered batches)** — the planned build order; guidance, not enforced.
18
+ - **Strategy facets** — Approach (domain strategy) · Data strategy · Pattern · Optimization stance: the domain HOW, anchored upstream (§1 Framings · §3 Schema · CONVENTIONS.md Honors), drafted at tests->build in the Persona's domain vocabulary; ⚠-mark the facet you trust least (risk: high → consult the add agent, advise mode). Advisory, never a gate.
19
+
20
+ Enforced: a completing verify gate refuses an out-of-scope build (`scope_violation` → self-heal).
21
+
22
+ ## Persona overlay (optional)
23
+
24
+ Load the active `.add/personas/<slug>.md` as a domain **overlay** atop `SOUL.md` (SOUL = voice/trust; persona = domain **stance**) — name it in §5; its domain supplies the facet vocabulary. SOUL.md is **human-owned**: the overlay never rewrites it (voice deltas: `deltas.md`). Advisory — it never lowers a gate; security still **HARD-STOPs**.
25
+
26
+ ## A red outside your suite — locate first
27
+
28
+ `add.py locate path::test_name`, never a blind fix. **in-node** — a live task owns it;
29
+ coordinate. **interface-regression** — you broke a DONE task's contract: fix the breaker; a
30
+ contract change is a change request, the printed closure names who re-verifies. **unowned** —
31
+ host/foreign surface = your §3 Regression floor; keep it green. A §4 `covers:` map quotes the
32
+ frozen §3 clause — repair the clause, not the symptom.
33
+
34
+ ## The cardinal rule
35
+
36
+ **Never weaken or delete a test to make it pass, and never edit the frozen
37
+ contract.** A genuine need to change either is a change request back to Specify. Honor the §5 safety rule (e.g. atomic balance update).
38
+
39
+ ## Exit gate
40
+
41
+ <exit_gate>
42
+ - [ ] All tests pass.
43
+ - [ ] Coverage did not decrease.
44
+ - [ ] No test and no contract modified by the AI.
45
+ - [ ] No dependency outside the allow-list.
46
+ - [ ] No file outside the declared §5 Scope was touched.
47
+ - [ ] Change small enough to review in full.
48
+ </exit_gate>
49
+
50
+ > **Advisor · Confidence** — delegate a well-scoped batch (the advisor spawn, `phases/verify.md`); self-score before presenting green, refine while cheap (the confidence self-score, `phases/direction.md`).
51
+
52
+ ## Next
53
+
54
+ `python3 .add/tooling/add.py gate PASS` (from build — compound-crosses to verify in one call) → `phases/verify.md` on demand.
55
+ Book: `docs/07-step-5-build.md`.
56
+
57
+ > Under `autonomy: auto` Build and Verify run together as one evidence-auto-gated run. See `run.md`.
58
+ >
59
+ > **Honest redo.** A confirmed cheat returns the task HERE — revert the tampered file or de-overfit src, then advance again (the bounded self-heal loop, `run.md`; capped, then HARD-STOPs to the human). Never weaken a test or edit the frozen contract to pass.
60
+
61
+ ## The self-improving map — every loop feeds four artifacts
62
+
63
+ You emit `open`; the human confirms; the engine transcribes — **nothing self-approves**. Emission
64
+ lives in observe (§7); every earlier step feeds it: ground surprises → §1 · the freeze's ⚠ flag →
65
+ the next spec · a red-suite gap → a TDD lesson · build's strategy-actually-used → the ADR block ·
66
+ verify residue → a SPEC delta.
67
+
68
+ | what improves | grammar (closes `(evidence: …)`) | consolidator |
69
+ |---|---|---|
70
+ | the living specs — `.add/specs/` | `[DDD\|SDD\|UDD\|TDD\|ADD · open] lesson` | `add.py delta-append <dd>` |
71
+ | personas — the agents' stances | `… · persona:<slug> · critical-rule\|success-metric\|anti-pattern\|ability` | the persona loop |
72
+ | `SOUL.md` — your voice | a voice delta, `open` | human rewrite (`deltas.md`) |
73
+ | the next scope | `[SPEC · open]` → seeded · dropped · carried | `loop.md` → `new-task` |
74
+
75
+ Routing: `ddd`→domain · `sdd`→system · `udd`→experience · `tdd`→quality · `add`→method — each
76
+ lands in-flight in its living spec via `add.py delta-append <dd>` (grammar: `deltas.md`). A
77
+ HOW-an-agent-behaves lesson → a persona, not the shared pile. Deltas prepend newest-first;
78
+ the spec diff is the receipt. Self-score before emitting (the confidence six dimensions; < 0.9 → refine).