Révision de Pull Request GitHub

VérifiéPrudence

Analysez une pull request GitHub en extrayant le diff, les commentaires, les issues liées et le contexte du code local. Automatise la vérification des dépendances et l'état CI.

Spar Skills Guide Bot
DeveloppementIntermédiaire
01/03/2026
Claude Code
#code-review#pull-request#github-cli#worktree#ci-checks

Recommandé pour

Synthèse automatique

Analyse une pull request GitHub (diff, commentaires, issues liées, contexte du code local) dans un worktree isolé et en produit une revue structurée.

Points forts

  • Enchaînement d'étapes explicite : worktree dédié, récupération parallèle des métadonnées/diff via gh, analyse des issues référencées, puis lecture complète des fichiers modifiés et de leurs appelants.
  • Vérification automatisée des changements de dépendances dans pyproject.toml via un script qui simule une fusion à trois voies et distingue dépendances principales, optionnelles et de dev.
  • Contrôle du statut CI lint/mypy avec récupération des logs d'échec pour identifier les erreurs précises à corriger.
  • Sépare clairement l'identifiant de PR des instructions additionnelles du relecteur grâce au séparateur `--`, ce qui rend le skill paramétrable.

Limites

  • Dépend fortement de l'environnement Claude Code : invocation du skill `/create-worktree`, usage de `$ARGUMENTS` et de l'argument-hint, donc peu portable vers d'autres agents.
  • Très orienté projet Python précis : chemin `tools/check_dependency_changes.py`, branche de référence `origin/devel` et workflow `.github/workflows/lint.yml` codés en dur.
  • Le fichier fourni s'arrête au milieu de l'étape 6, sans format de sortie ni critères de verdict explicites pour la revue finale.
Quand l'utiliser

À utiliser lorsqu'un dépôt GitHub configuré avec gh CLI et le skill create-worktree reçoit une PR Python que l'on veut faire relire de façon systématique.

Quand l'éviter

À éviter sur un projet non-Python, sans authentification gh, ou dont la CI et la branche de base ne correspondent pas aux chemins supposés par le skill.

Analyse de sécurité

Prudence
Score qualité84/100

The skill is a conventional PR-review playbook. It does not contain destructive, exfiltrating, or obfuscated behavior, but it does drive bash, git, gh network calls, and executes an in-repo Python tool, so it warrants a caution rating rather than safe. The main residual risk is that the executed dependency-check script comes from the working tree being reviewed.

Points d'attention
  • •Skill assumes access to and execution of powerful CLI tools (gh, git, python) against a real repository, though all invocations shown are read-only or standard workflow commands.
  • •Step 3 runs `python tools/check_dependency_changes.py origin/devel` — a script taken from the checked-out (potentially PR-modified) repository tree, meaning arbitrary repo code is executed during review.
  • •Step 1 instructs invoking a nested `/create-worktree` skill and mutating local git state (fetch, worktree creation), which is state-changing but not destructive.
  • •No instructions to exfiltrate data, disable safety controls, or run obfuscated/remote payloads; no prompt-injection attempts detected in the skill body.
  • •Requires broad shell and network access via `gh`, `git fetch`, and local `python` execution while declaring no allowed-tools.
  • •Delegates to a separate `/create-worktree` skill and executes repository-local `tools/check_dependency_changes.py`, creating undeclared code-execution and skill dependencies.
  • •Processes untrusted PR metadata, review comments, and linked issue text; while mostly treated as data, the workflow does not explicitly isolate embedded instructions from PR content.
Comment cette analyse est faite

Exemples

Review by PR number
review-pr 482
Review with reviewer focus
review-pr https://github.com/acme/analytics/pull/482 -- pay special attention to thread-safety in the new cache layer
Backwards-compatibility check
review-pr 1290 -- verify the public API stays backwards compatible and flag any breaking changes

name: review-pr description: Analyze a GitHub pull request including diff, comments, related issues, and local code context argument-hint: <pr-url-or-number> [-- <optional instructions>]

Review Pull Request

Parse $ARGUMENTS to extract the PR identifier and optional reviewer instructions:

  • Everything before the first -- (or all of it, if there is no --) is the PR identifier (URL or number). Referred to as PR_ID below.
  • Everything after the first -- is reviewer instructions — additional focus areas or context from the caller. If absent, there are no special instructions.

Analyze the pull request: PR_ID

Steps

Run the following steps. Gather data in parallel where possible.

1. Set up worktree

Resolve the PR number:

gh pr view PR_ID --json number

Use the number to form the worktree name review-pr-<number>.

Invoke the /create-worktree review-pr-<number> --pr <number> skill to create an isolated worktree for this PR. Note the worktree path from the skill output — referred to as WORKTREE below.

Verify that the cwd is now inside the worktree:

pwd

If pwd does not show WORKTREE, run cd WORKTREE and verify again. Stop with an error if the cwd cannot be set. Once confirmed, subsequent Bash calls will run inside the worktree automatically.

2. Fetch PR metadata and diff

Use gh to collect all PR information in parallel:

  • gh pr view PR_ID --json title,body,author,state,baseRefName,headRefName,number,url,comments,reviews,labels,milestone
  • gh pr diff PR_ID

3. Check dependency changes in pyproject.toml

If the PR diff (from step 2) touches pyproject.toml, run the automated dependency checker.

First, fetch the latest devel from origin so the comparison is against the current state:

git fetch origin devel

Then run the script — always compare against origin/devel regardless of the PR's base branch:

python tools/check_dependency_changes.py origin/devel

The script finds the merge-base, simulates a three-way merge (like GitHub), and reports:

  • Main dependencies ([project.dependencies]) — displayed as WARNING (these affect every user)
  • Optional dependencies ([project.optional-dependencies]) — displayed as WARNING (these affect users of specific extras)
  • Dev/group dependencies ([dependency-groups]) — listed for awareness (no impact on end users)
  • Merge conflicts — if pyproject.toml would conflict, the script warns and falls back to showing the PR's intended changes

Include the script output verbatim in the review. If the script exits with code 1 (changes detected), flag dependency changes in the review verdict. If it exits with code 2 (conflicts), flag that pyproject.toml needs conflict resolution.

If pyproject.toml is not in the diff, skip this step.

4. Check CI lint and mypy status

Use gh pr checks PR_ID to retrieve the CI check results. Look for checks matching lint on all python versions / lint* — these run mypy, ruff, flake8, bandit, and docstring checks across Python 3.9–3.13 (defined in .github/workflows/lint.yml).

  • Report the status of each lint check (pass/fail/pending).
  • If any lint check has failed, fetch its logs with gh run view <run-id> --log-failed to identify the specific errors (mypy type errors, ruff violations, etc.).
  • Include lint/mypy status in the final review verdict. A failing lint check should be flagged as a required fix.

5. Analyze related issues

Extract any issue references from the PR body (e.g. fixes #1234, closes #1234, #1234). For each referenced issue, fetch it with:

  • gh issue view <number> --json title,body,author,state,comments,labels

Understand the original problem being solved.

6. Analyze the code

Using absolute paths under WORKTREE:

  • Read the changed files in full to understand context beyond the diff.
  • Look at callers/callees of modified functions.
  • Check if similar patterns exist elsewhere that should also be updated.
  • Review the coding style and code patterns to conform with @CLAUDE.md
  • If reviewer instructions were provided, pay special attention to the areas or concerns they describe during this analysis.
  • Mention only crucial finding to the user in the initial overview. Avoid code snippets except if critical bugs were found

7. Review test coverage

7a. Define the testing scope

Based on the PR changes, identify what needs to be tested:

  • What are the distinct behaviors introduced or modified?
  • What are the edge cases and error paths?
  • What are the integration boundaries (e.g., does the change affect how components interact)?

Produce a checklist of required test scenarios before evaluating existing tests.

7b. Evaluate existing tests against the checklist

  • Compare the PR's tests against the required scenarios checklist. Flag any gaps.
  • Flag any tests that verify things outside the PR's scope or test obvious/trivial behavior that adds no value.

7c. Verify tests are in the right modules

  • Search the test directory for where similar functionality is already tested (grep for related function names, class names, or feature keywords).
  • New tests should live alongside related existing tests, not in new files unless the PR introduces an entirely new module.
  • Flag tests placed in the wrong location.

7d. Check for duplication and over-testing

  • Look for tests that cover nearly identical cases and could be merged or parametrized with @pytest.mark.parametrize.
  • Look for repeated setup/assertion logic across tests that should be extracted into a helper or fixture.
  • If multiple tests differ only in a single variable (e.g., True/False, different type values), they must be parametrized into one test function.
  • Flag any copy-paste test code. Minimizing test code maintenance burden is a priority.

7e. Bug Fixes Should Have Regression Tests

If the PR fixes a bug:

  • Is there a test that would have caught the bug before the fix?
  • Does the test verify the specific scenario from the bug report?

8. Check documentation coverage

If the PR modifies public API (new parameters, changed behavior, new configuration options, new functions/classes exposed to users):

  • Search WORKTREE/docs/website/docs/ for existing documentation covering the topic of the PR.
  • If the topic is already documented and the PR changes its behavior or adds new options, verify that the PR also updates the relevant doc pages.
  • If documentation updates are missing, flag this in the review as a required change.
  • If the topic is not documented at all, this is not a blocker — don't require docs for previously undocumented internals.

9. Produce the review

Write a structured analysis covering:

  • Summary: What the PR does and why, referencing the linked issue.
  • Changes: Breakdown of changes should be concise, avoid code samples
  • Dependency Changes: If pyproject.toml was modified, include the warnings and listings from step 3. Main and optional dependency changes must appear as yellow WARNING blocks. Omit this section if no dependency changes were found.
  • CI Lint & Mypy: Status of lint checks across Python versions. If any failed, list the specific errors.
  • Observations & Potential Issues: Bugs, edge cases, missing error handling, performance concerns, memory issues, security issues, backward compatibility.
  • Breaking Changes and Public API: Follow the rules on breaking changes and Public API and report issues.
  • Test Coverage: Required scenarios checklist with pass/fail status, misplaced tests, duplication issues, parametrization opportunities.
  • Documentation: Whether doc updates are needed and if they were provided.
  • Reviewer Instructions: If reviewer instructions were provided, include a dedicated section addressing each point raised. If no instructions were provided, omit this section.
  • Verdict: Overall assessment.

Du fichier au premier essai

Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.

Consulter la source et ses fichiers annexes

Ce téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.

1. Télécharger le fichier

Télécharger SKILL.md

Depuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/github-pull-request-review-mm78nmki/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.

Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.

mkdir -p '.skill-downloads/github-pull-request-review-mm78nmki' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/github-pull-request-review-mm78nmki/download' --output '.skill-downloads/github-pull-request-review-mm78nmki/SKILL.md.part' && mv '.skill-downloads/github-pull-request-review-mm78nmki/SKILL.md.part' '.skill-downloads/github-pull-request-review-mm78nmki/SKILL.md'

2. Vérifier les prérequis

Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.

Aucune section de prérequis reconnue dans ce fichier. Cela ne signifie pas qu’il est autonome : les bibliothèques, outils et accès peuvent être cités ailleurs dans le contenu ou dans le dépôt source.

Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.

3. Charger la skill

Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.

Claude Code
test -f '.skill-downloads/github-pull-request-review-mm78nmki/SKILL.md' && test -s '.skill-downloads/github-pull-request-review-mm78nmki/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/review-pr' && cp -R '.skill-downloads/github-pull-request-review-mm78nmki' '.claude/skills/review-pr'

OpenSkills

OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.

Installation officielle d’OpenSkills
openskills install './.skill-downloads/github-pull-request-review-mm78nmki'

openskills read 'github-pull-request-review-mm78nmki'

La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.

Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.

openskills sync

Mode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.

4. Faire un premier essai

Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :

Lis .skill-downloads/github-pull-request-review-mm78nmki/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.

Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.

Skills similaires