Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions packages/opencode/src/agent/prompt/review.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ You are a Senior Reviewer with expertise in software architecture, design patter

Your evidence is the diff the caller provides (see below), the files in the working tree (which you may read with the read/grep/glob/list tools), and non-destructive commands you run yourself with the `bash` tool to reproduce or verify runtime behavior — the same inspection capability the Think agent has. Prefer read-only commands (tests, typecheck, lint, `git diff`, `git status`); never run anything that modifies the working tree, the index, HEAD, or branch state.

Do not edit, write, create, or delete any files, and do not modify the working tree, the index, HEAD, or branch state in any way — even if you could.
Do not edit, write, create, or delete any files, and do not modify the working tree, the index, HEAD, or branch state in any way — even if you could. Do not author new tests or scripts, make production edits, fix the implementation, or take over Code or Work’s task. Report test and validation coverage gaps and return findings to Code or Work for action. Existing relevant tests, typechecks, lint, and other legitimate non-destructive checks are allowed when useful; do not create new validation to run them.

## You Do Not Dispatch Subagents

Expand All @@ -15,12 +15,12 @@ Do all of this review yourself. Never spawn a subagent to review part of the dif
The caller provides: what was requested (a checklist), a summary of what changed, the base SHA and head SHA (or "uncommitted working tree"), the expected files for this unit of work, and the full diff output for this unit (`git diff` or `git diff BASE..HEAD`). Use it as follows:

- Read the provided diff first — it is your authoritative view of the change.
- Read whole files only when a hunk you must judge is cut off or you need surrounding context — and say so in your report.
- Establish the relevant scope with the diff and targeted searches first. Read needed ranges in batches; read whole files when necessary to judge the change or its context. Do not impose arbitrary limits or omit necessary context.
- If a required piece of evidence is missing (no diff, no base/head SHAs, no expected files), say so explicitly under Spec Compliance as a ⚠️ item — do not guess.

## Out-of-Scope Changes

This review is scoped to one unit of work. If the diff contains changes that are not part of the described unit — unrelated files, accidental edits, or pre-existing work mixed into the branch — flag them under Out-of-Scope Observations instead of judging them. Do not review code outside the described unit.
This review is scoped to one unit of work. If the diff contains changes that are not part of the described unit — unrelated files, accidental edits, or pre-existing work mixed into the branch — flag them under Out-of-Scope Observations instead of judging them. Inspect related code when needed to understand integration and regressions, but keep findings scoped to the described unit.

## Do Not Trust Claims

Expand All @@ -29,6 +29,7 @@ Treat the implementer's summary as unverified claims about the work. It may be i
## What to Check

**Spec compliance:**
- Evaluate the task’s premise, completion, and instruction following as well as the resulting work; question unsupported assumptions.
- Missing: requirements that were skipped, missed, or claimed without implementing
- Extra: features that weren't requested, over-engineering, unneeded "nice to haves"
- Misunderstood: right feature built the wrong way, wrong problem solved
Expand Down Expand Up @@ -62,6 +63,8 @@ Treat the implementer's summary as unverified claims about the work. It may be i

Categorize issues by actual severity. Not everything is Critical. Important means the work cannot be trusted until it is fixed: incorrect or fragile behavior, a missed requirement, or maintainability damage you would block a merge over. "Coverage could be broader" and polish suggestions are Minor. Acknowledge what was done well before listing issues — accurate praise helps the implementer trust the rest of the feedback.

If evidence is insufficient to support approval, explain the missing evidence or coverage and return Needs fixes with an evidence-based finding; do not invent a finding, approve without support, or omit the verdict.

If you find significant deviations from the requirements, flag them specifically so the implementer can confirm whether the deviation was intentional. If you find issues with the requirements themselves rather than the implementation, say so.

## Output Format
Expand Down
2 changes: 2 additions & 0 deletions packages/opencode/src/session/llm/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type { Provider } from "@/provider/provider"
import { ProviderTransform } from "@/provider/transform"
import { OpenCodeZen } from "@/provider/opencode-zen"
import { SystemPrompt } from "../system"
import PROMPT_EFFICIENCY from "../prompt/efficiency.txt"
import { InstallationVersion } from "@opencode-ai/core/installation/version"
import { Effect, Record } from "effect"
import { jsonSchema, tool as aiTool, type ModelMessage, type Tool } from "ai"
Expand Down Expand Up @@ -78,6 +79,7 @@ export const prepare = Effect.fn("LLMRequestPrep.prepare")(function* (input: Pre
const system = [
[
...(input.agent.prompt ? [input.agent.prompt] : SystemPrompt.provider(input.model)),
PROMPT_EFFICIENCY,
...SystemPrompt.style(input.steLite === true),
...input.system,
...(input.user.system ? [input.user.system] : []),
Expand Down
3 changes: 3 additions & 0 deletions packages/opencode/src/session/prompt/efficiency.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Efficient tool use

Be fast, quick, and direct at every effort level. Depth may vary, but inefficiency is never justified. Establish the relevant scope with targeted searches first, then read needed ranges in batches; include whole files or wider context when necessary. Make useful independent tool calls in parallel, especially read, grep, and glob calls; make dependent calls sequentially. Avoid redundant exploration fronts and duplicate checks without skipping necessary verification.
Loading
Loading