opencode-review-security — Claude Code prompt for security reviews
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.
Apache-2.0 ★ 423 updated 2026-11-16
.claude/commands/opencode-review-security.mdWhat opencode-review-security does
The prompt lays out a security review workflow for pull requests in a Rust repository. It checks the diff before invoking the security-review skill, then assigns severity based on how exploitable a finding is and what damage it could cause. Findings must name a concrete risk.
For changes limited to docs or comments, it writes pass to ./.opencode-verdict.txt and updates the summary comment. Changes under .github/workflows/, .github/scripts/, .github/prompts/, or .agents/skills/ always require a full review. The workflow needs gh, repository and PR context values, and the security-review skill at .agents/skills/security-review/SKILL.md.
What it helps with
- review a pull request for security flaws
- skip full analysis for docs-only changes
- rank findings by exploitability
- update the PR verdict and summary comment
Example prompts for the agent
- Review this Rust pull request for security risks.
- Check this PR for exploitable security issues and post the summary result.
How to install opencode-review-security
Manually: put the files in place
.claude/commands/opencode-review-security.mdHow to use
Paste the text at the start of a chat or into project instructions
Questions about opencode-review-security
How do I install opencode-review-security in Claude Code?
Add the prompt file at .claude/commands/opencode-review-security.md.
What does opencode-review-security do?
It defines a security review workflow for Rust pull requests and invokes the security-review skill. For PRs with no code changes, it records pass and updates the summary comment.
What does opencode-review-security need to run?
It needs gh, repository and PR values in the run context, and the security-review skill at .agents/skills/security-review/SKILL.md.
Source text
opencode-review-security.md · Apache-2.0
You are performing an automated **Security 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 `security-review` skill
Your FIRST action is to invoke the `security-review` skill via the `skill` tool with skill ID `security-review`. The skill lives in this repository at `.agents/skills/security-review/SKILL.md` and is discovered by OpenCode automatically.
- The skill owns the review shape: its checklist (scope, threat model, input validation, authorization, secrets handling, dependency changes) defines the analysis steps. Do not re-derive or hand-roll the scope here.
- You assign severity by **exploitability**: how reachable and damaging the issue is in the context of this diff.
## Step 2 — No-op when there are no code changes
Before invoking the skill, run `gh pr diff ${PR_NUMBER}` and inspect the changed file list. Changes under `.github/workflows/`, `.github/scripts/`, `.github/prompts/`, or `.agents/skills/` are **always security-relevant and never take the no-op path** — these paths control what code and instructions run in CI with secrets, so they always warrant the full review. Otherwise, if the diff contains **no code changes at all** (docs-only or comment-only changes — i.e. no non-doc code change), 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:
```
**Security review:** no security-relevant changes. ✅
<!-- 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>` = `Security review`
- `<KIND_HYPHEN>` = `Security-review`
- `<SKILL_ID>` = `security-review`
- `<SKILL_PATH>` = `.agents/skills/security-review/SKILL.md`
- `<FINDING_DESC>` = `concrete issue`
- `<SEVERITY_NOTE>` = Severity is one of `Critical`, `High`, `Medium`, `Low`, assigned by exploitability.
- `<INLINE_SCOPE_LIMIT>` = `Do not post inline comments for stylistic preferences, missing tests, or general code quality — those belong to the other review workflows, not here.`
- `<SUMMARY_HEADING>` = `**Security review** (security-review skill)`
- `<NO_FALLBACK>` = `hand-rolled security checks`
© relatedb · Apache-2.0 · relatedb/relate