[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ECNCMY2EDMFGHF8VHE1JC6":3,"skill-same:01M7ECNCMY2EDMFGHF8VHE1JC6":49},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":20,"frontMatter":21,"refName":22,"commitSha":23,"skillDirectory":24,"forksCount":13,"repositoryHtmlUrl":25,"repositoryHomepageUrl":6,"ownerHtmlUrl":26,"ownerBlogUrl":6,"ownerDescription":27,"updatedAt":28,"install":29,"resources":42},"01M7ECNCMY2EDMFGHF8VHE1JC6","opencode",null,"jonahthan433\u002FCortexOS","jonahthan433","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F211465495?v=4","01M7ECH9HPHGA89DCXHHJBTS3C","jonah.ai","01M7ECH9JCEM45DZMWPT7148S1",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fjonahthan433\u002FCortexOS\u002Fblob\u002Fmain\u002Fskills\u002Fimported\u002Fautonomous-ai-agents\u002Fopencode\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"# opencode\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\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",{},"main","38b32c99e7ed0b8e215d638e92cfa452c1ec3079","skills\u002Fimported\u002Fautonomous-ai-agents\u002Fopencode","https:\u002F\u002Fgithub.com\u002Fjonahthan433\u002FCortexOS","https:\u002F\u002Fgithub.com\u002Fjonahthan433","AI Consultant","2026-10-24 05:13:39",{"source":7,"skillName":5,"commands":30,"prompt":40,"zipAvailable":41},[31,34,37],{"tool":32,"command":33},"npx","npx skills add jonahthan433\u002FCortexOS --skill opencode",{"tool":35,"command":36},"bunx","bunx skills add jonahthan433\u002FCortexOS --skill opencode",{"tool":38,"command":39},"pnpm","pnpm dlx skills add jonahthan433\u002FCortexOS --skill opencode","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjonahthan433\u002FCortexOS\u002Fblob\u002Fmain\u002Fskills\u002Fimported\u002Fautonomous-ai-agents\u002Fopencode\u002FSKILL.md",true,[43],{"path":44,"resourceType":45,"resourceTypeDesc":46,"sizeBytes":47,"sourceHtmlUrl":48},"skill.json","REFERENCE","参考文档",331,"https:\u002F\u002Fgithub.com\u002Fjonahthan433\u002FCortexOS\u002Fblob\u002Fmain\u002Fskills\u002Fimported\u002Fautonomous-ai-agents\u002Fopencode\u002Fskill.json",[50,56,62,68,74,80],{"skillNo":51,"name":52,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":18},"01M7EDQZDQX3Q8Y7GCQX6KN9V7","opportunity-brief","https:\u002F\u002Fgithub.com\u002Fjonahthan433\u002FCortexOS\u002Fblob\u002Fmain\u002Fskills\u002Fsales\u002Fopportunity-brief\u002FSKILL.md",[],[],{"skillNo":57,"name":58,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":18},"01M7EDQYA0V9Y99VKBREJJ3MRT","morning-intel","https:\u002F\u002Fgithub.com\u002Fjonahthan433\u002FCortexOS\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fmorning-intel\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":18},"01M7EDQVX1JVY0B6PDHKKGM19G","decision-brief","https:\u002F\u002Fgithub.com\u002Fjonahthan433\u002FCortexOS\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fdecision-brief\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":18},"01M7EDQV1GENZAC2SZSD8KZ3GM","weekly-review","https:\u002F\u002Fgithub.com\u002Fjonahthan433\u002FCortexOS\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fweekly-review\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":18},"01M7EDQT2KETJ1Y3CGVN9EKW2J","system-health","https:\u002F\u002Fgithub.com\u002Fjonahthan433\u002FCortexOS\u002Fblob\u002Fmain\u002Fskills\u002Fops\u002Fsystem-health\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":18},"01M7EDQQN2JK3XPWMS1M4T0F3K","backup-restore","https:\u002F\u002Fgithub.com\u002Fjonahthan433\u002FCortexOS\u002Fblob\u002Fmain\u002Fskills\u002Fops\u002Fbackup-restore\u002FSKILL.md",[],[]]