review-pr
Skill288 starsChanged 54 days agoMITView on GitHub
Review a pull request against Insights architecture standards — fetches PR diff, verifies previous comments are addressed, validates PR metadata (title, branch, issue reference, size), runs a code-standards check against every file in `.claude/rules/` and `.claude/hooks/guard-protected-files.sh`, and drafts inline review comments with suggested fixes. NEVER auto-posts comments or submits reviews — always presents a draft in the terminal for user approval before any comment lands on the PR. Use when reviewing PRs, checking PR quality, validating code changes, or when the user says "review", "check this PR", or "audit code".
185 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- data-privacy-stack/presidiotheir own version, first seen Nov 9, 2026
- pgmpy/pgmpytheir own version, first seen Nov 9, 2026
- enes-alatas/spooltheir own version, first seen Nov 8, 2026
- microsoft/presidiotheir own version, first seen Nov 8, 2026
- domengabrovsek/agent-configtheir own version, first seen Nov 8, 2026
- domengabrovsek/claudetheir own version, first seen Nov 8, 2026
Used with
Projects with it also use diagnose-ci-failures, docs-loop and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
zerx-labSkilldiagnose-ci-failures
Diagnose CI failures for a PR using the GitHub CLI, extract error logs, and generate a plan to fix them. Use when the user asks to check CI status, pull CI issues, triage test failures, or investigate PR build failures.
Also in 3 projects that use this
GeiserXSkilldocs-loop
Use when the user asks to audit docs, check documentation for stale claims, or verify docs against the code.
Also in 3 projects that use this
GeiserXSkillfull-loop
Drive a repository to done with sergio-loop, then keep improving it with refine-loop at a descending theta. Use only when the user explicitly invokes full-loop.
Also in 3 projects that use this
n24q02mSkillreview-delta
Review only changes since last commit using impact analysis. Token-efficient delta review with automatic blast-radius detection.
Also in 3 projects that use this
n24q02mSkillbuild-graph
Build or update the code review knowledge graph. Run this first to initialize, or let hooks keep it updated automatically.
Also in 3 projects that use this
- +7 more from GeiserX
Other versions185 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- CrowdDotDev/crowd.dev★ 3.4k75% same
Wrote their own version · 184
- denoland/deno★ 109ksame name
- ToolJet/ToolJet★ 41ksame name
- remix-run/remix★ 33ksame name
- tirth8205/code-review-graph★ 33ksame name
- alpinejs/alpine★ 32ksame name
- nrwl/nx★ 29ksame name
- PrefectHQ/fastmcp★ 28ksame name
- jlowin/fastmcp★ 28ksame name
- livewire/livewire★ 24ksame name
- microsoft/fluentui★ 20ksame name
174 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- adrSkill
- commitSkill
- db-migrateSkill
- dcoSkill
- event-trackingSkill
- fix-security-findingSkill
- fix-vulnsSkill
- preflightSkill
- setup-docsSkill
- setupSkill
- tech-writerSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. 0 are common, 11 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 178 edited versions we read keep these.
11
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 36
If no PR number is provided, use AskUserQuestion to ask for one.
- Distinctive: line 46
Run all of the following in a single turn:
- Very specific: line 68
If the diff is too large, save it to /tmp/pr-<N>.diff and read only changed .ts, .vue, .scss, .md files with Read.
- Very specific: line 80
Read .claude/hooks/guard-protected-files.sh.
- Distinctive: line 119
Check whether previously raised review comments were actually addressed in code.
- Very specific: line 124
Read the file on the PR branch: git show origin/<headRefName>:<file>
- Distinctive: line 136
If no previous review comments, note "No previous review comments found" and move on.
- Distinctive: line 159
If non-zero exit code, flag SHOULD FIX: branch needs a rebase.
- Distinctive: line 179
Wait for the Phase 2 enforcer Agent to complete.
- Distinctive: line 183
Before surfacing any finding, drop it if:
- Distinctive: line 219
Use AskUserQuestion with options:
- Distinctive: line 225
Do NOT proceed until the user explicitly picks an option.
- Very specific: line 235
If the user said "don't post", stop here — do not invoke /review or any PR-mutating gh command.
- Very specific: line 243
If additions > 1000, include in the review body:
- Distinctive: line 253
If the author has fewer than 5 merged PRs to this repo, be more educational in inline comments — explain the why behind each rule, not just …
- Distinctive: line 257
If the user passed extra instructions after the PR number, prioritize those areas but still execute the full review pipeline.
“Common” is measured: kept by at least 6 in 10 of the 178 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Insights PR Review
You are reviewing a pull request against the Insights architecture standards and project conventions. Walk through each phase in order.
The review is backed by these living sources of truth — always pull current contents rather than relying on memory:
.claude/rules/*.md— all project rules.claude/hooks/guard-protected-files.sh— the authoritative protected-files listAGENTS.md— project conventions
Phase 1: Input & Context Gathering
Parse arguments
The args string follows this format: <PR number> [extra instructions].
- First token is the PR number if numeric.
- Everything after it is extra instructions (e.g. "focus on backend", "check that previous comments were addressed").
- If no PR number is provided, use AskUserQuestion to ask for one.
Determine repository
gh repo view --json nameWithOwner --jq '.nameWithOwner'Fetch PR metadata (parallel)
Run all of the following in a single turn:
# PR details
gh pr view <N> --json title,body,headRefName,baseRefName,author,files,additions,deletions,state,number
# Full diff
gh pr diff <N>
# Previous inline review comments
gh api repos/{owner}/{repo}/pulls/{N}/comments --paginate
# Previous review summaries
gh api repos/{owner}/{repo}/pulls/{N}/reviews --paginate
# Commit messages
gh api repos/{owner}/{repo}/pulls/{N}/commits --paginate --jq '.[].commit.message'
# Fetch both branches for merge-base check
git fetch origin <baseRefName> <headRefName>If the diff is too large, save it to /tmp/pr-<N>.diff and read only changed .ts, .vue, .scss, .md files with Read.
Load all project rules (dynamic — do not hardcode)
Glob .claude/rules/*.md and read every rule file. At time of writing this includes:
always-use-uikit.md— uikit component usage rulespnpm-workspace-commands.md— pnpm workspace conventionscommit-workflow.md— PR title format, branch naming, issue tracking, signing
Load the protected-files hook
Read .claude/hooks/guard-protected-files.sh. Parse its case statements and if conditions to build the authoritative protected-files list. Never maintain it by hand — parse the hook so it stays in sync.
Phase 2: Launch Code Enforcer (background)
Spawn a background Agent subagent with run_in_background: true. Proceed to Phase 3 immediately while it runs in parallel.
Prompt for the agent:
You are a code-standards enforcer for the Insights codebase (Nuxt 4 / Vue 3 / TypeScript).
Branch:
origin/<headRefName>Changed files: (include the full list from Phase 1)For each file, read it with
git show origin/<headRefName>:<path>and check against:
.claude/rules/*.md— glob and read all rule files.claude/skills/review-pr/references/frontend-checklist.md— for files underfrontend/app/.claude/skills/review-pr/references/backend-checklist.md— for files underfrontend/server/AGENTS.md— project conventionsAlso read
.claude/hooks/guard-protected-files.shand parse itscase/ifpatterns. For every changed file matching a protected pattern, emit a NIT finding with the hook's warning reason.Severity calibration:
- CRITICAL — runtime bugs, security issues, secrets in code, broken auth, missing
createErrorfor HTTP errors- SHOULD_FIX — documented style/structure violations (raw HTML instead of uikit, Options API, missing license headers,
space-y-*instead ofgap-*,anytype, inline DB queries instead of repo pattern)- NIT — minor improvements, naming, protected-file awareness
Return findings as JSON:
[{ "file": "...", "line": N, "severity": "CRITICAL|SHOULD_FIX|NIT", "rule": "<rule-file>:<section>", "message": "...", "suggestion": "..." }]If you cannot quote the rule from a loaded rule file or checklist, drop the finding. Hallucinated rules are worse than missed ones.
Phase 3: Verify Previous Review Comments
Check whether previously raised review comments were actually addressed in code. Do NOT trust "resolved" status — read the actual code.
- Gather all inline comments and review bodies from Phase 1.
- Skip trivial comments: nits, "+1", bot auto-comments, purely informational remarks.
- For every CRITICAL or SHOULD FIX comment:
- Read the file on the PR branch:
git show origin/<headRefName>:<file> - Compare current code against what the comment requested.
- Classify: FIXED / NOT FIXED / PARTIALLY FIXED / N/A
- Read the file on the PR branch:
- Build a markdown table:
| # | Comment Summary | File | Status | Evidence |
| --- | ------------------------- | -------------------------- | --------- | --------------------------- |
| 1 | Use lfx-button not button | app/components/Foo.vue | FIXED | Line 12 now uses lfx-button |
| 2 | Missing license header | server/api/projects.get.ts | NOT FIXED | File still has no header |If no previous review comments, note "No previous review comments found" and move on.
Phase 4: PR Metadata Validation
Validates PR metadata against commit-workflow.md.
Checks
- PR title format — must match
type: description(Conventional Commits), all lowercase, no issue reference in title. A scope is optional.- Valid types:
feat,fix,docs,style,refactor,perf,test,build,ci,chore,revert
- Valid types:
- Branch name format — should match
<type>/issue-<issue-number>-short-description(e.g.feat/issue-123-token-refresh). Flag as NIT if non-conforming but otherwise well-formed. - Issue reference — the PR body should link the tracking issue with
ClosesorRefs. Strip HTML comments from the body first, then extract withgrep -oE '(Closes|Refs) linuxfoundation/lfx-cdp-insights-ops#[0-9]+'. If none, flag SHOULD FIX. If the body uses a bareCloses #<number>/Refs #<number>instead, flag SHOULD FIX: it points at alinuxfoundation/insightsissue, not the tracker. Other bare#<number>mentions (e.g. related insights PRs) are fine. Commit-body references are checked by/preflight. Branch rebased on main:
git merge-base --is-ancestor origin/main origin/<headRefName>If non-zero exit code, flag SHOULD FIX: branch needs a rebase.
- PR size — if
additions > 1000, note percommit-workflow.md's 1000-line target.
Build a findings table:
| Check | Status | Detail |
| --------------- | ------ | ---------------------------------------------- |
| PR title format | PASS | `feat(auth): add token refresh` |
| Branch name | PASS | `feat/issue-123-token-refresh` |
| Issue reference | PASS | Found linuxfoundation/lfx-cdp-insights-ops#123 |
| Branch rebased | PASS | origin/main is an ancestor |
| PR size | PASS | 342 additions |Phase 5: Compile Context
Wait for the Phase 2 enforcer Agent to complete. Then compile all findings.
Apply false-positive filter
Before surfacing any finding, drop it if:
- The
rulefield cannot be matched by string search in the loaded rule files, checklists, or hook - It relates to a pattern that doesn't exist in this codebase (e.g. Angular-specific rules)
Assemble the context block
- Previous comment verification — Phase 3 table (or "No previous review comments found")
- PR metadata validation — Phase 4 table
- Protected files touched — list any matching
.claude/hooks/guard-protected-files.sh, with the hook's warning reason - Code enforcer findings — filtered JSON results from Phase 2
- Domain checklists applied — note which checklists were checked:
- Frontend files (
frontend/app/**) →references/frontend-checklist.md - Backend files (
frontend/server/**) →references/backend-checklist.md
- Frontend files (
- Extra user instructions — any additional instructions from the args
Phase 6: Present Draft Review for Approval (NEVER auto-post)
You MUST NOT post inline comments, submit a review, or request changes without the user's explicit approval. Always present the draft first and wait for a clear go-ahead. This applies every time, with no exceptions.
Step 1 — Show the draft
Print the compiled context as a draft review summary:
- PR summary — number, title, author, size, branch
- Phase 3 table — previous comments and whether they were addressed
- Phase 4 table — PR metadata validation
- Protected files touched — list with hook reasons
- Proposed inline comments — one block per finding: file:line, severity, rule citation, message, suggested fix. Number them so the user can reference individual items.
- Proposed review body — summary text for the top of the review
- Proposed review verdict — COMMENT / APPROVE / REQUEST_CHANGES, with reasoning
Step 2 — Ask for approval
Use AskUserQuestion with options:
- "Post all comments as drafted"
- "Post with changes — I'll tell you which comments to drop or edit"
- "Don't post — just keep the summary here"
Do NOT proceed until the user explicitly picks an option. Treat silence or ambiguous replies as "don't post".
Step 3 — Only after approval: invoke /review
Once the user approves (with or without edits), apply their edits and use the Skill tool to invoke review with the PR number and compiled context:
<PR number> -- <compiled context from Phase 5, with user's edits applied>If the user said "don't post", stop here — do not invoke /review or any PR-mutating gh command.
Additional Rules
PR size check
If additions > 1000, include in the review body:
Note: This PR has {additions} additions, which exceeds the recommended 1000-line target per
commit-workflow.md. Consider splitting into smaller, independently reviewable PRs.
New contributor awareness
gh pr list --author <author> --state merged --limit 5 --json number | jq 'length'If the author has fewer than 5 merged PRs to this repo, be more educational in inline comments — explain the why behind each rule, not just the what.
Extra instructions
If the user passed extra instructions after the PR number, prioritize those areas but still execute the full review pipeline.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

