@open-agent-toolkit/cli 0.0.52 → 0.0.54

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.
@@ -0,0 +1,112 @@
1
+ # Selective Review Pass
2
+
3
+ This reference defines the prose-driven classification pass used by `oat-project-design` when `DESIGN_MODE == "selective"`. The skill body owns flow; this file owns the heuristic.
4
+
5
+ ## Signal Set
6
+
7
+ Classify each design section as `routine` or `needs-eyes`. Bias is conservative: any one `needs-eyes` signal marks the section `needs-eyes`.
8
+
9
+ Always `needs-eyes`:
10
+
11
+ - `Overview + Architecture`
12
+ - `Security Considerations`
13
+ - `Performance Considerations`
14
+ - `Error Handling`
15
+ - `Migration Plan`
16
+
17
+ Per-section `needs-eyes` signals:
18
+
19
+ - The user flagged concern, uncertainty, or worry about this area during discovery.
20
+ - Discovery Open Questions mention this area.
21
+ - Three or more spec FRs/NFRs directly touch this area.
22
+ - Component boundaries cross modules not already described in `.oat/repo/knowledge/architecture.md`.
23
+ - The section introduces a pattern absent from `.oat/repo/knowledge/conventions.md` and `.oat/repo/knowledge/stack.md`.
24
+ - The section changes public API, CLI, configuration, workflow semantics, defaults, or persisted state.
25
+ - The section introduces a new dependency, provider, service, storage model, permission boundary, or external integration.
26
+ - The section depends on knowledge files that are missing, stale, or too thin to support a low-risk classification.
27
+
28
+ `routine` means the section follows established repo patterns, is low-risk, and has enough grounding to draft silently. It does not mean the section is unimportant; it still appears in the committed design and final review gate.
29
+
30
+ ## Adequate Grounding
31
+
32
+ Grounding is adequate when at least one strong source, or two weaker sources, exists for the design surface:
33
+
34
+ - Strong sources: `.oat/repo/knowledge/project-index.md`, `.oat/repo/knowledge/architecture.md`, or a configured docs app with relevant architecture/convention docs.
35
+ - Weaker sources: non-thin `docs/`, `.oat/repo/knowledge/conventions.md`, `.oat/repo/knowledge/stack.md`, `.oat/repo/knowledge/concerns.md`, discovery notes with concrete implementation context, or existing nearby implementation patterns found in the repo.
36
+
37
+ Treat grounding as broadly absent when discovery skipped solution-space exploration and the knowledge base/docs are sparse. In that case, do not recommend Selective Collaborative; prefer Collaborative.
38
+
39
+ ## Recommendation Rules
40
+
41
+ Before the picker, run a lightweight classification preflight against the shared section list. Assign Selective Collaborative one of four states:
42
+
43
+ - `recommended`: grounding is adequate and at least 3 sections, or roughly 30-40% of sections, classify as `routine`.
44
+ - `available`: grounding is adequate but Collaborative is still the safer default.
45
+ - `available-not-recommended`: grounding exists, but savings are marginal for this design.
46
+ - `unavailable`: grounding is broadly absent.
47
+
48
+ Default recommendation is Collaborative when in doubt. Draft-and-review is never the picker default unless explicitly selected through argument, environment, or config.
49
+
50
+ ## Edge Cases
51
+
52
+ - If every section is `needs-eyes`, Selective Collaborative collapses to Collaborative. Emit: "All sections flagged for review — running as full collaborative."
53
+ - If zero sections are `needs-eyes`, force `Overview + Architecture` to `needs-eyes` so the user sees the framing before silent drafting continues.
54
+ - If a user elevates a `routine` section in the Section Review Plan, keep it `needs-eyes` for the rest of the run.
55
+ - If the user chooses "walk me through every remaining section" during a needs-eyes confirmation, mark all remaining sections `needs-eyes`.
56
+ - If the classification cannot explain its reason in one sentence, treat the section as `needs-eyes`.
57
+
58
+ ## Examples
59
+
60
+ Routine example:
61
+
62
+ | Section | Classification | Reason | Signals hit |
63
+ | ---------------- | -------------- | -------------------------------------------------------------------------------------------------- | ------------------- |
64
+ | Testing Strategy | routine | Follows existing requirement-to-test mapping pattern and no discovery uncertainty touches testing. | established pattern |
65
+
66
+ Needs-eyes example:
67
+
68
+ | Section | Classification | Reason | Signals hit |
69
+ | ---------- | -------------- | --------------------------------------------------------------------- | ------------------------------------------- |
70
+ | API Design | needs-eyes | Adds a new public CLI/config surface that changes workflow semantics. | public API/CLI/config, user-facing defaults |
71
+
72
+ ## Dogfood Notes
73
+
74
+ Use this section to capture misclassifications found while dogfooding Selective Collaborative mode. Keep entries short and actionable.
75
+
76
+ Template:
77
+
78
+ ```markdown
79
+ - Date/project:
80
+ - Section:
81
+ - Classified as:
82
+ - Should have been:
83
+ - Missed or overweighted signal:
84
+ - Prose adjustment:
85
+ ```
86
+
87
+ ### Dogfood run 2026-04-30: collaborative-design-workflow
88
+
89
+ Classification pass run manually against this project's own `spec.md`, `design.md`, `discovery.md`, and `.oat/repo/knowledge/*` context. Grounding was adequate (`project-index.md`, `architecture.md`, `conventions.md`, `stack.md`, and detailed discovery/design artifacts exist). Result: Selective Collaborative would be `recommended` because 3 of 12 sections classify as `routine` while high-risk sections still receive live review.
90
+
91
+ | Section | Classified As | Expected? | Notes |
92
+ | --------------------------------------------------- | ------------- | --------- | --------------------------------------------------------------------- |
93
+ | Overview + Architecture | needs-eyes | yes | Forced floor; user should see framing before any silent drafting. |
94
+ | Component Design | needs-eyes | yes | Cross-skill workflow semantics and config/skill boundaries changed. |
95
+ | Data Models | routine | yes | No database/domain model changes; config risk covered elsewhere. |
96
+ | API Design | needs-eyes | yes | Public CLI/config surface changes via `workflow.designMode`. |
97
+ | Security Considerations | needs-eyes | yes | High-risk-by-default section. |
98
+ | Performance Considerations | needs-eyes | yes | High-risk-by-default section. |
99
+ | Error Handling | needs-eyes | yes | High-risk-by-default section. |
100
+ | Testing Strategy (with Requirement-to-Test Mapping) | needs-eyes | yes | New prose-contract validation plus manual dogfood acceptance surface. |
101
+ | Deployment Strategy | routine | yes | No deployment-path change; release packaging validated separately. |
102
+ | Migration Plan | needs-eyes | yes | High-risk-by-default section, even when no migration is expected. |
103
+ | Implementation Phases | routine | yes | Follows established OAT plan/task structure. |
104
+ | Risks and Mitigation | needs-eyes | yes | New user-facing workflow mode and heuristic failure modes. |
105
+
106
+ No classification misfires were identified in this artifact-only pass. Live picker taxonomy, mid-flight elevation, and final recap behavior still require an interactive dogfood run because `oat-project-design` is a provider skill, not an executable CLI command.
107
+
108
+ Deferred follow-up dogfood after this PR opens:
109
+
110
+ - Exercise picker taxonomy live paths: `Recommended`, `Available / not recommended`, and `Unavailable`.
111
+ - Select "walk me through every remaining section" during a needs-eyes confirmation and verify every remaining section is presented.
112
+ - Confirm the final user-review gate lists sections drafted without live confirmation.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: oat-project-discover
3
- version: 1.3.0
3
+ version: 2.0.0
4
4
  description: Use when starting a project or when requirements are still unclear. Runs structured discovery to gather requirements, constraints, and context.
5
5
  disable-model-invocation: true
6
6
  user-invocable: true
@@ -322,7 +322,7 @@ If `"discovery"` is in `oat_hill_checkpoints`, require explicit user approval be
322
322
 
323
323
  **Approval prompt (required):**
324
324
 
325
- - "Discovery artifact is ready. Approve discovery and unlock `oat-project-spec`?"
325
+ - "Discovery artifact is ready. Approve discovery and unlock `oat-project-design`?"
326
326
 
327
327
  **Optional independent review path:**
328
328
 
@@ -347,7 +347,7 @@ Update frontmatter:
347
347
  ```yaml
348
348
  ---
349
349
  oat_status: complete
350
- oat_ready_for: oat-project-spec
350
+ oat_ready_for: oat-project-design
351
351
  ---
352
352
  ```
353
353
 
@@ -383,7 +383,7 @@ Key decisions:
383
383
  - {Decision 1}
384
384
  - {Decision 2}
385
385
 
386
- Ready for specification phase"
386
+ Ready for design phase"
387
387
  ```
388
388
 
389
389
  ### Step 15: Output Summary
@@ -391,5 +391,9 @@ Ready for specification phase"
391
391
  ```
392
392
  Discovery phase complete for {project-name}.
393
393
 
394
- Next: Create specification with the oat-project-spec skill
394
+ Next: Create design with the oat-project-design skill (which will confirm
395
+ requirements automatically and produce both spec.md and design.md).
396
+
397
+ If you'd rather formalize requirements without designing yet, run
398
+ `oat-project-spec` as a standalone step.
395
399
  ```
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: oat-project-implement
3
- version: 2.0.5
3
+ version: 2.0.6
4
4
  description: Use when plan.md is ready for execution. Dispatches phase-level subagents with bounded fix loops; supports plan-declared parallel phase groups with worktree-isolated execution and ordered fan-in.
5
5
  argument-hint: '[--retry-limit <N>] [--dry-run]'
6
6
  disable-model-invocation: true
@@ -525,13 +525,17 @@ When the current schedule entry is a multi-phase group, execute as follows.
525
525
  **Tier 1 parallel execution:**
526
526
 
527
527
  1. **Bootstrap worktrees:** for each phase in the group, invoke `oat-worktree-bootstrap-auto` with branch name `{project-name}/{pNN}` and base = orchestration branch.
528
+
529
+ > ⚠️ **CRITICAL — DO NOT substitute host-native worktree primitives.** Bootstrap MUST go through `oat-worktree-bootstrap-auto` with an explicit `--base` set to the current orchestration branch HEAD (capture `EXPECTED_HEAD=$(git rev-parse HEAD)` from the orchestration cwd before dispatching). Do not use Claude Code's `Agent({ isolation: "worktree" })`, Cursor's equivalent, or any other host-native isolation primitive in lieu of this skill — those mechanisms may use the primary repo's checkout (often `main`) as the base regardless of the orchestrator's current branch, silently producing a worktree that cannot see prior phase commits and forcing the entire group to degrade to sequential.
528
530
  - If **any** bootstrap fails, cancel any worktrees that bootstrapped successfully for this group and degrade the whole group to sequential inline execution. Log the degradation reason to `implementation.md` Outstanding Items.
529
531
 
530
- 2. **Concurrent dispatch:** for each successfully bootstrapped worktree, dispatch `oat-phase-implementer` (with the worktree as working directory) concurrently. Each dispatch runs the per-phase loop internally (implementer reviewer → fix-loop).
532
+ 2. **Verify worktree HEAD before dispatch (base-mismatch gate):** After bootstrap, verify each worktree is at the expected orchestration HEAD. From the orchestration cwd, capture `EXPECTED_HEAD=$(git rev-parse HEAD)` _before_ invoking bootstrap. After bootstrap, for each new worktree path, run `git -C {worktree-path} rev-parse HEAD` and confirm it matches `EXPECTED_HEAD`, or run `git -C {worktree-path} merge-base --is-ancestor "$EXPECTED_HEAD" HEAD` and confirm it succeeds (exit 0). If either check fails for any phase, treat the bootstrap as failed for that phase, cancel any successful sibling worktrees in this group, and degrade the entire group to sequential inline execution — same mechanism as a primary bootstrap failure. Log the mismatch to `implementation.md` Outstanding Items, including the observed and expected SHAs (`expected={EXPECTED_HEAD}, observed={observed-head-sha}, phase={pNN}, worktree={path}`).
533
+
534
+ 3. **Concurrent dispatch:** for each successfully bootstrapped worktree (passing the base-mismatch gate above), dispatch `oat-phase-implementer` (with the worktree as working directory) concurrently. Each dispatch runs the per-phase loop internally (implementer → reviewer → fix-loop).
531
535
 
532
- 3. **Wait for all phases:** do not proceed until every phase in the group reports a terminal verdict (pass or excluded).
536
+ 4. **Wait for all phases:** do not proceed until every phase in the group reports a terminal verdict (pass or excluded).
533
537
 
534
- 4. **Fan-in reconciliation (merge back in plan order):**
538
+ 5. **Fan-in reconciliation (merge back in plan order):**
535
539
 
536
540
  For each phase in the group, in plan order (p02 before p03, etc.), if its verdict is pass:
537
541
 
@@ -570,23 +574,23 @@ When the current schedule entry is a multi-phase group, execute as follows.
570
574
  commit: <sha if RESOLVED, else null>
571
575
  ```
572
576
 
573
- d. Parse the subagent's return status: - `RESOLVED` → subagent has committed the merge; orchestrator proceeds to integration verification (Step 5) and the next phase in the group. - `UNRESOLVABLE` or `VERIFICATION_FAILED` → STOP the run. Surface to user with phase ID, conflicting files, worktree path, subagent's reasoning summary. Do not merge remaining phases.
577
+ d. Parse the subagent's return status: - `RESOLVED` → subagent has committed the merge; orchestrator proceeds to integration verification (Step 6) and the next phase in the group. - `UNRESOLVABLE` or `VERIFICATION_FAILED` → STOP the run. Surface to user with phase ID, conflicting files, worktree path, subagent's reasoning summary. Do not merge remaining phases.
574
578
 
575
579
  **Tier 2 (inline) exception:** In Tier 2 runs, parallel groups already degrade to sequential, so fan-in conflicts don't arise from this code path. If a conflict ever surfaces in Tier 2 (e.g., from another operation), the orchestrator resolves inline since the whole run is already inline — consistent with Tier 2 semantics.
576
580
 
577
- 5. **Integration verification after each merge:**
581
+ 6. **Integration verification after each merge:**
578
582
 
579
583
  After each successful merge, run project verification (tests, lint, type-check). If verification fails:
580
584
  - Attempt a tractable fix (missing import, trivial type error). If the fix succeeds and verification passes, commit the fix.
581
585
  - If the fix is not tractable → revert the merge, STOP the run. Surface to user.
582
586
 
583
- 6. **Worktree cleanup:**
587
+ 7. **Worktree cleanup:**
584
588
 
585
589
  For phases that merged successfully and passed integration verification, clean up the worktree using the existing worktree cleanup mechanism (e.g., `git worktree remove`).
586
590
 
587
591
  For phases that were excluded (fix-loop exhausted), preserve the worktree and log its path in `implementation.md` Outstanding Items.
588
592
 
589
- 7. **Bookkeeping commit** after the group completes. Then HiLL checkpoint check.
593
+ 8. **Bookkeeping commit** after the group completes. Then HiLL checkpoint check.
590
594
 
591
595
  ### Step 7: Artifact Updates After Each Phase (or Group)
592
596
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: oat-project-quick-start
3
- version: 1.3.6
3
+ version: 2.0.2
4
4
  description: Use when a task is small enough for quick mode or rapid iteration is preferred. Scaffolds a lightweight OAT project from discovery directly to a runnable plan, with optional brainstorming and lightweight design.
5
5
  argument-hint: '<project-name> ["project description"]'
6
6
  disable-model-invocation: true
@@ -170,7 +170,7 @@ git diff --cached --quiet || git commit -m "chore(oat): capture quick-start disc
170
170
 
171
171
  ### Step 2.5: Decision Point — Design Depth
172
172
 
173
- **Auto-advance rule:** If the request was classified as **well-understood** in Step 2a and discovery surfaced no architecture decisions, component boundary questions, or unexpected complexity, skip this decision point entirely and continue directly to Step 3. This preserves the minimal-ceremony contract for straightforward requests.
173
+ **Auto-advance rule:** If the request was classified as **well-understood** in Step 2a and discovery surfaced no architecture decisions, component boundary questions, or unexpected complexity, skip this decision point entirely and continue directly to Step 2.6 (the requirements gate still fires before plan generation). This preserves the minimal-ceremony contract for straightforward requests.
174
174
 
175
175
  **Otherwise**, present the user with a choice about how to proceed:
176
176
 
@@ -188,15 +188,15 @@ Use `AskUserQuestion` to present this choice.
188
188
  - If discovery surfaced architecture choices, component boundaries, or data model questions → recommend "Lightweight design first"
189
189
  - If discovery revealed the scope is larger or more complex than initially expected → recommend "Promote to spec-driven"
190
190
 
191
- **If user chooses "Straight to plan":** continue to Step 3.
191
+ **If user chooses "Straight to plan":** continue to Step 2.6 (requirements gate), then Step 3.
192
192
 
193
- **If user chooses "Lightweight design first":** execute Step 2.75 before continuing to Step 3.
193
+ **If user chooses "Lightweight design first":** execute Step 2.75 before continuing to Step 3. The Step 2.6 requirements gate is skipped — Step 2.75's in-conversation design validation covers that ground.
194
194
 
195
195
  **If user chooses "Promote to spec-driven":**
196
196
 
197
197
  - Update `discovery.md` frontmatter:
198
198
  - `oat_status: complete`
199
- - `oat_ready_for: oat-project-spec`
199
+ - `oat_ready_for: oat-project-design`
200
200
  - `oat_last_updated: {today}`
201
201
  - Update `state.md`:
202
202
  - `oat_workflow_mode: spec-driven`
@@ -211,9 +211,105 @@ git add "$PROJECT_PATH/discovery.md" "$PROJECT_PATH/state.md" ".oat/state.md"
211
211
  git diff --cached --quiet || git commit -m "chore(oat): promote quick-start discovery for {project-name}"
212
212
  ```
213
213
 
214
- - Inform the user: "Discovery is complete. Run `oat-project-spec` next to formalize requirements."
214
+ - Inform the user: "Discovery is complete. Run `oat-project-design` next it will confirm requirements and produce both `spec.md` and `design.md` in one collaborative pass. If you'd rather formalize requirements without designing yet, `oat-project-spec` remains available as an optional standalone step."
215
215
  - Stop here. Do not generate a plan.
216
216
 
217
+ ### Step 2.6: Requirements Gate (Straight-to-Plan Path)
218
+
219
+ Fires only when the straight-to-plan path was chosen at Step 2.5 (explicit choice or auto-advance). Skip when the user selected "Lightweight design first" (Step 2.75 handles its own in-conversation confirmation) or "Promote to spec-driven".
220
+
221
+ Single conversational turn — no loop inside the gate. If the user materially redirects scope, route OUT to lightweight design or back to discovery.
222
+
223
+ > **Tool availability is not the same as interactivity.** If `AskUserQuestion` is unavailable but chat is available, present this gate as a plain chat message and wait for the user's reply. Do not auto-confirm just because the structured question tool is missing.
224
+
225
+ ```
226
+ # Explicit non-interactive fallback FIRST (FR9 contract; same signal as
227
+ # design mode choice). Lack of AskUserQuestion alone is NOT non-interactive
228
+ # — if chat with the user is available, present the gate as a plain chat
229
+ # message and wait for their reply instead.
230
+ if [ "${OAT_NON_INTERACTIVE:-}" = "1" ] || no_user_response_channel_exists; then
231
+ echo "Requirements gate auto-confirmed in non-interactive mode."
232
+ # proceed to Step 3
233
+ fi
234
+
235
+ # Interactive bypass (power-user opt-out).
236
+ if [ "${OAT_NO_REQUIREMENTS_GATE:-}" = "1" ] || [ "$ARG_NO_GATE" = "1" ]; then
237
+ # proceed to Step 3 silently
238
+ fi
239
+
240
+ # Extract requirements from discovery.md:
241
+ # - Key Decisions
242
+ # - Success Criteria
243
+ # - Constraints
244
+ # Format as bullet list and present (SINGLE TURN):
245
+ #
246
+ # > "Before I generate the plan, here are the requirements I'm building against:
247
+ # >
248
+ # > Key decisions:
249
+ # > - [decision 1]
250
+ # > - [decision 2]
251
+ # >
252
+ # > Success criteria:
253
+ # > - [criterion 1]
254
+ # >
255
+ # > Constraints:
256
+ # > - [constraint 1]
257
+ # >
258
+ # > Does this match what you want?"
259
+
260
+ # AskUserQuestion multi-choice:
261
+ # 1. Yes — proceed to plan generation
262
+ # 2. Add a minor requirement that still fits this scope (capture inline, proceed — no re-present)
263
+ # 3. Scope needs redirecting — rework discovery or produce a lightweight design first
264
+ #
265
+ # On choice 1: continue to Step 3.
266
+ # On choice 2: prompt once for the addition, append to discovery.md, proceed to Step 3 (do NOT re-present).
267
+ # On choice 3: exit the gate cleanly. Present follow-up choice:
268
+ # a. Produce a lightweight design first (run Step 2.75)
269
+ # b. Expand discovery (return to Step 2)
270
+ # Route the user accordingly. Do NOT loop back into the gate.
271
+ ```
272
+
273
+ ### Step 2.75a: Lightweight Design Mode Choice
274
+
275
+ Resolve the interaction mode before drafting. Same mechanics as the full `oat-project-design` skill (Component 1): argument precedes env var, config fallback, **explicit** non-interactive fallback to draft.
276
+
277
+ > **Tool availability is not the same as interactivity.** If `AskUserQuestion` is unavailable but chat is available, ask the mode-choice question as a plain chat message and wait for the user's reply. Only fall back to draft when `OAT_NON_INTERACTIVE=1` is set or there is no user-response channel at all.
278
+
279
+ ```
280
+ DESIGN_MODE="${ARG_MODE:-${OAT_DESIGN_MODE:-}}"
281
+ if [ -z "$DESIGN_MODE" ]; then
282
+ if [ "${OAT_NON_INTERACTIVE:-}" = "1" ] || no_user_response_channel_exists; then
283
+ DESIGN_MODE="draft"
284
+ echo "Non-interactive context detected. Falling back to draft-and-review mode."
285
+ else
286
+ # Consult persisted preference (FR15 / Component 14) before prompting
287
+ CONFIG_MODE=$(oat config get workflow.designMode 2>/dev/null || echo "")
288
+ if [ "$CONFIG_MODE" = "collaborative" ] || [ "$CONFIG_MODE" = "selective" ] || [ "$CONFIG_MODE" = "draft" ]; then
289
+ DESIGN_MODE="$CONFIG_MODE"
290
+ if [ "$DESIGN_MODE" = "selective" ]; then
291
+ DESIGN_MODE="collaborative"
292
+ echo "Using workflow.designMode = selective from config (treating as collaborative for lightweight design; Selective Collaborative is only available in full oat-project-design)."
293
+ else
294
+ echo "Using workflow.designMode = ${DESIGN_MODE} from config."
295
+ fi
296
+ else
297
+ # Prefer AskUserQuestion for structured multi-choice when available.
298
+ # If AskUserQuestion is unavailable, ask the same question as a plain
299
+ # chat message and wait for the user's reply. Do NOT switch to draft
300
+ # mode just because the structured tool is missing.
301
+ #
302
+ # Prompt (SAME text as oat-project-design Step 1.5):
303
+ # "How would you like to work through the lightweight design?
304
+ # 1. Collaborative (recommended) — section-by-section, one approach confirmation before drafting
305
+ # 2. Draft-and-review — full draft up front, you review holistically"
306
+ :
307
+ fi
308
+ fi
309
+ fi
310
+ echo "Running in ${DESIGN_MODE} mode."
311
+ ```
312
+
217
313
  ### Step 2.75: Lightweight Design (Optional)
218
314
 
219
315
  Produce a focused `design.md` covering only what's needed for a quality plan. This is NOT the full spec-driven design — it's a quick architectural sketch.
@@ -242,14 +338,37 @@ Copy template: `.oat/templates/design.md` → `"$PROJECT_PATH/design.md"`
242
338
  - Dependencies (captured in discovery instead)
243
339
  - Risks and Mitigation (captured in discovery instead)
244
340
 
245
- **Present design incrementally for validation:**
246
-
247
- 1. Draft architecture overview → present to user for validation
248
- 2. Draft component design → present to user for validation
249
- 3. Draft data flow + testing approach → present to user for validation
250
- 4. Finalize `design.md`
341
+ **Draft the design based on `DESIGN_MODE` (resolved in Step 2.75a):**
251
342
 
252
- After each chunk, ask: "Does this look right, or should we adjust before continuing?"
343
+ ```
344
+ IF DESIGN_MODE == "collaborative":
345
+ For SECTION in [Overview, Architecture, Component Design, Testing Strategy
346
+ (required); Data Models, API Design, Error Handling
347
+ (include only when relevant); SKIP Security, Performance,
348
+ Deployment, Migration]:
349
+ Draft section content. Scale each section to its complexity:
350
+ a few sentences if straightforward, up to 200-300 words if nuanced.
351
+ Not-applicable sections: state as a single sentence, not empty.
352
+ Present:
353
+ "Here's what I have for [section]: [content].
354
+ Does this look right, or should we adjust before continuing?"
355
+ Use AskUserQuestion for the validation prompt.
356
+ Revise inline on feedback. Be ready to go back and clarify if something
357
+ doesn't make sense. Re-present if substantive.
358
+ Mark section approved. Move to next.
359
+
360
+ IF DESIGN_MODE == "draft":
361
+ Draft all required sections (Overview, Architecture, Component Design,
362
+ Testing Strategy) and any applicable optional sections (Data Models,
363
+ API Design, Error Handling) in ONE pass (same reduced section set).
364
+ Scale each section to its complexity — no per-section prompts fire.
365
+ Run the FULL 4-check self-review (placeholder + internal consistency +
366
+ scope + ambiguity). No scaled-down variant — identical to the full
367
+ oat-project-design self-review.
368
+ Present the user-review gate wording (adapted for quick-start:
369
+ no HiLL gate by default; commits-first is still in effect).
370
+ Produce design.md only — NO spec.md is written by lightweight design.
371
+ ```
253
372
 
254
373
  If `design.md` or `state.md` was updated before one of these validation pauses, commit those artifact changes before waiting for the user response.
255
374
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: oat-project-spec
3
- version: 1.2.0
4
- description: Use when discovery is complete and the project needs a formal requirements baseline. Transforms discovery output into structured specification artifacts.
3
+ version: 2.0.0
4
+ description: Optional standalone skill for formalizing requirements into a structured spec.md when discovery is complete but you're not ready to design yet. Independent of the design workflow oat-project-design confirms requirements automatically and does not require this skill to be run first.
5
5
  disable-model-invocation: true
6
6
  user-invocable: true
7
7
  allowed-tools: Read, Write, Bash(git:*), Glob, Grep, AskUserQuestion
@@ -450,7 +450,7 @@ Ready for design phase"
450
450
  ### Step 21: Output Summary
451
451
 
452
452
  ```
453
- Specification phase complete for {project-name}.
453
+ Specification artifact created for {project-name}.
454
454
 
455
455
  Created:
456
456
  - {N} functional requirements
@@ -458,7 +458,12 @@ Created:
458
458
  - High-level design approach
459
459
  - Success metrics
460
460
 
461
- Next: Create detailed design with the oat-project-design skill
461
+ Note: This skill is optional in the default workflow. `oat-project-design`
462
+ will confirm requirements automatically when run after discovery.
463
+
464
+ If you want to proceed to design now, run: `oat-project-design`
465
+ If you're parking the project here, the spec.md is committed and ready
466
+ to pick up later.
462
467
  ```
463
468
 
464
469
  ## Success Criteria
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: oat-worktree-bootstrap-auto
3
- version: 1.2.1
3
+ version: 1.2.2
4
4
  description: Use when an orchestrator/subagent needs autonomous worktree bootstrap. Non-interactive companion to oat-worktree-bootstrap.
5
5
  argument-hint: '<branch-name> [--base <ref>] [--path <root>] [--baseline-policy <strict|allow-failing>]'
6
6
  disable-model-invocation: true
@@ -12,6 +12,8 @@ allowed-tools: Read, Write, Bash, Glob, Grep
12
12
 
13
13
  Non-interactive worktree bootstrap for orchestrator and subagent execution flows. Creates or reuses a worktree, runs baseline checks, and reports structured status — all without user prompts.
14
14
 
15
+ > ⚠️ **When not to substitute.** This skill is the **only** supported mechanism for orchestrator-driven worktree creation in OAT skills. Host-native isolation primitives — Claude Code's `Agent({ isolation: "worktree" })`, Cursor's worktree-isolated agent invocations, and equivalents in other hosts — are **not** substitutes. They may use the primary repo's checkout (often `main`) as the base regardless of the caller's current branch, silently producing a worktree at the wrong base. OAT orchestrators dispatching mid-run from a feature branch MUST go through this skill with an explicit `--base` so the resulting worktree contains the orchestrator's prior commits.
16
+
15
17
  ## Relationship to oat-worktree-bootstrap
16
18
 
17
19
  This skill is the **autonomous companion** to `oat-worktree-bootstrap`. Key differences:
@@ -37,11 +39,12 @@ When this skill is executed, provide concise status updates:
37
39
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
38
40
 
39
41
  - Before major phases, print compact indicators, for example:
40
- - `[1/5] Resolving worktree root…`
41
- - `[2/5] Creating/reusing worktree…`
42
- - `[3/5] Running baseline checks…`
43
- - `[4/5] Syncing provider directories…`
44
- - `[5/5] Returning structured status…`
42
+ - `[1/6] Resolving worktree root…`
43
+ - `[2/6] Creating/reusing worktree…`
44
+ - `[3/6] Verifying resolved base in worktree HEAD…`
45
+ - `[4/6] Running baseline checks…`
46
+ - `[5/6] Syncing provider directories…`
47
+ - `[6/6] Returning structured status…`
45
48
 
46
49
  ## Inputs
47
50
 
@@ -51,11 +54,11 @@ When this skill is executed, provide concise status updates:
51
54
 
52
55
  ### Optional
53
56
 
54
- | Parameter | Default | Description |
55
- | ---------------------------- | ----------------------- | ------------------------------- |
56
- | `--base <ref>` | `origin/main` | Base ref to branch from |
57
- | `--path <root>` | Resolved via precedence | Explicit worktree root override |
58
- | `--baseline-policy <policy>` | `strict` | Baseline check failure policy |
57
+ | Parameter | Default | Description |
58
+ | ---------------------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
59
+ | `--base <ref>` | `origin/main` | Base ref to branch from. **Callers running inside a worktree-on-a-feature-branch (e.g., an `oat-project-implement` orchestrator dispatching mid-run) MUST pass `--base` explicitly** — either the orchestrator's current branch name or the resolved current HEAD SHA. The default `origin/main` is the **wrong** choice for orchestrators dispatching mid-run; using it will land the worktree at `main`. |
60
+ | `--path <root>` | Resolved via precedence | Explicit worktree root override |
61
+ | `--baseline-policy <policy>` | `strict` | Baseline check failure policy |
59
62
 
60
63
  ### Baseline Policy
61
64
 
@@ -117,6 +120,36 @@ oat local sync "$TARGET_PATH" 2>/dev/null || true
117
120
  - Copies configured `localPaths` (e.g., `.oat/ideas/`, `.oat/projects/local/`) into the worktree.
118
121
  - Non-blocking: if sync fails or no `localPaths` are configured, bootstrap continues.
119
122
 
123
+ ### Step 2.7: Verify Resolved Base in Worktree HEAD
124
+
125
+ Before any baseline checks run, verify the worktree actually branched from the resolved base. This catches host-native or git-internal misbehavior that would otherwise silently land the worktree at the wrong base.
126
+
127
+ 1. Resolve the base SHA:
128
+
129
+ ```bash
130
+ RESOLVED_BASE_SHA=$(git -C "$REPO_ROOT" rev-parse "$BASE_REF")
131
+ ```
132
+
133
+ 2. Capture the worktree HEAD:
134
+
135
+ ```bash
136
+ OBSERVED_HEAD_SHA=$(git -C "$TARGET_PATH" rev-parse HEAD)
137
+ ```
138
+
139
+ 3. Confirm the resolved base is reachable from the worktree HEAD:
140
+
141
+ ```bash
142
+ git -C "$TARGET_PATH" merge-base --is-ancestor "$RESOLVED_BASE_SHA" "$OBSERVED_HEAD_SHA"
143
+ ```
144
+
145
+ - Exit `0` → base is contained in the worktree HEAD; continue to Step 3.
146
+ - Non-zero exit → base mismatch.
147
+
148
+ **On base mismatch:** treat as a bootstrap failure. Do **not** silently land at the wrong base, do **not** proceed to baseline checks. Apply the configured baseline policy to the failure:
149
+
150
+ - `strict` → return immediately with `status: failed`, `reason: base-mismatch`, populated `expected_base_sha` and `observed_head_sha`, and the worktree path. The orchestrator is expected to cancel the dispatch and degrade.
151
+ - `allow-failing` → emit a structured warning (`reason: base-mismatch`, with `expected_base_sha` and `observed_head_sha`), append a base-mismatch entry to `implementation.md` if an active project exists, and continue to Step 3 only if the caller has explicitly opted into a degraded outcome. In all other cases prefer fail-fast — base mismatch is rarely recoverable.
152
+
120
153
  ### Step 3: Run Baseline Checks
121
154
 
122
155
  Execute in the target worktree directory:
@@ -162,10 +195,12 @@ oat sync --scope all
162
195
  Return a structured status object (for orchestrator consumption):
163
196
 
164
197
  ```yaml
165
- status: success | error | warning
198
+ status: success | error | warning | failed
166
199
  worktree_path: '{absolute-path}'
167
200
  branch: '{branch-name}'
168
201
  base_ref: '{base-ref}'
202
+ resolved_base_sha: '{sha resolved from base-ref}'
203
+ observed_head_sha: '{sha of worktree HEAD after add}'
169
204
  checks:
170
205
  worktree_init: pass | fail | skip
171
206
  project_status: pass | fail | skip
@@ -174,25 +209,32 @@ checks:
174
209
  provider_sync: pass | fail | skip
175
210
  warnings: [] # List of warning messages (allow-failing mode)
176
211
  error: null # Error message (strict mode failure)
212
+ reason: null # Structured reason on failure (e.g., base-mismatch)
213
+ expected_base_sha: null # Populated when reason is base-mismatch
177
214
  baseline_policy: strict | allow-failing
178
215
  ```
179
216
 
217
+ `resolved_base_sha` and `observed_head_sha` are populated on **every** terminal status (success, warning, error, failed) so callers can perform belt-and-suspenders post-verification on the success path as well as diagnose the failure path.
218
+
180
219
  **Status determination:**
181
220
 
182
- - `success`: All checks passed.
183
- - `warning`: Some checks failed under `allow-failing` policy.
184
- - `error`: A check failed under `strict` policy, or worktree creation failed.
221
+ - `success`: All checks passed and Step 2.7 base-resolution verification passed.
222
+ - `warning`: Some checks failed under `allow-failing` policy (Step 2.7 still passed).
223
+ - `error`: A baseline check failed under `strict` policy, or worktree creation failed.
224
+ - `failed` (with `reason: base-mismatch`): Step 2.7 base-resolution verification failed. Callers should treat this distinctly from a generic baseline error — it is a contract violation, not a flaky check.
185
225
 
186
226
  ## Error Handling
187
227
 
188
- | Scenario | Behavior |
189
- | ------------------------------------ | ----------------------------------------------- |
190
- | Worktree creation fails | Return error status with git error message |
191
- | Branch already checked out elsewhere | Return error with worktree location info |
192
- | Baseline check fails (strict) | Return error with check name and failure output |
193
- | Baseline check fails (allow-failing) | Add to warnings, continue, log to artifacts |
194
- | No active project | Skip artifact logging, use console only |
195
- | Invalid branch name | Return error before attempting creation |
228
+ | Scenario | Behavior |
229
+ | ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- |
230
+ | Worktree creation fails | Return error status with git error message |
231
+ | Branch already checked out elsewhere | Return error with worktree location info |
232
+ | Base mismatch (Step 2.7 fails, strict) | Return `status: failed`, `reason: base-mismatch`, with `expected_base_sha` and `observed_head_sha`. Do not run baselines. |
233
+ | Base mismatch (Step 2.7 fails, allow-fail) | Emit structured warning with `reason: base-mismatch`, log to artifacts, prefer fail-fast unless caller opted into degrade. |
234
+ | Baseline check fails (strict) | Return error with check name and failure output |
235
+ | Baseline check fails (allow-failing) | Add to warnings, continue, log to artifacts |
236
+ | No active project | Skip artifact logging, use console only |
237
+ | Invalid branch name | Return error before attempting creation |
196
238
 
197
239
  ## Artifact Logging
198
240
 
@@ -211,6 +253,18 @@ Append to `implementation.md` under `## Implementation Log`:
211
253
  - {check_name}: {failure summary}
212
254
  ```
213
255
 
256
+ When a base mismatch is detected (Step 2.7) and an active project exists, append a distinct entry regardless of baseline policy so post-mortems can find it:
257
+
258
+ ```markdown
259
+ ### {YYYY-MM-DD} — Base Mismatch (autonomous bootstrap)
260
+
261
+ **Worktree:** {path}
262
+ **Branch:** {branch-name}
263
+ **Expected base SHA:** {expected_base_sha}
264
+ **Observed HEAD SHA:** {observed_head_sha}
265
+ **Base ref:** {base-ref}
266
+ ```
267
+
214
268
  ## Policy Flags
215
269
 
216
270
  | Flag | Type | Default | Description |
@@ -129,7 +129,16 @@ _Include this section only when the request is exploratory or multiple viable ap
129
129
 
130
130
  Use this discovery artifact to drive the next workflow step:
131
131
 
132
- - **Quick mode → straight to plan:** proceed directly to `plan.md` when scope is clear and no architecture decisions remain.
133
- - **Quick mode optional lightweight design:** produce a focused `design.md` (architecture, components, data flow, testing) before planning. Choose this when discovery surfaced architecture choices or component boundaries.
134
- - **Quick mode → promote:** escalate to spec-driven if discovery revealed the scope is larger or more complex than expected.
135
- - **Spec-driven mode:** continue to `oat-project-spec` (after HiLL approval if configured).
132
+ - **Spec-driven mode:** continue to `oat-project-design` (which confirms
133
+ requirements and produces both `spec.md` and `design.md`).
134
+ - **Spec-driven mode → formalize-only:** use `oat-project-spec` standalone
135
+ if you want a formalized requirements artifact but aren't ready to
136
+ design yet.
137
+ - **Quick mode → straight to plan:** proceed directly to `plan.md` when
138
+ scope is clear and no architecture decisions remain.
139
+ - **Quick mode → optional lightweight design:** produce a focused
140
+ `design.md` (architecture, components, data flow, testing) before
141
+ planning. Choose this when discovery surfaced architecture choices
142
+ or component boundaries.
143
+ - **Quick mode → promote:** escalate to spec-driven if discovery revealed
144
+ the scope is larger or more complex than expected.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/config/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGhF,OAAO,EACL,KAAK,SAAS,EACd,KAAK,cAAc,EAGnB,KAAK,UAAU,EAOhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqDpC,UAAU,yBAAyB;IACjC,mBAAmB,EAAE,CACnB,OAAO,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAC,KAC/C,cAAc,CAAC;IACpB,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACrD,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;IACxD,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACvE,kBAAkB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;IAClE,mBAAmB,EAAE,CACnB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,cAAc,KACnB,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,cAAc,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IAC/D,eAAe,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9E,mBAAmB,EAAE,CACnB,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,CAAC,UAAU,KACnB,OAAO,CAAC,MAAM,CAAC,CAAC;IACrB,sBAAsB,EAAE,CACtB,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,GAAG,EAAE,MAAM,CAAC,UAAU,KACnB,OAAO,CAAC,cAAc,CAAC,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC;CAC/B;AAwjCD,wBAAgB,mBAAmB,CACjC,SAAS,GAAE,OAAO,CAAC,yBAAyB,CAAM,GACjD,OAAO,CA0GT"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/config/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGhF,OAAO,EACL,KAAK,SAAS,EACd,KAAK,cAAc,EAGnB,KAAK,UAAU,EAOhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsDpC,UAAU,yBAAyB;IACjC,mBAAmB,EAAE,CACnB,OAAO,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAC,KAC/C,cAAc,CAAC;IACpB,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACrD,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;IACxD,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACvE,kBAAkB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;IAClE,mBAAmB,EAAE,CACnB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,cAAc,KACnB,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,cAAc,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IAC/D,eAAe,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9E,mBAAmB,EAAE,CACnB,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,CAAC,UAAU,KACnB,OAAO,CAAC,MAAM,CAAC,CAAC;IACrB,sBAAsB,EAAE,CACtB,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,GAAG,EAAE,MAAM,CAAC,UAAU,KACnB,OAAO,CAAC,cAAc,CAAC,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC;CAC/B;AAskCD,wBAAgB,mBAAmB,CACjC,SAAS,GAAE,OAAO,CAAC,yBAAyB,CAAM,GACjD,OAAO,CA0GT"}