Commands & Skills
Commands
Type /command-name in the OpenCode TUI to run.
Most commands accept an optional argument to scope the task: /command-name [argument] — the argument is passed directly to the target agent.
| Command | Argument hint | Purpose |
|---|---|---|
/api-docs | [module, file, or endpoint path] | Generate API reference docs |
/architecture-decision | [decision topic or system name] | Create an ADR |
/architecture-review | [system, component, or design document] | Review design for quality attributes |
/blog-post | [topic or title] | Write a blog post |
/code-review | [file, PR, or scope — blank for current changes] | Security, perf, and style review |
/content-review | [content text, file path, or topic] | Score and critique content quality |
/create-readme | [project name or path] | Generate or improve a README |
/generate-tests | [file, class, or function name] | Generate targeted tests |
/plan-project | [feature, objective, or epic] | Multi-phase implementation plan |
/execution-loop | [task goal or deliverable] | Bounded verify-and-continue execution loop |
/refactor-plan | [target module, file, or scope] | Safe staged refactor strategy |
/security-audit | [scope, file, component, or 'full project'] | Security-focused code review |
/stop-loop | [optional reason or scope] | Halt loop execution and report state |
/1-on-1-prep | [person] [context] | Prepare for a 1-on-1 meeting |
Skills
Skills are reusable behaviors loaded on demand. Common utility skills include:
project-bootstrap- Create a minimalAGENTS.mdscaffoldagent-diagnostics- Validate agent setup and instruction coveragedocs-validation- Outline docs lint and link checks
For the canonical current skill inventory and agent allowlists, see Skills Matrix.
Using Skills
Skills are defined in .opencode/skills/[skill-name]/SKILL.md. Agents load them via the skill tool when the task matches. To invoke a skill manually, ask an agent to use it:
@codebase Use the project-bootstrap skill to create AGENTS.md
@codebase Run agent-diagnostics to check my setup
Skills cannot be called directly from the TUI — they are invoked through agents.
External Link Validation (Optional)
- Internal docs links are validated by default via
npm run validate:docs. - External links can be validated on demand via
npm run validate:docs:external. - CI runs external checks in a separate scheduled, non-blocking workflow to avoid flaky PR gates.
Command Matrix Parity Validation
- Command tables are validated against canonical command frontmatter in
.opencode/commands/*.md. - Run
npm run validate:commandsto verify command presence and metadata parity.
Risk-Scored Review Path (CI)
- PR validation includes a risk-path gate that classifies changed files as low/medium/high impact.
- Medium/high changes require the PR template
Risk levelfield to acknowledge at least that level. - Risk-path logic runs in CI via
validate-risk-pathand is covered by local regression tests (npm run doctor).
Changelog Capability Labels
- Unreleased changelog bullets should be prefixed with
[capability:<label>]. - Validate locally with
npm run validate:changelog. - CI enforces this via the
validate-changeloggate.
Skill Selection Guardrails
- Load skills on demand for matching tasks only.
- Use one relevant skill by default; add a second only for clear cross-domain need.
- If technology/domain is ambiguous, ask for clarification before loading.
Skill Permission Hardening
OpenCode supports skill-level permissions. Use these in agent frontmatter:
permission:
skill:
"*": "deny"
"docs-validation": "allow"
"agent-diagnostics": "allow"
Pattern notes:
"*": "deny"first, then explicit allows.- Use wildcard patterns for groups (for example,
"internal-*": "allow"). - Prefer narrow allowlists per agent role for least privilege.
Task Permission Hardening
Control which subagents can be launched via the Task tool:
permission:
task:
"*": "deny"
"explore": "allow"
"review": "allow"
Pattern notes:
- Keep
"*": "deny"first, then explicit allows. - Keep allowlists role-specific.
- Rules are evaluated in order; last matching rule wins.
Custom Commands
Add command files to .opencode/commands/ with frontmatter:
---
description: What this command does
agent: recommended-agent
subtask: true
---
See OpenCode Commands docs for full reference.