---
name: opencode-prompting
description: How to compose effective prompts for the opencode CLI for review, rescue, and diagnosis tasks.
disable-model-invocation: false
---

# Prompting for opencode

Use this skill when composing prompts for the `opencode` CLI for review, rescue, or diagnosis work.

Each `opencode run` invocation is a one-shot unless you pass `--continue` or `--session <id>`. Prompts should be explicit, structured, and self-contained.

## Guidelines

- State the role and the goal up front (for example: "You are a senior engineer doing a read-only review").
- Provide the diff or file context inline; do not assume the CLI can see your editor state.
- Ask for prioritized, specific findings with file/line references.
- For rescue tasks, define done explicitly and constrain scope.
- Pick the right agent: `plan` for read-only analysis, `build` for changes.
- Prefer one focused task per invocation; use `--continue` / `--session` to iterate.
- Use `--model <provider/model>` to override the default when a task needs a stronger or cheaper model.
