Agent skill

Opencode

by RedWoodOG in RedWoodOG/Hermes-Desktop

Delegate coding tasks to OpenCode CLI agent for feature implementation, refactoring, PR review, and long-running autonomous sessions.

MITAuto-check passedDevelopment

Install Opencode

skills CLI
$ npx skills add RedWoodOG/Hermes-Desktop --skill opencode -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install RedWoodOG/Hermes-Desktop opencode --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/RedWoodOG/Hermes-Desktop.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/autonomous-ai-agents/opencode .claude/skills/opencode && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
opencode
GitHub stars
177
Used in
5 other repos
Token cost
~1.8k tokens
SKILL.md length
582 words
Files
1
Skills in repo
62
Repo updated
First seen
Licence
MIT

At a glance

Delegate coding tasks to OpenCode CLI agent for feature implementation, refactoring, PR review, and long-running autonomous sessions.

  • Works in 7 steps: Verify tool readiness → For bounded tasks, use opencode run… → For iterative tasks, start opencode with… → …
  • Tasks that involve Pull requests
  • SKILL.md covers When to Use, Prerequisites, Binary Resolution (Important) and One-Shot Tasks, plus 9 more sections
  • Calls opencode, git and npm; reaches github.com; needs OPENROUTER_API_KEY

What it does

Opencode is an agent skill from RedWoodOG/Hermes-Desktop. Delegate coding tasks to OpenCode CLI agent for feature implementation, refactoring, PR review, and long-running autonomous sessions. Requires the opencode CLI installed and authenticated.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Pull requests and Refactoring. The licence is MIT.

When your agent uses it

  • Tasks that involve Pull requests
  • Tasks that involve Refactoring

Example prompts

  • “/opencode”

Requirements

  • Node.js
  • A credential in OPENROUTER_API_KEY

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Verify tool readiness
  2. For bounded tasks, use opencode run '...' (no pty needed).
  3. For iterative tasks, start opencode with background=true, pty=true.
  4. Monitor long tasks with process(action="poll"|"log").
  5. If OpenCode asks for input, respond via process(action="submit", ...).
  6. Exit with process(action="write", data="\x03") or process(action="kill").
  7. Summarize file changes, test results, and next steps back to user.

What it can do on your machine

Read from SKILL.md and the folder at commit be46b39. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • opencode
    • git
    • npm
    • brew

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • github.com

    Also links to:

    • opencode.ai

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • OPENROUTER_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Opencode loads about 1.8k tokens when it runs. Until then it costs about 49 tokens; SKILL.md has 582 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~49
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from RedWoodOG/Hermes-Desktop at commit be46b39, republished under its MIT licence (© RedWoodOG). 582 words, ~1,837 tokens.

Download SKILL.mdSave it as .claude/skills/opencode/SKILL.md (or your agent's skills folder).
name
opencode
description
Delegate coding tasks to OpenCode CLI agent for feature implementation, refactoring, PR review, and long-running autonomous sessions. Requires the opencode CLI installed and authenticated.
version
1.2.0
author
Hermes Agent
license
MIT

OpenCode CLI

Use OpenCode as an autonomous coding worker orchestrated by Hermes terminal/process tools. OpenCode is a provider-agnostic, open-source AI coding agent with a TUI and CLI.

When to Use

  • User explicitly asks to use OpenCode
  • You want an external coding agent to implement/refactor/review code
  • You need long-running coding sessions with progress checks
  • You want parallel task execution in isolated workdirs/worktrees

Prerequisites

  • OpenCode installed: npm i -g opencode-ai@latest or brew install anomalyco/tap/opencode
  • Auth configured: opencode auth login or set provider env vars (OPENROUTER_API_KEY, etc.)
  • Verify: opencode auth list should show at least one provider
  • Git repository for code tasks (recommended)
  • pty=true for interactive TUI sessions

Binary Resolution (Important)

Shell environments may resolve different OpenCode binaries. If behavior differs between your terminal and Hermes, check:

terminal(command="which -a opencode")
terminal(command="opencode --version")

If needed, pin an explicit binary path:

terminal(command="$HOME/.opencode/bin/opencode run '...'", workdir="~/project", pty=true)

One-Shot Tasks

Use opencode run for bounded, non-interactive tasks:

terminal(command="opencode run 'Add retry logic to API calls and update tests'", workdir="~/project")

Attach context files with -f:

terminal(command="opencode run 'Review this config for security issues' -f config.yaml -f .env.example", workdir="~/project")

Show model thinking with --thinking:

terminal(command="opencode run 'Debug why tests fail in CI' --thinking", workdir="~/project")

Force a specific model:

terminal(command="opencode run 'Refactor auth module' --model openrouter/anthropic/claude-sonnet-4", workdir="~/project")

Interactive Sessions (Background)

For iterative work requiring multiple exchanges, start the TUI in background:

terminal(command="opencode", workdir="~/project", background=true, pty=true)
# Returns session_id

# Send a prompt
process(action="submit", session_id="<id>", data="Implement OAuth refresh flow and add tests")

# Monitor progress
process(action="poll", session_id="<id>")
process(action="log", session_id="<id>")

# Send follow-up input
process(action="submit", session_id="<id>", data="Now add error handling for token expiry")

# Exit cleanly — Ctrl+C
process(action="write", session_id="<id>", data="\x03")
# Or just kill the process
process(action="kill", session_id="<id>")

Important: Do NOT use /exit — it is not a valid OpenCode command and will open an agent selector dialog instead. Use Ctrl+C (\x03) or process(action="kill") to exit.

TUI Keybindings
KeyAction
EnterSubmit message (press twice if needed)
TabSwitch between agents (build/plan)
Ctrl+POpen command palette
Ctrl+X LSwitch session
Ctrl+X MSwitch model
Ctrl+X NNew session
Ctrl+X EOpen editor
Ctrl+CExit OpenCode
Resuming Sessions

After exiting, OpenCode prints a session ID. Resume with:

terminal(command="opencode -c", workdir="~/project", background=true, pty=true)  # Continue last session
terminal(command="opencode -s ses_abc123", workdir="~/project", background=true, pty=true)  # Specific session

Common Flags

FlagUse
run 'prompt'One-shot execution and exit
--continue / -cContinue the last OpenCode session
--session <id> / -sContinue a specific session
--agent <name>Choose OpenCode agent (build or plan)
--model provider/modelForce specific model
--format jsonMachine-readable output/events
--file <path> / -fAttach file(s) to the message
--thinkingShow model thinking blocks
--variant <level>Reasoning effort (high, max, minimal)
--title <name>Name the session
--attach <url>Connect to a running opencode server
Show full SKILL.md (263 more words)Show less

Procedure

  1. Verify tool readiness:
    • terminal(command="opencode --version")
    • terminal(command="opencode auth list")
  2. For bounded tasks, use opencode run '...' (no pty needed).
  3. For iterative tasks, start opencode with background=true, pty=true.
  4. Monitor long tasks with process(action="poll"|"log").
  5. If OpenCode asks for input, respond via process(action="submit", ...).
  6. Exit with process(action="write", data="\x03") or process(action="kill").
  7. Summarize file changes, test results, and next steps back to user.

PR Review Workflow

OpenCode has a built-in PR command:

terminal(command="opencode pr 42", workdir="~/project", pty=true)

Or review in a temporary clone for isolation:

terminal(command="REVIEW=$(mktemp -d) && git clone https://github.com/user/repo.git $REVIEW && cd $REVIEW && opencode run 'Review this PR vs main. Report bugs, security risks, test gaps, and style issues.' -f $(git diff origin/main --name-only | head -20 | tr '\n' ' ')", pty=true)

Parallel Work Pattern

Use separate workdirs/worktrees to avoid collisions:

terminal(command="opencode run 'Fix issue #101 and commit'", workdir="/tmp/issue-101", background=true, pty=true)
terminal(command="opencode run 'Add parser regression tests and commit'", workdir="/tmp/issue-102", background=true, pty=true)
process(action="list")

Session & Cost Management

List past sessions:

terminal(command="opencode session list")

Check token usage and costs:

terminal(command="opencode stats")
terminal(command="opencode stats --days 7 --models anthropic/claude-sonnet-4")

Pitfalls

  • Interactive opencode (TUI) sessions require pty=true. The opencode run command does NOT need pty.
  • /exit is NOT a valid command — it opens an agent selector. Use Ctrl+C to exit the TUI.
  • PATH mismatch can select the wrong OpenCode binary/model config.
  • If OpenCode appears stuck, inspect logs before killing:
    • process(action="log", session_id="<id>")
  • Avoid sharing one working directory across parallel OpenCode sessions.
  • Enter may need to be pressed twice to submit in the TUI (once to finalize text, once to send).

Verification

Smoke test:

terminal(command="opencode run 'Respond with exactly: OPENCODE_SMOKE_OK'")

Success criteria:

  • Output includes OPENCODE_SMOKE_OK
  • Command exits without provider/model errors
  • For code tasks: expected files changed and tests pass

Rules

  1. Prefer opencode run for one-shot automation — it's simpler and doesn't need pty.
  2. Use interactive background mode only when iteration is needed.
  3. Always scope OpenCode sessions to a single repo/workdir.
  4. For long tasks, provide progress updates from process logs.
  5. Report concrete outcomes (files changed, tests, remaining risks).
  6. Exit interactive sessions with Ctrl+C or kill, never /exit.

© RedWoodOG, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/autonomous-ai-agents/opencode of RedWoodOG/Hermes-Desktop.

Open the folder on GitHubat commit be46b39

Used in 5 other repositories

We found 6 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 5 other GitHub owners. This page covers the copy in RedWoodOG/Hermes-Desktop, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Opencode next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Opencode compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Opencode this skillRedWoodOG/Hermes-Desktop1775 repos~1.8kAutomated safety check: PassMIT
Smell CheckZhen-Bo/smell-check239—~1.5kAutomated safety check: PassMIT
Coding Agentmastra-ai/mastra29k—~2.3kAutomated safety check: PassCustom licence
Code ReviewerYikai-Liao/symusic1891 repos~1.3kAutomated safety check: PassMIT
Typescript React ReviewerSuFxGIT/scoutarr114—~1.7kAutomated safety check: PassNone
Memtrace Change Impact Analysissyncable-dev/memtrace-public486—~1.4kAutomated safety check: PassCustom licence

Similar skills

  • Smell Check

    Zhen-Bo/smell-check

    Runs a smell-first audit on a user-chosen path set: measures structure metrics, applies a named size profile, and reports code smells and test smells with evidence strength.

    239 GitHub stars~1.5k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Coding Agent

    mastra-ai/mastra

    Authoring playbook for building agents that write, edit, review, or refactor code.

    29k GitHub stars~2.3k tokensUpdated today
    DevelopmentAuto-check passed
  • Code Reviewer

    Yikai-Liao/symusic

    Analyzes code diffs and files to identify bugs, security vulnerabilities (SQL injection, XSS, insecure deserialization), code smells, N+1 queries, naming issues, and architectural concerns, then…

    189 GitHub starsUsed in 1 repo~1.3k tokens
    DevelopmentAuto-check passed
  • Expert code reviewer for TypeScript + React 19 applications.

    114 GitHub stars~1.7k tokensUpdated 6 mo ago
    DevelopmentAuto-check passed
  • Memtrace Change Impact Analysis

    syncable-dev/memtrace-public

    Compute what a planned source-code change will break — blast radius, affected processes, cross-repo callers, temporal stability, and Cortex decision-memory constraints — and produce a risk-rated…

    486 GitHub stars~1.4k tokensUpdated today
    DevelopmentAuto-check passed
  • Develop Microfeed

    microfeed/microfeed

    Develop and contribute changes to the microfeed repository safely from branch creation through validation, commit, push, and draft pull request.

    4.1k GitHub stars~2.1k tokensUpdated today
    DevelopmentAuto-check passed

More from RedWoodOG/Hermes-Desktop

All 62 skills in this repo
  • Obliteratus

    RedWoodOG/Hermes-Desktop

    Remove refusal behaviors from open-weight LLMs using OBLITERATUS — mechanistic interpretability techniques (diff-in-means, SVD, whitened SVD, LEACE, SAE decomposition, etc.) to excise guardrails…

    177 GitHub starsUsed in 6 repos~3.8k tokens
    Auto-check passed
  • Excalidraw

    RedWoodOG/Hermes-Desktop

    Create hand-drawn style diagrams using Excalidraw JSON format.

    177 GitHub starsUsed in 5 repos~1.8k tokens
    Auto-check passed
  • Ascii Video

    RedWoodOG/Hermes-Desktop

    Production pipeline for ASCII art video — any format. An agent skill from RedWoodOG/Hermes-Desktop.

    177 GitHub starsUsed in 2 repos~3.2k tokens
    Auto-check passed
  • Systematic Debugging

    RedWoodOG/Hermes-Desktop

    A skill your agent uses when encountering any bug, test failure, or unexpected behavior.

    177 GitHub starsUsed in 6 repos~2.6k tokens
    Auto-check passed
  • Test Driven Development

    RedWoodOG/Hermes-Desktop

    A skill your agent uses when implementing any feature or bugfix, before writing implementation code.

    177 GitHub starsUsed in 6 repos~2.4k tokens
    Auto-check passed
  • Claude Code

    RedWoodOG/Hermes-Desktop

    Delegate coding tasks to Claude Code (Anthropic's CLI agent).

    177 GitHub starsUsed in 4 repos~784 tokens
    Auto-check passed

Categories

Questions about Opencode

What does Opencode do?

Delegate coding tasks to OpenCode CLI agent for feature implementation, refactoring, PR review, and long-running autonomous sessions. Opencode is an agent skill from RedWoodOG/Hermes-Desktop. Delegate coding tasks to OpenCode CLI agent for feature implementation, refactoring, PR review, and long-running autonomous sessions.

When should I use Opencode?

Opencode fits situations like: tasks that involve Pull requests; tasks that involve Refactoring.

How do I install Opencode in Claude Code?

Run `npx skills add RedWoodOG/Hermes-Desktop --skill opencode -a claude-code`. Or copy the skill folder (skills/autonomous-ai-agents/opencode in RedWoodOG/Hermes-Desktop) into .claude/skills/opencode in your project. Claude Code loads it when a task matches its description.

How do I install Opencode in Codex?

Run `npx skills add RedWoodOG/Hermes-Desktop --skill opencode -a codex`. Or copy the skill folder (skills/autonomous-ai-agents/opencode in RedWoodOG/Hermes-Desktop) into .agents/skills/opencode in your project. Codex loads it when a task matches its description.

Can I use Opencode in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add RedWoodOG/Hermes-Desktop --skill opencode -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/opencode, .gemini/skills/opencode, .github/skills/opencode and .opencode/skills/opencode in your project.

What does Opencode need to run?

Going by SKILL.md and its folder, Opencode needs the command-line tools its instructions call (opencode, git, npm and brew) and credentials named OPENROUTER_API_KEY. Our summary lists: Node.js; A credential in OPENROUTER_API_KEY.

Does Opencode access the network?

SKILL.md names 2 domains. In commands or code: github.com; the agent is likely to contact it when it follows the instructions. As links in the text: opencode.ai. This is read from the text; nothing was executed.

Is Opencode safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Opencode use?

Opencode is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Opencode use?

About 1.8k tokens (SKILL.md is roughly 7.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Opencode?

Skills that share tags, products or a category with Opencode: Smell Check (Zhen-Bo/smell-check, 239 stars), Coding Agent (mastra-ai/mastra, 29k stars), Code Reviewer (Yikai-Liao/symusic, 189 stars) and Typescript React Reviewer (SuFxGIT/scoutarr, 114 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Opencode?

RedWoodOG (a GitHub user) maintains it in RedWoodOG/Hermes-Desktop, which has 177 GitHub stars. The repository holds 62 skills in this directory. The repository was last updated on May 30, 2026.

Source: RedWoodOG/Hermes-Desktop on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.