agentleFS
crux-clicrux-cli/crux/.claude/skills/review-pr/SKILL.md

review-pr

Skill0 starsChanged 8 months agoMITView on GitHub

Review open PRs: CI gate, code review, security review, docs review. Approve or request changes.

  • Reads credentials

185 other projects use a version of this.

Adopted by

Most recently taken up by

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-labSkill

    diagnose-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

  • GeiserXSkill

    docs-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

  • GeiserXSkill

    full-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

  • n24q02mSkill

    review-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

  • n24q02mSkill

    build-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

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. 0 are common, 13 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 178 edited versions we read keep these.

  • 13

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If a PR number is provided, use it.

    line 20
  2. Distinctive:

    Run the full review process (Steps 1–5) for each PR sequentially.

    line 26
  3. Distinctive:

    Check whether all CI checks have passed:

    line 30
  4. Distinctive:

    Read the full PR diff:

    line 55
  5. Very specific:

    If the PR body contains Closes #<number> or Fixes #<number>, fetch the linked issue:

    line 69
  6. Distinctive:

    Use the issue description to:

    line 75
  7. Distinctive:

    If the PR claims to close an issue but the changes don't address it, flag this as a WARNING finding.

    line 81
  8. Distinctive:

    Use of eval/exec with untrusted data

    line 139
  9. Distinctive:

    Check that all documentation is consistent with the PR changes.

    line 152
  10. Distinctive:

    If new features or commands were added, is README updated?

    line 156
  11. Distinctive:

    If existing features changed, does README reflect the change?

    line 157
  12. Very specific:

    Do navigation references (mkdocs.yml or index pages) include new pages?

    line 165
  13. Distinctive:

    If commands were added or modified, does the command's help text match the docs?

    line 174
  14. Distinctive:

    When reviewing multiple PRs, post results for each before moving to the next

    line 223
  15. Distinctive:

    If a PR has already been reviewed and no new commits were pushed, skip it

    line 224

“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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

PR Review

Review pull requests with a rigorous multi-phase process: CI gate, code review, security audit, and documentation check. Post findings as PR comments, then approve or request changes.

Invocation

/review-pr          # Review all open PRs
/review-pr 42       # Review PR #42 only

Step 0: Resolve Target PRs

If a PR number is provided, use it. Otherwise, list all open PRs:

gh pr list --state open --json number,title,headRefName --limit 50

Run the full review process (Steps 1–5) for each PR sequentially.

Step 1: CI Gate (Hard Gate)

Check whether all CI checks have passed:

gh pr checks <PR#>
  • All checks pass: proceed to Step 2.
  • Any check failing: post a comment and request changes immediately. Do NOT proceed with code review.

Comment on failure:

**[CRITICAL]** CI Pipeline

CI checks are failing. Skipping code review until all checks pass.

Failing checks:
- <list each failing check and its status>

Please fix CI failures and push again.

Skip to the next PR (if reviewing multiple).

Step 2: Code Review

Read the full PR diff:

gh pr diff <PR#>

Also read the PR description and any linked issues for context:

gh pr view <PR#> --json title,body,labels,files

2.0: Check Linked Issue

If the PR body contains Closes #<number> or Fixes #<number>, fetch the linked issue:

gh issue view <ISSUE#> --json number,title,body,labels

Use the issue description to:

  • Verify the fix matches the reported problem — does the PR actually address what the issue describes?
  • Check repro steps are covered — if the issue includes repro steps, are they addressed by the changes or covered by tests?
  • Validate scope — does the PR stay within the scope of what the issue requested, or does it include unrelated changes?

If the PR claims to close an issue but the changes don't address it, flag this as a WARNING finding.

2a. Logic & Correctness

Review every changed file for:

  • Logical errors: off-by-one, wrong conditionals, missing edge cases, race conditions
  • Error handling: uncaught exceptions, swallowed errors, missing validation at system boundaries
  • State management: uninitialized variables, stale state, mutation side effects
  • API contracts: breaking changes to public interfaces, missing backwards compatibility where needed
  • Resource management: unclosed files/connections, missing cleanup

2b. Test Quality

Review all test changes for:

  • Shortcut detection: tests that are written to pass rather than to verify behavior — e.g., testing implementation details, asserting on mocks instead of outcomes, trivially true assertions
  • Coverage gaps: new code paths without corresponding tests, missing edge case tests
  • Test isolation: tests depending on execution order, shared mutable state, flaky patterns
  • Assertion quality: meaningful assertions vs. trivially true checks, proper error message checks, boundary value testing

2c. Code Style (per CONTRIBUTING.md)

  • Python 3.11+ modern syntax (list[str], str | None)
  • Type annotations on public functions
  • Line length: 120 characters
  • Atomic file writes (temp file + rename) for JSON/TOML saves
  • Ruff rules compliance: E/F/W, I, UP, B, SIM, S

Step 3: Security Review

Examine the diff for security issues. This is a thorough review — check every changed line.

3a. Secrets & Credentials

  • API keys, tokens, passwords, private keys in code or config
  • Hardcoded connection strings with credentials
  • .env files or secrets committed to the repo
  • Hardcoded URLs with embedded auth tokens

3b. Injection Vulnerabilities

  • Command injection: unsanitized input passed to subprocess calls or shell execution
  • SQL injection: string concatenation in queries instead of parameterized queries
  • Path traversal: user input used in file paths without sanitization
  • XSS: unescaped user input rendered in HTML/templates
  • Template injection: user input in format strings or template engines

3c. Dependency Security

  • New dependencies added — check if they are well-maintained and trustworthy
  • Pinned versions vs. unpinned (prefer pinned)
  • Known vulnerabilities in added packages

3d. Unsafe Operations

  • File operations without proper error handling or atomic writes
  • Unsafe deserialization (e.g., loading untrusted serialized objects)
  • Use of eval/exec with untrusted data
  • Weak cryptographic algorithms (MD5, SHA1 for security purposes)
  • Hardcoded salts, IVs, or crypto keys

3e. Auth & Permissions

  • Missing authentication checks on new endpoints/commands
  • Privilege escalation paths
  • Overly permissive file permissions
  • CORS misconfigurations

Step 4: Documentation Review

Check that all documentation is consistent with the PR changes.

4a. README.md

  • If new features or commands were added, is README updated?
  • If existing features changed, does README reflect the change?
  • Are usage examples accurate?

4b. docs/ Pages

  • For new CLI commands: is there a corresponding docs/cli/<command>.md?
  • For API changes: is the relevant docs/api/*.md page updated?
  • For new guides or concepts: are they added to docs/guides/ or docs/getting-started/?
  • Do navigation references (mkdocs.yml or index pages) include new pages?

4c. CHANGELOG.md

  • Is there a changelog entry for user-facing changes?
  • Does the entry accurately describe what changed?

4d. CLI Help Text

  • If commands were added or modified, does the command's help text match the docs?
  • Is the skill file (src/crux_cli/data/skills/crux/SKILL.md) updated if commands changed?

Step 5: Verdict

Collect all findings from Steps 2–4. Classify each finding by severity:

SeverityMeaningBlocks merge?
CRITICALSecurity vulnerability, data loss risk, broken logicYes
WARNINGCode smell, missing tests, incomplete docsNo
NITStyle, naming, minor suggestionNo

5a. Post Review

Submit a single PR review via gh pr review that includes:

  1. Inline comments on specific lines for each finding (use gh api to post review comments on specific files/lines)
  2. Summary comment with a findings table:
## PR Review Summary

| # | Severity | Category | Finding |
|---|----------|----------|---------|
| 1 | CRITICAL | Security | API key hardcoded in config.py:42 |
| 2 | WARNING  | Tests    | No test for error path in sync.py:89 |
| 3 | NIT      | Style    | Unused import in utils.py:3 |

**Verdict**: <APPROVE / REQUEST CHANGES>

5b. Decision

# If ANY critical finding exists:
gh pr review <PR#> --request-changes --body "<summary>"

# If only warnings/nits (no criticals):
gh pr review <PR#> --comment --body "<summary>"

# If clean (no findings at all):
gh pr review <PR#> --approve --body "All checks pass. Code, security, and docs look good."

Notes

  • This skill requires gh CLI authenticated with repo access
  • For large PRs (>1000 lines), focus on the most critical files first
  • When reviewing multiple PRs, post results for each before moving to the next
  • If a PR has already been reviewed and no new commits were pushed, skip it

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.