← ClaudeAtlas

delegate-to-opencodelisted

Call the opencode CLI (`opencode run`) non-interactively to get a second opinion, run a code review, or delegate read-only or edit-capable work to an independent opencode run. Use for GLM-5.2/opencode harness delegation, primary/all agent configs with edit permissions, worktree-isolated edit workers, JSON event capture, session resume/fork flows, and gotchas around `mode: subagent`, `--auto`, prompt files, and `--dir`.
T0mSIlver/skills · ★ 1 · AI & Automation · score 70
Install: claude install-skill T0mSIlver/skills
# Delegate to opencode (CLI) Run `opencode run` non-interactively for a second opinion, review, or a delegated edit worker. Model default: `-m zai-coding-plan/glm-5.2` (verify the slug with `opencode models | grep glm`; don't hard-code `temperature`). ## Happy path 1. **Isolate and install agents.** Copy the bundled agents (they are `mode: all`, required for direct `--agent` launches) into `.opencode/agents/` of the checkout the run will use — opencode resolves `--agent` against `--dir`, so the agent must live there. Read-only review runs in the current checkout: ```bash slug="opencode-$(date +%Y%m%d-%H%M%S)" skill_dir="<directory containing this SKILL.md>" run_dir="/tmp/opencode-$slug" mkdir -p "$run_dir" .opencode/agents cp "$skill_dir/assets/reviewer.md" .opencode/agents/ ``` Edit work gets its own worktree instead (opencode never creates one): ```bash slug="opencode-$(date +%Y%m%d-%H%M%S)" skill_dir="<directory containing this SKILL.md>" worktree="../$(basename "$PWD")-$slug" git worktree add -b "agent/opencode/$slug" "$worktree" HEAD run_dir="$worktree/.agent-runs/$slug" mkdir -p "$run_dir" "$worktree/.opencode/agents" cp "$skill_dir/assets/editor.md" "$worktree/.opencode/agents/" ``` 2. **Write the brief** to `$run_dir/prompt.md`: context, exact task, constraints, acceptance criteria, verification commands, required final output. It reaches opencode inline as the positional message — `"$(cat