agentleFS
lost-rob0tlost-rob0t/skills/skills/opencode-worker/SKILL.md

opencode-worker

Skill0 starsChanged 13 days agoBSD-3-ClauseView on GitHub

opencode, worker, models, retries, isolation, automation

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run OpenCode as a bounded Unix worker while preserving stream and exit-status semantics.

    line 11
  2. Very specific:

    Use --mode isolated-mutate --dir <linked-worktree> for tasks allowed to modify files.

    line 32
  3. Very specific:

    Do not use --continue or --session for mutating work.

    line 43
  4. Distinctive:

    Treat JSON mode as raw OpenCode JSON events, not a synthesized envelope.

    line 45

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

OpenCode Worker

Goal

Run OpenCode as a bounded Unix worker while preserving stream and exit-status semantics.

Input

Pipe the complete prompt to scripts/opencode-worker. Select a logical model with --model; astra-medium resolves through config/models.tsv. Use --role for prompt metadata, not as an OpenCode CLI option.

Output

Successful model output is written to stdout. Worker and OpenCode diagnostics go to stderr. The final OpenCode status, or a signal-derived status, is preserved. --format text maps to OpenCode default; --format json maps to json.

Workflow

printf '%s\n' 'Review the current change.' |
  scripts/opencode-worker --model astra-medium --role reviewer --dir "$PWD"

Use --mode isolated-mutate --dir <linked-worktree> for tasks allowed to modify files. Read-only mode injects a no-mutation instruction. Shared/main-worktree mutation is rejected. Use --lock-file <path> to serialize workers sharing an external resource.

Rules

  • Set finite --max-retries and --max-delay; defaults are 3 and 60 seconds.
  • Retries apply only to recognizable rate-limit failures and honor bounded Retry-After values when observable.
  • Forward only documented OpenCode options. Never emulate unsupported flags.
  • Do not use --continue or --session for mutating work; use a fresh isolated worktree instead.
  • Treat JSON mode as raw OpenCode JSON events, not a synthesized envelope.
  • Empty prompts and prompts at or above --max-prompt-bytes (default 131072) are rejected before any model call; Linux caps one process argument near that size, so split large tasks instead of raising the limit.

See references/contract.md for options and model-map details.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.