Conduct
Classifies tasks by type, routes to lanes, dispatches to workers, reviews with Claude. Loops until done.
# /conduct — Lane-Based Orchestrator
Classifies tasks by type, routes to lanes, dispatches to workers, reviews with Claude. Loops until done.
## CRITICAL: Dispatch Is Mandatory
This operator REQUIRES external worker dispatch. Claude is the planner and reviewer ONLY.
Implementation tasks MUST go to opencode_go workers via `./bin/oneshot dispatch` or `./bin/oneshot dispatch-many`.
**There is no "do it inline" fallback. If dispatch fails, log a blocker and escalate.**
## Usage
/conduct
/conduct
## Behavior
### Phase 0: Intake (BLOCKING — nothing else runs until complete)
1. **Detect providers and verify routing works**
```bash
./bin/oneshot lanes
The router MUST return a valid lane with workers. If it fails, stop and tell the user.
.oneshot/config/models.yaml MUST exist. If it doesn't, stop and tell the user.
Ask 5 required questions using AskUserQuestion — do NOT proceed until answered:
- What is the goal / deliverable?
- What does done look like? (acceptance criteria — be specific)
- What is in scope? What is explicitly out of scope?
- Any constraints? (tech stack, time, things to avoid)
- What is the riskiest / most uncertain part?
Initialize
1shot/in the project root (create if missing):- Create dated subdirectory:
1shot/{YYYY-MM-DD}-{session-slug}/ - Write intake answers to
1shot/{session-dir}/PROJECT.md - Update
1shot/{session-dir}/STATE.md: phase = "intake → plan" - Create
1shot/{session-dir}/skills/directory - NEVER clobber an existing session directory — each /conduct run gets its own folder
- Create dated subdirectory:
Show PROJECT.md to user and confirm before proceeding.
Phase 1: Plan
- Explore codebase (Explore subagent) — identify impacted files
- Persist exploration artifact — Write structured output to
1shot/explore.json:{ "goal": "[from PROJECT.md]", "candidate_files": ["list of relevant files"], "commands_to_run": ["test commands", "lint commands"], "constraints": ["architectural constraints discovered"], "unknowns": ["open questions to resolve"], "risk_assessment": {"level": "low|medium|high", "reasoning": "..."}, "existing_patterns": ["patterns found in relevant files"] } - Docs Check —
cat ~/github/docs-cache/docs/cache/.index.md→ cache missing docs via/doc - Write
1shot/ROADMAP.md— phases and success criteria - Task specs for non-trivial work: Generate TASK_SPEC.md from
templates/TASK_SPEC.md - Generate machine-readable plan — Create
1shot/plan.jsonfromcore/plan_schema.py - Create native tasks — one TaskCreate per deliverable
- Classify each task:
python -m core.router.resolve --class <task_class> --category <category> - Update STATE.md: phase = "plan → build"
Phase 2: Build Loop (ALL implementation via dispatch)
Repeat until no unblocked tasks remain:
- Pick next unblocked task (
TaskList→ lowest ID pending) TaskUpdate→ in_progress- Select methodology (automatic — based on task description):
- Bug fix →
/debugprotocol (investigate → analyze → hypothesize → fix) - New feature →
/tddprotocol (RED-GREEN-REFACTOR) - Doc edit, config change, refactor: no special methodology needed
- Bug fix →
- Classify and dispatch (MANDATORY — no exceptions):
- Determine task class (see task-classes.md)
- Resolve lane:
python -m core.router.resolve --class <class> --category <category> - If lane is NOT premium: Build self-contained prompt → dispatch to worker:
./bin/oneshot dispatch \ --lane <lane> \ --task-file /tmp/task-spec.md \ --allow-dirty - If lane IS premium: Claude handles inline (planning, review, integration only)
- For parallel tasks:
./bin/oneshot dispatch-many --lane <lane> \ --task-file /tmp/task-a.md \ --task-file /tmp/task-b.md \ --task-file /tmp/task-c.md - CRITICAL: Use subprocess dispatch, NOT Agent tool subagents.
core.dispatch.runspawns lightweight CLI processes. Agent tool spawns full Claude Code sessions — never use Agent for dispatch. - If NO workers are available: log blocker, stop, tell user
- Review: If task requires review, dispatch review to reviewer
- Scope check —
git diff --name-onlyagainst TASK_SPEC "Files Involved" - Verify: Run Phase 3 verification checklist
TaskUpdate→ completed (only after verification passes)- Update
1shot/STATE.md - Circuit breaker: if same task failed 3x → log blocker → skip → continue
If 3 consecutive tasks hit circuit breaker → stop, surface to user.
Phase 3: Verify (MANDATORY — evidence required)
No verification, no completion. Assertions don't count — show the output.
- Run targeted tests — if test files exist for the changed files, run them.
- Run lint/static analysis — shellcheck, prettier, ruff, or whatever the project uses.
- Run type check — tsc, pyright, or equivalent.
- Check acceptance criteria — go through each criterion, cite evidence.
- Review diff —
git diffand confirm changed files match plan scope.
If any check fails:
TaskUpdateback to pending — never mark as completed with failing checks- Loop back to Phase 2
- Document persistent failures in
1shot/BLOCKERS.md
Phase 4: Challenge (two-stage review)
Stage A: Spec Compliance
Re-read 1shot/PROJECT.md. For each acceptance criterion: cite evidence. Check scope violations.
Stage A fail → do not run Stage B. Create tasks to address gaps.
Stage B: Code Quality
# Dispatch a single task
./bin/oneshot dispatch --lane routine_coder --task-file /tmp/task.md
# Dispatch multiple tasks in parallel
./bin/oneshot dispatch-many --lane routine_coder \
--task-file /tmp/task-a.md \
--task-file /tmp/task-b.md
Phase 5: Session-End L
Maintain Conduct?
Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.
[Conduct on getagentictools](https://getagentictools.com/loops/khamel83-conduct-lane-based-orchestrator?ref=badge) npx agentictools info loops/khamel83-conduct-lane-based-orchestrator The second line is the CLI lookup for this page — handy in READMEs and docs.