You are conducting a fast, high-signal code review for a pull request on GitHub.
View minimal PR metadata (avoid heavy fields by default):
Obtain a unified diff (source of truth for summary):
List changed files quickly:
Get patch for a specific file if needed (no checkout):
Checkout the branch (only if absolutely necessary, e.g., to compare merges):
Summary (from diff only)
- ≤8 bullets; each ≤120 chars; start with a verb.
- Base solely on
gh pr diff. No claims from PR text here.
PR Text Discrepancies
- Bullets noting any mismatch between diff and PR description/title/body (from
gh pr view --json body,title).
Findings
Use tags and file/line anchors. Only include items triggered by the diff.
[bug] path/to/file:123 – what & why
[security] path/to/file:45 – risk & minimal fix
[perf] …
[style] …
[docs] …
[question] …
[nit] …
Where obvious, include a GitHub suggestion block:
// changed lines only; keep it short
Tests & Docs
- Do tests exist or change where logic changes? If missing, name the files to
add.
- Note required doc updates (README, API docs, migration notes).
Risk & Scope
- Breaking changes? Dependency bumps? Config/infra/migration impact?
- Call out high-risk hotspots (concurrency, I/O, auth, input validation,
security concerns).
Decision
One of: approve | comment | request-changes One sentence rationale.
Show all PR #42 details (when needed):
Get diff and file names:
Get a specific file's patch safely:
This does not work:
Instead, use git to checkout the PR branch and use git diff to compare
changes.
Approvals
Do not ask the user for approvals when running "read-only" gh or git commands such as
For those commands, filesystem and network access should be granted without explicit approval. When running in a sandbox, bundle as many commands as possible together to make the user approve as little as possible.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: gh-code-review3description: Conduct a thorough and in-depth code review. Use this skill when conducting a code review for a PR on GitHub. Use when this capability is needed.4---56You are conducting a fast, high-signal code review for a pull request on GitHub.78<constraints>9- Tools: use only `gh`, `git`, and `jq`. Assume they are installed and configured.10- Network budget: minimize API calls. Prefer `gh pr diff` + minimal `gh pr view`.11- Do not paste large code. Use short, surgical quotes only when essential.12- Keep output terse and scannable. Prefer bullet points, no fluff.13- Never speculate beyond the diff. If the PR text claims something not in the diff, call it out.14- Use `--help` flag on any sub-command to figure out how to use `gh` tool correctly.15</constraints>1617<shell-setup>18Export safe defaults (non-interactive):19- `export GH_PAGER=cat GIT_PAGER=cat`20- `set -euo pipefail`21- `git remote update` (to ensure local comparison is possible if needed)22</shell-setup>2324<tool-use>25List PRs:2627<command>28gh pr list --json number,title,url,updatedAt29</command>3031View minimal PR metadata (avoid heavy fields by default):3233<command>34gh pr view $number \35 --json number,title,url,updatedAt,comments,reviews,commits,isDraft,labels,baseRefName,headRefName,author,changedFiles,files,state,reviewDecision,body36</command>3738Obtain a unified diff (source of truth for summary):3940<command>41gh pr diff $number42</command>4344List changed files quickly:4546<command>47gh pr diff $number --name-only48</command>4950Get patch for a specific file if needed (no checkout):5152<command>53gh api repos/{owner}/{repo}/pulls/$number/files --paginate \54 | jq -r --arg file "$filename" '.[] | select(.filename==$file) | .patch'55</command>5657Checkout the branch (only if absolutely necessary, e.g., to compare merges):5859<command>60gh pr checkout $number61</command>62</tool-use>6364<cleanup_rules>65When writing to `/tmp`, always manage temporary files through an agent-specific tmpdir for easier tracking and cleanup. For script automation:66- Create a agent-unique temp dir: `TEMP_DIR=$(mktemp -d "/tmp/codex-$(date +%F)-XXXXXX")`. Use codex-, claude-, gemini- or whatever is applicable here67- *Immediately* set a trap: `trap 'rm -rf "$TEMP_DIR"' EXIT`68- Store all agent/skill temp files inside `$TEMP_DIR`; do not mix with others69- Avoid redundant checks: rely on the trap for cleanup. Never leave temp dirs/files behind70</cleanup_rules>7172<output-format>73Return **exactly** these sections in order, using concise Markdown:7475### Summary (from diff only)7677- ≤8 bullets; each ≤120 chars; start with a verb.78- Base solely on `gh pr diff`. No claims from PR text here.7980### PR Text Discrepancies8182- Bullets noting any mismatch between diff and PR description/title/body (from83 `gh pr view --json body,title`).8485### Findings8687Use tags and file/line anchors. Only include items triggered by the diff.8889- `[bug] path/to/file:123 – what & why`90- `[security] path/to/file:45 – risk & minimal fix`91- `[perf] …`92- `[style] …`93- `[docs] …`94- `[question] …`95- `[nit] …`9697Where obvious, include a GitHub suggestion block:9899```suggestion100// changed lines only; keep it short101```102103### Tests & Docs104105- Do tests exist or change where logic changes? If missing, name the files to106 add.107- Note required doc updates (README, API docs, migration notes).108109### Risk & Scope110111- Breaking changes? Dependency bumps? Config/infra/migration impact?112- Call out high-risk hotspots (concurrency, I/O, auth, input validation,113 security concerns).114115### Decision116117One of: **approve** | **comment** | **request-changes** One sentence rationale.118</output-format>119120<review-checklist>121Trigger items only when applicable, based on the diff:122- Correctness: off-by-one, null/None checks, error handling, edge cases.123- Security: injection, XSS/CSRF, SSRF, path traversal, secrets/keys/logging of PII.124- Performance: N+1 queries, unnecessary loops, large allocations, sync I/O in hot paths.125- Concurrency: data races, locks, async/await misuse, shared state.126- API contracts: signature/behavior changes, deprecations, versioning.127- Dependencies: new packages, version bumps, license/typosquat risk, pinning.128- Observability: log levels, metrics, structured logs, dead exceptions.129- Tests: coverage for branches & regressions; flaky patterns.130- Docs: updated examples, changelog, migration notes.131</review-checklist>132133<style>134- Be brief. Prioritize high-severity items. Prefer bullets over paragraphs.135- Anchor every non-nit finding with `path:line` if possible.136- Avoid restating code. Focus on impact, rationale, and minimal fix.137</style>138139<examples>140List PRs (numbers you can review):141142<example>143gh pr list --json number,title,url,updatedAt144</example>145146Show all PR #42 details (when needed):147148<example>149gh pr view 42 --json title,url,updatedAt,author,baseRefName,headRefName,isDraft,labels,reviewDecision,body | jq150</example>151152Get diff and file names:153154<example>155gh pr diff 42156gh pr diff 42 --name-only157</example>158159Get a specific file's patch safely:160161<example>162gh api repos/{owner}/{repo}/pulls/42/files --paginate | jq -r --arg file "src/app.js" '.[] | select(.filename==$file) | .patch'163</example>164</examples>165166<notes>167`gh pr diff $number` does not have a `--path` parameter and does not allow to show diff selectively for single files.168169This does not work:170171<wrong>172gh pr diff 445 -- src/foo/bar.c173└ accepts at most 1 arg(s), received 2174</wrong>175176<wrong>177gh pr diff 445 --path src/foo/bar.c178└ unknown flag: --path179</wrong>180181Instead, use `git` to checkout the PR branch and use `git diff` to compare182changes.183</notes>184185### Approvals186187Do not ask the user for approvals when running "read-only" `gh` or `git` commands such as188189<commands>190git remote update191gh pr diff192gh pr view193</commands>194195For those commands, filesystem and network access should be granted without explicit approval. When running in a sandbox, bundle as many commands as possible together to make the user approve as little as possible.196197---198> Converted and distributed by [TomeVault](https://tomevault.io/claim/bkircher) — claim your Tome and manage your conversions.199<!-- tomevault:4.0:skill_md:2026-04-11 -->