review-pr — Claude Code skill: PR review and setup
This skill reviews a PR or branch through a code knowledge graph, showing risk, affected flows, and test gaps. Use it when a diff needs structural context.
npx skills add tirth8205/code-review-graph --skill review-pr -a claude-codeWhat review-pr does
The skill reviews every commit in a pull request or branch against its base branch. It identifies changed files, risk-scored functions, missing tests, and affected flows across the branch. The output includes a summary, overall risk, blast radius, test coverage, file-level concerns, missing tests, and recommendations.
It uses graph tools such as get_minimal_context_tool, detect_changes_tool, query_graph_tool, and review-context queries. For high-risk functions, it checks callers and tests, then flags public API changes when callers were not updated. If the graph is not ready, the workflow runs build_or_update_graph_tool() before continuing.
The review scenario uses main as its base and can account for master. Check the base branch before running it, because that choice controls the diff and impact analysis.
What it helps with
- review a PR against its base branch
- spot high-risk changed functions
- trace the blast radius of a diff
- find missing tests for changed code
- flag public API changes with stale callers
Example prompts for the agent
- Review `<PR number or branch name>` against `main` and produce the structured PR review.
- Analyze `<PR number or branch name>`, then inspect callers and tests for every high-risk function.
- Compare the current branch with `main`, report affected flows and missing tests, and update the graph if it is not ready.
How to install review-pr
1Skills CLI (Vercel)
npx skills add tirth8205/code-review-graph --skill review-pr -a claude-code2Manually: put the files in place
~/.claude/skills/review-pr/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/review-pr/
1Skills CLI (Vercel)
npx skills add tirth8205/code-review-graph --skill review-pr -a codex2Manually: put the files in place
.agents/skills/review-pr/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add tirth8205/code-review-graph --skill review-pr -a cursor2Manually: put the files in place
.cursor/skills/review-pr/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install tirth8205/code-review-graph review-pr2Manually: put the files in place
.github/skills/review-pr/SKILL.md1Skills CLI (Vercel)
npx skills add tirth8205/code-review-graph --skill review-pr -a gemini-cli2Platform CLI
gemini skills install https://github.com/tirth8205/code-review-graph --path skills/review-prManually: put the files in place
.devin/skills/review-pr/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add tirth8205/code-review-graph --skill review-pr -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set7
The whole set →Similar
Questions about review-pr
How do I install review-pr in Claude Code?
Run npx skills add tirth8205/code-review-graph --skill review-pr -a claude-code, then run npx skills add tirth8205/code-review-graph --skill review-pr -a claude-code again. The skill file is at ~/.claude/skills/review-pr/SKILL.md.
What does review-pr do?
It reviews a PR or branch with a code knowledge graph, scores changed functions for risk, checks callers and tests, and produces a structured review with blast-radius analysis.
What happens when the code graph is not ready?
The workflow calls build_or_update_graph_tool() and continues with the change analysis.
Source text
SKILL.md · MIT
--- name: review-pr description: Review a PR or branch diff using the knowledge graph for full structural context. Outputs a structured review with blast-radius analysis. argument-hint: "[PR number or branch name]" --- # Review PR Review all commits of a pull request or branch against its base branch. ## Steps 1. Identify the changes. With a branch name run `git diff --name-only main...<branch>`; otherwise diff the current branch against `main` (or `master`). Use that ref as `base` below. 2. Call `get_minimal_context_tool(task="review PR", base="main")`. If it returns `status: not_ready`, call `build_or_update_graph_tool()` and continue. 3. Call `detect_changes_tool(base="main", detail_level="minimal")` for risk-scored changed functions, test gaps and affected flows across the whole branch. 4. For high-risk functions call `query_graph_tool(pattern="callers_of", target="<function>")` and `query_graph_tool(pattern="tests_for", target="<function>")`. Flag public API changes whose callers were not updated. 5. Call `get_review_context_tool(base="main")` for source snippets, or `get_impact_radius_tool(base="main")` for the full dependent list, only when step 3 leaves a high-risk item unclear. 6. Read the changed source of the highest-impact files first. Do not load whole files unless the change needs it. ## Output ``` ## PR Review: <title> ### Summary <1-3 sentences> ### Risk - Overall: Low / Medium / High - Blast radius: <n> files, <m> functions - Test coverage: <covered> of <changed> changed functions ### Files #### <path> - Changes: <what> - Impact: <who depends on it> - Issues: <bugs, style, concerns> ### Missing Tests - <function> in <file> ### Recommendations 1. <action> ``` ## Tips - Use `semantic_search_nodes_tool` to find related code the PR may have missed.
© tirth8205 · MIT · tirth8205/code-review-graph