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
@@ -1,6 +1,6 @@
1
1
  # Design registry — schema + freshness rule
2
2
 
3
- The registry is the product hub's record of which design tool is connected and how to reach it. It is
3
+ The registry is the Product's record of which design tool is connected and how to reach it. It is
4
4
  **project-wide** (one design tool per project, shared across every epic), so it lives at the product
5
5
  root, not under any `epics/EP-<slug>/.sdlc/`.
6
6
 
@@ -51,6 +51,6 @@ only). This mirrors how `repos.json` and `hub.json` are committed.
51
51
 
52
52
  ## Greenfield
53
53
 
54
- A brand-new product hub has no `design.json`. That is valid — `yad-ui` treats "no design tool connected"
54
+ A brand-new Product has no `design.json`. That is valid — `yad-ui` treats "no design tool connected"
55
55
  the same as `tool: "none"` and produces the Markdown artifacts only. The registry appears the first time
56
56
  `connect` runs.
@@ -1,16 +1,16 @@
1
1
  ---
2
2
  name: yad-connect-docs
3
- description: 'Connects a docs/Pages publishing target to the product hub so the interactive-docs steps can build and deploy the generated SPA — not just commit its source. Registers the target into the project-wide .sdlc/docs.json (GitHub Pages / GitLab Pages / build-only), auto-detecting the platform from .sdlc/hub.json and resolving the Vite base path, with local-user auth and no stored tokens. Detects whether gh/glab is present and degrades to build-only when absent. Run at setup or any time the publish target changes. Reusable, idempotent, refreshable. Use when the user says "connect docs", "connect Pages", "refresh the docs connection", or "list the docs connection".'
3
+ description: 'Connects a docs/Pages publishing target to the Product so the interactive-docs steps can build and deploy the generated SPA — not just commit its source. Registers the target into the project-wide .sdlc/docs.json (GitHub Pages / GitLab Pages / build-only), auto-detecting the platform from .sdlc/hub.json and resolving the Vite base path, with local-user auth and no stored tokens. Detects whether gh/glab is present and degrades to build-only when absent. Run at setup or any time the publish target changes. Reusable, idempotent, refreshable. Use when the user says "connect docs", "connect Pages", "refresh the docs connection", or "list the docs connection".'
4
4
  ---
5
5
 
6
6
  # SDLC — Connect a Docs/Pages Target (make the docs steps publishable)
7
7
 
8
8
  **Goal:** Let the interactive-docs steps (`yad-docs` per epic, `yad-docs-overview` project-wide)
9
9
  **build and deploy** the generated React/Vite SPA to a real URL — a GitHub Pages or GitLab Pages site —
10
- instead of only committing its source. This skill **connects** a publishing target to the product hub
10
+ instead of only committing its source. This skill **connects** a publishing target to the Product
11
11
  and records *how* to reach it (the platform, the publish scope, the base path) — never a credential.
12
12
 
13
- This is **setup/maintenance**, not a gated front state — it never touches `.sdlc/state.json` or any
13
+ This is **setup/maintenance**, not a gated Shape step — it never touches `.sdlc/state.json` or any
14
14
  epic's approvals. It only writes the project-wide docs registry. `yad-docs` / `yad-docs-overview`
15
15
  consume it: when a target is connected, they theme + generate the site and drive `yad docs deploy`;
16
16
  when nothing is connected (`target: "none"`), they still generate and **npm-build** the site but stop
@@ -18,9 +18,9 @@ at a local `dist/` — build-only, no publish, exactly as before.
18
18
 
19
19
  ## Conventions
20
20
 
21
- - `{project-root}` resolves from the project working directory (the **product hub**).
21
+ - `{project-root}` resolves from the project working directory (the **Product**).
22
22
  - The target is **GitHub-Pages-first but pluggable** — a *publish adapter*, mirroring the GitHub/GitLab
23
- platform adapter the hub already uses. `github-pages` and `gitlab-pages` are the providers; `none` →
23
+ platform adapter the Product already uses. `github-pages` and `gitlab-pages` are the providers; `none` →
24
24
  build-only (deliberate, no error).
25
25
  - The platform CLI (`gh` / `glab`) is a **subprocess**, used read/deploy-only via the user's own auth —
26
26
  never installed by this skill, never given a token. Absent ⇒ degrade to build-only (`source:
@@ -29,15 +29,15 @@ at a local `dist/` — build-only, no publish, exactly as before.
29
29
  NOT per-epic), the sibling of `.sdlc/hub.json`, `.sdlc/repos.json`, and `.sdlc/design.json`.
30
30
  - Per-epic / overview build manifests (`docs-build.json`) are written later by `yad-docs` /
31
31
  `yad-docs-overview`, not here. This skill describes the *connection*; it does not build.
32
- - 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`.
33
33
 
34
34
  ## Inputs
35
35
 
36
36
  - `action` — `connect` (default) | `refresh` | `list` | `disconnect`.
37
37
  - `target` — `github-pages` | `gitlab-pages` | `none`. Default **auto-detected** from `.sdlc/hub.json`
38
- `platform` (github → `github-pages`, gitlab → `gitlab-pages`, null/no hub → `none`).
38
+ `platform` (github → `github-pages`, gitlab → `gitlab-pages`, null/no Product → `none`).
39
39
  - `scope` — `hub` (default) | `<repo-name>` | `dedicated`. Where the Pages site is published from (the
40
- hub repo, one connected code repo, or a dedicated docs repo).
40
+ Product repo, one connected code repo, or a dedicated docs repo).
41
41
  - `public` — `true` (default) | `false`. Whether the published site is public.
42
42
  - `base_path` — optional explicit override of the Vite `base` (otherwise resolved, Step 2).
43
43
 
@@ -45,7 +45,7 @@ at a local `dist/` — build-only, no publish, exactly as before.
45
45
 
46
46
  ### Step 1 — Resolve the target + detect the platform (the publish adapter)
47
47
  Determine the `target`. If not given, read `{project-root}/.sdlc/hub.json` `platform` and map it the same
48
- way the hub bridge maps repos: `github` → `github-pages`, `gitlab` → `gitlab-pages`, `null`/no hub →
48
+ way the Product bridge maps repos: `github` → `github-pages`, `gitlab` → `gitlab-pages`, `null`/no Product →
49
49
  `none` (deliberate build-only). Reject a `target` value outside the three providers (fall back to the
50
50
  detected default with a warning, the way `registerRepo` falls back on an unknown platform).
51
51
 
@@ -61,7 +61,7 @@ tokens**; everything in the registry is a plain reference. Do **not** install a
61
61
 
62
62
  ### Step 2 — Decide the publish scope + resolve the base path
63
63
  Resolve `scope` → `publishRepo`:
64
- - `hub` (default) → publish from the hub repo (read its name from `hub.json` `git_url`).
64
+ - `hub` (default) → publish from the Product repo (read its name from `hub.json` `git_url`).
65
65
  - `<repo-name>` → publish from that connected code repo (must exist in `.sdlc/repos.json`).
66
66
  - `dedicated` → a dedicated docs repo the user names (recorded as `publishRepo`).
67
67
 
@@ -109,7 +109,7 @@ the site here — `yad-docs` builds.**
109
109
  **available/unavailable** flag for the platform CLI (best-effort, the user's own session). No target
110
110
  connected ⇒ "build-only".
111
111
  - **`disconnect`** — remove the registry file (or set `target: "none"`). The platform's own Pages site is
112
- **never touched** — only the hub's record of it.
112
+ **never touched** — only the Product's record of it.
113
113
 
114
114
  ## Hard rules
115
115
 
@@ -127,6 +127,6 @@ the site here — `yad-docs` builds.**
127
127
  - Registry schema, the base-path resolution table, and the freshness/degrade rules:
128
128
  `references/docs-registry.md`.
129
129
  - The connect pattern this mirrors (design tool): `../yad-connect-design/SKILL.md`.
130
- - The connect pattern this mirrors (code repos + hub detection): `../yad-connect-repos/SKILL.md`.
130
+ - The connect pattern this mirrors (code repos + Product detection): `../yad-connect-repos/SKILL.md`.
131
131
  - The consumers — how `yad-docs` / `yad-docs-overview` build + deploy: `../yad-docs/SKILL.md`,
132
132
  `../yad-docs-overview/SKILL.md`.
@@ -38,7 +38,7 @@ Holds **no credentials** — every field is a plain reference. Auth is always th
38
38
 
39
39
  ## Platform auto-detection (from `.sdlc/hub.json`)
40
40
 
41
- When `target` is not given, map the hub's `platform` the same way `yad-connect-repos` maps a repo host:
41
+ When `target` is not given, map the Product's `platform` the same way `yad-connect-repos` maps a repo host:
42
42
 
43
43
  | `hub.json` `platform` | default `target` |
44
44
  |-----------------------|------------------|
@@ -1,13 +1,13 @@
1
1
  ---
2
2
  name: yad-connect-learning
3
- description: 'Connects a learning/tutoring tool (DeepTutor, or another tool — pluggable) to the product hub so the cross-cutting learning layer can tutor any team member, at any SDLC stage, in the context of what is being built. Registers the tool into the project-wide .sdlc/learning.json (local-user auth, no stored tokens), detecting whether the DeepTutor CLI is on PATH and degrading to harness-native tutoring (the harness model reading project artifacts) when it is not. Optionally builds a project knowledge base from the SDLC artifacts + secret-scanned code-maps so tutoring is grounded. Run at setup or any time the learning tool changes. Reusable, idempotent, refreshable. Use when the user says "connect DeepTutor", "connect a learning tool", "refresh the learning connection", or "list the learning connection".'
3
+ description: 'Connects a learning/tutoring tool (DeepTutor, or another tool — pluggable) to the Product so the cross-cutting learning layer can tutor any team member, at any SDLC stage, in the context of what is being built. Registers the tool into the project-wide .sdlc/learning.json (local-user auth, no stored tokens), detecting whether the DeepTutor CLI is on PATH and degrading to harness-native tutoring (the harness model reading project artifacts) when it is not. Optionally builds a project knowledge base from the SDLC artifacts + secret-scanned code-maps so tutoring is grounded. Run at setup or any time the learning tool changes. Reusable, idempotent, refreshable. Use when the user says "connect DeepTutor", "connect a learning tool", "refresh the learning connection", or "list the learning connection".'
4
4
  ---
5
5
 
6
6
  # SDLC — Connect a Learning Tool (the cross-cutting learning layer)
7
7
 
8
8
  **Goal:** Let any team member pause at **any** SDLC stage and ask to learn a concept — and get tutored
9
9
  *in the context of what the team is actually building*. This skill **connects** a learning tool such as
10
- **DeepTutor** to the product hub and records *how* to reach it (the tool, the CLI, an optional grounded
10
+ **DeepTutor** to the Product and records *how* to reach it (the tool, the CLI, an optional grounded
11
11
  knowledge base) — never a credential. The consumer skill **`yad-learn`** does the tutoring per request
12
12
  and records the team's skills.
13
13
 
@@ -19,7 +19,7 @@ explains the concept. The learning layer is **purely opt-in and never blocks a g
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 integration is **DeepTutor-first but pluggable** (`config.yaml` `learning.tools`): a learning-tool
24
24
  *adapter*, like the design/testing adapters. `none` → harness-native (yad-learn still tutors via the
25
25
  harness model).
@@ -30,7 +30,7 @@ explains the concept. The learning layer is **purely opt-in and never blocks a g
30
30
  the sibling of `.sdlc/repos.json`, `.sdlc/hub.json`, `.sdlc/design.json`, and `.sdlc/testing.json`.
31
31
  - Per-epic, per-member learning records + rendered tutorials are written later by `yad-learn`
32
32
  (`epics/EP-<slug>/.sdlc/learning-records.json` and `epics/EP-<slug>/learning/`), not here.
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
 
@@ -113,7 +113,7 @@ auto-advances; this is setup.
113
113
  **available/harness-native** flag for the CLI (best-effort). No learning tool connected ⇒
114
114
  "harness-native".
115
115
  - **`disconnect`** — remove the registry file (or set `tool: "none"`). DeepTutor's own config and
116
- knowledge bases are **never touched** — only the hub's record of them.
116
+ knowledge bases are **never touched** — only the Product's record of them.
117
117
 
118
118
  ## Hard rules
119
119
 
@@ -1,6 +1,6 @@
1
1
  # Learning registry — schema + freshness rule
2
2
 
3
- The registry is the product hub's record of which learning tool is connected and how to reach it. It is
3
+ The registry is the Product's record of which learning tool is connected and how to reach it. It is
4
4
  **project-wide** (one learning tool per project, shared across every epic), so it lives at the product
5
5
  root, not under any `epics/EP-<slug>/.sdlc/`.
6
6
 
@@ -55,6 +55,6 @@ only). This mirrors how `repos.json`, `hub.json`, `design.json`, and `testing.js
55
55
 
56
56
  ## Greenfield
57
57
 
58
- A brand-new product hub has no `learning.json`. That is valid — `yad-learn` treats "no learning tool
58
+ A brand-new Product has no `learning.json`. That is valid — `yad-learn` treats "no learning tool
59
59
  connected" the same as `tool: "none"` and tutors harness-native. The registry appears the first time
60
60
  `connect` runs.
@@ -1,25 +1,25 @@
1
1
  ---
2
2
  name: yad-connect-repos
3
- description: 'Connects code repos to the product hub so the front/"brain" phases are code-aware. Registers N code repos (GitHub or GitLab, local-user auth, no stored tokens) into the project-wide .sdlc/repos.json, then caches an AI-readable picture of each — a compressed Repomix pack and a lightweight code-map (existing endpoints/events/data-models/modules), secret-scanned. Run at one-time setup or any time a new repo is added. Reusable, idempotent, refreshable; staleness is tracked by HEAD sha. `yad repo refresh --push` publishes the refreshed code-maps + registry to the hub default branch as a chore(hub): sync code-context [skip ci] audit commit. Use when the user says "connect a repo", "connect the code repos", "refresh the code context", "list connected repos", or "push the code-map refresh".'
3
+ description: 'Connects code repos to the Product so the front/"brain" phases are code-aware. Registers N code repos (GitHub or GitLab, local-user auth, no stored tokens) into the project-wide .sdlc/repos.json, then caches an AI-readable picture of each — a compressed Repomix pack and a lightweight code-map (existing endpoints/events/data-models/modules), secret-scanned. Run at one-time setup or any time a new repo is added. Reusable, idempotent, refreshable; staleness is tracked by HEAD sha. `yad repo refresh --push` publishes the refreshed code-maps + registry to the Product default branch as a chore(hub): sync code-context [skip ci] audit commit. Also drafts each code repo's risk map (.sdlc/risk-map — a level per directory, no names), classified by reading the code and marked guessed for a person to confirm. Use when the user says "connect a repo", "connect the code repos", "refresh the code context", "list connected repos", or "push the code-map refresh".'
4
4
  ---
5
5
 
6
6
  # SDLC — Connect Code Repos (make the brain code-aware)
7
7
 
8
8
  **Goal:** Give the front/"brain" phases (`yad-epic` → `-architecture` → `-ui` → `-stories`)
9
9
  full context about what **already exists** in the code, so the AI does not author a contract, UI, or
10
- stories that contradict or duplicate what is built. This skill **connects** code repos to the product
11
- hub and caches an AI-readable picture of each. It is the product → code half of the 2-way link (the
10
+ stories that contradict or duplicate what is built. This skill **connects** code repos to the Product and caches an AI-readable picture of each. It is the product → code half of the 2-way link (the
12
11
  code → product half is the existing `link.md` back-pointer each spec carries).
13
12
 
14
- This is **setup/maintenance**, not a gated front state — it never touches `.sdlc/state.json` or any
15
- epic's approvals. It only writes the project-wide registry and the per-repo context cache.
13
+ This is **setup/maintenance**, not a gated Shape step — it never touches `.sdlc/state.json` or any
14
+ epic's approvals. It writes the project-wide registry, the per-repo context cache, and — in the code
15
+ repo itself — a draft of that repo's risk map (Step 3b), which the team commits there through a PR.
16
16
 
17
17
  ## Conventions
18
18
 
19
- - `{project-root}` resolves from the project working directory (the **product hub**).
20
- - The **product repo is the front-phase toolchain hub** (`config.yaml` `code_context`): Repomix (and
19
+ - `{project-root}` resolves from the project working directory (the **Product**).
20
+ - The **product repo is where the Shape phase toolchain runs** (`config.yaml` `code_context`): Repomix (and
21
21
  Impeccable, later) are installed/run **here** and target the connected code repos **by path**. The
22
- code repos themselves need no install for this. (The build-half CI gates are the exception — they
22
+ code repos themselves need no install for this. (The Build CI gates are the exception — they
23
23
  live inside each code repo; see `yad-checks`.)
24
24
  - **Repomix is a true CLI subprocess** (Phase 0 / RESEARCH-NOTES §3): `npx repomix@latest [flags]` —
25
25
  NOT a slash-command. It secret-scans by default (Secretlint).
@@ -28,18 +28,15 @@ epic's approvals. It only writes the project-wide registry and the per-repo cont
28
28
 
29
29
  ## Inputs
30
30
 
31
- - `action` — `connect` | `refresh` | `list` | `disconnect` | `detect-hub` | `roster` (default `connect`).
31
+ - `action` — `connect` | `refresh` | `list` | `disconnect` | `detect-hub` (default `connect`).
32
32
  - `repo` — the repo's short name (the key used in stories' `repos:` tag, e.g. `backend`).
33
- - `login`, `name`, `email`, `roles` — for `roster` (map login → name + commit email + the per-scope
34
- `roles` map, e.g. `roles: hub=owner,reviewer backend=domain-owner`). Validate the login against the
35
- hub (`gh api users/<login>` / `glab api users?username=`); a miss is flagged `unverified` (warn-only).
36
33
  - `path` — local path to the code repo (relative to `{project-root}` or absolute). For local repos.
37
34
  It must resolve inside the **workspace** — the project root's parent — so the standard layout, where
38
- the code repos sit **beside** the hub rather than under it, registers as `../backend`:
35
+ the code repos sit **beside** the Product rather than under it, registers as `../backend`:
39
36
 
40
37
  ```text
41
38
  project/ <- the workspace (containment boundary)
42
- product/ <- the hub repo; `yad setup` runs here
39
+ product/ <- the Product repo; `yad setup` runs here
43
40
  backend/ <- ../backend
44
41
  frontend/ <- ../frontend
45
42
  ```
@@ -49,12 +46,13 @@ epic's approvals. It only writes the project-wide registry and the per-repo cont
49
46
  later used as a working directory (repomix) and written into (`.coderabbit.yaml`, CI wiring).
50
47
  It is stored **exactly as typed**; every consumer re-resolves it against the project root.
51
48
 
52
- The workspace is the trust boundary, so **put the hub one level below it** (`project/product`), not
53
- directly in `$HOME` — with the hub at `~/product` the workspace becomes `~` and every home-dir
49
+ The workspace is the trust boundary, so **put the Product one level below it** (`project/product`), not
50
+ directly in `$HOME` — with the Product at `~/product` the workspace becomes `~` and every home-dir
54
51
  sibling turns into a registrable repo. The workspace directory itself (`..`) is never registrable.
55
52
  - `git_url` — optional remote (SSH or HTTPS; GitHub or GitLab). Used when the repo is not yet on disk.
56
- - `domain_owners` — the engineer(s) who own this repo's domain (a repo may have several; drives per-repo
57
- review routing). Each name is also written into that person's `roles[<repo>]` map in `hub.json`.
53
+
54
+ yadflow keeps **no list of people** (E62): no roster, no roles, no repo owners, no commit emails. Do not
55
+ ask for them and do not write them.
58
56
 
59
57
  ## On Activation
60
58
 
@@ -90,9 +88,33 @@ Feed the pack to the AI with the **"describe what exists, do not invent"** instr
90
88
  (`references/code-context.md`) and write `{project-root}/.sdlc/code-context/<repo>/code-map.md`: a small
91
89
  index of **stack/conventions, entry points, public endpoints/APIs, events, data models/entities, and
92
90
  module layout**. Mark anything unclear `<!-- unverified: ... -->`; never fill gaps with invented
93
- behaviour. This is the cheap artifact every front phase loads by default (the full pack is read only
91
+ behaviour. This is the cheap artifact every Shape phase loads by default (the full pack is read only
94
92
  when a phase needs depth).
95
93
 
94
+ ### Step 3b — Draft the risk map (a level per directory, from the code)
95
+ Each code repo keeps `.sdlc/risk-map` **in the code repo**: one line per directory saying `high`, `medium`
96
+ or `low`, and **no names** (E65). Format, rubric and edit rules: `references/risk-map.md`.
97
+
98
+ 1. Run `yad risk-map draft <path>` with the repo's **path**, not its name: on a first `connect` the repo is
99
+ not in `repos.json` until Step 4, and a name it does not know is refused. It adds an `unset` line for
100
+ every directory no line covers and never changes a line that is already there.
101
+ 2. For every `unset` line, **read the code in that directory** — the pack, the code-map, and the files
102
+ themselves when those do not say — and decide the level by the rubric. Judge by what the code does,
103
+ never by the folder's name — with one exception, `.sdlc/`, which is `high` because it holds the risk
104
+ map (see the rubric). Write the level, `guessed`, and a one-line reason from the code
105
+ (`src/payments/ high guessed # charge.js calls the card processor`). When unsure between two levels,
106
+ choose the higher one. When a directory's parts differ, add a deeper line for each part.
107
+ 3. A `guessed` line may be re-levelled if the code says otherwise — except `.sdlc/`, which is raised to
108
+ `high` if it is not (the rubric's one exception). **Never edit, re-level or delete a `confirmed` line**:
109
+ when the code now contradicts one, report it as a suggestion for a person. Never mark anything
110
+ `confirmed` — only a person does that. Write no name, secret or customer value.
111
+ 4. Run `yad risk-map check <path>` and report what is left.
112
+ 5. Tell the person to review every `guessed` line, change the right ones to `confirmed`, and commit
113
+ `.sdlc/risk-map` **in the code repo, on a new branch, through a PR** — never straight to its default branch. Its `risk-map` check warns on that PR that the map
114
+ was edited — expected, and advisory.
115
+
116
+ With no AI agent available, stop after step 1 and tell the person the `unset` lines are theirs to fill.
117
+
96
118
  ### Step 4 — Record the repo in the registry
97
119
  Upsert the repo into `{project-root}/.sdlc/repos.json` (create the file if absent). Record the current
98
120
  HEAD sha as `syncedHead` (this drives staleness):
@@ -104,8 +126,6 @@ HEAD sha as `syncedHead` (this drives staleness):
104
126
  "path": "<path rel. to project-root>",
105
127
  "git_url": "<url or null>",
106
128
  "platform": "github|gitlab|null",
107
- "domain_owners": ["<owner>", "…"],
108
- "domain_owner": "<domain_owners[0] — legacy mirror>",
109
129
  "default_branch": "<branch>",
110
130
  "connectedAt": "<YYYY-MM-DD>",
111
131
  "lastSyncedAt": "<YYYY-MM-DD>",
@@ -118,20 +138,22 @@ HEAD sha as `syncedHead` (this drives staleness):
118
138
  }
119
139
  ```
120
140
  `connect` is **idempotent** — re-running it for an existing repo refreshes its entry in place. Adding a
121
- new repo later is the same `connect` action.
141
+ new repo later is the same `connect` action. Write no `domain_owner`/`domain_owners`; an entry an older
142
+ release wrote with them is left as it is (nothing reads them, and `yad doctor` warns
143
+ `people:domain-owners-unused`).
122
144
 
123
145
  ### Step 5 — Report
124
146
  Report the connected repo, its `platform`, the pack + code-map paths, the secret-scan result, and that
125
- the front phases will now load this repo's code-map. Nothing auto-advances; this is setup.
147
+ the Shape phases will now load this repo's code-map. Nothing auto-advances; this is setup.
126
148
 
127
149
  ## Other actions
128
150
 
129
- - **`refresh`** — re-run Steps 2–4 for an already-connected repo (after its code moves). Updates
151
+ - **`refresh`** — re-run Steps 2–4 (including Step 3b) for an already-connected repo (after its code moves). A new directory gets an `unset` line and a guess; a `confirmed` line is only ever suggested against. Updates
130
152
  `syncedHead` + `lastSyncedAt`. Same machinery as `connect`. Once the AI has regenerated the
131
- `code-map.md` (Step 3), publish it to the product hub with **`yad repo refresh <repo> --push`**: it
153
+ `code-map.md` (Step 3), publish it to the Product with **`yad repo refresh <repo> --push`**: it
132
154
  commits the tracked code-maps + `.sdlc/repos.json` (never the gitignored `pack.md`) as one
133
155
  audit-trail commit `chore(hub): sync code-context — <repos> by @<login> [skip ci]` and pushes it
134
- straight to the hub's **default branch** (add `--allow-branch` to commit on a non-default branch).
156
+ straight to the Product's **default branch** (add `--allow-branch` to commit on a non-default branch).
135
157
  This is the code-context analogue of `yad checkpoint` — human-owned machine state, no Task trailer,
136
158
  no Co-Authored-By.
137
159
  - **`list`** — print every registry entry with a **fresh/stale** flag: compare each repo's current HEAD
@@ -139,38 +161,51 @@ the front phases will now load this repo's code-map. Nothing auto-advances; this
139
161
  - **`disconnect`** — remove the repo from the registry and delete its cache dir. Leaves the **code repo
140
162
  itself untouched**.
141
163
 
142
- ## Hub detection + reviewer roster (the front-half review bridge)
164
+ ## Product detection (the Shape review bridge)
143
165
 
144
- The hub is itself a git repo on a platform. These actions record that so the front-half review/comment/
145
- approval cycle can run through a real PR/MR on the hub (`yad-review-gate` + `yad-hub-bridge`). They
146
- write only `{project-root}/.sdlc/hub.json` (`config.yaml` `hub.config`) — never an epic's state/approvals.
166
+ The Product is itself a git repo on a platform. This action records that so the Shape review/comment/
167
+ approval cycle can run through a real PR/MR on the Product (`yad-review-gate` + `yad-hub-bridge`). It
168
+ writes only `{project-root}/.sdlc/hub.json` (`config.yaml` `product.config` (older projects: `hub.config`)) — never an epic's state/approvals.
147
169
 
148
- - **`detect-hub`** — detect the hub's own platform and upsert `.sdlc/hub.json`. Run
149
- `git remote get-url origin` **on the hub** and read the host with the SAME logic Step 1 uses for code
170
+ - **`detect-hub`** — detect the Product's own platform and upsert `.sdlc/hub.json`. Run
171
+ `git remote get-url origin` **on the Product** and read the host with the SAME logic Step 1 uses for code
150
172
  repos: `github.com` → `github`, GitLab host → `gitlab`, no remote → `platform: null`. Record
151
- `git_url`, `default_branch`, `detectedAt`, and `bridge_enabled` — **`true` only when a platform was
152
- detected, `false` alongside `platform: null`** (preserve an existing roster). The two travel
153
- together: bridge mode is a platform AND the flag (`isBridge`, `cli/gate.mjs`), and `yad setup`
154
- derives both from one value, so writing the flag onto a platform-less hub creates a state no CLI
155
- path can produce and the gates read differently (#186).
173
+ `git_url`, `default_branch`, `detectedAt`, and **all three of** `ledger`, `bridge_enabled` and
174
+ `bridge`:
175
+
176
+ | a platform was detected | no platform (`platform: null`) |
177
+ |---|---|
178
+ | `"ledger": "verified"`, `bridge_enabled: true`, `bridge: true` | `"ledger": "local"`, `bridge_enabled: false`, `bridge: false` |
179
+
180
+ Write no `roster`. Leave any other key already in the file as it is — including a `roster` or
181
+ `verified_authors` an older release wrote. Neither decides anything (the roster's name → login pairs
182
+ only help the first sync recognise older approvals); `yad doctor` warns
183
+ `people:roster-unused` / `people:verified-authors-unused`, and nothing deletes them.
184
+
185
+ **`ledger` is the one that decides.** `isVerifiedLedger` (`cli/manifest.mjs`) reads it first and
186
+ falls back to the booleans only when it is absent — so on a project that has already run
187
+ `yad migrate`, writing `bridge_enabled: true` while leaving `"ledger": "local"` in place turns
188
+ verified mode ON in the file and OFF in the engine. Nothing would be wired, no guard would arm,
189
+ and the report would say it worked. Write all three, and keep them saying the same thing.
190
+
191
+ The booleans are still written because a check gate committed in the repo may predate
192
+ `yad update`; see `docs/migrations/shape-2.md`.
193
+
194
+ A platform and a verified ledger travel together: verified mode is a platform AND the switch
195
+ (`isVerifiedLedger`, `cli/manifest.mjs`), and `yad setup` derives both from one value, so marking a
196
+ platform-less Product verified creates a state no CLI path can produce and the gates read
197
+ differently (#186).
156
198
  Auth is the local user's own `gh`/`glab`/git; **store no tokens**. Idempotent — safe to re-run.
157
- - **`roster`** — set one roster entry mapping a platform `login` → SDLC `name` + `email` + a per-scope
158
- `roles` map (`roles: { hub: ["owner","reviewer"], <repo>: ["domain-owner", …] }`). Upsert by `login`;
159
- a person may hold several roles across several scopes, and a repo several people per role. Validate the
160
- `login` against the hub (warn-only; flag `unverified` on a miss). `domain-owner` is written into
161
- `roles[<repo>]` (and still **derived** as a fallback when a roster `name` equals a repo's
162
- `domain_owner`/`domain_owners` in `repos.json` — see `references/hub-config.md`). An unmapped login
163
- degrades to a plain `reviewer`, never auto-promoted to owner/domain-owner.
164
- **The deterministic half is the `yad roster` CLI command** — runnable any time, not just at setup:
165
- `yad roster list`; `yad roster add <login>` (upsert, then a repo-driven walk that asks for each
166
- connected repo's role); `yad roster grant|revoke <name> <repo> <role>`; `yad roster remove <login>`.
167
- A `domain-owner` grant/revoke keeps `repos.json` `domain_owners` in sync so the gate never drifts.
168
-
169
- If the hub has no remote (`platform: null`) or the bridge is disabled, the front-half gate runs
170
- file-only with no error — the bridge is purely additive.
199
+
200
+ There is **no roster action** (removed in E62). `yad roster` is gone too: typing it prints a notice and
201
+ exits 1. A team gate needs 1 approval from someone other than the author, and each approval records the
202
+ platform login that gave it. The platform, not a stored list, decides who can approve.
203
+
204
+ If the Product has no remote (`platform: null`) or the verified ledger is disabled, the Shape gate runs
205
+ local with no error — the verified ledger is purely additive.
171
206
 
172
207
  ## Live on-demand (the third context layer)
173
- The cached pack + map are the default. When a front phase needs an **area** not in the map, it may
208
+ The cached pack + map are the default. When a Shape phase needs an **area** not in the map, it may
174
209
  re-run Repomix **live**, scoped to that area:
175
210
  ```bash
176
211
  npx repomix@latest --compress --include "<area globs>" --style markdown -o -
@@ -188,11 +223,14 @@ it does not silently re-pack. Refreshing the cache is a human decision. Document
188
223
  - **Describe what exists; never invent.** The code-map records built behaviour, not a design.
189
224
  - **Setup, not a gate.** Never touch `.sdlc/state.json`, approvals, or the contract lock from here.
190
225
  - **Idempotent + refreshable.** `connect`/`refresh` are safe to re-run; staleness is HEAD-sha based.
226
+ - **The risk map holds no names, and the agent never confirms.** It fills `unset`, may re-level `guessed`,
227
+ and only suggests against `confirmed`.
191
228
 
192
229
  ## Reference
193
230
  - Registry schema + freshness rule: `references/repos-registry.md`.
194
- - Hub config + reviewer roster (the review bridge): `references/hub-config.md`.
231
+ - The risk map — format, rubric, what the agent may change: `references/risk-map.md`.
232
+ - Product config (the review bridge): `references/hub-config.md`.
195
233
  - Repomix command, secret-scan, degrade path, the code-map prompt, and live on-demand:
196
234
  `references/code-context.md`.
197
235
  - The repomix discipline this reuses (one-feature-at-a-time variant): `../yad-backfill/references/backfill.md`.
198
- - Repos convention + per-repo review routing: `../yad-stories/references/story-schema.md`.
236
+ - Repos convention: `../yad-stories/references/story-schema.md`.
@@ -6,7 +6,7 @@ variant; backfill is the one-feature-at-a-time variant).
6
6
 
7
7
  ## Layer 1 — the cached pack (full context)
8
8
 
9
- Run from the product hub, targeting the connected repo (flags from `config.yaml`
9
+ Run from the Product, targeting the connected repo (flags from `config.yaml`
10
10
  `code_context.pack_flags`):
11
11
 
12
12
  ```
@@ -64,12 +64,12 @@ source: repomix
64
64
  <!-- the main directories/modules and what each owns -->
65
65
  ```
66
66
 
67
- The code-map is deliberately small so every front phase can load it cheaply. The full `pack.md` is read
67
+ The code-map is deliberately small so every Shape phase can load it cheaply. The full `pack.md` is read
68
68
  only when a phase needs depth (the architecture phase, primarily).
69
69
 
70
70
  ## Layer 3 — live on-demand (a specific area, not a stale repo)
71
71
 
72
- When a front phase needs an area not captured in the code-map, it may re-pack that **slice** live,
72
+ When a Shape phase needs an area not captured in the code-map, it may re-pack that **slice** live,
73
73
  scoped to the area, without writing the cache:
74
74
 
75
75
  ```bash
@@ -81,11 +81,11 @@ side-effect:** when a repo is stale (HEAD ≠ `syncedHead`), the phase **flags i
81
81
  "`<repo>` is stale; run `yad repo refresh <repo>` to re-pack the cache + `syncedHead`" — rather than
82
82
  silently re-packing the whole repo. A phase never refreshes the registry on its own; the human runs
83
83
  `yad repo refresh` (or `yad check --fix`). After the AI regenerates the code-map, `yad repo refresh
84
- --push` publishes the refreshed code-maps + registry to the hub's default branch as a `chore(hub): sync
84
+ --push` publishes the refreshed code-maps + registry to the Product's default branch as a `chore(hub): sync
85
85
  code-context … [skip ci]` audit commit (never the pack's content; `--allow-branch` overrides the branch
86
86
  guard). The `pack.md` is gitignored — `yad repo refresh`/`yad setup` scaffold
87
- `.sdlc/code-context/*/pack.md` into the hub `.gitignore` (so a regenerated pack never dirties the tree),
88
- and a hub that tracked the pack *before* that ignore existed is self-healed: `--push` untracks it and
87
+ `.sdlc/code-context/*/pack.md` into the Product `.gitignore` (so a regenerated pack never dirties the tree),
88
+ and a Product that tracked the pack *before* that ignore existed is self-healed: `--push` untracks it and
89
89
  lands the removal + the managed `.gitignore` line in the same audit commit. The commit is a scoped
90
90
  `git commit -- <paths>` — it never sweeps unrelated staged work, and an unrelated hand-edit to
91
91
  `.gitignore` is left for the human to commit rather than riding the `[skip ci]` audit commit.