Index of every page on this site: llms.txt
All skills
Run it yourself

Delegate coding tasks to OpenCode CLI for execution, or discuss implementation approaches with it. OpenCode is a free, open-source AI coding agent with broad model support (Claude, GPT, Gemini, and 75+ providers via Models.dev). Use when the plan is clear and needs hands-on coding. Claude handles architecture, strategy, copywriting, and ambiguous problems better.

Use this Skill: https://skilld.dev/gh/zenstudiolab/skills/opencode

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈94 tokens for metadata: the name and description. ≈982 when used: this file. ≈872 more on demand in 1 file.

Description uses 4.7% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈376 characters, or 4.7%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Critical Rules (Black Box Protocol)

  • ONLY interact with OpenCode through the bundled shell script
  • Run script ONCE per task, read output file and proceed (no re-runs)
  • Do NOT read or inspect the script source code (black box)
  • Always quote file paths with brackets/spaces/special chars
  • Keep task prompt focused (~500 words max)
  • Never paste file contents in prompt - use --file flag instead
  • Don't reference SKILL.md itself in prompts

How to Call the Script

~/.agents/skills/opencode/scripts/ask_opencode.sh "Your request" ~/.agents/skills/opencode/scripts/ask_opencode.sh "Refactor" --file src/components/UserList.tsx --file src/components/UserDetail.tsx ~/.agents/skills/opencode/scripts/ask_opencode.sh "Continue task" --session <session_id> ~/.agents/skills/opencode/scripts/ask_opencode.sh "Complex task" --watch ~/.agents/skills/opencode/scripts/ask_opencode.sh --status <session_id>

Output Format: session_id=<thread_id> output_path=<path to markdown file> status_path=<path to status file> # while running

Decision Policy (When to Call)

  • Implementation plan is clear and needs coding execution
  • Batch refactoring, code generation, repetitive changes
  • Multiple files need coordinated modifications
  • Using free/open-source models (OpenCode supports free models)
  • Multi-turn conversations where you want to continue a session
  • Writing/updating tests based on existing code
  • Simple-to-moderate bug fixes with identified root cause

When to prefer OpenCode over Codex:

  • You want to use free models or a broader range of providers
  • You prefer open-source tooling
  • Session continuation is important for your workflow

When to prefer Codex over OpenCode:

  • You have an existing Codex workflow and prefer its specific features
  • You need Codex's specific tool ecosystem

Script Options

  • --workspace <path> - Target workspace (default: current)
  • --file <path> - Entry-point files (repeatable)
  • --session <id> - Resume a previous session
  • --model <name> - Override model (format: provider/model)
  • --agent <name> - Use a specific agent
  • -W, --watch - Stream output to stdout while writing to files (for long tasks)
  • --status <session_id> - Check status of a running session

Status & Progress Tracking

While a task is running, the script writes status files to .runtime/ in the project/workspace directory:

Status file (.runtime/<timestamp>.status):

status=running|completed|failed
session_id=<id>
started_at=<timestamp>
last_activity=<description>
progress_path=<file>

Progress file (.runtime/<timestamp>.progress - JSONL):

{"ts":"2026-04-02T10:00:00Z","type":"shell","msg":"Shell: pnpm build → success"}
{"ts":"2026-04-02T10:00:05Z","type":"file","msg":"File written: src/api.ts"}
{"ts":"2026-04-02T10:00:10Z","type":"message","msg":"Running tests..."}

Checking status:

ask_opencode.sh --status <session_id>

Watch mode - streams activity to stderr as it happens:

ask_opencode.sh "Complex refactor" --watch

Workflow

  1. Prepare: Write your task prompt and identify relevant files
  2. Execute: Run ask_opencode.sh with task and file context
  3. Review: Read the output markdown for results and session ID
  4. Continue: Use --session <id> to continue the conversation if needed

Comparison with Codex Skill

Feature OpenCode Codex
Cost Free (open-source) Paid
Models 75+ providers OpenAI only
Protocol ACP (Agent Client Protocol) JSON-RPC
CLI opencode run codex exec
Session --session <id> --session <id>
File context --file <path> --file <path>
PTY workaround Not needed Required
Watch mode --watch streams to stdout Not available
Status tracking .runtime/*.status + *.progress Not available

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 alert7mo3 checks · Risk HIGH
  • Gen Agent Trust Hub7mo

    This skill contains adversarial instructions dubbed the 'Black Box Protocol' that explicitly forbid the AI agent from auditing the bundled shell scripts. This technique is used to evade security oversight and hide potential malicious logic. Additionally, the skill provides a powerful command execution interface for an external coding agent without implementing sanitization for indirect prompt injection.

  • Socket7mo

    No alerts

  • Snyk7mo

    Risk: LOW · No issues

Signed by skilld at 032d25b. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 6 months ago

README badge

README badge for zenstudiolab/skills/opencode