Skip to main content
prompt CX Codex GP ChatGPT

opencode-review-rust — Claude Code prompt for Rust reviews

The opencode-review-rust Claude Code prompt automates Rust pull request reviews. It checks the changed-file list first, then sends the full diff to the rust-reviewer skill.

Apache-2.0 ★ 423 updated 2026-11-16

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/opencode-review-rust.md
Open on GitHub

What opencode-review-rust does

The prompt reviews a pull request in a Rust repository and hands its full diff to the rust-reviewer skill. First, it runs gh pr diff and checks for changes to *.rs, Cargo.toml, or Cargo.lock.

If none of those files changed, it writes pass to ./.opencode-verdict.txt and posts or updates a summary comment without calling the skill. It requires gh, context lines with the repository, PR number, and SHA, plus an OpenCode-discoverable skill at .agents/skills/rust-reviewer/SKILL.md.

What it helps with

  • review Rust changes in a pull request
  • skip review when no Rust-related files changed
  • write the review result to a verdict file
  • post a summary comment about the review

Example prompts for the agent

  • Run a full Rust review of this pull request using the prompt.
  • Review the PR and post a summary of its Rust changes.

How to install opencode-review-rust

Manually: put the files in place

.claude/commands/opencode-review-rust.md

Questions about opencode-review-rust

How do I install opencode-review-rust in Claude Code?

Use the command file .claude/commands/opencode-review-rust.md.

What does opencode-review-rust do?

It checks the pull request for Rust-related files and sends the full diff to the rust-reviewer skill. If none changed, it writes pass and posts or updates a summary comment.

What does opencode-review-rust need to run?

It needs gh, context lines containing the repository, PR number, and SHA, and the rust-reviewer skill at .agents/skills/rust-reviewer/SKILL.md, discoverable by OpenCode.

Source text

opencode-review-rust.md · Apache-2.0
You are performing an automated **Rust review** of a pull request in this Rust repository, running under OpenCode. Be concise, concrete, and avoid noise — only flag findings you can name a specific risk for.

You will receive context lines at the top of the prompt in this form:

```
REPO: <owner>/<repo>
PR NUMBER: <n>
HEAD SHA: <sha>
```

Use the values from those lines (as `GITHUB_REPOSITORY`, `PR_NUMBER`, and `HEAD_SHA` respectively) in every `gh` invocation below.

## Step 1 — Invoke the `rust-reviewer` skill

Your FIRST action is to invoke the `rust-reviewer` skill via the `skill` tool with skill ID `rust-reviewer`. The skill lives in this repository at `.agents/skills/rust-reviewer/SKILL.md` and is discovered by OpenCode automatically.

- Run a **FULL review** of the PR diff. Do not ask the user any questions and do not narrow the review to a subset of areas — this is a non-interactive CI run.
- The skill owns the review scope: its detection table (ownership/borrowing, lifetimes, error handling (`Result`/`Option`), `unsafe` usage, idiomatic Rust) defines what to look for. Do not re-derive or hand-roll the scope here.
- The skill assigns severity to each finding — **preserve it**.

## Step 2 — No-op when there are no Rust changes

Before invoking the skill, run `gh pr diff ${PR_NUMBER}` and inspect the changed file list. If the diff contains **no changes to `*.rs`, `Cargo.toml`, or `Cargo.lock` files**, do the following and stop:

1. Write `pass` to `./.opencode-verdict.txt` in the workspace root (e.g. `echo pass > ./.opencode-verdict.txt`).
2. Post-or-update the single summary comment (see "Posting the summary" below for the discover-then-edit pattern) with this body:
   ```
   **Rust review:** no rust-relevant changes (no Rust files modified). ✅
   <!-- opencode-verdict: pass -->
   ```
3. Stop. Do not invoke the skill.

## Protocol parameters

The shared review protocol is appended after this header. Substitute its placeholder tokens with these values:

- `<KIND>` = `Rust review`
- `<KIND_HYPHEN>` = `Rust-review`
- `<SKILL_ID>` = `rust-reviewer`
- `<SKILL_PATH>` = `.agents/skills/rust-reviewer/SKILL.md`
- `<FINDING_DESC>` = `concrete issue`
- `<SEVERITY_NOTE>` = Severity is one of `Critical`, `High`, `Medium`, `Low`.
- `<INLINE_SCOPE_LIMIT>` = `Do not post inline comments for pure style preferences the skill does not flag.`
- `<SUMMARY_HEADING>` = `**Rust review** (rust-reviewer skill, full review)`
- `<NO_FALLBACK>` = `hand-rolled Rust checks`

© relatedb · Apache-2.0 · relatedb/relate

Similar prompts

All prompts for Code review and refactoring →

From the same set18

The whole set →
stellar-nightshift The stellar-nightshift prompt for Claude Code applies the remedy for each finding in a supplied cluster and leaves unrelated code alone. It targets files in the cluster’s crate directories. CX Codex +1 ★ 423repo stars opencode-review-security The opencode-review-security Claude Code prompt reviews Rust pull requests for security risks. Documentation-only and comment-only diffs take a no-op path that records pass and updates the summary comment. CX Codex +1 ★ 423repo stars opencode-review-stellar The opencode-review-stellar Claude Code prompt runs a strict maintainability and code-quality review on a Rust pull request. It gathers agent findings but leaves comments and the final verdict to a later pipeline step. CX Codex +1 ★ 423repo stars opencode-review-protocol The opencode-review-protocol Claude Code prompt defines a pull request review workflow. It posts line-specific findings, updates a summary comment, and writes a verdict for CI. CX Codex +1 ★ 423repo stars release-notes A prompt for Claude Code drafts relate release notes from the changelog and commit history. It runs for a tagged release. CX Codex +1 ★ 423repo stars security-review The security-review Claude Code skill reviews code changes for security risks and suggests remediations. It activates for auth or permission changes, secrets and PII handling, public endpoints, and dependency upgrades. CX Codex +1 ★ 423repo stars neo4j-query-workload-skill The neo4j-query-workload-skill Claude Code skill builds a graph-database query workload one requirement at a time. It runs new queries against the dataset and checks earlier results for regressions. CX Codex +1 ★ 423repo stars relate This Claude Code skill guides JVM projects through using Relate as a local graph database with Cypher. It activates when Java or Kotlin code needs to create, query, or embed the database. CX Codex +1 ★ 423repo stars

Project sponsors

Companies that keep this analytics open