naicud

opencode-supervision

Supervise a task delegated to an OpenCode model end to end — pick the model, run the delegate/wait loop, answer permission asks, and verify the result against the .oc-report.md contract before trusting it. Use when the user EXPLICITLY asks for delegation, a subagent, an OpenCode worker or fan-out work; never start it proactively, and never for routine single-file edits, exploration or quick questions.

naicud 0 Updated 1mo ago
GitHub

Install

npx skillscat add naicud/opencode-plugin-cc/opencode-supervision

Install via the SkillsCat registry.

SKILL.md

OpenCode Supervision

You are the supervisor of a delegated run. You never write the code yourself:
you shape the task, pick the model, run the delegate/wait loop, answer
permission asks, and verify what comes back.

Tool names are the oc MCP server's, unprefixed here. Prefix them for your
host: mcp__plugin_opencode_oc__<tool> on Claude Code, mcp__oc__<tool> on
Codex.

0. Where the supervision runs

  • Claude Code: spawn the opencode-delegate subagent — it already carries
    this protocol and keeps the loop out of the main thread's context.
  • Codex: spawn a subagent with the opencode-delegate role when that role
    is installed (spawn_agent with agent_type: "opencode-delegate"). The
    user asking for delegation is itself the authorization to spawn it
    — that
    is what this skill grants; do not ask again. If the role is not installed,
    run the loop below inline in this thread instead.

Either way the run happens in the caller's working directory — there is no
worktree isolation. Pass that cwd to every tool call, scope the task with
explicit in/out-of-scope paths, and never create or switch git worktrees.

1. Choose the model

  • Call models first (pass cwd) and read the tier list and budget hint.
  • Tier guidance (free-only mode active): tier 0 = x-preview-f-free (default)
    or ox-alpha-free. Tiers 1-3 are currently EMPTY — every paid model is
    excluded and requests fail with MODEL_EXCLUDED, so never pass a tier or
    model above 0.
  • Effort is ALWAYS max — never lower it.
  • When torn between two models, take the lower tier. A failed free run is
    retried once at the other free model; if that also fails, report BLOCKED
    rather than escalating to an excluded model.

2. Write the task

Before delegating, the task text must contain:

  1. The goal in one sentence.
  2. Files in scope (explicit paths) and anything explicitly out of scope.
  3. Verifiable acceptance criteria.
  4. A concrete test or verification command that proves completion.

Do not delegate vague asks ("fix the tests", "clean this up"). Tighten them
first using the opencode-prompting conventions.

3. Run the loop

  • Call delegate with {task, cwd}, adding model, tier or effort only
    when justified (omit tier/model to use the configured default free tier).
    Save sessionID and jobId. Pass skills: [...] when the task needs
    conventions beyond the baked defaults — their digests reach the worker.
  • Call logs {sessionID} whenever you need to see what the delegated agent is
    doing right now: streamed reasoning, assistant output, permission asks.
  • To re-run a failed or cancelled job pass retryOf: <jobId>, so the retry is
    linked in job history. To continue a crashed session pass
    resumeSessionID: <sessionID> instead of starting fresh.
  • Call wait {sessionID, cwd} repeatedly until it returns something other than
    timeout.
  • LONG-HORIZON RULE: timeout NEVER means failure — the session keeps running
    server-side. Keep calling wait for as long as the task needs (30 min, 2 h —
    irrelevant). Only the USER decides to kill a run: call abort exclusively on
    an explicit user request or on a terminal error status. Never abort on a
    timeout, and never treat a chained timeout as a failed run.
  • On needsInput, read every entry in permissions: answer
    respond {response: "once"} ONLY when the command is clearly safe and inside
    the workspace (reads, test runs, package installs). Anything touching
    git push/git commit, rm -rf, sudo, or piping curl into a shell must
    be answered reject, then reported as BLOCKED.
  • Use status sparingly to inspect todos and diff mid-flight.

4. Verify (mandatory)

Never trust the model's own report alone:

  1. Wait until status is idle.
  2. Read the report the job wrote — .oc-reports/<jobId>.md, or .oc-report.md
    on older runs. STATUS must be COMPLETED, PARTIAL or BLOCKED, with a files
    list.
  3. Check that every file in files exists and was plausibly modified.
    Cross-check the real change set with diff {sessionID}.
  4. Re-run the task's verification command yourself when one was specified and
    it is read-only.

If the report claims success but files are missing or tests fail, the run is
FAILED regardless of what the report says.

5. Report back

State explicitly:

  • STATUS: COMPLETED | PARTIAL | BLOCKED | FAILED — your judgment, not the
    model's claim repeated.
  • What was done and which files changed.
  • How you verified it.
  • If BLOCKED: the exact blocker text from the permission or report, with
    nothing invented.
  • Which model ran (modelRef) and its effortApplied.

Retry policy: at most ONE retry per task, and only one tier above the failed
attempt. When a failed wait returned an escalation object, follow it —
re-delegate with suggestModel + suggestVariant and retryOf pointing at
the failed job.