Opencode
OpenCode (open-source terminal coding agent by SST). Reads AGENTS.md natively. Rulebook generates opencode.json plus .opencode/commands, .opencode/agents, .opencode/skills.
Best use case
Opencode is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
OpenCode (open-source terminal coding agent by SST). Reads AGENTS.md natively. Rulebook generates opencode.json plus .opencode/commands, .opencode/agents, .opencode/skills.
Teams using Opencode should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/opencode/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How Opencode Compares
| Feature / Agent | Opencode | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
OpenCode (open-source terminal coding agent by SST). Reads AGENTS.md natively. Rulebook generates opencode.json plus .opencode/commands, .opencode/agents, .opencode/skills.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
<!-- OPENCODE:START --> # OpenCode Rules **Tool**: [OpenCode](https://opencode.ai) — open-source terminal coding agent. ## Generated surface area When Rulebook detects OpenCode (`opencode.json` / `.opencode/` / `opencode` binary on PATH), it generates: - `opencode.json` with `$schema`, `mcp.rulebook`, and `instructions`. Existing user keys (model, theme, permission, custom agents) are preserved. - `.opencode/commands/<name>.md` for every user-invocable Rulebook slash command, with OpenCode-shaped frontmatter (`description`). - `.opencode/agents/<role>.md` for every Rulebook role agent (researcher, implementer, tester, code-reviewer, architect, docs-writer, security-reviewer, build-engineer, team-lead, etc.) with model tier mapped (`haiku → claude-haiku-4-5`, `sonnet → claude-sonnet-4-6`, `opus → claude-opus-4-7`) and a synthesized `permission` block. - `.opencode/skills/<normalized-name>/SKILL.md` for every Rulebook dev skill, name-normalized to `[a-z0-9](-[a-z0-9])*` (≤64 chars) and description bounded to ≤1024 chars. - `.opencode/.rulebook-managed.json` — sidecar listing managed keys so `rulebook update` knows what to refresh vs. preserve. ## Idempotency Files carrying the `<!-- RULEBOOK:START -->` marker are managed and refreshed on every `rulebook update`. Files without the marker are treated as user-owned and left untouched. ## Sequential editing OpenCode follows the same Rulebook discipline as Claude Code: - Edit files one at a time. - For 3+ files, decompose into 1–2 file sub-tasks. - Diagnostic-first: type-check / lint before tests. ## Quality gates - Type-check / lint must be clean. - Tests must pass. - Coverage ≥95%. - Pre-commit hooks enforce these — never `--no-verify`. ## MCP `mcp.rulebook` in `opencode.json` exposes `rulebook_task_*`, `rulebook_memory_*`, `rulebook_decision_*`, `rulebook_knowledge_*`, `rulebook_learn_*`. Prefer MCP tools over shell commands when both exist. ## Workflow 1. Reference `AGENTS.md` and `.rulebook/specs/*.md`. 2. Use `/rulebook-task-create`, `/rulebook-task-list`, `/handoff`. 3. Delegate to role agents (`@researcher`, `@implementer`, `@tester`). 4. Run quality checks before committing. 5. Save learnings (`rulebook_memory_save`, `rulebook_knowledge_add`). ## Documentation - [opencode.ai/docs/rules](https://opencode.ai/docs/rules/) - [opencode.ai/docs/config](https://opencode.ai/docs/config/) - [opencode.ai/docs/mcp-servers](https://opencode.ai/docs/mcp-servers/) - [opencode.ai/docs/commands](https://opencode.ai/docs/commands/) - [opencode.ai/docs/agents](https://opencode.ai/docs/agents/) - [opencode.ai/docs/skills](https://opencode.ai/docs/skills/) - [opencode.ai/docs/permissions](https://opencode.ai/docs/permissions/) <!-- OPENCODE:END -->