yadflow 3.18.1 → 4.0.0-next.1

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 (156) hide show
  1. package/CHANGELOG.md +355 -0
  2. package/README.md +79 -26
  3. package/bin/commands.mjs +41 -0
  4. package/bin/yad.mjs +437 -124
  5. package/cli/artifact-status.mjs +34 -15
  6. package/cli/checkpoint.mjs +69 -49
  7. package/cli/codeowners-command.mjs +170 -0
  8. package/cli/codeowners.mjs +397 -0
  9. package/cli/commit.mjs +13 -9
  10. package/cli/companion.mjs +2 -2
  11. package/cli/dial.mjs +183 -0
  12. package/cli/docs.mjs +88 -32
  13. package/cli/doctor.mjs +1472 -97
  14. package/cli/epic-state.mjs +3478 -232
  15. package/cli/epic.mjs +506 -0
  16. package/cli/errors.mjs +4 -1
  17. package/cli/gate.mjs +1002 -209
  18. package/cli/history.mjs +556 -0
  19. package/cli/hook.mjs +266 -55
  20. package/cli/hubcommit.mjs +6 -17
  21. package/cli/index-command.mjs +87 -0
  22. package/cli/ledger.mjs +57 -7
  23. package/cli/lib.mjs +184 -18
  24. package/cli/manifest.mjs +367 -56
  25. package/cli/migrate.mjs +726 -53
  26. package/cli/mode.mjs +170 -0
  27. package/cli/next.mjs +349 -90
  28. package/cli/openpr.mjs +191 -39
  29. package/cli/people.mjs +654 -0
  30. package/cli/plan.mjs +417 -132
  31. package/cli/platform.mjs +110 -129
  32. package/cli/product-index.mjs +287 -0
  33. package/cli/protection.mjs +706 -0
  34. package/cli/reconcile.mjs +38 -12
  35. package/cli/repo-publish.mjs +24 -26
  36. package/cli/repo.mjs +23 -14
  37. package/cli/report.mjs +21 -15
  38. package/cli/review.mjs +24 -27
  39. package/cli/riskmap-command.mjs +289 -0
  40. package/cli/riskmap.mjs +373 -0
  41. package/cli/setup.mjs +139 -287
  42. package/cli/ship.mjs +7 -6
  43. package/cli/skill.mjs +180 -0
  44. package/cli/skip.mjs +211 -30
  45. package/cli/thread.mjs +42 -17
  46. package/cli/tidy.mjs +20 -20
  47. package/cli/update-commit.mjs +22 -22
  48. package/cli/usage.mjs +115 -109
  49. package/package.json +3 -3
  50. package/skills/sdlc/config.yaml +166 -87
  51. package/skills/sdlc/module-help.csv +35 -35
  52. package/skills/yad-analysis/SKILL.md +125 -65
  53. package/skills/yad-architecture/SKILL.md +34 -23
  54. package/skills/yad-architecture/references/contract-format.md +10 -8
  55. package/skills/yad-backfill/SKILL.md +14 -8
  56. package/skills/yad-backfill/references/backfill.md +1 -1
  57. package/skills/yad-change/SKILL.md +127 -52
  58. package/skills/yad-change/references/triage.md +42 -28
  59. package/skills/yad-checks/SKILL.md +89 -45
  60. package/skills/yad-checks/references/check-gates.md +315 -92
  61. package/skills/yad-checks/templates/checks/build-test-lint.sh +25 -7
  62. package/skills/yad-checks/templates/checks/commit-message.sh +17 -3
  63. package/skills/yad-checks/templates/checks/contract-check.sh +58 -2
  64. package/skills/yad-checks/templates/checks/epic-open.sh +3 -3
  65. package/skills/yad-checks/templates/checks/install-deps.sh +46 -0
  66. package/skills/yad-checks/templates/checks/ledger-guard.sh +94 -18
  67. package/skills/yad-checks/templates/checks/lineage-check.sh +23 -9
  68. package/skills/yad-checks/templates/checks/package-manager.sh +140 -0
  69. package/skills/yad-checks/templates/checks/reconcile-debt-check.sh +4 -4
  70. package/skills/yad-checks/templates/checks/risk-map-check.sh +438 -0
  71. package/skills/yad-checks/templates/checks/verified-commits.sh +20 -46
  72. package/skills/yad-checks/templates/github/yad-checks.yml +37 -5
  73. package/skills/yad-checks/templates/github/yad-hub-checks.yml +5 -5
  74. package/skills/yad-checks/templates/github/yad-update-guard.yml +3 -4
  75. package/skills/yad-checks/templates/github/yad-verified-commits.yml +4 -4
  76. package/skills/yad-checks/templates/gitlab/.gitlab-ci.yml +7 -1
  77. package/skills/yad-checks/templates/gitlab/yad-checks.gitlab-ci.yml +22 -4
  78. package/skills/yad-checks/templates/gitlab/yad-hub-checks.gitlab-ci.yml +5 -5
  79. package/skills/yad-checks/templates/gitlab/yad-verified-commits.gitlab-ci.yml +4 -4
  80. package/skills/yad-checks/templates/hooks/ledger-guard-cursor.sh +91 -0
  81. package/skills/yad-checks/templates/hooks/ledger-guard.sh +38 -7
  82. package/skills/yad-commit/SKILL.md +6 -6
  83. package/skills/yad-connect-design/SKILL.md +6 -6
  84. package/skills/yad-connect-design/references/design-context.md +1 -1
  85. package/skills/yad-connect-design/references/design-registry.md +2 -2
  86. package/skills/yad-connect-docs/SKILL.md +12 -12
  87. package/skills/yad-connect-docs/references/docs-registry.md +1 -1
  88. package/skills/yad-connect-learning/SKILL.md +5 -5
  89. package/skills/yad-connect-learning/references/learning-registry.md +2 -2
  90. package/skills/yad-connect-repos/SKILL.md +92 -54
  91. package/skills/yad-connect-repos/references/code-context.md +6 -6
  92. package/skills/yad-connect-repos/references/hub-config.md +68 -58
  93. package/skills/yad-connect-repos/references/repos-registry.md +10 -9
  94. package/skills/yad-connect-repos/references/risk-map.md +81 -0
  95. package/skills/yad-connect-testing/SKILL.md +6 -6
  96. package/skills/yad-connect-testing/references/testing-context.md +3 -4
  97. package/skills/yad-connect-testing/references/testing-registry.md +2 -2
  98. package/skills/yad-defects/SKILL.md +8 -8
  99. package/skills/yad-discovery/SKILL.md +130 -94
  100. package/skills/yad-discovery/references/discovery-schema.md +23 -7
  101. package/skills/yad-discovery/references/foundation-schema.md +374 -0
  102. package/skills/yad-docs/SKILL.md +16 -11
  103. package/skills/yad-docs/references/data-mapping.md +9 -7
  104. package/skills/yad-docs/templates/app/package-lock.json +3 -3
  105. package/skills/yad-docs-overview/SKILL.md +32 -17
  106. package/skills/yad-docs-overview/references/pipeline-model.md +47 -28
  107. package/skills/yad-docs-sync/SKILL.md +10 -5
  108. package/skills/yad-docs-sync/references/staleness.md +8 -7
  109. package/skills/yad-engineer-review/SKILL.md +88 -24
  110. package/skills/yad-engineer-review/references/ship-and-record.md +25 -16
  111. package/skills/yad-epic/SKILL.md +178 -100
  112. package/skills/yad-epic/references/state-schema.md +626 -117
  113. package/skills/yad-hub-bridge/SKILL.md +66 -48
  114. package/skills/yad-hub-bridge/references/bridge.md +110 -83
  115. package/skills/yad-hub-bridge/references/login-roster.md +163 -70
  116. package/skills/yad-hub-bridge/templates/checks/hub-route.sh +22 -19
  117. package/skills/yad-hub-bridge/templates/github/yad-gate-sync.yml +34 -14
  118. package/skills/yad-hub-bridge/templates/gitlab/gitlab-ci.include-root.yml +2 -2
  119. package/skills/yad-hub-bridge/templates/gitlab/yad-gate-sync.gitlab-ci.yml +22 -12
  120. package/skills/yad-implement/SKILL.md +29 -15
  121. package/skills/yad-implement/references/implement-conventions.md +2 -2
  122. package/skills/yad-learn/SKILL.md +9 -9
  123. package/skills/yad-learn/references/learning-state.md +2 -2
  124. package/skills/yad-open-pr/SKILL.md +64 -29
  125. package/skills/yad-pair-review/SKILL.md +18 -16
  126. package/skills/yad-pair-review/references/session-state.md +4 -4
  127. package/skills/yad-pr-template/SKILL.md +48 -27
  128. package/skills/yad-pr-template/references/risk-routing.md +97 -24
  129. package/skills/yad-pr-template/templates/checks/pr-template.sh +37 -15
  130. package/skills/yad-pr-template/templates/checks/pr-title.sh +27 -13
  131. package/skills/yad-pr-template/templates/checks/risk-route.sh +107 -14
  132. package/skills/yad-pr-template/templates/github/pull_request_template.md +7 -5
  133. package/skills/yad-pr-template/templates/gitlab/merge_request_templates/Default.md +7 -5
  134. package/skills/yad-pr-template/templates/hub/github/pull_request_template.md +15 -14
  135. package/skills/yad-pr-template/templates/hub/gitlab/merge_request_templates/Default.md +15 -13
  136. package/skills/yad-reconcile/SKILL.md +3 -3
  137. package/skills/yad-report/SKILL.md +5 -5
  138. package/skills/yad-review-companion/SKILL.md +12 -9
  139. package/skills/yad-review-gate/SKILL.md +198 -79
  140. package/skills/yad-review-gate/references/gating.md +230 -54
  141. package/skills/yad-run/SKILL.md +86 -56
  142. package/skills/yad-run/references/run-loop.md +67 -45
  143. package/skills/yad-ship/SKILL.md +18 -14
  144. package/skills/yad-spec/SKILL.md +31 -17
  145. package/skills/yad-spec/references/spec-handoff.md +17 -5
  146. package/skills/yad-status/SKILL.md +114 -56
  147. package/skills/yad-stories/SKILL.md +42 -27
  148. package/skills/yad-stories/references/story-schema.md +10 -9
  149. package/skills/yad-stub/SKILL.md +59 -48
  150. package/skills/yad-sync-repos/SKILL.md +3 -3
  151. package/skills/yad-test-cases/SKILL.md +37 -30
  152. package/skills/yad-test-cases/references/test-cases-schema.md +8 -5
  153. package/skills/yad-timeline/SKILL.md +8 -7
  154. package/skills/yad-ui/SKILL.md +46 -25
  155. package/cli/roster.mjs +0 -164
  156. package/skills/sdlc/install.sh +0 -68
@@ -0,0 +1,374 @@
1
+ # Foundation schema — the sections and the ledger
2
+
3
+ The Foundation is the Product level (E75). It lives in `{project-root}/foundation/`, with its fixed id
4
+ `EP-foundation`:
5
+
6
+ ```
7
+ foundation/
8
+ purpose.md market.md scope.md mvp.md roadmap.md stack.md repos.md risks.md
9
+ .sdlc/state.json approvals.json comments.json product-prs.json hub-prs.json
10
+ reviews/
11
+ ```
12
+
13
+ ## The ledger (`foundation/.sdlc/state.json`)
14
+
15
+ Written by `yad foundation new`, never by hand. What it holds, for reference:
16
+
17
+ ```text
18
+ epicId EP-foundation
19
+ kind foundation the marker every reader keys off (not a work-item type — there is none)
20
+ profile foundation the route: two steps, no Build
21
+ currentStep foundation → foundation-review → foundation-done
22
+ steps foundation (author, artifact foundation/) · foundation-review (review+approve, artifact foundation/)
23
+ ```
24
+
25
+ - `artifact: "foundation/"` is a **virtual** base: the gate fingerprints the Foundation sections together
26
+ (`foundationHash` in `cli/epic-state.mjs`). An edit to any section revokes prior approvals. The
27
+ frontmatter `status:` line is not part of the fingerprint, so the gate flipping it is not an edit.
28
+ - The six **required** sections must all exist before the Foundation is reviewable. The two
29
+ **optional** ones (`market.md`, `risks.md`) count once they exist.
30
+ - On approval the gate sets `currentStep: "foundation-done"`. The Foundation has no Build, so it never
31
+ becomes `ready-for-build`.
32
+ - The review branch is `review/EP-foundation/foundation`, which both gate-sync workflows already match.
33
+ - On a **verified** ledger, `foundation/.sdlc/` and `foundation/reviews/` are CI-owned exactly like an
34
+ epic's. The committed `checks/ledger-guard.sh` must be from E75 or later to guard them — `yad doctor`
35
+ warns when it is not, and `yad update` refreshes it.
36
+
37
+ ## When a section counts as written (E76)
38
+
39
+ A section that still holds **only its template** is not written. "Only its template" means nothing but
40
+ the frontmatter, `#` and `##` headings, `<!-- comments -->`, blank lines, `---` dividers, and an empty table
41
+ (its header row, its `|---|` rule, and rows whose cells are all empty). One real sentence, one filled
42
+ table row, or one `###` sub-heading makes it written.
43
+
44
+ The engine checks this, and only ever **warns**:
45
+
46
+ - `yad gate open` and `yad gate sync` print `Foundation not written yet — <files> hold nothing but their
47
+ template` when a section that exists is still empty.
48
+ - `yad doctor` reports `foundation:unwritten` once the review has **opened or passed** with an empty
49
+ section. While the Foundation is still being written, an empty section is just work not done yet.
50
+
51
+ So write every example into a comment, never as a table row: a filled row is read as your content.
52
+
53
+ ## Section templates and what goes in them
54
+
55
+ Every section carries the same frontmatter block:
56
+
57
+ ```markdown
58
+ ---
59
+ id: EP-foundation
60
+ artifact: <section>
61
+ status: draft
62
+ owner:
63
+ ---
64
+ ```
65
+
66
+ Each section below has four parts:
67
+
68
+ - **The template** — the file to start from. Keep its headings; reviewers look for them.
69
+ - **Ask** — the questions to put to the user. Ask them one at a time and write down the user's answer,
70
+ not your own guess.
71
+ - **A good answer** — what the section holds when it is done.
72
+ - **The reviewer checks** — what a reviewer holds it against at the gate.
73
+
74
+ The examples use one made-up product, **Tally**: an app for flatmates to split shared bills.
75
+
76
+ ### `purpose.md`
77
+
78
+ ```markdown
79
+ ## Why this exists
80
+ ## Who it is for
81
+ ## What success looks like
82
+ <!-- measurable where possible -->
83
+ ```
84
+
85
+ **Ask:**
86
+ - What problem does this solve, and what do people do about it today?
87
+ - Who has the problem most? Name one kind of person, not "everyone".
88
+ - A year after launch, what number would tell you this worked?
89
+
90
+ **A good answer:** one short paragraph per heading. The problem is stated from the user's side, not as a
91
+ feature. There is one main user group, with others named as secondary. Success is two or three
92
+ measurable signals, each with a number or a clear yes/no.
93
+
94
+ **The reviewer checks:** could someone outside the team say who this is for and why after one read? Is
95
+ every success signal something you could actually measure?
96
+
97
+ **Example (Tally):**
98
+
99
+ ```markdown
100
+ ## Why this exists
101
+ Flatmates split rent, bills and shopping. Today they use a shared spreadsheet or a group chat, and
102
+ someone always ends up owed money they are too awkward to ask for.
103
+
104
+ ## Who it is for
105
+ People aged 20–35 sharing a flat with two to five others. Secondary: couples who share bills.
106
+
107
+ ## What success looks like
108
+ - 40% of flats that add a second member are still logging expenses 8 weeks later.
109
+ - A flat settles up (everyone at zero) at least once a month.
110
+ ```
111
+
112
+ ### `market.md` *(optional)*
113
+
114
+ ```markdown
115
+ ## Who else does this
116
+ | Competitor | What they do | Where they fall short |
117
+ |---|---|---|
118
+ ## Why us
119
+ ```
120
+
121
+ **Ask:**
122
+ - Who does this already, including "a spreadsheet" or "nobody bothers"?
123
+ - For each one: why would your user still not be happy with it?
124
+ - What can you do that they cannot, or will not?
125
+
126
+ **A good answer:** three to five real alternatives, each with one honest line on where it falls short.
127
+ "Why us" names an advantage the team really has, not a wish.
128
+
129
+ **The reviewer checks:** is any obvious alternative missing? Does "why us" follow from the gaps in the
130
+ table, or is it unrelated to them?
131
+
132
+ **Example (Tally):**
133
+
134
+ ```markdown
135
+ ## Who else does this
136
+ | Competitor | What they do | Where they fall short |
137
+ |---|---|---|
138
+ | Splitwise | Tracks shared expenses for any group | Built for trips; recurring rent and bills are clumsy |
139
+ | A shared spreadsheet | Free and flexible | Nobody updates it; no reminders |
140
+
141
+ ## Why us
142
+ We only do flats, so recurring bills and a monthly settle-up are the default, not an add-on.
143
+ ```
144
+
145
+ ### `scope.md`
146
+
147
+ ```markdown
148
+ ## What it is
149
+ ## What it is NOT
150
+ <!-- explicit non-goals — the list a reviewer checks each feature epic against -->
151
+ ```
152
+
153
+ **Ask:**
154
+ - In one sentence, what is this product?
155
+ - What will people expect it to do that it will **not** do? Keep asking until the user has named at
156
+ least three things.
157
+ - Which of those are "not now" and which are "never"?
158
+
159
+ **A good answer:** "What it is" is one or two sentences. "What it is NOT" is a list of concrete
160
+ non-goals, each one a thing a real person might ask for. Mark each one *not now* or *never*.
161
+
162
+ **The reviewer checks:** every later feature epic is compared with this list, so each non-goal must be
163
+ specific enough to say yes or no to. "Not a bank" is useful; "not bloated" is not.
164
+
165
+ **Example (Tally):**
166
+
167
+ ```markdown
168
+ ## What it is
169
+ A shared ledger for one flat: log what each person paid, see who owes whom, settle up.
170
+
171
+ ## What it is NOT
172
+ - Not a payment app — it never moves money (never).
173
+ - Not for trips or one-off groups (not now).
174
+ - Not a budgeting tool for one person (never).
175
+ ```
176
+
177
+ ### `mvp.md`
178
+
179
+ ```markdown
180
+ ## The smallest thing worth shipping
181
+ ## What is deliberately left out of it, and why
182
+ ```
183
+
184
+ **Ask:**
185
+ - What is the least a first user needs to get the value in `purpose.md`?
186
+ - Walk through one user's first week. Which steps must work for that week to succeed?
187
+ - What did you want to include but can live without at first?
188
+
189
+ **A good answer:** a short list of capabilities — not screens, not technical tasks — that together
190
+ deliver the first success signal. The "left out" list names each thing and one line on why it can wait.
191
+
192
+ **The reviewer checks:** is every item really needed for the first success signal? Does anything here
193
+ contradict `scope.md`'s non-goals?
194
+
195
+ **Example (Tally):**
196
+
197
+ ```markdown
198
+ ## The smallest thing worth shipping
199
+ - Create a flat and invite flatmates by link.
200
+ - Log an expense and who it is split between.
201
+ - See each person's balance, and mark a settle-up.
202
+
203
+ ## What is deliberately left out of it, and why
204
+ - Recurring bills — people can log rent by hand for the first months; we learn the real patterns first.
205
+ - Receipts and photos — nice, but nobody leaves over it.
206
+ ```
207
+
208
+ ### `roadmap.md` (the spine of the review)
209
+
210
+ ```markdown
211
+ ## Summary
212
+ <!-- the product thesis in 2–3 lines -->
213
+
214
+ ## Phase 1 — MVP
215
+ | Feature | Proposed epic id | Status |
216
+ |---------|------------------|--------|
217
+ <!-- one row per feature, e.g. | Registration | EP-registration | planned |. Write the Status once, when you add the row; do not update it by hand — `yad foundation status` reads it from the epic ledgers -->
218
+
219
+ ## Phase 2 — <name>
220
+ | Feature | Proposed epic id | Status |
221
+ |---------|------------------|--------|
222
+
223
+ ## Later / parked
224
+ <!-- explicitly deferred, with why -->
225
+ ```
226
+
227
+ **Ask:**
228
+ - What does the MVP break down into, as features a team could build one at a time?
229
+ - After the MVP, what comes next, and what has to be true before it starts?
230
+ - What have you decided to park, and why?
231
+
232
+ **A good answer:** Phase 1 holds exactly the MVP from `mvp.md`, one row per feature. Later phases are
233
+ ordered by a stated reason (what they depend on, or what they unlock). Parked items are listed with why.
234
+ Each proposed epic id follows `EP-<2–4 lowercase words>`.
235
+
236
+ **The reviewer checks:** does Phase 1 match `mvp.md`, no more and no less? Is anything in a later phase
237
+ a non-goal in `scope.md`?
238
+
239
+ The proposed ids are suggestions — `yad-epic` still assigns the id, and never picks the reserved
240
+ `EP-foundation` or `EP-discovery`.
241
+
242
+ **Do not update the Status column by hand.** The roadmap table is part of what the Foundation's
243
+ reviewers approved, so editing a row after the review has passed changes the Foundation's fingerprint,
244
+ and `yad doctor` then reports its approvals as stale. Instead, `yad foundation status` reads how far each
245
+ feature has got from the epic ledgers:
246
+
247
+ | Status | Meaning |
248
+ |---|---|
249
+ | `planned` | No epic ledger with the proposed id exists yet |
250
+ | `in-shape` | The epic is seeded and still in Shape (epic, architecture, UI, stories) |
251
+ | `in-build` | Shape is done, and Build has not shipped every story in every repo |
252
+ | `shipped` | Every story in the epic has a Build state, every repo each story declares has a lane, and every lane is shipped (or the epic is a brownfield anchor) |
253
+
254
+ It also names feature epics that no row proposes — `yad-epic` may give an epic a different id from the
255
+ one proposed. Write `planned` when you first add a row; an older Foundation that says `epic-started` or
256
+ `shipped` can stay as it is, and the command notes where the column and the ledgers disagree.
257
+
258
+ **Example (Tally):**
259
+
260
+ ```markdown
261
+ ## Summary
262
+ Flatmates should never have to chase money. Tally is the shared ledger for one flat.
263
+
264
+ ## Phase 1 — MVP
265
+ | Feature | Proposed epic id | Status |
266
+ |---------|------------------|--------|
267
+ | Flats and invites | EP-flat-invites | planned |
268
+ | Log and split an expense | EP-log-expense | planned |
269
+ | Balances and settle-up | EP-settle-up | planned |
270
+
271
+ ## Phase 2 — Recurring bills
272
+ | Feature | Proposed epic id | Status |
273
+ |---------|------------------|--------|
274
+ | Recurring bills | EP-recurring-bills | planned |
275
+
276
+ ## Later / parked
277
+ - Receipt photos — parked until people ask for it.
278
+ ```
279
+
280
+ ### `stack.md`
281
+
282
+ ```markdown
283
+ ## Languages and frameworks
284
+ ## Hosting and runtime
285
+ ## Data stores
286
+ <!-- brownfield: what the connected repos actually use, from their code-maps -->
287
+ ```
288
+
289
+ **Ask (greenfield — nothing is built yet):**
290
+ - What does the team already know well? A stack nobody knows is a risk, not a choice.
291
+ - What does the product need that narrows the choice (offline use, a phone app, heavy data, a region
292
+ the data must stay in)?
293
+ - For each choice: what else did you consider, and why not that?
294
+
295
+ **A good answer:** for each heading, the **decision**, the **alternatives rejected** and **why**, in a
296
+ line or two each. Say what would make you change the choice later. On a greenfield product this records
297
+ intended choices; nothing has to exist yet.
298
+
299
+ **The reviewer checks:** does every choice have a reason tied to this product or this team? Is anything
300
+ chosen that `mvp.md` does not need yet?
301
+
302
+ **Example (Tally):**
303
+
304
+ ```markdown
305
+ ## Languages and frameworks
306
+ TypeScript everywhere. Web app in React; no native app for the MVP (a phone browser is enough).
307
+ Rejected: a native app first — two codebases before we know people want it.
308
+
309
+ ## Hosting and runtime
310
+ One Node service on a managed platform in the EU. Rejected: running our own servers — no one to run them.
311
+
312
+ ## Data stores
313
+ PostgreSQL. Balances must add up exactly, so we want transactions. Rejected: a document store.
314
+ ```
315
+
316
+ ### `repos.md`
317
+
318
+ ```markdown
319
+ ## Layout
320
+ <!-- monorepo or separate repos, and why -->
321
+ | Repo | What it does |
322
+ |------|--------------|
323
+ ```
324
+
325
+ **Ask (greenfield):**
326
+ - How many deployable parts does the MVP have?
327
+ - Will different people or teams own different parts?
328
+ - Do the parts release together, or on their own schedules?
329
+
330
+ **A good answer:** the layout decision (one repo, or several) with the reason, and a table with one row
331
+ per repo. Each row says what the repo does in one line. On a greenfield product the repos may not exist
332
+ yet — list what you intend to create.
333
+
334
+ **The reviewer checks:** does every part in `stack.md` have a home here? Is the reason for the layout
335
+ about how the team works, not just taste?
336
+
337
+ **Example (Tally):**
338
+
339
+ ```markdown
340
+ ## Layout
341
+ One repo for now. One small team owns everything and it all releases together; we split when a second
342
+ team joins.
343
+
344
+ | Repo | What it does |
345
+ |------|--------------|
346
+ | tally | The web app, the API and the database migrations |
347
+ ```
348
+
349
+ ### `risks.md` *(optional)*
350
+
351
+ ```markdown
352
+ | Risk | Why it could kill this | What we do about it |
353
+ |------|------------------------|---------------------|
354
+ ```
355
+
356
+ **Ask:**
357
+ - What would make this fail even if it is built well?
358
+ - What are you assuming about users, the market, or the law that might be wrong?
359
+ - For each risk: what is the cheapest way to find out early?
360
+
361
+ **A good answer:** three to six risks, each with a concrete action — a test, a limit, or a decision
362
+ point — not "monitor closely".
363
+
364
+ **The reviewer checks:** is the biggest risk the team talks about in private written here? Does each
365
+ action happen before the risk would hurt?
366
+
367
+ **Example (Tally):**
368
+
369
+ ```markdown
370
+ | Risk | Why it could kill this | What we do about it |
371
+ |------|------------------------|---------------------|
372
+ | Only one flatmate uses it | The ledger is useless if others do not log | Measure second-member activity from week 1; stop if under 20% |
373
+ | People want it to move money | "Not a payment app" loses them | Ask the first 20 flats; revisit scope.md at 8 weeks |
374
+ ```
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: yad-docs
3
- description: 'Generates the per-epic interactive documentation site — a vendored React/Vite/Tailwind SPA with an animated flow canvas and role-based stakeholder doc pages — from the epic''s approved artifacts (epic, architecture, the locked contract, UI design, stories, code-context, test cases). Themes it from the design tokens, wires the docs.json base path, and drives `yad docs build/deploy` to publish to Pages (or build-only when no target). This is an OUTPUT ENRICHMENT, never a gated front state: it never mutates state.json steps, approvals, or the contract lock. Use when the user says "generate the docs site", "build the interactive docs", or "deploy the epic docs".'
3
+ description: 'Generates the per-epic interactive documentation site — a vendored React/Vite/Tailwind SPA with an animated flow canvas and role-based stakeholder doc pages — from the epic''s approved artifacts (epic, architecture, the locked contract, UI design, stories, code-context, test cases). Themes it from the design tokens, wires the docs.json base path, and drives `yad docs build/deploy` to publish to Pages (or build-only when no target). This is an OUTPUT ENRICHMENT, never a gated Shape step: it never mutates state.json steps, approvals, or the contract lock. Use when the user says "generate the docs site", "build the interactive docs", or "deploy the epic docs".'
4
4
  ---
5
5
 
6
6
  # SDLC — Author the Interactive Docs Site (per-epic, output enrichment)
@@ -12,14 +12,14 @@ stakeholder doc pages** (each lens → a set of doc sections). The shell is gene
12
12
  generated entirely into `src/data/*.ts` and the theme into `src/index.css`.
13
13
 
14
14
  This is an **output enrichment**, exactly like `design-links.json` / `test-links.json` — **NOT a gated
15
- front state.** It **never** mutates `.sdlc/state.json` `steps[]`, `approvals.json`, or
15
+ Shape step.** It **never** mutates `.sdlc/state.json` `steps[]`, `approvals.json`, or
16
16
  `contract-lock.json`, and it never adds a `state.json` step. It reads the *approved* shape and renders
17
17
  it; it never decides approval. When a docs target is connected (`yad-connect-docs` → `.sdlc/docs.json`)
18
18
  the site is built + deployed; when none is, it is npm-built to a local `dist/` (build-only).
19
19
 
20
20
  ## Conventions
21
21
 
22
- - `{project-root}` resolves from the project working directory (the **product hub**).
22
+ - `{project-root}` resolves from the project working directory (the **Product**).
23
23
  - Artifacts live under `{project-root}/epics/EP-<slug>/`. The generated site lives at
24
24
  `epics/EP-<slug>/docs-site/`; its `dist/` and `node_modules/` are gitignored, the generated **source
25
25
  is committed**.
@@ -30,7 +30,7 @@ the site is built + deployed; when none is, it is npm-built to a local `dist/` (
30
30
  - The actual data-file **generation** (reading artifacts → writing `src/data/*.ts`, theming
31
31
  `index.css`) is the **AI step** inside this skill; the `yad docs` CLI only does the npm build +
32
32
  platform deploy + staleness hashing.
33
- - Speak in the configured `communication_language`; write documents in `document_output_language`.
33
+ - Speak in the `communication_language` set in `{project-root}/.sdlc/config.yaml`; write documents in `document_output_language`.
34
34
 
35
35
  ## Inputs
36
36
 
@@ -52,7 +52,7 @@ and point the user at the gate (`yad-review-gate`); do not render an unapproved
52
52
  Open the `docs/EP-<slug>` authoring branch per the shared procedure
53
53
  (`../yad-epic/references/state-schema.md` → "Authoring branches"): git-safe (skip with a note if
54
54
  `{project-root}` is not a git work tree), check out the branch if it exists, else create it from the
55
- hub's default branch. Generate and commit the site source on it.
55
+ Product's default branch. Generate and commit the site source on it.
56
56
 
57
57
  ### Step 2 — Read the inputs (the data sources)
58
58
  Load each artifact and note what it feeds (full table in `references/data-mapping.md`):
@@ -85,9 +85,11 @@ Copy the shell from `templates/app/` **verbatim**, then:
85
85
  timestamps inside the data files** — so regenerating an unchanged input yields a byte-identical file
86
86
  (the staleness hash depends on it). Data must satisfy `src/data/types.ts`
87
87
  (`FlowPath`/`FlowStep`/`AnimatedMessage`/`SystemComponent`/`StakeholderView`, etc.).
88
- 2. **Derive stakeholder roles** (`roles.ts`) from the hub roster roles (`.sdlc/hub.json`) ∩ the yadflow
89
- lens set (analyst / pm / architect / ux / dev / tester / reviewer / engineer) ∩ the stories' `repos:`
90
- tags — each role → its relevant doc `sectionIds` + `relevantPathIds` (`references/data-mapping.md`).
88
+ 2. **Derive stakeholder roles** (`roles.ts`) from the yadflow lens set (analyst / pm / architect / ux /
89
+ dev / tester / reviewer / engineer), kept only where the epic's artifacts give that lens something to
90
+ read (which steps have artifacts, and the stories' `repos:` tags). No people or roles are read from
91
+ `.sdlc/hub.json` — yadflow keeps no list of people. Each role → its relevant doc `sectionIds` +
92
+ `relevantPathIds` (`references/data-mapping.md`).
91
93
  3. **Theme the `:root` block of `src/index.css`** from the design tokens, by the 4-tier priority in
92
94
  `references/theme-map.md`: **DESIGN.md → design.json/design-links.json palette → code-map tokens →
93
95
  default theme** (stamp `theme: default` in the manifest when it falls through to the shell default).
@@ -107,7 +109,7 @@ Write `epics/EP-<slug>/.sdlc/docs-build.json` — the baseline `yad-docs-sync` c
107
109
  "artifactHash": "<sha256 of epic.md + architecture.md + contract.md CONTRACT-SURFACE + ui-design.md + each story>",
108
110
  "repoHeads": { "<repo>": "<HEAD sha>" },
109
111
  "deployUrl": "<url or null>",
110
- "templateVersion": "<shell template version>"
112
+ "shellVersion": "<the `version` in templates/app/package.json>"
111
113
  }
112
114
  ```
113
115
 
@@ -120,7 +122,10 @@ Optionally record a `docs:` line in a `DOCS.md` index under the epic.
120
122
  - `action: deploy` — drive **`yad docs deploy --epic <id>`**: it npm-builds the site (`npm ci && npm run
121
123
  build` as a subprocess, like `yad-spec` shelling `npx repomix`), ensures the Pages CI workflow is
122
124
  present, and reports the deploy URL (publish happens via CI). **Degrades** to the local `dist/` path
123
- when no platform CLI / `target: "none"` (build-only).
125
+ when no platform CLI / `target: "none"` (build-only). **A failed build exits 1**: if `npm ci` (or
126
+ `npm install`, when the site has no lockfile) or `npm run build` fails, or the site was never generated, the command names the site and exits 1 —
127
+ report that failure and give no deploy URL. npm missing from PATH is only a warning here (CI builds on
128
+ push). `--json` has `built` (a count) and `sites: [{ site, built, error }]`.
124
129
 
125
130
  ### Step 6 — Stop. Report (NEVER auto-advance)
126
131
  Report: the site path (`epics/EP-<slug>/docs-site/`), the data files produced, the **theme source** (or
@@ -152,7 +157,7 @@ the default-theme degrade), the **deploy URL** or "build-only", and the **stalen
152
157
  - The connected docs target + base-path resolution: `../yad-connect-docs/SKILL.md`.
153
158
  - The design tokens this themes from: `../yad-connect-design/SKILL.md`.
154
159
  - The code-context the data enriches: `../yad-connect-repos/SKILL.md`.
155
- - The authoring pattern (front-state author that writes link artifacts without gating):
160
+ - The authoring pattern (Shape step author that writes link artifacts without gating):
156
161
  `../yad-ui/SKILL.md`.
157
162
  - State schema + the "Authoring branches" procedure: `../yad-epic/references/state-schema.md`.
158
163
  - The project overview site + the staleness/CI reconciler: `../yad-docs-overview/SKILL.md`,
@@ -11,7 +11,7 @@ shell renders whatever these export, as long as it satisfies `src/data/types.ts`
11
11
  |----------------|---------|-------------------|-----------|
12
12
  | `components.ts` | `COMPONENTS: SystemComponent[]` | `architecture.md` system components + `code-map.md` module/endpoint names | each durable component → `{ id, label, icon, color, position, description }`; canvas `position` laid out deterministically; real module names from the code-map enrich `label`/`description`. |
13
13
  | `paths.ts` | `FLOW_PATHS: FlowPath[]` | `stories/*.md` (one FlowPath each) + `architecture.md` flows | each story → one `FlowPath` (`id`, `label`, `icon`, `color`, `category`, `steps[]`); each acceptance criterion → a `FlowStep` whose `messages: AnimatedMessage[]` animate the request/response/event/job and whose `sideEffects` record jobs/notifications/pubsub. UI states (from `ui-design.md`) annotate each step. |
14
- | `roles.ts` | `ROLES: RoleConfig[]` | hub roster (`.sdlc/hub.json`) + the yadflow lens set + stories' `repos:` tags | each stakeholder lens → `{ slug, label, shortLabel, icon, color, description, sectionIds, relevantPathIds }` (role derivation below). |
14
+ | `roles.ts` | `ROLES: RoleConfig[]` | the yadflow lens set + which artifacts the epic has + stories' `repos:` tags | each stakeholder lens → `{ slug, label, shortLabel, icon, color, description, sectionIds, relevantPathIds }` (role derivation below). |
15
15
  | `docSections.ts` | `DOC_SECTIONS: DocSectionConfig[]` | `epic.md`, `architecture.md`, `contract.md`, `ui-design.md`, `test-cases.md` | the ordered doc-section registry (`{ id, title, icon, iconColor, component }`); each section id is referenced from `roles.ts`. |
16
16
  | `referenceData.ts` | the reference tables/payloads the doc-section components render | `contract.md` CONTRACT-SURFACE (authoritative) + `architecture.md` + `test-cases.md` | API reference rows, the status machine, the DB schema, feature flags, error codes, the test plan — the structured data behind the doc sections. |
17
17
 
@@ -21,8 +21,8 @@ shell renders whatever these export, as long as it satisfies `src/data/types.ts`
21
21
  organized around a central hub into four surrounding zones** so the spokes fan out without crossing,
22
22
  rather than scattering nodes:
23
23
 
24
- - **Center** — the product hub (the brain).
25
- - **Top band** — the file ledger the hub owns (state / approvals / contract-lock), spread across one row.
24
+ - **Center** — the Product (the brain).
25
+ - **Top band** — the file ledger the Product owns (state / approvals / contract-lock), spread across one row.
26
26
  - **Left** — the code side: each connector with its external target just beyond it (`repos-json → code-repos`).
27
27
  - **Right** — the connected tools as a single aligned column: each connector on the inner edge with its
28
28
  external tool on the same row just outside it (`design-json → Design Tool`, etc.).
@@ -52,13 +52,15 @@ contract is rendered exactly as locked — the docs are a *view* of the locked s
52
52
 
53
53
  ## Role derivation (`roles.ts`)
54
54
 
55
- A stakeholder role is generated for each lens that is **both** present in the hub roster **and** relevant
56
- to this epic:
55
+ A stakeholder role is generated for each lens that is **relevant to this epic** — that is, the epic's
56
+ artifacts give the lens something to read. yadflow keeps no list of people, so no people or roles are
57
+ read from `.sdlc/hub.json`.
57
58
 
58
59
  1. Start from the **yadflow lens set**: `analyst`, `pm`, `architect`, `ux`, `dev`, `tester`, `reviewer`,
59
60
  `engineer`.
60
- 2. Intersect with the **hub roster** roles (`.sdlc/hub.json` `roster[].roles`) — only emit lenses the
61
- team actually has (an unmapped lens is dropped, never invented).
61
+ 2. Keep only the lenses the epic's artifacts support — for example `analyst` needs `analysis.md`, `ux`
62
+ needs `ui-design.md`, `tester` needs `test-cases.md`, and `dev`/`engineer` need at least one story
63
+ with a `repos:` tag. A lens with nothing to read is dropped, never invented.
62
64
  3. For the `dev`/`engineer` lenses, **fan out per `repos:` tag** present across the epic's stories (e.g.
63
65
  a `backend` dev role and a `mobile` dev role), so each repo audience gets its own integration view —
64
66
  mirroring the reference site's per-app dev roles.
@@ -2396,9 +2396,9 @@
2396
2396
  "license": "MIT"
2397
2397
  },
2398
2398
  "node_modules/js-yaml": {
2399
- "version": "4.3.1",
2400
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.1.tgz",
2401
- "integrity": "sha512-CY6crGq313MX8GkwvB7tzgp99vjQxY1++5y10/BKN/GUfHqWaOGQMNZkBvqSzsZKWk/ijwHlWzzkLulsGHhjWQ==",
2399
+ "version": "4.3.2",
2400
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.2.tgz",
2401
+ "integrity": "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==",
2402
2402
  "dev": true,
2403
2403
  "funding": [
2404
2404
  {
@@ -7,7 +7,7 @@ description: 'Generates the project-level SDLC-overview interactive site — the
7
7
 
8
8
  **Goal:** Render the **whole yadflow pipeline** — every stage from setup → ship — as an interactive site,
9
9
  reusing the same shell as the per-epic docs (`skills/yad-docs/templates/app/`). Where `yad-docs`
10
- animates one epic's flows, this animates the **workflow itself**: the front gates, the build half, the
10
+ animates one epic's flows, this animates the **workflow itself**: the Shape gates, Build, the
11
11
  automation dial, the setup connectors. The hand-maintained overview report stays the **main
12
12
  documentation at the Pages root** (`<base>/`, served from `public/report.html` and `public/index.html`);
13
13
  this interactive SPA mounts under `<base>/app/` and is reached from the report — the report links
@@ -19,14 +19,17 @@ It only reads the pipeline definition and writes a project-level site. When a do
19
19
 
20
20
  ## Conventions
21
21
 
22
- - `{project-root}` resolves from the project working directory (the **product hub**).
22
+ - `{project-root}` resolves from the project working directory (the **Product**).
23
23
  - The overview site lives at `{project-root}/docs/sdlc-site/`; its `dist/`/`node_modules/` are gitignored,
24
24
  the generated **source is committed**. The overview build manifest is `docs/sdlc-site/.docs-build.json`.
25
- - The shell template is `skills/yad-docs/templates/app/` — copied **verbatim**, themed only in the
26
- `:root` of `index.css`. Generated data satisfies `src/data/types.ts`.
25
+ - The shell template is `skills/yad-docs/templates/app/`. It is copied **only when `docs/sdlc-site/`
26
+ does not exist yet** — see Step 3. The overview site in this repo has since grown sections of its own
27
+ (for example CheckGates, CliReference, TwoDials, Glossary, ContractLock, ReviewGate, Connectors and the
28
+ Reference tables) and dropped the template's per-epic ones, so it is **updated in place, never
29
+ re-copied**. Generated data satisfies `src/data/types.ts`.
27
30
  - Theme: **yadflow's own brand palette** (the `:root` of the legacy report, now `docs/sdlc-site/public/report.html`) — for visual continuity with
28
31
  the existing overview, not an epic's design tokens.
29
- - Speak in the configured `communication_language`; write documents in `document_output_language`.
32
+ - Speak in the `communication_language` set in `{project-root}/.sdlc/config.yaml`; write documents in `document_output_language`.
30
33
 
31
34
  ## Inputs
32
35
 
@@ -39,8 +42,8 @@ It only reads the pipeline definition and writes a project-level site. When a do
39
42
  There is no epic; the inputs are the workflow's own config + manifest (full mapping in
40
43
  `references/pipeline-model.md`):
41
44
 
42
- - `skills/sdlc/config.yaml` — the front/back steps, the **two dials** (assistance, automation),
43
- defaults, the review-gate rule, the build conventions, the automation/trust thresholds.
45
+ - `skills/sdlc/config.yaml` — the Shape/Build steps, the **two dials** (`driver`/`assistance`, `advance`/`automation`),
46
+ defaults, the review-gate rule, the build conventions, the automation defaults.
44
47
  - `skills/sdlc/module-help.csv` — the **canonical skill manifest**: each skill's `phase`,
45
48
  `preceded-by` / `followed-by`, and `outputs`. This is the ordering source of truth.
46
49
  - `docs/diagrams/sdlc-overview.mmd` — the overview diagram (the node/edge shape + the node classes:
@@ -56,10 +59,10 @@ git work tree). Generate and commit on it.
56
59
  Map the pipeline onto the same data structures `yad-docs` uses (concrete mapping in
57
60
  `references/pipeline-model.md`):
58
61
 
59
- - **Flow paths** = the **phases** — `Setup`, `Front-zero` (discovery), `Front half`, `Build half`, `Automation`, `Change management` (feature threads).
62
+ - **Flow paths** = the **phases** — `Setup`, `Front-zero` (discovery), `Shape`, `Build`, `Automation`, `Change management` (feature threads).
60
63
  - **Flow steps** = the **skills/gates in order** (from `module-help.csv` `preceded-by`/`followed-by`),
61
64
  each step's `messages` = the skill's `outputs`, and `sideEffects` = the `.sdlc/` files it writes.
62
- - **System components** = the **durable state objects** — the product hub, each `.sdlc/*.json`
65
+ - **System components** = the **durable state objects** — the Product, each `.sdlc/*.json`
63
66
  (`state.json`, `approvals.json`, `repos.json`, `design.json`, `testing.json`, `learning.json`,
64
67
  `docs.json`, `contract-lock.json`, `build-state/*`, `trust-log.json`), the connected code repos, the
65
68
  design/testing/learning tools, and the platform.
@@ -67,7 +70,16 @@ Map the pipeline onto the same data structures `yad-docs` uses (concrete mapping
67
70
  to its relevant sections + paths.
68
71
 
69
72
  ### Step 3 — Generate the site into `docs/sdlc-site/`
70
- Copy the shell from `templates/app/` **verbatim**, generate `src/data/*.ts` deterministically (same
73
+ **First check whether `docs/sdlc-site/` already exists.**
74
+
75
+ - **It does not exist** (a first build): copy the shell from `templates/app/` verbatim, then do the rest
76
+ of this step.
77
+ - **It exists** (every build after the first): **do not copy the shell.** Copying it would overwrite the
78
+ site's own components and delete the sections the template does not have. Instead, update the site in
79
+ place: regenerate the data in `src/data/*.ts`, and edit a component only where the pipeline change
80
+ needs it. Before you finish, run `git status docs/sdlc-site/` and check that nothing was deleted.
81
+
82
+ Then generate `src/data/*.ts` deterministically (same
71
83
  determinism rules as `yad-docs`: stable-ID sort by skill pipeline order / phase, fixed key order, no
72
84
  timestamps in the data files), theme the `:root` of `index.css` from **yadflow's brand palette** — the
73
85
  the legacy report's `:root`: `--accent: #2471a3` and the node colors (`--artifact-*`, `--gate-*`,
@@ -84,13 +96,14 @@ Write `docs/sdlc-site/.docs-build.json` — `yad-docs-sync` compares against it:
84
96
  "theme": "yadflow-brand",
85
97
  "artifactHash": "<sha256 of config.yaml + module-help.csv + docs/diagrams/sdlc-overview.mmd>",
86
98
  "skillCount": <number of yad-* skills>,
87
- "deployUrl": "<url or null>",
88
- "templateVersion": "<shell template version = the yad CLI version>"
99
+ "deployUrl": "<url or null>"
89
100
  }
90
101
  ```
91
102
 
92
- The overview's freshness inputs are the **config + manifest + diagram** (plus the `templateVersion`, so a
93
- doc-shell upgrade triggers a rebuild). `skillCount` rides along in the manifest as an informational field
103
+ The overview's freshness inputs are the **config + manifest + diagram**. There is **no shell version**:
104
+ the overview is not re-copied from the shell (Step 3), so a shell upgrade is not a reason to rebuild it.
105
+ An older manifest may still carry a `templateVersion` (the yad CLI version); it is ignored, because it
106
+ made the overview read stale after every release. `skillCount` rides along in the manifest as an informational field
94
107
  — it is **not** a separate hash input, since `module-help.csv` already moves whenever the skill set does.
95
108
  Not per-epic artifacts/repo heads.
96
109
 
@@ -108,7 +121,8 @@ root. This generalizes the standing rule that feature work hand-updates the repo
108
121
  ### Step 6 — Build / deploy (`action`)
109
122
  - `action: generate` (default) — generate source + manifest; stop.
110
123
  - `action: deploy` — drive **`yad docs deploy --overview`**: npm-build, ensure the Pages CI workflow,
111
- report the deploy URL. Degrades to local `dist/` when no platform CLI / `target: "none"`.
124
+ report the deploy URL. Degrades to local `dist/` when no platform CLI / `target: "none"`. A failed
125
+ npm install or build exits 1 and names the site — report the failure, not a deploy URL.
112
126
 
113
127
  ### Step 7 — Stop. Report (no gate, no epic)
114
128
  Report: the site path (`docs/sdlc-site/`), the data files produced, that the theme is the yadflow brand
@@ -124,8 +138,9 @@ under `<base>/app/` and cross-linked. Never touches any epic state.
124
138
  work hand-updates `docs/index.html` + the overview diagram + skill counts: the overview site now
125
139
  regenerates whenever `module-help.csv` / `config.yaml` / the skill count changes — and `yad-docs-sync`
126
140
  **enforces** that (it flags the overview stale when those inputs move).
127
- - **Brand-palette themed, copy the shell verbatim.** Theme only the `:root`; generate only `src/data/*.ts`
128
- + the Vite base. Never hand-edit `templates/app/`.
141
+ - **Copy the shell once, then update in place.** The template is copied only into a missing
142
+ `docs/sdlc-site/`. An existing site is never re-copied over, because that deletes its own sections.
143
+ Theme only the `:root`. Never hand-edit `templates/app/` for the overview's sake.
129
144
  - **Deterministic generation.** Same stable-sort / fixed-key / no-timestamp discipline as `yad-docs`.
130
145
  - **Degrade gracefully.** No docs target → build-only; no `.mmd` / no build-plan docs → omit those
131
146
  sections with a note, never invent.