agentleFS
ceccopierangiolieugenioceccopierangiolieugenio/pyTermTk/.github/skills/review-branch-or-pr/SKILL.md

review-branch-or-pr

Skill925 starsChanged 4 months agoMITView on GitHub

Use when: reviewing a pull request, PR, branch, diff, or code changes for bugs, regressions, risky behavior, missing tests, or merge issues. Review the changes in a specific branch or PR against its base branch and report findings first with severity and file references.

The file

Show its rules and text

We split this skill into the rules it gives an agent

17 rules. About 0 are common, 17 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈17

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Default to a code review mindset:

    line 20
  2. Distinctive:

    Look for missing validation, broken assumptions, unsafe refactors, and compatibility risks

    line 22
  3. Distinctive:

    Check whether tests cover the changed behavior when that is reasonably expected

    line 23
  4. Distinctive:

    Keep summaries brief and place findings first

    line 24
  5. Distinctive:

    Do not default to style-only comments unless they hide a functional or maintainability risk.

    line 26
  6. Distinctive:

    If the user does not specify a target and a current branch can be determined from git context, use that.

    line 37
  7. Distinctive:

    If the base branch is not specified, infer it from repository context when possible.

    line 39
  8. Distinctive:

    If neither the base branch nor the repository default branch can be determined, stop and ask the user: "What is the base branch to compare …

    line 41
  9. Distinctive:

    If the changed file count exceeds ~50 files or the diff exceeds ~2000 lines, explicitly state the scope limitation, focus review on the …

    line 50
  10. Distinctive:

    Prefer repository-aware tools when available.

    line 52
  11. Distinctive:

    If a changed file is mostly wiring, step once to the code that directly decides behavior.

    line 79
  12. Distinctive:

    When a likely defect depends on behavior that can be checked cheaply, run a narrow validation:

    line 100
  13. Distinctive:

    Do not broaden into full-suite validation unless the review risk justifies it.

    line 105
  14. Distinctive:

    If there are no findings, say so explicitly and mention residual risks or testing gaps.

    line 124
  15. Distinctive:

    Start from the diff, not from broad repository exploration

    line 138
  16. Distinctive:

    Prefer concrete bugs and regressions over style suggestions

    line 141
  17. Distinctive:

    Run focused validation when it can confirm or disconfirm a concern cheaply

    line 142

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “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

Branch Or PR Review

Overview

This skill performs a code review of the changes introduced by a specific branch or pull request.

The review should compare the target branch or PR against its base, inspect the changed files and diff, and then report concrete findings in code-review format.

When to Use

  • The user asks for a PR review
  • The user asks for a branch review
  • The user asks to review code changes before merge
  • The user asks for bugs, regressions, or missing tests in a diff

Review Standard

Default to a code review mindset:

  • Prioritize correctness, regressions, and behavior changes
  • Look for missing validation, broken assumptions, unsafe refactors, and compatibility risks
  • Check whether tests cover the changed behavior when that is reasonably expected
  • Keep summaries brief and place findings first

Do not default to style-only comments unless they hide a functional or maintainability risk.

Workflow

Step 1: Identify the Review Target

Determine whether the user wants to review:

  • the current branch
  • a named branch
  • a specific PR number
  • a PR URL

If the user does not specify a target and a current branch can be determined from git context, use that. Otherwise, ask the user to specify the branch or PR to review.

If the base branch is not specified, infer it from repository context when possible. Otherwise use the repository default branch.

If neither the base branch nor the repository default branch can be determined, stop and ask the user: "What is the base branch to compare against?" Do not proceed with a review against an assumed base.

Step 2: Collect the Comparison Surface

Gather the smallest useful comparison surface first:

  1. Identify the base branch and review target
  2. Compute the merge base when reviewing a branch
  3. List changed files before reading large diffs
  4. Inspect the patch for the most relevant files

If the changed file count exceeds ~50 files or the diff exceeds ~2000 lines, explicitly state the scope limitation, focus review on the highest-risk files identified in Step 3, and note in Open Questions that a full review was not performed.

Prefer repository-aware tools when available. Otherwise use git locally.

Useful commands:

git status --short
git branch --show-current
git diff --name-only <base>...<target>
git diff --stat <base>...<target>
git diff <base>...<target> -- <path>

For PR review, prefer metadata that reveals:

  • the PR base branch
  • the PR head branch
  • the changed files
  • the patch or combined diff

Step 3: Review the Deciding Code Paths

Review the files that actually control behavior, not just call sites or registrations.

Prioritize:

  1. Logic that computes or mutates state
  2. Validation and boundary handling
  3. Error handling and fallback behavior
  4. Tests added or omitted for behavior changes
  5. Public API or data model changes

If a changed file is mostly wiring, step once to the code that directly decides behavior.

Step 4: Form Findings

A valid finding should include:

  1. The concrete risk or bug
  2. Why it happens from the diff
  3. The user-visible or maintenance impact
  4. A precise file reference

Good findings are specific and falsifiable. Avoid vague comments like "this might be cleaner".

Focus on issues such as:

  • broken control flow
  • incorrect assumptions after refactors
  • missing guard clauses
  • inconsistent state updates
  • incomplete rename or migration work
  • missing or weak tests for the changed behavior
  • branch-specific merge hazards

Step 5: Validate When Needed

When a likely defect depends on behavior that can be checked cheaply, run a narrow validation:

  • the most relevant unit test
  • a targeted lint or typecheck
  • a focused command that falsifies the concern

Do not broaden into full-suite validation unless the review risk justifies it.

Response Format

Present findings first, ordered by severity.

Use this structure:

Findings
1. [severity] Short title
   Why it is a problem, impact, and file reference.

Open Questions
- Any assumptions that could not be verified.

Change Summary
- Very brief overview of what changed.

If there are no findings, say so explicitly and mention residual risks or testing gaps.

Severity Guide

  • high: likely bug, regression, data loss, crash, or broken workflow
  • medium: correctness risk, edge-case breakage, incomplete handling, or test gap around important behavior
  • low: minor maintainability concern with plausible future risk

Example Prompts

  • "Review this PR for regressions."
  • "Do a code review of branch feature/search-refactor."
  • "Review the changes in PR #42 against main."
  • "Check whether this branch is safe to merge."

Important Rules

  • Start from the diff, not from broad repository exploration
  • Review the target against its actual base branch
  • Findings must come before summary
  • Prefer concrete bugs and regressions over style suggestions
  • Run focused validation when it can confirm or disconfirm a concern cheaply

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.