=== Group 1 dispatch (2026-05-11T14:02:20+02:00) ===
Model: gpt-5.5 / high / fast
Scope: spec_kit/deep-research, complete, implement, plan, resume (5 commands)

Reading additional input from stdin...
OpenAI Codex v0.130.0
--------
workdir: /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
model: gpt-5.5
provider: openai
approval: never
sandbox: workspace-write [workdir, /tmp, $TMPDIR, /Users/michelkerkmeester/.codex/memories] (network access enabled)
reasoning effort: high
reasoning summaries: none
session id: 019e16ea-b580-7260-965b-9c0380909cb5
--------
user
You are migrating the `/spec_kit:*` command Group 1 (5 commands) to cite the shared `auto_mode_contract.md` reference and adopt the three-tier `:auto` setup contract.

# RUNTIME RULES (read first)

- Run as inline Codex execution. Do NOT call SpawnAgent, collab: SpawnAgent, Task, or any sub-agent. If you would dispatch, stop and work inline.
- Gate 3 (spec-folder) answer for this run: the spec folder is `.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/`. Use it. specFolder=103-002. Do NOT ask interactive questions; stdin is closed.
- Strict scope: edit ONLY the 5 command files below + 002's tasks.md (mark T010 done) + 002's evidence/codex-group1-dispatch.txt (write summary). Anything else is a rollback trigger.
- Do NOT run any /spec_kit:*:auto YAML loop. Markdown edits only.
- Final output: ONE summary message at the end listing every file modified, per-command status, decisions, concerns.

# REPO ROOT
/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public

All paths below relative to this root.

# SCOPE LIST — THE ONLY FILES YOU MAY EDIT

```
.opencode/commands/spec_kit/deep-research.md
.opencode/commands/spec_kit/complete.md
.opencode/commands/spec_kit/implement.md
.opencode/commands/spec_kit/plan.md
.opencode/commands/spec_kit/resume.md
.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt
```

You MAY read any file. You may NOT touch paired YAML assets (`assets/spec_kit_*_auto.yaml`, `assets/spec_kit_*_confirm.yaml`) unless absolutely forced — if forced, document in your final summary with explicit justification.

# CONTEXT — SOURCE OF TRUTH (read in this order BEFORE any edit)

1. **Shared contract** — `.opencode/skills/system-spec-kit/references/workflows/auto_mode_contract.md` — your template authority. §1 three-tier flow, §2 PRE-BOUND ANSWERS grammar, §3 Default Resolution Table format, §4 Tier-3 error template, §5 `:confirm` invariance, §6 verification protocol, §7 adoption checklist, §8 OOS.

2. **Reference example (what the post-migration shape looks like)** — `.opencode/commands/spec_kit/deep-review.md` §0 lines 44-130. This is the canonical example: brief citation + Tier-1/2/3 summary + PRE-BOUND ANSWERS Schema + Default Resolution Table + UNTOUCHED `:confirm` consolidated Q-block below.

3. **Phase 2 spec** — `.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/spec.md` — §3 SCOPE, §4 REQUIREMENTS, §5 SUCCESS CRITERIA.

# PER-COMMAND MIGRATION PATTERN

For each of the 5 commands in SCOPE LIST, the migration steps are:

## Step A — Read the command's current §0 (UNIFIED SETUP PHASE or equivalent)
Identify:
- Every Q-block field name (Q0, Q1, Q1_type, Q_dims, Q-Exec, etc.)
- Each field's current resolution: flag (from $ARGUMENTS), default, requires-ask, auto-detect from another field
- The full consolidated Q-block content (under the `STATUS: BLOCKED` header in `:confirm` mode)
- Whether the file has a paired YAML asset (it does — under `.opencode/commands/spec_kit/assets/`)

## Step B — Build the per-command Default Resolution Table

For every Q-block field, classify it:

| Column | Meaning |
|---|---|
| Field | the field name (matches the legacy Q-block question label) |
| Required | Y or N |
| Resolves Via | ordered list of resolution sources, e.g. `flag → $ARGUMENTS positional` / `marker → PRE-BOUND` / `default → "<value>"` / `auto-detect from <other field>` / `requires-ask` |
| Default | the documented default value, or `none` |
| Tier-2 Candidate | Y only when no default exists AND user choice is the only path (ambiguity, not absence) |

## Step C — Replace the `:auto` setup branch in §0

In §0, after the existing FIRST MESSAGE PROTOCOL line, add this `:auto`-mode-only section:

```
### `:auto` Setup Resolution

Setup contract: see `.opencode/skills/system-spec-kit/references/workflows/auto_mode_contract.md`.

Under `execution_mode = AUTONOMOUS` (from the `:auto` suffix), follow the three-tier flow:

1. **Tier 1 — Resolve confidently** (contract §1): parse `$ARGUMENTS` flags + `PRE-BOUND SETUP ANSWERS:` block (§2) + the Default Resolution Table below (§3). When every required field is resolved, persist to `<COMMAND-SPECIFIC-PATH>` (shape: <KEY-FIELDS>), bind runtime YAML placeholders, set `STATUS: PASSED`, load `<COMMAND-YAML-ASSET-PATH>`. End §0.

2. **Tier 2 — Targeted ask** (contract §1): when 1-2 required fields are genuinely ambiguous AND no default exists, emit ONE narrow question per ambiguous field. Command-specific Tier-2-eligible fields (per the Default Resolution Table below): `<FIELD-A>`, `<FIELD-B>`. **Ordering rule**: <COMMAND-SPECIFIC-ORDERING-OR-"none-needed">. Missing required fields (absence, not ambiguity) → go to Tier 3.

3. **Tier 3 — Fail fast** (contract §4): emit the named-missing-inputs error format with `/spec_kit:<COMMAND-NAME>:auto` as the command name. Exit non-zero. Do not load YAML.

`:confirm` path stays unchanged — see the consolidated setup prompt section below.
```

Replace `<COMMAND-SPECIFIC-PATH>`, `<KEY-FIELDS>`, `<COMMAND-YAML-ASSET-PATH>`, `<FIELD-A>`, `<FIELD-B>`, `<COMMAND-SPECIFIC-ORDERING-OR-"none-needed">`, `<COMMAND-NAME>` per command.

For commands where Tier-2 candidates are zero or one (because all required fields have defaults or are always supplied via flags), omit the FIELD-B placeholder and simplify the ordering rule.

## Step D — Add the PRE-BOUND SETUP ANSWERS Schema subsection

After the `:auto Setup Resolution` subsection, add:

```
### PRE-BOUND SETUP ANSWERS Schema (for `:auto` non-interactive dispatch)

The dispatched prompt body may contain one structured marker block. Parse it before applying defaults. Grammar: see `auto_mode_contract.md` §2.

\```yaml
PRE-BOUND SETUP ANSWERS:
  <field_a>: <example value>  # comment with type/enum
  <field_b>: <example value>
  ...
\```

Rules: see `auto_mode_contract.md` §2 (unspecified fields fall back to default; marker fields take precedence over $ARGUMENTS flags; unknown fields warn; malformed lines parse-error).
```

List every Q-block field in YAML key form with the appropriate example value and type/enum comment.

## Step E — Add the Default Resolution Table subsection

After the PRE-BOUND Schema, add `### Default Resolution Table` with the 4-column table from Step B.

## Step F — Update the frontmatter `argument-hint`

Add `(:auto supports PRE-BOUND SETUP ANSWERS: prompt-body block for non-interactive setup)` to the existing argument-hint string. Don't strip existing args/flags.

## Step G — PRESERVE the existing `:confirm` consolidated Q-block path UNTOUCHED

Hard invariant: the consolidated setup prompt for `:confirm` mode (the section that emits `STATUS: BLOCKED` and asks Q0..Q-Exec) must NOT be modified. Read-back diff after your edits: the legacy `:confirm` Q-block section header AND body content must remain identical.

# AFTER ALL 5 MIGRATIONS

1. Update `002/tasks.md`:
   - Mark T010 `[x]` with brief evidence text (`Group 1 codex dispatch completed; 5 commands migrated; see evidence/codex-group1-dispatch.txt`)
   - Update `_memory.continuity` block: `recent_action: "Group 1 spec_kit commands migrated"`, `next_safe_action: "Dispatch group 2 create commands"`

2. Write `002/evidence/codex-group1-dispatch.txt`:
   - 5 sections (one per command)
   - Per-section: command name, fields migrated count, Tier-2 candidates identified, any concerns
   - Final line: `EXIT_STATUS: complete` or describe any partial-application

# YOUR FINAL OUTPUT MESSAGE

After all edits, emit ONE markdown message:

1. **Files modified** — bulleted list (path only).
2. **Per-command status** — one line per command: `<command>: <N fields migrated> | Tier-2 candidates: <list> | :confirm preserved: yes/no | argument-hint updated: yes/no`.
3. **Decisions you made that the prompt did not pre-specify** — e.g. naming conventions for command-specific config files, default value choices, field-name conflicts.
4. **Concerns for the reviewer** — anything you couldn't resolve, partial applications, unusual edge cases per command.

# CONSTRAINTS

- Stay strictly inside SCOPE LIST.
- `:confirm` block is sacrosanct.
- Do not touch paired YAML assets unless forced (and document the force).
- Do not run any :auto YAML dispatches.
- Do not call SpawnAgent / collab / Task / sub-agents.
- The spec folder is the Gate 3 answer.
hook: SessionStart
hook: SessionStart
hook: SessionStart Completed
hook: SessionStart Completed
hook: UserPromptSubmit
hook: UserPromptSubmit
hook: UserPromptSubmit Completed
hook: UserPromptSubmit Completed
codex
Using `system-spec-kit` for the scoped spec workflow and markdown command migration. I’ll keep this inline, read the shared contract/example/spec first, then edit only the seven allowed paths.
exec
/bin/zsh -lc "sed -n '1,180p' .opencode/commands/spec_kit/deep-review.md" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
exec
/bin/zsh -lc "sed -n '1,260p' .opencode/skills/system-spec-kit/references/workflows/auto_mode_contract.md" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
exec
/bin/zsh -lc "sed -n '1,220p' .opencode/skills/system-spec-kit/SKILL.md" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
exec
/bin/zsh -lc "sed -n '1,220p' .opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/spec.md" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
---
description: Autonomous deep-review loop: iterative code audit with convergence detection. Modes :auto, :confirm.
argument-hint: "<target> [:auto|:confirm] [--max-iterations=N] [--convergence=N] [--spec-folder=PATH] (:auto supports PRE-BOUND SETUP ANSWERS: prompt-body block for non-interactive setup)"
allowed-tools: Read, Write, Edit, Bash, Grep, Glob, Task, memory_context, memory_search, mcp__cocoindex_code__search, code_graph_query, code_graph_context
---

> **EXECUTION PROTOCOL -- READ FIRST**
>
> This command runs a structured YAML workflow. Do NOT dispatch agents from this document.
> Under `:auto`, setup follows the three-tier resolution contract in §0: resolve confidently, ask only targeted ambiguity questions, then fail fast if required inputs remain unresolved. Under `:confirm`, setup keeps the consolidated interactive question block.
>
> **YOUR FIRST ACTION:**
> 1. Run the unified setup phase in this Markdown entrypoint and resolve:
>    - `review_target`
>    - `review_target_type`
>    - `review_dimensions`
>    - `spec_folder`
>    - `execution_mode`
>    - `maxIterations`
>    - `convergenceThreshold`
> 2. Load the corresponding YAML file from `assets/` only after all setup values are resolved:
>    - Auto: `spec_kit_deep-review_auto.yaml`
>    - Confirm: `spec_kit_deep-review_confirm.yaml`
> 3. Execute the YAML workflow step by step using those resolved values
>
> All content below is reference context for the YAML workflow. Do not treat reference sections as direct instructions to execute.

## CONSTRAINTS

- **DO NOT** dispatch any agent from this document
- **ALL** agent dispatching is handled by the YAML workflow steps
- **MARKDOWN OWNS SETUP**: resolve setup inputs here first, then hand off to YAML
- **YAML START CONDITION**: do not load YAML until ALL required inputs are bound:
  - `review_target`, `review_target_type`, `review_dimensions`, `spec_folder`, `execution_mode`, `maxIterations`, `convergenceThreshold`

> **Canonical mode syntax:** use attached command suffixes (`/spec_kit:deep-review:auto`, `/spec_kit:deep-review:confirm`) and keep AGENTS, skills, and quick references synchronized to this entrypoint.

# SINGLE CONSOLIDATED SETUP PROMPT

This workflow gathers all setup inputs in one prompt. Confirm mode still includes multiple approval gates after setup; only the setup round-trip is consolidated here.

---

## 0. UNIFIED SETUP PHASE

**FIRST MESSAGE PROTOCOL**: For `:confirm` or no suffix, the consolidated setup prompt MUST be your FIRST response. No implementation or file-modifying tool calls before asking. Lightweight read-only discovery to suggest a spec folder or load prior context is allowed, then ask ALL questions immediately and wait.

For `:auto`, do not emit the consolidated prompt by default. Resolve setup with the three-tier branch below, then load the auto YAML only after all required values are bound.

### `:auto` Setup Resolution

Setup contract: see `.opencode/skills/system-spec-kit/references/workflows/auto_mode_contract.md`.

Under `execution_mode = AUTONOMOUS` (from the `:auto` suffix), follow the three-tier flow:

1. **Tier 1 — Resolve confidently** (contract §1): parse `$ARGUMENTS` flags + `PRE-BOUND SETUP ANSWERS:` block (§2) + the Default Resolution Table below (§3). When every required field is resolved, persist to `{spec_folder}/review/deep-review-config.json` (shape: `reviewTarget`, `reviewTargetType`, `reviewDimensions`, `specFolder`, `maxIterations`, `convergenceThreshold`, `executionMode: "auto"`, `resource_map.emit`, `config.executor.*`), bind runtime YAML placeholders, set `STATUS: PASSED`, load `.opencode/commands/spec_kit/assets/spec_kit_deep-review_auto.yaml`. End §0.

2. **Tier 2 — Targeted ask** (contract §1): when 1-2 required fields are genuinely ambiguous AND no default exists, emit ONE narrow question per ambiguous field. Command-specific Tier-2-eligible fields (per the Default Resolution Table below): `review_target_type`, `spec_folder`. **Ordering rule**: if `review_target_type` is ambiguous, ask only for `review_target_type` first — the answer may make `spec_folder` self-evident on the next Tier 1 pass. Missing `review_target` is absence, not ambiguity — go to Tier 3.

3. **Tier 3 — Fail fast** (contract §4): emit the named-missing-inputs error format with `/spec_kit:deep-review:auto` as the command name. Exit non-zero. Do not load YAML.

`:confirm` path stays unchanged — see the Consolidated Setup Prompt section below.

### PRE-BOUND SETUP ANSWERS Schema (for `:auto` non-interactive dispatch)

The dispatched prompt body may contain one structured marker block. Parse it before applying defaults.

```yaml
PRE-BOUND SETUP ANSWERS:
  review_target: specs/skilled-agent-orchestration/102-sk-doc-skill-readme-and-structure
  review_target_type: spec-folder  # one of: spec-folder | skill | agent | track | files
  review_dimensions: all  # or comma-separated subset: correctness, security, traceability, maintainability
  spec_folder: existing  # one of: existing | new | update-related | phase-folder, or an explicit specs/.opencode/specs path
  execution_mode: AUTONOMOUS  # from :auto suffix
  maxIterations: 10
  convergenceThreshold: 0.10
  executor: native  # one of: native | cli-codex | cli-gemini | cli-claude-code
  executor_model: ""  # optional, executor-specific
  executor_reasoning: ""  # optional
  executor_service_tier: ""  # optional
  executor_timeout: 900  # optional
  resource_map_emit: true  # optional
```

Rules:

- Any unspecified field falls back to its documented default.
- Marker fields take precedence over `$ARGUMENTS` flags because the caller explicitly bound setup in the prompt body.
- Unknown fields are warnings, not errors.
- Malformed lines, including missing `:`, emit a parse error naming the offending line. Known fields parsed before the error may still be used, and unresolved fields continue to Tier 2 or Tier 3.
- Empty strings count as unresolved for required fields.
- Compact legacy answer strings are only for the consolidated `:confirm` prompt. They are not a `:auto` marker format.

### Default Resolution Table

| Field | Required | Resolves Via | Default | Tier-2 Candidate |
|-------|----------|--------------|---------|------------------|
| `review_target` | Y | `$ARGUMENTS` first positional target, or marker `review_target` | none | N |
| `review_target_type` | Y | marker `review_target_type`, or auto-detect from `review_target` | inferred only | Y, when target is present but ambiguous |
| `review_dimensions` | Y | flag `--dims` if supported by caller, marker `review_dimensions`, or default | `"all"` | N |
| `spec_folder` | Y | flag `--spec-folder`, marker `spec_folder`, or target path when target is a spec folder | none | Y, when target is not a spec folder |
| `execution_mode` | Y | attached suffix `:auto` or marker `execution_mode` | `AUTONOMOUS` under `:auto` | N |
| `maxIterations` | Y | flag `--max-iterations`, marker `maxIterations`, or default | `7` | N |
| `convergenceThreshold` | Y | flag `--convergence`, marker `convergenceThreshold`, or default | `0.10` | N |
| `executor` | N | flag `--executor`, marker `executor`, config file, or default | `native` | N |
| `executor_model` | N | flag `--model`, marker `executor_model`, or executor-specific validation | none | N |
| `executor_reasoning` | N | flag `--reasoning-effort`, marker `executor_reasoning`, or executor default | none | N |
| `executor_service_tier` | N | flag `--service-tier`, marker `executor_service_tier`, or executor default | none | N |
| `executor_timeout` | N | flag `--executor-timeout`, marker `executor_timeout`, or default | `900` | N |
| `resource_map_emit` | N | flag `--no-resource-map`, marker `resource_map_emit`, or default | `true` | N |

### Consolidated Setup Prompt for `:confirm` and No-Suffix Mode

Use this block only when `execution_mode = "INTERACTIVE"` or when no suffix was supplied and Q2 must ask for the execution mode.

**STATUS: BLOCKED**

```
EXECUTE THIS SINGLE CONSOLIDATED PROMPT:

1. CHECK for mode suffix:
   |-- ":auto"    -> execution_mode = "AUTONOMOUS"
   |-- ":confirm" -> execution_mode = "INTERACTIVE"
   +-- No suffix  -> execution_mode = "ASK" (include Q2)

2. CHECK $ARGUMENTS for target (review_target):
   |-- Has content (ignoring suffixes and flags):
   |     -> review_target = $ARGUMENTS, omit Q0
   +-- Empty -> include Q0

3. PARSE optional flags from $ARGUMENTS:
   |-- --max-iterations=N -> maxIterations = N
   |-- --convergence=N -> convergenceThreshold = N
   |-- --spec-folder=PATH -> spec_path = PATH, omit Q1
   |-- --executor=<type> -> config.executor.type (`native` | `cli-codex`)
   |-- --model=<id> -> config.executor.model (for example `gpt-5.4`)
   |-- --reasoning-effort=<level> -> config.executor.reasoningEffort (`none` | `minimal` | `low` | `medium` | `high` | `xhigh`)
   |-- --service-tier=<tier> -> config.executor.serviceTier (`priority` | `standard` | `fast`)
   |-- --executor-timeout=<seconds> -> config.executor.timeoutSeconds (positive integer, default `900`)
   |-- --no-resource-map -> config.resource_map.emit = false
   +-- Defaults: maxIterations=7, convergenceThreshold=0.10, config.executor.type=`native`, config.executor.timeoutSeconds=900, config.resource_map.emit=`true`

   Executor precedence for setup resolution:
   - CLI flag > config file > schema defaults
   - The generated `deep-review-config.json` stores executor settings under `config.executor.*`

   Parsing to config mapping:
   - `--executor` -> `config.executor.type`
   - `--model` -> `config.executor.model`
   - `--reasoning-effort` -> `config.executor.reasoningEffort`
   - `--service-tier` -> `config.executor.serviceTier`
   - `--executor-timeout` -> `config.executor.timeoutSeconds`

   Validation hook:
   - `parseExecutorConfig` from `.opencode/skills/system-spec-kit/mcp_server/lib/deep-loop/executor-config.ts` runs at config-write time
   - Invalid combinations fail fast with clear errors, including `cli-codex` without `--model` and reserved-but-unwired executor kinds

4. Search for related spec folders across alias roots:
   $ find specs .opencode/specs -mindepth 2 -maxdepth 2 -type d 2>/dev/null | sort | tail -10

5. Search for prior work (background):
   - memory_context({ input: review_target OR "deep-review", mode: "focused", includeContent: true })
   - Store: prior_work_found = [yes/no]

6. ASK with SINGLE prompt (include only applicable questions):
   - Include Q-Exec only when `--executor` is NOT present and the target text does NOT already mention executor hints such as `cli-codex`, `codex`, or `gpt-5.4`
   - If Q-Exec is omitted and no executor is otherwise resolved, default to `native`

   Q0. Review Target (if not in command): What to review?
     Examples: spec folder path, `skill:sk-name`, `agent:name`, `track:NN--name`, or file paths/globs

   Q1_type. Review Target Type (auto-detect from Q0, confirm):
     A) spec-folder -- Review spec artifacts + implementation files
     B) skill -- SKILL.md + references/ + assets/ + agents + commands
     C) agent -- Agent family across all runtimes
     D) track -- All child spec folders in a feature track
     E) files -- Arbitrary file paths or globs

   Q_dims. Which review dimensions? (default: all 4)
     All: correctness, security, traceability, maintainability

 succeeded in 0ms:
---
title: Auto Mode Contract Reference
description: Canonical three-tier `:auto` setup-resolution contract shared by every user-invokable `/command:*:auto` surface. Defines tier semantics (resolve → targeted ask → fail-fast), `PRE-BOUND SETUP ANSWERS:` marker grammar, default-resolution table format, fail-fast error template, `:confirm` invariance, and verification protocol.
---

# Auto Mode Contract Reference

This reference module defines the single canonical `:auto` setup-resolution contract used by every user-invokable `/command:*:auto` surface in spec-kit (`/spec_kit:*`, `/create:*`, `/improve:*`). Each command's §0 cites this contract and supplies only its own per-field Default Resolution Table + `PRE-BOUND SETUP ANSWERS:` field list. The contract semantics, marker grammar, error format, and verification protocol live here.

Origin: shipped in `.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/001-deep-review-three-tier-setup/` (deep-review prototype) and generalized in `.../002-auto-mode-contract-generalization-to-all-commands/` (12-command rollout).

Related memory: `feedback_auto_mode_ask_only_when_ambiguous.md`, `feedback_codex_spawnagent_allowlist.md`, `feedback_gate3_no_tmp_exemption.md`.

---

## §1. Three-Tier Flow

`:auto` mode does NOT mean "never ask" (too rigid) and does NOT mean "always ask the full setup block" (too soft). It means "ask only when uncertain or ambiguous." This is achieved via three tiers, evaluated in order:

### Tier 1 — Resolve Confidently

When `execution_mode = AUTONOMOUS` (from `:auto` suffix), the command's §0 MUST attempt to resolve every required input from these sources in order:

1. **`$ARGUMENTS` flags** — explicit user-passed flags (e.g. `--max-iterations=10`, `--spec-folder=PATH`, command-specific flags)
2. **`PRE-BOUND SETUP ANSWERS:` block in the prompt body** — see §2 for grammar. Caller's explicit prompt-body binding wins over `$ARGUMENTS` when both are present
3. **Documented per-field defaults** — see the command's own Default Resolution Table (§3) for which fields carry sensible defaults

After resolution: if every required field has a value, persist the resolved map to the command's working-config file (e.g. `deep-review-config.json`, `plan-config.json`), set `STATUS: PASSED`, load the paired YAML workflow. Do NOT emit any setup question. End §0.

### Tier 2 — Targeted Ask

Use Tier 2 ONLY when Tier 1 leaves one or two required inputs unresolved AND each unresolved field is genuinely ambiguous AND no sensible default exists.

Constraints:
- Emit ONE narrow question per ambiguous field, naming only the ambiguous field. NEVER the full consolidated Q-block from the legacy setup phase.
- If two fields are ambiguous but one's resolution likely makes the other obvious (e.g. `review_target_type` may make `spec_folder` self-evident), ask the first one first; do not bundle multiple ambiguities into a single prompt.
- Missing required input (e.g. empty `$ARGUMENTS` with no marker for a required positional) is NOT ambiguity. Absence is a Tier 3 case.
- Wait briefly for user reply. If an answer arrives, merge it into the resolved map and re-run Tier 1 from the default-application step. If stdin is closed (`</dev/null`, redirected output, non-interactive dispatch) and no answer arrives, fall through to Tier 3. Never wait indefinitely.

### Tier 3 — Fail Fast

Use Tier 3 when `:auto` still has unresolved required inputs after Tier 1 and Tier 2, OR when Tier 2 produced no answer because stdin is closed.

Emit the named-missing-inputs error format (§4), exit non-zero, do NOT load the YAML workflow, do NOT emit any further setup question.

---

## §2. PRE-BOUND SETUP ANSWERS Schema

The `PRE-BOUND SETUP ANSWERS:` block is a structured marker the dispatched AI parses out of the prompt body. It allows callers to pre-bind setup field values without using individual `$ARGUMENTS` flags.

Grammar (YAML-style key/value, one field per line):

```
PRE-BOUND SETUP ANSWERS:
  <field_name>: <value>  # optional inline comment
  <field_name>: <value>
  ...
```

Rules:

- The block opens with `PRE-BOUND SETUP ANSWERS:` (exact case-sensitive heading, followed by colon). Indentation MAY be inside a markdown fenced code block or inline in the prompt text.
- Each field is `  <key>: <value>` indented two spaces, one per line.
- Values are interpreted by the command's Default Resolution Table (§3). Field types and value enums are command-specific.
- Comments after `#` on a value line are ignored.
- Unknown fields produce a warning (do not abort), so callers may include forward-compatible fields.
- Fields not specified fall back to: command-specific Default Resolution Table → command-specific default value → unresolved (triggers Tier 2 or Tier 3 per §1).
- Malformed lines (e.g. missing `:`, malformed value type) emit a parse error naming the line. Known fields parsed before the error may still be used; remaining unresolved fields continue to Tier 2 or Tier 3.
- A second `PRE-BOUND SETUP ANSWERS:` block in the same prompt body produces a duplicate-block error.

The marker block applies ONLY under `:auto`. Under `:confirm`, the block is informational and does not skip the consolidated question prompt.

---

## §3. Default Resolution Table

Every command MUST publish a Default Resolution Table in its §0 (after citing this contract). The table lists each setup field with the following columns:

| Field | Required | Resolves Via | Default | Tier-2 Candidate |
|-------|----------|--------------|---------|------------------|

Column meanings:

- **Field**: the field name (matches the schema in §2 and the question label in the legacy consolidated Q-block).
- **Required**: `Y` (must be resolved before YAML load) or `N` (optional).
- **Resolves Via**: ordered list of resolution sources, e.g. `flag → $ARGUMENTS` / `marker → PRE-BOUND` / `default → "<value>"` / `auto-detect from <other field>` / `requires-ask`.
- **Default**: the documented default value when no flag, marker, or auto-detection applies. May be `none` (no default — Tier 2 or Tier 3 candidate).
- **Tier-2 Candidate**: `Y` if a missing value can be resolved by ONE targeted question (per §1); `N` if absence triggers fail-fast (Tier 3).

A field is a Tier-2 candidate only when ALL of:
- No flag exists for it.
- No marker is provided.
- No sensible default exists.
- The field is genuinely required (Required=`Y`).
- A user choice is the only resolution path (ambiguity, not absence).

---

## §4. Tier 3 Fail-Fast Error Template

When Tier 3 fires, the command emits this exact format and exits non-zero:

```
[ERROR] /<command>:auto — required inputs unresolved under autonomous mode:
  - <field>: <why-unresolved>
  - <field>: <why-unresolved>
Resolution: provide via $ARGUMENTS flags, PRE-BOUND SETUP ANSWERS: block, or switch to :confirm mode for interactive setup.
```

Rules:

- Replace `<command>` with the canonical command name (e.g. `spec_kit:deep-review`).
- One bulleted line per unresolved required field.
- `<why-unresolved>` is one short phrase: "missing — no flag, no marker, no default" or "ambiguous — Tier 2 received no answer (stdin closed)".
- Final line cites the three resolution paths verbatim.
- Do NOT load the YAML workflow.
- Do NOT emit setup questions in Tier 3.
- Exit code: non-zero (1 is the convention).

---

## §5. `:confirm` Invariance

The `:confirm` mode (interactive, with full consolidated Q-block) is unaffected by this contract. Commands MUST preserve their existing `:confirm` behavior exactly. The contract applies ONLY when `execution_mode = AUTONOMOUS` (from `:auto` suffix or explicit `--mode=AUTONOMOUS` flag).

Test invariant: a `:confirm` dispatch against any contract-adopting command MUST emit the original consolidated Q-block (Q0..Qn). Regression-check this per command after migration.

---

## §6. Verification Protocol

Each contract-adopting command requires four verification traces (dry-run mental dispatch traces against the command's §0):

### Trace A — Tier 1 pass
Dispatch with all required inputs resolvable (flags + markers + defaults). Expected: STATUS PASSED, YAML loaded, no question emitted.

### Trace B — Tier 2 targeted ask
Dispatch with exactly one ambiguous required field. Expected: ONE narrow question naming only that field; NEVER the full consolidated block.

### Trace C — Tier 3 fail fast
Dispatch with one or more truly missing required inputs (and stdin closed in non-interactive runtimes). Expected: error format from §4, exit non-zero, no YAML load.

### Trace D — `:confirm` regression
Dispatch with `:confirm` suffix and any inputs. Expected: existing full consolidated Q-block emitted.

Live verification (when feasible) extends the dry-run traces with actual non-interactive dispatches (codex `exec </dev/null`, opencode `run --pure ... </dev/null`, claude `--print`) capturing transcripts as evidence. Live verification confirms the contract works under real runtime stdin-closure conditions.

Evidence schema (one file per dispatch):
- Command invocation verbatim
- Full transcript
- Verdict footer: PASS / PARTIAL / FAIL / SKIP
- Optional: timing, model, runtime gotchas observed

Stored under `<packet>/evidence/<command-slug>-<trace>.txt`.

---

## §7. Adoption Checklist

For each command adopting this contract, the §0 of the command markdown:

- [ ] Adds a one-line citation: `Setup contract: see references/workflows/auto_mode_contract.md`
- [ ] Provides its own per-field Default Resolution Table (§3) listing every Q-block field with the four columns
- [ ] Provides its own `PRE-BOUND SETUP ANSWERS:` field list (one row per setup field, matching the Default Resolution Table)
- [ ] Documents any command-specific Tier-2 ordering rule (e.g. "ask review_target_type before spec_folder")
- [ ] Updates frontmatter `argument-hint` to reference the new bypass capability
- [ ] Preserves the existing `:confirm` consolidated Q-block path untouched
- [ ] Authors §0 dry-run traces (A/B/C/D) and stores them under the adopting packet's `evidence/`

Commands that have adopted this contract:

- `/spec_kit:deep-review` (prototype) — see `.../103/001-deep-review-three-tier-setup/`
- (to be appended as `.../103/002-...` rolls out)

---

## §8. Out of Scope

- Commands without paired YAML workflows (`/improve:prompt`, `agent_router`, etc.) — they have no setup-phase surface where the contract applies.
- Skill-internal `:auto` flows (sk-doc, sk-code routing, etc.) — those are skill SKILL.md surfaces, not `/command:*` surfaces.
- YAML workflow internal interaction gates (e.g. mid-loop approval gates) — handled by each YAML's own non-interactivity rules, not this contract.
- Cross-command `:auto` integration (e.g. `/spec_kit:plan:auto` chained into `/spec_kit:implement:auto`) — separate contract concern.

 succeeded in 0ms:
---
name: system-spec-kit
description: "Unified spec-folder workflow + context preservation: Levels 1-3+, validation, Spec Kit Memory. Required for file modifications."
allowed-tools: [Bash, Edit, Glob, Grep, Read, Task, Write]
version: 3.4.1.0
---

<!-- Keywords: spec-kit, speckit, documentation-workflow, spec-folder, template-enforcement, context-preservation, progressive-documentation, validation, spec-kit-memory, vector-search, hybrid-search, bm25, rrf-fusion, fsrs-decay, constitutional-tier, checkpoint, importance-tiers, cognitive-memory, co-activation, tiered-injection -->

# Spec Kit - Mandatory Conversation Documentation

Orchestrates mandatory spec folder creation for all conversations involving file modifications. Ensures proper documentation level selection (1-3+), template usage, and context preservation through AGENTS.md-enforced workflows.

## 1. WHEN TO USE

### What is a Spec Folder?

A **spec folder** is a numbered directory (e.g., `007-auth-feature/`) that contains documentation for a single feature/task or a coordinated packet of related phase work:

Spec folders may also be nested as coordination-root packets with direct-child phase folders (e.g., `specs/02--track/022-feature/011-phase/002-child/`).

- **Purpose**: Track specifications, plans, tasks, and decisions for one unit of work
- **Location**: Under `specs/` using either `###-short-name/` at the root or nested packet paths for phased coordination
- **Contents**: Markdown files (spec.md, plan.md, tasks.md, and implementation-summary.md when work is complete) plus optional support folders such as `scratch/`, `research/`, or `review/`

Think of it as a "project folder" for AI-assisted development - it keeps context organized and enables session continuity.

### Activation Triggers

**MANDATORY for ALL file modifications:**
- Code files: JS, TS, Python, CSS, HTML
- Documentation: Markdown, README, guides
- Configuration: JSON, YAML, TOML, env templates
- Templates, knowledge base, build/tooling files

**Request patterns that trigger activation:**
- "Add/implement/create [feature]"
- "Fix/update/refactor [code]"
- "Modify/change [configuration]"
- Any keyword: add, implement, fix, update, create, modify, rename, delete, configure, analyze, phase

**Example triggers:**
- "Add email validation to the signup form" → Level 1-2
- "Refactor the authentication module" → Level 2-3
- "Fix the button alignment bug" → Level 1
- "Implement user dashboard with analytics" → Level 3

### When NOT to Use

- Pure exploration/reading (no file modifications)
- Single typo fixes (<5 characters in one file)
- Whitespace-only changes
- Auto-generated file updates (package-lock.json)
- User explicitly selects Option D (skip documentation)

**Rule of thumb:** If modifying ANY file content → Activate this skill.
Status: ✅ This requirement applies immediately once file edits are requested.

### Distributed Governance Rule

Any agent writing authored spec folder docs (`spec.md`, `plan.md`, `tasks.md`, `checklist.md`, `implementation-summary.md`, `decision-record.md`, `handover.md`, `review-report.md`, `debug-delegation.md`, `resource-map.md` (optional)) MUST use contract-backed templates through `create.sh` or the inline renderer. This is a workflow-required gate, not a runtime hook: run `bash .opencode/skills/system-spec-kit/scripts/spec/validate.sh <spec-folder> --strict` after authored spec-doc writes and before completion claims, then route continuity updates through /memory:save. Deep-research workflow-owned packet markdown (`research/iterations/*.md`, `research/deep-research-*.md`, and progressive `research/research.md` loop updates) is exempt from that generic per-write rule; `/spec_kit:deep-research` must instead run targeted strict validation after every `spec.md` mutation it performs. @deep-research retains exclusive write access for `research/research.md`; @debug retains exclusive write access for `debug-delegation.md`.

- `handover.md` stays in the canonical recovery ladder and is maintained through `/memory:save` handover_state routing using the handover template for initial creation.
- `review-report.md` remains owned by `@deep-review` when deep review workflows synthesize findings.
- `resource-map.md` is a peer cross-cutting template under `.opencode/skills/system-spec-kit/templates/`; it remains optional at any level and gives reviewers a lean file ledger alongside `implementation-summary.md`.

### Utility Template Triggers

| Template              | Trigger Keywords                                                                                                              | Action                    |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ------------------------- |
| `handover.md`         | "handover", "next session", "continue later", "pass context", "ending session", "save state", "multi-session", "for next AI"  | Suggest `/memory:save` handover maintenance |
| `debug-delegation.md` | "stuck", "can't fix", "tried everything", "same error", "fresh eyes", "hours on this", "still failing", "need help debugging" | Suggest Task-tool debug delegation |

**Rule:** When detected, proactively suggest the appropriate action.

---

## 2. SMART ROUTING


### Resource Domains

The router discovers markdown resources recursively from `references/` and `assets/` and then applies intent scoring from `RESOURCE_MAP`. Keep this section domain-focused rather than static file inventories.

- `references/memory/` for context retrieval, save workflows, trigger behavior, and indexing.
- `references/templates/` for level selection, template selection, and structure guides.
- `references/validation/` for checklist policy, verification rules, decision formats, and template compliance contracts.
- `references/structure/` for folder organization and sub-folder versioning.
- `references/workflows/` for command workflows and worked examples.
- `references/debugging/` for troubleshooting and root-cause methodology.
- `references/config/` for runtime environment configuration.

### Template and Script Sources of Truth

- Level definitions and template size guidance: level specifications reference
- Template usage and composition rules: [template_guide.md](./references/templates/template_guide.md)
- Use the Level contract for operational templates; `create.sh` and the Level contract resolver share the same template index.
- Use `templates/changelog/` for packet-local nested changelog generation at completion time.
- Script architecture, build outputs, and runtime entrypoints: [scripts/README.md](./scripts/README.md)
- Memory save JSON schema and workflow contracts: [save_workflow.md](./references/memory/save_workflow.md)
- Nested packet changelog workflow: [nested_changelog.md](./references/workflows/nested_changelog.md)

Primary operational scripts:
- `spec/validate.sh`
- `spec/create.sh`
- `spec/archive.sh`
- `spec/check-completion.sh`
- `spec/recommend-level.sh`
- `mcp_server/lib/templates/level-contract-resolver.ts`

CLI exit codes:
- `0`: success.
- `1`: user error such as bad flags or invalid input.
- `2`: validation error.
- `3`: system error such as missing folders, missing manifests, or file I/O failures.

### Resource Loading Levels

| Level       | When to Load               | Resources                    |
| ----------- | -------------------------- | ---------------------------- |
| ALWAYS      | Every skill invocation     | Shared patterns + SKILL.md   |
| CONDITIONAL | If intent signals match   | Intent-mapped references     |
| ON_DEMAND   | Only on explicit request   | Deep-dive quality standards  |

`references/workflows/quick_reference.md` is the primary first-touch command surface. Keep the compact `spec_kit` and `memory` command map there, including `/spec_kit:plan --intake-only` as the standalone intake entry, `/spec_kit:plan` and `/spec_kit:complete` smart delegation notes, and the pointer from `/spec_kit:deep-research` to `../deep-research/references/spec_check_protocol.md`, and use this file only to point readers to it rather than duplicating the full matrix.

### Smart Router Pseudocode

The authoritative routing logic for scoped loading, weighted intent scoring, and ambiguity handling.

- Pattern 1: Runtime Discovery - `discover_markdown_resources()` recursively inventories `references/` and `assets/`.
- Pattern 2: Existence-Check Before Load - `load_if_available()` guards, de-duplicates with `seen`, and checks `inventory`.
- Pattern 3: Extensible Routing Key - command and intent signals select routing labels without static file inventories.
- Pattern 4: Multi-Tier Graceful Fallback - `UNKNOWN_FALLBACK` asks for disambiguation and missing-resource cases return a "no knowledge base" notice.

```python
from pathlib import Path

SKILL_ROOT = Path(__file__).resolve().parent
RESOURCE_BASES = (SKILL_ROOT / "references", SKILL_ROOT / "assets")
DEFAULT_RESOURCE = "references/workflows/quick_reference.md"

INTENT_SIGNALS = {
    "PLAN": {"weight": 3, "keywords": ["plan", "design", "new spec", "level selection", "option b"]},
    "RESEARCH": {"weight": 3, "keywords": ["investigate", "explore", "analyze", "prior work", "evidence"]},
    "IMPLEMENT": {"weight": 3, "keywords": ["implement", "build", "execute", "workflow"]},
    "DEBUG": {"weight": 4, "keywords": ["stuck", "error", "not working", "failed", "debug"]},
    "COMPLETE": {"weight": 4, "keywords": ["done", "complete", "finish", "verify", "checklist"]},
    "MEMORY": {"weight": 4, "keywords": ["memory", "save context", "resume", "checkpoint", "context"]},
    "HANDOVER": {"weight": 4, "keywords": ["handover", "continue later", "next session", "pause"]},
    "PHASE": {"weight": 4, "keywords": ["phase", "decompose", "split", "workstream", "multi-phase", "phased approach", "phased", "multi-session"]},
    "RETRIEVAL_TUNING": {"weight": 3, "keywords": ["retrieval", "search tuning", "fusion", "scoring", "pipeline"]},
    "EVALUATION": {"weight": 3, "keywords": ["evaluate", "ablation", "benchmark", "baseline", "metrics"]},
    "SCORING_CALIBRATION": {"weight": 3, "keywords": ["calibration", "scoring", "normalization", "decay", "interference"]},
    "ROLLOUT_FLAGS": {"weight": 3, "keywords": ["feature flag", "rollout", "toggle", "enable", "disable"]},
    "GOVERNANCE": {"weight": 3, "keywords": ["governance", "tenant", "retention", "audit"]},
}

RESOURCE_MAP = {
    "PLAN": [
                "references/templates/template_guide.md",
        "references/validation/template_compliance_contract.md",
    ],
    "RESEARCH": [
        "references/workflows/quick_reference.md",
        "references/workflows/worked_examples.md",
        "references/memory/epistemic_vectors.md",
    ],
    "IMPLEMENT": [
        "references/validation/validation_rules.md",
        "references/validation/template_compliance_contract.md",
        "references/templates/template_guide.md",
    ],
    "DEBUG": [
        "references/debugging/troubleshooting.md",
        "references/workflows/quick_reference.md",
        "manual_testing_playbook/manual_testing_playbook.md",
    ],
    "COMPLETE": [
        "references/validation/validation_rules.md",
        "references/workflows/nested_changelog.md",
    ],
    "MEMORY": [
        "references/memory/memory_system.md",
        "references/memory/save_workflow.md",
        "references/memory/trigger_config.md",
    ],
    "HANDOVER": [
        "references/workflows/quick_reference.md",
    ],
    "PHASE": [
        "references/structure/phase_definitions.md",
        "references/structure/sub_folder_versioning.md",
        "references/validation/phase_checklists.md",
    ],
    "RETRIEVAL_TUNING": [
        "references/memory/embedding_resilience.md",
        "references/memory/trigger_config.md",
    ],
    "EVALUATION": [
        "references/memory/epistemic_vectors.md",
        "references/config/environment_variables.md",
        "manual_testing_playbook/manual_testing_playbook.md",
    ],
    "SCORING_CALIBRATION": [
        "references/config/environment_variables.md",
    ],
    "ROLLOUT_FLAGS": [
        "references/config/environment_variables.md",
    ],
    "GOVERNANCE": [
        "references/config/environment_variables.md",
    ],
}

COMMAND_BOOSTS = {
    "/spec_kit:plan": "PLAN",
    "/spec_kit:implement": "IMPLEMENT",
    "/spec_kit:complete": "COMPLETE",
    "/spec_kit:plan :with-phases": "PHASE",

 succeeded in 0ms:
---
title: "Feature Specification: auto-mode-contract generalization to all commands"
description: "Lift the three-tier :auto contract from /spec_kit:deep-review (Phase 1) into a shared reference and migrate 11 remaining /spec_kit/, /create/, /improve/ commands to cite it; full live :auto dispatch verification per command."
trigger_phrases:
  - "auto mode contract generalization"
  - "spec-kit :auto rollout"
importance_tier: "important"
contextType: "implementation"
_memory:
  continuity:
    packet_pointer: ".opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands"
    last_updated_at: "2026-05-11T12:35:00Z"
    last_updated_by: "claude-opus-4-7"
    recent_action: "Authored Level 2 spec"
    next_safe_action: "Dispatch cli-codex group 1 (spec_kit commands)"
    blockers: []
    key_files: []
    session_dedup:
      fingerprint: "sha256:0000000000000000000000000000000000000000000000000000000000000000"
      session_id: "103-002-auto-mode-contract-generalization"
      parent_session_id: null
    completion_pct: 0
    open_questions: []
    answered_questions: []
---
# Feature Specification: auto-mode-contract generalization to all commands

<!-- SPECKIT_LEVEL: 2 -->
<!-- SPECKIT_TEMPLATE_SOURCE: spec-core | v2.2 -->

---

<!-- ANCHOR:metadata -->
## 1. METADATA

| Field | Value |
|-------|-------|
| **Level** | 2 |
| **Priority** | P1 |
| **Status** | Active |
| **Created** | 2026-05-11 |
| **Branch** | `main` |
| **Parent Spec** | ../spec.md |
| **Phase** | 2 of 2 |
| **Predecessor** | 001-deep-review-three-tier-setup |
| **Successor** | None |
<!-- /ANCHOR:metadata -->

---

<!-- ANCHOR:problem -->
## 2. PROBLEM & PURPOSE

### Problem Statement
Phase 1 introduced the three-tier `:auto` contract for `/spec_kit:deep-review`. The same architecture and same stdin-hang gap affect 11 other commands across `/spec_kit/`, `/create/`, and `/improve/`. Inlining the three-tier flow into every command duplicates ~300 LOC and risks drift; lifting it into a shared reference doc preserves a single source of truth and keeps each command lean.

### Purpose
Author the shared `auto_mode_contract.md` reference, refactor Phase-1's deep-review to cite it, migrate 11 remaining commands to the same pattern, and verify each one via a live non-interactive `:auto` dispatch.
<!-- /ANCHOR:problem -->

---

<!-- ANCHOR:scope -->
## 3. SCOPE

### In Scope
- Author `.opencode/skills/system-spec-kit/references/workflows/auto_mode_contract.md` (Level 2 sk-doc reference; §1-8 — three-tier flow, PRE-BOUND ANSWERS grammar, default-resolution-table format, Tier-3 error template, `:confirm` invariance, verification protocol, adoption checklist, out-of-scope).
- Refactor `/spec_kit:deep-review` §0 to cite the shared contract (replacing the inline three-tier sections from 001).
- Migrate 11 commands' §0 to cite the shared contract + provide their own per-field default table + PRE-BOUND ANSWERS field list:
  - `/spec_kit:` — deep-research, complete, implement, plan, resume (5)
  - `/create:` — sk-skill, agent, changelog, feature-catalog, testing-playbook, folder_readme (6)
  - `/improve:` — agent (1)
- Update each migrated command's frontmatter `argument-hint` to reference the new bypass capability.
- Preserve each command's `:confirm` consolidated Q-block path untouched (regression-check).
- Full live `:auto` dispatch verification: one transcript per command captured under `evidence/`.

### Out of Scope
- `/improve:prompt` and `agent_router` — no paired YAML / dispatch-only.
- YAML asset edits unless a live verification surfaces a hard requirement.
- Cross-command `:auto` integration tests (chained dispatches).
- Skill-internal `:auto` flows (sk-doc, sk-code, etc.).

### Files to Change

| File Path | Change Type | Description |
|-----------|-------------|-------------|
| `.opencode/skills/system-spec-kit/references/workflows/auto_mode_contract.md` | Create | Shared three-tier `:auto` contract reference |
| `.opencode/commands/spec_kit/deep-review.md` | Modify | Refactor §0 to cite shared contract |
| `.opencode/commands/spec_kit/{deep-research,complete,implement,plan,resume}.md` | Modify | Migrate §0 to shared contract pattern |
| `.opencode/commands/create/{sk-skill,agent,changelog,feature-catalog,testing-playbook,folder_readme}.md` | Modify | Same |
| `.opencode/commands/improve/agent.md` | Modify | Same |
| `002/evidence/` | Create dir + 12 files | Live dispatch transcripts |
<!-- /ANCHOR:scope -->

---

<!-- ANCHOR:requirements -->
## 4. REQUIREMENTS

### P0 - Blockers (MUST complete)

| ID | Requirement | Acceptance Criteria |
|----|-------------|---------------------|
| REQ-001 | Shared `auto_mode_contract.md` exists with all required sections | `grep -c "^## §[1-8]" auto_mode_contract.md` returns ≥7 |
| REQ-002 | All 12 commands (deep-review + 11 migrated) cite the shared contract | `grep -l "auto_mode_contract.md" .opencode/commands/{spec_kit,create,improve}/*.md \| wc -l` returns ≥12 |
| REQ-003 | 12 live `:auto` dispatch evidence files captured | `find 002/evidence -name "*.txt" \| wc -l` returns ≥12 |
| REQ-004 | ≥10/12 PASS verdicts on live dispatches | Per-evidence-file footer verdict |

### P1 - Required (complete OR user-approved deferral)

| ID | Requirement | Acceptance Criteria |
|----|-------------|---------------------|
| REQ-005 | Each command's `:confirm` consolidated Q-block path untouched | Per-command read-back diff confirms no `:confirm` regression |
| REQ-006 | Each migrated command's frontmatter `argument-hint` updated | grep for new bypass capability mention per command |
<!-- /ANCHOR:requirements -->

---

<!-- ANCHOR:success-criteria -->
## 5. SUCCESS CRITERIA

- **SC-001**: Shared contract doc exists and is cited by all 12 in-scope commands.
- **SC-002**: 11 commands migrated; deep-review (Phase 1) refactored to match the shared-contract pattern.
- **SC-003**: 12/12 evidence files exist; ≥10/12 PASS.
- **SC-004**: No `:confirm` regression in any of the 12 commands.
<!-- /ANCHOR:success-criteria -->

---

<!-- ANCHOR:risks -->
## 6. RISKS & DEPENDENCIES

| Type | Item | Impact | Mitigation |
|------|------|--------|------------|
| Risk | Per-command Q-block field shapes differ; one-size-fits-all template may not fit | Some commands' Tier-2 logic needs unique tweaks | Per-command default table is command-specific; codex dispatch reads each command's current §0 and authors a tailored table |
| Risk | Live `:auto` dispatches produce side effects (file writes outside `/tmp`) | Polluting production spec folders or skills tree | Every live-dispatch prompt forbids writes outside `/tmp`; pre-answers Gate 3 with "D) Skip" |
| Risk | Codex SpawnAgent allowlist gap re-emerges in some dispatch | Codex falls back to sub-agent and hits Gate 3 | Use inline-contract pattern per `feedback_codex_spawnagent_allowlist.md` |
| Risk | CLI dispatch unreliability under parallelism | Concurrent codex runs silently fail | Sequential dispatches only; 3 codex groups + 12 live verifications all serial |
| Dependency | `auto_mode_contract.md` must exist before any command migration | Per-command edits would have no citation target | Stage B authors the contract first |
| Dependency | deep-review.md refactor must land first as the reference example | Other migrations would lack a working template | Stage B refactors deep-review before Stage C kicks off |
<!-- /ANCHOR:risks -->

---

<!-- ANCHOR:nfr -->
## L2: NON-FUNCTIONAL REQUIREMENTS

### Performance
- **NFR-P01**: Per-command codex migration completes within 5 min wall-clock.
- **NFR-P02**: Per-command live `:auto` dispatch verification completes within 5 min wall-clock (setup-phase resolution check, not full YAML loop).

### Security
- **NFR-S01**: No secrets, tokens, or credentials persisted in any evidence file.
- **NFR-S02**: All live-dispatch outputs land in `/tmp/` only; never under `.opencode/skills/`, `.opencode/agents/`, or production spec folders.

### Reliability
- **NFR-R01**: Each migrated command's `:confirm` path retains exact existing behavior.
- **NFR-R02**: Every PASS verdict cites file:line evidence in the transcript.
<!-- /ANCHOR:nfr -->

---

<!-- ANCHOR:edge-cases -->
## L2: EDGE CASES

### Data Boundaries
- Command has no `:auto` mode (e.g., `agent_router`): skip from scope.
- Command has `:auto` but no paired YAML (e.g., `/improve:prompt`): skip — no setup-phase surface.
- Command's `:auto` path already implements partial three-tier: codex audits and aligns rather than overwriting.

### Error Scenarios
- Per-command codex migration partially applies: rollback via `git restore <command-md>`; retry with tightened prompt.
- Live dispatch hangs: kill the process; mark as FAIL with stdin-hang diagnostic in evidence; flag as separate finding.
- Live dispatch writes outside `/tmp`: HARD STOP; immediate rollback; treat as P0 in implementation-summary.

### State Transitions
- Draft → Active: 002 spec authored.
- Active → Complete: 12 PASS-or-PARTIAL evidence files exist; strict-validate exit 0; implementation-summary populated.
<!-- /ANCHOR:edge-cases -->

---

<!-- ANCHOR:complexity -->
## L2: COMPLEXITY ASSESSMENT

| Dimension | Score | Notes |
|-----------|-------|-------|
| Scope | 20/25 | 12 commands + 1 shared doc + 12 live verifications |
| Risk | 14/25 | Per-command idiosyncrasies; live verification side-effect risk |
| Research | 8/20 | Pattern established by 001; per-command field mapping is mechanical |
| **Total** | **42/70** | **Level 2** |
<!-- /ANCHOR:complexity -->

---

<!-- ANCHOR:questions -->
## 7. OPEN QUESTIONS

- None blocking planning.
<!-- /ANCHOR:questions -->

codex
The reference example is already in the target shape, so the main work is per-command field mapping. I’m reading each current setup phase now and will snapshot the `:confirm` Q-blocks before touching anything.
exec
/bin/zsh -lc "sed -n '1,260p' .opencode/commands/spec_kit/deep-research.md" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
---
description: Autonomous deep-research loop: iterative investigation with convergence detection. Modes :auto, :confirm.
argument-hint: "<topic> [:auto|:confirm] [--max-iterations=N] [--convergence=N]"
allowed-tools: Read, Write, Edit, Bash, Grep, Glob, Task, WebFetch, memory_context, memory_search, mcp__cocoindex_code__search, code_graph_query, code_graph_context
---

> **EXECUTION PROTOCOL -- READ FIRST**
>
> This command runs a structured YAML workflow. Do NOT dispatch agents from this document.
>
> **YOUR FIRST ACTION:**
> 1. Run the unified setup phase in this Markdown entrypoint and resolve:
>    - `research_topic`
>    - `spec_folder`
>    - `execution_mode`
>    - `maxIterations`
>    - `convergenceThreshold`
> 2. Load the corresponding YAML file from `assets/` only after all setup values are resolved:
>    - Auto: `spec_kit_deep-research_auto.yaml`
>    - Confirm: `spec_kit_deep-research_confirm.yaml`
> 3. Execute the YAML workflow step by step using those resolved values
>
> All content below is reference context for the YAML workflow. Do not treat reference sections as direct instructions to execute.

## CONSTRAINTS

- **DO NOT** dispatch any agent from this document
- **ALL** agent dispatching is handled by the YAML workflow steps
- **MARKDOWN OWNS SETUP**: resolve setup inputs here first, then hand off to YAML
- **YAML START CONDITION**: do not load YAML until ALL required inputs are bound:
  - `research_topic`, `spec_folder`, `execution_mode`, `maxIterations`, `convergenceThreshold`

> **Canonical mode syntax:** use attached command suffixes (`/spec_kit:deep-research:auto`, `/spec_kit:deep-research:confirm`) and keep AGENTS, skills, and quick references synchronized to this entrypoint.

> **Note:** Late-INIT `spec.md` detection and bounded `spec.md` mutations follow
> `.opencode/skills/deep-research/references/spec_check_protocol.md`.
> Acquire `{spec_folder}/research/.deep-research.lock` before `folder_state` classification and keep `research/research.md` as the source of truth for any generated findings sync.
> Targeted strict validation after deep-research spec mutations uses the Node validation orchestrator; the current strict path is designed for fast packet checks and was measured at about 108ms for a fresh Level 3 packet on the local harness.

# SINGLE CONSOLIDATED SETUP PROMPT

This workflow gathers all setup inputs in one prompt. Confirm mode still includes multiple approval gates after setup; only the setup round-trip is consolidated here.

---

## 0. UNIFIED SETUP PHASE

**FIRST MESSAGE PROTOCOL**: This prompt MUST be your FIRST response. No implementation or file-modifying tool calls before asking. Lightweight read-only discovery to suggest a spec folder or load prior context is allowed, then ask ALL questions immediately and wait.

**STATUS: BLOCKED**

```
EXECUTE THIS SINGLE CONSOLIDATED PROMPT:

1. CHECK for mode suffix:
   |-- ":auto"         -> execution_mode = "AUTONOMOUS"
   |-- ":confirm"      -> execution_mode = "INTERACTIVE"
   +-- No suffix       -> execution_mode = "ASK"

2. CHECK $ARGUMENTS for topic:
   |-- Has content (ignoring suffixes and flags):
   |     -> research_topic = $ARGUMENTS, omit Q0
   +-- Empty -> include Q0

3. PARSE optional flags from $ARGUMENTS:
   |-- --max-iterations=N -> maxIterations = N
   |-- --convergence=N -> convergenceThreshold = N
   |-- --spec-folder=PATH -> spec_path = PATH, omit Q1
   |-- --executor=<type> -> config.executor.type (`native` | `cli-codex`)
   |-- --model=<id> -> config.executor.model (for example `gpt-5.4`)
   |-- --reasoning-effort=<level> -> config.executor.reasoningEffort (`none` | `minimal` | `low` | `medium` | `high` | `xhigh`)
   |-- --service-tier=<tier> -> config.executor.serviceTier (`priority` | `standard` | `fast`)
   |-- --executor-timeout=<seconds> -> config.executor.timeoutSeconds (positive integer, default `900`)
   |-- --no-resource-map -> config.resource_map.emit = false
   +-- Defaults: maxIterations=10, convergenceThreshold=0.05, config.executor.type=`native`, config.executor.timeoutSeconds=900, config.resource_map.emit=`true`

   Executor precedence for setup resolution:
   - CLI flag > config file > schema defaults
   - The generated `deep-research-config.json` stores executor settings under `config.executor.*`

   Parsing to config mapping:
   - `--executor` -> `config.executor.type`
   - `--model` -> `config.executor.model`
   - `--reasoning-effort` -> `config.executor.reasoningEffort`
   - `--service-tier` -> `config.executor.serviceTier`
   - `--executor-timeout` -> `config.executor.timeoutSeconds`

   Validation hook:
   - `parseExecutorConfig` from `.opencode/skills/system-spec-kit/mcp_server/lib/deep-loop/executor-config.ts` runs at config-write time
   - Invalid combinations fail fast with clear errors, including `cli-codex` without `--model` and reserved-but-unwired executor kinds

4. Search for related spec folders across alias roots:
   $ find specs .opencode/specs -mindepth 2 -maxdepth 2 -type d 2>/dev/null | sort | tail -10

5. Search for prior work (background):
   - memory_context({ input: research_topic OR "deep-research", mode: "focused", includeContent: true })
   - Store: prior_work_found = [yes/no]

6. ASK with SINGLE prompt (include only applicable questions):
   - Include Q-Exec only when `--executor` is NOT present and the topic text does NOT already mention executor hints such as `cli-codex`, `codex`, or `gpt-5.4`
   - If Q-Exec is omitted and no executor is otherwise resolved, default to `native`

   Q0. Research Topic (if not in command): What topic to research deeply?

   Q1. Spec Folder (required):
     A) Use existing [suggest if found]
     B) Create new under `specs/[track]/[###]-[slug]/` (accept `.opencode/specs/` alias roots when already in use)
     C) Update related [if match found]
     D) Phase folder (e.g., `specs/NN-track/NNN-name/001-phase/` or matching `.opencode/specs/` alias)

   Q2. Execution Mode (if no suffix):
     A) Autonomous -- all iterations without approval
     B) Interactive -- pause at each iteration for review

   Q3. Max Iterations (if not set via flag):
     Default is 10. Change? [Enter number or press enter for default]

   Q-Exec. Executor (optional, press enter for default):
     A) Native (default) — dispatch via @deep-research agent with Opus.
     B) cli-codex — `codex exec` with --model X -c model_reasoning_effort -c service_tier.
     C) cli-gemini — `gemini "PROMPT" -m gemini-3.1-pro-preview -y -o text`. Single supported model currently. No reasoning-effort or service-tier.
     D) cli-claude-code — `claude -p "PROMPT" --model X --permission-mode acceptEdits` with optional --effort. No service-tier.

   Reply format examples:
   - `"A, A"`
   - `"WebSocket research, A, B, 15"`
   - `"WebSocket reconnection strategies, B, A, 10, 0.05, B, gpt-5.4, high, fast"`
   - `"agent execution guardrails research, B, A, 15, 0.05, C, gpt-5.4, _, _"`

7. WAIT for user response (DO NOT PROCEED)

8. Parse response and store ALL results:
   - research_topic = [from Q0 or $ARGUMENTS]
   - spec_choice = [A/B/C/D from Q1]
   - spec_path = [derived path]
   - execution_mode = [AUTONOMOUS/INTERACTIVE]
   - maxIterations = [from Q3 or flag or default 10]
   - convergenceThreshold = [from flag or default 0.05]
   - executor config = [CLI flags, compact reply, config file, or default `native`; map compact reply fields to `config.executor.type/model/reasoningEffort/serviceTier`, and accept an optional volunteered convergence value before executor fields]

9. SET STATUS: PASSED

STOP HERE - Wait for user answers before continuing.

DO NOT proceed until user explicitly answers
NEVER auto-create spec folders without confirmation
NEVER split questions into multiple prompts
```

**Phase Output:**
- `research_topic` | `spec_choice` | `spec_path`
- `execution_mode` | `maxIterations` | `convergenceThreshold`

---

# Deep Research

Conduct autonomous iterative deep research with convergence detection. Each iteration dispatches a fresh LEAF agent (`@deep-research`) that reads externalized state, performs focused investigation, and writes findings to files.

For code review and quality auditing, see `/spec_kit:deep-review`.

```yaml
role: Deep Research Loop Manager
purpose: Run iterative research cycles until convergence or max iterations
action: Execute YAML workflow managing init, loop, synthesis, and save phases
operating_mode:
  workflow: iterative_loop
  compliance: MANDATORY
  execution: autonomous_or_interactive
  validation: convergence_detection
```

---

## 1. PURPOSE

Run an iterative loop for deep research: Initialize state under `{artifact_dir}` (resolved via `resolveArtifactRoot()` — root specs use `{spec_folder}/research/`; child phases and sub-phases use `{spec_folder}/research/{packet}-pt-{NN}/`), dispatch `@deep-research` agent per iteration, evaluate convergence, synthesize findings into `{artifact_dir}/research.md`, and emit `{artifact_dir}/resource-map.md` at convergence unless `--no-resource-map` disables it. Use when deep investigation requiring multiple rounds of discovery.

---

## 2. CONTRACT

**Inputs:** `$ARGUMENTS` -- Research topic with optional flags and mode suffix
**Outputs:** Spec folder with `{artifact_dir}/` packet (`{spec_folder}/research/` for root specs or `{spec_folder}/research/{packet}-pt-{NN}/` for nested phases), `research.md`, optional `resource-map.md`, state files, and `STATUS=<OK|FAIL|CANCELLED>`

---

## 3. WORKFLOW OVERVIEW

| Phase | Name | Purpose | Outputs |
|-------|------|---------|---------|
| Init | Initialize | Create config, strategy (with research charter), state files | State files in `research/` |
| Loop | Iterate | Dispatch @deep-research agent, evaluate convergence + quality guards, generate dashboard | iteration-NNN.md files, deep-research-dashboard.md |
| Synth | Synthesize | Emit `research/resource-map.md` and compile final research/research.md | research/resource-map.md, research/research.md (17 sections) |
| Save | Preserve | Refresh continuity update in canonical spec docs | canonical spec doc updated via `generate-context.js` |

### Execution Modes

| Mode | Invocation | Behavior |
|------|-----------|----------|
| `:auto` | `/spec_kit:deep-research:auto "topic"` | All iterations without approval |
| `:confirm` | `/spec_kit:deep-research:confirm "topic"` | Multi-gate review at setup, iteration, and synthesis |
| (default) | `/spec_kit:deep-research "topic"` | Ask user to choose mode during setup |

---

## 4. INSTRUCTIONS

After setup phase passes, load and execute the appropriate YAML prompt based on execution_mode:

- **AUTONOMOUS**: `.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml`
- **INTERACTIVE**: `.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml`

The YAML contains the full loop workflow: initialization, iteration dispatch, convergence detection, synthesis, and memory save.

---

## 5. OUTPUT FORMATS

**Success:**
```
Deep research complete.
Iterations: [N] | Stop reason: [converged|max_iterations|all_answered]
Artifacts: research/research.md, research/resource-map.md (unless `--no-resource-map`), [N] iteration files, continuity update in canonical spec docs refreshed
Ready for: /spec_kit:plan [feature-description]
STATUS=OK PATH=[spec-folder-path]
```

**Failure:**
```
Error: [error description]  Phase: [phase name]
STATUS=FAIL ERROR="[message]"
```

---

## 6. MEMORY INTEGRATION

### Before Starting
- `memory_context({ input: topic, intent: "understand" })` -- Load prior research
- Inject results into strategy.md "Known Context" section

### Code Context Bootstrap
- Use CocoIndex (`mcp__cocoindex_code__search`) to find relevant code examples before starting research
- Query: 2-5 word concept descriptions related to the research topic
- Inject discovered code patterns into strategy.md "Known Context" section alongside memory findings

### After Completing
- `node .opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js /tmp/save-context-data-<session-id>.json [spec-folder]`
- Verify that the canonical save routed continuity into the expected packet doc (decision-record.md / implementation-summary.md / handover.md)

### Anchor Tags (Automatic)
`ANCHOR:deep-research-[topic]`, `ANCHOR:findings`, `ANCHOR:convergence-report`

---

## 7. SKILL REFERENCE

Full protocol documentation: `.opencode/skills/deep-research/SKILL.md`


exec
/bin/zsh -lc "sed -n '1,260p' .opencode/commands/spec_kit/complete.md" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
---
description: End-to-end SpecKit workflow (14+ steps). Modes: :auto, :confirm, :with-research, :with-phases.
argument-hint: "<feature-description> [:auto|:confirm] [:with-research] [:with-phases] [--phases N] [--phase-names list] [--phase-folder=<path>]"
allowed-tools: Read, Write, Edit, Bash, Grep, Glob, Task, memory_context, spec_kit_memory_memory_save, spec_kit_memory_memory_index_scan, mcp__cocoindex_code__search
---

> ⚠️ **EXECUTION PROTOCOL — READ FIRST**
>
> This command runs a structured YAML workflow. Do NOT dispatch agents from this document.
>
> **Ownership:** Markdown owns setup (resolves all inputs). YAML owns execution (dispatches steps). Setup values resolved here are passed to the YAML workflow.
>
> **YOUR FIRST ACTION:**
> 1. Determine execution mode from user input (`:auto` or `:confirm`)
>    Note: :with-research and :with-phases are feature flags, not execution modes. They modify the :auto or :confirm workflow but do not change the base execution mode.
> 2. Load the corresponding YAML file from `assets/`:
>    - Auto mode → `spec_kit_complete_auto.yaml`
>    - Confirm mode → `spec_kit_complete_confirm.yaml`
> 3. Execute the YAML workflow step by step
>
> All content below is reference context for the YAML workflow. Do not treat reference sections, routing tables, or dispatch templates as direct instructions to execute.

## CONSTRAINTS

- **DO NOT** dispatch any agent (`@review`, `@debug`, `@context`, `@deep-research`) from this document
- **DO NOT** dispatch `@review` to review this workflow or command prompt
- **DO NOT** dispatch `@debug` autonomously under any condition; the workflow surfaces a prompted offer when `failure_count >= 3` during Step 10 and the user dispatches via Task tool themselves with the pre-filled debug-delegation.md scaffold as the structured handoff
- **ALL** agent dispatching is handled by the YAML workflow steps — this document is setup + reference only
- **FIRST ACTION** is always: load the YAML file, then execute it step by step

# SINGLE CONSOLIDATED PROMPT - ONE USER INTERACTION

This workflow gathers ALL inputs in ONE prompt. Round-trip: 1 user interaction.

---

## 0. UNIFIED SETUP PHASE

**FIRST MESSAGE PROTOCOL**: This prompt MUST be your FIRST response. No analysis, no tool calls — ask ALL questions immediately, then wait.

Read-only discovery to classify folder state is allowed when `spec_path` is explicit or can be inferred from the setup answers. Healthy folders keep the existing prompt shape; non-healthy folders run the intake contract (`.opencode/skills/system-spec-kit/references/intake-contract.md`) inline inside the same consolidated prompt and MUST NOT open a second visible command flow.

**STATUS: BLOCKED**

```
EXECUTE THIS SINGLE CONSOLIDATED PROMPT:

1. CHECK mode suffix:
   ├─ ":auto"    → execution_mode = "AUTONOMOUS" (omit Q2)
   ├─ ":confirm" → execution_mode = "INTERACTIVE" (omit Q2)
   └─ No suffix  → execution_mode = "ASK" (include Q2)

1a. CHECK feature flags:
   ├─ ":with-research" present → research_integration = TRUE
   ├─ ":with-phases" present → phase_decomposition = TRUE (omit Q6)
   │   Parse additional flags: --phases N (default 3), --phase-names "a,b,c" (optional)
   │   Include Q7 (Phase Count) and Q8 (Phase Names) if not provided via flags
   └─ None of above → respective flag = FALSE; phase_decomposition = "ASK" (include Q6)

1b. CHECK --phase-folder flag:
   ├─ --phase-folder=<path> provided → auto-resolve spec_path to that child folder path
   │   Set spec_choice = "E", spec_path = <path>, omit Q1
   │   Validate path matches pattern: specs/[###]-*/[0-9][0-9][0-9]-*/
   │   Show parent context: "Phase folder: <path> (parent: <parent-folder>)"
   └─ Not provided → continue normally

2. CHECK $ARGUMENTS for feature description:
   ├─ Has content (ignoring flags/suffix) → feature_description = $ARGUMENTS, omit Q0
   └─ Empty → include Q0

3. Search for related spec folders:
   $ ls -d specs/*/ 2>/dev/null | tail -10

4. Search for prior work (background):
   - memory_context({ input: feature_description OR "complete", mode: "focused", includeContent: true })
   > Gate 1 trigger matching handled at agent level (AGENTS.md).
   > Gate 3 spec-folder trigger classification is typed: `.opencode/skills/system-spec-kit/shared/gate-3-classifier.ts` (`classifyPrompt()`). Invocations of `/spec_kit:complete` are already inside a write flow, so Gate 3 is pre-answered by command dispatch — no extra inference needed here.
   - Store: prior_work_found = [yes/no], prior_work_count = [N]

5. Prior-work loading question needed ONLY if user selects A or C for spec folder AND prior continuity records exist for this spec.

5a. CHECK intake contract requirement when `spec_path` is explicit or can be derived from Q1 / `--phase-folder`:
   ├─ Inspect `{spec_path}` for `spec.md`, `description.json`, `graph-metadata.json`, persisted intake resume markers, and tracked placeholder markers per intake-contract.md §3 Folder State Classification
   ├─ Normalize `folder_state` to one of: `empty-folder` | `partial-folder` | `repair-mode` | `placeholder-upgrade` | `populated-folder`
   ├─ Treat `resume_question_id` / `reentry_reason` or tracked placeholder markers as intake-required resume/upgrade state, not as a healthy folder
   ├─ `folder_state == populated-folder` → `intake_required = FALSE` and preserve the current prompt unchanged
   └─ Otherwise → `intake_required = TRUE`, inherit the parent `execution_mode`, and run the intake contract inline before Step 1 continues

6. ASK with SINGLE prompt (include only applicable questions):

   Q0. Feature Description (if not in command): What feature to build?

   Q1. Spec Folder (required):
     A) Use existing [suggest if found]  B) Create new: specs/[###]-[slug]/
     C) Update related [if match found]  D) Skip documentation
     E) Phase folder — target a specific phase child (e.g., specs/NNN-name/001-phase/)

   Q2. Execution Mode (if no suffix):
     A) Autonomous - all 14 steps without approval
     B) Interactive - pause at each step

   Q3. Dispatch Mode (required):
     A) Single Agent (Recommended)  B) Multi-Agent (1+2)  C) Multi-Agent (1+3)

   Q4. Prior Work Context (when prior continuity records exist for this spec):
     A) Load most recent spec-doc record  B) Load up to 3 most recent spec-doc records  C) Skip

   Q5. Research Intent (required):
     A) add_feature  B) fix_bug  C) refactor  D) understand

   Q6. Phase Decomposition (if :with-phases not in command):
     Create phased spec structure (parent + N child folders)?
     A) No — single spec folder (default)
     B) Yes — decompose into phases before building

   Q7. Phase Count (if phase_decomposition == TRUE and --phases not provided):
     How many phases? (Default: 3)

   Q8. Phase Names (if phase_decomposition == TRUE and --phase-names not provided):
     Provide phase names? (Optional — auto-generated if skipped)
     Example: "data-model, api-layer, ui-components"

   **Intake contract block** (ONLY if `intake_required = TRUE`; keep this inside the SAME prompt, not a second command flow):

   Execute the Q0–Q4+ consolidated intake interview per `.opencode/skills/system-spec-kit/references/intake-contract.md §5`. Questions cover: feature description, target folder state, documentation level, relationship capture, and relationship entries (grouped `depends_on` / `related_to` / `supersedes` by `packet_id`).

   Reply format: "B, A, A, C, A" or "Add auth, B, A, C, A"

7. WAIT for user response (DO NOT PROCEED)

8. Parse response and store ALL results:
   - feature_description = [from Q0 or $ARGUMENTS]
   - spec_choice = [A/B/C/D/E from Q1]
   - spec_path = [derived path or null if D]
   - execution_mode = [AUTONOMOUS/INTERACTIVE from suffix or Q2]
   - dispatch_mode = [single/multi_small/multi_large from Q3]
   - memory_choice = [A/B/C from Q4, or N/A]
   - research_intent = [add_feature/fix_bug/refactor/understand from Q5]
   - phase_decomposition = [TRUE/FALSE]
   - phase_count = [from Q6 or --phases, default 3]
   - phase_names = [from Q7 or --phase-names, or null for auto-generate]
   - IF `intake_required = TRUE`: bind `selected_level`, `start_state`, `repair_mode`, and `manual_relationships` from the inline intake-contract block (see intake-contract.md §6 for trio-publication semantics)
   - IF intake contract adjusts the target: update `feature_description` and `spec_path` from the returned contract before Step 1

9. Execute background operations:
   - IF memory_choice == A: Load the most recent indexed canonical spec document
   - IF memory_choice == B: Load up to 3 recent indexed canonical spec documents or MCP context results
   - IF dispatch_mode is multi_*: Note parallel dispatch will be used
   - IF `intake_required = TRUE`: continue the existing 14-step workflow using the bound `feature_description`, `spec_path`, `selected_level`, `start_state`, `repair_mode`, and `manual_relationships`

10. SET STATUS: PASSED

STOP HERE - Wait for user answers before continuing.

⛔ DO NOT proceed until user explicitly answers
⛔ NEVER auto-create spec folders without confirmation
⛔ NEVER auto-select execution mode without suffix or choice
⛔ NEVER split questions into multiple prompts
```

**Phase Output:**
- `feature_description` | `spec_choice` | `spec_path`
- `execution_mode` | `dispatch_mode` | `memory_loaded` | `research_intent`
- `phase_decomposition` | `phase_count` | `phase_names` (if `:with-phases`)
- `research_integration` | `auto_debug`
- `selected_level` | `start_state` | `repair_mode` | `manual_relationships` (when intake contract runs)

> **Cross-reference**: Implements AGENTS.md Section 2 "Gate 3: Spec Folder Question" and "First Message Protocol".

---

# SpecKit Complete

Execute the complete SpecKit lifecycle from specification through implementation with context preservation.

```yaml
role: Expert Developer using Smart SpecKit with Full Lifecycle Management
purpose: Spec-driven development with mandatory compliance and comprehensive documentation
action: Run full 14-step SpecKit from specification to implementation
operating_mode:
  workflow: sequential_14_step
  compliance: MANDATORY
  execution: autonomous_or_interactive
  validation: checkpoint_based_with_checklist_verification
```

---

## 1. PURPOSE

Run the full 14-step SpecKit workflow: specification, clarification, planning, task breakdown, implementation, and context saving.

---

## 2. CONTRACT

**Inputs:** `$ARGUMENTS` -- Feature description with optional parameters (branch, scope, context)
**Outputs:** Complete spec folder with all artifacts, refreshed `graph-metadata.json`, and `STATUS=<OK|FAIL|CANCELLED>`

```text
$ARGUMENTS
```

### Phase Folder Support

When `--phase-folder=<path>` is provided or spec folder selection includes a phase child:
- **Option E) Phase folder** — complete a specific phase child (e.g., `specs/NNN-name/001-phase/`)
- Auto-resolve `spec_path` to the phase child folder; validate path matches `specs/[###]-*/[0-9][0-9][0-9]-*/`
- Show parent context: "Phase folder: `<path>` (parent: `<parent-folder>`)"
- **Phase lifecycle validation:** If spec folder is a phase child, verify predecessor phase is complete before proceeding. For the first phase (`001-*`), skip predecessor validation (no predecessor exists). For subsequent phases, check that the previous numbered phase folder (e.g., `001-*` before `002-*`) satisfies **either** condition (OR logic): (a) `implementation-summary.md` exists, OR (b) all tasks marked `[x]` in `tasks.md`. Either condition alone is sufficient to consider the predecessor complete.

---

## 3. WORKFLOW OVERVIEW

| Step | Name | Purpose | Outputs |
|------|------|---------|---------|
| 1 | Request Analysis | Analyze inputs, define scope | requirement_summary |
| 2 | Pre-Work Review | Review AGENTS.md, standards | coding_standards_summary |
| 3 | Specification | Create spec.md | spec.md, feature branch |
| 4 | Clarification | Resolve ambiguities | updated spec.md |
| 5 | Quality Checklist | Generate validation checklist (ACTIVELY USED at completion) | checklist.md |
| 6 | Planning | Create technical plan | plan.md, research/research.md |
| 7 | Task Breakdown | Break into tasks | tasks.md |
| 8 | Analysis | Verify consistency | consistency_report |
| 9 | Implementation Check | Verify prerequisites | greenlight |
| 9.5 | **PREFLIGHT Capture** | Capture epistemic baseline | preflight_baseline |
| 10 | Development | Execute implementation | code changes |
| 11 | Checklist Verify | Verify P0/P1 items (Level 2+) | All P0/P1 verified |
| 11.5 | **POSTFLIGHT Capture** | Capture learning delta | postflight_delta |
| 12 | Completion | Generate summary (MANDATORY L2+) | implementation-summary.md |
| 13 | Save Context | Refresh continuity update in canonical spec docs | canonical spec doc updated via `generate-context.js` |
| 14 | Workflow Finish | Close the workflow after the final continuity check | workflow_closed |

### Packet Graph Metadata

- Completion relies on canonical save to refresh the packet's root `graph-metadata.json`.
- `/spec_kit:complete` is responsible for final packet-facing derived state such as `status` and `last_save_at`.
- Manual packet relationships remain untouched during completion; only the derived section is refreshed.

### Execution Modes

| Mode | Invocation | Behavior |
|------|-----------|----------|
| `:auto` | `/spec_kit:complete :auto "feature"` | Execute all steps without approval gates |
| `:confirm` | `/spec_kit:complete :confirm "feature"` | Pause at each step for approval |
| `:with-research` | `/spec_kit:complete :with-research "feature"` | Insert research phase after Step 2 (before specification) |
| `:with-phases` | `/spec_kit:complete :with-phases "feature"` | Insert phase decomposition before Step 1, then complete first child. The parent scaffolds from `phase-parent Level template contract` (lean trio only — `spec.md` + `description.json` + `graph-metadata.json` at parent); plan/tasks/checklist/decisions live in each child. |
| (default) | `/spec_kit:complete "feature"` | Ask user to choose mode during setup |

---

## 4. PHASE A: PLANNING (Steps 1-7)

| STEP | NAME | REQUIRED OUTPUT | VERIFICATION |
|------|------|----------------|--------------|
| 1 | Request Analysis | requirement_summary | Scope defined |
| 2 | Pre-Work Review | coding_standards_summary | AGENTS.md reviewed |
| 3 | Specification | `spec.md` created | File exists, no [NEEDS CLARIFICATION] |
| 4 | Clarification | updated `spec.md` | Ambiguities resolved |

exec
/bin/zsh -lc "sed -n '1,280p' .opencode/commands/spec_kit/implement.md" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
---
description: Implementation workflow (9 steps): execute pre-planned work. Requires plan.md. Modes :auto, :confirm.
argument-hint: "<spec-folder> [:auto|:confirm] [--phase-folder=<path>]"
allowed-tools: Read, Write, Edit, Bash, Grep, Glob, Task, memory_context, memory_search, spec_kit_memory_memory_save, spec_kit_memory_memory_index_scan, mcp__cocoindex_code__search
---

> ⚠️ **EXECUTION PROTOCOL — READ FIRST**
>
> This command runs a structured YAML workflow. Do NOT dispatch agents from this document.
>
> **YOUR FIRST ACTION:**
> 1. Determine execution mode from user input (`:auto` or `:confirm`)
> 2. Load the corresponding YAML file from `assets/`:
>    - Auto mode → `spec_kit_implement_auto.yaml`
>    - Confirm mode → `spec_kit_implement_confirm.yaml`
> 3. Execute the YAML workflow step by step
>
> All content below is reference context for the YAML workflow. Do not treat reference sections, routing tables, or dispatch templates as direct instructions to execute.

## CONSTRAINTS

- **DO NOT** dispatch any agent (`@review`, `@debug`) from this document
- **DO NOT** dispatch `@review` to review this workflow or command prompt
- **DO NOT** dispatch `@debug` autonomously under any condition; the workflow surfaces a prompted offer when `failure_count >= 3` during Step 6 and the user dispatches via Task tool themselves
- **ALL** agent dispatching is handled by the YAML workflow steps — this document is setup + reference only
- **FIRST ACTION** is always: load the YAML file, then execute it step by step

# SINGLE CONSOLIDATED PROMPT - ONE USER INTERACTION

This workflow uses a SINGLE consolidated prompt to gather ALL required inputs in ONE user interaction.

---

## 0. UNIFIED SETUP PHASE

**FIRST MESSAGE PROTOCOL**: This prompt MUST be your FIRST response. No implementation or file-modifying tool calls before asking. Lightweight read-only discovery is allowed, then ask ALL questions immediately and wait.

**STATUS: BLOCKED**

```
EXECUTE THIS SINGLE CONSOLIDATED PROMPT:

1. CHECK for mode suffix:
   - ":auto" -> execution_mode = "AUTONOMOUS" (omit Q2)
   - ":confirm" -> execution_mode = "INTERACTIVE" (omit Q2)
   - No suffix -> execution_mode = "ASK" (include Q2)

2. CHECK $ARGUMENTS for spec folder path:
   - IF has path -> spec_folder_input = $ARGUMENTS
   - IF empty -> include Q0 with available folders

2b. CHECK --phase-folder flag OR auto-detect phase child:
   - IF --phase-folder=<path> provided → auto-resolve spec_path to that child folder
     Set spec_path = <path>, omit Q0/Q1
     Validate path matches pattern: specs/[###]-*/[0-9][0-9][0-9]-*/
   - IF spec_folder_input path contains /[0-9][0-9][0-9]-*/ → auto-detect as phase child
     Show parent context: "Phase child detected: <path> (parent: <parent-folder>)"
     Load parent spec.md for cross-reference context
   - ELSE → continue normally

3. Search for available spec folders with plan.md:
   $ ls -d specs/*/ 2>/dev/null | tail -10
   Check each for: spec.md, plan.md (required), checklist.md (optional)

4. IF spec_folder_input provided, validate prerequisites:
   - spec.md (REQUIRED), plan.md (REQUIRED)
   - tasks.md (create if missing), checklist.md (REQUIRED Level 2+)

5. CHECK for prior incomplete sessions:
   - Read handover.md / canonical packet docs for incomplete markers, unchecked tasks in tasks.md
   - IF found -> Show warning with options:
     A) Resume from where left off  B) Restart (archives prior)  C) Cancel

6. Check if handover.md or canonical packet docs exist for this spec folder

7. ASK user (include only applicable questions):

   Q0. Spec Folder (if not provided):
      Available folders with plan.md: [list with status]
      Enter folder path or number
      E) Phase folder — target a specific phase child (e.g., specs/NNN-name/001-phase/)

   Q1. Confirm Spec Folder (if path provided):
      Folder: [path] | spec.md [Y/N] | plan.md [Y/N] | checklist.md [Y/N/optional]
      A) Yes, implement  B) Different folder  C) Cancel (plan first)

   Q2. Execution Mode (if no suffix):
      A) Autonomous - all 9 steps without approval
      B) Interactive - pause at each step

   Q3. Dispatch Mode (required):
      A) Single Agent (Recommended)
      B) Multi-Agent (1+2)
      C) Multi-Agent (1+3)

   Q4. Prior Work Context (when prior continuity records exist for this spec):
      A) Load most recent spec-doc record  B) Load up to 3 most recent spec-doc records  C) Skip (fresh start)

   Reply with answers, e.g.: "A, A, A, B" or "specs/007-auth/, A, A, B"

8. WAIT for user response (DO NOT PROCEED)

9. Parse and store:
   - spec_path, confirm_choice, execution_mode, dispatch_mode, memory_choice

10. Handle redirects:
    - confirm_choice == B -> Re-prompt folder selection
    - confirm_choice == C -> Redirect to /spec_kit:plan

11. Execute background operations:
    - memory_choice A: load most recent | B: load up to 3 | multi_*: note parallel dispatch

12. SET STATUS: PASSED

HARD STOP: DO NOT proceed until user answers
NEVER assume spec folder without confirmation
NEVER auto-select execution mode without suffix or explicit choice
NEVER split into multiple prompts
```

**Phase Output:**
- `spec_path` | `prerequisites_valid` | `execution_mode` | `dispatch_mode` | `memory_loaded`

> **Cross-reference**: Implements AGENTS.md Section 2 "Gate 3: Spec Folder Question" and "First Message Protocol".

---

# SpecKit Implement

Execute implementation of a pre-planned feature. Requires existing spec.md and plan.md from a prior `/spec_kit:plan` workflow.

> Standalone workflow (9 steps) that assumes spec.md and plan.md exist. Run `/spec_kit:plan` first if needed.

```yaml
role: Expert Developer using Smart SpecKit for Implementation Phase
purpose: Execute pre-planned feature implementation with mandatory checklist verification
action: Run 9-step implementation workflow from plan review through completion summary

operating_mode:
  workflow: sequential_9_step
  workflow_compliance: MANDATORY
  workflow_execution: autonomous_or_interactive
  approvals: step_by_step_for_confirm_mode
  tracking: progressive_task_completion
  validation: checklist_verification_with_evidence
```

---

## 1. PURPOSE

Run the 9-step implementation workflow: plan review, task breakdown, quality validation, development, completion summary, and workflow closeout. Picks up where `/spec_kit:plan` left off.

---

## 2. CONTRACT

**Inputs:** `$ARGUMENTS` -- Spec folder path (REQUIRED) with optional parameters
**Outputs:** Completed implementation + implementation-summary.md + nested changelog when applicable + `STATUS=<OK|FAIL|CANCELLED>`

### Prerequisites

**REQUIRED (all levels):** spec.md, plan.md, tasks.md (created if missing)
**REQUIRED Level 2+:** checklist.md

Missing prerequisites -> guide user to `/spec_kit:plan` first.

### Completion Validation

`validate.sh --strict` uses the current SpecKit exit taxonomy: 0 = success, 1 = user error, 2 = validation error, 3 = system error. Strict warnings exit as validation errors, so implementation cannot close on a warning-only packet without repairing or explicitly documenting the validation state.

---

## 3. WORKFLOW OVERVIEW

| Step | Name                   | Purpose                                       | Outputs                   |
| ---- | ---------------------- | --------------------------------------------- | ------------------------- |
| 1    | Review Plan & Spec     | Understand requirements                       | requirements_summary      |
| 2    | Task Breakdown         | Create/validate tasks.md with template compliance | tasks.md                  |
| 3    | Analysis               | Verify consistency                            | consistency_report        |
| 4    | Quality Checklist      | Validate checklists (used at completion)      | checklist_status          |
| 5    | Implementation Check   | Verify prerequisites                          | greenlight                |
| 5.5  | PREFLIGHT Capture      | Epistemic baseline for learning measurement   | preflight_baseline        |
| 6    | Development            | Execute implementation                        | code changes              |
| 7    | Completion             | Generate implementation summary with template compliance | implementation-summary.md + nested changelog when applicable |
| 7.5  | POSTFLIGHT Capture     | Learning delta and improvement calculation    | postflight_delta          |
| 8    | Save Context           | Refresh continuity update in canonical spec docs           | canonical spec doc updated via `generate-context.js` |
| 9    | Workflow Finish        | Close the implementation pass after continuity refresh | workflow_closed |

> **Note:** This step validates checklist structure and item presence. Evidence verification occurs after implementation in the completion phase.

### Code Search During Plan Review (Step 1)

When reviewing plan.md references to codebase patterns, use CocoIndex semantic search (`mcp__cocoindex_code__search`) to verify that referenced code still exists and find related patterns. Use 2-5 word concept queries. Reserve Grep for exact token verification.

**Execute steps IN ORDER. Mark each ONLY after completing ALL activities. DO NOT SKIP.**

### Step 8: Save Context Protocol

**MANDATORY** via structured `generate-context.js` input (per AGENTS.md Memory Save Rule):
```
node .opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js /tmp/save-context-data-<session-id>.json [spec-folder-path]
```
DO NOT use Write/Edit to author continuity update in canonical spec docss directly. After the script runs, call `memory_save({ filePath })` for MCP availability.

### Memory Context Loading

Use `memory_context()` (L1 unified entry) as primary retrieval. Use `memory_search()` (L2) only as fallback for direct parameter control.

---

## 4. INSTRUCTIONS

After all phases pass, load and execute the appropriate YAML prompt:

- **AUTONOMOUS**: `.opencode/commands/spec_kit/assets/spec_kit_implement_auto.yaml`
- **INTERACTIVE**: `.opencode/commands/spec_kit/assets/spec_kit_implement_confirm.yaml`

The YAML contains detailed step-by-step workflow, field extraction rules, completion report format, and all configuration.

---

## 5. OUTPUT FORMATS

### Success
```
SpecKit Implementation Complete - All 9 steps executed.
Artifacts: tasks.md, implementation-summary.md, nested changelog (when applicable), continuity update in canonical spec docs refreshed
STATUS=OK PATH=[spec-folder-path]
```

### Failure
```
SpecKit Implementation Failed
Error: [description] | Step: [number]
STATUS=FAIL ERROR="[message]"
```

---

## 6. REFERENCE

**Full details in YAML prompts:** Workflow steps, field extraction, doc levels (1/2/3), templates, completion report, mode behaviors, parallel dispatch, checklist verification, failure recovery.

**See also:** AGENTS.md Sections 2-6 for memory loading, confidence framework, request analysis.

---

## 7. PARALLEL DISPATCH

Supports parallel agent dispatch for complex phases (configured in YAML prompts).

### Complexity Scoring (5 dimensions)

| Dimension            | Weight | Scoring                              |
| -------------------- | ------ | ------------------------------------ |
| Domain Count         | 35%    | 1=0.0, 2=0.5, 3+=1.0                |
| File Count           | 25%    | 1-2=0.0, 3-5=0.5, 6+=1.0           |
| LOC Estimate         | 15%    | <50=0.0, 50-200=0.5, >200=1.0       |
| Parallel Opportunity | 20%    | sequential=0.0, some=0.5, high=1.0  |
| Task Type            | 5%     | trivial=0.0, moderate=0.5, complex=1.0|

### Thresholds

- **<20%**: Proceed directly | **>=20% + 2 domains**: ALWAYS ask user
- Eligible phase: `step_6_development`
- Override: `"proceed directly"` / `"use parallel"` / `"auto-decide"` (1hr session mode)

### Workstream Prefixes

`[W:IMPL-N]` implementation | `[W:TEST]` tests | `[W:DOCS]` documentation

---

## 8. QUALITY GATES

| Gate                | Location        | Threshold | Blocking          |
| ------------------- | --------------- | --------- | ----------------- |
| Pre-Implementation  | Before Step 6   | 70        | Yes               |
| Mid-Implementation  | After Step 6.5  | 70        | No (warning only) |

exec
/bin/zsh -lc "sed -n '1,300p' .opencode/commands/spec_kit/plan.md" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
---
description: Planning workflow (8 steps): spec through plan only. Modes :auto, :confirm, :with-phases.
argument-hint: "<feature-description> [:auto|:confirm] [:with-phases] [--intake-only] [--phases N] [--phase-names list] [--phase-folder=<path>] [--spec-folder=PATH] [--level=1|2|3|3+] [--start-state=STATE] [--repair-mode=MODE] [--record-relationships=yes|no] [--depends-on=IDs] [--related-to=IDs] [--supersedes=IDs]"
allowed-tools: Read, Write, Edit, Bash, Grep, Glob, Task, memory_context, memory_search, spec_kit_memory_memory_save, spec_kit_memory_memory_index_scan, mcp__cocoindex_code__search
---

> ⚠️ **EXECUTION PROTOCOL — READ FIRST**
>
> This command runs a structured YAML workflow. Do NOT dispatch agents from this document.
>
> **Ownership:** Markdown owns setup (resolves all inputs). YAML owns execution (dispatches steps). Setup values resolved here are passed to the YAML workflow.
>
> **YOUR FIRST ACTION:**
> 1. Determine execution mode from user input (`:auto` or `:confirm`)
>    Note: `:with-phases` is a feature flag, not an execution mode. It modifies the workflow but does not change the base execution mode.
> 2. Load the corresponding YAML file from `assets/`:
>    - Auto mode → `spec_kit_plan_auto.yaml`
>    - Confirm mode → `spec_kit_plan_confirm.yaml`
> 3. Execute the YAML workflow step by step
>
> All content below is reference context for the YAML workflow. Do not treat reference sections, routing tables, or dispatch templates as direct instructions to execute.

## CONSTRAINTS

- **DO NOT** dispatch any agent (`@deep-research`, `@context`) from this document
- **DO NOT** dispatch `@deep-research` unless confidence < 60% during planning (Step 5)
- **ALL** agent dispatching is handled by the YAML workflow steps — this document is setup + reference only
- **FIRST ACTION** is always: load the YAML file, then execute it step by step

# SINGLE CONSOLIDATED PROMPT - ONE USER INTERACTION

This workflow gathers ALL inputs in ONE prompt. Round-trip: 1 user interaction.

---

## 0. UNIFIED SETUP PHASE

**FIRST MESSAGE PROTOCOL**: This prompt MUST be your FIRST response. No analysis, no tool calls — ask ALL questions immediately, then wait.

Read-only discovery to classify folder state is allowed when `spec_path` is explicit or can be inferred from the setup answers. Healthy folders keep the existing prompt shape; non-healthy folders run the intake contract (`.opencode/skills/system-spec-kit/references/intake-contract.md`) inline inside the same consolidated prompt and MUST NOT open a second visible command flow. When `--intake-only` is present, execution halts after the Emit phase without proceeding to planning Steps 2–8.

**STATUS: BLOCKED**

```
EXECUTE THIS SINGLE CONSOLIDATED PROMPT:

1. CHECK mode suffix:
   ├─ ":auto"    → execution_mode = "AUTONOMOUS" (omit Q2)
   ├─ ":confirm" → execution_mode = "INTERACTIVE" (omit Q2)
   └─ No suffix  → execution_mode = "ASK" (include Q2)

1a. CHECK :with-phases flag:
   ├─ ":with-phases" present → phase_decomposition = TRUE (omit Q6)
   │   Parse additional flags: --phases N (default 3), --phase-names "a,b,c" (optional)
   │   Include Q7 (Phase Count) and Q8 (Phase Names) if not provided via flags
   └─ Not present → phase_decomposition = "ASK" (include Q6)

1a-b. CHECK --intake-only flag:
   ├─ present → intake_only = TRUE; workflow halts after Emit phase, does not proceed to planning Steps 2–8
   └─ absent → intake_only = FALSE

1a-c. PARSE intake contract flags (see .opencode/skills/system-spec-kit/references/intake-contract.md §1):
   ├─ --spec-folder=PATH → spec_path = PATH (bypass auto-discovery)
   ├─ --level=N → selected_level = N
   ├─ --start-state=STATE → requested_start_state = STATE
   ├─ --repair-mode=MODE → repair_mode = MODE
   ├─ --record-relationships=yes|no → collect_relationships = [true|false]
   ├─ --depends-on=PACKET_ID[,...] → seed manual_relationships.depends_on[]
   ├─ --related-to=PACKET_ID[,...] → seed manual_relationships.related_to[]
   └─ --supersedes=PACKET_ID[,...] → seed manual_relationships.supersedes[]

1b. CHECK --phase-folder flag:
   ├─ --phase-folder=<path> provided → auto-resolve spec_path to that child folder path
   │   Set spec_choice = "E", spec_path = <path>, omit Q1
   │   Validate path matches pattern: specs/[###]-*/[0-9][0-9][0-9]-*/
   │   Show parent context: "Phase folder: <path> (parent: <parent-folder>)"
   └─ Not provided → continue normally

2. CHECK $ARGUMENTS for feature description:
   ├─ Has content (ignoring :auto/:confirm) → feature_description = $ARGUMENTS, omit Q0
   └─ Empty → include Q0

3. Search for related spec folders:
   $ ls -d specs/*/ 2>/dev/null | tail -10

4. Search for prior work (background):
   - memory_context({ input: feature_description OR "planning", mode: "focused", includeContent: true })
   > Gate 1 trigger matching handled at agent level (AGENTS.md).
   > Gate 3 spec-folder trigger classification is typed: `.opencode/skills/system-spec-kit/shared/gate-3-classifier.ts` (`classifyPrompt()`). Invocations of `/spec_kit:plan` are already inside a write flow, so Gate 3 is pre-answered by command dispatch — no extra inference needed here.
   - Store: prior_work_found = [yes/no], prior_work_count = [N]

5. Prior-work loading question needed ONLY if user selects A or C for spec folder AND prior continuity records exist for this spec.

5a. CHECK intake contract requirement when `spec_path` is explicit or can be derived from Q1 / `--phase-folder`:
   ├─ Inspect `{spec_path}` for `spec.md`, `description.json`, `graph-metadata.json`, and tracked placeholder markers per intake-contract.md §3 Folder State Classification
   ├─ Normalize `folder_state` to one of: `empty-folder` | `partial-folder` | `repair-mode` | `placeholder-upgrade` | `populated-folder`
   ├─ `folder_state == populated-folder` AND `intake_only == FALSE` → `intake_required = FALSE` and preserve the current prompt unchanged
   ├─ `folder_state == populated-folder` AND `intake_only == TRUE` → no-op exit with informational message
   └─ Otherwise → `intake_required = TRUE`, inherit the parent `execution_mode`, and run the intake contract inline before Step 1 continues (or halt after Emit phase if `intake_only == TRUE`)

6. ASK with SINGLE prompt (include only applicable questions):

   Q0. Feature Description (if not in command): What feature to plan?

   Q1. Spec Folder (required):
     A) Use existing [suggest if found]  B) Create new: specs/[###]-[slug]/
     C) Update related [if match found]  D) Skip documentation
     E) Phase folder — target a specific phase child (e.g., specs/NNN-name/001-phase/)

   Q2. Execution Mode (if no suffix):
     A) Autonomous - all 8 steps without approval
     B) Interactive - pause at each step

   Q3. Dispatch Mode (required):
     A) Single Agent (Recommended)  B) Multi-Agent (1+2)  C) Multi-Agent (1+3)

   Q4. Prior Work Context (when prior continuity records exist for this spec):
     A) Load most recent spec-doc record  B) Load up to 3 most recent spec-doc records  C) Skip

   Q5. Research Intent (required):
     A) add_feature  B) fix_bug  C) refactor  D) understand

   Q6. Phase Decomposition (if :with-phases not in command):
     Create phased spec structure (parent + N child folders)?
     A) No — single spec folder (default)
     B) Yes — decompose into phases before planning

   Q7. Phase Count (if phase_decomposition == TRUE and --phases not provided):
     How many phases? (Default: 3)

   Q8. Phase Names (if phase_decomposition == TRUE and --phase-names not provided):
     Provide phase names? (Optional — auto-generated if skipped)
     Example: "data-model, api-layer, ui-components"

   **Intake contract block** (ONLY if `intake_required = TRUE`; keep this inside the SAME prompt, not a second command flow):

   Execute the Q0–Q4+ consolidated intake interview per `.opencode/skills/system-spec-kit/references/intake-contract.md §5`. Questions cover: feature description, target folder state, documentation level, relationship capture, and relationship entries (grouped `depends_on` / `related_to` / `supersedes` by `packet_id`).

   Reply format: "B, A, A, C, A" or "Add auth, B, A, C, A"

7. WAIT for user response (DO NOT PROCEED)

8. Parse response and store ALL results:
   - feature_description = [from Q0 or $ARGUMENTS]
   - spec_choice = [A/B/C/D/E from Q1]
   - spec_path = [derived path or null if D]
   - execution_mode = [AUTONOMOUS/INTERACTIVE from suffix or Q2]
   - dispatch_mode = [single/multi_small/multi_large from Q3]
   - memory_choice = [A/B/C from Q4, or N/A]
   - research_intent = [add_feature/fix_bug/refactor/understand from Q5]
   - IF `intake_required = TRUE`: bind `selected_level`, `start_state`, `repair_mode`, and `manual_relationships` from the inline intake-contract block (see intake-contract.md §6 for trio-publication semantics)
   - IF intake contract adjusts the target: update `feature_description` and `spec_path` from the returned contract before Step 1
   - IF `intake_only = TRUE`: halt here with STATUS=OK after intake Emit phase completes; do not proceed to Step 1

9. Execute background operations:
   - IF memory_choice == A: Load the most recent indexed canonical spec document
   - IF memory_choice == B: Load up to 3 recent indexed canonical spec documents or MCP context results
   - IF dispatch_mode is multi_*: Note parallel dispatch will be used
   - IF `intake_required = TRUE` AND `intake_only = FALSE`: continue the existing 8-step workflow using the bound `feature_description`, `spec_path`, `selected_level`, `start_state`, `repair_mode`, and `manual_relationships`
   - IF `intake_only = TRUE`: skip Steps 2–8; workflow terminates after intake Emit phase

10. SET STATUS: PASSED

STOP HERE - Wait for user answers before continuing.

⛔ DO NOT proceed until user explicitly answers
⛔ NEVER auto-create spec folders without confirmation
⛔ NEVER auto-select execution mode without suffix or choice
⛔ NEVER split questions into multiple prompts
```

**Phase Output:**
- `feature_description` | `spec_choice` | `spec_path`
- `execution_mode` | `dispatch_mode` | `memory_loaded` | `research_intent`
- `phase_decomposition` | `phase_count` | `phase_names` (if `:with-phases`)
- `intake_only` (if `--intake-only`)
- `selected_level` | `start_state` | `repair_mode` | `manual_relationships` (when intake contract runs)

> **Cross-reference**: Implements AGENTS.md Section 2 "Gate 3: Spec Folder Question" and "First Message Protocol".

---

# SpecKit Plan

Execute the SpecKit planning lifecycle from specification through planning. Terminates after plan.md — use `/spec_kit:implement` for implementation.

> **ENFORCEMENT:** If the user requests implementation via free text (e.g., "implement this plan", "go ahead and build it") instead of `/spec_kit:implement`, you MUST route through the implement command. Do NOT begin implementing directly. Plan and implementation are **separate gate-checked phases** — gate answers from planning do NOT carry over.

```yaml
role: Expert Developer using Smart SpecKit for Planning Phase
purpose: Spec-driven planning with mandatory compliance and stakeholder review support
action: Run planning workflow from specification through technical plan creation

operating_mode:
  workflow: sequential
  workflow_compliance: MANDATORY
  workflow_execution: autonomous_or_interactive
  approvals: step_by_step_for_confirm_mode
  tracking: progressive_artifact_creation
  validation: consistency_check_before_handoff
```

---

## 1. PURPOSE

Run the planning workflow: specification, clarification, and technical planning. Creates spec.md, plan.md, tasks.md, and checklists without implementation. Use when planning needs review before coding.

---

## 2. CONTRACT

**Inputs:** `$ARGUMENTS` — Feature description with optional parameters (branch, scope, context)
**Outputs:** Spec folder with: spec.md, plan.md, tasks.md, checklist.md (Level 2+), a scaffolded root `graph-metadata.json` packet contract, plus a refreshed continuity update in canonical spec docs generated via structured `generate-context.js` input

> **Level 1 Note:** /spec_kit:plan creates spec.md, plan.md, and tasks.md. For complete Level 1 baseline implementation execution, run /spec_kit:implement after planning or use /spec_kit:complete instead.

```text
$ARGUMENTS
```

---

## 3. WORKFLOW OVERVIEW

| Step | Name             | Purpose                      | Outputs                  |
| ---- | ---------------- | ---------------------------- | ------------------------ |
| 1    | Intake           | Run intake contract (folder state, level, relationships) when required | intake_contract_output |
| 2    | Request Analysis | Analyze inputs, define scope | requirement_summary      |
| 3    | Pre-Work Review  | Review AGENTS.md, standards  | coding_standards_summary |
| 4    | Specification    | Create spec.md               | spec.md                  |
| 5    | Clarification    | Resolve ambiguities          | updated spec.md          |
| 6    | Planning         | Create technical plan        | plan.md, checklist.md    |
| 7    | Save Context     | Refresh continuity update in canonical spec docs | canonical spec doc updated via `generate-context.js` |
| 8    | Workflow Finish  | Close the planning pass after context refresh | planning_summary |

### Packet Graph Metadata

- Packet creation now scaffolds a root `graph-metadata.json` file alongside the canonical spec docs.
- The file starts with empty `manual.depends_on`, `manual.supersedes`, and `manual.related_to` arrays.
- Derived fields are intentionally minimal at creation time and are finalized by later canonical save or completion flows.

---

## 4. INSTRUCTIONS

After all phases pass, load and execute the appropriate YAML prompt:

- **AUTONOMOUS**: `.opencode/commands/spec_kit/assets/spec_kit_plan_auto.yaml`
- **INTERACTIVE**: `.opencode/commands/spec_kit/assets/spec_kit_plan_confirm.yaml`

The YAML contains detailed step-by-step workflow, field extraction rules, completion report format, and all configuration.

---

## 5. OUTPUT FORMATS

**Success:**
```
✅ SpecKit Planning Complete — All 8 steps executed.
Artifacts: spec.md, plan.md, tasks.md, checklist.md (L2+), graph-metadata.json scaffolded, continuity update in canonical spec docs refreshed
Ready for: /spec_kit:implement [spec-folder-path]
STATUS=OK PATH=[spec-folder-path]
```

**Failure:**
```
❌ SpecKit Planning Failed
Error: [description] | Step: [number]
STATUS=FAIL ERROR="[message]"
```

---

## 6. REFERENCE

**Full details in YAML prompts:** Workflow steps, field extraction, documentation levels (1/2/3), templates, completion report, mode behaviors, parallel dispatch config, checklist guidelines, failure recovery.

**See also:** AGENTS.md Sections 2-6 for memory loading, confidence framework, and request analysis.

---

## 7. PARALLEL DISPATCH

Supports smart parallel sub-agent dispatch using 5-dimension complexity scoring.

### Complexity Scoring (5 Dimensions)

| Dimension            | Weight | Scoring                                |
| -------------------- | ------ | -------------------------------------- |
| Domain Count         | 35%    | 1=0.0, 2=0.5, 3+=1.0                  |
| File Count           | 25%    | 1-2=0.0, 3-5=0.5, 6+=1.0             |
| LOC Estimate         | 15%    | <50=0.0, 50-200=0.5, >200=1.0         |
| Parallel Opportunity | 20%    | sequential=0.0, some=0.5, high=1.0    |
| Task Type            | 5%     | trivial=0.0, moderate=0.5, complex=1.0 |

**Thresholds:** <20% proceed directly | >=20% + 2 domains: ALWAYS ask user first

### Planning Step: 4-Agent Parallel Exploration (Automatic)


exec
/bin/zsh -lc "sed -n '1,300p' .opencode/commands/spec_kit/resume.md" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
---
description: Resume or recover work on a spec folder: canonical continuity recovery with one next step.
argument-hint: "[spec-folder-path] [:auto|:confirm] [--phase-folder=<path>]"
allowed-tools: Read, Write, Edit, Bash, Grep, Glob, Task, memory_context, memory_search, memory_match_triggers, memory_list, memory_stats, memory_delete, memory_update, memory_validate, memory_index_scan, memory_health, checkpoint_create, checkpoint_list, checkpoint_restore, checkpoint_delete, mcp__cocoindex_code__search
---

> ⚠️ **EXECUTION PROTOCOL — READ FIRST**
>
> This command runs a structured YAML workflow. Do NOT dispatch agents from this document.
>
> **YOUR FIRST ACTION:**
> 1. Determine execution mode from user input (`:auto` or `:confirm`)
> 2. Load the corresponding YAML file from `assets/`:
>    - Auto mode → `spec_kit_resume_auto.yaml`
>    - Confirm mode → `spec_kit_resume_confirm.yaml`
> 3. Execute the YAML workflow step by step
>
> All content below defines workflow context for the YAML runner. Treat it as executable only when running this command workflow; otherwise use it as reference.

## CONSTRAINTS

- **DO NOT** dispatch any agent from this document
- **ALL** agent dispatching is handled by the YAML workflow steps — this document is setup + reference only
- **FIRST ACTION** is always: load the YAML file, then execute it step by step

> **Format:** `/spec_kit:resume [spec-folder-path] [:auto|:confirm]`
> Examples: `/spec_kit:resume specs/007-feature/` | `/spec_kit:resume:auto specs/007-feature/`

# SINGLE CONSOLIDATED PROMPT - ONE USER INTERACTION

This workflow gathers ALL inputs in ONE prompt. Mode defaults to INTERACTIVE unless :auto suffix used.

> **Gate 3 Note:** Resume inherently satisfies Gate 3 — it REQUIRES a spec folder (provided or detected).

---

## 0. UNIFIED SETUP PHASE

**FIRST MESSAGE PROTOCOL**: This prompt MUST be your FIRST response. No implementation or file-modifying tool calls before asking. Lightweight read-only discovery is allowed, then ask ALL questions immediately and wait.

**STATUS: BLOCKED**

```
EXECUTE THIS SINGLE CONSOLIDATED PROMPT:

1. CHECK mode suffix:
   ├─ ":auto"    → execution_mode = "AUTONOMOUS"
   ├─ ":confirm" → execution_mode = "INTERACTIVE"
   └─ No suffix  → execution_mode = "INTERACTIVE" (default - safer)

2. CHECK $ARGUMENTS for spec folder path:
   ├─ Has path → validate path exists
   └─ Empty → auto-detect from deterministic filtered candidates

3. Auto-detect if needed:
   - Build candidates from session-learning + known spec roots (`specs/`, `.opencode/specs/`)
   - Normalize aliases, filter archive/test/fixture/scratch, then rank deterministically
   - Low confidence: confirm in interactive mode; non-interactive safely falls through
   - Found → spec_path = extracted, detection_method = "ranked"
   - Not found → detection_method = "none" (include Q0)

3b. CHECK --phase-folder flag, --no-redirect, OR detect phase parent:
   - IF --phase-folder=<path> provided → auto-resolve spec_path to that child folder
     Set spec_path = <path>, detection_method = "phase-folder"
     Validate path matches pattern: `{specs|.opencode/specs}/[###]-*/[0-9][0-9][0-9]-*/`
   - IF --no-redirect is present → skip pointer redirect entirely; show the parent `spec.md` and child list when spec_path is a phase parent
   - IF spec_path is a parent phase folder (contains numbered child folders like 001-*, 002-*):
     Unless --no-redirect is present, read `graph-metadata.json` first:
       - If `derived.last_active_child_id` is a non-null string AND `derived.last_active_at` parses as ISO-8601 within the last 24 hours, resolve that child under the parent and recurse directly into that child resume flow
       - If the pointer child is missing, null, malformed, missing `last_active_at`, or older than 24 hours, ignore it and continue to list fallback
       - When redirecting, report the redirect target and timestamp so the user can backtrack with `--no-redirect`
     List fallback: child phases with completion status:
       $ ls -d [spec_path]/[0-9][0-9][0-9]-*/ 2>/dev/null
     For each child: check tasks.md completion %, show status (not started / in progress / complete)
     Present phase selection to user so they can choose which phase to resume
   - ELSE → continue normally

4. Check for "CONTINUATION - Attempt" handoff pattern in recent messages:
   - Detected → continuation_detected = TRUE, parse Last/Next
   - Not detected → continuation_detected = FALSE

4b. Check canonical continuity anchors:
    - `handover.md` exists and is recent → continuity_hint_available = TRUE
    - `implementation-summary.md` contains `_memory.continuity` → continuity_state_available = TRUE
    - Parse last confirmed action, next safe action, blockers, and key files from those canonical sources

5. Validate artifacts in spec folder:
   - Check: spec.md, plan.md, tasks.md
   - Store: artifacts_valid = [yes/partial/no]

6. Check canonical recovery sources:
   - `handover.md`
   - `implementation-summary.md` with `_memory.continuity`
   - Supporting spec docs: `tasks.md`, `checklist.md`, `plan.md`, `decision-record.md`, `resource-map.md`
   - `graph-metadata.json` for packet dependencies, related packets, and derived key files after the canonical docs are checked
   - Store: continuity_sources_available = [yes/partial/no]

7. ASK with SINGLE prompt (include only applicable questions):

   Q0. Spec Folder (if not detected/provided):
     No active session detected. Available spec folders: [list]
     A) List and select  B) Start new with /spec_kit:complete  C) Cancel
     E) Phase folder — resume a specific phase child (e.g., specs/NNN-name/001-phase/)

   Q1. Confirm Detected Session (if auto-detected):
     Detected: [spec_path] (last activity: [date])
     A) Yes, resume  B) Select different folder  C) Cancel

   Q2. Continuation Validation (if handoff pattern with mismatch):
     Handoff claims: Last=[X], Next=[Y] | Indexed continuity shows: Last=[A], Next=[B]
     A) Use handoff claims  B) Use indexed-continuity state  C) Investigate first

   Q3. Missing Artifacts (if artifacts_valid != yes):
     Missing: [list]
     A) Run /spec_kit:plan  B) Select different folder  C) Continue anyway

   Q4. Recovery Depth (when the canonical resume packet is still thin):
     A) Fast resume - just enough context to continue safely
     B) Fill missing next step / blockers
     C) Deeper MCP context - enrich the packet if essentials are still missing
     D) Use canonical artifacts only

   Reply format: "A, A" or "A, A, B"

8. WAIT for user response (DO NOT PROCEED)

9. Parse response and store ALL results:
   - spec_path = [from Q0/Q1 or auto-detected or $ARGUMENTS]
   - detection_method = [provided/recent]
   - execution_mode = [AUTONOMOUS/INTERACTIVE from suffix]
   - continuation_choice = [from Q2, or N/A]
   - artifacts_valid = [yes/partial/no]
   - memory_choice = [A/B/C from Q4, or N/A]

10. Execute background operations:
    - IF memory_choice == A: Recover only the default resume packet
    - IF memory_choice == B: Run targeted gap-filling for next step / blockers
   - IF memory_choice == C: Use `session_bootstrap()`/`memory_context()` to enrich the canonical packet
   - IF memory_choice == D: Use canonical artifacts only
    - Calculate progress from tasks.md/checklist.md

11. SET STATUS: PASSED

STOP HERE - Wait for user answers before continuing.

⛔ DO NOT proceed until user explicitly answers
⛔ NEVER assume spec folder without confirmation when path was invalid
⛔ NEVER split questions into multiple prompts
```

**Phase Output:**
- `spec_path` | `detection_method` | `execution_mode`
- `artifacts_valid` | `memory_loaded`

### Packet Graph Metadata

- Resume remains anchored to `handover.md -> _memory.continuity -> spec docs`.
- When that canonical packet is thin, `graph-metadata.json` provides packet-level dependency and key-file hints without replacing the canonical ladder.

---

## 2. PHASE STATUS VERIFICATION (BLOCKING)

| FIELD            | REQUIRED      | SOURCE                        |
| ---------------- | ------------- | ----------------------------- |
| spec_path        | Yes           | Q0/Q1 or auto-detect or $ARGS |
| detection_method | Yes           | Auto-determined               |
| execution_mode   | Yes           | Suffix (defaults INTERACTIVE) |
| artifacts_valid  | Yes           | Validation check              |
| memory_loaded    | Conditional   | Q4 (if the canonical resume packet is still thin) |

ALL required fields set? → Proceed to workflow | Missing? → Re-prompt for missing only

---

## 3. VIOLATION SELF-DETECTION (BLOCKING)

**You are in violation if you:** started workflow before fields set, asked questions in multiple prompts, proceeded without validating artifacts, assumed spec folder without confirmation, didn't display progress, claimed "resumed" without continuation options.

**Recovery:** STOP → state violation → present consolidated prompt → WAIT → resume after all fields set.

---

# WORKFLOW EXECUTION

Execute steps IN ORDER. Mark each ✅ ONLY after completing ALL activities and verifying outputs.

---

## 4. AUTO MODE (4 STEPS)

| STEP | NAME               | REQUIRED OUTPUT      | VERIFICATION            |
| ---- | ------------------ | -------------------- | ----------------------- |
| 1    | Session Detection  | spec_path confirmed  | Path validated          |
| 2    | Load Memory        | context_loaded       | Recovery packet loaded  |
| 3    | Calculate Progress | progress_percentages | Tasks/checklist counted |
| 4    | Present Resume     | resume_summary       | Summary displayed       |

---

## 5. CONFIRM MODE (5 STEPS)

| STEP | NAME               | REQUIRED OUTPUT      | VERIFICATION            |
| ---- | ------------------ | -------------------- | ----------------------- |
| 1    | Session Detection  | spec_path confirmed  | Path validated          |
| 2    | Memory Selection   | user_choice          | User selected A/B/C/D   |
| 3    | Load Memory        | context_loaded       | Requested gaps loaded   |
| 4    | Calculate Progress | progress_percentages | Tasks/checklist counted |
| 5    | Present Resume     | resume_summary       | Summary displayed       |

---

# SpecKit Resume

Resume work on an existing spec folder by detecting the last active session, loading just enough useful context to continue safely, and presenting progress with clear next steps.

```yaml
role: Expert Developer using Smart SpecKit for Session Recovery
purpose: Resume interrupted work with full context restoration and progress visibility
action: Run 4-5 step resume workflow from session detection through continuation options

operating_mode:
  workflow: sequential_4_or_5_step
  workflow_compliance: MANDATORY
  workflow_execution: autonomous_or_interactive
  approvals: memory_selection_in_confirm_mode
  tracking: progress_calculation
  validation: artifact_based
```

---

## 6. PURPOSE

Resume work on an existing or recently interrupted spec-folder session by detecting the last active state, loading structured handoff or memory context, and presenting the smallest useful recovery packet: where you are, what happened last, what should happen next, and what might block it. This command owns both normal continuation and crash-recovery routing.

---

## 7. CONTRACT

**Inputs:** `$ARGUMENTS` — Optional spec folder path with optional :auto/:confirm suffix
**Outputs:** Resumed session context + progress display + packet-graph hints when available + `STATUS=<OK|FAIL|CANCELLED>`

```text
$ARGUMENTS
```

---

## 8. INSTRUCTIONS

After all phases pass, load and execute the appropriate YAML prompt:

- **AUTONOMOUS**: `.opencode/commands/spec_kit/assets/spec_kit_resume_auto.yaml`
- **INTERACTIVE**: `.opencode/commands/spec_kit/assets/spec_kit_resume_confirm.yaml`

The YAML contains detailed step-by-step workflow, output formats, and all configuration.

---

## 9. SESSION DETECTION FLOW

**Priority order for finding spec folder:**
1. Validate provided path from $ARGUMENTS
2. `memory_match_triggers()` — fast phrase matching (<50ms)
3. `memory_context()` — L1 unified retrieval (score > 0.6)
4. Deterministic filtered ranking (session-learning + alias-normalized spec roots)
5. No session found → offer: /spec_kit:complete or specify path

**Context loading priority (after spec_path confirmed):**
1. handover.md (exists & <24h) → use handover context
2. `implementation-summary.md` → `_memory.continuity` host block for last/next/blockers/key files
3. Supporting spec docs (`tasks.md`, `checklist.md`, `plan.md`, `decision-record.md`) → canonical packet detail
4. `graph-metadata.json` → packet dependencies, related packets, supersession, and derived key files
5. `session_bootstrap()` or `memory_context({ mode: "resume", profile: "resume" })` → optional enrichment when the canonical packet is still thin
6. `memory_search()` with resume anchors → targeted gap-filling only when essentials are still missing

**Stale session (>7 days):** Warn user, offer: A) Resume anyway, B) Fresh start, C) Review changes, D) Cancel

---

## 10. SMART MEMORY LOGIC

**Goal:** recover enough state to take the next safe action, not to replay the whole project history.

### Resume Essentials

| Signal | Why it matters | Primary source | Fallback |
| ------ | -------------- | -------------- | -------- |
| Current phase or task | Orient the user immediately | `handover.md`, `tasks.md` | `_memory.continuity`, then `session_bootstrap()` or `memory_context({ mode: "resume", profile: "resume" })` |
| Last confirmed action | Prevent duplicate work | `handover.md`, `_memory.continuity` | `memory_search()` with `state` anchor |
| Next safe action | Make the resume actually useful | `_memory.continuity`, `tasks.md` | `memory_search()` with `next-steps` anchor |
| Blockers or "none" | Avoid unsafe continuation | `_memory.continuity`, `handover.md` | `memory_search()` with `blockers` or `summary` anchor |
| Relevant artifact or file | Give the user a concrete place to start | `tasks.md`, `implementation-summary.md`, `handover.md` | `plan.md`, `decision-record.md` |

### Sufficiency Rule

- Stop loading more context once the command can name a **Next Safe Action** plus at least two of: current phase/task, blocker status, last confirmed action, or relevant artifact/file.
- If the next safe action is still ambiguous after the primary recovery chain, run targeted gap-filling instead of broad memory loading.
- If ambiguity remains after targeted recovery, report uncertainty clearly instead of guessing.

exec
/bin/zsh -lc "sed -n '1,220p' .opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
---
title: "Tasks: auto-mode-contract generalization"
description: "11-command migration via 3 codex groups + 12 live verifications + synthesis."
trigger_phrases:
  - "auto mode contract generalization"
importance_tier: "important"
contextType: "implementation"
_memory:
  continuity:
    packet_pointer: ".opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands"
    last_updated_at: "2026-05-11T12:35:00Z"
    last_updated_by: "claude-opus-4-7"
    recent_action: "Authored task list"
    next_safe_action: "Dispatch codex group 1"
    blockers: []
    key_files: []
    session_dedup:
      fingerprint: "sha256:0000000000000000000000000000000000000000000000000000000000000000"
      session_id: "103-002-auto-mode-contract-generalization"
      parent_session_id: null
    completion_pct: 0
    open_questions: []
    answered_questions: []
---
# Tasks: auto-mode-contract generalization

<!-- SPECKIT_LEVEL: 2 -->
<!-- SPECKIT_TEMPLATE_SOURCE: tasks-core | v2.2 -->

---

<!-- ANCHOR:notation -->
## Task Notation

| Prefix | Meaning |
|--------|---------|
| `[ ]` | Pending |
| `[x]` | Completed |
| `[P]` | Parallelizable |
| `[B]` | Blocked |

**Task Format**: `T### [P?] Description (file path)`
<!-- /ANCHOR:notation -->

---

<!-- ANCHOR:phase-1 -->
## Phase 1: Setup

- [x] T001 Shared `auto_mode_contract.md` authored (Stage B).
- [x] T002 `/spec_kit:deep-review.md` §0 refactored to cite shared contract (Stage B).
- [ ] T003 Confirm 001's dry-run traces still conceptually pass after refactor (read-back).
<!-- /ANCHOR:phase-1 -->

---

<!-- ANCHOR:phase-2 -->
## Phase 2: Implementation

- [ ] T010 Codex group dispatch 1 (spec_kit/5): deep-research, complete, implement, plan, resume.
- [ ] T011 Codex group dispatch 2 (create/6): sk-skill, agent, changelog, feature-catalog, testing-playbook, folder_readme.
- [ ] T012 Codex group dispatch 3 (improve/1): agent.
- [ ] T013 Per-command read-back: confirm `:confirm` block untouched in all 11 migrated commands.
<!-- /ANCHOR:phase-2 -->

---

<!-- ANCHOR:phase-3 -->
## Phase 3: Verification

- [ ] T020 Live `:auto` dispatch — `/spec_kit:deep-review` (re-verify post-refactor).
- [ ] T021 Live `:auto` dispatch — `/spec_kit:deep-research`.
- [ ] T022 Live `:auto` dispatch — `/spec_kit:resume`.
- [ ] T023 Live `:auto` dispatch — `/spec_kit:implement`.
- [ ] T024 Live `:auto` dispatch — `/spec_kit:complete`.
- [ ] T025 Live `:auto` dispatch — `/spec_kit:plan`.
- [ ] T026 Live `:auto` dispatch — `/create:changelog`.
- [ ] T027 Live `:auto` dispatch — `/create:sk-skill`.
- [ ] T028 Live `:auto` dispatch — `/create:agent`.
- [ ] T029 Live `:auto` dispatch — `/create:feature-catalog`.
- [ ] T030 Live `:auto` dispatch — `/create:testing-playbook`.
- [ ] T031 Live `:auto` dispatch — `/create:folder_readme`.
- [ ] T032 Live `:auto` dispatch — `/improve:agent`.
- [ ] T033 Populate `implementation-summary.md` with 12-row results matrix + per-PARTIAL/FAIL finding.
- [ ] T034 strict-validate 103 phase parent + 001 + 002 — all exit 0.
- [ ] T035 Update `_memory.continuity` blocks to `completion_pct: 100`.
<!-- /ANCHOR:phase-3 -->

---

<!-- ANCHOR:completion -->
## Completion Criteria

- [ ] All tasks marked `[x]`
- [ ] No `[B]` blocked tasks remaining
- [ ] 12 evidence files exist with verdict footers
- [ ] ≥10/12 PASS verdicts
- [ ] strict-validate 103/001/002 all exit 0
<!-- /ANCHOR:completion -->

---

<!-- ANCHOR:cross-refs -->
## Cross-References

- **Specification**: See `spec.md`
- **Plan**: See `plan.md`
- **Checklist**: See `checklist.md`
- **Shared contract**: `.opencode/skills/system-spec-kit/references/workflows/auto_mode_contract.md`
- **Phase 1 prototype**: `../001-deep-review-three-tier-setup/`
- **Memory**: `feedback_codex_spawnagent_allowlist.md`, `feedback_gate3_no_tmp_exemption.md`, `feedback_auto_mode_ask_only_when_ambiguous.md`, `feedback_cli_dispatch_unreliability.md`
<!-- /ANCHOR:cross-refs -->

exec
/bin/zsh -lc 'ls -l .opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt 2>/dev/null || true' in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
exec
/bin/zsh -lc 'rg -n "''^### `:auto` Setup Resolution|''^### PRE-BOUND|''^### Default Resolution Table|''^### Consolidated Setup Prompt|''^'"\\*\\*STATUS: BLOCKED\\*\\*|"'^argument-hint:" .opencode/commands/spec_kit/{deep-research,complete,implement,plan,resume}.md' in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
zsh:1: command not found: :auto
.opencode/commands/spec_kit/resume.md:3:argument-hint: "[spec-folder-path] [:auto|:confirm] [--phase-folder=<path>]"
.opencode/commands/spec_kit/resume.md:41:**STATUS: BLOCKED**
.opencode/commands/spec_kit/deep-research.md:3:argument-hint: "<topic> [:auto|:confirm] [--max-iterations=N] [--convergence=N]"
.opencode/commands/spec_kit/deep-research.md:50:**STATUS: BLOCKED**
.opencode/commands/spec_kit/plan.md:3:argument-hint: "<feature-description> [:auto|:confirm] [:with-phases] [--intake-only] [--phases N] [--phase-names list] [--phase-folder=<path>] [--spec-folder=PATH] [--level=1|2|3|3+] [--start-state=STATE] [--repair-mode=MODE] [--record-relationships=yes|no] [--depends-on=IDs] [--related-to=IDs] [--supersedes=IDs]"
.opencode/commands/spec_kit/plan.md:42:**STATUS: BLOCKED**
.opencode/commands/spec_kit/implement.md:3:argument-hint: "<spec-folder> [:auto|:confirm] [--phase-folder=<path>]"
.opencode/commands/spec_kit/implement.md:38:**STATUS: BLOCKED**
.opencode/commands/spec_kit/complete.md:3:argument-hint: "<feature-description> [:auto|:confirm] [:with-research] [:with-phases] [--phases N] [--phase-names list] [--phase-folder=<path>]"
.opencode/commands/spec_kit/complete.md:43:**STATUS: BLOCKED**

codex
The five setup blocks all have the legacy full prompt immediately under `STATUS: BLOCKED`, with no existing `:auto` branch except the reference command. I’m checking the YAML/config naming now so the new Tier 1 text points at the right files instead of inventing names.
exec
/bin/zsh -lc "rg -n \"config\\.json|deep-research-config|complete-config|implement-config|plan-config|resume-config|CONFIG|config\" .opencode/commands/spec_kit/assets/spec_kit_{deep-research,complete,implement,plan,resume}_auto.yaml .opencode/commands/spec_kit/assets/spec_kit_{deep-research,complete,implement,plan,resume}_confirm.yaml" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
.opencode/commands/spec_kit/assets/spec_kit_implement_confirm.yaml:153:# PARALLEL DISPATCH CONFIGURATION
.opencode/commands/spec_kit/assets/spec_kit_implement_confirm.yaml:155:parallel_dispatch_config:
.opencode/commands/spec_kit/assets/spec_kit_implement_confirm.yaml:167:# MULTI-AGENT DISPATCH CONFIGURATION
.opencode/commands/spec_kit/assets/spec_kit_implement_confirm.yaml:169:multi_agent_config:
.opencode/commands/spec_kit/assets/spec_kit_implement_confirm.yaml:453:    - Setup first (structure, dependencies, config)
.opencode/commands/spec_kit/assets/spec_kit_plan_confirm.yaml:240:# PARALLEL DISPATCH CONFIGURATION
.opencode/commands/spec_kit/assets/spec_kit_plan_confirm.yaml:242:parallel_dispatch_config:
.opencode/commands/spec_kit/assets/spec_kit_plan_confirm.yaml:254:# MULTI-AGENT DISPATCH CONFIGURATION
.opencode/commands/spec_kit/assets/spec_kit_plan_confirm.yaml:256:multi_agent_config:
.opencode/commands/spec_kit/assets/spec_kit_complete_confirm.yaml:267:# PARALLEL DISPATCH CONFIGURATION
.opencode/commands/spec_kit/assets/spec_kit_complete_confirm.yaml:269:parallel_dispatch_config:
.opencode/commands/spec_kit/assets/spec_kit_complete_confirm.yaml:281:# MULTI-AGENT DISPATCH CONFIGURATION
.opencode/commands/spec_kit/assets/spec_kit_complete_confirm.yaml:283:multi_agent_config:
.opencode/commands/spec_kit/assets/spec_kit_complete_confirm.yaml:943:    - Setup first (structure, dependencies, config)
.opencode/commands/spec_kit/assets/spec_kit_plan_auto.yaml:234:# PARALLEL DISPATCH CONFIGURATION
.opencode/commands/spec_kit/assets/spec_kit_plan_auto.yaml:236:parallel_dispatch_config:
.opencode/commands/spec_kit/assets/spec_kit_plan_auto.yaml:248:# MULTI-AGENT DISPATCH CONFIGURATION
.opencode/commands/spec_kit/assets/spec_kit_plan_auto.yaml:250:multi_agent_config:
.opencode/commands/spec_kit/assets/spec_kit_implement_auto.yaml:189:# PARALLEL DISPATCH CONFIGURATION
.opencode/commands/spec_kit/assets/spec_kit_implement_auto.yaml:191:parallel_dispatch_config:
.opencode/commands/spec_kit/assets/spec_kit_implement_auto.yaml:203:# MULTI-AGENT DISPATCH CONFIGURATION
.opencode/commands/spec_kit/assets/spec_kit_implement_auto.yaml:205:multi_agent_config:
.opencode/commands/spec_kit/assets/spec_kit_implement_auto.yaml:444:    - Setup first (structure, dependencies, config)
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:61:    config: .opencode/skills/deep-research/assets/deep_research_config.json
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:65:# AGENT CONFIGURATION
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:67:agent_config:
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:85:  config: "{artifact_dir}/deep-research-config.json"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:143:          - "{state_paths.packet_dir}/config.json"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:160:          - "{state_paths.config}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:166:          completed-session: "Resume artifacts exist and config.status == 'complete'"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:187:            skip_to: step_create_config
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:191:          note: "fork and completed-continue branches are deferred. The reducer still reads `lineageMode` from config for dashboards and analysis, but only `new`, `resume`, and `restart` are runtime-supported in this release. See deep-research/references/loop_protocol.md `Session Lifecycle` for the canonical one-session model."
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:202:      step_create_config:
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:203:        action: "Create deep-research-config.json from template"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:204:        template: .opencode/skills/deep-research/assets/deep_research_config.json
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:222:        output: "{state_paths.config}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:225:        action: "Initialize JSONL state log with config record"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:226:        content: '{"type":"config","topic":"{research_topic}","maxIterations":{max_iterations},"convergenceThreshold":{convergence_threshold},"resource_map_present":{resource_map_present},"resource_map":{"emit":true},"createdAt":"{ISO_8601_NOW}","specFolder":"{spec_folder}"}'
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:355:        on_B: { action: "Apply user adjustments to strategy.md and/or config", return_to: gate_init_approval }
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:393:          log_event: '{"type":"event","event":"userPaused","mode":"research","run":{current_iteration},"stopReason":"userPaused","sentinelPath":"{state_paths.pause_sentinel}","timestamp":"{ISO_8601_NOW}","sessionId":"{config.lineage.sessionId}","generation":{config.lineage.generation}}'
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:407:            sessionId: "{config.lineage.sessionId}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:415:        append_to_jsonl: '{"type":"event","event":"graph_convergence","mode":"research","run":{current_iteration},"decision":{graph_decision_json},"signals":{graph_signals_json},"blockers":{graph_blockers_json},"timestamp":"{ISO_8601_NOW}","sessionId":"{config.lineage.sessionId}","generation":{config.lineage.generation}}'
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:422:          3. if stuck_count >= config.stuckThreshold: STUCK_RECOVERY
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:482:          append_to_jsonl: '{"type":"event","event":"blocked_stop","mode":"research","run":{current_iteration},"blockedBy":{blocked_by_json},"gateResults":{"convergence":{"pass":{gate_convergence_pass},"score":{gate_convergence_score}},"keyQuestionCoverage":{"pass":{gate_key_question_coverage_pass},"answered":{answered_count},"total":{total_questions}},"evidenceDensity":{"pass":{gate_evidence_density_pass},"sources":{gate_evidence_density_sources}},"hotspotSaturation":{"pass":{gate_hotspot_saturation_pass}}},"recoveryStrategy":"{recovery_strategy}","timestamp":"{ISO_8601_NOW}","sessionId":"{config.lineage.sessionId}","generation":{config.lineage.generation}}'
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:495:          append_to_jsonl: '{"type":"event","event":"stuckRecovery","mode":"research","run":{current_iteration},"stopReason":"stuckRecovery","fromIteration":{current_iteration},"outcome":"recovered","timestamp":"{ISO_8601_NOW}","sessionId":"{config.lineage.sessionId}","generation":{config.lineage.generation}}'
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:507:          canonical_event: '{"type":"event","event":"userPaused","mode":"research","run":{current_iteration},"stopReason":"userPaused","sentinelPath":"{state_paths.pause_sentinel}","timestamp":"{ISO_8601_NOW}","sessionId":"{config.lineage.sessionId}","generation":{config.lineage.generation}}'
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:510:          canonical_event: '{"type":"event","event":"stuckRecovery","mode":"research","run":{current_iteration},"stopReason":"stuckRecovery","fromIteration":{current_iteration},"outcome":"recovered","timestamp":"{ISO_8601_NOW}","sessionId":"{config.lineage.sessionId}","generation":{config.lineage.generation}}'
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:538:          source: "config.executor"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:539:          loader: ".opencode/skills/system-spec-kit/mcp_server/lib/deep-loop/executor-config.ts#parseExecutorConfig"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:559:              state_paths_config: "{state_paths.config}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:566:          skip_when: "config.executor.type == 'native'"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:570:            executor: "{config.executor}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:572:        branch_on: "config.executor.type"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:582:              --model "{config.executor.model}" \
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:583:              -c model_reasoning_effort="{config.executor.reasoningEffort}" \
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:584:              -c service_tier="{config.executor.serviceTier}" \
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:589:          timeout_seconds: "{config.executor.timeoutSeconds}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:598:                --model "{config.executor.model}" \
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:604:                --model "{config.executor.model}" \
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:609:          timeout_seconds: "{config.executor.timeoutSeconds}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:619:              -m "{config.executor.model}" \
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:624:          timeout_seconds: "{config.executor.timeoutSeconds}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:629:            - "gemini model whitelist enforced at config parse (currently only gemini-3.1-pro-preview)"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:634:              --model "{config.executor.model}" \
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:639:          timeout_seconds: "{config.executor.timeoutSeconds}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:643:              If config.executor.reasoningEffort is set and non-null, expand to: --effort {config.executor.reasoningEffort}
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:652:              --model "{config.executor.model}" \
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:662:          timeout_seconds: "{config.executor.timeoutSeconds}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:666:              If config.executor.reasoningEffort is set and non-null, expand to: --variant {config.executor.reasoningEffort}
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:686:          skip_when: "config.executor.type == 'native'"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:690:            type: "{config.executor.type}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:691:            model: "{config.executor.model}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:692:            reasoningEffort: "{config.executor.reasoningEffort}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:693:            serviceTier: "{config.executor.serviceTier}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:728:              sessionId: "{config.lineage.sessionId}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:811:          - "{state_paths.config}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:858:        action: "Emit {state_paths.resource_map_output} from converged research deltas unless config.resource_map.emit is false"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:861:          - "{state_paths.config}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:865:        guarantee: "Reducer skips cleanly when config.resource_map.emit == false and writes a deterministic resource-map when enabled."
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:921:        on_C: { append_to_jsonl: '{"type":"spec_mutation","event":"spec_synthesis_deferred","reason":"confirm_mode_deferred_writeback","generatedFence":"deep-research/spec-findings","timestamp":"{ISO_8601_NOW}"}', proceed_to: step_update_config_status }
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:924:        action: "Write or replace the bounded generated findings block in spec.md before config completion"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:942:      step_update_config_status:
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:943:        action: "Mark config as complete"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:944:        edit: "{state_paths.config}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:1014:        - State files: config.json, state.jsonl, strategy.md, findings-registry.json, dashboard.md
.opencode/commands/spec_kit/assets/spec_kit_deep-research_confirm.yaml:1059:    - modify_config_after_initialization
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:75:    config: .opencode/skills/deep-research/assets/deep_research_config.json
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:79:# AGENT CONFIGURATION
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:81:agent_config:
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:99:  config: "{artifact_dir}/deep-research-config.json"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:157:        action: "Detect resource-map.md before config creation so init can persist the flag and seed Known Context"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:170:          - "{state_paths.packet_dir}/config.json"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:200:          - "{state_paths.config}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:206:          completed-session: "Resume artifacts exist and config.status == 'complete'"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:226:          skip_to: step_create_config
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:227:        note_deferred_branches: "fork and completed-continue are deferred and no longer runtime-supported in this release. The reducer still reads `lineageMode` from config for dashboards and analysis, but only `new`, `resume`, and `restart` are live. See deep-research/references/loop_protocol.md §Lifecycle Branch Contract for the one-session contract."
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:238:      step_create_config:
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:239:        action: "Create deep-research-config.json from template"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:240:        template: .opencode/skills/deep-research/assets/deep_research_config.json
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:261:        output: "{state_paths.config}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:264:        action: "Initialize JSONL state log with config record"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:266:        # Same parsed --no-resource-map flag honored here so config and state_log agree from line 1.
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:267:        content: '{"type":"config","topic":"{research_topic}","maxIterations":{max_iterations},"convergenceThreshold":{convergence_threshold},"resource_map_present":{resource_map_present},"resource_map":{"emit":{resource_map_emit}},"createdAt":"{ISO_8601_NOW}","specFolder":"{spec_folder}"}'
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:380:          - "{state_paths.config}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:394:          - resource_map_present: "Extract boolean from deep-research-config.json, default false"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:404:          log_event: '{"type":"event","event":"userPaused","mode":"research","run":{current_iteration},"stopReason":"userPaused","sentinelPath":"{state_paths.pause_sentinel}","timestamp":"{ISO_8601_NOW}","sessionId":"{config.lineage.sessionId}","generation":{config.lineage.generation}}'
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:418:            sessionId: "{config.lineage.sessionId}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:426:        append_to_jsonl: '{"type":"event","event":"graph_convergence","mode":"research","run":{current_iteration},"decision":{graph_decision_json},"signals":{graph_signals_json},"blockers":{graph_blockers_json},"timestamp":"{ISO_8601_NOW}","sessionId":"{config.lineage.sessionId}","generation":{config.lineage.generation}}'
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:433:          3. if stuck_count >= config.stuckThreshold: STUCK_RECOVERY
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:493:          append_to_jsonl: '{"type":"event","event":"blocked_stop","mode":"research","run":{current_iteration},"blockedBy":{blocked_by_json},"gateResults":{"convergence":{"pass":{gate_convergence_pass},"score":{gate_convergence_score}},"keyQuestionCoverage":{"pass":{gate_key_question_coverage_pass},"answered":{answered_count},"total":{total_questions}},"evidenceDensity":{"pass":{gate_evidence_density_pass},"sources":{gate_evidence_density_sources}},"hotspotSaturation":{"pass":{gate_hotspot_saturation_pass}}},"recoveryStrategy":"{recovery_strategy}","timestamp":"{ISO_8601_NOW}","sessionId":"{config.lineage.sessionId}","generation":{config.lineage.generation}}'
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:506:          append_to_jsonl: '{"type":"event","event":"stuckRecovery","mode":"research","run":{current_iteration},"stopReason":"stuckRecovery","fromIteration":{current_iteration},"outcome":"recovered","timestamp":"{ISO_8601_NOW}","sessionId":"{config.lineage.sessionId}","generation":{config.lineage.generation}}'
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:518:          canonical_event: '{"type":"event","event":"userPaused","mode":"research","run":{current_iteration},"stopReason":"userPaused","sentinelPath":"{state_paths.pause_sentinel}","timestamp":"{ISO_8601_NOW}","sessionId":"{config.lineage.sessionId}","generation":{config.lineage.generation}}'
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:521:          canonical_event: '{"type":"event","event":"stuckRecovery","mode":"research","run":{current_iteration},"stopReason":"stuckRecovery","fromIteration":{current_iteration},"outcome":"recovered","timestamp":"{ISO_8601_NOW}","sessionId":"{config.lineage.sessionId}","generation":{config.lineage.generation}}'
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:526:          source: "config.executor"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:527:          loader: ".opencode/skills/system-spec-kit/mcp_server/lib/deep-loop/executor-config.ts#parseExecutorConfig"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:548:              state_paths_config: "{state_paths.config}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:555:          skip_when: "config.executor.type == 'native'"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:559:            executor: "{config.executor}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:561:        branch_on: "config.executor.type"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:574:            import { resolveCodexSandboxMode } from './.opencode/skills/system-spec-kit/mcp_server/lib/deep-loop/executor-config.ts';
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:578:              model: '{config.executor.model}',
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:579:              reasoningEffort: '{config.executor.reasoningEffort}' === 'null' ? null : '{config.executor.reasoningEffort}',
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:580:              serviceTier: '{config.executor.serviceTier}' === 'null' ? null : '{config.executor.serviceTier}',
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:581:              sandboxMode: '{config.executor.sandboxMode}' === 'null' ? null : '{config.executor.sandboxMode}',
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:582:              timeoutSeconds: Number('{config.executor.timeoutSeconds}'),
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:612:          timeout_seconds: "{config.executor.timeoutSeconds}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:620:            import { resolveGeminiSandboxMode } from './.opencode/skills/system-spec-kit/mcp_server/lib/deep-loop/executor-config.ts';
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:624:              model: '{config.executor.model}',
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:625:              reasoningEffort: '{config.executor.reasoningEffort}' === 'null' ? null : '{config.executor.reasoningEffort}',
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:626:              serviceTier: '{config.executor.serviceTier}' === 'null' ? null : '{config.executor.serviceTier}',
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:627:              sandboxMode: '{config.executor.sandboxMode}' === 'null' ? null : '{config.executor.sandboxMode}',
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:628:              timeoutSeconds: Number('{config.executor.timeoutSeconds}'),
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:653:          timeout_seconds: "{config.executor.timeoutSeconds}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:658:            - "gemini model whitelist enforced at config parse (currently only gemini-3.1-pro-preview)"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:665:            import { resolveClaudePermissionMode } from './.opencode/skills/system-spec-kit/mcp_server/lib/deep-loop/executor-config.ts';
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:669:              model: '{config.executor.model}',
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:670:              reasoningEffort: '{config.executor.reasoningEffort}' === 'null' ? null : '{config.executor.reasoningEffort}',
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:671:              serviceTier: '{config.executor.serviceTier}' === 'null' ? null : '{config.executor.serviceTier}',
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:672:              sandboxMode: '{config.executor.sandboxMode}' === 'null' ? null : '{config.executor.sandboxMode}',
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:673:              timeoutSeconds: Number('{config.executor.timeoutSeconds}'),
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:702:          timeout_seconds: "{config.executor.timeoutSeconds}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:709:          skip_when: "config.executor.type == 'native'"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:713:            type: "{config.executor.type}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:714:            model: "{config.executor.model}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:715:            reasoningEffort: "{config.executor.reasoningEffort}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:716:            serviceTier: "{config.executor.serviceTier}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:720:              --model "{config.executor.model}" \
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:730:          timeout_seconds: "{config.executor.timeoutSeconds}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:734:              If config.executor.reasoningEffort is set and non-null, expand to: --variant {config.executor.reasoningEffort}
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:799:              sessionId: "{config.lineage.sessionId}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:822:          append_jsonl: '{"type":"iteration","run":{current_iteration},"mode":"research","status":"error","focus":"{next_focus}","findingsCount":0,"newInfoRatio":0.0,"keyQuestions":[],"answeredQuestions":[],"durationMs":0,"timestamp":"{ISO_8601_NOW}","sessionId":"{config.lineage.sessionId}","generation":{config.lineage.generation}}'
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:855:          - "{state_paths.config}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:879:        action: "Emit {state_paths.resource_map_output} from converged research deltas unless config.resource_map.emit is false"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:882:          - "{state_paths.config}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:886:        guarantee: "Reducer skips cleanly when config.resource_map.emit == false and writes a deterministic resource-map when enabled."
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:922:        action: "Write or replace the bounded generated findings block in spec.md before config completion"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:946:      step_update_config_status:
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:947:        action: "Mark config as complete"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:948:        edit: "{state_paths.config}"
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:997:        - State files: config.json, state.jsonl, strategy.md, findings-registry.json, dashboard.md
.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml:1030:    - modify_config_after_initialization
.opencode/commands/spec_kit/assets/spec_kit_complete_auto.yaml:258:# PARALLEL DISPATCH CONFIGURATION
.opencode/commands/spec_kit/assets/spec_kit_complete_auto.yaml:260:parallel_dispatch_config:
.opencode/commands/spec_kit/assets/spec_kit_complete_auto.yaml:272:# MULTI-AGENT DISPATCH CONFIGURATION
.opencode/commands/spec_kit/assets/spec_kit_complete_auto.yaml:274:multi_agent_config:
.opencode/commands/spec_kit/assets/spec_kit_complete_auto.yaml:884:    - Setup first (project structure, dependencies, configuration)

exec
/bin/zsh -lc "node - <<'NODE'
const fs=require('fs'); const crypto=require('crypto');
for (const f of ['deep-research','complete','implement','plan','resume']) {
 const p="'`.opencode/commands/spec_kit/${f}.md`;
 const s=fs.readFileSync(p,'"'utf8');
 const start=s.indexOf('**STATUS: BLOCKED**');
 const fence=s.indexOf('"'```'"', start);
 const end=s.indexOf('\\n"'```'"', fence+3)+4;
 const block=s.slice(start,end);
 console.log("'`${f}'"\\t"'${block.length}'"\\t"'${crypto.createHash('"'sha256').update(block).digest('hex')}"'`);
}
NODE' in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
deep-research	4960	24ced4c41a394c4e8c12b91338560f6bd975aac2d6aa68a8c40da0e0d5ebed85
complete	6534	de4b894b541f282b653df63ffa7b69eead81ccb17880fcfc13016ea6ad8839ce
implement	3202	ad7ce7d856aaaff11e29a55977922bb3311c0ca65a0e4db16753c4d2f8932341
plan	7312	15d79f803954df1d67eacdce2d41d2f26266e5fb329f4bdd92dcff88f2606925
resume	5528	2123ab4b502a1592f19fd580923a29258c56b1ee09d94331bd58af87fd30a3c1

codex
I’ve got the field model now. The only non-obvious call: for `plan`/`complete`, I’m treating `dispatch_mode` and phase decomposition as defaultable in `:auto`, while `spec_folder` and `research_intent` remain the targeted-ask candidates because those are real user choices.
exec
/bin/zsh -lc "node - <<'NODE'
const fs = require('fs');
const root = '/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public';
const suffix = ' (:auto supports PRE-BOUND SETUP ANSWERS: prompt-body block for non-interactive setup)';
const files = {
  'deep-research': '.opencode/commands/spec_kit/deep-research.md',
  complete: '.opencode/commands/spec_kit/complete.md',
  implement: '.opencode/commands/spec_kit/implement.md',
  plan: '.opencode/commands/spec_kit/plan.md',
  resume: '.opencode/commands/spec_kit/resume.md',
};
function block(lines) { return lines.join('\\n') + '\\n'; }
function updateHint(s) {
  return s.replace(/"'^argument-hint: "([''^"]*)"$/m, (m, hint) => {
    if (hint.includes('"':auto supports PRE-BOUND SETUP ANSWERS')) return m;
    return "'`argument-hint: "${hint}${suffix}"`;
  });
}
function replaceFirstProtocol(s) {
  return s.replace(
    /'"\\*\\*FIRST MESSAGE PROTOCOL\\*\\*: This prompt MUST be your FIRST response\\.(["'^'"\\n]*)\\n/,
    '**FIRST MESSAGE PROTOCOL**: For "'`:confirm` or no suffix, the consolidated setup prompt MUST be your FIRST response.$1'"\\n'
  );
}
const sections = {};
sections['deep-research'] = block([
'For "'`:auto`, do not emit the consolidated prompt by default. Resolve setup with the three-tier branch below, then load the auto YAML only after all required values are bound.'"',
'',
'### "'`:auto` Setup Resolution'"',
'',
'Setup contract: see "'`.opencode/skills/system-spec-kit/references/workflows/auto_mode_contract.md`.'"',
'',
'Under "'`execution_mode = AUTONOMOUS` (from the `:auto` suffix), follow the three-tier flow:'"',
'',
'1. **Tier 1 — Resolve confidently** (contract §1): parse "'`$ARGUMENTS` flags + `PRE-BOUND SETUP ANSWERS:` block (§2) + the Default Resolution Table below (§3). When every required field is resolved, persist to `{artifact_dir}/deep-research-config.json` (shape: `researchTopic`, `specFolder`, `maxIterations`, `convergenceThreshold`, `executionMode: "auto"`, `resource_map.emit`, `config.executor.*`), bind runtime YAML placeholders, set `STATUS: PASSED`, load `.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml`. End §0.'"',
'',
'2. **Tier 2 — Targeted ask** (contract §1): when 1-2 required fields are genuinely ambiguous AND no default exists, emit ONE narrow question per ambiguous field. Command-specific Tier-2-eligible fields (per the Default Resolution Table below): "'`spec_folder`. **Ordering rule**: none needed. Missing `research_topic` is absence, not ambiguity — go to Tier 3.'"',
'',
'3. **Tier 3 — Fail fast** (contract §4): emit the named-missing-inputs error format with "'`/spec_kit:deep-research:auto` as the command name. Exit non-zero. Do not load YAML.'"',
'',
'"'`:confirm` path stays unchanged — see the consolidated setup prompt section below.'"',
'',
'### PRE-BOUND SETUP ANSWERS Schema (for "'`:auto` non-interactive dispatch)'"',
'',
'The dispatched prompt body may contain one structured marker block. Parse it before applying defaults. Grammar: see "'`auto_mode_contract.md` §2.'"',
'',
'"'```yaml'"',
'PRE-BOUND SETUP ANSWERS:',
'  research_topic: WebSocket reconnection strategies  # string',
'  spec_folder: .opencode/specs/103-example/001-research/  # existing | new | update-related | phase-folder | explicit path',
'  execution_mode: AUTONOMOUS  # from :auto suffix',
'  maxIterations: 10  # positive integer',
'  convergenceThreshold: 0.05  # decimal 0..1',
'  executor: native  # native | cli-codex | cli-gemini | cli-claude-code',
'  executor_model: \"\"  # optional executor-specific model id',
'  executor_reasoning: \"\"  # optional reasoning effort',
'  executor_service_tier: \"\"  # optional service tier',
'  executor_timeout: 900  # optional positive integer seconds',
'  resource_map_emit: true  # boolean',
'"'```'"',
'',
'Rules: see "'`auto_mode_contract.md` §2 (unspecified fields fall back to default; marker fields take precedence over `$ARGUMENTS` flags; unknown fields warn; malformed lines parse-error).'"',
'',
'### Default Resolution Table',
'',
'| Field | Required | Resolves Via | Default | Tier-2 Candidate |',
'|-------|----------|--------------|---------|------------------|',
'| "'`research_topic` | Y | `$ARGUMENTS` positional topic, or marker `research_topic` | none | N |'"',
'| "'`spec_folder` | Y | flag `--spec-folder`, marker `spec_folder`, or targeted choice among suggested existing/new/update-related/phase folder | none | Y, when topic is present but folder choice is ambiguous |'"',
'| "'`execution_mode` | Y | attached suffix `:auto` or marker `execution_mode` | `AUTONOMOUS` under `:auto` | N |'"',
'| "'`maxIterations` | Y | flag `--max-iterations`, marker `maxIterations`, or default | `10` | N |'"',
'| "'`convergenceThreshold` | Y | flag `--convergence`, marker `convergenceThreshold`, or default | `0.05` | N |'"',
'| "'`executor` | N | flag `--executor`, marker `executor`, config file, or default | `native` | N |'"',
'| "'`executor_model` | N | flag `--model`, marker `executor_model`, or executor-specific validation | none | N |'"',
'| "'`executor_reasoning` | N | flag `--reasoning-effort`, marker `executor_reasoning`, or executor default | none | N |'"',
'| "'`executor_service_tier` | N | flag `--service-tier`, marker `executor_service_tier`, or executor default | none | N |'"',
'| "'`executor_timeout` | N | flag `--executor-timeout`, marker `executor_timeout`, or default | `900` | N |'"',
'| "'`resource_map_emit` | N | flag `--no-resource-map`, marker `resource_map_emit`, or default | `true` | N |'"',
'']);
sections.complete = block([
'For "'`:auto`, do not emit the consolidated prompt by default. Resolve setup with the three-tier branch below, then load the auto YAML only after all required values are bound.'"',
'',
'### "'`:auto` Setup Resolution'"',
'',
'Setup contract: see "'`.opencode/skills/system-spec-kit/references/workflows/auto_mode_contract.md`.'"',
'',
'Under "'`execution_mode = AUTONOMOUS` (from the `:auto` suffix), follow the three-tier flow:'"',
'',
'1. **Tier 1 — Resolve confidently** (contract §1): parse "'`$ARGUMENTS` flags + `PRE-BOUND SETUP ANSWERS:` block (§2) + the Default Resolution Table below (§3). When every required field is resolved, persist to `{spec_path}/complete-config.json` (shape: `featureDescription`, `specPath`, `executionMode: "auto"`, `dispatchMode`, `memoryChoice`, `researchIntent`, `researchIntegration`, `phaseDecomposition`, `phaseCount`, `phaseNames`, `intake.*`), bind runtime YAML placeholders, set `STATUS: PASSED`, load `.opencode/commands/spec_kit/assets/spec_kit_complete_auto.yaml`. End §0.'"',
'',
'2. **Tier 2 — Targeted ask** (contract §1): when 1-2 required fields are genuinely ambiguous AND no default exists, emit ONE narrow question per ambiguous field. Command-specific Tier-2-eligible fields (per the Default Resolution Table below): "'`spec_folder`, `research_intent`. **Ordering rule**: none needed. Missing `feature_description` is absence, not ambiguity — go to Tier 3.'"',
'',
'3. **Tier 3 — Fail fast** (contract §4): emit the named-missing-inputs error format with "'`/spec_kit:complete:auto` as the command name. Exit non-zero. Do not load YAML.'"',
'',
'"'`:confirm` path stays unchanged — see the consolidated setup prompt section below.'"',
'',
'### PRE-BOUND SETUP ANSWERS Schema (for "'`:auto` non-interactive dispatch)'"',
'',
'The dispatched prompt body may contain one structured marker block. Parse it before applying defaults. Grammar: see "'`auto_mode_contract.md` §2.'"',
'',
'"'```yaml'"',
'PRE-BOUND SETUP ANSWERS:',
'  feature_description: Add passwordless login  # string',
'  spec_folder: .opencode/specs/103-example/001-passwordless-login/  # existing | new | update-related | skip | phase-folder | explicit path',
'  execution_mode: AUTONOMOUS  # from :auto suffix',
'  dispatch_mode: single_agent  # single_agent | multi_small | multi_large',
'  memory_choice: skip  # latest | recent3 | skip | n/a',
'  research_intent: add_feature  # add_feature | fix_bug | refactor | understand',
'  research_integration: false  # boolean, true when :with-research present',
'  phase_decomposition: false  # boolean, true when :with-phases present',
'  phase_count: 3  # positive integer',
'  phase_names: \"\"  # optional comma-separated names',
'  phase_folder: \"\"  # optional explicit phase child path',
'  selected_level: \"\"  # optional intake level: 1 | 2 | 3 | 3+',
'  start_state: \"\"  # optional intake folder state',
'  repair_mode: \"\"  # optional intake repair mode',
'  record_relationships: false  # boolean',
'  depends_on: \"\"  # optional comma-separated packet ids',
'  related_to: \"\"  # optional comma-separated packet ids',
'  supersedes: \"\"  # optional comma-separated packet ids',
'"'```'"',
'',
'Rules: see "'`auto_mode_contract.md` §2 (unspecified fields fall back to default; marker fields take precedence over `$ARGUMENTS` flags; unknown fields warn; malformed lines parse-error).'"',
'',
'### Default Resolution Table',
'',
'| Field | Required | Resolves Via | Default | Tier-2 Candidate |',
'|-------|----------|--------------|---------|------------------|',
'| "'`feature_description` | Y | `$ARGUMENTS` positional feature description, or marker `feature_description` | none | N |'"',
'| "'`spec_folder` | Y | flag `--phase-folder`, marker `spec_folder` / `phase_folder`, or targeted choice among existing/new/update-related/skip/phase folder | none | Y, when feature is present but folder choice is ambiguous |'"',
'| "'`execution_mode` | Y | attached suffix `:auto` or marker `execution_mode` | `AUTONOMOUS` under `:auto` | N |'"',
'| "'`dispatch_mode` | Y | marker `dispatch_mode` or default recommended option | `single_agent` | N |'"',
'| "'`memory_choice` | N | marker `memory_choice`, prior-work detection, or default | `skip` when no prior continuity records exist | N |'"',
'| "'`research_intent` | Y | marker `research_intent` or targeted classification question | none | Y |'"',
'| "'`research_integration` | N | suffix `:with-research`, marker `research_integration`, or default | `false` | N |'"',
'| "'`phase_decomposition` | Y | suffix `:with-phases`, marker `phase_decomposition`, or default | `false` | N |'"',
'| "'`phase_count` | N | flag `--phases`, marker `phase_count`, or default | `3` | N |'"',
'| "'`phase_names` | N | flag `--phase-names`, marker `phase_names`, or auto-generate | none | N |'"',
'| "'`phase_folder` | N | flag `--phase-folder`, marker `phase_folder`, or default | none | N |'"',
'| "'`selected_level` | N | marker `selected_level` or inline intake contract when required | none | N |'"',
'| "'`start_state` | N | marker `start_state`, folder-state classification, or inline intake contract when required | auto-detect | N |'"',
'| "'`repair_mode` | N | marker `repair_mode` or inline intake contract when required | none | N |'"',
'| "'`record_relationships` | N | marker `record_relationships` or inline intake contract when required | `false` | N |'"',
'| "'`depends_on` | N | marker `depends_on` or inline intake relationship capture | none | N |'"',
'| "'`related_to` | N | marker `related_to` or inline intake relationship capture | none | N |'"',
'| "'`supersedes` | N | marker `supersedes` or inline intake relationship capture | none | N |'"',
'']);
sections.implement = block([
'For "'`:auto`, do not emit the consolidated prompt by default. Resolve setup with the three-tier branch below, then load the auto YAML only after all required values are bound.'"',
'',
'### "'`:auto` Setup Resolution'"',
'',
'Setup contract: see "'`.opencode/skills/system-spec-kit/references/workflows/auto_mode_contract.md`.'"',
'',
'Under "'`execution_mode = AUTONOMOUS` (from the `:auto` suffix), follow the three-tier flow:'"',
'',
'1. **Tier 1 — Resolve confidently** (contract §1): parse "'`$ARGUMENTS` flags + `PRE-BOUND SETUP ANSWERS:` block (§2) + the Default Resolution Table below (§3). When every required field is resolved, persist to `{spec_path}/implement-config.json` (shape: `specPath`, `executionMode: "auto"`, `dispatchMode`, `memoryChoice`, `confirmChoice`, `resumeChoice`, `prerequisitesValid`), bind runtime YAML placeholders, set `STATUS: PASSED`, load `.opencode/commands/spec_kit/assets/spec_kit_implement_auto.yaml`. End §0.'"',
'',
'2. **Tier 2 — Targeted ask** (contract §1): when 1-2 required fields are genuinely ambiguous AND no default exists, emit ONE narrow question per ambiguous field. Command-specific Tier-2-eligible fields (per the Default Resolution Table below): "'`spec_folder`, `resume_choice`. **Ordering rule**: ask only for `spec_folder` first when folder detection is ambiguous — prerequisite and resume-session checks depend on it. Missing `spec_folder` with no viable candidates is absence, not ambiguity — go to Tier 3.'"',
'',
'3. **Tier 3 — Fail fast** (contract §4): emit the named-missing-inputs error format with "'`/spec_kit:implement:auto` as the command name. Exit non-zero. Do not load YAML.'"',
'',
'"'`:confirm` path stays unchanged — see the consolidated setup prompt section below.'"',
'',
'### PRE-BOUND SETUP ANSWERS Schema (for "'`:auto` non-interactive dispatch)'"',
'',
'The dispatched prompt body may contain one structured marker block. Parse it before applying defaults. Grammar: see "'`auto_mode_contract.md` §2.'"',
'',
'"'```yaml'"',
'PRE-BOUND SETUP ANSWERS:',
'  spec_folder: .opencode/specs/103-example/001-passwordless-login/  # explicit spec or phase folder path',
'  phase_folder: \"\"  # optional explicit phase child path',
'  confirm_choice: yes  # yes | different-folder | cancel',
'  execution_mode: AUTONOMOUS  # from :auto suffix',
'  dispatch_mode: single_agent  # single_agent | multi_small | multi_large',
'  memory_choice: skip  # latest | recent3 | skip | n/a',
'  resume_choice: resume  # resume | restart | cancel, only when prior incomplete session exists',
'  prerequisites_valid: true  # auto-detected boolean',
'"'```'"',
'',
'Rules: see "'`auto_mode_contract.md` §2 (unspecified fields fall back to default; marker fields take precedence over `$ARGUMENTS` flags; unknown fields warn; malformed lines parse-error).'"',
'',
'### Default Resolution Table',
'',
'| Field | Required | Resolves Via | Default | Tier-2 Candidate |',
'|-------|----------|--------------|---------|------------------|',
'| "'`spec_folder` | Y | `$ARGUMENTS` positional path, flag `--phase-folder`, marker `spec_folder` / `phase_folder`, or deterministic single-folder detection | none | Y, when detection returns multiple viable folders |'"',
'| "'`phase_folder` | N | flag `--phase-folder`, marker `phase_folder`, or auto-detect phase child from `spec_folder` | none | N |'"',
'| "'`confirm_choice` | Y | marker `confirm_choice` or default after prerequisite validation | `yes` when prerequisites are valid | N |'"',
'| "'`execution_mode` | Y | attached suffix `:auto` or marker `execution_mode` | `AUTONOMOUS` under `:auto` | N |'"',
'| "'`dispatch_mode` | Y | marker `dispatch_mode` or default recommended option | `single_agent` | N |'"',
'| "'`memory_choice` | N | marker `memory_choice`, prior-continuity detection, or default | `skip` when no prior continuity records exist | N |'"',
'| "'`resume_choice` | N | marker `resume_choice` or targeted question when prior incomplete session exists | none | Y, only when an incomplete-session warning is present |'"',
'| "'`prerequisites_valid` | Y | auto-detect from `spec.md`, `plan.md`, `tasks.md`, and Level 2+ `checklist.md`; marker may only document expected state | auto-detect | N |'"',
'']);
sections.plan = block([
'For "'`:auto`, do not emit the consolidated prompt by default. Resolve setup with the three-tier branch below, then load the auto YAML only after all required values are bound.'"',
'',
'### "'`:auto` Setup Resolution'"',
'',
'Setup contract: see "'`.opencode/skills/system-spec-kit/references/workflows/auto_mode_contract.md`.'"',
'',
'Under "'`execution_mode = AUTONOMOUS` (from the `:auto` suffix), follow the three-tier flow:'"',
'',
'1. **Tier 1 — Resolve confidently** (contract §1): parse "'`$ARGUMENTS` flags + `PRE-BOUND SETUP ANSWERS:` block (§2) + the Default Resolution Table below (§3). When every required field is resolved, persist to `{spec_path}/plan-config.json` (shape: `featureDescription`, `specPath`, `executionMode: "auto"`, `dispatchMode`, `memoryChoice`, `researchIntent`, `phaseDecomposition`, `phaseCount`, `phaseNames`, `intakeOnly`, `intake.*`), bind runtime YAML placeholders, set `STATUS: PASSED`, load `.opencode/commands/spec_kit/assets/spec_kit_plan_auto.yaml`. End §0.'"',
'',
'2. **Tier 2 — Targeted ask** (contract §1): when 1-2 required fields are genuinely ambiguous AND no default exists, emit ONE narrow question per ambiguous field. Command-specific Tier-2-eligible fields (per the Default Resolution Table below): "'`spec_folder`, `research_intent`. **Ordering rule**: none needed. Missing `feature_description` is absence, not ambiguity — go to Tier 3.'"',
'',
'3. **Tier 3 — Fail fast** (contract §4): emit the named-missing-inputs error format with "'`/spec_kit:plan:auto` as the command name. Exit non-zero. Do not load YAML.'"',
'',
'"'`:confirm` path stays unchanged — see the consolidated setup prompt section below.'"',
'',
'### PRE-BOUND SETUP ANSWERS Schema (for "'`:auto` non-interactive dispatch)'"',
'',
'The dispatched prompt body may contain one structured marker block. Parse it before applying defaults. Grammar: see "'`auto_mode_contract.md` §2.'"',
'',
'"'```yaml'"',
'PRE-BOUND SETUP ANSWERS:',
'  feature_description: Add passwordless login  # string',
'  spec_folder: .opencode/specs/103-example/001-passwordless-login/  # existing | new | update-related | skip | phase-folder | explicit path',
'  execution_mode: AUTONOMOUS  # from :auto suffix',
'  dispatch_mode: single_agent  # single_agent | multi_small | multi_large',
'  memory_choice: skip  # latest | recent3 | skip | n/a',
'  research_intent: add_feature  # add_feature | fix_bug | refactor | understand',
'  phase_decomposition: false  # boolean, true when :with-phases present',
'  phase_count: 3  # positive integer',
'  phase_names: \"\"  # optional comma-separated names',
'  phase_folder: \"\"  # optional explicit phase child path',
'  intake_only: false  # boolean, true when --intake-only present',
'  selected_level: \"\"  # optional intake level: 1 | 2 | 3 | 3+',
'  start_state: \"\"  # optional intake folder state',
'  repair_mode: \"\"  # optional intake repair mode',
'  record_relationships: false  # boolean',
'  depends_on: \"\"  # optional comma-separated packet ids',
'  related_to: \"\"  # optional comma-separated packet ids',
'  supersedes: \"\"  # optional comma-separated packet ids',
'"'```'"',
'',
'Rules: see "'`auto_mode_contract.md` §2 (unspecified fields fall back to default; marker fields take precedence over `$ARGUMENTS` flags; unknown fields warn; malformed lines parse-error).'"',
'',
'### Default Resolution Table',
'',
'| Field | Required | Resolves Via | Default | Tier-2 Candidate |',
'|-------|----------|--------------|---------|------------------|',
'| "'`feature_description` | Y | `$ARGUMENTS` positional feature description, or marker `feature_description` | none | N |'"',
'| "'`spec_folder` | Y | flag `--spec-folder`, flag `--phase-folder`, marker `spec_folder` / `phase_folder`, or targeted choice among existing/new/update-related/skip/phase folder | none | Y, when feature is present but folder choice is ambiguous |'"',
'| "'`execution_mode` | Y | attached suffix `:auto` or marker `execution_mode` | `AUTONOMOUS` under `:auto` | N |'"',
'| "'`dispatch_mode` | Y | marker `dispatch_mode` or default recommended option | `single_agent` | N |'"',
'| "'`memory_choice` | N | marker `memory_choice`, prior-work detection, or default | `skip` when no prior continuity records exist | N |'"',
'| "'`research_intent` | Y | marker `research_intent` or targeted classification question | none | Y |'"',
'| "'`phase_decomposition` | Y | suffix `:with-phases`, marker `phase_decomposition`, or default | `false` | N |'"',
'| "'`phase_count` | N | flag `--phases`, marker `phase_count`, or default | `3` | N |'"',
'| "'`phase_names` | N | flag `--phase-names`, marker `phase_names`, or auto-generate | none | N |'"',
'| "'`phase_folder` | N | flag `--phase-folder`, marker `phase_folder`, or default | none | N |'"',
'| "'`intake_only` | N | flag `--intake-only`, marker `intake_only`, or default | `false` | N |'"',
'| "'`selected_level` | N | flag `--level`, marker `selected_level`, or inline intake contract when required | none | N |'"',
'| "'`start_state` | N | flag `--start-state`, marker `start_state`, folder-state classification, or inline intake contract when required | auto-detect | N |'"',
'| "'`repair_mode` | N | flag `--repair-mode`, marker `repair_mode`, or inline intake contract when required | none | N |'"',
'| "'`record_relationships` | N | flag `--record-relationships`, marker `record_relationships`, or inline intake contract when required | `false` | N |'"',
'| "'`depends_on` | N | flag `--depends-on`, marker `depends_on`, or inline intake relationship capture | none | N |'"',
'| "'`related_to` | N | flag `--related-to`, marker `related_to`, or inline intake relationship capture | none | N |'"',
'| "'`supersedes` | N | flag `--supersedes`, marker `supersedes`, or inline intake relationship capture | none | N |'"',
'']);
sections.resume = block([
'For "'`:auto`, do not emit the consolidated prompt by default. Resolve setup with the three-tier branch below, then load the auto YAML only after all required values are bound.'"',
'',
'### "'`:auto` Setup Resolution'"',
'',
'Setup contract: see "'`.opencode/skills/system-spec-kit/references/workflows/auto_mode_contract.md`.'"',
'',
'Under "'`execution_mode = AUTONOMOUS` (from the `:auto` suffix), follow the three-tier flow:'"',
'',
'1. **Tier 1 — Resolve confidently** (contract §1): parse "'`$ARGUMENTS` flags + `PRE-BOUND SETUP ANSWERS:` block (§2) + the Default Resolution Table below (§3). When every required field is resolved, persist to `{spec_path}/resume-config.json` (shape: `specPath`, `detectionMethod`, `executionMode: "auto"`, `continuationChoice`, `artifactRecoveryChoice`, `memoryChoice`, `artifactsValid`, `continuitySourcesAvailable`), bind runtime YAML placeholders, set `STATUS: PASSED`, load `.opencode/commands/spec_kit/assets/spec_kit_resume_auto.yaml`. End §0.'"',
'',
'2. **Tier 2 — Targeted ask** (contract §1): when 1-2 required fields are genuinely ambiguous AND no default exists, emit ONE narrow question per ambiguous field. Command-specific Tier-2-eligible fields (per the Default Resolution Table below): "'`spec_folder`, `continuation_choice`. **Ordering rule**: ask only for `spec_folder` first when detection is ambiguous — continuation validation depends on it. Missing `spec_folder` with no viable candidates is absence, not ambiguity — go to Tier 3.'"',
'',
'3. **Tier 3 — Fail fast** (contract §4): emit the named-missing-inputs error format with "'`/spec_kit:resume:auto` as the command name. Exit non-zero. Do not load YAML.'"',
'',
'"'`:confirm` path stays unchanged — see the consolidated setup prompt section below.'"',
'',
'### PRE-BOUND SETUP ANSWERS Schema (for "'`:auto` non-interactive dispatch)'"',
'',
'The dispatched prompt body may contain one structured marker block. Parse it before applying defaults. Grammar: see "'`auto_mode_contract.md` §2.'"',
'',
'"'```yaml'"',
'PRE-BOUND SETUP ANSWERS:',
'  spec_folder: .opencode/specs/103-example/001-passwordless-login/  # explicit spec or phase folder path',
'  phase_folder: \"\"  # optional explicit phase child path',
'  no_redirect: false  # boolean',
'  detection_method: provided  # provided | phase-folder | ranked | none',
'  execution_mode: AUTONOMOUS  # from :auto suffix',
'  continuation_choice: indexed-continuity  # handoff | indexed-continuity | investigate',
'  artifact_recovery_choice: continue_anyway  # plan | select-different | continue_anyway',
'  memory_choice: fast  # fast | fill-gaps | deeper-mcp | canonical-only',
'  artifacts_valid: true  # auto-detected: yes | partial | no',
'  continuity_sources_available: yes  # auto-detected: yes | partial | no',
'"'```'"',
'',
'Rules: see "'`auto_mode_contract.md` §2 (unspecified fields fall back to default; marker fields take precedence over `$ARGUMENTS` flags; unknown fields warn; malformed lines parse-error).'"',
'',
'### Default Resolution Table',
'',
'| Field | Required | Resolves Via | Default | Tier-2 Candidate |',
'|-------|----------|--------------|---------|------------------|',
'| "'`spec_folder` | Y | `$ARGUMENTS` positional path, flag `--phase-folder`, marker `spec_folder` / `phase_folder`, or deterministic ranked detection | none | Y, when detection returns multiple viable folders |'"',
'| "'`phase_folder` | N | flag `--phase-folder`, marker `phase_folder`, or phase-parent redirect | none | N |'"',
'| "'`no_redirect` | N | flag `--no-redirect`, marker `no_redirect`, or default | `false` | N |'"',
'| "'`detection_method` | Y | auto-detect from provided path / phase-folder / ranked candidates, or marker `detection_method` | auto-detect | N |'"',
'| "'`execution_mode` | Y | attached suffix `:auto` or marker `execution_mode` | `AUTONOMOUS` under `:auto` | N |'"',
'| "'`continuation_choice` | N | marker `continuation_choice` or targeted question when handoff and indexed continuity disagree | none | Y, only when a handoff mismatch is present |'"',
'| "'`artifact_recovery_choice` | N | marker `artifact_recovery_choice`, artifact validation result, or default | `continue_anyway` under resume auto mode | N |'"',
'| "'`memory_choice` | N | marker `memory_choice`, canonical packet thickness check, or default | `fast` | N |'"',
'| "'`artifacts_valid` | Y | auto-detect from `spec.md`, `plan.md`, and `tasks.md`; marker may only document expected state | auto-detect | N |'"',
'| "'`continuity_sources_available` | N | auto-detect from `handover.md`, `_memory.continuity`, spec docs, and graph metadata; marker may only document expected state | auto-detect | N |'"',
'']);
for (const [name, rel] of Object.entries(files)) {
  const p = "'`${root}/${rel}`;
  let s = fs.readFileSync(p, '"'utf8');
  s = updateHint(s);
  s = replaceFirstProtocol(s);
  if (s.includes('### "'`:auto` Setup Resolution'"')) {
    throw new Error("'`${name} already has auto setup section`);
  }
  const marker = '"'**STATUS: BLOCKED**\\n';
  const idx = s.indexOf(marker);
  if (idx < 0) throw new Error("'`${name}: missing status marker`);
  s = s.slice(0, idx) + sections[name] + s.slice(idx);
  fs.writeFileSync(p, s);
}
NODE' in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
codex
The command files now have the shared-contract sections inserted ahead of the legacy prompt. I’m doing a read-back pass before touching the task/evidence files, especially checking that the `STATUS: BLOCKED` fenced blocks hash exactly the same as before.
exec
/bin/zsh -lc 'rg -n "argument-hint:|auto_mode_contract|PRE-BOUND SETUP ANSWERS|Default Resolution Table|Tier 2 — Targeted ask" .opencode/commands/spec_kit/{deep-research,complete,implement,plan,resume}.md' in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
.opencode/commands/spec_kit/complete.md:3:argument-hint: "<feature-description> [:auto|:confirm] [:with-research] [:with-phases] [--phases N] [--phase-names list] [--phase-folder=<path>] (:auto supports PRE-BOUND SETUP ANSWERS: prompt-body block for non-interactive setup)"
.opencode/commands/spec_kit/complete.md:47:Setup contract: see `.opencode/skills/system-spec-kit/references/workflows/auto_mode_contract.md`.
.opencode/commands/spec_kit/complete.md:51:1. **Tier 1 — Resolve confidently** (contract §1): parse `$ARGUMENTS` flags + `PRE-BOUND SETUP ANSWERS:` block (§2) + the Default Resolution Table below (§3). When every required field is resolved, persist to `{spec_path}/complete-config.json` (shape: `featureDescription`, `specPath`, `executionMode: "auto"`, `dispatchMode`, `memoryChoice`, `researchIntent`, `researchIntegration`, `phaseDecomposition`, `phaseCount`, `phaseNames`, `intake.*`), bind runtime YAML placeholders, set `STATUS: PASSED`, load `.opencode/commands/spec_kit/assets/spec_kit_complete_auto.yaml`. End §0.
.opencode/commands/spec_kit/complete.md:53:2. **Tier 2 — Targeted ask** (contract §1): when 1-2 required fields are genuinely ambiguous AND no default exists, emit ONE narrow question per ambiguous field. Command-specific Tier-2-eligible fields (per the Default Resolution Table below): `spec_folder`, `research_intent`. **Ordering rule**: none needed. Missing `feature_description` is absence, not ambiguity — go to Tier 3.
.opencode/commands/spec_kit/complete.md:59:### PRE-BOUND SETUP ANSWERS Schema (for `:auto` non-interactive dispatch)
.opencode/commands/spec_kit/complete.md:61:The dispatched prompt body may contain one structured marker block. Parse it before applying defaults. Grammar: see `auto_mode_contract.md` §2.
.opencode/commands/spec_kit/complete.md:64:PRE-BOUND SETUP ANSWERS:
.opencode/commands/spec_kit/complete.md:85:Rules: see `auto_mode_contract.md` §2 (unspecified fields fall back to default; marker fields take precedence over `$ARGUMENTS` flags; unknown fields warn; malformed lines parse-error).
.opencode/commands/spec_kit/complete.md:87:### Default Resolution Table
.opencode/commands/spec_kit/resume.md:3:argument-hint: "[spec-folder-path] [:auto|:confirm] [--phase-folder=<path>] (:auto supports PRE-BOUND SETUP ANSWERS: prompt-body block for non-interactive setup)"
.opencode/commands/spec_kit/resume.md:45:Setup contract: see `.opencode/skills/system-spec-kit/references/workflows/auto_mode_contract.md`.
.opencode/commands/spec_kit/resume.md:49:1. **Tier 1 — Resolve confidently** (contract §1): parse `$ARGUMENTS` flags + `PRE-BOUND SETUP ANSWERS:` block (§2) + the Default Resolution Table below (§3). When every required field is resolved, persist to `{spec_path}/resume-config.json` (shape: `specPath`, `detectionMethod`, `executionMode: "auto"`, `continuationChoice`, `artifactRecoveryChoice`, `memoryChoice`, `artifactsValid`, `continuitySourcesAvailable`), bind runtime YAML placeholders, set `STATUS: PASSED`, load `.opencode/commands/spec_kit/assets/spec_kit_resume_auto.yaml`. End §0.
.opencode/commands/spec_kit/resume.md:51:2. **Tier 2 — Targeted ask** (contract §1): when 1-2 required fields are genuinely ambiguous AND no default exists, emit ONE narrow question per ambiguous field. Command-specific Tier-2-eligible fields (per the Default Resolution Table below): `spec_folder`, `continuation_choice`. **Ordering rule**: ask only for `spec_folder` first when detection is ambiguous — continuation validation depends on it. Missing `spec_folder` with no viable candidates is absence, not ambiguity — go to Tier 3.
.opencode/commands/spec_kit/resume.md:57:### PRE-BOUND SETUP ANSWERS Schema (for `:auto` non-interactive dispatch)
.opencode/commands/spec_kit/resume.md:59:The dispatched prompt body may contain one structured marker block. Parse it before applying defaults. Grammar: see `auto_mode_contract.md` §2.
.opencode/commands/spec_kit/resume.md:62:PRE-BOUND SETUP ANSWERS:
.opencode/commands/spec_kit/resume.md:75:Rules: see `auto_mode_contract.md` §2 (unspecified fields fall back to default; marker fields take precedence over `$ARGUMENTS` flags; unknown fields warn; malformed lines parse-error).
.opencode/commands/spec_kit/resume.md:77:### Default Resolution Table
.opencode/commands/spec_kit/implement.md:3:argument-hint: "<spec-folder> [:auto|:confirm] [--phase-folder=<path>] (:auto supports PRE-BOUND SETUP ANSWERS: prompt-body block for non-interactive setup)"
.opencode/commands/spec_kit/implement.md:42:Setup contract: see `.opencode/skills/system-spec-kit/references/workflows/auto_mode_contract.md`.
.opencode/commands/spec_kit/implement.md:46:1. **Tier 1 — Resolve confidently** (contract §1): parse `$ARGUMENTS` flags + `PRE-BOUND SETUP ANSWERS:` block (§2) + the Default Resolution Table below (§3). When every required field is resolved, persist to `{spec_path}/implement-config.json` (shape: `specPath`, `executionMode: "auto"`, `dispatchMode`, `memoryChoice`, `confirmChoice`, `resumeChoice`, `prerequisitesValid`), bind runtime YAML placeholders, set `STATUS: PASSED`, load `.opencode/commands/spec_kit/assets/spec_kit_implement_auto.yaml`. End §0.
.opencode/commands/spec_kit/implement.md:48:2. **Tier 2 — Targeted ask** (contract §1): when 1-2 required fields are genuinely ambiguous AND no default exists, emit ONE narrow question per ambiguous field. Command-specific Tier-2-eligible fields (per the Default Resolution Table below): `spec_folder`, `resume_choice`. **Ordering rule**: ask only for `spec_folder` first when folder detection is ambiguous — prerequisite and resume-session checks depend on it. Missing `spec_folder` with no viable candidates is absence, not ambiguity — go to Tier 3.
.opencode/commands/spec_kit/implement.md:54:### PRE-BOUND SETUP ANSWERS Schema (for `:auto` non-interactive dispatch)
.opencode/commands/spec_kit/implement.md:56:The dispatched prompt body may contain one structured marker block. Parse it before applying defaults. Grammar: see `auto_mode_contract.md` §2.
.opencode/commands/spec_kit/implement.md:59:PRE-BOUND SETUP ANSWERS:
.opencode/commands/spec_kit/implement.md:70:Rules: see `auto_mode_contract.md` §2 (unspecified fields fall back to default; marker fields take precedence over `$ARGUMENTS` flags; unknown fields warn; malformed lines parse-error).
.opencode/commands/spec_kit/implement.md:72:### Default Resolution Table
.opencode/commands/spec_kit/plan.md:3:argument-hint: "<feature-description> [:auto|:confirm] [:with-phases] [--intake-only] [--phases N] [--phase-names list] [--phase-folder=<path>] [--spec-folder=PATH] [--level=1|2|3|3+] [--start-state=STATE] [--repair-mode=MODE] [--record-relationships=yes|no] [--depends-on=IDs] [--related-to=IDs] [--supersedes=IDs] (:auto supports PRE-BOUND SETUP ANSWERS: prompt-body block for non-interactive setup)"
.opencode/commands/spec_kit/plan.md:46:Setup contract: see `.opencode/skills/system-spec-kit/references/workflows/auto_mode_contract.md`.
.opencode/commands/spec_kit/plan.md:50:1. **Tier 1 — Resolve confidently** (contract §1): parse `$ARGUMENTS` flags + `PRE-BOUND SETUP ANSWERS:` block (§2) + the Default Resolution Table below (§3). When every required field is resolved, persist to `{spec_path}/plan-config.json` (shape: `featureDescription`, `specPath`, `executionMode: "auto"`, `dispatchMode`, `memoryChoice`, `researchIntent`, `phaseDecomposition`, `phaseCount`, `phaseNames`, `intakeOnly`, `intake.*`), bind runtime YAML placeholders, set `STATUS: PASSED`, load `.opencode/commands/spec_kit/assets/spec_kit_plan_auto.yaml`. End §0.
.opencode/commands/spec_kit/plan.md:52:2. **Tier 2 — Targeted ask** (contract §1): when 1-2 required fields are genuinely ambiguous AND no default exists, emit ONE narrow question per ambiguous field. Command-specific Tier-2-eligible fields (per the Default Resolution Table below): `spec_folder`, `research_intent`. **Ordering rule**: none needed. Missing `feature_description` is absence, not ambiguity — go to Tier 3.
.opencode/commands/spec_kit/plan.md:58:### PRE-BOUND SETUP ANSWERS Schema (for `:auto` non-interactive dispatch)
.opencode/commands/spec_kit/plan.md:60:The dispatched prompt body may contain one structured marker block. Parse it before applying defaults. Grammar: see `auto_mode_contract.md` §2.
.opencode/commands/spec_kit/plan.md:63:PRE-BOUND SETUP ANSWERS:
.opencode/commands/spec_kit/plan.md:84:Rules: see `auto_mode_contract.md` §2 (unspecified fields fall back to default; marker fields take precedence over `$ARGUMENTS` flags; unknown fields warn; malformed lines parse-error).
.opencode/commands/spec_kit/plan.md:86:### Default Resolution Table
.opencode/commands/spec_kit/deep-research.md:3:argument-hint: "<topic> [:auto|:confirm] [--max-iterations=N] [--convergence=N] (:auto supports PRE-BOUND SETUP ANSWERS: prompt-body block for non-interactive setup)"
.opencode/commands/spec_kit/deep-research.md:54:Setup contract: see `.opencode/skills/system-spec-kit/references/workflows/auto_mode_contract.md`.
.opencode/commands/spec_kit/deep-research.md:58:1. **Tier 1 — Resolve confidently** (contract §1): parse `$ARGUMENTS` flags + `PRE-BOUND SETUP ANSWERS:` block (§2) + the Default Resolution Table below (§3). When every required field is resolved, persist to `{artifact_dir}/deep-research-config.json` (shape: `researchTopic`, `specFolder`, `maxIterations`, `convergenceThreshold`, `executionMode: "auto"`, `resource_map.emit`, `config.executor.*`), bind runtime YAML placeholders, set `STATUS: PASSED`, load `.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml`. End §0.
.opencode/commands/spec_kit/deep-research.md:60:2. **Tier 2 — Targeted ask** (contract §1): when 1-2 required fields are genuinely ambiguous AND no default exists, emit ONE narrow question per ambiguous field. Command-specific Tier-2-eligible fields (per the Default Resolution Table below): `spec_folder`. **Ordering rule**: none needed. Missing `research_topic` is absence, not ambiguity — go to Tier 3.
.opencode/commands/spec_kit/deep-research.md:66:### PRE-BOUND SETUP ANSWERS Schema (for `:auto` non-interactive dispatch)
.opencode/commands/spec_kit/deep-research.md:68:The dispatched prompt body may contain one structured marker block. Parse it before applying defaults. Grammar: see `auto_mode_contract.md` §2.
.opencode/commands/spec_kit/deep-research.md:71:PRE-BOUND SETUP ANSWERS:
.opencode/commands/spec_kit/deep-research.md:85:Rules: see `auto_mode_contract.md` §2 (unspecified fields fall back to default; marker fields take precedence over `$ARGUMENTS` flags; unknown fields warn; malformed lines parse-error).
.opencode/commands/spec_kit/deep-research.md:87:### Default Resolution Table

exec
/bin/zsh -lc "git diff -- .opencode/commands/spec_kit/deep-research.md .opencode/commands/spec_kit/complete.md .opencode/commands/spec_kit/implement.md .opencode/commands/spec_kit/plan.md .opencode/commands/spec_kit/resume.md | sed -n '1,260p'" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
diff --git a/.opencode/commands/spec_kit/complete.md b/.opencode/commands/spec_kit/complete.md
index 1f9373c1dc..f984189f40 100644
--- a/.opencode/commands/spec_kit/complete.md
+++ b/.opencode/commands/spec_kit/complete.md
@@ -1,6 +1,6 @@
 ---
 description: End-to-end SpecKit workflow (14+ steps). Modes: :auto, :confirm, :with-research, :with-phases.
-argument-hint: "<feature-description> [:auto|:confirm] [:with-research] [:with-phases] [--phases N] [--phase-names list] [--phase-folder=<path>]"
+argument-hint: "<feature-description> [:auto|:confirm] [:with-research] [:with-phases] [--phases N] [--phase-names list] [--phase-folder=<path>] (:auto supports PRE-BOUND SETUP ANSWERS: prompt-body block for non-interactive setup)"
 allowed-tools: Read, Write, Edit, Bash, Grep, Glob, Task, memory_context, spec_kit_memory_memory_save, spec_kit_memory_memory_index_scan, mcp__cocoindex_code__search
 ---
 
@@ -36,10 +36,77 @@ This workflow gathers ALL inputs in ONE prompt. Round-trip: 1 user interaction.
 
 ## 0. UNIFIED SETUP PHASE
 
-**FIRST MESSAGE PROTOCOL**: This prompt MUST be your FIRST response. No analysis, no tool calls — ask ALL questions immediately, then wait.
+**FIRST MESSAGE PROTOCOL**: For `:confirm` or no suffix, the consolidated setup prompt MUST be your FIRST response. No analysis, no tool calls — ask ALL questions immediately, then wait.
 
 Read-only discovery to classify folder state is allowed when `spec_path` is explicit or can be inferred from the setup answers. Healthy folders keep the existing prompt shape; non-healthy folders run the intake contract (`.opencode/skills/system-spec-kit/references/intake-contract.md`) inline inside the same consolidated prompt and MUST NOT open a second visible command flow.
 
+For `:auto`, do not emit the consolidated prompt by default. Resolve setup with the three-tier branch below, then load the auto YAML only after all required values are bound.
+
+### `:auto` Setup Resolution
+
+Setup contract: see `.opencode/skills/system-spec-kit/references/workflows/auto_mode_contract.md`.
+
+Under `execution_mode = AUTONOMOUS` (from the `:auto` suffix), follow the three-tier flow:
+
+1. **Tier 1 — Resolve confidently** (contract §1): parse `$ARGUMENTS` flags + `PRE-BOUND SETUP ANSWERS:` block (§2) + the Default Resolution Table below (§3). When every required field is resolved, persist to `{spec_path}/complete-config.json` (shape: `featureDescription`, `specPath`, `executionMode: "auto"`, `dispatchMode`, `memoryChoice`, `researchIntent`, `researchIntegration`, `phaseDecomposition`, `phaseCount`, `phaseNames`, `intake.*`), bind runtime YAML placeholders, set `STATUS: PASSED`, load `.opencode/commands/spec_kit/assets/spec_kit_complete_auto.yaml`. End §0.
+
+2. **Tier 2 — Targeted ask** (contract §1): when 1-2 required fields are genuinely ambiguous AND no default exists, emit ONE narrow question per ambiguous field. Command-specific Tier-2-eligible fields (per the Default Resolution Table below): `spec_folder`, `research_intent`. **Ordering rule**: none needed. Missing `feature_description` is absence, not ambiguity — go to Tier 3.
+
+3. **Tier 3 — Fail fast** (contract §4): emit the named-missing-inputs error format with `/spec_kit:complete:auto` as the command name. Exit non-zero. Do not load YAML.
+
+`:confirm` path stays unchanged — see the consolidated setup prompt section below.
+
+### PRE-BOUND SETUP ANSWERS Schema (for `:auto` non-interactive dispatch)
+
+The dispatched prompt body may contain one structured marker block. Parse it before applying defaults. Grammar: see `auto_mode_contract.md` §2.
+
+```yaml
+PRE-BOUND SETUP ANSWERS:
+  feature_description: Add passwordless login  # string
+  spec_folder: .opencode/specs/103-example/001-passwordless-login/  # existing | new | update-related | skip | phase-folder | explicit path
+  execution_mode: AUTONOMOUS  # from :auto suffix
+  dispatch_mode: single_agent  # single_agent | multi_small | multi_large
+  memory_choice: skip  # latest | recent3 | skip | n/a
+  research_intent: add_feature  # add_feature | fix_bug | refactor | understand
+  research_integration: false  # boolean, true when :with-research present
+  phase_decomposition: false  # boolean, true when :with-phases present
+  phase_count: 3  # positive integer
+  phase_names: ""  # optional comma-separated names
+  phase_folder: ""  # optional explicit phase child path
+  selected_level: ""  # optional intake level: 1 | 2 | 3 | 3+
+  start_state: ""  # optional intake folder state
+  repair_mode: ""  # optional intake repair mode
+  record_relationships: false  # boolean
+  depends_on: ""  # optional comma-separated packet ids
+  related_to: ""  # optional comma-separated packet ids
+  supersedes: ""  # optional comma-separated packet ids
+```
+
+Rules: see `auto_mode_contract.md` §2 (unspecified fields fall back to default; marker fields take precedence over `$ARGUMENTS` flags; unknown fields warn; malformed lines parse-error).
+
+### Default Resolution Table
+
+| Field | Required | Resolves Via | Default | Tier-2 Candidate |
+|-------|----------|--------------|---------|------------------|
+| `feature_description` | Y | `$ARGUMENTS` positional feature description, or marker `feature_description` | none | N |
+| `spec_folder` | Y | flag `--phase-folder`, marker `spec_folder` / `phase_folder`, or targeted choice among existing/new/update-related/skip/phase folder | none | Y, when feature is present but folder choice is ambiguous |
+| `execution_mode` | Y | attached suffix `:auto` or marker `execution_mode` | `AUTONOMOUS` under `:auto` | N |
+| `dispatch_mode` | Y | marker `dispatch_mode` or default recommended option | `single_agent` | N |
+| `memory_choice` | N | marker `memory_choice`, prior-work detection, or default | `skip` when no prior continuity records exist | N |
+| `research_intent` | Y | marker `research_intent` or targeted classification question | none | Y |
+| `research_integration` | N | suffix `:with-research`, marker `research_integration`, or default | `false` | N |
+| `phase_decomposition` | Y | suffix `:with-phases`, marker `phase_decomposition`, or default | `false` | N |
+| `phase_count` | N | flag `--phases`, marker `phase_count`, or default | `3` | N |
+| `phase_names` | N | flag `--phase-names`, marker `phase_names`, or auto-generate | none | N |
+| `phase_folder` | N | flag `--phase-folder`, marker `phase_folder`, or default | none | N |
+| `selected_level` | N | marker `selected_level` or inline intake contract when required | none | N |
+| `start_state` | N | marker `start_state`, folder-state classification, or inline intake contract when required | auto-detect | N |
+| `repair_mode` | N | marker `repair_mode` or inline intake contract when required | none | N |
+| `record_relationships` | N | marker `record_relationships` or inline intake contract when required | `false` | N |
+| `depends_on` | N | marker `depends_on` or inline intake relationship capture | none | N |
+| `related_to` | N | marker `related_to` or inline intake relationship capture | none | N |
+| `supersedes` | N | marker `supersedes` or inline intake relationship capture | none | N |
+
 **STATUS: BLOCKED**
 
 ```
diff --git a/.opencode/commands/spec_kit/deep-research.md b/.opencode/commands/spec_kit/deep-research.md
index 88f709fa4e..2a54a33edb 100644
--- a/.opencode/commands/spec_kit/deep-research.md
+++ b/.opencode/commands/spec_kit/deep-research.md
@@ -1,6 +1,6 @@
 ---
 description: Autonomous deep-research loop: iterative investigation with convergence detection. Modes :auto, :confirm.
-argument-hint: "<topic> [:auto|:confirm] [--max-iterations=N] [--convergence=N]"
+argument-hint: "<topic> [:auto|:confirm] [--max-iterations=N] [--convergence=N] (:auto supports PRE-BOUND SETUP ANSWERS: prompt-body block for non-interactive setup)"
 allowed-tools: Read, Write, Edit, Bash, Grep, Glob, Task, WebFetch, memory_context, memory_search, mcp__cocoindex_code__search, code_graph_query, code_graph_context
 ---
 
@@ -45,7 +45,60 @@ This workflow gathers all setup inputs in one prompt. Confirm mode still include
 
 ## 0. UNIFIED SETUP PHASE
 
-**FIRST MESSAGE PROTOCOL**: This prompt MUST be your FIRST response. No implementation or file-modifying tool calls before asking. Lightweight read-only discovery to suggest a spec folder or load prior context is allowed, then ask ALL questions immediately and wait.
+**FIRST MESSAGE PROTOCOL**: For `:confirm` or no suffix, the consolidated setup prompt MUST be your FIRST response. No implementation or file-modifying tool calls before asking. Lightweight read-only discovery to suggest a spec folder or load prior context is allowed, then ask ALL questions immediately and wait.
+
+For `:auto`, do not emit the consolidated prompt by default. Resolve setup with the three-tier branch below, then load the auto YAML only after all required values are bound.
+
+### `:auto` Setup Resolution
+
+Setup contract: see `.opencode/skills/system-spec-kit/references/workflows/auto_mode_contract.md`.
+
+Under `execution_mode = AUTONOMOUS` (from the `:auto` suffix), follow the three-tier flow:
+
+1. **Tier 1 — Resolve confidently** (contract §1): parse `$ARGUMENTS` flags + `PRE-BOUND SETUP ANSWERS:` block (§2) + the Default Resolution Table below (§3). When every required field is resolved, persist to `{artifact_dir}/deep-research-config.json` (shape: `researchTopic`, `specFolder`, `maxIterations`, `convergenceThreshold`, `executionMode: "auto"`, `resource_map.emit`, `config.executor.*`), bind runtime YAML placeholders, set `STATUS: PASSED`, load `.opencode/commands/spec_kit/assets/spec_kit_deep-research_auto.yaml`. End §0.
+
+2. **Tier 2 — Targeted ask** (contract §1): when 1-2 required fields are genuinely ambiguous AND no default exists, emit ONE narrow question per ambiguous field. Command-specific Tier-2-eligible fields (per the Default Resolution Table below): `spec_folder`. **Ordering rule**: none needed. Missing `research_topic` is absence, not ambiguity — go to Tier 3.
+
+3. **Tier 3 — Fail fast** (contract §4): emit the named-missing-inputs error format with `/spec_kit:deep-research:auto` as the command name. Exit non-zero. Do not load YAML.
+
+`:confirm` path stays unchanged — see the consolidated setup prompt section below.
+
+### PRE-BOUND SETUP ANSWERS Schema (for `:auto` non-interactive dispatch)
+
+The dispatched prompt body may contain one structured marker block. Parse it before applying defaults. Grammar: see `auto_mode_contract.md` §2.
+
+```yaml
+PRE-BOUND SETUP ANSWERS:
+  research_topic: WebSocket reconnection strategies  # string
+  spec_folder: .opencode/specs/103-example/001-research/  # existing | new | update-related | phase-folder | explicit path
+  execution_mode: AUTONOMOUS  # from :auto suffix
+  maxIterations: 10  # positive integer
+  convergenceThreshold: 0.05  # decimal 0..1
+  executor: native  # native | cli-codex | cli-gemini | cli-claude-code
+  executor_model: ""  # optional executor-specific model id
+  executor_reasoning: ""  # optional reasoning effort
+  executor_service_tier: ""  # optional service tier
+  executor_timeout: 900  # optional positive integer seconds
+  resource_map_emit: true  # boolean
+```
+
+Rules: see `auto_mode_contract.md` §2 (unspecified fields fall back to default; marker fields take precedence over `$ARGUMENTS` flags; unknown fields warn; malformed lines parse-error).
+
+### Default Resolution Table
+
+| Field | Required | Resolves Via | Default | Tier-2 Candidate |
+|-------|----------|--------------|---------|------------------|
+| `research_topic` | Y | `$ARGUMENTS` positional topic, or marker `research_topic` | none | N |
+| `spec_folder` | Y | flag `--spec-folder`, marker `spec_folder`, or targeted choice among suggested existing/new/update-related/phase folder | none | Y, when topic is present but folder choice is ambiguous |
+| `execution_mode` | Y | attached suffix `:auto` or marker `execution_mode` | `AUTONOMOUS` under `:auto` | N |
+| `maxIterations` | Y | flag `--max-iterations`, marker `maxIterations`, or default | `10` | N |
+| `convergenceThreshold` | Y | flag `--convergence`, marker `convergenceThreshold`, or default | `0.05` | N |
+| `executor` | N | flag `--executor`, marker `executor`, config file, or default | `native` | N |
+| `executor_model` | N | flag `--model`, marker `executor_model`, or executor-specific validation | none | N |
+| `executor_reasoning` | N | flag `--reasoning-effort`, marker `executor_reasoning`, or executor default | none | N |
+| `executor_service_tier` | N | flag `--service-tier`, marker `executor_service_tier`, or executor default | none | N |
+| `executor_timeout` | N | flag `--executor-timeout`, marker `executor_timeout`, or default | `900` | N |
+| `resource_map_emit` | N | flag `--no-resource-map`, marker `resource_map_emit`, or default | `true` | N |
 
 **STATUS: BLOCKED**
 
diff --git a/.opencode/commands/spec_kit/implement.md b/.opencode/commands/spec_kit/implement.md
index 55c76b6dea..e7a8ceb38b 100644
--- a/.opencode/commands/spec_kit/implement.md
+++ b/.opencode/commands/spec_kit/implement.md
@@ -1,6 +1,6 @@
 ---
 description: Implementation workflow (9 steps): execute pre-planned work. Requires plan.md. Modes :auto, :confirm.
-argument-hint: "<spec-folder> [:auto|:confirm] [--phase-folder=<path>]"
+argument-hint: "<spec-folder> [:auto|:confirm] [--phase-folder=<path>] (:auto supports PRE-BOUND SETUP ANSWERS: prompt-body block for non-interactive setup)"
 allowed-tools: Read, Write, Edit, Bash, Grep, Glob, Task, memory_context, memory_search, spec_kit_memory_memory_save, spec_kit_memory_memory_index_scan, mcp__cocoindex_code__search
 ---
 
@@ -33,7 +33,54 @@ This workflow uses a SINGLE consolidated prompt to gather ALL required inputs in
 
 ## 0. UNIFIED SETUP PHASE
 
-**FIRST MESSAGE PROTOCOL**: This prompt MUST be your FIRST response. No implementation or file-modifying tool calls before asking. Lightweight read-only discovery is allowed, then ask ALL questions immediately and wait.
+**FIRST MESSAGE PROTOCOL**: For `:confirm` or no suffix, the consolidated setup prompt MUST be your FIRST response. No implementation or file-modifying tool calls before asking. Lightweight read-only discovery is allowed, then ask ALL questions immediately and wait.
+
+For `:auto`, do not emit the consolidated prompt by default. Resolve setup with the three-tier branch below, then load the auto YAML only after all required values are bound.
+
+### `:auto` Setup Resolution
+
+Setup contract: see `.opencode/skills/system-spec-kit/references/workflows/auto_mode_contract.md`.
+
+Under `execution_mode = AUTONOMOUS` (from the `:auto` suffix), follow the three-tier flow:
+
+1. **Tier 1 — Resolve confidently** (contract §1): parse `$ARGUMENTS` flags + `PRE-BOUND SETUP ANSWERS:` block (§2) + the Default Resolution Table below (§3). When every required field is resolved, persist to `{spec_path}/implement-config.json` (shape: `specPath`, `executionMode: "auto"`, `dispatchMode`, `memoryChoice`, `confirmChoice`, `resumeChoice`, `prerequisitesValid`), bind runtime YAML placeholders, set `STATUS: PASSED`, load `.opencode/commands/spec_kit/assets/spec_kit_implement_auto.yaml`. End §0.
+
+2. **Tier 2 — Targeted ask** (contract §1): when 1-2 required fields are genuinely ambiguous AND no default exists, emit ONE narrow question per ambiguous field. Command-specific Tier-2-eligible fields (per the Default Resolution Table below): `spec_folder`, `resume_choice`. **Ordering rule**: ask only for `spec_folder` first when folder detection is ambiguous — prerequisite and resume-session checks depend on it. Missing `spec_folder` with no viable candidates is absence, not ambiguity — go to Tier 3.
+
+3. **Tier 3 — Fail fast** (contract §4): emit the named-missing-inputs error format with `/spec_kit:implement:auto` as the command name. Exit non-zero. Do not load YAML.
+
+`:confirm` path stays unchanged — see the consolidated setup prompt section below.
+
+### PRE-BOUND SETUP ANSWERS Schema (for `:auto` non-interactive dispatch)
+
+The dispatched prompt body may contain one structured marker block. Parse it before applying defaults. Grammar: see `auto_mode_contract.md` §2.
+
+```yaml
+PRE-BOUND SETUP ANSWERS:
+  spec_folder: .opencode/specs/103-example/001-passwordless-login/  # explicit spec or phase folder path
+  phase_folder: ""  # optional explicit phase child path
+  confirm_choice: yes  # yes | different-folder | cancel
+  execution_mode: AUTONOMOUS  # from :auto suffix
+  dispatch_mode: single_agent  # single_agent | multi_small | multi_large
+  memory_choice: skip  # latest | recent3 | skip | n/a
+  resume_choice: resume  # resume | restart | cancel, only when prior incomplete session exists
+  prerequisites_valid: true  # auto-detected boolean
+```
+
+Rules: see `auto_mode_contract.md` §2 (unspecified fields fall back to default; marker fields take precedence over `$ARGUMENTS` flags; unknown fields warn; malformed lines parse-error).
+
+### Default Resolution Table
+
+| Field | Required | Resolves Via | Default | Tier-2 Candidate |
+|-------|----------|--------------|---------|------------------|
+| `spec_folder` | Y | `$ARGUMENTS` positional path, flag `--phase-folder`, marker `spec_folder` / `phase_folder`, or deterministic single-folder detection | none | Y, when detection returns multiple viable folders |
+| `phase_folder` | N | flag `--phase-folder`, marker `phase_folder`, or auto-detect phase child from `spec_folder` | none | N |
+| `confirm_choice` | Y | marker `confirm_choice` or default after prerequisite validation | `yes` when prerequisites are valid | N |
+| `execution_mode` | Y | attached suffix `:auto` or marker `execution_mode` | `AUTONOMOUS` under `:auto` | N |
+| `dispatch_mode` | Y | marker `dispatch_mode` or default recommended option | `single_agent` | N |
+| `memory_choice` | N | marker `memory_choice`, prior-continuity detection, or default | `skip` when no prior continuity records exist | N |
+| `resume_choice` | N | marker `resume_choice` or targeted question when prior incomplete session exists | none | Y, only when an incomplete-session warning is present |
+| `prerequisites_valid` | Y | auto-detect from `spec.md`, `plan.md`, `tasks.md`, and Level 2+ `checklist.md`; marker may only document expected state | auto-detect | N |
 
 **STATUS: BLOCKED**
 
diff --git a/.opencode/commands/spec_kit/plan.md b/.opencode/commands/spec_kit/plan.md
index 7e5580e47d..d3220dd845 100644
--- a/.opencode/commands/spec_kit/plan.md
+++ b/.opencode/commands/spec_kit/plan.md
@@ -1,6 +1,6 @@
 ---
 description: Planning workflow (8 steps): spec through plan only. Modes :auto, :confirm, :with-phases.
-argument-hint: "<feature-description> [:auto|:confirm] [:with-phases] [--intake-only] [--phases N] [--phase-names list] [--phase-folder=<path>] [--spec-folder=PATH] [--level=1|2|3|3+] [--start-state=STATE] [--repair-mode=MODE] [--record-relationships=yes|no] [--depends-on=IDs] [--related-to=IDs] [--supersedes=IDs]"
+argument-hint: "<feature-description> [:auto|:confirm] [:with-phases] [--intake-only] [--phases N] [--phase-names list] [--phase-folder=<path>] [--spec-folder=PATH] [--level=1|2|3|3+] [--start-state=STATE] [--repair-mode=MODE] [--record-relationships=yes|no] [--depends-on=IDs] [--related-to=IDs] [--supersedes=IDs] (:auto supports PRE-BOUND SETUP ANSWERS: prompt-body block for non-interactive setup)"
 allowed-tools: Read, Write, Edit, Bash, Grep, Glob, Task, memory_context, memory_search, spec_kit_memory_memory_save, spec_kit_memory_memory_index_scan, mcp__cocoindex_code__search
 ---
 
@@ -35,10 +35,77 @@ This workflow gathers ALL inputs in ONE prompt. Round-trip: 1 user interaction.
 
 ## 0. UNIFIED SETUP PHASE
 
-**FIRST MESSAGE PROTOCOL**: This prompt MUST be your FIRST response. No analysis, no tool calls — ask ALL questions immediately, then wait.
+**FIRST MESSAGE PROTOCOL**: For `:confirm` or no suffix, the consolidated setup prompt MUST be your FIRST response. No analysis, no tool calls — ask ALL questions immediately, then wait.
 
 Read-only discovery to classify folder state is allowed when `spec_path` is explicit or can be inferred from the setup answers. Healthy folders keep the existing prompt shape; non-healthy folders run the intake contract (`.opencode/skills/system-spec-kit/references/intake-contract.md`) inline inside the same consolidated prompt and MUST NOT open a second visible command flow. When `--intake-only` is present, execution halts after the Emit phase without proceeding to planning Steps 2–8.
 
+For `:auto`, do not emit the consolidated prompt by default. Resolve setup with the three-tier branch below, then load the auto YAML only after all required values are bound.
+
+### `:auto` Setup Resolution
+
+Setup contract: see `.opencode/skills/system-spec-kit/references/workflows/auto_mode_contract.md`.
+

exec
/bin/zsh -lc "node - <<'NODE'
const fs=require('fs'); const crypto=require('crypto');
const before={
 'deep-research':'24ced4c41a394c4e8c12b91338560f6bd975aac2d6aa68a8c40da0e0d5ebed85',
 complete:'de4b894b541f282b653df63ffa7b69eead81ccb17880fcfc13016ea6ad8839ce',
 implement:'ad7ce7d856aaaff11e29a55977922bb3311c0ca65a0e4db16753c4d2f8932341',
 plan:'15d79f803954df1d67eacdce2d41d2f26266e5fb329f4bdd92dcff88f2606925',
 resume:'2123ab4b502a1592f19fd580923a29258c56b1ee09d94331bd58af87fd30a3c1',
};
for (const f of Object.keys(before)) {
 const p="'`.opencode/commands/spec_kit/${f}.md`;
 const s=fs.readFileSync(p,'"'utf8');
 const start=s.indexOf('**STATUS: BLOCKED**');
 const fence=s.indexOf('"'```'"', start);
 const end=s.indexOf('\\n"'```'"', fence+3)+4;
 const block=s.slice(start,end);
 const hash=crypto.createHash('sha256').update(block).digest('hex');
 console.log("'`${f}'"\\t"'${hash===before[f]?'"'OK':'CHANGED'}\\t"'${hash}`);
}
NODE' in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
deep-research	OK	24ced4c41a394c4e8c12b91338560f6bd975aac2d6aa68a8c40da0e0d5ebed85
complete	OK	de4b894b541f282b653df63ffa7b69eead81ccb17880fcfc13016ea6ad8839ce
implement	OK	ad7ce7d856aaaff11e29a55977922bb3311c0ca65a0e4db16753c4d2f8932341
plan	OK	15d79f803954df1d67eacdce2d41d2f26266e5fb329f4bdd92dcff88f2606925
resume	OK	2123ab4b502a1592f19fd580923a29258c56b1ee09d94331bd58af87fd30a3c1

codex
Read-back confirms the legacy `:confirm` blocks are byte-for-byte preserved for all five files. I’m updating the scoped task marker and adding the dispatch evidence summary now.
apply patch
patch: completed
/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt
/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
diff --git a/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt
new file mode 100644
index 0000000000000000000000000000000000000000..3b0e4380f4031f08e12b15887ab0a8060add895a
--- /dev/null
+++ b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt
@@ -0,0 +1,28 @@
+# Codex Group 1 Dispatch Evidence
+
+## /spec_kit:deep-research
+- Fields migrated count: 11
+- Tier-2 candidates identified: spec_folder
+- Concerns: `spec_folder` is treated as a targeted-ask candidate only when the research topic is present but folder choice is ambiguous; missing `research_topic` goes straight to Tier 3.
+
+## /spec_kit:complete
+- Fields migrated count: 18
+- Tier-2 candidates identified: spec_folder, research_intent
+- Concerns: Chose `{spec_path}/complete-config.json` as the command-specific setup config path because no existing complete config file was present in the YAML assets.
+
+## /spec_kit:implement
+- Fields migrated count: 8
+- Tier-2 candidates identified: spec_folder, resume_choice
+- Concerns: `confirm_choice` defaults to yes only after prerequisite validation passes; invalid or absent prerequisites still fail setup rather than silently continuing.
+
+## /spec_kit:plan
+- Fields migrated count: 18
+- Tier-2 candidates identified: spec_folder, research_intent
+- Concerns: Chose `{spec_path}/plan-config.json` as the command-specific setup config path because no existing plan config file was present in the YAML assets.
+
+## /spec_kit:resume
+- Fields migrated count: 10
+- Tier-2 candidates identified: spec_folder, continuation_choice
+- Concerns: `artifact_recovery_choice` defaults to `continue_anyway` under resume auto mode so missing artifacts do not consume a Tier-2 slot; hard path absence still fails fast.
+
+EXIT_STATUS: complete
diff --git a/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
index b3c4d71f116fd6fe21e8b192db56019f72adb9f2..c463f8dee17721abef4433ca88d004ba71488bc0
--- a/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
+++ b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
@@ -10,8 +10,8 @@
     packet_pointer: ".opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands"
     last_updated_at: "2026-05-11T12:35:00Z"
     last_updated_by: "claude-opus-4-7"
-    recent_action: "Authored task list"
-    next_safe_action: "Dispatch codex group 1"
+    recent_action: "Group 1 spec_kit commands migrated"
+    next_safe_action: "Dispatch group 2 create commands"
     blockers: []
     key_files: []
     session_dedup:
@@ -57,7 +57,7 @@
 <!-- ANCHOR:phase-2 -->
 ## Phase 2: Implementation
 
-- [ ] T010 Codex group dispatch 1 (spec_kit/5): deep-research, complete, implement, plan, resume.
+- [x] T010 Codex group dispatch 1 (spec_kit/5): deep-research, complete, implement, plan, resume. Evidence: Group 1 codex dispatch completed; 5 commands migrated; see evidence/codex-group1-dispatch.txt
 - [ ] T011 Codex group dispatch 2 (create/6): sk-skill, agent, changelog, feature-catalog, testing-playbook, folder_readme.
 - [ ] T012 Codex group dispatch 3 (improve/1): agent.
 - [ ] T013 Per-command read-back: confirm `:confirm` block untouched in all 11 migrated commands.

diff --git a/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt
new file mode 100644
index 0000000000000000000000000000000000000000..3b0e4380f4031f08e12b15887ab0a8060add895a
--- /dev/null
+++ b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt
@@ -0,0 +1,28 @@
+# Codex Group 1 Dispatch Evidence
+
+## /spec_kit:deep-research
+- Fields migrated count: 11
+- Tier-2 candidates identified: spec_folder
+- Concerns: `spec_folder` is treated as a targeted-ask candidate only when the research topic is present but folder choice is ambiguous; missing `research_topic` goes straight to Tier 3.
+
+## /spec_kit:complete
+- Fields migrated count: 18
+- Tier-2 candidates identified: spec_folder, research_intent
+- Concerns: Chose `{spec_path}/complete-config.json` as the command-specific setup config path because no existing complete config file was present in the YAML assets.
+
+## /spec_kit:implement
+- Fields migrated count: 8
+- Tier-2 candidates identified: spec_folder, resume_choice
+- Concerns: `confirm_choice` defaults to yes only after prerequisite validation passes; invalid or absent prerequisites still fail setup rather than silently continuing.
+
+## /spec_kit:plan
+- Fields migrated count: 18
+- Tier-2 candidates identified: spec_folder, research_intent
+- Concerns: Chose `{spec_path}/plan-config.json` as the command-specific setup config path because no existing plan config file was present in the YAML assets.
+
+## /spec_kit:resume
+- Fields migrated count: 10
+- Tier-2 candidates identified: spec_folder, continuation_choice
+- Concerns: `artifact_recovery_choice` defaults to `continue_anyway` under resume auto mode so missing artifacts do not consume a Tier-2 slot; hard path absence still fails fast.
+
+EXIT_STATUS: complete
diff --git a/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
index b3c4d71f116fd6fe21e8b192db56019f72adb9f2..c463f8dee17721abef4433ca88d004ba71488bc0
--- a/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
+++ b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
@@ -10,8 +10,8 @@
     packet_pointer: ".opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands"
     last_updated_at: "2026-05-11T12:35:00Z"
     last_updated_by: "claude-opus-4-7"
-    recent_action: "Authored task list"
-    next_safe_action: "Dispatch codex group 1"
+    recent_action: "Group 1 spec_kit commands migrated"
+    next_safe_action: "Dispatch group 2 create commands"
     blockers: []
     key_files: []
     session_dedup:
@@ -57,7 +57,7 @@
 <!-- ANCHOR:phase-2 -->
 ## Phase 2: Implementation
 
-- [ ] T010 Codex group dispatch 1 (spec_kit/5): deep-research, complete, implement, plan, resume.
+- [x] T010 Codex group dispatch 1 (spec_kit/5): deep-research, complete, implement, plan, resume. Evidence: Group 1 codex dispatch completed; 5 commands migrated; see evidence/codex-group1-dispatch.txt
 - [ ] T011 Codex group dispatch 2 (create/6): sk-skill, agent, changelog, feature-catalog, testing-playbook, folder_readme.
 - [ ] T012 Codex group dispatch 3 (improve/1): agent.
 - [ ] T013 Per-command read-back: confirm `:confirm` block untouched in all 11 migrated commands.

codex
The scoped task and evidence file are in place. I’m doing the final verification pass now: changed-file scope, `:confirm` hashes, contract/hint presence, and the packet validator.
exec
/bin/zsh -lc 'git diff --name-only' in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
.opencode/commands/spec_kit/complete.md
.opencode/commands/spec_kit/deep-research.md
.opencode/commands/spec_kit/implement.md
.opencode/commands/spec_kit/plan.md
.opencode/commands/spec_kit/resume.md
.opencode/skills/deep-ai-council/README.md
.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/010-doctor-update-orchestrator/graph-metadata.json

exec
/bin/zsh -lc "node - <<'NODE'
const fs=require('fs'); const crypto=require('crypto');
const before={
 'deep-research':'24ced4c41a394c4e8c12b91338560f6bd975aac2d6aa68a8c40da0e0d5ebed85',
 complete:'de4b894b541f282b653df63ffa7b69eead81ccb17880fcfc13016ea6ad8839ce',
 implement:'ad7ce7d856aaaff11e29a55977922bb3311c0ca65a0e4db16753c4d2f8932341',
 plan:'15d79f803954df1d67eacdce2d41d2f26266e5fb329f4bdd92dcff88f2606925',
 resume:'2123ab4b502a1592f19fd580923a29258c56b1ee09d94331bd58af87fd30a3c1',
};
let ok=true;
for (const f of Object.keys(before)) {
 const p="'`.opencode/commands/spec_kit/${f}.md`;
 const s=fs.readFileSync(p,'"'utf8');
 const start=s.indexOf('**STATUS: BLOCKED**');
 const fence=s.indexOf('"'```'"', start);
 const end=s.indexOf('\\n"'```'"', fence+3)+4;
 const hash=crypto.createHash('sha256').update(s.slice(start,end)).digest('hex');
 const good=hash===before[f]; ok &&= good;
 console.log("'`${f}: :confirm ${good?'"'preserved':'changed'}"'`);
}
process.exit(ok?0:1);
NODE' in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
deep-research: :confirm preserved
complete: :confirm preserved
implement: :confirm preserved
plan: :confirm preserved
resume: :confirm preserved

exec
/bin/zsh -lc 'for f in deep-research complete implement plan resume; do p=.opencode/commands/spec_kit/$f.md; printf '"'%s ' \""'$f"; rg -q "auto_mode_contract.md" "$p" && rg -q "PRE-BOUND SETUP ANSWERS" "$p" && rg -q "Default Resolution Table" "$p" && rg -q "argument-hint: .*PRE-BOUND SETUP ANSWERS" "$p" && echo OK || echo FAIL; done' in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
deep-research OK
complete OK
implement OK
plan OK
resume OK

diff --git a/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt
new file mode 100644
index 0000000000000000000000000000000000000000..3b0e4380f4031f08e12b15887ab0a8060add895a
--- /dev/null
+++ b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt
@@ -0,0 +1,28 @@
+# Codex Group 1 Dispatch Evidence
+
+## /spec_kit:deep-research
+- Fields migrated count: 11
+- Tier-2 candidates identified: spec_folder
+- Concerns: `spec_folder` is treated as a targeted-ask candidate only when the research topic is present but folder choice is ambiguous; missing `research_topic` goes straight to Tier 3.
+
+## /spec_kit:complete
+- Fields migrated count: 18
+- Tier-2 candidates identified: spec_folder, research_intent
+- Concerns: Chose `{spec_path}/complete-config.json` as the command-specific setup config path because no existing complete config file was present in the YAML assets.
+
+## /spec_kit:implement
+- Fields migrated count: 8
+- Tier-2 candidates identified: spec_folder, resume_choice
+- Concerns: `confirm_choice` defaults to yes only after prerequisite validation passes; invalid or absent prerequisites still fail setup rather than silently continuing.
+
+## /spec_kit:plan
+- Fields migrated count: 18
+- Tier-2 candidates identified: spec_folder, research_intent
+- Concerns: Chose `{spec_path}/plan-config.json` as the command-specific setup config path because no existing plan config file was present in the YAML assets.
+
+## /spec_kit:resume
+- Fields migrated count: 10
+- Tier-2 candidates identified: spec_folder, continuation_choice
+- Concerns: `artifact_recovery_choice` defaults to `continue_anyway` under resume auto mode so missing artifacts do not consume a Tier-2 slot; hard path absence still fails fast.
+
+EXIT_STATUS: complete
diff --git a/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
index b3c4d71f116fd6fe21e8b192db56019f72adb9f2..c463f8dee17721abef4433ca88d004ba71488bc0
--- a/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
+++ b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
@@ -10,8 +10,8 @@
     packet_pointer: ".opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands"
     last_updated_at: "2026-05-11T12:35:00Z"
     last_updated_by: "claude-opus-4-7"
-    recent_action: "Authored task list"
-    next_safe_action: "Dispatch codex group 1"
+    recent_action: "Group 1 spec_kit commands migrated"
+    next_safe_action: "Dispatch group 2 create commands"
     blockers: []
     key_files: []
     session_dedup:
@@ -57,7 +57,7 @@
 <!-- ANCHOR:phase-2 -->
 ## Phase 2: Implementation
 
-- [ ] T010 Codex group dispatch 1 (spec_kit/5): deep-research, complete, implement, plan, resume.
+- [x] T010 Codex group dispatch 1 (spec_kit/5): deep-research, complete, implement, plan, resume. Evidence: Group 1 codex dispatch completed; 5 commands migrated; see evidence/codex-group1-dispatch.txt
 - [ ] T011 Codex group dispatch 2 (create/6): sk-skill, agent, changelog, feature-catalog, testing-playbook, folder_readme.
 - [ ] T012 Codex group dispatch 3 (improve/1): agent.
 - [ ] T013 Per-command read-back: confirm `:confirm` block untouched in all 11 migrated commands.

exec
/bin/zsh -lc 'bash .opencode/skills/system-spec-kit/scripts/spec/validate.sh .opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands --strict' in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
exec
/bin/zsh -lc 'git status --short' in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
 M .opencode/commands/spec_kit/complete.md
 M .opencode/commands/spec_kit/deep-research.md
 M .opencode/commands/spec_kit/implement.md
 M .opencode/commands/spec_kit/plan.md
 M .opencode/commands/spec_kit/resume.md
 M .opencode/skills/deep-ai-council/README.md
 M .opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
 M .opencode/specs/system-spec-kit/026-graph-and-context-optimization/010-doctor-update-orchestrator/graph-metadata.json
?? .opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/

diff --git a/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt
new file mode 100644
index 0000000000000000000000000000000000000000..3b0e4380f4031f08e12b15887ab0a8060add895a
--- /dev/null
+++ b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt
@@ -0,0 +1,28 @@
+# Codex Group 1 Dispatch Evidence
+
+## /spec_kit:deep-research
+- Fields migrated count: 11
+- Tier-2 candidates identified: spec_folder
+- Concerns: `spec_folder` is treated as a targeted-ask candidate only when the research topic is present but folder choice is ambiguous; missing `research_topic` goes straight to Tier 3.
+
+## /spec_kit:complete
+- Fields migrated count: 18
+- Tier-2 candidates identified: spec_folder, research_intent
+- Concerns: Chose `{spec_path}/complete-config.json` as the command-specific setup config path because no existing complete config file was present in the YAML assets.
+
+## /spec_kit:implement
+- Fields migrated count: 8
+- Tier-2 candidates identified: spec_folder, resume_choice
+- Concerns: `confirm_choice` defaults to yes only after prerequisite validation passes; invalid or absent prerequisites still fail setup rather than silently continuing.
+
+## /spec_kit:plan
+- Fields migrated count: 18
+- Tier-2 candidates identified: spec_folder, research_intent
+- Concerns: Chose `{spec_path}/plan-config.json` as the command-specific setup config path because no existing plan config file was present in the YAML assets.
+
+## /spec_kit:resume
+- Fields migrated count: 10
+- Tier-2 candidates identified: spec_folder, continuation_choice
+- Concerns: `artifact_recovery_choice` defaults to `continue_anyway` under resume auto mode so missing artifacts do not consume a Tier-2 slot; hard path absence still fails fast.
+
+EXIT_STATUS: complete
diff --git a/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
index b3c4d71f116fd6fe21e8b192db56019f72adb9f2..c463f8dee17721abef4433ca88d004ba71488bc0
--- a/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
+++ b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
@@ -10,8 +10,8 @@
     packet_pointer: ".opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands"
     last_updated_at: "2026-05-11T12:35:00Z"
     last_updated_by: "claude-opus-4-7"
-    recent_action: "Authored task list"
-    next_safe_action: "Dispatch codex group 1"
+    recent_action: "Group 1 spec_kit commands migrated"
+    next_safe_action: "Dispatch group 2 create commands"
     blockers: []
     key_files: []
     session_dedup:
@@ -57,7 +57,7 @@
 <!-- ANCHOR:phase-2 -->
 ## Phase 2: Implementation
 
-- [ ] T010 Codex group dispatch 1 (spec_kit/5): deep-research, complete, implement, plan, resume.
+- [x] T010 Codex group dispatch 1 (spec_kit/5): deep-research, complete, implement, plan, resume. Evidence: Group 1 codex dispatch completed; 5 commands migrated; see evidence/codex-group1-dispatch.txt
 - [ ] T011 Codex group dispatch 2 (create/6): sk-skill, agent, changelog, feature-catalog, testing-playbook, folder_readme.
 - [ ] T012 Codex group dispatch 3 (improve/1): agent.
 - [ ] T013 Per-command read-back: confirm `:confirm` block untouched in all 11 migrated commands.

 succeeded in 3802ms:

Spec Folder Validation v3.0.0

  Folder: /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands
  Level:  2

+ FILE_EXISTS: All required files present for Level 2
+ PLACEHOLDER_FILLED: No unfilled template placeholders found
+ TEMPLATE_SOURCE: Template source headers present
+ TEMPLATE_HEADERS: Template headers match in 5 file(s)
+ ANCHORS_VALID: Template anchors match in 5 file(s)
+ PRIORITY_TAGS: Checklist priority tags use CHK-* [P*] format
+ FRONTMATTER_VALID: Frontmatter continuity basics present
+ FRONTMATTER_MEMORY_BLOCK: All spec-doc frontmatter memory blocks are structurally valid
+ SPEC_DOC_SUFFICIENCY: All targeted spec-doc anchors meet the sufficiency baseline
+ SECTIONS_PRESENT: Section presence covered by per-document manifest anchors
+ GRAPH_METADATA_PRESENT: Graph metadata checked

Summary: Errors: 0  Warnings: 0

RESULT: PASSED

diff --git a/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt
new file mode 100644
index 0000000000000000000000000000000000000000..3b0e4380f4031f08e12b15887ab0a8060add895a
--- /dev/null
+++ b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt
@@ -0,0 +1,28 @@
+# Codex Group 1 Dispatch Evidence
+
+## /spec_kit:deep-research
+- Fields migrated count: 11
+- Tier-2 candidates identified: spec_folder
+- Concerns: `spec_folder` is treated as a targeted-ask candidate only when the research topic is present but folder choice is ambiguous; missing `research_topic` goes straight to Tier 3.
+
+## /spec_kit:complete
+- Fields migrated count: 18
+- Tier-2 candidates identified: spec_folder, research_intent
+- Concerns: Chose `{spec_path}/complete-config.json` as the command-specific setup config path because no existing complete config file was present in the YAML assets.
+
+## /spec_kit:implement
+- Fields migrated count: 8
+- Tier-2 candidates identified: spec_folder, resume_choice
+- Concerns: `confirm_choice` defaults to yes only after prerequisite validation passes; invalid or absent prerequisites still fail setup rather than silently continuing.
+
+## /spec_kit:plan
+- Fields migrated count: 18
+- Tier-2 candidates identified: spec_folder, research_intent
+- Concerns: Chose `{spec_path}/plan-config.json` as the command-specific setup config path because no existing plan config file was present in the YAML assets.
+
+## /spec_kit:resume
+- Fields migrated count: 10
+- Tier-2 candidates identified: spec_folder, continuation_choice
+- Concerns: `artifact_recovery_choice` defaults to `continue_anyway` under resume auto mode so missing artifacts do not consume a Tier-2 slot; hard path absence still fails fast.
+
+EXIT_STATUS: complete
diff --git a/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
index b3c4d71f116fd6fe21e8b192db56019f72adb9f2..c463f8dee17721abef4433ca88d004ba71488bc0
--- a/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
+++ b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
@@ -10,8 +10,8 @@
     packet_pointer: ".opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands"
     last_updated_at: "2026-05-11T12:35:00Z"
     last_updated_by: "claude-opus-4-7"
-    recent_action: "Authored task list"
-    next_safe_action: "Dispatch codex group 1"
+    recent_action: "Group 1 spec_kit commands migrated"
+    next_safe_action: "Dispatch group 2 create commands"
     blockers: []
     key_files: []
     session_dedup:
@@ -57,7 +57,7 @@
 <!-- ANCHOR:phase-2 -->
 ## Phase 2: Implementation
 
-- [ ] T010 Codex group dispatch 1 (spec_kit/5): deep-research, complete, implement, plan, resume.
+- [x] T010 Codex group dispatch 1 (spec_kit/5): deep-research, complete, implement, plan, resume. Evidence: Group 1 codex dispatch completed; 5 commands migrated; see evidence/codex-group1-dispatch.txt
 - [ ] T011 Codex group dispatch 2 (create/6): sk-skill, agent, changelog, feature-catalog, testing-playbook, folder_readme.
 - [ ] T012 Codex group dispatch 3 (improve/1): agent.
 - [ ] T013 Per-command read-back: confirm `:confirm` block untouched in all 11 migrated commands.

exec
/bin/zsh -lc 'find .opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence -maxdepth 1 -type f -print | sort' in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch-full-transcript.txt
.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt

exec
/bin/zsh -lc "sed -n '1,220p' .opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
# Codex Group 1 Dispatch Evidence

## /spec_kit:deep-research
- Fields migrated count: 11
- Tier-2 candidates identified: spec_folder
- Concerns: `spec_folder` is treated as a targeted-ask candidate only when the research topic is present but folder choice is ambiguous; missing `research_topic` goes straight to Tier 3.

## /spec_kit:complete
- Fields migrated count: 18
- Tier-2 candidates identified: spec_folder, research_intent
- Concerns: Chose `{spec_path}/complete-config.json` as the command-specific setup config path because no existing complete config file was present in the YAML assets.

## /spec_kit:implement
- Fields migrated count: 8
- Tier-2 candidates identified: spec_folder, resume_choice
- Concerns: `confirm_choice` defaults to yes only after prerequisite validation passes; invalid or absent prerequisites still fail setup rather than silently continuing.

## /spec_kit:plan
- Fields migrated count: 18
- Tier-2 candidates identified: spec_folder, research_intent
- Concerns: Chose `{spec_path}/plan-config.json` as the command-specific setup config path because no existing plan config file was present in the YAML assets.

## /spec_kit:resume
- Fields migrated count: 10
- Tier-2 candidates identified: spec_folder, continuation_choice
- Concerns: `artifact_recovery_choice` defaults to `continue_anyway` under resume auto mode so missing artifacts do not consume a Tier-2 slot; hard path absence still fails fast.

EXIT_STATUS: complete

exec
/bin/zsh -lc "sed -n '1,70p' .opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
---
title: "Tasks: auto-mode-contract generalization"
description: "11-command migration via 3 codex groups + 12 live verifications + synthesis."
trigger_phrases:
  - "auto mode contract generalization"
importance_tier: "important"
contextType: "implementation"
_memory:
  continuity:
    packet_pointer: ".opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands"
    last_updated_at: "2026-05-11T12:35:00Z"
    last_updated_by: "claude-opus-4-7"
    recent_action: "Group 1 spec_kit commands migrated"
    next_safe_action: "Dispatch group 2 create commands"
    blockers: []
    key_files: []
    session_dedup:
      fingerprint: "sha256:0000000000000000000000000000000000000000000000000000000000000000"
      session_id: "103-002-auto-mode-contract-generalization"
      parent_session_id: null
    completion_pct: 0
    open_questions: []
    answered_questions: []
---
# Tasks: auto-mode-contract generalization

<!-- SPECKIT_LEVEL: 2 -->
<!-- SPECKIT_TEMPLATE_SOURCE: tasks-core | v2.2 -->

---

<!-- ANCHOR:notation -->
## Task Notation

| Prefix | Meaning |
|--------|---------|
| `[ ]` | Pending |
| `[x]` | Completed |
| `[P]` | Parallelizable |
| `[B]` | Blocked |

**Task Format**: `T### [P?] Description (file path)`
<!-- /ANCHOR:notation -->

---

<!-- ANCHOR:phase-1 -->
## Phase 1: Setup

- [x] T001 Shared `auto_mode_contract.md` authored (Stage B).
- [x] T002 `/spec_kit:deep-review.md` §0 refactored to cite shared contract (Stage B).
- [ ] T003 Confirm 001's dry-run traces still conceptually pass after refactor (read-back).
<!-- /ANCHOR:phase-1 -->

---

<!-- ANCHOR:phase-2 -->
## Phase 2: Implementation

- [x] T010 Codex group dispatch 1 (spec_kit/5): deep-research, complete, implement, plan, resume. Evidence: Group 1 codex dispatch completed; 5 commands migrated; see evidence/codex-group1-dispatch.txt
- [ ] T011 Codex group dispatch 2 (create/6): sk-skill, agent, changelog, feature-catalog, testing-playbook, folder_readme.
- [ ] T012 Codex group dispatch 3 (improve/1): agent.
- [ ] T013 Per-command read-back: confirm `:confirm` block untouched in all 11 migrated commands.
<!-- /ANCHOR:phase-2 -->

---

<!-- ANCHOR:phase-3 -->
## Phase 3: Verification


diff --git a/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt
new file mode 100644
index 0000000000000000000000000000000000000000..3b0e4380f4031f08e12b15887ab0a8060add895a
--- /dev/null
+++ b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt
@@ -0,0 +1,28 @@
+# Codex Group 1 Dispatch Evidence
+
+## /spec_kit:deep-research
+- Fields migrated count: 11
+- Tier-2 candidates identified: spec_folder
+- Concerns: `spec_folder` is treated as a targeted-ask candidate only when the research topic is present but folder choice is ambiguous; missing `research_topic` goes straight to Tier 3.
+
+## /spec_kit:complete
+- Fields migrated count: 18
+- Tier-2 candidates identified: spec_folder, research_intent
+- Concerns: Chose `{spec_path}/complete-config.json` as the command-specific setup config path because no existing complete config file was present in the YAML assets.
+
+## /spec_kit:implement
+- Fields migrated count: 8
+- Tier-2 candidates identified: spec_folder, resume_choice
+- Concerns: `confirm_choice` defaults to yes only after prerequisite validation passes; invalid or absent prerequisites still fail setup rather than silently continuing.
+
+## /spec_kit:plan
+- Fields migrated count: 18
+- Tier-2 candidates identified: spec_folder, research_intent
+- Concerns: Chose `{spec_path}/plan-config.json` as the command-specific setup config path because no existing plan config file was present in the YAML assets.
+
+## /spec_kit:resume
+- Fields migrated count: 10
+- Tier-2 candidates identified: spec_folder, continuation_choice
+- Concerns: `artifact_recovery_choice` defaults to `continue_anyway` under resume auto mode so missing artifacts do not consume a Tier-2 slot; hard path absence still fails fast.
+
+EXIT_STATUS: complete
diff --git a/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
index b3c4d71f116fd6fe21e8b192db56019f72adb9f2..c463f8dee17721abef4433ca88d004ba71488bc0
--- a/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
+++ b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
@@ -10,8 +10,8 @@
     packet_pointer: ".opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands"
     last_updated_at: "2026-05-11T12:35:00Z"
     last_updated_by: "claude-opus-4-7"
-    recent_action: "Authored task list"
-    next_safe_action: "Dispatch codex group 1"
+    recent_action: "Group 1 spec_kit commands migrated"
+    next_safe_action: "Dispatch group 2 create commands"
     blockers: []
     key_files: []
     session_dedup:
@@ -57,7 +57,7 @@
 <!-- ANCHOR:phase-2 -->
 ## Phase 2: Implementation
 
-- [ ] T010 Codex group dispatch 1 (spec_kit/5): deep-research, complete, implement, plan, resume.
+- [x] T010 Codex group dispatch 1 (spec_kit/5): deep-research, complete, implement, plan, resume. Evidence: Group 1 codex dispatch completed; 5 commands migrated; see evidence/codex-group1-dispatch.txt
 - [ ] T011 Codex group dispatch 2 (create/6): sk-skill, agent, changelog, feature-catalog, testing-playbook, folder_readme.
 - [ ] T012 Codex group dispatch 3 (improve/1): agent.
 - [ ] T013 Per-command read-back: confirm `:confirm` block untouched in all 11 migrated commands.

exec
/bin/zsh -lc 'git status --short --untracked-files=all' in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
 M .opencode/commands/spec_kit/complete.md
 M .opencode/commands/spec_kit/deep-research.md
 M .opencode/commands/spec_kit/implement.md
 M .opencode/commands/spec_kit/plan.md
 M .opencode/commands/spec_kit/resume.md
 M .opencode/skills/deep-ai-council/README.md
 M .opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
 M .opencode/specs/system-spec-kit/026-graph-and-context-optimization/010-doctor-update-orchestrator/graph-metadata.json
?? .opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch-full-transcript.txt
?? .opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt

diff --git a/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt
new file mode 100644
index 0000000000000000000000000000000000000000..3b0e4380f4031f08e12b15887ab0a8060add895a
--- /dev/null
+++ b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt
@@ -0,0 +1,28 @@
+# Codex Group 1 Dispatch Evidence
+
+## /spec_kit:deep-research
+- Fields migrated count: 11
+- Tier-2 candidates identified: spec_folder
+- Concerns: `spec_folder` is treated as a targeted-ask candidate only when the research topic is present but folder choice is ambiguous; missing `research_topic` goes straight to Tier 3.
+
+## /spec_kit:complete
+- Fields migrated count: 18
+- Tier-2 candidates identified: spec_folder, research_intent
+- Concerns: Chose `{spec_path}/complete-config.json` as the command-specific setup config path because no existing complete config file was present in the YAML assets.
+
+## /spec_kit:implement
+- Fields migrated count: 8
+- Tier-2 candidates identified: spec_folder, resume_choice
+- Concerns: `confirm_choice` defaults to yes only after prerequisite validation passes; invalid or absent prerequisites still fail setup rather than silently continuing.
+
+## /spec_kit:plan
+- Fields migrated count: 18
+- Tier-2 candidates identified: spec_folder, research_intent
+- Concerns: Chose `{spec_path}/plan-config.json` as the command-specific setup config path because no existing plan config file was present in the YAML assets.
+
+## /spec_kit:resume
+- Fields migrated count: 10
+- Tier-2 candidates identified: spec_folder, continuation_choice
+- Concerns: `artifact_recovery_choice` defaults to `continue_anyway` under resume auto mode so missing artifacts do not consume a Tier-2 slot; hard path absence still fails fast.
+
+EXIT_STATUS: complete
diff --git a/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
index b3c4d71f116fd6fe21e8b192db56019f72adb9f2..c463f8dee17721abef4433ca88d004ba71488bc0
--- a/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
+++ b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
@@ -10,8 +10,8 @@
     packet_pointer: ".opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands"
     last_updated_at: "2026-05-11T12:35:00Z"
     last_updated_by: "claude-opus-4-7"
-    recent_action: "Authored task list"
-    next_safe_action: "Dispatch codex group 1"
+    recent_action: "Group 1 spec_kit commands migrated"
+    next_safe_action: "Dispatch group 2 create commands"
     blockers: []
     key_files: []
     session_dedup:
@@ -57,7 +57,7 @@
 <!-- ANCHOR:phase-2 -->
 ## Phase 2: Implementation
 
-- [ ] T010 Codex group dispatch 1 (spec_kit/5): deep-research, complete, implement, plan, resume.
+- [x] T010 Codex group dispatch 1 (spec_kit/5): deep-research, complete, implement, plan, resume. Evidence: Group 1 codex dispatch completed; 5 commands migrated; see evidence/codex-group1-dispatch.txt
 - [ ] T011 Codex group dispatch 2 (create/6): sk-skill, agent, changelog, feature-catalog, testing-playbook, folder_readme.
 - [ ] T012 Codex group dispatch 3 (improve/1): agent.
 - [ ] T013 Per-command read-back: confirm `:confirm` block untouched in all 11 migrated commands.

exec
/bin/zsh -lc "stat -f '%Sm %N' -t '%Y-%m-%d %H:%M:%S' .opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch-full-transcript.txt .opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
2026-05-11 14:11:53 .opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch-full-transcript.txt
2026-05-11 14:11:01 .opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt

diff --git a/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt
new file mode 100644
index 0000000000000000000000000000000000000000..3b0e4380f4031f08e12b15887ab0a8060add895a
--- /dev/null
+++ b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt
@@ -0,0 +1,28 @@
+# Codex Group 1 Dispatch Evidence
+
+## /spec_kit:deep-research
+- Fields migrated count: 11
+- Tier-2 candidates identified: spec_folder
+- Concerns: `spec_folder` is treated as a targeted-ask candidate only when the research topic is present but folder choice is ambiguous; missing `research_topic` goes straight to Tier 3.
+
+## /spec_kit:complete
+- Fields migrated count: 18
+- Tier-2 candidates identified: spec_folder, research_intent
+- Concerns: Chose `{spec_path}/complete-config.json` as the command-specific setup config path because no existing complete config file was present in the YAML assets.
+
+## /spec_kit:implement
+- Fields migrated count: 8
+- Tier-2 candidates identified: spec_folder, resume_choice
+- Concerns: `confirm_choice` defaults to yes only after prerequisite validation passes; invalid or absent prerequisites still fail setup rather than silently continuing.
+
+## /spec_kit:plan
+- Fields migrated count: 18
+- Tier-2 candidates identified: spec_folder, research_intent
+- Concerns: Chose `{spec_path}/plan-config.json` as the command-specific setup config path because no existing plan config file was present in the YAML assets.
+
+## /spec_kit:resume
+- Fields migrated count: 10
+- Tier-2 candidates identified: spec_folder, continuation_choice
+- Concerns: `artifact_recovery_choice` defaults to `continue_anyway` under resume auto mode so missing artifacts do not consume a Tier-2 slot; hard path absence still fails fast.
+
+EXIT_STATUS: complete
diff --git a/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
index b3c4d71f116fd6fe21e8b192db56019f72adb9f2..c463f8dee17721abef4433ca88d004ba71488bc0
--- a/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
+++ b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
@@ -10,8 +10,8 @@
     packet_pointer: ".opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands"
     last_updated_at: "2026-05-11T12:35:00Z"
     last_updated_by: "claude-opus-4-7"
-    recent_action: "Authored task list"
-    next_safe_action: "Dispatch codex group 1"
+    recent_action: "Group 1 spec_kit commands migrated"
+    next_safe_action: "Dispatch group 2 create commands"
     blockers: []
     key_files: []
     session_dedup:
@@ -57,7 +57,7 @@
 <!-- ANCHOR:phase-2 -->
 ## Phase 2: Implementation
 
-- [ ] T010 Codex group dispatch 1 (spec_kit/5): deep-research, complete, implement, plan, resume.
+- [x] T010 Codex group dispatch 1 (spec_kit/5): deep-research, complete, implement, plan, resume. Evidence: Group 1 codex dispatch completed; 5 commands migrated; see evidence/codex-group1-dispatch.txt
 - [ ] T011 Codex group dispatch 2 (create/6): sk-skill, agent, changelog, feature-catalog, testing-playbook, folder_readme.
 - [ ] T012 Codex group dispatch 3 (improve/1): agent.
 - [ ] T013 Per-command read-back: confirm `:confirm` block untouched in all 11 migrated commands.

exec
/bin/zsh -lc 'git diff --check -- .opencode/commands/spec_kit/deep-research.md .opencode/commands/spec_kit/complete.md .opencode/commands/spec_kit/implement.md .opencode/commands/spec_kit/plan.md .opencode/commands/spec_kit/resume.md .opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md .opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt' in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
diff --git a/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt
new file mode 100644
index 0000000000000000000000000000000000000000..3b0e4380f4031f08e12b15887ab0a8060add895a
--- /dev/null
+++ b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt
@@ -0,0 +1,28 @@
+# Codex Group 1 Dispatch Evidence
+
+## /spec_kit:deep-research
+- Fields migrated count: 11
+- Tier-2 candidates identified: spec_folder
+- Concerns: `spec_folder` is treated as a targeted-ask candidate only when the research topic is present but folder choice is ambiguous; missing `research_topic` goes straight to Tier 3.
+
+## /spec_kit:complete
+- Fields migrated count: 18
+- Tier-2 candidates identified: spec_folder, research_intent
+- Concerns: Chose `{spec_path}/complete-config.json` as the command-specific setup config path because no existing complete config file was present in the YAML assets.
+
+## /spec_kit:implement
+- Fields migrated count: 8
+- Tier-2 candidates identified: spec_folder, resume_choice
+- Concerns: `confirm_choice` defaults to yes only after prerequisite validation passes; invalid or absent prerequisites still fail setup rather than silently continuing.
+
+## /spec_kit:plan
+- Fields migrated count: 18
+- Tier-2 candidates identified: spec_folder, research_intent
+- Concerns: Chose `{spec_path}/plan-config.json` as the command-specific setup config path because no existing plan config file was present in the YAML assets.
+
+## /spec_kit:resume
+- Fields migrated count: 10
+- Tier-2 candidates identified: spec_folder, continuation_choice
+- Concerns: `artifact_recovery_choice` defaults to `continue_anyway` under resume auto mode so missing artifacts do not consume a Tier-2 slot; hard path absence still fails fast.
+
+EXIT_STATUS: complete
diff --git a/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
index b3c4d71f116fd6fe21e8b192db56019f72adb9f2..c463f8dee17721abef4433ca88d004ba71488bc0
--- a/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
+++ b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
@@ -10,8 +10,8 @@
     packet_pointer: ".opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands"
     last_updated_at: "2026-05-11T12:35:00Z"
     last_updated_by: "claude-opus-4-7"
-    recent_action: "Authored task list"
-    next_safe_action: "Dispatch codex group 1"
+    recent_action: "Group 1 spec_kit commands migrated"
+    next_safe_action: "Dispatch group 2 create commands"
     blockers: []
     key_files: []
     session_dedup:
@@ -57,7 +57,7 @@
 <!-- ANCHOR:phase-2 -->
 ## Phase 2: Implementation
 
-- [ ] T010 Codex group dispatch 1 (spec_kit/5): deep-research, complete, implement, plan, resume.
+- [x] T010 Codex group dispatch 1 (spec_kit/5): deep-research, complete, implement, plan, resume. Evidence: Group 1 codex dispatch completed; 5 commands migrated; see evidence/codex-group1-dispatch.txt
 - [ ] T011 Codex group dispatch 2 (create/6): sk-skill, agent, changelog, feature-catalog, testing-playbook, folder_readme.
 - [ ] T012 Codex group dispatch 3 (improve/1): agent.
 - [ ] T013 Per-command read-back: confirm `:confirm` block untouched in all 11 migrated commands.

codex
**Files Modified**
- `.opencode/commands/spec_kit/deep-research.md`
- `.opencode/commands/spec_kit/complete.md`
- `.opencode/commands/spec_kit/implement.md`
- `.opencode/commands/spec_kit/plan.md`
- `.opencode/commands/spec_kit/resume.md`
- `.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md`
- `.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt`

**Per-Command Status**
- `/spec_kit:deep-research`: 11 fields migrated | Tier-2 candidates: `spec_folder` | `:confirm` preserved: yes | argument-hint updated: yes
- `/spec_kit:complete`: 18 fields migrated | Tier-2 candidates: `spec_folder`, `research_intent` | `:confirm` preserved: yes | argument-hint updated: yes
- `/spec_kit:implement`: 8 fields migrated | Tier-2 candidates: `spec_folder`, `resume_choice` | `:confirm` preserved: yes | argument-hint updated: yes
- `/spec_kit:plan`: 18 fields migrated | Tier-2 candidates: `spec_folder`, `research_intent` | `:confirm` preserved: yes | argument-hint updated: yes
- `/spec_kit:resume`: 10 fields migrated | Tier-2 candidates: `spec_folder`, `continuation_choice` | `:confirm` preserved: yes | argument-hint updated: yes

**Decisions**
- Used `{spec_path}/complete-config.json`, `{spec_path}/implement-config.json`, `{spec_path}/plan-config.json`, and `{spec_path}/resume-config.json` for commands without an existing setup config path.
- Defaulted `dispatch_mode` to `single_agent` in `:auto` because the legacy prompt marks it recommended.
- Kept `spec_folder` as Tier-2 only when detection/choice is ambiguous; pure absence fails fast.
- Did not touch any paired YAML assets.

**Concerns**
- `complete`/`plan` intake fields are documented as optional/conditional marker fields; live dispatch may later prove some need stricter required handling.
- Worktree already shows unrelated dirty files outside this scope; I did not modify them.
- Verification passed: `:confirm` block hashes unchanged for all five commands, `git diff --check` clean for scoped files, and strict spec validation passed.
diff --git a/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt
new file mode 100644
index 0000000000000000000000000000000000000000..3b0e4380f4031f08e12b15887ab0a8060add895a
--- /dev/null
+++ b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt
@@ -0,0 +1,28 @@
+# Codex Group 1 Dispatch Evidence
+
+## /spec_kit:deep-research
+- Fields migrated count: 11
+- Tier-2 candidates identified: spec_folder
+- Concerns: `spec_folder` is treated as a targeted-ask candidate only when the research topic is present but folder choice is ambiguous; missing `research_topic` goes straight to Tier 3.
+
+## /spec_kit:complete
+- Fields migrated count: 18
+- Tier-2 candidates identified: spec_folder, research_intent
+- Concerns: Chose `{spec_path}/complete-config.json` as the command-specific setup config path because no existing complete config file was present in the YAML assets.
+
+## /spec_kit:implement
+- Fields migrated count: 8
+- Tier-2 candidates identified: spec_folder, resume_choice
+- Concerns: `confirm_choice` defaults to yes only after prerequisite validation passes; invalid or absent prerequisites still fail setup rather than silently continuing.
+
+## /spec_kit:plan
+- Fields migrated count: 18
+- Tier-2 candidates identified: spec_folder, research_intent
+- Concerns: Chose `{spec_path}/plan-config.json` as the command-specific setup config path because no existing plan config file was present in the YAML assets.
+
+## /spec_kit:resume
+- Fields migrated count: 10
+- Tier-2 candidates identified: spec_folder, continuation_choice
+- Concerns: `artifact_recovery_choice` defaults to `continue_anyway` under resume auto mode so missing artifacts do not consume a Tier-2 slot; hard path absence still fails fast.
+
+EXIT_STATUS: complete
diff --git a/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
index b3c4d71f116fd6fe21e8b192db56019f72adb9f2..c463f8dee17721abef4433ca88d004ba71488bc0
--- a/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
+++ b/.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md
@@ -10,8 +10,8 @@
     packet_pointer: ".opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands"
     last_updated_at: "2026-05-11T12:35:00Z"
     last_updated_by: "claude-opus-4-7"
-    recent_action: "Authored task list"
-    next_safe_action: "Dispatch codex group 1"
+    recent_action: "Group 1 spec_kit commands migrated"
+    next_safe_action: "Dispatch group 2 create commands"
     blockers: []
     key_files: []
     session_dedup:
@@ -57,7 +57,7 @@
 <!-- ANCHOR:phase-2 -->
 ## Phase 2: Implementation
 
-- [ ] T010 Codex group dispatch 1 (spec_kit/5): deep-research, complete, implement, plan, resume.
+- [x] T010 Codex group dispatch 1 (spec_kit/5): deep-research, complete, implement, plan, resume. Evidence: Group 1 codex dispatch completed; 5 commands migrated; see evidence/codex-group1-dispatch.txt
 - [ ] T011 Codex group dispatch 2 (create/6): sk-skill, agent, changelog, feature-catalog, testing-playbook, folder_readme.
 - [ ] T012 Codex group dispatch 3 (improve/1): agent.
 - [ ] T013 Per-command read-back: confirm `:confirm` block untouched in all 11 migrated commands.

hook: Stop
hook: Stop Completed
tokens used
123,398
**Files Modified**
- `.opencode/commands/spec_kit/deep-research.md`
- `.opencode/commands/spec_kit/complete.md`
- `.opencode/commands/spec_kit/implement.md`
- `.opencode/commands/spec_kit/plan.md`
- `.opencode/commands/spec_kit/resume.md`
- `.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/tasks.md`
- `.opencode/specs/skilled-agent-orchestration/103-spec-kit-auto-mode-noninteractive-contract/002-auto-mode-contract-generalization-to-all-commands/evidence/codex-group1-dispatch.txt`

**Per-Command Status**
- `/spec_kit:deep-research`: 11 fields migrated | Tier-2 candidates: `spec_folder` | `:confirm` preserved: yes | argument-hint updated: yes
- `/spec_kit:complete`: 18 fields migrated | Tier-2 candidates: `spec_folder`, `research_intent` | `:confirm` preserved: yes | argument-hint updated: yes
- `/spec_kit:implement`: 8 fields migrated | Tier-2 candidates: `spec_folder`, `resume_choice` | `:confirm` preserved: yes | argument-hint updated: yes
- `/spec_kit:plan`: 18 fields migrated | Tier-2 candidates: `spec_folder`, `research_intent` | `:confirm` preserved: yes | argument-hint updated: yes
- `/spec_kit:resume`: 10 fields migrated | Tier-2 candidates: `spec_folder`, `continuation_choice` | `:confirm` preserved: yes | argument-hint updated: yes

**Decisions**
- Used `{spec_path}/complete-config.json`, `{spec_path}/implement-config.json`, `{spec_path}/plan-config.json`, and `{spec_path}/resume-config.json` for commands without an existing setup config path.
- Defaulted `dispatch_mode` to `single_agent` in `:auto` because the legacy prompt marks it recommended.
- Kept `spec_folder` as Tier-2 only when detection/choice is ambiguous; pure absence fails fast.
- Did not touch any paired YAML assets.

**Concerns**
- `complete`/`plan` intake fields are documented as optional/conditional marker fields; live dispatch may later prove some need stricter required handling.
- Worktree already shows unrelated dirty files outside this scope; I did not modify them.
- Verification passed: `:confirm` block hashes unchanged for all five commands, `git diff --check` clean for scoped files, and strict spec validation passed.

=== EXIT 0; WALL 631s ===
