Conductor
Primary loop:
Setup -> Track -> Spec(+approval) -> Plan(+approval) -> Implement -> Review -> Reconcile
Preserved Conductor invariants:
- Durable context is on disk, not only in chat memory
- Work is represented as tracks
- Important tracks carry both spec and plan artifacts
- Review is a first-class stage before closure
OpenCode-specific adaptation:
- Use
task(subagent_type="...") for delegation
- Use
.omc/conductor/ paths used by OMC hooks
- Use
question for gated approvals when user decisions are required
Primary directory (read-write)
.omc/conductor/
conductor-state.json # Index of all tracks (regenerable from track metadata)
context/ # Shared project context
product.md
tech-stack.md
workflow.md
styleguides/*.md
tracks/
<track-slug>/ # One directory per track
metadata.json # Track state, phase, git info, timestamps
spec.md # Requirements specification
plan.md # Phased implementation plan with task checkboxes
review.md # Review verdict and evidence (created at review phase)
research/ # Optional: created when uncertainty is high
state.json
findings.md
archive/ # Completed or cancelled tracks moved here
External directory discovery (read-only import)
Conductor also scans for tracks created by other tools (e.g., Codex conductor) so that work can be continued across tools without manual copying.
Scan paths (checked in order during Setup/Resume):
.omc/conductor/tracks/ — primary, read-write
conductor/tracks/ — Codex conductor layout, read-only import
Discovery rules:
- On Setup/Resume, scan each path for subdirectories containing
metadata.json or spec.md.
- Codex tracks use a slightly different metadata schema. Normalize on read:
| Codex field |
OpenCode conductor field |
Mapping |
track_id |
track_id |
Direct |
type ("feature") |
type |
Direct |
status ("in_progress") |
status → phase |
"in_progress" → status "in_progress", phase "implementing" |
description |
description |
Direct |
created_at / updated_at |
created_at / updated_at |
Direct |
| (missing fields) |
git_branch, git_start_commit, blocked_by, supersedes |
Default to null |
- Codex tracks that have
spec.md + plan.md but no metadata.json are also recognized — infer metadata from filenames and plan checkbox state.
- External tracks appear in
status output with an [external] tag and their source path.
- External tracks are read-only by default. To work on an external track, conductor copies it into
.omc/conductor/tracks/<slug>/ first (prompted via question).
Context fallback: If .omc/conductor/context/ is empty or missing during setup, also check:
conductor/product.md → seed context/product.md
conductor/tech-stack.md → seed context/tech-stack.md
conductor/workflow.md → seed context/workflow.md
conductor/code_styleguides/*.md → seed context/styleguides/*.md
conductor-state.json (index — regenerable from track metadata)
{
"active": true,
"activeTrack": "<track-slug>",
"tracks": {
"<track-slug>": {
"slug": "<track-slug>",
"title": "Human-readable title",
"type": "feature",
"status": "in_progress",
"phase": "implementing",
"source": "primary | external"
}
},
"_meta": {
"version": "2.0.0",
"lastWriteAt": "ISO8601",
"cwd": "/path/to/project"
}
}
metadata.json (per-track — authoritative source of track state)
{
"track_id": "<track-slug>",
"title": "Human-readable title",
"type": "feature | bugfix | tech-debt | hotfix",
"status": "spec | planned | in_progress | review | done | cancelled",
"phase": "setup | spec | planning | implementing | reviewing | complete",
"description": "Short summary of the track goal",
"supersedes": null,
"blocked_by": null,
"git_branch": "conductor/<track-slug>",
"git_start_commit": "<sha>",
"current_task_index": 0,
"created_at": "ISO8601",
"updated_at": "ISO8601",
"completed_at": null
}
State management rules
metadata.json in each track is the authoritative source for that track's state.
conductor-state.json is an index/cache that summarizes all tracks for quick lookup.
- If
conductor-state.json is missing or stale, regenerate it from tracks/*/metadata.json.
- Track status transitions happen in
metadata.json first, then sync to the index.
Conductor workflow operations (can be executed by skill protocol even if no dedicated slash command exists):
implement <slug|active>
refresh [scope]
revert <slug>
archive <slug>
Track Selection / Creation
- If user provided slug/title, resolve it against tracks from all discovered paths (primary + external).
- If the resolved track is external, ask user whether to import it into
.omc/conductor/tracks/ before proceeding.
- Else choose active track first, otherwise earliest non-complete track.
- If no track exists, create one:
- Generate URL-safe slug from title (e.g.,
payment-webhook-retry)
- Create
tracks/<slug>/metadata.json with initial phase spec
- Create git branch
conductor/<slug> from current HEAD
- Update
conductor-state.json index
Preflight Context
- read in order: context docs → active spec → active plan → relevant code/config.
- Output compact brief: goal, accepted constraints, current phase, next task, blockers.
Spec Generation (phase: spec)
- Delegate to
analyst for requirements structure.
- Delegate to
architect for system boundaries, risks, and acceptance criteria.
- Persist to
tracks/<slug>/spec.md.
- Gate: present spec to user for approval via
question before proceeding.
- Update
metadata.json status to planned only after approval.
Plan Generation (phase: planning)
- Delegate to
planner for phased tasks.
- Plan must follow the phased task format (see Plan Format below).
- Require testable acceptance criteria and explicit verification commands.
- Persist to
tracks/<slug>/plan.md.
- Gate: present plan to user for approval via
question before proceeding.
- Optionally delegate to
critic for plan review before user approval.
Implement (phase: implementing)
- Execute tasks sequentially per plan phase via
executor.
- Before starting each task: update its checkbox from
[ ] to [~] in plan.md.
- After completing each task: update its checkbox from
[~] to [x] in plan.md.
- Run deterministic checks per task (lint/type/test/build as applicable).
- After completing the last task of each phase: run phase verification protocol.
- Update
metadata.json field current_task_index as tasks progress.
Phase Verification (within implement)
- After completing the last task of a phase:
- Announce phase completion and run automated checks.
- Prepare a manual verification checklist for user-visible behavior.
- Wait for explicit user feedback via
question.
- Create a checkpoint commit when the phase is accepted.
- Record the checkpoint SHA in plan.md.
- If verification fails: reopen relevant tasks, return to implement.
Review (phase: reviewing)
- Use
code-reviewer and verifier as default review pair.
- Add
security-reviewer when auth, secrets, trust-boundaries, or user input changed.
- Compute git diff from
git_start_commit..HEAD for the review scope.
- Persist verdict to
tracks/<slug>/review.md.
Reconcile / Close
- If review fails, reopen tasks and return to implement.
- If review passes, mark track complete and record concise evidence.
- Update
metadata.json: status: "done", phase: "complete", completed_at: ISO8601.
- Optionally move completed track to
archive/ via archive subcommand.
# Implementation Plan
## Phase 1: <Phase Title>
- [ ] Task: <task description>
- [ ] <sub-step 1>
- [ ] <sub-step 2>
- [ ] Verify relevant tests pass
- [ ] Task: <task description>
- [ ] <sub-step 1>
- [ ] Verify relevant tests pass
- [ ] Task: Conductor - Phase Verification '<Phase Title>'
## Phase 2: <Phase Title>
...
Rules:
- Each phase groups related tasks that can be verified together.
- Tasks use
[ ] (pending), [~] (in-progress), [x] (done) checkboxes.
- Each phase ends with a verification gate task.
- Tasks should be ~1-3 hours of work each.
- Sub-steps are optional but encouraged for complex tasks.
Trigger examples:
- External dependency behavior changed recently
- Two plausible architectural options with unclear tradeoffs
- Security/compliance requirement needs primary-source confirmation
Research protocol:
- Decompose into 3-5 research stages.
- Parallel execute stage analysis with
scientist agents (max 5 concurrent).
- Verify contradictions; output
[VERIFIED] or [CONFLICTS:<list>].
- Synthesize into a decision note appended to spec/plan.
Persist research artifacts inside the track directory:
tracks/<slug>/research/state.json
tracks/<slug>/research/findings.md
[FINDING:<id>] <title>
<analysis>
[/FINDING]
[EVIDENCE:<id>]
- Source: <url or file>
- Date: <YYYY-MM-DD>
- Relevance: <why it matters>
[/EVIDENCE]
[CONFIDENCE:HIGH|MEDIUM|LOW]
<brief rationale>
Quality gates:
- Every
[FINDING] must include [EVIDENCE]
- Unsupported claims must be downgraded or removed
- Unresolved contradictions must remain explicit
Example:
## Conductor Status
**Active track:** payment-webhook-retry (feature)
**Phase:** implementing (3/4 phases done)
**Tasks:** 9/13 done, 1 in-progress, 3 pending
**Next:** Complete task "Add retry backoff logic" in Phase 4
**Blockers:** None
**Review:** Not yet started
1---2name: conductor-23description: Use when user wants durable Context->Spec->Plan->Implement tracks ('conductor', 'structured workflow', 'track this', 'context then plan'). Creates and governs `.omc/conductor/` artifacts for OpenCode multi-session delivery.4---56# Conductor78<Purpose>9Conductor is a durable track-management workflow for OpenCode. It preserves long-lived context on disk, turns ambiguous requests into spec+plan artifacts, and controls implementation/review so work can safely span multiple sessions.1011Primary loop:12`Setup -> Track -> Spec(+approval) -> Plan(+approval) -> Implement -> Review -> Reconcile`13</Purpose>1415<Use_When>16- User explicitly asks for `conductor`, `structured workflow`, or `track this`17- Work needs persistent artifacts and traceability across sessions18- Feature scope is large enough that spec and plan should be reviewed before coding19- Team needs deterministic progress reporting and reversible checkpoints20</Use_When>2122<Do_Not_Use_When>23- Small one-off bugfix or single-file change (use direct executor flow)24- User wants immediate end-to-end autonomous build (use `autopilot`)25- User is still exploring alternatives with no commitment to tracked artifacts (use `omc-plan`/`ralplan` first)26</Do_Not_Use_When>2728<Compatibility>29This skill is aligned to the Conductor protocol in `oh-my-codex`, adapted to OpenCode runtime primitives, and incorporates best practices from Gemini Conductor, Kiro SDD, and cc-sdd.3031Preserved Conductor invariants:32- Durable context is on disk, not only in chat memory33- Work is represented as tracks34- Important tracks carry both spec and plan artifacts35- Review is a first-class stage before closure3637OpenCode-specific adaptation:38- Use `task(subagent_type="...")` for delegation39- Use `.omc/conductor/` paths used by OMC hooks40- Use `question` for gated approvals when user decisions are required41</Compatibility>4243<Execution_Policy>44- Keep a single active track by default unless user explicitly asks for parallel tracks45- Retrieval-first: read repository facts before proposing architecture or implementation46- Plan is the execution source of truth; do not silently drift from accepted plan47- Prefer minimal, reversible edits and checkpoint after each completed task cluster48- If tool calls fail, stop that phase, report blocker, and avoid speculative continuation49- Spec must be approved before plan generation; plan must be approved before implementation50</Execution_Policy>5152<Directory_Contract>53Tracks are organized **per-track** — all artifacts for one track live in a single directory.54This makes it easy to browse, archive, or delete a complete feature, and keeps related spec+plan+review co-located for agent context loading.5556### Primary directory (read-write)5758```text59.omc/conductor/60 conductor-state.json # Index of all tracks (regenerable from track metadata)61 context/ # Shared project context62 product.md63 tech-stack.md64 workflow.md65 styleguides/*.md66 tracks/67 <track-slug>/ # One directory per track68 metadata.json # Track state, phase, git info, timestamps69 spec.md # Requirements specification70 plan.md # Phased implementation plan with task checkboxes71 review.md # Review verdict and evidence (created at review phase)72 research/ # Optional: created when uncertainty is high73 state.json74 findings.md75 archive/ # Completed or cancelled tracks moved here76```7778### External directory discovery (read-only import)7980Conductor also scans for tracks created by other tools (e.g., Codex conductor) so that work can be continued across tools without manual copying.8182**Scan paths** (checked in order during Setup/Resume):831. `.omc/conductor/tracks/` — primary, read-write842. `conductor/tracks/` — Codex conductor layout, **read-only** import8586**Discovery rules:**87- On Setup/Resume, scan each path for subdirectories containing `metadata.json` or `spec.md`.88- Codex tracks use a slightly different metadata schema. Normalize on read:8990| Codex field | OpenCode conductor field | Mapping |91|-------------|----------------------|---------|92| `track_id` | `track_id` | Direct |93| `type` (`"feature"`) | `type` | Direct |94| `status` (`"in_progress"`) | `status` → `phase` | `"in_progress"` → status `"in_progress"`, phase `"implementing"` |95| `description` | `description` | Direct |96| `created_at` / `updated_at` | `created_at` / `updated_at` | Direct |97| *(missing fields)* | `git_branch`, `git_start_commit`, `blocked_by`, `supersedes` | Default to `null` |9899- Codex tracks that have `spec.md` + `plan.md` but no `metadata.json` are also recognized — infer metadata from filenames and plan checkbox state.100- External tracks appear in `status` output with an `[external]` tag and their source path.101- External tracks are **read-only by default**. To work on an external track, conductor copies it into `.omc/conductor/tracks/<slug>/` first (prompted via `question`).102103**Context fallback:** If `.omc/conductor/context/` is empty or missing during setup, also check:104- `conductor/product.md` → seed `context/product.md`105- `conductor/tech-stack.md` → seed `context/tech-stack.md`106- `conductor/workflow.md` → seed `context/workflow.md`107- `conductor/code_styleguides/*.md` → seed `context/styleguides/*.md`108109### conductor-state.json (index — regenerable from track metadata)110111```json112{113 "active": true,114 "activeTrack": "<track-slug>",115 "tracks": {116 "<track-slug>": {117 "slug": "<track-slug>",118 "title": "Human-readable title",119 "type": "feature",120 "status": "in_progress",121 "phase": "implementing",122 "source": "primary | external"123 }124 },125 "_meta": {126 "version": "2.0.0",127 "lastWriteAt": "ISO8601",128 "cwd": "/path/to/project"129 }130}131```132133### metadata.json (per-track — authoritative source of track state)134135```json136{137 "track_id": "<track-slug>",138 "title": "Human-readable title",139 "type": "feature | bugfix | tech-debt | hotfix",140 "status": "spec | planned | in_progress | review | done | cancelled",141 "phase": "setup | spec | planning | implementing | reviewing | complete",142 "description": "Short summary of the track goal",143 "supersedes": null,144 "blocked_by": null,145 "git_branch": "conductor/<track-slug>",146 "git_start_commit": "<sha>",147 "current_task_index": 0,148 "created_at": "ISO8601",149 "updated_at": "ISO8601",150 "completed_at": null151}152```153154### State management rules155156- `metadata.json` in each track is the **authoritative** source for that track's state.157- `conductor-state.json` is an **index/cache** that summarizes all tracks for quick lookup.158- If `conductor-state.json` is missing or stale, regenerate it from `tracks/*/metadata.json`.159- Track status transitions happen in `metadata.json` first, then sync to the index.160</Directory_Contract>161162<Subcommand_Routing>163Native command hooks currently support:164- `setup`165- `track <title> [description]`166- `plan <slug>`167- `review <slug>`168- `status [slug]`169170Conductor workflow operations (can be executed by skill protocol even if no dedicated slash command exists):171- `implement <slug|active>`172- `refresh [scope]`173- `revert <slug>`174- `archive <slug>`175</Subcommand_Routing>176177<Workflow>1781. **Setup / Resume**179 - If `conductor-state.json` exists and `active=true`, resume from current phase.180 - Otherwise initialize `.omc/conductor/` and context documents.181 - Bootstrap `context/tech-stack.md` from `.omc/project-memory.json`, AGENTS.md, or package.json when available.182 - Bootstrap `context/product.md` from README.md, existing conductor docs, or user input.183 - **Cross-directory scan**: also check `conductor/` (Codex layout) for existing context docs and tracks (see External Directory Discovery).184 - If context files in `.omc/conductor/context/` are empty but `conductor/product.md` etc. exist, seed from them.185 - On resume: read all `tracks/*/metadata.json` from **both** primary and external paths to reconstruct index, output compact status brief.1861872. **Track Selection / Creation**188 - If user provided slug/title, resolve it against tracks from **all** discovered paths (primary + external).189 - If the resolved track is external, ask user whether to import it into `.omc/conductor/tracks/` before proceeding.190 - Else choose active track first, otherwise earliest non-complete track.191 - If no track exists, create one:192 - Generate URL-safe slug from title (e.g., `payment-webhook-retry`)193 - Create `tracks/<slug>/metadata.json` with initial phase `spec`194 - Create git branch `conductor/<slug>` from current HEAD195 - Update `conductor-state.json` index1961973. **Preflight Context**198 - read in order: context docs → active spec → active plan → relevant code/config.199 - Output compact brief: goal, accepted constraints, current phase, next task, blockers.2002014. **Spec Generation** (phase: `spec`)202 - Delegate to `analyst` for requirements structure.203 - Delegate to `architect` for system boundaries, risks, and acceptance criteria.204 - Persist to `tracks/<slug>/spec.md`.205 - **Gate: present spec to user for approval via `question` before proceeding.**206 - Update `metadata.json` status to `planned` only after approval.2072085. **Plan Generation** (phase: `planning`)209 - Delegate to `planner` for phased tasks.210 - Plan must follow the phased task format (see Plan Format below).211 - Require testable acceptance criteria and explicit verification commands.212 - Persist to `tracks/<slug>/plan.md`.213 - **Gate: present plan to user for approval via `question` before proceeding.**214 - Optionally delegate to `critic` for plan review before user approval.2152166. **Implement** (phase: `implementing`)217 - Execute tasks sequentially per plan phase via `executor`.218 - Before starting each task: update its checkbox from `[ ]` to `[~]` in plan.md.219 - After completing each task: update its checkbox from `[~]` to `[x]` in plan.md.220 - Run deterministic checks per task (lint/type/test/build as applicable).221 - After completing the last task of each phase: run phase verification protocol.222 - Update `metadata.json` field `current_task_index` as tasks progress.2232247. **Phase Verification** (within implement)225 - After completing the last task of a phase:226 1. Announce phase completion and run automated checks.227 2. Prepare a manual verification checklist for user-visible behavior.228 3. Wait for explicit user feedback via `question`.229 4. Create a checkpoint commit when the phase is accepted.230 5. Record the checkpoint SHA in plan.md.231 - If verification fails: reopen relevant tasks, return to implement.2322338. **Review** (phase: `reviewing`)234 - Use `code-reviewer` and `verifier` as default review pair.235 - Add `security-reviewer` when auth, secrets, trust-boundaries, or user input changed.236 - Compute git diff from `git_start_commit..HEAD` for the review scope.237 - Persist verdict to `tracks/<slug>/review.md`.2382399. **Reconcile / Close**240 - If review fails, reopen tasks and return to implement.241 - If review passes, mark track complete and record concise evidence.242 - Update `metadata.json`: `status: "done"`, `phase: "complete"`, `completed_at: ISO8601`.243 - Optionally move completed track to `archive/` via `archive` subcommand.244</Workflow>245246<Plan_Format>247Plans must follow phased task structure with checkboxes for progress tracking:248249```markdown250# Implementation Plan251252## Phase 1: <Phase Title>253254- [ ] Task: <task description>255 - [ ] <sub-step 1>256 - [ ] <sub-step 2>257 - [ ] Verify relevant tests pass258259- [ ] Task: <task description>260 - [ ] <sub-step 1>261 - [ ] Verify relevant tests pass262263- [ ] Task: Conductor - Phase Verification '<Phase Title>'264265## Phase 2: <Phase Title>266...267```268269Rules:270- Each phase groups related tasks that can be verified together.271- Tasks use `[ ]` (pending), `[~]` (in-progress), `[x]` (done) checkboxes.272- Each phase ends with a verification gate task.273- Tasks should be ~1-3 hours of work each.274- Sub-steps are optional but encouraged for complex tasks.275</Plan_Format>276277<Research_Integration>278When uncertainty is high (new SDKs, conflicting docs, unknown architecture edges), run a research pass before locking spec/plan.279280Trigger examples:281- External dependency behavior changed recently282- Two plausible architectural options with unclear tradeoffs283- Security/compliance requirement needs primary-source confirmation284285Research protocol:2861. **Decompose** into 3-5 research stages.2872. **Parallel execute** stage analysis with `scientist` agents (max 5 concurrent).2883. **Verify** contradictions; output `[VERIFIED]` or `[CONFLICTS:<list>]`.2894. **Synthesize** into a decision note appended to spec/plan.290291Persist research artifacts inside the track directory:292- `tracks/<slug>/research/state.json`293- `tracks/<slug>/research/findings.md`294</Research_Integration>295296<Research_Evidence_Format>297Use structured evidence blocks:298299```text300[FINDING:<id>] <title>301<analysis>302[/FINDING]303304[EVIDENCE:<id>]305- Source: <url or file>306- Date: <YYYY-MM-DD>307- Relevance: <why it matters>308[/EVIDENCE]309310[CONFIDENCE:HIGH|MEDIUM|LOW]311<brief rationale>312```313314Quality gates:315- Every `[FINDING]` must include `[EVIDENCE]`316- Unsupported claims must be downgraded or removed317- Unresolved contradictions must remain explicit318</Research_Evidence_Format>319320<Agent_Routing>321- Setup/context scan: `explore`322- Requirements/spec: `analyst` + `architect`323- Plan refinement: `planner` + `critic`324- Implementation: `executor`325- Test strategy/fixes: `test-engineer`326- Review/validation: `code-reviewer` + `verifier` (+ `security-reviewer` when needed)327- Research branches: `scientist`328</Agent_Routing>329330<Status_Contract>331`status` output should always include:332- active track (title + slug)333- track type and phase334- progress summary (phases completed / total, tasks completed/in-progress/pending)335- next concrete action336- blockers (or `None`)337- latest review verdict (if present)338- research verification status (if research was run)339340Example:341```342## Conductor Status343344**Active track:** payment-webhook-retry (feature)345**Phase:** implementing (3/4 phases done)346**Tasks:** 9/13 done, 1 in-progress, 3 pending347**Next:** Complete task "Add retry backoff logic" in Phase 4348**Blockers:** None349**Review:** Not yet started350```351</Status_Contract>352353<Failure_Handling>354- If setup/context files are missing: stop and run setup first355- If plan is missing: do not implement; return to plan phase356- If spec not approved: do not generate plan; wait for approval357- If verification fails: reopen related tasks and continue implementation358- If evidence is insufficient in research mode: emit `[PROMISE:RESEARCH_BLOCKED]` with blocker details359- If `conductor-state.json` is missing or corrupt: regenerate from `tracks/*/metadata.json`360</Failure_Handling>361362<Examples>363<Good>364User: "conductor track payment-webhook-retry and plan it"365Why good: Explicit track+planning request with durable artifacts.366</Good>367368<Good>369User: "conductor for this multi-service auth refactor; do research first"370Why good: High-uncertainty, multi-session scope benefits from research-integrated conductor flow.371</Good>372373<Good>374User: "conductor status"375Why good: Resume from where the last session left off with a compact status overview.376</Good>377378<Bad>379User: "conductor fix typo in README"380Why bad: Tiny one-off task; overhead exceeds benefit.381</Bad>382</Examples>383384<Final_Checklist>385- [ ] Conductor state initialized or resumed correctly386- [ ] Active track resolved deterministically387- [ ] Spec approved by user before plan generation388- [ ] Plan approved by user before implementation389- [ ] Implementation updates map back to plan tasks (checkboxes in sync)390- [ ] Phase verification gates executed after each plan phase391- [ ] Review artifacts recorded with clear verdict392- [ ] Research evidence attached for high-uncertainty decisions393- [ ] Status reports actionable next step and blockers394- [ ] metadata.json is authoritative; conductor-state.json stays in sync395</Final_Checklist>