@open-agent-toolkit/cli 0.2.40 → 0.2.45

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 (213) hide show
  1. package/assets/agents/oat-codebase-mapper.md +15 -3
  2. package/assets/agents/oat-phase-implementer.md +34 -9
  3. package/assets/agents/oat-reviewer.md +2 -2
  4. package/assets/bundle-metadata.json +1 -1
  5. package/assets/docs/cli-utilities/configuration.md +11 -1
  6. package/assets/docs/cli-utilities/tool-packs.md +8 -0
  7. package/assets/docs/contributing/skills.md +67 -14
  8. package/assets/docs/quickstart.md +9 -0
  9. package/assets/docs/reference/cli-reference.md +56 -1
  10. package/assets/docs/reference/file-locations.md +18 -1
  11. package/assets/docs/reference/oat-directory-structure.md +20 -4
  12. package/assets/docs/workflows/projects/artifacts.md +27 -1
  13. package/assets/docs/workflows/projects/implementation-execution.md +22 -0
  14. package/assets/docs/workflows/projects/index.md +6 -0
  15. package/assets/docs/workflows/projects/lifecycle.md +19 -5
  16. package/assets/docs/workflows/projects/picking-up-projects.md +75 -0
  17. package/assets/docs/workflows/projects/pr-flow.md +22 -1
  18. package/assets/docs/workflows/projects/reviewing-oat-prs.md +60 -0
  19. package/assets/public-package-versions.json +4 -4
  20. package/assets/skills/analyze/SKILL.md +13 -5
  21. package/assets/skills/compare/SKILL.md +11 -2
  22. package/assets/skills/oat-brainstorm/SKILL.md +135 -32
  23. package/assets/skills/oat-brainstorm/references/destinations.md +9 -6
  24. package/assets/skills/oat-cursor-cloud-projects/SKILL.md +11 -1
  25. package/assets/skills/oat-dispatch-subagents/SKILL.md +19 -6
  26. package/assets/skills/oat-doctor/SKILL.md +8 -1
  27. package/assets/skills/oat-project-autonomous/SKILL.md +45 -1
  28. package/assets/skills/oat-project-autonomous/references/gate-inventory.md +8 -8
  29. package/assets/skills/oat-project-capture/SKILL.md +29 -9
  30. package/assets/skills/oat-project-complete/SKILL.md +610 -38
  31. package/assets/skills/oat-project-complete/scripts/parse-completion-retry-fields.mjs +265 -0
  32. package/assets/skills/oat-project-complete/scripts/recover-completion-receipts.mjs +764 -0
  33. package/assets/skills/oat-project-complete/scripts/resolve-completion-retry.mjs +134 -0
  34. package/assets/skills/oat-project-complete/scripts/validate-nonarchive-lifecycle-receipt.mjs +160 -0
  35. package/assets/skills/oat-project-design/SKILL.md +33 -9
  36. package/assets/skills/oat-project-discover/SKILL.md +16 -3
  37. package/assets/skills/oat-project-document/SKILL.md +10 -4
  38. package/assets/skills/oat-project-document/references/docs/autonomy-contract.md +8 -8
  39. package/assets/skills/oat-project-implement/SKILL.md +14 -3
  40. package/assets/skills/oat-project-implement/references/completion-and-closeout.md +18 -6
  41. package/assets/skills/oat-project-implement/references/docs/autonomy-contract.md +8 -8
  42. package/assets/skills/oat-project-implement/references/phase-execution.md +9 -3
  43. package/assets/skills/oat-project-implement/references/plan-and-resume.md +3 -0
  44. package/assets/skills/oat-project-import-plan/SKILL.md +15 -9
  45. package/assets/skills/oat-project-new/SKILL.md +7 -5
  46. package/assets/skills/oat-project-next/SKILL.md +32 -10
  47. package/assets/skills/oat-project-plan/SKILL.md +18 -3
  48. package/assets/skills/oat-project-pr-final/SKILL.md +23 -2
  49. package/assets/skills/oat-project-pr-final/references/docs/autonomy-contract.md +8 -8
  50. package/assets/skills/oat-project-pr-progress/SKILL.md +23 -2
  51. package/assets/skills/oat-project-progress/SKILL.md +23 -9
  52. package/assets/skills/oat-project-promote-spec-driven/SKILL.md +20 -2
  53. package/assets/skills/oat-project-quick-start/SKILL.md +48 -18
  54. package/assets/skills/oat-project-quick-start/references/docs/autonomy-contract.md +8 -8
  55. package/assets/skills/oat-project-reconcile/SKILL.md +14 -10
  56. package/assets/skills/oat-project-retro/SKILL.md +3 -3
  57. package/assets/skills/oat-project-retro/references/apply-procedure.md +102 -6
  58. package/assets/skills/oat-project-retro-file/SKILL.md +57 -6
  59. package/assets/skills/oat-project-review-provide/SKILL.md +56 -6
  60. package/assets/skills/oat-project-review-receive/SKILL.md +16 -7
  61. package/assets/skills/oat-project-review-receive-remote/SKILL.md +9 -3
  62. package/assets/skills/oat-project-revise/SKILL.md +12 -3
  63. package/assets/skills/oat-project-spec/SKILL.md +16 -3
  64. package/assets/skills/oat-project-summary/SKILL.md +113 -13
  65. package/assets/skills/oat-repo-improve/SKILL.md +18 -7
  66. package/assets/skills/oat-review-provide-remote/SKILL.md +11 -2
  67. package/assets/skills/oat-wave-execute/SKILL.md +34 -2
  68. package/assets/skills/oat-worktree-bootstrap/SKILL.md +13 -1
  69. package/assets/skills/oat-worktree-bootstrap-auto/SKILL.md +13 -1
  70. package/dist/commands/config/index.d.ts +1 -0
  71. package/dist/commands/config/index.d.ts.map +1 -1
  72. package/dist/commands/config/index.js +30 -2
  73. package/dist/commands/doctor/index.d.ts +2 -0
  74. package/dist/commands/doctor/index.d.ts.map +1 -1
  75. package/dist/commands/doctor/index.js +27 -3
  76. package/dist/commands/doctor/synced-projects.d.ts +12 -0
  77. package/dist/commands/doctor/synced-projects.d.ts.map +1 -0
  78. package/dist/commands/doctor/synced-projects.js +208 -0
  79. package/dist/commands/init/gitattributes.d.ts +4 -0
  80. package/dist/commands/init/gitattributes.d.ts.map +1 -0
  81. package/dist/commands/init/gitattributes.js +12 -0
  82. package/dist/commands/init/gitignore.d.ts +8 -1
  83. package/dist/commands/init/gitignore.d.ts.map +1 -1
  84. package/dist/commands/init/gitignore.js +146 -41
  85. package/dist/commands/init/index.d.ts +2 -0
  86. package/dist/commands/init/index.d.ts.map +1 -1
  87. package/dist/commands/init/index.js +3 -0
  88. package/dist/commands/init/managed-block.d.ts +10 -0
  89. package/dist/commands/init/managed-block.d.ts.map +1 -0
  90. package/dist/commands/init/managed-block.js +40 -0
  91. package/dist/commands/init/tools/workflows/install-workflows.js +1 -1
  92. package/dist/commands/local/index.d.ts.map +1 -1
  93. package/dist/commands/local/index.js +5 -1
  94. package/dist/commands/local/sync.d.ts +4 -0
  95. package/dist/commands/local/sync.d.ts.map +1 -1
  96. package/dist/commands/local/sync.js +123 -2
  97. package/dist/commands/pjm/adoption.d.ts +2 -0
  98. package/dist/commands/pjm/adoption.d.ts.map +1 -1
  99. package/dist/commands/pjm/adoption.js +1 -1
  100. package/dist/commands/project/archive/archive-utils.d.ts +24 -0
  101. package/dist/commands/project/archive/archive-utils.d.ts.map +1 -1
  102. package/dist/commands/project/archive/archive-utils.js +349 -22
  103. package/dist/commands/project/archive/index.d.ts.map +1 -1
  104. package/dist/commands/project/archive/index.js +1 -0
  105. package/dist/commands/project/archive/push-runner.d.ts +5 -1
  106. package/dist/commands/project/archive/push-runner.d.ts.map +1 -1
  107. package/dist/commands/project/archive/push-runner.js +33 -4
  108. package/dist/commands/project/complete-state/index.d.ts.map +1 -1
  109. package/dist/commands/project/complete-state/index.js +3 -1
  110. package/dist/commands/project/index.d.ts.map +1 -1
  111. package/dist/commands/project/index.js +12 -0
  112. package/dist/commands/project/links/compute.d.ts +9 -0
  113. package/dist/commands/project/links/compute.d.ts.map +1 -0
  114. package/dist/commands/project/links/compute.js +27 -0
  115. package/dist/commands/project/links/index.d.ts +17 -0
  116. package/dist/commands/project/links/index.d.ts.map +1 -0
  117. package/dist/commands/project/links/index.js +72 -0
  118. package/dist/commands/project/links/refresh.d.ts +26 -0
  119. package/dist/commands/project/links/refresh.d.ts.map +1 -0
  120. package/dist/commands/project/links/refresh.js +92 -0
  121. package/dist/commands/project/links/render.d.ts +24 -0
  122. package/dist/commands/project/links/render.d.ts.map +1 -0
  123. package/dist/commands/project/links/render.js +68 -0
  124. package/dist/commands/project/list.d.ts +5 -0
  125. package/dist/commands/project/list.d.ts.map +1 -1
  126. package/dist/commands/project/list.js +182 -9
  127. package/dist/commands/project/migrate/index.d.ts +22 -0
  128. package/dist/commands/project/migrate/index.d.ts.map +1 -0
  129. package/dist/commands/project/migrate/index.js +79 -0
  130. package/dist/commands/project/new/index.d.ts +2 -0
  131. package/dist/commands/project/new/index.d.ts.map +1 -1
  132. package/dist/commands/project/new/index.js +14 -2
  133. package/dist/commands/project/new/scaffold.d.ts +22 -1
  134. package/dist/commands/project/new/scaffold.d.ts.map +1 -1
  135. package/dist/commands/project/new/scaffold.js +287 -69
  136. package/dist/commands/project/open/index.d.ts +16 -0
  137. package/dist/commands/project/open/index.d.ts.map +1 -1
  138. package/dist/commands/project/open/index.js +151 -19
  139. package/dist/commands/project/pause/index.d.ts +8 -0
  140. package/dist/commands/project/pause/index.d.ts.map +1 -1
  141. package/dist/commands/project/pause/index.js +129 -19
  142. package/dist/commands/project/prune/index.d.ts +21 -0
  143. package/dist/commands/project/prune/index.d.ts.map +1 -0
  144. package/dist/commands/project/prune/index.js +95 -0
  145. package/dist/commands/project/pull/index.d.ts +28 -0
  146. package/dist/commands/project/pull/index.d.ts.map +1 -0
  147. package/dist/commands/project/pull/index.js +157 -0
  148. package/dist/commands/project/push/index.d.ts +22 -0
  149. package/dist/commands/project/push/index.d.ts.map +1 -0
  150. package/dist/commands/project/push/index.js +100 -0
  151. package/dist/commands/project/scope/index.d.ts +17 -0
  152. package/dist/commands/project/scope/index.d.ts.map +1 -0
  153. package/dist/commands/project/scope/index.js +107 -0
  154. package/dist/commands/project/split/run.d.ts +4 -0
  155. package/dist/commands/project/split/run.d.ts.map +1 -1
  156. package/dist/commands/project/split/run.js +48 -10
  157. package/dist/commands/project/sync/git.d.ts +18 -0
  158. package/dist/commands/project/sync/git.d.ts.map +1 -0
  159. package/dist/commands/project/sync/git.js +60 -0
  160. package/dist/commands/project/sync/record.d.ts +22 -0
  161. package/dist/commands/project/sync/record.d.ts.map +1 -0
  162. package/dist/commands/project/sync/record.js +133 -0
  163. package/dist/commands/project/sync/ref-sync.d.ts +120 -0
  164. package/dist/commands/project/sync/ref-sync.d.ts.map +1 -0
  165. package/dist/commands/project/sync/ref-sync.js +962 -0
  166. package/dist/commands/project/sync/resolve-target.d.ts +27 -0
  167. package/dist/commands/project/sync/resolve-target.d.ts.map +1 -0
  168. package/dist/commands/project/sync/resolve-target.js +159 -0
  169. package/dist/commands/shared/oat-paths.d.ts +4 -1
  170. package/dist/commands/shared/oat-paths.d.ts.map +1 -1
  171. package/dist/commands/shared/oat-paths.js +2 -2
  172. package/dist/commands/shared/project-scope.d.ts +23 -0
  173. package/dist/commands/shared/project-scope.d.ts.map +1 -0
  174. package/dist/commands/shared/project-scope.js +106 -0
  175. package/dist/commands/tools/migrate/index.js +1 -1
  176. package/dist/commands/tools/shared/pack-inventory.d.ts.map +1 -1
  177. package/dist/commands/tools/shared/pack-inventory.js +11 -0
  178. package/dist/commands/tools/shared/pack-lifecycle.js +1 -1
  179. package/dist/commands/tools/shared/pack-reconcile.d.ts.map +1 -1
  180. package/dist/commands/tools/shared/pack-reconcile.js +4 -1
  181. package/dist/commands/tools/update/index.d.ts.map +1 -1
  182. package/dist/commands/tools/update/index.js +20 -10
  183. package/dist/commands/tools/update/update-tools.d.ts +2 -0
  184. package/dist/commands/tools/update/update-tools.d.ts.map +1 -1
  185. package/dist/config/oat-config.d.ts +6 -3
  186. package/dist/config/oat-config.d.ts.map +1 -1
  187. package/dist/config/oat-config.js +41 -7
  188. package/dist/config/resolve.d.ts.map +1 -1
  189. package/dist/config/resolve.js +2 -1
  190. package/dist/fs/io.d.ts +2 -1
  191. package/dist/fs/io.d.ts.map +1 -1
  192. package/dist/fs/io.js +5 -2
  193. package/dist/projects/split/finalize.d.ts.map +1 -1
  194. package/dist/projects/split/finalize.js +55 -2
  195. package/dist/projects/split/resume.d.ts +3 -0
  196. package/dist/projects/split/resume.d.ts.map +1 -1
  197. package/dist/projects/split/resume.js +34 -7
  198. package/dist/projects/split/seed-children.d.ts.map +1 -1
  199. package/dist/projects/split/seed-children.js +6 -0
  200. package/dist/projects/split/write-parent.d.ts +7 -0
  201. package/dist/projects/split/write-parent.d.ts.map +1 -1
  202. package/dist/projects/split/write-parent.js +7 -4
  203. package/dist/release/public-package-contract.d.ts.map +1 -1
  204. package/dist/release/public-package-contract.js +1 -0
  205. package/dist/validation/skills.d.ts.map +1 -1
  206. package/dist/validation/skills.js +434 -0
  207. package/package.json +4 -4
  208. package/dist/__tests__/skills/split-flow-fixtures.d.ts +0 -50
  209. package/dist/__tests__/skills/split-flow-fixtures.d.ts.map +0 -1
  210. package/dist/__tests__/skills/split-flow-fixtures.js +0 -161
  211. package/dist/commands/__tests__/helpers.d.ts +0 -12
  212. package/dist/commands/__tests__/helpers.d.ts.map +0 -1
  213. package/dist/commands/__tests__/helpers.js +0 -36
@@ -0,0 +1,75 @@
1
+ ---
2
+ title: Picking Up Projects
3
+ description: Continue a synced OAT project on another machine or from another user through its dedicated Git ref.
4
+ ---
5
+
6
+ # Picking Up a Project on Another Machine or From Another User
7
+
8
+ Synced projects travel through ordinary Git refs on `origin`. Their artifact
9
+ history is independent from the implementation branch, so a teammate or a
10
+ second machine can continue the project even before the branch carrying its
11
+ record file merges.
12
+
13
+ ## Discover and adopt
14
+
15
+ From any checkout with access to `origin`:
16
+
17
+ ```bash
18
+ oat project list --remote
19
+ oat project pull <project>
20
+ ```
21
+
22
+ `list --remote` discovers `refs/oat/projects/*` directly. `pull` can adopt a
23
+ remote project that has no local record yet: it writes the record and creates
24
+ the nested checkout. When the selected project is a coordination parent, pull
25
+ also discovers and pulls its child projects by default. Pass `--no-children`
26
+ only when you intentionally want the selected project alone.
27
+
28
+ After adoption, set or open the project through the normal lifecycle command
29
+ you are using. Arrival-aware project skills pull before reading its artifacts.
30
+
31
+ ## What travels
32
+
33
+ - The project ref carries the complete active artifact tree and its history.
34
+ - The tracked JSON record travels once the branch containing it is shared or
35
+ merged.
36
+ - Coordination relationships travel in the artifacts and records pulled with
37
+ the project.
38
+
39
+ ## What does not travel automatically
40
+
41
+ - `local` projects never leave their original machine.
42
+ - GitHub forks copy branches and tags, but not the `refs/oat/*` namespace. A
43
+ fork collaborator needs access to the upstream remote or an explicit ref
44
+ transfer.
45
+ - A normal `git clone` fetches branches and tags, not custom OAT refs. OAT
46
+ handles remote discovery with `ls-remote` and explicitly fetches the selected
47
+ project ref during sync operations such as `pull`; do not expect a generic
48
+ clone or `git fetch` to materialize the checkout.
49
+
50
+ ## Why retained refs remain durable
51
+
52
+ `refs/oat/projects/<project>` is a real Git ref locally and on `origin`. The
53
+ objects reachable from it remain garbage-collection roots even when no nested
54
+ checkout exists. Branch pruning, remote-tracking-ref pruning, and
55
+ `git worktree prune` do not delete the project ref. Completion deliberately
56
+ retains it so pinned PR links remain valid.
57
+
58
+ Only the explicit destructive operation `oat project prune` removes the local
59
+ and remote project refs. Treat it as permanent project-history deletion and
60
+ review its warnings before using `--force`.
61
+
62
+ ## Archive contents
63
+
64
+ When archive is selected, completion copies a synced project into
65
+ `.oat/projects/archived/<project>/` without the nested checkout's `.git`
66
+ pointer or `reviews/`. S3 snapshots also omit `pr/`, following the existing
67
+ archive policy. When archive is disabled or declined, the active synced
68
+ checkout remains in place. Both paths retain the project ref and commit the
69
+ tracked record as `complete`; only the archive path records an archive snapshot.
70
+
71
+ ## Related
72
+
73
+ - [Reviewing OAT PRs](reviewing-oat-prs.md)
74
+ - [Project Artifacts](artifacts.md)
75
+ - [Implementation Execution](implementation-execution.md#synced-projects-in-worktrees)
@@ -34,6 +34,25 @@ GitHub PR body policy:
34
34
  - Keep YAML frontmatter in local artifact
35
35
  - Strip frontmatter from submitted PR body
36
36
 
37
+ ## Synced project links
38
+
39
+ For a synced project, PR creation follows a six-step order:
40
+
41
+ 1. write and format the local PR artifact;
42
+ 2. run `oat project push` so the project ref contains the latest artifacts;
43
+ 3. run `oat project links --format markdown` to generate the delimited links
44
+ block from that exact ref commit;
45
+ 4. include the block in the submitted PR body;
46
+ 5. persist `oat_pr_status` and `oat_pr_url` in `state.md`; and
47
+ 6. push again so subsequent artifact writes can refresh the open PR body.
48
+
49
+ The generated block links only `discovery.md`, `design.md`, and `summary.md`
50
+ when present. The URLs are pinned to the project ref's exact commit SHA rather
51
+ than a moving branch name. `plan.md`, `state.md`, `implementation.md`, and
52
+ `reviews/` are intentionally excluded because they contain agent-facing
53
+ execution detail rather than the reviewer-oriented project narrative. See
54
+ [Reviewing OAT PRs](reviewing-oat-prs.md).
55
+
37
56
  ## Post-PR state
38
57
 
39
58
  After `oat-project-pr-final` creates the PR, `state.md` transitions to `oat_phase_status: pr_open`. This signals "awaiting human review" rather than "done."
@@ -57,7 +76,9 @@ Both completion orderings are supported:
57
76
 
58
77
  An open PR is not a completion blocker. When completion archives project
59
78
  artifacts, the archive-aware flow regenerates and synchronizes the open PR body
60
- so its artifact links remain valid.
79
+ so its artifact links remain valid. Synced completion retains the project ref,
80
+ which keeps its SHA-pinned links resolvable after the nested checkout is
81
+ removed.
61
82
 
62
83
  ## Reference artifacts
63
84
 
@@ -0,0 +1,60 @@
1
+ ---
2
+ title: Reviewing OAT PRs
3
+ description: Understand synced-project records, SHA-pinned artifact links, and the reviewer-facing PR experience.
4
+ ---
5
+
6
+ # Reviewing OAT PRs
7
+
8
+ A PR for a synced OAT project contains the implementation diff without placing
9
+ the agent-facing project tree on the feature branch. Reviewers get durable
10
+ project context through a small tracked record and a generated links block in
11
+ the PR body.
12
+
13
+ ## The synced record
14
+
15
+ `.oat/projects/synced/<project>.json` is tracked on the feature branch. It
16
+ names the project slug, `origin`, `refs/oat/projects/<project>`, whether the
17
+ project is active or complete, and the archive snapshot when completion has
18
+ created one. It is discovery and lifecycle metadata; the project artifacts
19
+ themselves live on the project ref.
20
+
21
+ ## The artifact links block
22
+
23
+ `oat project links` generates a delimited Markdown block for the PR body. Each
24
+ URL points at the exact project-ref commit current when the block was rendered,
25
+ so later pushes cannot silently change the content behind an existing link.
26
+ `oat project push` refreshes the block when the project's `state.md` identifies
27
+ an open PR.
28
+
29
+ The block includes the reviewer-oriented artifacts that exist:
30
+
31
+ - `discovery.md` for problem framing and constraints;
32
+ - `design.md` for the selected architecture; and
33
+ - `summary.md` for the concise outcome and durable decisions.
34
+
35
+ It does not link `plan.md`, `state.md`, `implementation.md`, or `reviews/`.
36
+ Those files are operational agent context, can be noisy or transient, and are
37
+ not part of the stable reviewer narrative. The implementation diff and normal
38
+ PR review remain authoritative for the code change.
39
+
40
+ ## Editor discovery
41
+
42
+ The project checkout is a nested Git worktree. VS Code and Cursor may not show
43
+ it in Source Control unless repository scanning includes nested repositories.
44
+ Add the synced root to `git.scanRepositories` in workspace settings when you
45
+ want editor Git integration for these checkouts:
46
+
47
+ ```json
48
+ {
49
+ "git.scanRepositories": [".oat/projects/synced"]
50
+ }
51
+ ```
52
+
53
+ This setting is an editor convenience. OAT's `push`, `pull`, and `links`
54
+ commands do not depend on editor discovery.
55
+
56
+ ## Related
57
+
58
+ - [PR Flow](pr-flow.md)
59
+ - [Project Artifacts](artifacts.md)
60
+ - [Picking Up Projects](picking-up-projects.md)
@@ -1,6 +1,6 @@
1
1
  {
2
- "cli": "0.2.40",
3
- "docs-config": "0.2.40",
4
- "docs-theme": "0.2.40",
5
- "docs-transforms": "0.2.40"
2
+ "cli": "0.2.45",
3
+ "docs-config": "0.2.45",
4
+ "docs-theme": "0.2.45",
5
+ "docs-transforms": "0.2.45"
6
6
  }
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: analyze
3
- version: 0.1.0
3
+ version: 0.1.1
4
4
  description: Multi-angle analysis of existing artifacts, codebases, documents, or systems. Examines what you have from six analysis angles and produces structured findings with prioritized recommendations.
5
5
  argument-hint: 'target [--context path]'
6
6
  user-invocable: true
@@ -258,10 +258,18 @@ Then ask the user via `AskUserQuestion` (Claude Code), structured user-input too
258
258
 
259
259
  `[10/10] Writing artifact…`
260
260
 
261
- Write the structured analysis artifact using:
262
-
263
- - Base schema structure (Executive Summary, Methodology, Findings, Sources & References) from `../deep-research/references/schema-base.md`
264
- - Analysis extended schema sections (Per-Angle Findings, Cross-Angle Synthesis, Prioritized Recommendations) from `../deep-research/references/schema-analysis.md`
261
+ Write the structured analysis artifact using the `deep-research` schema
262
+ references. Independently probe each required `<name>/SKILL.md` in order:
263
+ `${SKILL_DIR}/..` from this loaded skill, `${HOME}/.agents/skills`, then
264
+ `<repo-root>/.agents/skills`. Bind the first match for `deep-research` to its
265
+ own `${RESEARCH_SKILLS_ROOT}`; never ambient discovery. On a miss, name the
266
+ skill, stop before writing the artifact instead of inventing a schema, and give
267
+ its intended-scope recovery command:
268
+ `oat tools install research --scope <user|project>` or
269
+ `oat tools update --pack research --scope <user|project>`.
270
+
271
+ - Base schema structure (Executive Summary, Methodology, Findings, Sources & References) from `${RESEARCH_SKILLS_ROOT}/deep-research/references/schema-base.md`
272
+ - Analysis extended schema sections (Per-Angle Findings, Cross-Angle Synthesis, Prioritized Recommendations) from `${RESEARCH_SKILLS_ROOT}/deep-research/references/schema-analysis.md`
265
273
 
266
274
  Artifact frontmatter contract:
267
275
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: compare
3
- version: 0.1.0
3
+ version: 0.1.1
4
4
  description: Domain-aware comparative analysis with clear recommendations. Compares options across auto-detected or user-specified dimensions and produces a qualitative assessment with a clear winner.
5
5
  argument-hint: 'item1 item2 [item3...] [--save] [--context path] [--dimensions "dim1, dim2, ..."]'
6
6
  user-invocable: true
@@ -167,7 +167,16 @@ Condensed comparison with:
167
167
 
168
168
  **Artifact output (`--save` flag):**
169
169
 
170
- Write artifact using the `comparative` extended schema from `.agents/skills/deep-research/references/schema-comparative.md`:
170
+ Write artifact using the `comparative` extended schema owned by the
171
+ `deep-research` skill. Independently probe each required `<name>/SKILL.md` in order:
172
+ `${SKILL_DIR}/..` from this loaded skill, `${HOME}/.agents/skills`, then
173
+ `<repo-root>/.agents/skills`. Bind the first match for `deep-research` to its
174
+ own `${RESEARCH_SKILLS_ROOT}`; never ambient discovery. On a miss, name the
175
+ skill, stop before writing the artifact instead of inventing a schema, and give
176
+ its intended-scope recovery command:
177
+ `oat tools install research --scope <user|project>` or
178
+ `oat tools update --pack research --scope <user|project>`. Then read
179
+ `${RESEARCH_SKILLS_ROOT}/deep-research/references/schema-comparative.md`:
171
180
 
172
181
  - Include artifact frontmatter contract:
173
182
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: oat-brainstorm
3
- version: 1.3.1
3
+ version: 1.3.4
4
4
  description: Use when the user explicitly invokes the `brainstorm` verb, including `/oat-brainstorm`, "let's brainstorm", "brainstorm this", "can we brainstorm X", or "help me brainstorm X". For ambiguous exploratory phrasing ("I've been thinking", "what if", "help me think through"), do NOT auto-enter; respond conversationally and offer mode only after ≥2 sustained exploratory turns. Do NOT use for review, debug, PR, status, implementation, or active-workflow questions.
5
5
  disable-model-invocation: false
6
6
  user-invocable: true
@@ -89,9 +89,9 @@ These messages get a direct response, not a workflow takeover. If the model has
89
89
  - No formal requirements / specs / architectural designs (the design phase belongs to `oat-project-design`, not here).
90
90
  - No auto-routing to a destination before convergence — the destination is identified at the end of the conversation, not the beginning. Opportunistic surfacing on a clear trigger phrase is allowed; pre-emptively forcing a destination is not.
91
91
  - Visual-companion offer must run only when the topic is visual-likely OR the user has explicitly asked for it. Never offer when the topic is text-likely; never skip when the topic is visual-likely.
92
- - No fold-back commit on a dirty working tree without running the preflight `git status` check first (see Process step 9 active-project branches).
93
- - No `git add -A` and no directory globs for the fold-back commit. Staging is always scoped: `git add -- "$ARTIFACT_PATH"`.
94
- - No printing the fold-back handoff prompt before `git commit` actually succeeds. The prompt references a hash; a missing commit makes the prompt misleading.
92
+ - No fold-back persistence on a dirty artifact, or from a synced checkout with any dirty project file, without running the preflight `git status` check first (see Process step 9 active-project branches).
93
+ - For shared/local fold-back, no `git add -A` or directory globs: stage only `git add -- "$ARTIFACT_PATH"`. For synced fold-back, never stage on the parent branch; use the validated `oat project push --json` receipt.
94
+ - No printing the fold-back handoff prompt before the scope-appropriate branch commit or synced push succeeds. The prompt references a hash; a missing persistence receipt makes it misleading.
95
95
 
96
96
  **ALLOWED Activities:**
97
97
 
@@ -100,7 +100,7 @@ These messages get a direct response, not a workflow takeover. If the model has
100
100
  - Pack and active-project detection at convergence time (`oat tools has <pack>` / `oat config get activeProject`).
101
101
  - Reading downstream skill files (`oat-idea-*`, `oat-pjm-add-backlog-item`, `oat-project-*`) and following their process inline using the synthesized payload as pre-filled answers.
102
102
  - Rendering the doc-to-path artifact from `templates/brainstorm-doc.md`.
103
- - Active-project fold-back: appending synthesis to the chosen upstream artifact and committing — only after the safety contract (preflight, scoped staging, conditional handoff print) is satisfied.
103
+ - Active-project fold-back: appending synthesis to the chosen upstream artifact and persisting by scope — exact-path branch commit for shared/local, validated project-ref push for synced — only after the safety contract is satisfied.
104
104
 
105
105
  **Self-Correction Protocol:**
106
106
  If you catch yourself:
@@ -110,9 +110,9 @@ If you catch yourself:
110
110
  - Forcing a destination before convergence → STOP. Return to free brainstorming and let convergence happen via trigger phrase or natural soft cue.
111
111
  - Skipping the visual-companion offer when visual content is coming → STOP. Print the offer as its own message before continuing.
112
112
  - Offering the visual companion before a text-likely brainstorm has any visual need → STOP. Set `VISUAL_COMPANION = "deferred"` and continue text-only.
113
- - Running the fold-back commit on a dirty working tree without preflight → STOP. Re-route through the dirty-tree handler (three-option picker) before any artifact mutation.
114
- - Staging with `-A` or a directory glob during fold-back → STOP. The fold-back commit must be `git add -- "$ARTIFACT_PATH"` only.
115
- - Printing the fold-back handoff prompt before the commit succeeds → STOP. Surface the commit error and let the user resolve it before the prompt is emitted.
113
+ - Running fold-back persistence on a dirty artifact without preflight → STOP. Re-route through the dirty-tree handler (three-option picker) before any artifact mutation.
114
+ - For shared/local scope, staging with `-A` or a directory glob during fold-back → STOP; use `git add -- "$ARTIFACT_PATH"` only. For synced scope, any parent-branch staging → STOP; use `oat project push`.
115
+ - Printing the fold-back handoff prompt before the branch commit or synced push succeeds → STOP. Surface the persistence error and let the user resolve it before the prompt is emitted.
116
116
 
117
117
  **Recovery:**
118
118
 
@@ -302,7 +302,21 @@ If "keep going", return to step 5. If "wrap up", surface the **pack-filtered ter
302
302
  - Gated by `WORKFLOWS_INSTALLED == "true"` AND `ACTIVE_PROJECT_VALID == "true"`: `Active project: fold-back` and `Active project: brainstorming reference file`. When this branch fires, present the **3-way active-project router first** (see step 9 active-project branches) — its outcome controls whether the rest of the picker is even surfaced.
303
303
  3. Evaluate whether the accumulated brainstorm scope is large enough to offer a split destination. Track the same four split signals used by discovery and evaluate them through the installed CLI:
304
304
 
305
+ Define this fail-closed parser once before any synced persistence below. If
306
+ it rejects a receipt, print the complete CLI JSON, run
307
+ `oat project pull "$ACTIVE_PROJECT"`, resolve any reported conflict, and
308
+ retry the original push; never infer a commit from local Git state.
309
+
305
310
  ```bash
311
+ parse_synced_push_receipt() {
312
+ node -e '
313
+ let value;
314
+ try { value = JSON.parse(process.argv[1]); } catch { process.exit(1); }
315
+ if (!["pushed", "up-to-date"].includes(value.status) || !/^[0-9a-f]{40}$/.test(value.sha)) process.exit(1);
316
+ process.stdout.write(value.sha);
317
+ ' "$1"
318
+ }
319
+
306
320
  oat project split evaluate-signals --fired "<comma-list>"
307
321
  ```
308
322
 
@@ -392,7 +406,7 @@ After confirmation succeeds, proceed to step 9 (handoff).
392
406
 
393
407
  ### Step 9: Handoff
394
408
 
395
- Branch on the destination. Each branch executes its handoff inline using the confirmed payload. The non-fold-back destinations are listed first; the active-project router and fold-back commit safety contract are detailed at the end of this step.
409
+ Branch on the destination. Each branch executes its handoff inline using the confirmed payload. The non-fold-back destinations are listed first; the active-project router and scope-aware fold-back persistence contract are detailed at the end of this step.
396
410
 
397
411
  **Resolving `${SKILLS_ROOT}` for chained skills.** The `ideas` and
398
412
  `project-management` packs default to user scope just as `brainstorm` does, so a
@@ -552,15 +566,35 @@ Uniform across spec-driven and quick modes. Differs only in which plan-authoring
552
566
 
553
567
  Confirm the chosen artifact with the user (minimal confirmation per `references/destinations.md`). Set `ARTIFACT_PATH` to the absolute path.
554
568
 
555
- **Step 2 — Preflight `git status` check.** Run **before** any artifact mutation, scoped to the chosen artifact only:
569
+ **Persistence invariant:** shared and local project artifacts remain ordinary
570
+ parent-checkout files and use exact-path branch commits. Synced project
571
+ artifacts live only in the nested project checkout and become durable only
572
+ through a validated `oat project push --json` receipt on
573
+ `refs/oat/projects/<slug>`; never stage a synced artifact on the parent branch.
574
+ This invariant applies equally to clean fold-back, both dirty fold-back choices,
575
+ and the brainstorming reference-file route.
576
+
577
+ **Step 2 — Preflight `git status` check.** Run **before** any artifact mutation.
578
+ For shared/local projects, scope the check to the chosen artifact. For synced
579
+ projects, inspect the full nested checkout because `oat project push` persists
580
+ every pending project file:
556
581
 
557
582
  ```bash
558
- git status --porcelain -- "$ARTIFACT_PATH"
583
+ PROJECT_SCOPE=$(oat project scope "$ACTIVE_PROJECT" --format value) || { echo "oat: cannot resolve project scope for $ACTIVE_PROJECT; refusing to commit artifacts" >&2; exit 1; }
584
+ # fail closed: never fall back to branch bookkeeping when scope resolution fails
585
+ if [ "$PROJECT_SCOPE" = "synced" ]; then
586
+ git -C "$ACTIVE_PROJECT" status --porcelain
587
+ else
588
+ git status --porcelain -- "$ARTIFACT_PATH"
589
+ fi
559
590
  ```
560
591
 
561
592
  The check happens before any append, so the skill can route around the dirty case without having half-written the synthesis.
562
593
 
563
- **Step 3 — If the artifact is clean** (no entry in the porcelain output): this is the happy path.
594
+ **Step 3 — If the artifact is clean** (no entry in the porcelain output): this
595
+ is the happy path. For synced projects, "artifact is clean" additionally
596
+ requires the entire project checkout to be clean; a clean chosen artifact
597
+ beside another dirty project file must take Step 4.
564
598
 
565
599
  1. Append the synthesis as a clearly-marked section to `ARTIFACT_PATH`:
566
600
 
@@ -570,33 +604,90 @@ The check happens before any append, so the skill can route around the dirty cas
570
604
 
571
605
  Section body contains: `chosenDirection` (with rationale), key decisions (extracted from the conversation), and a transcript appendix (`transcriptSessionNote`). Optionally include `openQuestions` and `nextSteps` if surfaced.
572
606
 
573
- 2. Stage **only** the artifact:
607
+ 2. Persist **only** the artifact under the scope guard:
574
608
 
575
609
  ```bash
576
- git add -- "$ARTIFACT_PATH"
610
+ PROJECT_SCOPE=$(oat project scope "$ACTIVE_PROJECT" --format value) || { echo "oat: cannot resolve project scope for $ACTIVE_PROJECT; refusing to commit artifacts" >&2; exit 1; }
611
+ # fail closed: never fall back to branch bookkeeping when scope resolution fails
612
+ if [ "$PROJECT_SCOPE" = "synced" ]; then
613
+ FOLD_BACK_PUSH=$(oat project push "$ACTIVE_PROJECT" --message "chore(oat): integrate brainstorm into <artifact-basename> for <project-name>" --json) || { echo "oat: project push failed; run oat project pull, resolve the reported state, and retry" >&2; exit 1; }
614
+ FOLD_BACK_COMMIT_SHA=$(parse_synced_push_receipt "$FOLD_BACK_PUSH") || { printf '%s\n' "$FOLD_BACK_PUSH" >&2; echo "Recovery: run oat project pull \"$ACTIVE_PROJECT\", resolve conflicts, then retry this push." >&2; exit 1; }
615
+ else
616
+ git add -- "$ARTIFACT_PATH"
617
+ git commit -m "chore(oat): integrate brainstorm into <artifact-basename> for <project-name>"
618
+ FOLD_BACK_COMMIT_SHA=$(git rev-parse HEAD)
619
+ fi
577
620
  ```
578
621
 
579
- Use the explicit `--` filename form. **Never `git add -A`. Never directory globs.** Other working-tree paths are not touched by this commit.
622
+ For non-synced projects, use the explicit `--` filename form. **Never `git add -A`. Never directory globs.** Other working-tree paths are not touched by this commit. For synced projects, `FOLD_BACK_COMMIT_SHA` comes from the push JSON rather than the parent branch.
580
623
 
581
- 3. Commit with the canonical message:
624
+ 3. `<artifact-basename>` is `design.md` or `discovery.md` depending on which was chosen. `<project-name>` is the active project's slug.
582
625
 
583
- ```bash
584
- git commit -m "chore(oat): integrate brainstorm into <artifact-basename> for <project-name>"
585
- ```
626
+ 4. If the guarded persistence succeeded → proceed to step 5 (handoff prompt).
627
+
628
+ **Step 4 — If the artifact is dirty** (any entry in the porcelain output):
629
+ pause the fold-back, present the user with three options before any artifact
630
+ mutation occurs. For synced projects, any dirty project file makes this branch
631
+ apply; name other dirty project files in the warning so the user knows
632
+ `oat project push` would include them. Carry the scope resolved by the preflight
633
+ into the selected branch and resolve it again inside every persistence block so
634
+ failures remain fail-closed.
586
635
 
587
- `<artifact-basename>` is `design.md` or `discovery.md` depending on which was chosen. `<project-name>` is the active project's slug.
636
+ - **Option A — Commit current artifact changes first** (recommended when prior changes are unrelated to the brainstorm). Ask the user for a one-line subject and persist the existing artifact state before appending the synthesis:
588
637
 
589
- 4. If `git commit` succeeded → proceed to step 5 (handoff prompt).
638
+ ```bash
639
+ PROJECT_SCOPE=$(oat project scope "$ACTIVE_PROJECT" --format value) || { echo "oat: cannot resolve project scope for $ACTIVE_PROJECT; refusing to commit artifacts" >&2; exit 1; }
640
+ if [ "$PROJECT_SCOPE" = "synced" ]; then
641
+ CURRENT_ARTIFACT_PUSH=$(oat project push "$ACTIVE_PROJECT" --message "$CURRENT_ARTIFACT_SUBJECT" --json) || { echo "oat: project push failed; run oat project pull, resolve the reported state, and retry" >&2; exit 1; }
642
+ CURRENT_ARTIFACT_COMMIT_SHA=$(parse_synced_push_receipt "$CURRENT_ARTIFACT_PUSH") || { printf '%s\n' "$CURRENT_ARTIFACT_PUSH" >&2; echo "Recovery: run oat project pull \"$ACTIVE_PROJECT\", resolve conflicts, then retry this push." >&2; exit 1; }
643
+ else
644
+ git add -- "$ARTIFACT_PATH"
645
+ git commit --only -m "$CURRENT_ARTIFACT_SUBJECT" -- "$ARTIFACT_PATH"
646
+ CURRENT_ARTIFACT_COMMIT_SHA=$(git rev-parse HEAD)
647
+ fi
648
+ ```
649
+
650
+ Only after that succeeds, append the synthesis. Persist the fold-back as a
651
+ second commit on the same scope:
652
+
653
+ ```bash
654
+ PROJECT_SCOPE=$(oat project scope "$ACTIVE_PROJECT" --format value) || { echo "oat: cannot resolve project scope for $ACTIVE_PROJECT; refusing to commit artifacts" >&2; exit 1; }
655
+ if [ "$PROJECT_SCOPE" = "synced" ]; then
656
+ FOLD_BACK_PUSH=$(oat project push "$ACTIVE_PROJECT" --message "chore(oat): integrate brainstorm into <artifact-basename> for <project-name>" --json) || { echo "oat: project push failed; run oat project pull, resolve the reported state, and retry" >&2; exit 1; }
657
+ FOLD_BACK_COMMIT_SHA=$(parse_synced_push_receipt "$FOLD_BACK_PUSH") || { printf '%s\n' "$FOLD_BACK_PUSH" >&2; echo "Recovery: run oat project pull \"$ACTIVE_PROJECT\", resolve conflicts, then retry this push." >&2; exit 1; }
658
+ else
659
+ git add -- "$ARTIFACT_PATH"
660
+ git commit --only -m "chore(oat): integrate brainstorm into <artifact-basename> for <project-name>" -- "$ARTIFACT_PATH"
661
+ FOLD_BACK_COMMIT_SHA=$(git rev-parse HEAD)
662
+ fi
663
+ ```
590
664
 
591
- **Step 4 — If the artifact is dirty** (any entry in the porcelain output): pause the fold-back, present the user with three options before any artifact mutation occurs:
665
+ For synced projects, the two returned project-ref SHAs prove that the prior
666
+ dirty state was pushed before the fold-back.
667
+
668
+ - **Option B — Include current changes in the fold-back persistence.** Warn explicitly: "The persisted fold-back will mix prior unrelated edits with the brainstorm synthesis. The handoff prompt's receipt SHA will reference both. Confirm?" If the user accepts, append the synthesis and persist the combined state once:
669
+
670
+ ```bash
671
+ PROJECT_SCOPE=$(oat project scope "$ACTIVE_PROJECT" --format value) || { echo "oat: cannot resolve project scope for $ACTIVE_PROJECT; refusing to commit artifacts" >&2; exit 1; }
672
+ if [ "$PROJECT_SCOPE" = "synced" ]; then
673
+ MIXED_FOLD_BACK_PUSH=$(oat project push "$ACTIVE_PROJECT" --message "chore(oat): integrate brainstorm + prior edits into <artifact-basename> for <project-name>" --json) || { echo "oat: project push failed; run oat project pull, resolve the reported state, and retry" >&2; exit 1; }
674
+ FOLD_BACK_COMMIT_SHA=$(parse_synced_push_receipt "$MIXED_FOLD_BACK_PUSH") || { printf '%s\n' "$MIXED_FOLD_BACK_PUSH" >&2; echo "Recovery: run oat project pull \"$ACTIVE_PROJECT\", resolve conflicts, then retry this push." >&2; exit 1; }
675
+ else
676
+ git add -- "$ARTIFACT_PATH"
677
+ git commit --only -m "chore(oat): integrate brainstorm + prior edits into <artifact-basename> for <project-name>" -- "$ARTIFACT_PATH"
678
+ FOLD_BACK_COMMIT_SHA=$(git rev-parse HEAD)
679
+ fi
680
+ ```
681
+
682
+ The `--only` path commit retains the existing non-synced Git route while
683
+ preserving unrelated staged state. A synced dirty branch never runs parent
684
+ `git add` for the project artifact.
592
685
 
593
- - **Option A — Commit current artifact changes first** (recommended when prior changes are unrelated to the brainstorm). Skill commits the existing artifact state with a separate, user-described commit message (ask the user for a one-line subject), then proceeds with fold-back as a new scoped commit on top.
594
- - **Option B — Include current changes in the fold-back commit.** Skill warns explicitly: "The fold-back commit will mix prior unrelated edits with the brainstorm synthesis. The handoff prompt's commit hash will reference both. Confirm?" If user accepts, append synthesis, then `git add -- "$ARTIFACT_PATH"`, then commit with an adjusted message acknowledging the mix (e.g., `chore(oat): integrate brainstorm + prior edits into <artifact> for <project-name>`).
595
686
  - **Option C — Abort fold-back; capture as reference file instead.** Switch the destination to **branch 9j** (active-project brainstorming reference file). Upstream artifact is left untouched.
596
687
 
597
- After the user picks A or B and the resulting commit succeeds, proceed to step 5. After option C, jump to branch 9j.
688
+ After the user picks A or B and the resulting branch commit or synced push succeeds, proceed to step 5. After option C, jump to branch 9j.
598
689
 
599
- **Step 5 — Handoff prompt.** Print **only after the scoped commit succeeds.** If `git commit` failed (pre-commit hooks rejected, signing failed, anything else), surface the error verbatim and **do NOT print the handoff prompt** — the prompt references a commit hash, and a missing commit makes the prompt actively misleading. The user resolves the failure (or re-routes via option C above) before fold-back can complete.
690
+ **Step 5 — Handoff prompt.** Print **only after the scoped commit or synced push succeeds.** If persistence failed (pre-commit hooks rejected, signing failed, push failed, anything else), surface the error verbatim and **do NOT print the handoff prompt** — the prompt references a commit hash, and a missing commit makes the prompt actively misleading. The user resolves the failure (or re-routes via option C above) before fold-back can complete.
600
691
 
601
692
  Resolve the handoff target by `ACTIVE_PROJECT_MODE` and `ACTIVE_PROJECT_PR_STATUS`:
602
693
 
@@ -606,7 +697,7 @@ Resolve the handoff target by `ACTIVE_PROJECT_MODE` and `ACTIVE_PROJECT_PR_STATU
606
697
  | quick | none / closed | `oat-project-quick-start` |
607
698
  | either | open (`oat_pr_status: open`) | `oat-project-revise` |
608
699
 
609
- Print the handoff prompt template, substituting `<skill-name>`, `<artifact>`, `<hash>`, and `<subject>` from the actual commit:
700
+ Print the handoff prompt template, substituting `<skill-name>`, `<artifact>`, `<hash>`, and `<subject>` from the actual branch commit or synced push receipt:
610
701
 
611
702
  ```
612
703
  Run `<skill-name>` with this context:
@@ -634,14 +725,26 @@ If `<ACTIVE_PROJECT>/brainstorming/` does not exist, create it (`mkdir -p`). The
634
725
 
635
726
  Render `${SKILL_DIR}/templates/brainstorm-doc.md` (resolve `${SKILL_DIR}` per the rule in step 3) with the synthesized payload (same shape as the doc-to-path destination) and write to the resolved path.
636
727
 
637
- After writing, commit the file with scoped staging (mirror the discipline of the active-project fold-back commit safety contract):
728
+ After writing, persist the file with the same fail-closed scope guard:
638
729
 
639
730
  ```bash
640
- git add -- "<active-project-relative-path>"
641
- git commit -m "chore(oat): capture brainstorming reference for <project-name>"
731
+ PROJECT_SCOPE=$(oat project scope "$ACTIVE_PROJECT" --format value) || { echo "oat: cannot resolve project scope for $ACTIVE_PROJECT; refusing to commit artifacts" >&2; exit 1; }
732
+ # fail closed: never fall back to branch bookkeeping when scope resolution fails
733
+ if [ "$PROJECT_SCOPE" = "synced" ]; then
734
+ REFERENCE_PUSH=$(oat project push "$ACTIVE_PROJECT" --message "chore(oat): capture brainstorming reference for <project-name>" --json) || { echo "oat: project push failed; run oat project pull, resolve the reported state, and retry" >&2; exit 1; }
735
+ REFERENCE_COMMIT_SHA=$(parse_synced_push_receipt "$REFERENCE_PUSH") || { printf '%s\n' "$REFERENCE_PUSH" >&2; echo "Recovery: run oat project pull \"$ACTIVE_PROJECT\", resolve conflicts, then retry this push." >&2; exit 1; }
736
+ else
737
+ git add -- "<active-project-relative-path>"
738
+ git commit -m "chore(oat): capture brainstorming reference for <project-name>"
739
+ REFERENCE_COMMIT_SHA=$(git rev-parse HEAD)
740
+ fi
642
741
  ```
643
742
 
644
- Use only `git add -- <path>` so unrelated working-tree changes are not swept into the commit. After the commit succeeds, capture the short hash via `git rev-parse --short HEAD` and report it alongside the absolute path written (for example: "Wrote `<absolute-path>` and committed as `<hash>`."). End mode assertion.
743
+ For shared/local scope, use only `git add -- <path>` so unrelated working-tree changes are not swept into the commit, then capture `git rev-parse --short HEAD`. For synced scope, use the validated push receipt SHA and never stage the artifact on the parent branch. Report the resulting SHA alongside the absolute path written, then end mode assertion.
744
+
745
+ For synced projects, the preceding short-hash sentence is superseded by the
746
+ full `REFERENCE_COMMIT_SHA` returned from `oat project push --json`; no parent
747
+ branch artifact commit occurs.
645
748
 
646
749
  #### 9k — Promote to N projects
647
750
 
@@ -667,7 +770,7 @@ End mode assertion when the split handoff completes or reports its own blocker.
667
770
  - ✅ Confirmation pattern matches `references/destinations.md`: `full` for scoped backlog item (field-by-field with example wording), `minimal` for slug/path/artifact destinations, `none` for inline-only and summarize-idea-directly.
668
771
  - ✅ Each handoff branch (9a-9k) reads the correct downstream `SKILL.md` path and enters at the documented step. Project promotion writes `discovery.md` only — never `design.md` — and does not auto-chain into the next phase.
669
772
  - ✅ Doc-to-path validation handles all four cases: path-is-directory, parent-missing (with explicit out-of-repo confirmation), file-already-exists (overwrite or rename), unwritable (surface OS error).
670
- - ✅ Fold-back commit safety contract honored: preflight `git status --porcelain -- "$ARTIFACT_PATH"` runs before any artifact mutation; clean → append + `git add -- "$ARTIFACT_PATH"` (explicit `--`, never `-A`, never globs) + scoped commit; dirty → three-option picker (commit-prior-first / mix / abort-to-reference-file); handoff prompt prints only after `git commit` succeeds.
773
+ - ✅ Fold-back persistence safety contract honored: preflight `git status --porcelain -- "$ARTIFACT_PATH"` runs before any artifact mutation; clean → append + exact-path branch commit for shared/local or validated `oat project push --json` for synced; dirty → three-option picker (persist-prior-first / mix / abort-to-reference-file); handoff prompt prints only after the scope-appropriate receipt succeeds.
671
774
  - ✅ Handoff target for fold-back resolves correctly per `oat_workflow_mode` + `oat_pr_status`: `oat-project-plan` (spec-driven, no/closed PR) / `oat-project-quick-start` (quick, no/closed PR) / `oat-project-revise` (either mode, open PR).
672
775
  - ✅ Active-project 3-way router (related / independent / supplementary) fires before the standard pack-filtered picker when both `WORKFLOWS_INSTALLED == "true"` and `ACTIVE_PROJECT_VALID == "true"`.
673
776
  - ✅ Skill validates cleanly under `pnpm oat:validate-skills` (frontmatter contract, allowed-tools, mode-assertion structure).
@@ -138,10 +138,13 @@ Skill proposes `quick` vs `spec-driven` mode based on `chosenDirection` and scop
138
138
 
139
139
  The fold-back commit safety contract is non-negotiable:
140
140
 
141
- 1. Preflight `git status --porcelain -- "$ARTIFACT_PATH"` _before_ any artifact mutation.
142
- 2. If clean: append the synthesis section, then `git add -- "$ARTIFACT_PATH"` (explicit `--` form, never `-A`, never globs) followed by `git commit -m "chore(oat): integrate brainstorm into <artifact> for <project-name>"`.
143
- 3. If dirty: present the user with three options before any mutation — (a) commit current artifact changes first then fold-back as new scoped commit, (b) include current changes in the fold-back commit (warn that prior edits are mixed in; user explicitly accepts), or (c) abort fold-back and switch destination to "active project: brainstorming reference file" instead.
144
- 4. Handoff prompt prints only after the scoped commit succeeds. If `git commit` fails (pre-commit hooks reject, signing fails, etc.), surface the error and do NOT print the handoff prompt.
141
+ 1. Resolve scope fail-closed, then preflight the full nested checkout with `git -C "$ACTIVE_PROJECT" status --porcelain` for synced or the exact artifact with `git status --porcelain -- "$ARTIFACT_PATH"` for shared/local, _before_ any artifact mutation. Synced checks must include every project file because the later push persists the whole checkout.
142
+ 2. If clean: append the synthesis section, then use a validated `oat project push --json` receipt for synced (capture its project-ref `sha`) or `git add -- "$ARTIFACT_PATH"` followed by an exact-path branch commit for shared/local.
143
+ 3. If dirty: present the user with three options before any mutation. Every persistence step remains scope-aware:
144
+ - (a) persist the current artifact changes first, then fold back in a second persistence step. Each step uses a validated `oat project push --json` receipt for synced or an exact-path branch commit for shared/local.
145
+ - (b) include current changes in the fold-back persistence step (warn that prior edits are mixed in; user explicitly accepts), using a validated project-ref push for synced or an exact-path branch commit for shared/local.
146
+ - (c) abort fold-back and switch destination to "active project: brainstorming reference file" instead; that route independently resolves scope and uses the same synced-push versus shared/local-commit split.
147
+ 4. Handoff prompt prints only after the scoped commit or synced push succeeds. On persistence failure, surface the error and do NOT print the handoff prompt.
145
148
 
146
149
  **Handoff target:** Append synthesis to the chosen upstream artifact, commit immediately (per safety contract above), then print the handoff prompt template:
147
150
 
@@ -175,6 +178,6 @@ After printing the prompt, the skill stops. The user runs the plan-authoring ski
175
178
  **Trigger phrases:** "this is supplementary for the active project", "save this with the project but don't change the design", "park this as a reference for the project", "stash this in the project's brainstorming folder". Also offered as the third option when the active-project 3-way router fires (related but supplementary → reference file).
176
179
  **Required template fields:** `title` (slug-friendly), filename (defaults to `YYYY-MM-DD-<topic>.md`), the synthesized payload (rendered using the same shape as `templates/brainstorm-doc.md`).
177
180
  **Optional template fields:** `motivation`, `vision`, `openQuestions`, `nextSteps` — same as doc-to-path destination.
178
- **Confirmation pattern:** `minimal` (filename + commit hash). After the file is written, the skill commits it on the active branch and reports the short commit hash alongside the absolute path (for example: "Wrote `<absolute-path>` and committed as `<hash>`.").
179
- **Handoff target:** no downstream skill invocation. Write the synthesized payload to `<active-project>/brainstorming/YYYY-MM-DD-<topic>.md` using the doc-to-path template shape. The `brainstorming/` subdirectory is created if it doesn't exist (parallel to `pr/` and `reviews/`). The reference file is a **durable tracked artifact**: after writing, the skill stages only the new file via `git add -- <reference-path>` and commits it with `chore(oat): capture brainstorming reference for <project-name>` — mirroring the scoped-staging discipline of the fold-back commit safety contract so the working tree is clean when the skill exits.
181
+ **Confirmation pattern:** `minimal` (filename + persistence SHA). After the file is written, the skill reports the absolute path and scope-appropriate SHA: the exact-path branch commit for shared/local or the detached project-ref commit from the validated synced push receipt.
182
+ **Handoff target:** no downstream skill invocation. Write the synthesized payload to `<active-project>/brainstorming/YYYY-MM-DD-<topic>.md` using the doc-to-path template shape. The `brainstorming/` subdirectory is created if it doesn't exist (parallel to `pr/` and `reviews/`). The reference file is a **durable project artifact**: persist it with the fail-closed scope guard so synced projects use `oat project push --json` and capture its `sha`, while other scopes retain scoped staging and the existing branch commit.
180
183
  **If user wants to keep brainstorming after this is offered:** return to flow with destination = active-project-reference-file. Available regardless of active project's phase or PR status; no special probing.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: oat-cursor-cloud-projects
3
- version: 1.0.2
3
+ version: 1.1.1
4
4
  description: Use when OAT work is mentioned in a Cursor Cloud environment. Orients agents to cloud detection, repo-rooted project homes, user-first assets, CLI availability, and Cursor dispatch context without owning lifecycle execution.
5
5
  disable-model-invocation: false
6
6
  user-invocable: true
@@ -153,8 +153,18 @@ Resolve from the target repository:
153
153
  PROJECTS_ROOT="${OAT_PROJECTS_ROOT:-$(oat config get projects.root 2>/dev/null || echo ".oat/projects/shared")}"
154
154
  PROJECTS_ROOT="${PROJECTS_ROOT%/}"
155
155
  PROJECT_PATH=$(oat config get activeProject 2>/dev/null || true)
156
+ if [ -n "$PROJECT_PATH" ]; then
157
+ PROJECT_SCOPE=$(oat project scope "$PROJECT_PATH" --format value) || exit 1
158
+ if [ "$PROJECT_SCOPE" = "synced" ]; then
159
+ oat project pull "$PROJECT_PATH"
160
+ fi
161
+ fi
156
162
  ```
157
163
 
164
+ Run this guard from the target repository before reading project artifacts. A
165
+ record-backed synced path whose checkout is absent is materialized by the pull;
166
+ remote-only projects are adopted by the same command.
167
+
158
168
  Rules:
159
169
 
160
170
  - **Single-repo workspace:** the sole target repository owns `.oat/`, local
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: oat-dispatch-subagents
3
- version: 1.2.2
3
+ version: 1.2.3
4
4
  description: Use when an OAT skill or workflow needs provider-neutral selection, launch, recovery, or evidence for bounded subagent work without project lifecycle policy.
5
5
  disable-model-invocation: true
6
6
  user-invocable: false
@@ -51,10 +51,22 @@ contract.
51
51
 
52
52
  Model-selection policy lives in the `subagent-orchestration` skill (same
53
53
  pack); this skill owns launch mechanics. Read this file before every
54
- OAT-managed subagent dispatch, then read
55
- `.agents/skills/subagent-orchestration/references/model-selection-principles.md`.
54
+ OAT-managed subagent dispatch.
55
+
56
+ Independently probe each required `<name>/SKILL.md` in order: `${SKILL_DIR}/..`
57
+ from this loaded skill, `${HOME}/.agents/skills`, then
58
+ `<repo-root>/.agents/skills`. Bind the first match for `subagent-orchestration`
59
+ to its own `${ORCHESTRATION_SKILLS_ROOT}`; never ambient discovery. On a miss,
60
+ name the skill, stop class-constrained dispatch, and give its intended-scope
61
+ recovery command: `oat tools install utility --scope <user|project>` or
62
+ `oat tools update --pack utility --scope <user|project>`.
63
+
64
+ Then read
65
+ `${ORCHESTRATION_SKILLS_ROOT}/subagent-orchestration/references/model-selection-principles.md`.
56
66
  Resolve the active provider and read exactly one selection reference from
57
- that skill plus the matching mechanics reference from this one:
67
+ `${ORCHESTRATION_SKILLS_ROOT}/subagent-orchestration/references/` plus the
68
+ matching mechanics reference from this skill's own `references/`. The
69
+ short-form paths below are relative to those two already-bound roots:
58
70
 
59
71
  - Claude: `subagent-orchestration/references/provider-claude.md`, then
60
72
  `references/provider-claude.md`
@@ -69,8 +81,9 @@ mappings; the mechanics reference contains surface-specific launch controls.
69
81
  For an unsupported provider, apply the provider-neutral contract and fail
70
82
  closed when exact launch controls cannot be established.
71
83
 
72
- If the `subagent-orchestration` skill is not installed, treat model guidance
73
- as unresolved: fail closed for class-constrained dispatch, and for
84
+ If no candidate root resolves `subagent-orchestration/SKILL.md`, treat model
85
+ guidance as unresolved: fail closed for class-constrained dispatch, name the
86
+ missing skill with its `utility` recovery commands above, and for
74
87
  unconstrained dispatch select only through active user and repository
75
88
  instructions intersected with the live catalog.
76
89