@open-agent-toolkit/cli 0.1.51 → 0.1.53

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 (36) hide show
  1. package/assets/docs/cli-utilities/configuration.md +1 -1
  2. package/assets/docs/cli-utilities/tool-packs.md +23 -2
  3. package/assets/docs/contributing/skills.md +16 -0
  4. package/assets/docs/reference/cli-reference.md +2 -2
  5. package/assets/docs/workflows/projects/hill-checkpoints.md +1 -1
  6. package/assets/docs/workflows/projects/implementation-execution.md +25 -0
  7. package/assets/docs/workflows/projects/lifecycle.md +9 -0
  8. package/assets/public-package-versions.json +4 -4
  9. package/assets/skills/oat-dispatch-subagents/SKILL.md +222 -0
  10. package/assets/skills/oat-dispatch-subagents/references/provider-claude.md +44 -0
  11. package/assets/skills/oat-dispatch-subagents/references/provider-codex.md +69 -0
  12. package/assets/skills/oat-dispatch-subagents/references/provider-cursor.md +61 -0
  13. package/assets/skills/oat-dispatch-subagents/references/record-schema.md +100 -0
  14. package/assets/skills/oat-project-dispatch-subagents/SKILL.md +218 -0
  15. package/assets/skills/oat-project-implement/SKILL.md +104 -30
  16. package/assets/skills/oat-project-import-plan/SKILL.md +6 -6
  17. package/assets/skills/oat-project-next/SKILL.md +8 -1
  18. package/assets/skills/oat-project-plan/SKILL.md +6 -6
  19. package/assets/skills/oat-project-plan-writing/SKILL.md +13 -10
  20. package/assets/skills/oat-project-pr-final/SKILL.md +8 -1
  21. package/assets/skills/oat-project-quick-start/SKILL.md +5 -5
  22. package/assets/skills/oat-repo-improve/SKILL.md +137 -0
  23. package/assets/skills/oat-repo-improve/references/audit-playbook.md +130 -0
  24. package/assets/skills/oat-repo-improve/references/closing-the-loop.md +96 -0
  25. package/assets/skills/oat-repo-improve/references/plan-template.md +199 -0
  26. package/dist/commands/config/index.d.ts.map +1 -1
  27. package/dist/commands/config/index.js +34 -9
  28. package/dist/commands/init/tools/shared/skill-manifest.d.ts +2 -2
  29. package/dist/commands/init/tools/shared/skill-manifest.d.ts.map +1 -1
  30. package/dist/commands/init/tools/shared/skill-manifest.js +3 -0
  31. package/dist/config/oat-config.d.ts +9 -1
  32. package/dist/config/oat-config.d.ts.map +1 -1
  33. package/dist/config/oat-config.js +55 -4
  34. package/dist/config/resolve.d.ts.map +1 -1
  35. package/dist/config/resolve.js +7 -3
  36. package/package.json +2 -2
@@ -0,0 +1,100 @@
1
+ # Dispatch Record Schema
2
+
3
+ Load this reference only when constructing or validating dispatch evidence.
4
+ Use neutral scope, action, role, and authority fields. Calling workflows may
5
+ add namespaced metadata without redefining these fields.
6
+
7
+ ## Request
8
+
9
+ ```yaml
10
+ request_id: dispatch-unique-id
11
+ caller: oat-repo-improve
12
+ scope: repo:packages/cli
13
+ objective: Audit CLI correctness hotspots
14
+ action: analysis
15
+ role:
16
+ name: repo-audit-scout
17
+ class: recon
18
+ provider: codex
19
+ dispatch_context: root-native
20
+ dispatch_policy: economy
21
+ dispatch_ceiling: high
22
+ authority: read-only
23
+ expected_output: structured-findings
24
+ verification_evidence: file-line-references
25
+ deadline_seconds: 300
26
+ retry_limit: 1
27
+ authorization_scope: this-audit-run
28
+ fallback:
29
+ mode: explicit-downgrade
30
+ target: reduced-quick-audit
31
+ escalate_when:
32
+ - evidence requires cross-package reconciliation
33
+ - security impact is consequential
34
+ ```
35
+
36
+ `dispatch_policy` and `dispatch_ceiling` are optional resolved inputs. The
37
+ general engine does not resolve their source.
38
+
39
+ ## Record
40
+
41
+ ```yaml
42
+ request_id: dispatch-unique-id
43
+ caller: oat-repo-improve
44
+ scope: repo:packages/cli
45
+ objective: Audit CLI correctness hotspots
46
+ action: analysis
47
+ role_name: repo-audit-scout
48
+ role_class: recon
49
+ provider: codex
50
+ dispatch_context: root-native
51
+ dispatch_policy: economy
52
+ dispatch_ceiling: high
53
+ catalog_snapshot:
54
+ id: root-native-1
55
+ source: tool-schema
56
+ observed_at: 2026-07-12T00:00:00Z
57
+ authority: read-only
58
+ role_selector: oat-recon-worker
59
+ model_selector: opaque-provider-selector
60
+ model_selector_granularity: opaque
61
+ effort_selector: economical
62
+ selection_source: explicit-call
63
+ candidates_considered:
64
+ - opaque-provider-selector
65
+ selection_reason: native-catalog
66
+ selected_route: native
67
+ deadline_seconds: 300
68
+ retry_limit: 1
69
+ payload: {}
70
+ launch_status: accepted
71
+ child_outcome: completed
72
+ configured_invocation_evidence: []
73
+ runtime_confirmation: not-reported
74
+ diagnostics: []
75
+ continuation_events: []
76
+ ```
77
+
78
+ `role_selector` is the exact provider or harness agent-type selector, when that
79
+ surface exists. Preserve opaque selectors byte-for-byte.
80
+
81
+ ## Recon Wave
82
+
83
+ ```yaml
84
+ wave_id: repo-audit-wave-1
85
+ scope: repo:packages/cli
86
+ shared_dispatch_record: dispatch-unique-id
87
+ lanes:
88
+ - lane_id: correctness
89
+ scope: packages/cli/src
90
+ launch_status: accepted
91
+ child_outcome: completed
92
+ - lane_id: security
93
+ scope: packages/cli/src
94
+ launch_status: accepted
95
+ child_outcome: completed
96
+ ```
97
+
98
+ The wave scope is the aggregate boundary. Lane scope may narrow it. Use one
99
+ shared record only when every dispatch axis listed in the main skill is
100
+ identical.
@@ -0,0 +1,218 @@
1
+ ---
2
+ name: oat-project-dispatch-subagents
3
+ version: 1.0.0
4
+ description: Use when an OAT project lifecycle skill needs to translate project state, phase or task scope, gates, and write authority into a provider-neutral subagent dispatch.
5
+ disable-model-invocation: true
6
+ user-invocable: false
7
+ allowed-tools: Read, Bash
8
+ ---
9
+
10
+ # Dispatching OAT Project Subagents
11
+
12
+ Use this internal adapter for OAT project lifecycle delegation. It resolves
13
+ project policy and lifecycle authority, then invokes `oat-dispatch-subagents`
14
+ for provider selection, launch, recovery, and generic evidence.
15
+
16
+ ## Progress Indicators (User-Facing)
17
+
18
+ This skill is an internal dependency; the calling project lifecycle skill owns
19
+ progress indicators and decides whether a sub-banner is useful. When surfacing
20
+ a distinct project dispatch wave, use:
21
+
22
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
23
+ OAT ▸ PROJECT SUBAGENT DISPATCH
24
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
25
+
26
+ Do not repeat the banner for every task. Return a compact project-scope and
27
+ dispatch summary for the caller to incorporate.
28
+
29
+ ## Required Loading
30
+
31
+ Resolve and read `oat-dispatch-subagents` from the active skill catalog before
32
+ every lifecycle dispatch. Follow its provider-reference loading rule and
33
+ request/record contract. Do not copy provider mechanics into this adapter.
34
+
35
+ If the engine skill is unavailable, stop before project mutation or child
36
+ launch and tell the user to install the utility pack at the matching scope:
37
+
38
+ ```bash
39
+ oat tools install utility --scope project
40
+ ```
41
+
42
+ Use `--scope user` when workflows are intentionally user-scoped. Do not fall
43
+ back to duplicated inline dispatch logic.
44
+
45
+ ## Ownership Boundary
46
+
47
+ This adapter owns:
48
+
49
+ - active project, workflow mode, phase, and task scope resolution;
50
+ - project and phase dispatch policy and named ceiling resolution;
51
+ - lifecycle role policy, gates, task IDs, write roots, commits, and worktrees;
52
+ - translation into a generic dispatch request;
53
+ - project-specific outcome bookkeeping layered on the generic record.
54
+
55
+ The general dispatch skill owns capability, authorization, catalogs,
56
+ candidate intersection, route selection, launch acceptance, continuation, and
57
+ recovery. Calling lifecycle skills still own sequencing, plan mutation,
58
+ cross-task synthesis, user checkpoints, and final artifact writes.
59
+
60
+ ## Resolve Project Context
61
+
62
+ Resolve a user-supplied project path first. Otherwise use the active project.
63
+ Read state through the OAT CLI source of truth rather than ad-hoc YAML parsing:
64
+
65
+ ```bash
66
+ oat project status --project-path "$PROJECT_PATH" --json
67
+ ```
68
+
69
+ Before dispatch, establish:
70
+
71
+ - project path, workflow mode, current phase, and phase status;
72
+ - lifecycle scope such as phase ID or `pNN-tNN` task ID;
73
+ - declared dependencies and parallel group, when applicable;
74
+ - task file boundary, required verification, and write authority;
75
+ - worktree and commit expectations;
76
+ - configured HiLL, phase-review, and lifecycle-gate requirements;
77
+ - effective dispatch policy and named ceiling.
78
+
79
+ If project state cannot be resolved or conflicts with the requested lifecycle
80
+ scope, block before invoking the general engine.
81
+
82
+ ## Resolve Dispatch Policy
83
+
84
+ Use the current OAT CLI resolver contract for the active provider and
85
+ lifecycle role. Do not duplicate dispatch matrices or parse configuration
86
+ layers directly. Preserve the resolver's exact candidate selectors and
87
+ provider arguments.
88
+
89
+ Project policy may cap or select a target. Translate the resolved policy and
90
+ ceiling into the generic request; do not ask the general engine to read
91
+ `state.md` or infer project configuration.
92
+
93
+ ## Lifecycle Roles
94
+
95
+ Map each lifecycle role to a generic baseline class and add project policy:
96
+
97
+ | Lifecycle role | Generic class | Project-specific contract |
98
+ | -------------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
99
+ | Phase coordinator | `coordinator` | Own one phase dossier. Prefer an explicit suitable native target; inherit only when the root/session target is deliberately suitable. |
100
+ | Task worker | `worker` | Own one task and bounded files. Use an explicit native or pre-selected alternate target; never silently inherit an expensive root model. |
101
+ | Fix worker | `worker` | Own listed findings and bounded files. Preserve retry/fix-loop limits and original task context. |
102
+ | Planning self-review | `reviewer` | Inherit the planning parent by default unless the plan-writing contract requires an exact independent reviewer. |
103
+ | Implementation self-review | `reviewer` | Target the resolved reviewer ceiling; inherit only when the review-owning dispatcher is known to satisfy it. |
104
+ | Phase gate | `reviewer` | Use the configured independent target and fail closed when unavailable. |
105
+ | Lifecycle gate | `reviewer` | Stay independent of producer context and fail closed rather than substituting same-context self-review. |
106
+
107
+ The calling lifecycle skill remains authoritative when its reviewed contract
108
+ is stricter than this table.
109
+
110
+ ## Adapt the Request
111
+
112
+ For every lifecycle dispatch:
113
+
114
+ 1. Validate project state and requested phase/task scope.
115
+ 2. Resolve lifecycle role policy, provider, named ceiling, and exact
116
+ configuration through current CLI interfaces.
117
+ 3. Define objective, bounded files or read scope, expected output,
118
+ verification evidence, escalation conditions, authority, deadline, retry
119
+ limit, and fallback.
120
+ 4. Map the lifecycle role to a generic class.
121
+ 5. Add project metadata without replacing neutral request fields.
122
+ 6. Invoke `oat-dispatch-subagents` with the complete request.
123
+ 7. Preserve its generic dispatch record unchanged.
124
+ 8. Add lifecycle outcome metadata and let the calling workflow perform state,
125
+ plan, implementation-log, commit, or review-table writes.
126
+
127
+ Example adapter input:
128
+
129
+ ```yaml
130
+ project_path: .oat/projects/shared/example
131
+ project_mode: quick
132
+ project_phase: implement
133
+ scope: p01-t02
134
+ lifecycle_role: task-worker
135
+ file_boundary:
136
+ - packages/cli/src/example.ts
137
+ verification:
138
+ - pnpm --filter @open-agent-toolkit/cli test
139
+ commit_policy: one-commit-per-task
140
+ worktree: root
141
+ ```
142
+
143
+ Example namespaced metadata added to the generic request:
144
+
145
+ ```yaml
146
+ project:
147
+ path: .oat/projects/shared/example
148
+ mode: quick
149
+ phase: implement
150
+ phase_id: p01
151
+ task_id: p01-t02
152
+ file_boundary:
153
+ - packages/cli/src/example.ts
154
+ commit_policy: one-commit-per-task
155
+ worktree: root
156
+ ```
157
+
158
+ ## Coordinator and Worker Topology
159
+
160
+ Use a phase coordinator only when the lifecycle workflow declares that
161
+ topology. A coordinator may dispatch task workers when nesting and authority
162
+ permit it, but it must not widen task boundaries, alter plan sequencing, or
163
+ take over user checkpoints.
164
+
165
+ For parallel groups, preserve plan-declared isolation. Each worktree receives
166
+ only its assigned phase/task boundaries and must not mutate sibling worktrees.
167
+ The root lifecycle workflow retains merge ordering and conflict resolution.
168
+
169
+ ## Gates and Independence
170
+
171
+ Gate independence is project policy layered on the generic reviewer class.
172
+ Resolve the configured gate target before launch and pass it as exact selection
173
+ input. If the required independent target cannot be enforced, block the gate;
174
+ do not silently downgrade to producer-context review.
175
+
176
+ Treat gate artifacts, receive eligibility, and lifecycle disposition as caller
177
+ concerns. The dispatch engine returns evidence and output but does not mutate
178
+ review tables or project state.
179
+
180
+ ## Lifecycle Record Extension
181
+
182
+ Preserve the generic record and attach project metadata separately:
183
+
184
+ ```yaml
185
+ project_dispatch:
186
+ project_path: .oat/projects/shared/example
187
+ workflow_mode: quick
188
+ phase: implement
189
+ phase_id: p01
190
+ task_id: p01-t02
191
+ lifecycle_role: task-worker
192
+ file_boundary:
193
+ - packages/cli/src/example.ts
194
+ worktree: root
195
+ commit_policy: one-commit-per-task
196
+ gate_requirement: none
197
+ generic_dispatch_record: dispatch-unique-id
198
+ lifecycle_outcome:
199
+ task_status: complete
200
+ verification_status: passed
201
+ commit: abc1234
202
+ ```
203
+
204
+ Do not rewrite generic route, selector, acceptance, outcome, or diagnostic
205
+ fields inside the lifecycle extension.
206
+
207
+ ## Failure Boundaries
208
+
209
+ - Invalid or stale project state: block before generic dispatch.
210
+ - Scope outside the plan or assigned worktree: block and return to the caller.
211
+ - Incomplete resolver result: do not invent a target; surface the diagnostic.
212
+ - Generic pre-start rejection: apply caller retry policy through the general
213
+ engine.
214
+ - Accepted child failure: return the terminal outcome to the lifecycle caller;
215
+ do not select a replacement automatically.
216
+ - Required gate target unavailable: fail closed.
217
+ - Verification or commit failure after worker completion: lifecycle caller owns
218
+ repair and bookkeeping; do not falsify the child outcome.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: oat-project-implement
3
- version: 2.0.35
3
+ version: 2.0.36
4
4
  description: Use when plan.md is ready for execution. Dispatches phase coordinators that select one exact target-pinned worker per task; supports bounded fix loops and plan-declared worktree-isolated parallel phases.
5
5
  oat_gateable: true
6
6
  argument-hint: '[--retry-limit <N>] [--dry-run]'
@@ -1451,7 +1451,7 @@ git add {PROJECT_PATH}/implementation.md {PROJECT_PATH}/state.md {PROJECT_PATH}/
1451
1451
  git commit -m "chore(oat): bookkeeping after {pNN} {pass|fail}"
1452
1452
  ```
1453
1453
 
1454
- Then run the optional external phase review gate for the completed phase when `oat_phase_review_gate` selects it. After the gate passes or is skipped, check HiLL checkpoint if the phase ID is in `oat_plan_hill_phases`, pause for user approval before continuing.
1454
+ Then run the optional external phase review gate for the completed phase when `oat_phase_review_gate` selects it. After the gate passes or is skipped, check the HiLL checkpoint. A non-final checkpoint pauses at this boundary; defer a final-phase checkpoint to **Final HiLL Closeout Sequence** after final verification, final review, and any configured pre-approval steps succeed.
1455
1455
 
1456
1456
  ### Step 8: Check Plan Phase Completion
1457
1457
 
@@ -1495,12 +1495,20 @@ Before pausing at a checkpoint, check if auto-review is enabled:
1495
1495
 
1496
1496
  3. If disabled: skip directly to the checkpoint pause.
1497
1497
 
1498
- When pausing:
1498
+ When pausing at a non-final checkpoint:
1499
1499
 
1500
1500
  - Output phase summary (tasks completed, commits made)
1501
1501
  - Ask user: "Phase {N} ({phase_name}) complete. Continue to next phase?"
1502
1502
  - Wait for user approval before proceeding to next plan phase
1503
1503
 
1504
+ **Final checkpoint deferral:** If the current phase is the final implementation
1505
+ phase and it is configured as a HiLL checkpoint, do not ask the generic
1506
+ "Continue to next phase?" question. Final checkpoint auto-review above still
1507
+ runs exactly as written, including `oat-project-review-provide code final` and
1508
+ its no-duplicate-final-review rule. Then continue through Steps 9–14. Final
1509
+ approval occurs only in **Final HiLL Closeout Sequence**, after final review and
1510
+ the stored pre-approval sequence complete.
1511
+
1504
1512
  **Restart safety (required):**
1505
1513
 
1506
1514
  - At the end of each task and at each phase boundary, ensure `implementation.md` is persisted and internally consistent:
@@ -1541,7 +1549,7 @@ Do not use `git add -A` or glob patterns. Only commit the three project artifact
1541
1549
  **Note on HiLL types:**
1542
1550
 
1543
1551
  - **Workflow HiLL** (`oat_hill_checkpoints` in state.md): Gates between workflow phases (discovery → spec → design → plan → implement). Checked by oat-project-progress router.
1544
- - **Plan phase checkpoints** (`oat_plan_hill_phases` in plan.md): Gates at plan phase boundaries during implementation. `[]` means pause after every phase; a populated array pauses only after listed phases. The field may be absent only before the first implementation-run confirmation. Listed phases are where you stop AFTER completing them.
1552
+ - **Plan phase checkpoints** (`oat_plan_hill_phases` in plan.md): Gates at plan phase boundaries during implementation. `[]` means pause after every phase; a populated array pauses only after listed phases. The field may be absent only before the first implementation-run confirmation. Listed phases are where you stop AFTER completing them. A checkpoint on the final implementation phase is deferred to final closeout so final verification, final review, and configured pre-approval work finish before explicit approval.
1545
1553
  - **Phase review gate** (`oat_phase_review_gate` in plan.md): Optional non-pausing external review gate after a completed phase passes the standard reviewer. Missing/disabled means skip; `phases: []` means gate every implementation phase. Passing gates continue automatically; blocking gates are received/fixed before execution proceeds.
1546
1554
 
1547
1555
  **Revision phase completion handling:**
@@ -1715,10 +1723,12 @@ echo "$FINAL_ROW"
1715
1723
  - Example row:
1716
1724
  - `| final | code | passed | 2026-01-28 | reviews/final-review-2026-01-28T140322Z.md |`
1717
1725
  - Check:
1726
+
1718
1727
  ```bash
1719
1728
  echo "$FINAL_ROW" | grep -qE "^\\|\\s*final\\s*\\|.*\\|\\s*passed\\s*\\|" && echo "passed"
1720
1729
  ```
1721
- - Skip to Step 15 (PR prompt)
1730
+
1731
+ - Continue to Step 15 (final closeout)
1722
1732
 
1723
1733
  **If final review is not marked `passed`:**
1724
1734
 
@@ -1807,36 +1817,100 @@ To run in a separate session use: oat-project-review-provide code final
1807
1817
 
1808
1818
  **After final review is marked `passed`:**
1809
1819
 
1810
- - Update `"$PROJECT_PATH/state.md"` frontmatter:
1811
- - `oat_phase: implement`
1812
- - `oat_phase_status: complete`
1813
- - `oat_project_state_updated: "{ISO 8601 UTC timestamp}"`
1814
- - Append `"implement"` to `oat_hill_completed` (only if configured as a HiLL gate)
1815
- - Update state content to "Implementation complete".
1816
- - Update `"$PROJECT_PATH/plan.md"`:
1817
- - Set the `final` review row status to `passed` (if not already)
1818
- - Ensure `## Implementation Complete` totals reflect any review fix tasks that were added
1819
- - Update `"$PROJECT_PATH/implementation.md"`:
1820
- - Ensure `oat_current_task_id: null`
1821
- - Ensure the "Review Received" section reflects completed fixes and points to the next action (PR) rather than "execute fix tasks"
1820
+ - Record the passed final review and keep the project in implementation closeout.
1821
+ - Do not append `"implement"` to `oat_hill_completed`, set
1822
+ `oat_phase_status: complete`, or offer the normal next-step prompt yet.
1823
+ - Continue to **Final HiLL Closeout Sequence**.
1822
1824
 
1823
- ### Step 15: Prompt for Next Steps
1825
+ ### Step 15: Final HiLL Closeout Sequence
1824
1826
 
1825
- After final review passes (no Critical/Important findings):
1827
+ The final-closeout orchestrator owns this sequence after the rebased phase
1828
+ coordinator has finished. Do not move lifecycle sequencing into task workers or
1829
+ weaken exact target selection for child dispatches.
1826
1830
 
1827
- **Workflow preference check (before prompting):**
1831
+ Identify the final implementation phase from the plan. A final HiLL checkpoint
1832
+ exists when `oat_plan_hill_phases` is `[]` (every phase) or when it explicitly
1833
+ contains that final phase ID. Defer only a checkpoint on the final implementation
1834
+ phase; non-final checkpoint behavior remains unchanged.
1828
1835
 
1829
- ```bash
1830
- POST_IMPL=$(oat config get workflow.postImplementSequence 2>/dev/null || true)
1831
- ```
1836
+ Run final verification (Step 13). Final review must be `passed` before any
1837
+ pre-approval dispatch. If final checkpoint auto-review is enabled, Step 8 has
1838
+ already run `oat-project-review-provide code final`; do not run a duplicate
1839
+ final review here.
1840
+
1841
+ Read the effective `workflow.postImplementSequence` once. For a configured
1842
+ legacy or structured preference, normalize legacy values before snapshotting:
1843
+ `wait` → `{ preApproval: [], postApproval: [] }`, `summary` →
1844
+ `{ preApproval: ["summary"], postApproval: [] }`, `pr` → `{ preApproval:
1845
+ ["summary", "pr"], postApproval: [] }`, and `docs-pr` → `{ preApproval:
1846
+ ["summary", "document", "pr"], postApproval: [] }`.
1832
1847
 
1833
- - **If `POST_IMPL` is `wait`:** Print `Post-implementation: wait (from workflow.postImplementSequence). Run follow-up skills manually when ready.` Exit without auto-chaining.
1834
- - **If `POST_IMPL` is `summary`:** Print `Post-implementation: summary (from workflow.postImplementSequence).` Invoke `oat-project-summary`. Stop after summary completes.
1835
- - **If `POST_IMPL` is `pr`:** Print `Post-implementation: pr (from workflow.postImplementSequence).` Invoke `oat-project-pr-final` (which auto-generates `summary.md` as part of its flow).
1836
- - **If `POST_IMPL` is `docs-pr`:** Print `Post-implementation: docs-pr (from workflow.postImplementSequence).` Invoke `oat-project-document` then `oat-project-pr-final` (summary included via pr-final).
1837
- - **If unset or invalid:** Fall through to the standard prompt below.
1848
+ Persist this immutable state before dispatching a child:
1849
+
1850
+ ```yaml
1851
+ oat_post_implement_sequence:
1852
+ status: pre_approval # pre_approval | awaiting_approval | post_approval | failed | complete
1853
+ final_phase: pNN
1854
+ pre_approval: [summary, document, pr]
1855
+ pre_approval_completed: []
1856
+ approval: pending # pending | approved | not_required
1857
+ post_approval: []
1858
+ post_approval_completed: []
1859
+ failure: null
1860
+ ```
1838
1861
 
1839
- **Rationale:** `oat-project-pr-final` already auto-generates/refreshes `summary.md` as part of its flow, so `pr` and `docs-pr` do not need a separate summary step. The `summary` value exists as a standalone option for the rare case where you want just the summary without PR.
1862
+ The snapshot is immutable for this closeout: never re-resolve
1863
+ `workflow.postImplementSequence` while it is incomplete. Iterate
1864
+ `pre_approval` and `post_approval` in their stored array order; do not sort or
1865
+ substitute a vocabulary order. Resume from the first incomplete stored step,
1866
+ including a partially completed noncanonical order.
1867
+
1868
+ For every pending `summary`, `document`, or `pr`, dispatch respectively
1869
+ `oat-project-summary`, `oat-project-document`, or `oat-project-pr-final`.
1870
+ Every `summary`, `document`, and `pr` child receives the authoritative snapshot
1871
+ and must merge state updates without replacing `oat_post_implement_sequence`.
1872
+ Re-read and verify the snapshot after every child returns before recording step
1873
+ success. If a child removed or altered it, restore the authoritative snapshot,
1874
+ record that step as failed, and stop with the boundary, failed step, and exact
1875
+ resume command: `oat-project-implement`.
1876
+
1877
+ Commit each completed step before dispatching the next step. On failure, persist
1878
+ `status: failed`, the boundary, the failed step, and concise recovery context.
1879
+ A pre-approval failure leaves `approval: pending`; a post-approval failure
1880
+ retains `approval: approved`. Fail fast with the boundary, failed step, and
1881
+ exact resume command: `oat-project-implement`.
1882
+
1883
+ 1. Dispatch incomplete `pre_approval` steps in stored order.
1884
+ 2. When they succeed and a final checkpoint exists, commit `status:
1885
+ awaiting_approval` with `approval: pending` before asking for final HiLL
1886
+ approval.
1887
+ 3. Record explicit approval as `approval: approved` and `status: post_approval`
1888
+ before any post-approval dispatch. Then dispatch incomplete `post_approval`
1889
+ steps in stored order.
1890
+ 4. A decline or defer keeps `status: awaiting_approval` and `approval: pending`;
1891
+ record neither approval nor failure and run no post-approval step. State the
1892
+ boundary and exact resume command: `oat-project-implement`.
1893
+ 5. If no final checkpoint exists, commit `approval: not_required` before
1894
+ post-approval dispatch. `approval: not_required` is valid only when no final
1895
+ checkpoint exists.
1896
+ 6. After all stored steps finish, commit `status: complete`. Only then complete
1897
+ implementation state, append the configured final HiLL completion, and
1898
+ continue to the existing next-step behavior.
1899
+
1900
+ If the preference is unset, do not create a sequence snapshot. When the
1901
+ preference is unset, retain the existing next-step prompt only after final
1902
+ approval when a final checkpoint is configured.
1903
+
1904
+ ### Step 16: Prompt for Next Steps
1905
+
1906
+ Run the standard next-step prompt only when
1907
+ `workflow.postImplementSequence` was unset and no sequence snapshot was
1908
+ created. It occurs after final approval when a final checkpoint is configured.
1909
+ A configured legacy or structured preference has already completed through
1910
+ **Final HiLL Closeout Sequence**; do not re-dispatch its steps here. When the
1911
+ completed snapshot came from configured `wait`, print
1912
+ `Post-implementation: wait (from workflow.postImplementSequence). Run
1913
+ follow-up skills manually when ready.` and exit without auto-chaining.
1840
1914
 
1841
1915
  **Standard prompt (when preference is unset):**
1842
1916
 
@@ -1869,7 +1943,7 @@ Do not route directly to `oat-project-complete`. The `pr_open` status set by pr-
1869
1943
 
1870
1944
  Tell user: "Run the skills individually when ready: oat-project-summary → oat-project-document → oat-project-pr-final"
1871
1945
 
1872
- ### Step 16: Output Summary
1946
+ ### Step 17: Output Summary
1873
1947
 
1874
1948
  ```
1875
1949
  Implementation complete for {project-name}.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: oat-project-import-plan
3
- version: 1.4.4
3
+ version: 1.4.5
4
4
  description: Use when you have an external markdown plan to execute with OAT. Preserves the source plan and normalizes it into canonical plan.md format.
5
5
  argument-hint: '<path-to-plan.md> [--provider codex|cursor|claude] [--project <name>]'
6
6
  oat_gateable: true
@@ -16,7 +16,7 @@ Import a markdown plan from an external coding provider and normalize it into OA
16
16
  Provider native plan mode uses this same path: provider-plan-via-import
17
17
  preserves the provider plan first, and provider plan dispatch readiness
18
18
  inherits the same import workflow contract below, including complete ladder
19
- adoption, the project named ceiling, the `Shared Phase-Review Setup Contract`,
19
+ adoption, the project named ceiling, the `Shared Phase Gate Review Setup Contract`,
20
20
  and the rule that readiness and completion follow only after a durable review
21
21
  disposition. It does not add a separate provider-plan prompt.
22
22
 
@@ -277,10 +277,10 @@ maximum. Use the canonical
277
277
  project ceiling resolves. `Uncapped` and `Inherit Host Defaults` remain
278
278
  explicit modes; `Leave Unresolved` is not implementation-ready.
279
279
 
280
- ### Step 4.25: Configure Optional Phase Review
280
+ ### Step 4.25: Configure Optional Phase Gate Review
281
281
 
282
282
  After normalization has produced stable phase IDs and before Step 4.5 starts
283
- the import-aware plan artifact review, invoke the `Shared Phase-Review Setup
283
+ the import-aware plan artifact review, invoke the `Shared Phase Gate Review Setup
284
284
  Contract` from `oat-project-plan-writing`. Provider native plan mode uses this
285
285
  same import step and inherits its result.
286
286
 
@@ -289,10 +289,10 @@ through the shared contract without probing, prompting, or mutation. Resumed or
289
289
  imported explicit values remain authoritative without re-prompting. Otherwise
290
290
  let the contract probe qualifying targets and offer all phases, selected
291
291
  phases, or disabled. If the probe fails, no target qualifies, or the user
292
- declines, leave phase review disabled and continue with the contract's concise
292
+ declines, leave Phase gate review disabled and continue with the contract's concise
293
293
  status output.
294
294
 
295
- This phase-review setup is independent from HiLL checkpoints. Do not read or
295
+ This Phase gate review setup is independent from HiLL checkpoints. Do not read or
296
296
  change HiLL fields here, and do not add a provider/model `--target` to any
297
297
  lifecycle command.
298
298
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: oat-project-next
3
- version: 1.0.6
3
+ version: 1.0.7
4
4
  description: Use when continuing work on the active OAT project. Reads project state, determines the next lifecycle action, and invokes the appropriate skill automatically.
5
5
  disable-model-invocation: true
6
6
  user-invocable: true
@@ -259,6 +259,13 @@ Entry condition: `oat_phase == "implement"` AND (`oat_phase_status == "complete"
259
259
 
260
260
  Apply the following checks in priority order. Stop at the first match:
261
261
 
262
+ **5.0: Incomplete approval-aware post-implementation sequence**
263
+
264
+ Before every other post-implementation route, inspect `oat_post_implement_sequence`
265
+ in project state. When the snapshot exists and is incomplete, route to
266
+ `oat-project-implement`. This applies even when `oat_phase_status` is `pr_open`
267
+ or a summary exists. A completed snapshot falls through to the normal router.
268
+
262
269
  **5.1: Incomplete revision tasks**
263
270
 
264
271
  Grep plan.md for `p-revN` phases. If any `p-revN` tasks exist with status != completed in implementation.md:
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: oat-project-plan
3
- version: 1.3.12
3
+ version: 1.3.13
4
4
  description: Use when design.md is complete and executable implementation tasks are needed. Breaks design into bite-sized TDD tasks in canonical plan.md format.
5
5
  oat_gateable: true
6
6
  disable-model-invocation: true
@@ -203,7 +203,7 @@ oat_template: false
203
203
 
204
204
  When Overwrite restored an explicit phase-review snapshot, keep that exact
205
205
  entry in this first rewritten frontmatter. Do not let the generic frontmatter
206
- update remove or replace it. The shared phase-review setup in Step 12.25 must
206
+ update remove or replace it. The shared Phase gate review setup in Step 12.25 must
207
207
  observe the restored key and preserve it without probing, prompting, or
208
208
  mutation. When the key was absent from the overwritten plan, do not invent it
209
209
  before the shared setup contract runs.
@@ -417,20 +417,20 @@ Ask: "Does this breakdown make sense? Any tasks missing?"
417
417
 
418
418
  Iterate until user confirms.
419
419
 
420
- ### Step 12.25: Configure Optional Phase Review
420
+ ### Step 12.25: Configure Optional Phase Gate Review
421
421
 
422
422
  After the confirmed plan has stable phase IDs and before Step 12.5 starts the
423
- plan artifact review, invoke the `Shared Phase-Review Setup Contract` from
423
+ plan artifact review, invoke the `Shared Phase Gate Review Setup Contract` from
424
424
  `oat-project-plan-writing`.
425
425
 
426
426
  If `plan.md` already contains an explicit `oat_phase_review_gate`, preserve it
427
427
  through the shared contract without probing, prompting, or mutation. Otherwise
428
428
  let the contract probe qualifying targets and offer all phases, selected
429
429
  phases, or disabled. If the probe fails, no target qualifies, or the user
430
- declines, leave phase review disabled and continue with the contract's concise
430
+ declines, leave Phase gate review disabled and continue with the contract's concise
431
431
  status output.
432
432
 
433
- This phase-review setup is independent from HiLL checkpoints. Do not read or
433
+ This Phase gate review setup is independent from HiLL checkpoints. Do not read or
434
434
  change HiLL fields here, and do not add a provider/model `--target` to any
435
435
  lifecycle command.
436
436