[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6C3C4Z1573974210AWD21DM":3,"skill-same:01M6C3C4Z1573974210AWD21DM":81},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":41,"linkOnly":42,"markdownContent":43,"markdownBody":44,"frontMatter":45,"refName":60,"commitSha":61,"skillDirectory":62,"forksCount":63,"repositoryHtmlUrl":64,"repositoryHomepageUrl":6,"ownerHtmlUrl":65,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":66,"install":67,"resources":80},"01M6C3C4Z1573974210AWD21DM","opencode",null,"Delegate coding to OpenCode CLI (features, PR review).","adnichols\u002Fai-configs","adnichols","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F493746?v=4","01M6C33VRY9WF6XWYPT1AFA7JJ","Aaron Nichols","01M6C33VWTNKGRM92E9G643V4W",5,"MIT","https:\u002F\u002Fgithub.com\u002Fadnichols\u002Fai-configs\u002Fblob\u002Fmain\u002F_hermes\u002Fdefault\u002Fprofiles\u002Fnerd\u002Fskills\u002Fautonomous-ai-agents\u002Fopencode\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[5,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],"linear","Coding-Agent","autonomous","delegate","hermes agent","hermes","coding","refactoring","review","code-review","code","pr","http","pr review","workflow","codex","cli","2026-11-10 10:12:30",false,"---\nname: opencode\ndescription: \"Delegate coding to OpenCode CLI (features, PR review).\"\nversion: 1.2.0\nauthor: Hermes Agent\nlicense: MIT\nmetadata:\n  hermes:\n    tags: [Coding-Agent, OpenCode, Autonomous, Refactoring, Code-Review]\n    related_skills: [claude-code, codex, hermes-agent, hermes-opencode-linear-build, opencode-http-coding-workflow]\n---\n\n# OpenCode CLI\n\nUse [OpenCode](https:\u002F\u002Fopencode.ai) as an autonomous coding worker orchestrated by Hermes terminal\u002Fprocess tools. OpenCode is a provider-agnostic, open-source AI coding agent with a TUI and CLI.\n\n## When to Use\n\n- User explicitly asks to use OpenCode\n- You want an external coding agent to implement\u002Frefactor\u002Freview code\n- You need long-running coding sessions with progress checks\n- You want parallel task execution in isolated workdirs\u002Fworktrees\n\n## Prerequisites\n\n- OpenCode installed: `npm i -g opencode-ai@latest` or `brew install anomalyco\u002Ftap\u002Fopencode`\n- Auth configured: `opencode auth login` or set provider env vars (OPENROUTER_API_KEY, etc.)\n- Verify: `opencode auth list` should show at least one provider\n- Git repository for code tasks (recommended)\n- `pty=true` for interactive TUI sessions\n\n## Binary Resolution (Important)\n\nShell environments may resolve different OpenCode binaries. If behavior differs between your terminal and Hermes, check:\n\n```\nterminal(command=\"which -a opencode\")\nterminal(command=\"opencode --version\")\n```\n\nIf needed, pin an explicit binary path:\n\n```\nterminal(command=\"$HOME\u002F.opencode\u002Fbin\u002Fopencode run '...'\", workdir=\"~\u002Fproject\", pty=true)\n```\n\n## One-Shot Tasks\n\nUse `opencode run` for bounded, non-interactive tasks:\n\n```\nterminal(command=\"opencode run 'Add retry logic to API calls and update tests'\", workdir=\"~\u002Fproject\")\n```\n\n## HTTP API \u002F Server Control\n\nWhen the user has `opencode server` running (commonly `http:\u002F\u002Flocalhost:63333`), Hermes can operate OpenCode sessions directly with `curl` via terminal. Prefer read\u002Flist\u002Fstatus endpoints first, and only create\u002Fsend prompts when the user has asked to run a coding session.\n\nFor Aaron's Linear-backed OpenCode issue workflow, first verify the independently maintained `cmd:linear-build-workspace` command plus `create_linear_workspace.py` and `linear_build_orchestrator.py` exist under `~\u002F.config\u002Fopencode`. Only then load the compatibility-only `hermes-opencode-linear-build` workflow. If any component is absent, use a maintained Pi\u002FCodex workflow instead of generic manual OpenCode workdir\u002Fworktree patterns.\n\nReadiness checks:\n\n```\nterminal(command=\"curl -sS http:\u002F\u002Flocalhost:63333\u002Fglobal\u002Fhealth\")\nterminal(command=\"curl -sS http:\u002F\u002Flocalhost:63333\u002Fsession\")\n```\n\nUseful endpoints observed in OpenCode 1.14.x:\n\n| Endpoint | Use |\n|---|---|\n| `GET \u002Fglobal\u002Fhealth` | health\u002Fversion, e.g. `{\\\"healthy\\\":true,\\\"version\\\":\\\"1.14.x\\\"}` |\n| `GET \u002Fsession` | list sessions; supports query params such as `directory`, `workspace`, `limit`, `search`, `archived` |\n| `POST \u002Fsession` | create a session; JSON body may include `title`, `agent`, `model`, `permission`, `workspaceID`, `parentID`; in OpenCode 1.14.x `permission` is an array of objects like `{\\\"permission\\\":\\\"bash\\\",\\\"action\\\":\\\"allow\\\",\\\"pattern\\\":\\\"*\\\"}`, not a map |\n| `GET \u002Fsession\u002F{sessionID}` | session metadata |\n| `GET \u002Fsession\u002F{sessionID}\u002Fmessage` | list messages for a session; supports `limit` and `before` |\n| `POST \u002Fsession\u002F{sessionID}\u002Fmessage` | send a prompt; JSON body can include `parts`, `agent`, `model`, `variant`, `tools`, `system`, `noReply` |\n| `POST \u002Fsession\u002F{sessionID}\u002Fprompt_async` | fire-and-monitor prompt launch; OpenCode 1.14 may return `204 No Content` on success, so do not retry via `\u002Fmessage` after a 204 |\n| `GET \u002Fevent` | workspace-scoped SSE event stream |\n| `GET \u002Fglobal\u002Fevent` | global SSE event stream |\n| `POST \u002Fsession\u002F{sessionID}\u002Fpermissions\u002F{permissionID}` | answer permission prompts |\n| `GET \u002Fconfig\u002Fproviders` | provider\u002Fmodel availability; output may include secrets, so never paste raw output back to the user |\n\nExample create + prompt shape (use an explicit repo directory\u002Fworkspace query when appropriate):\n\n```\nterminal(command=\"curl -sS -X POST 'http:\u002F\u002Flocalhost:63333\u002Fsession?directory=\u002Fabsolute\u002Frepo\u002Fpath-url-encoded' -H 'Content-Type: application\u002Fjson' -d '{\\\"title\\\":\\\"Hermes task\\\",\\\"agent\\\":\\\"build\\\"}'\")\nterminal(command=\"curl -sS -X POST 'http:\u002F\u002Flocalhost:63333\u002Fsession\u002F$SESSION_ID\u002Fprompt_async?directory=\u002Fabsolute\u002Frepo\u002Fpath-url-encoded' -H 'Content-Type: application\u002Fjson' -d '{\\\"parts\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Inspect the repo and summarize test commands. Do not edit files.\\\"}],\\\"agent\\\":\\\"build\\\"}'\")\n```\n\nObserved OpenCode 1.14.40 quirk: `POST \u002Fsession` may reject richer bodies like `{\"permission\":{\"edit\":\"allow\",...}}` with HTTP 400 even though simple `{title, agent}` succeeds. Start with the minimal body, then send the work prompt via `\u002Fprompt_async`. A successful `\u002Fprompt_async` can return an empty response body; treat HTTP 2xx as the success signal and poll `\u002Fsession\u002Fstatus`.\n\nPitfalls:\n- `\u002Fdoc` may expose a partial OpenAPI document; the frontend bundle can reveal additional session\u002Fmessage endpoints.\n- `\u002Fconfig` and `\u002Fconfig\u002Fproviders` may include credential-bearing or sensitive provider metadata; summarize only non-secret facts.\n- Creating sessions and posting prompts are side effects and may spend model tokens. Do not do that for a smoke test unless the user explicitly asks.\n- For coding workflows, pass\u002Fchoose the correct repo `directory`\u002F`workspace` so OpenCode does not operate from `$HOME`.\n\n\nAttach context files with `-f`:\n\n```\nterminal(command=\"opencode run 'Review this config for security issues' -f config.yaml -f .env.example\", workdir=\"~\u002Fproject\")\n```\n\nShow model thinking with `--thinking`:\n\n```\nterminal(command=\"opencode run 'Debug why tests fail in CI' --thinking\", workdir=\"~\u002Fproject\")\n```\n\nForce a specific model:\n\n```\nterminal(command=\"opencode run 'Refactor auth module' --model openrouter\u002Fanthropic\u002Fclaude-sonnet-4\", workdir=\"~\u002Fproject\")\n```\n\n## Interactive Sessions (Background)\n\nFor iterative work requiring multiple exchanges, start the TUI in background:\n\n```\nterminal(command=\"opencode\", workdir=\"~\u002Fproject\", background=true, pty=true)\n# Returns session_id\n\n# Send a prompt\nprocess(action=\"submit\", session_id=\"\u003Cid>\", data=\"Implement OAuth refresh flow and add tests\")\n\n# Monitor progress\nprocess(action=\"poll\", session_id=\"\u003Cid>\")\nprocess(action=\"log\", session_id=\"\u003Cid>\")\n\n# Send follow-up input\nprocess(action=\"submit\", session_id=\"\u003Cid>\", data=\"Now add error handling for token expiry\")\n\n# Exit cleanly — Ctrl+C\nprocess(action=\"write\", session_id=\"\u003Cid>\", data=\"\\x03\")\n# Or just kill the process\nprocess(action=\"kill\", session_id=\"\u003Cid>\")\n```\n\n**Important:** Do NOT use `\u002Fexit` — 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.\n\n### TUI Keybindings\n\n| Key | Action |\n|-----|--------|\n| `Enter` | Submit message (press twice if needed) |\n| `Tab` | Switch between agents (build\u002Fplan) |\n| `Ctrl+P` | Open command palette |\n| `Ctrl+X L` | Switch session |\n| `Ctrl+X M` | Switch model |\n| `Ctrl+X N` | New session |\n| `Ctrl+X E` | Open editor |\n| `Ctrl+C` | Exit OpenCode |\n\n### Resuming Sessions\n\nAfter exiting, OpenCode prints a session ID. Resume with:\n\n```\nterminal(command=\"opencode -c\", workdir=\"~\u002Fproject\", background=true, pty=true)  # Continue last session\nterminal(command=\"opencode -s ses_abc123\", workdir=\"~\u002Fproject\", background=true, pty=true)  # Specific session\n```\n\n## Common Flags\n\n| Flag | Use |\n|------|-----|\n| `run 'prompt'` | One-shot execution and exit |\n| `--continue` \u002F `-c` | Continue the last OpenCode session |\n| `--session \u003Cid>` \u002F `-s` | Continue a specific session |\n| `--agent \u003Cname>` | Choose OpenCode agent (build or plan) |\n| `--model provider\u002Fmodel` | Force specific model |\n| `--format json` | Machine-readable output\u002Fevents |\n| `--file \u003Cpath>` \u002F `-f` | Attach file(s) to the message |\n| `--thinking` | Show model thinking blocks |\n| `--variant \u003Clevel>` | Reasoning effort (high, max, minimal) |\n| `--title \u003Cname>` | Name the session |\n| `--attach \u003Curl>` | Connect to a running opencode server |\n\n## Procedure\n\n1. Verify tool readiness:\n   - `terminal(command=\"opencode --version\")`\n   - `terminal(command=\"opencode auth list\")`\n2. For bounded tasks, use `opencode run '...'` (no pty needed).\n3. For iterative tasks, start `opencode` with `background=true, pty=true`.\n4. Monitor long tasks with `process(action=\"poll\"|\"log\")`.\n5. If OpenCode asks for input, respond via `process(action=\"submit\", ...)`.\n6. Exit with `process(action=\"write\", data=\"\\x03\")` or `process(action=\"kill\")`.\n7. Summarize file changes, test results, and next steps back to user.\n\n## PR Review Workflow\n\nOpenCode has a built-in PR command:\n\n```\nterminal(command=\"opencode pr 42\", workdir=\"~\u002Fproject\", pty=true)\n```\n\nOr review in a temporary clone for isolation:\n\n```\nterminal(command=\"REVIEW=$(mktemp -d) && git clone https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo.git $REVIEW && cd $REVIEW && opencode run 'Review this PR vs main. Report bugs, security risks, test gaps, and style issues.' -f $(git diff origin\u002Fmain --name-only | head -20 | tr '\\n' ' ')\", pty=true)\n```\n\n## Parallel Work Pattern\n\nUse separate workdirs\u002Fworktrees to avoid collisions:\n\n```\nterminal(command=\"opencode run 'Fix issue #101 and commit'\", workdir=\"\u002Ftmp\u002Fissue-101\", background=true, pty=true)\nterminal(command=\"opencode run 'Add parser regression tests and commit'\", workdir=\"\u002Ftmp\u002Fissue-102\", background=true, pty=true)\nprocess(action=\"list\")\n```\n\n## Session & Cost Management\n\nList past sessions:\n\n```\nterminal(command=\"opencode session list\")\n```\n\nCheck token usage and costs:\n\n```\nterminal(command=\"opencode stats\")\nterminal(command=\"opencode stats --days 7 --models anthropic\u002Fclaude-sonnet-4\")\n```\n\n## Pitfalls\n\n- Interactive `opencode` (TUI) sessions require `pty=true`. The `opencode run` command does NOT need pty.\n- `\u002Fexit` is NOT a valid command — it opens an agent selector. Use Ctrl+C to exit the TUI.\n- PATH mismatch can select the wrong OpenCode binary\u002Fmodel config.\n- If OpenCode appears stuck, inspect logs before killing:\n  - `process(action=\"log\", session_id=\"\u003Cid>\")`\n- Avoid sharing one working directory across parallel OpenCode sessions.\n- Enter may need to be pressed twice to submit in the TUI (once to finalize text, once to send).\n\n## Verification\n\nSmoke test:\n\n```\nterminal(command=\"opencode run 'Respond with exactly: OPENCODE_SMOKE_OK'\")\n```\n\nSuccess criteria:\n- Output includes `OPENCODE_SMOKE_OK`\n- Command exits without provider\u002Fmodel errors\n- For code tasks: expected files changed and tests pass\n\n## Rules\n\n1. Prefer `opencode run` for one-shot automation — it's simpler and doesn't need pty.\n2. Use interactive background mode only when iteration is needed.\n3. Always scope OpenCode sessions to a single repo\u002Fworkdir.\n4. For long tasks, provide progress updates from `process` logs.\n5. Report concrete outcomes (files changed, tests, remaining risks).\n6. Exit interactive sessions with Ctrl+C or kill, never `\u002Fexit`.\n","# OpenCode CLI\n\nUse [OpenCode](https:\u002F\u002Fopencode.ai) as an autonomous coding worker orchestrated by Hermes terminal\u002Fprocess tools. OpenCode is a provider-agnostic, open-source AI coding agent with a TUI and CLI.\n\n## When to Use\n\n- User explicitly asks to use OpenCode\n- You want an external coding agent to implement\u002Frefactor\u002Freview code\n- You need long-running coding sessions with progress checks\n- You want parallel task execution in isolated workdirs\u002Fworktrees\n\n## Prerequisites\n\n- OpenCode installed: `npm i -g opencode-ai@latest` or `brew install anomalyco\u002Ftap\u002Fopencode`\n- Auth configured: `opencode auth login` or set provider env vars (OPENROUTER_API_KEY, etc.)\n- Verify: `opencode auth list` should show at least one provider\n- Git repository for code tasks (recommended)\n- `pty=true` for interactive TUI sessions\n\n## Binary Resolution (Important)\n\nShell environments may resolve different OpenCode binaries. If behavior differs between your terminal and Hermes, check:\n\n```\nterminal(command=\"which -a opencode\")\nterminal(command=\"opencode --version\")\n```\n\nIf needed, pin an explicit binary path:\n\n```\nterminal(command=\"$HOME\u002F.opencode\u002Fbin\u002Fopencode run '...'\", workdir=\"~\u002Fproject\", pty=true)\n```\n\n## One-Shot Tasks\n\nUse `opencode run` for bounded, non-interactive tasks:\n\n```\nterminal(command=\"opencode run 'Add retry logic to API calls and update tests'\", workdir=\"~\u002Fproject\")\n```\n\n## HTTP API \u002F Server Control\n\nWhen the user has `opencode server` running (commonly `http:\u002F\u002Flocalhost:63333`), Hermes can operate OpenCode sessions directly with `curl` via terminal. Prefer read\u002Flist\u002Fstatus endpoints first, and only create\u002Fsend prompts when the user has asked to run a coding session.\n\nFor Aaron's Linear-backed OpenCode issue workflow, first verify the independently maintained `cmd:linear-build-workspace` command plus `create_linear_workspace.py` and `linear_build_orchestrator.py` exist under `~\u002F.config\u002Fopencode`. Only then load the compatibility-only `hermes-opencode-linear-build` workflow. If any component is absent, use a maintained Pi\u002FCodex workflow instead of generic manual OpenCode workdir\u002Fworktree patterns.\n\nReadiness checks:\n\n```\nterminal(command=\"curl -sS http:\u002F\u002Flocalhost:63333\u002Fglobal\u002Fhealth\")\nterminal(command=\"curl -sS http:\u002F\u002Flocalhost:63333\u002Fsession\")\n```\n\nUseful endpoints observed in OpenCode 1.14.x:\n\n| Endpoint | Use |\n|---|---|\n| `GET \u002Fglobal\u002Fhealth` | health\u002Fversion, e.g. `{\\\"healthy\\\":true,\\\"version\\\":\\\"1.14.x\\\"}` |\n| `GET \u002Fsession` | list sessions; supports query params such as `directory`, `workspace`, `limit`, `search`, `archived` |\n| `POST \u002Fsession` | create a session; JSON body may include `title`, `agent`, `model`, `permission`, `workspaceID`, `parentID`; in OpenCode 1.14.x `permission` is an array of objects like `{\\\"permission\\\":\\\"bash\\\",\\\"action\\\":\\\"allow\\\",\\\"pattern\\\":\\\"*\\\"}`, not a map |\n| `GET \u002Fsession\u002F{sessionID}` | session metadata |\n| `GET \u002Fsession\u002F{sessionID}\u002Fmessage` | list messages for a session; supports `limit` and `before` |\n| `POST \u002Fsession\u002F{sessionID}\u002Fmessage` | send a prompt; JSON body can include `parts`, `agent`, `model`, `variant`, `tools`, `system`, `noReply` |\n| `POST \u002Fsession\u002F{sessionID}\u002Fprompt_async` | fire-and-monitor prompt launch; OpenCode 1.14 may return `204 No Content` on success, so do not retry via `\u002Fmessage` after a 204 |\n| `GET \u002Fevent` | workspace-scoped SSE event stream |\n| `GET \u002Fglobal\u002Fevent` | global SSE event stream |\n| `POST \u002Fsession\u002F{sessionID}\u002Fpermissions\u002F{permissionID}` | answer permission prompts |\n| `GET \u002Fconfig\u002Fproviders` | provider\u002Fmodel availability; output may include secrets, so never paste raw output back to the user |\n\nExample create + prompt shape (use an explicit repo directory\u002Fworkspace query when appropriate):\n\n```\nterminal(command=\"curl -sS -X POST 'http:\u002F\u002Flocalhost:63333\u002Fsession?directory=\u002Fabsolute\u002Frepo\u002Fpath-url-encoded' -H 'Content-Type: application\u002Fjson' -d '{\\\"title\\\":\\\"Hermes task\\\",\\\"agent\\\":\\\"build\\\"}'\")\nterminal(command=\"curl -sS -X POST 'http:\u002F\u002Flocalhost:63333\u002Fsession\u002F$SESSION_ID\u002Fprompt_async?directory=\u002Fabsolute\u002Frepo\u002Fpath-url-encoded' -H 'Content-Type: application\u002Fjson' -d '{\\\"parts\\\":[{\\\"type\\\":\\\"text\\\",\\\"text\\\":\\\"Inspect the repo and summarize test commands. Do not edit files.\\\"}],\\\"agent\\\":\\\"build\\\"}'\")\n```\n\nObserved OpenCode 1.14.40 quirk: `POST \u002Fsession` may reject richer bodies like `{\"permission\":{\"edit\":\"allow\",...}}` with HTTP 400 even though simple `{title, agent}` succeeds. Start with the minimal body, then send the work prompt via `\u002Fprompt_async`. A successful `\u002Fprompt_async` can return an empty response body; treat HTTP 2xx as the success signal and poll `\u002Fsession\u002Fstatus`.\n\nPitfalls:\n- `\u002Fdoc` may expose a partial OpenAPI document; the frontend bundle can reveal additional session\u002Fmessage endpoints.\n- `\u002Fconfig` and `\u002Fconfig\u002Fproviders` may include credential-bearing or sensitive provider metadata; summarize only non-secret facts.\n- Creating sessions and posting prompts are side effects and may spend model tokens. Do not do that for a smoke test unless the user explicitly asks.\n- For coding workflows, pass\u002Fchoose the correct repo `directory`\u002F`workspace` so OpenCode does not operate from `$HOME`.\n\n\nAttach context files with `-f`:\n\n```\nterminal(command=\"opencode run 'Review this config for security issues' -f config.yaml -f .env.example\", workdir=\"~\u002Fproject\")\n```\n\nShow model thinking with `--thinking`:\n\n```\nterminal(command=\"opencode run 'Debug why tests fail in CI' --thinking\", workdir=\"~\u002Fproject\")\n```\n\nForce a specific model:\n\n```\nterminal(command=\"opencode run 'Refactor auth module' --model openrouter\u002Fanthropic\u002Fclaude-sonnet-4\", workdir=\"~\u002Fproject\")\n```\n\n## Interactive Sessions (Background)\n\nFor iterative work requiring multiple exchanges, start the TUI in background:\n\n```\nterminal(command=\"opencode\", workdir=\"~\u002Fproject\", background=true, pty=true)\n# Returns session_id\n\n# Send a prompt\nprocess(action=\"submit\", session_id=\"\u003Cid>\", data=\"Implement OAuth refresh flow and add tests\")\n\n# Monitor progress\nprocess(action=\"poll\", session_id=\"\u003Cid>\")\nprocess(action=\"log\", session_id=\"\u003Cid>\")\n\n# Send follow-up input\nprocess(action=\"submit\", session_id=\"\u003Cid>\", data=\"Now add error handling for token expiry\")\n\n# Exit cleanly — Ctrl+C\nprocess(action=\"write\", session_id=\"\u003Cid>\", data=\"\\x03\")\n# Or just kill the process\nprocess(action=\"kill\", session_id=\"\u003Cid>\")\n```\n\n**Important:** Do NOT use `\u002Fexit` — 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.\n\n### TUI Keybindings\n\n| Key | Action |\n|-----|--------|\n| `Enter` | Submit message (press twice if needed) |\n| `Tab` | Switch between agents (build\u002Fplan) |\n| `Ctrl+P` | Open command palette |\n| `Ctrl+X L` | Switch session |\n| `Ctrl+X M` | Switch model |\n| `Ctrl+X N` | New session |\n| `Ctrl+X E` | Open editor |\n| `Ctrl+C` | Exit OpenCode |\n\n### Resuming Sessions\n\nAfter exiting, OpenCode prints a session ID. Resume with:\n\n```\nterminal(command=\"opencode -c\", workdir=\"~\u002Fproject\", background=true, pty=true)  # Continue last session\nterminal(command=\"opencode -s ses_abc123\", workdir=\"~\u002Fproject\", background=true, pty=true)  # Specific session\n```\n\n## Common Flags\n\n| Flag | Use |\n|------|-----|\n| `run 'prompt'` | One-shot execution and exit |\n| `--continue` \u002F `-c` | Continue the last OpenCode session |\n| `--session \u003Cid>` \u002F `-s` | Continue a specific session |\n| `--agent \u003Cname>` | Choose OpenCode agent (build or plan) |\n| `--model provider\u002Fmodel` | Force specific model |\n| `--format json` | Machine-readable output\u002Fevents |\n| `--file \u003Cpath>` \u002F `-f` | Attach file(s) to the message |\n| `--thinking` | Show model thinking blocks |\n| `--variant \u003Clevel>` | Reasoning effort (high, max, minimal) |\n| `--title \u003Cname>` | Name the session |\n| `--attach \u003Curl>` | Connect to a running opencode server |\n\n## Procedure\n\n1. Verify tool readiness:\n   - `terminal(command=\"opencode --version\")`\n   - `terminal(command=\"opencode auth list\")`\n2. For bounded tasks, use `opencode run '...'` (no pty needed).\n3. For iterative tasks, start `opencode` with `background=true, pty=true`.\n4. Monitor long tasks with `process(action=\"poll\"|\"log\")`.\n5. If OpenCode asks for input, respond via `process(action=\"submit\", ...)`.\n6. Exit with `process(action=\"write\", data=\"\\x03\")` or `process(action=\"kill\")`.\n7. Summarize file changes, test results, and next steps back to user.\n\n## PR Review Workflow\n\nOpenCode has a built-in PR command:\n\n```\nterminal(command=\"opencode pr 42\", workdir=\"~\u002Fproject\", pty=true)\n```\n\nOr review in a temporary clone for isolation:\n\n```\nterminal(command=\"REVIEW=$(mktemp -d) && git clone https:\u002F\u002Fgithub.com\u002Fuser\u002Frepo.git $REVIEW && cd $REVIEW && opencode run 'Review this PR vs main. Report bugs, security risks, test gaps, and style issues.' -f $(git diff origin\u002Fmain --name-only | head -20 | tr '\\n' ' ')\", pty=true)\n```\n\n## Parallel Work Pattern\n\nUse separate workdirs\u002Fworktrees to avoid collisions:\n\n```\nterminal(command=\"opencode run 'Fix issue #101 and commit'\", workdir=\"\u002Ftmp\u002Fissue-101\", background=true, pty=true)\nterminal(command=\"opencode run 'Add parser regression tests and commit'\", workdir=\"\u002Ftmp\u002Fissue-102\", background=true, pty=true)\nprocess(action=\"list\")\n```\n\n## Session & Cost Management\n\nList past sessions:\n\n```\nterminal(command=\"opencode session list\")\n```\n\nCheck token usage and costs:\n\n```\nterminal(command=\"opencode stats\")\nterminal(command=\"opencode stats --days 7 --models anthropic\u002Fclaude-sonnet-4\")\n```\n\n## Pitfalls\n\n- Interactive `opencode` (TUI) sessions require `pty=true`. The `opencode run` command does NOT need pty.\n- `\u002Fexit` is NOT a valid command — it opens an agent selector. Use Ctrl+C to exit the TUI.\n- PATH mismatch can select the wrong OpenCode binary\u002Fmodel config.\n- If OpenCode appears stuck, inspect logs before killing:\n  - `process(action=\"log\", session_id=\"\u003Cid>\")`\n- Avoid sharing one working directory across parallel OpenCode sessions.\n- Enter may need to be pressed twice to submit in the TUI (once to finalize text, once to send).\n\n## Verification\n\nSmoke test:\n\n```\nterminal(command=\"opencode run 'Respond with exactly: OPENCODE_SMOKE_OK'\")\n```\n\nSuccess criteria:\n- Output includes `OPENCODE_SMOKE_OK`\n- Command exits without provider\u002Fmodel errors\n- For code tasks: expected files changed and tests pass\n\n## Rules\n\n1. Prefer `opencode run` for one-shot automation — it's simpler and doesn't need pty.\n2. Use interactive background mode only when iteration is needed.\n3. Always scope OpenCode sessions to a single repo\u002Fworkdir.\n4. For long tasks, provide progress updates from `process` logs.\n5. Report concrete outcomes (files changed, tests, remaining risks).\n6. Exit interactive sessions with Ctrl+C or kill, never `\u002Fexit`.\n",{"name":5,"author":46,"license":15,"version":47,"metadata":48,"description":7},"Hermes Agent","1.2.0",{"hermes":49},{"tags":50,"related_skills":55},[25,51,52,53,54],"OpenCode","Autonomous","Refactoring","Code-Review",[56,39,57,58,59],"claude-code","hermes-agent","hermes-opencode-linear-build","opencode-http-coding-workflow","main","64e2fc9afa7bb3da1138eb73399144d0e7e73e9d","_hermes\u002Fdefault\u002Fprofiles\u002Fnerd\u002Fskills\u002Fautonomous-ai-agents\u002Fopencode",4,"https:\u002F\u002Fgithub.com\u002Fadnichols\u002Fai-configs","https:\u002F\u002Fgithub.com\u002Fadnichols","2026-11-06 00:28:38",{"source":8,"skillName":5,"commands":68,"prompt":78,"zipAvailable":79},[69,72,75],{"tool":70,"command":71},"npx","npx skills add adnichols\u002Fai-configs --skill opencode",{"tool":73,"command":74},"bunx","bunx skills add adnichols\u002Fai-configs --skill opencode",{"tool":76,"command":77},"pnpm","pnpm dlx skills add adnichols\u002Fai-configs --skill opencode","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fadnichols\u002Fai-configs\u002Fblob\u002Fmain\u002F_hermes\u002Fdefault\u002Fprofiles\u002Fnerd\u002Fskills\u002Fautonomous-ai-agents\u002Fopencode\u002FSKILL.md",true,[],[82,102,131,155,166,182],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":41},"01M6CB7RN791P5RRRCJWWC7DAR","blocked-page-recovery","Use when a fetch fails: 403\u002F429, paywall, WAF, bot wall.","https:\u002F\u002Fgithub.com\u002Fadnichols\u002Fai-configs\u002Fblob\u002Fmain\u002F_hermes\u002Fdefault\u002Fskills\u002Fweb\u002Fblocked-page-recovery\u002FSKILL.md",[],[89,90,91,92,93,94,95,28,29,96,97,98,99,100,101],"recovery","page","blocked page recovery","bot","fallback","use","fetch","Citations","waf","windows","research","linux","macos",{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":117,"publishedAt":41},"01M6CB7NQY2VVYCQJ1QBXACQF4","writing-plans","Use when creating or updating executable software plans. Keep plans as local files unless the user explicitly asks to register them in Doct.","https:\u002F\u002Fgithub.com\u002Fadnichols\u002Fai-configs\u002Fblob\u002Fmain\u002F_hermes\u002Fdefault\u002Fskills\u002Fsoftware-development\u002Fwriting-plans\u002FSKILL.md",[108,111,112],{"categoryNo":109,"categoryName":110,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":113,"categoryName":114,"taxonomyType":115,"taxonomyTypeDesc":116},"01JBSEEDCAT000000000000036","内容创作者","PROFESSION","适用职业",[118,119,120,121,38,122,123,124,125,126,127,128,94,129,28,29,130],"writing","writing plans","documentation","test","design","user","development","planning","files","implementation","html","ops","plan",{"skillNo":132,"name":133,"nameZh":6,"description":134,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":135,"categories":136,"keywords":146,"publishedAt":41},"01M6CB7JME246KZQHP73Z2STDF","test-driven-development","TDD: enforce RED-GREEN-REFACTOR, tests before code.","https:\u002F\u002Fgithub.com\u002Fadnichols\u002Fai-configs\u002Fblob\u002Fmain\u002F_hermes\u002Fdefault\u002Fskills\u002Fsoftware-development\u002Ftest-driven-development\u002FSKILL.md",[137,140,143],{"categoryNo":138,"categoryName":139,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000007","代码审查",{"categoryNo":141,"categoryName":142,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":144,"categoryName":145,"taxonomyType":115,"taxonomyTypeDesc":116},"01JBSEEDCAT000000000000037","律师与法务",[121,124,147,148,149,28,29,150,130,151,34,152,101,153,100,154,98],"test driven development","red-green-refactor","superpowers","quality","refactor","debugging","tdd","testing",{"skillNo":156,"name":157,"nameZh":6,"description":158,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":159,"categories":160,"keywords":162,"publishedAt":41},"01M6CB7FQ407KQTD4Z9VAWKY54","systematic-debugging","4-phase root cause debugging: understand bugs before fixing.","https:\u002F\u002Fgithub.com\u002Fadnichols\u002Fai-configs\u002Fblob\u002Fmain\u002F_hermes\u002Fdefault\u002Fskills\u002Fsoftware-development\u002Fsystematic-debugging\u002FSKILL.md",[161],{"categoryNo":141,"categoryName":142,"taxonomyType":21,"taxonomyTypeDesc":22},[152,163,124,149,28,29,164,130,165,98,121,100,101],"systematic debugging","troubleshooting","investigation",{"skillNo":167,"name":168,"nameZh":6,"description":169,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":170,"categories":171,"keywords":175,"publishedAt":41},"01M6CB7D57MK88HE5YPZHKH68Q","spike","Throwaway experiments to validate an idea before build.","https:\u002F\u002Fgithub.com\u002Fadnichols\u002Fai-configs\u002Fblob\u002Fmain\u002F_hermes\u002Fdefault\u002Fskills\u002Fsoftware-development\u002Fspike\u002FSKILL.md",[172],{"categoryNo":173,"categoryName":174,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000021","资料检索与研究",[168,98,176,177,99,178,100,101,179,180,181,28,29,130,125],"validate","experiments","prototype","feasibility","sketch","experiment",{"skillNo":183,"name":184,"nameZh":6,"description":185,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":186,"categories":187,"keywords":192,"publishedAt":41},"01M6CB7APAQ37YE5YE1MAAFT42","simplify-code","Parallel 3-agent cleanup of recent code changes.","https:\u002F\u002Fgithub.com\u002Fadnichols\u002Fai-configs\u002Fblob\u002Fmain\u002F_hermes\u002Fdefault\u002Fskills\u002Fsoftware-development\u002Fsimplify-code\u002FSKILL.md",[188,189],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":190,"categoryName":191,"taxonomyType":115,"taxonomyTypeDesc":116},"01JBSEEDCAT000000000000030","开发工程师",[193,194,34,195,28,29,196,130,151,33,197,198,124,98,121,100,32,101],"simplify code","simplify","subagent","parallel","delegation","cleanup"]