@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,181 +0,0 @@
1
- # TASK: {{title}}
2
-
3
- slug: {{slug}} · created: {{date}} · stage: {{stage}}
4
- milestone: {{milestone}}
5
- autonomy: {{autonomy}} <!-- level: manual < conservative < auto — lower for a high-risk task (`add.py autonomy set`). Multi-component repo? add a `component: <name>` line (.add/components.toml) to join that root to §5 Scope. -->
6
- phase: ground <!-- ground -> specify -> scenarios -> contract -> tests -> build -> verify -> observe -> done -->
7
- <!-- high-risk/method-defining? declare `risk: high` on the slug line + a lowered autonomy — the engine refuses an unguarded completion (`unguarded_high_risk_auto`). A comment is never a declaration. -->
8
-
9
- > One file = one task — fill top-to-bottom; the phase marker above is the single source of truth (`add.py phase`); unclear phase → its book chapter.
10
-
11
- ---
12
-
13
- ## 0 · GROUND — the real codebase ▸ docs/02-the-flow.md
14
-
15
- Touches (files · symbols · signatures): <path:symbol — what it is / how it is keyed>
16
- Context (working folder): <docs · todos · config · data the task touches — task-delta only>
17
- Honors (patterns / conventions): <PROJECT.md / CONVENTIONS.md anchors — task-delta only, never a re-scan>
18
- Seams consulted: <SEAMS.md entry cited instead of re-deriving, e.g. .add/SEAMS.md#scope-token-grammar — optional, omit if none apply>
19
- Anchors the contract cites: <the symbols §3 will name>
20
- Issues/Risks (→ feed §1): <problems · traps · untestable risks found in the real code — task-delta; §1 builds on these>
21
- Related intent: <PROJECT.md § · GLOSSARY term(s) · originating request/milestone rationale — the WHY; task-delta>
22
- Ground SHA: <`git rev-parse --short HEAD` at ground time — cite symbols, not bare line numbers; any line ref is "as of" this commit>
23
-
24
- ---
25
-
26
- ## 1 · SPECIFY — the rules ▸ docs/03-step-1-specify.md
27
-
28
- Feature: <name>
29
- Framings weighed: <chosen> (chosen) · <alternative> · <alternative>
30
- Must:
31
- <must>
32
- - <required behavior>
33
- </must>
34
- Reject:
35
- <reject>
36
- - <bad input / situation> -> "<error_code>"
37
- </reject>
38
- After:
39
- <after>
40
- - <state that is true once it succeeds>
41
- </after>
42
- Assumptions — lowest-confidence first:
43
- <assumptions>
44
- ⚠ <the one assumption most likely to be wrong> — lowest confidence because <why>; if wrong: <cost>
45
- - [ ] <next assumption, ranked> — confirm or deny; never carry an open one forward
46
- </assumptions>
47
-
48
- <!-- EXIT: every rule + rejection stated; assumptions ranked lowest-confidence first, top 1–2 ⚠-flagged with why + cost (or an honest "none material" naming the biggest risk). -->
49
-
50
- ---
51
-
52
- ## 2 · SCENARIOS — pass/fail cases ▸ docs/04-step-2-scenarios.md
53
-
54
- <scenarios>
55
-
56
- ```gherkin
57
- Scenario: <short name> # <Must/Reject item this covers, e.g. M1 or R1>
58
- Given <starting situation>
59
- When <action>
60
- Then <expected result>
61
- And <what must remain unchanged> # required for every rejection
62
- ```
63
-
64
- </scenarios>
65
-
66
- <!-- EXIT: one scenario per Must AND per Reject; each result is observable. -->
67
-
68
- ---
69
-
70
- ## 3 · CONTRACT — freeze the shape ▸ docs/05-step-3-contract.md
71
-
72
- ```
73
- <METHOD> <path> body: { <fields> }
74
- 200 -> { <success fields> }
75
- 4xx -> { error: "<code>" | "<code>" }
76
- Schema: <tables/fields touched, and access pattern>
77
- ```
78
-
79
- Glossary deltas: <new domain term(s) this task introduces, `Term: definition` — or "none">
80
- Status: DRAFT
81
- Reported: <yes — the freeze report (banner/ARC/SHAPE) rendered before this froze | no>
82
- <!-- The freeze IS the one approval — lead it with the bundle's lowest-confidence flag (§1 ⚠ feeds it; a flag may point at any part — run.md). Approved -> Status: FROZEN @ vN — approved by <name>; changing a frozen contract = change request back to SPECIFY. EXIT: frozen · every §1 rejection has a contracted response · names match GLOSSARY (new terms = Glossary delta) · flag surfaced. -->
83
-
84
- ---
85
-
86
- ## 4 · TESTS — failing-first suite (red) ▸ docs/06-step-4-tests.md
87
-
88
- Coverage target: <e.g. 90%>
89
- Plan (one test per scenario, asserting behavior not internals):
90
- <test_plan>
91
- - test_<scenario>: arrange <Given> / act <When> / assert <Then> + assert <unchanged> · covers: <M#, R:code — optional>
92
- </test_plan>
93
-
94
- Tests live in: `./tests/` · MUST run red (missing implementation) before Build.
95
- <!-- declare paths as backticked tokens on this line: `./…` = this task dir · a token with "/" = the project root · a bare name = a sibling of the previous token's dir · a directory counts its *.py files (non-recursive) · declared counts marked † · outside the project root counts 0 -->
96
-
97
- <!-- EXIT: one test per scenario; suite red for the RIGHT reason; target recorded. -->
98
-
99
- ---
100
-
101
- ## 5 · BUILD — AI writes code ▸ docs/07-step-5-build.md
102
-
103
- Scope (may touch): `./src/` <fill before the §3 freeze — every file the build may write>
104
- Strategy (ordered batches): <1. … 2. … — the planned build order; guidance, not enforced; preferred architecture/pattern strategies; advise solution/method to resolve issues/implement features; let the named Persona's domain stance (below) shape the approach, not just architecture patterns>
105
-
106
- Persona (required): <name the persona file under `.add/personas/` this build embodies as a domain stance atop SOUL.md — advisory, never lowers a gate; name "generic" if no project persona fits yet>
107
- Spawn isolation (default): <prefer isolation: "worktree" for any subagent build/verify spawn, not only explicit parallel mode; shared-tree needs a stated reason — see worktree-isolated-spawn-default>
108
- Known-problem fixes: <trap → planned fix — the failure modes this build must dodge; guidance, not enforced>
109
- Strategy actually used: <fill at VERIFY — the strategy you ACTUALLY used (or "as planned"); harvested into the §7 Decisions (ADR) block as the [AI] build decision>
110
- Safety rule (feature-specific): <e.g. debit+credit in one atomic transaction>
111
- Code lives in: `./src/`
112
- Constraints: do NOT change any test or the contract; allow-list packages only; ask if unclear.
113
-
114
- <!-- Scope tokens, backticked, FIRST declaring line: `./…` = this task dir · a token with "/" = project root · a bare name = sibling of the previous token's dir · a DIRECTORY token covers its whole subtree (diverges from §4's non-recursive counting) · outside-root resolutions drop fail-closed · absent line = UNDECLARED (grandfathered, never retro-red) · enforcement live: a completing verify gate refuses an out-of-scope build (scope_violation → self-heal); check surfaces it. EXIT: all green; coverage held; no test/contract touched; no unlisted dependency. -->
115
-
116
- ---
117
-
118
- ## 6 · VERIFY — evidence + non-functional review ▸ docs/08-step-6-verify.md
119
-
120
- - [ ] all tests pass
121
- - [ ] coverage did not decrease
122
- - [ ] no test or contract was altered during build
123
- - [ ] the green was EARNED, not gamed — no overfit to fixtures, vacuous asserts, or stubbed-away logic (score with an adversarial refute-read — a subagent recommended under `autonomy: auto`; a confirmed cheat is HARD-STOP)
124
- - [ ] concurrency / timing of the risky operation is safe
125
- - [ ] no exposed secrets, injection openings, or unexpected dependencies
126
- - [ ] layering & dependencies follow CONVENTIONS.md
127
- - [ ] a person reviewed and approved the change
128
-
129
- ### Build expectations — what "correct" looks like (fill BEFORE build; confirm each at the gate)
130
- > OBSERVABLE outcomes a correct build must produce, derived from the §2 scenarios + §3 contract — evidence you can SEE, not test names.
131
- - [ ] <observable outcome a correct build must produce> — confirmed by <how / where>
132
- - [ ] <another observable outcome> — confirmed by <evidence seen>
133
-
134
- ### Deep checks — do not skim (fill the path that applies; the resolver judges which)
135
- - [ ] WIRING (code) — every new symbol is referenced; record where / how confirmed
136
- - [ ] DEAD-CODE (code) — no new unused or orphaned symbol introduced
137
- - [ ] SEMANTIC (prose / non-code) — read in full, not skimmed: <what read · what confirmed>
138
-
139
- ### Live-verify evidence — confirm the §0 GROUND anchors still resolve (fill at the gate)
140
- > Re-resolve every symbol §3 cites against the CURRENT tree (code moved since Ground SHA) — catch a stale anchor here, not later.
141
- - [ ] every symbol §3 CONTRACT cites still resolves in the current tree — confirmed by <how / where>
142
- - [ ] any anchor that moved/renamed since Ground SHA is named here, not left silent
143
-
144
- ### Refute-read verdict — the earned-green check (record it; required for an auto-PASS)
145
- > Under auto, record the earned-green refute-read (the engine never spawns it — you do; NOT-EARNED -> `add.py heal`). Audit-measured (`refute_unrecorded`), never blocked; a human spot-audit is the backstop.
146
- Verdict: <EARNED | NOT-EARNED>
147
- By: <self | agent-id> · adversarially checked: <what was probed>
148
-
149
- ### Advisor 3-lens verdict — sequential (security → concurrency → architecture)
150
- > Lenses run in order; a Security HARD-STOP ends the checklist (leave the rest blank). Binding for sensitivity: mechanical (advisor-gate-relax); advisory otherwise. Audit-measured (`advisor_verdict_unrecorded`), never blocked.
151
- Advisor: <agent-id | self>
152
- 1. Security: <CLEAR | HARD-STOP: finding>
153
- 2. Concurrency: <CLEAR | RESIDUE: finding>
154
- 3. Architecture: <CLEAR | RESIDUE: finding>
155
- Verdict: <PASS | HARD-STOP>
156
- Residue: <none | summary>
157
- Binding: <yes — mechanical | advisory — <sensitivity>>
158
-
159
- ### GATE RECORD
160
- Reported: <yes — the gate report (banner/ARC) rendered before this outcome recorded | no>
161
- Outcome: <PASS | RISK-ACCEPTED | HARD-STOP>
162
- If RISK-ACCEPTED -> owner: <name> · ticket: <link> · expires: <date> (never for a security gap)
163
- Reviewed by: <name> · date: <date>
164
-
165
- <!-- Security is ALWAYS HARD-STOP; record exactly one outcome — no silent pass. The Advisor 3-lens and Refute-read verdicts are audit-measured (`advisor_verdict_unrecorded` · `refute_unrecorded`), never engine-blocked; a human spot-audit backstops anything unrecorded. -->
166
-
167
- ---
168
-
169
- ## 7 · OBSERVE — feed the next loop ▸ docs/09-the-loop.md
170
-
171
- Watch (reuse scenarios as monitors): <error rate / per-rejection rate / latency>
172
-
173
- ### Decisions (ADR)
174
- <harvested at done from §1/§3/§5/§6 — do not hand-edit; one actor-tagged line per decision, refilled only while this placeholder stands>
175
-
176
- ### Spec delta
177
- One line per forward change, tagged `[SPEC · open|seeded|dropped]` + evidence — each re-enters at Specify (`deltas.md`).
178
-
179
- ### Competency deltas
180
- One lesson per line: `[DDD|SDD|UDD|TDD|ADD · open] the learning (evidence: …)` — see `deltas.md`.
181
- <!-- e.g. - [DDD · open] the model missed multi-tenancy (evidence: scenario_x failed) -->