Révision de code automatisée pour pull requests

VérifiéSûr

Automatise la revue de code des pull requests avec plusieurs agents IA qui vérifient l'état de la PR, récupèrent les directives CLAUDE.md, analysent les différences pour trouver des bugs et des violations de règles, et valident chaque problème pour garantir une haute pertinence. Conçu pour réduire les faux positifs tout en détectant des problèmes significatifs dans les modifications de code.

Spar Skills Guide Bot
DeveloppementIntermédiaire
02/03/2026
Claude Code
#code-review#pull-request#multi-agent#github-cli#quality-assurance

Recommandé pour

Synthèse automatique

Ce skill réalise une revue de code automatisée d'une pull request GitHub en orchestrant plusieurs sous-agents spécialisés (conformité CLAUDE.md, détection de bugs, validation des signalements).

Points forts

  • Sépare les responsabilités entre plusieurs agents (conformité CLAUDE.md, bugs, validation) lancés en parallèle, ce qui croise les regards sur un même diff
  • Filtre volontairement pour ne garder que les problèmes à fort signal (erreurs de compilation, logique fausse, violations CLAUDE.md citables) afin de limiter les faux positifs
  • Vérifie en amont que la PR est ouverte, non-draft et pas déjà commentée par Claude avant de lancer la revue
  • Étape de validation dédiée où chaque problème signalé est reconfirmé par un sous-agent avant d'être publié

Limites

  • Dépend entièrement du CLI GitHub (gh) authentifié et des droits de lecture/commentaire sur le dépôt
  • Ne couvre que les pull requests GitHub, pas les autres forge (GitLab, Bitbucket) ni les diffs locaux
  • Ignore délibérément le style, les suggestions subjectives et les problèmes dépendant d'entrées spécifiques, donc peu utile pour une revue de qualité globale
Quand l'utiliser

Pour obtenir rapidement une revue ciblée sur les bugs réels et la conformité aux fichiers CLAUDE.md d'une pull request GitHub.

Quand l'éviter

Si vous cherchez des retours sur le style, l'architecture ou des suggestions d'amélioration, ou si votre dépôt n'est pas hébergé sur GitHub.

Analyse de sécurité

Sûr
Score qualité78/100

All executed commands are read-oriented GitHub CLI operations plus PR commenting; there is no network exfiltration, no shell download-and-execute, no destructive filesystem action, and no attempt to disable safety controls. The only write action is posting review comments to the PR under review, which is the skill's explicit purpose and is scoped by the allowlist. Minor inconsistency between the allowlist and the `gh pr review` instruction is a permissions/UX issue rather than a security risk.

Points d'attention
  • •Declared allowed-tools omit `gh pr review`, yet step 9 instructs posting inline comments via `gh pr review`; this mismatch may cause repeated permission prompts or an agent attempting commands outside its allowlist (availability concern, not exfiltration).
  • •The skill spawns multiple subagents and instructs them to assume 'all tools are functional and will work without error' and not to test tools — harmless, but reduces the agents' ability to verify state before acting.
Comment cette analyse est faite

Exemples

Review a specific PR
Review pull request #248 in this repository and post your findings as a PR comment.
Review the current branch's PR
Find the open pull request for my current branch and give it a code review, flagging only high-confidence bugs and CLAUDE.md violations.
Review a PR by URL
Run a code review on https://github.com/acme/api/pull/512, skipping it if it's a draft or already reviewed.

name: code-review description: Automated code review for pull requests using multiple specialized agents disable-model-invocation: true allowed-tools: Bash(gh issue view:), Bash(gh search:), Bash(gh issue list:), Bash(gh pr comment:), Bash(gh pr diff:), Bash(gh pr view:), Bash(gh pr list:*)

Provide a code review for the given pull request.

Agent assumptions (applies to all agents and subagents):

  • All tools are functional and will work without error. Do not test tools or make exploratory calls. Make sure this is clear to every subagent that is launched.
  • Only call a tool if it is required to complete the task. Every tool call should have a clear purpose.

To do this, follow these steps precisely:

  1. Launch a haiku agent to check if any of the following are true:

    • The pull request is closed
    • The pull request is a draft
    • The pull request does not need code review (e.g. automated PR, trivial change that is obviously correct)
    • Claude has already commented on this PR (check gh pr view <PR> --comments for comments left by claude)

    If any condition is true, stop and do not proceed.

Note: Still review Claude generated PR's.

  1. Launch a haiku agent to return a list of file paths (not their contents) for all relevant CLAUDE.md files including:

    • The root CLAUDE.md file, if it exists
    • Any CLAUDE.md files in directories containing files modified by the pull request
  2. Launch a sonnet agent to view the pull request and return a summary of the changes

  3. Launch 4 agents in parallel to independently review the changes. Each agent should return the list of issues, where each issue includes a description and the reason it was flagged (e.g. "CLAUDE.md adherence", "bug"). The agents should do the following:

    Agents 1 + 2: CLAUDE.md compliance sonnet agents Audit changes for CLAUDE.md compliance in parallel. Note: When evaluating CLAUDE.md compliance for a file, you should only consider CLAUDE.md files that share a file path with the file or parents.

    Agent 3: Opus bug agent (parallel subagent with agent 4) Scan for obvious bugs. Focus only on the diff itself without reading extra context. Flag only significant bugs; ignore nitpicks and likely false positives. Do not flag issues that you cannot validate without looking at context outside of the git diff.

    Agent 4: Opus bug agent (parallel subagent with agent 3) Look for problems that exist in the introduced code. This could be security issues, incorrect logic, etc. Only look for issues that fall within the changed code.

    CRITICAL: We only want HIGH SIGNAL issues. Flag issues where:

    • The code will fail to compile or parse (syntax errors, type errors, missing imports, unresolved references)
    • The code will definitely produce wrong results regardless of inputs (clear logic errors)
    • Clear, unambiguous CLAUDE.md violations where you can quote the exact rule being broken

    Do NOT flag:

    • Code style or quality concerns
    • Potential issues that depend on specific inputs or state
    • Subjective suggestions or improvements

    If you are not certain an issue is real, do not flag it. False positives erode trust and waste reviewer time.

    In addition to the above, each subagent should be told the PR title and description. This will help provide context regarding the author's intent.

  4. For each issue found in the previous step by agents 3 and 4, launch parallel subagents to validate the issue. These subagents should get the PR title and description along with a description of the issue. The agent's job is to review the issue to validate that the stated issue is truly an issue with high confidence. For example, if an issue such as "variable is not defined" was flagged, the subagent's job would be to validate that is actually true in the code. Another example would be CLAUDE.md issues. The agent should validate that the CLAUDE.md rule that was violated is scoped for this file and is actually violated. Use Opus subagents for bugs and logic issues, and sonnet agents for CLAUDE.md violations.

  5. Filter out any issues that were not validated in step 5. This step will give us our list of high signal issues for our review.

  6. If issues were found, skip to step 8 to post comments.

    If NO issues were found, post a summary comment using gh pr comment (if --comment argument is provided): "No issues found. Checked for bugs and CLAUDE.md compliance."

  7. Create a list of all comments that you plan on leaving. This is only for you to make sure you are comfortable with the comments. Do not post this list anywhere.

  8. Post inline comments for each issue using gh pr review with inline comments. For each comment:

    • Provide a brief description of the issue
    • For small, self-contained fixes, include a committable suggestion block
    • For larger fixes (6+ lines, structural changes, or changes spanning multiple locations), describe the issue and suggested fix without a suggestion block
    • Never post a committable suggestion UNLESS committing the suggestion fixes the issue entirely. If follow up steps are required, do not leave a committable suggestion.

    IMPORTANT: Only post ONE comment per unique issue. Do not post duplicate comments.

Use this list when evaluating issues in Steps 4 and 5 (these are false positives, do NOT flag):

  • Pre-existing issues
  • Something that appears to be a bug but is actually correct
  • Pedantic nitpicks that a senior engineer would not flag
  • Issues that a linter will catch (do not run the linter to verify)
  • General code quality concerns (e.g., lack of test coverage, general security issues) unless explicitly required in CLAUDE.md
  • Issues mentioned in CLAUDE.md but explicitly silenced in the code (e.g., via a lint ignore comment)

Notes:

  • Use gh CLI to interact with GitHub (e.g., fetch pull requests, create comments). Do not use web fetch.
  • Create a todo list before starting.
  • You must cite and link each issue in inline comments (e.g., if referring to a CLAUDE.md, include a link to it).
  • If no issues are found, post a comment with the following format:

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.


  • When linking to code in inline comments, follow the following format precisely, otherwise the Markdown preview won't render correctly: https://github.com/OWNER/REPO/blob/FULL_SHA/path/to/file.py#L10-L15
    • Requires full git sha
    • You must provide the full sha. Commands like https://github.com/owner/repo/blob/$(git rev-parse HEAD)/foo/bar will not work, since your comment will be directly rendered in Markdown.
    • Repo name must match the repo you're code reviewing
    • sign after the file name

    • Line range format is L[start]-L[end]
    • Provide at least 1 line of context before and after, centered on the line you are commenting about (eg. if you are commenting about lines 5-6, you should link to L4-7)

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/automated-code-review-for-pull-requests-mm8o520s/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/automated-code-review-for-pull-requests-mm8o520s' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/automated-code-review-for-pull-requests-mm8o520s/download' --output '.skill-downloads/automated-code-review-for-pull-requests-mm8o520s/SKILL.md.part' && mv '.skill-downloads/automated-code-review-for-pull-requests-mm8o520s/SKILL.md.part' '.skill-downloads/automated-code-review-for-pull-requests-mm8o520s/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.

Outils déclarés par l’auteur (à vérifier dans votre agent) : Bash(gh issue view:*), Bash(gh search:*), Bash(gh issue list:*), Bash(gh pr comment:*), Bash(gh pr diff:*), Bash(gh pr view:*), Bash(gh pr list:*)

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/automated-code-review-for-pull-requests-mm8o520s/SKILL.md' && test -s '.skill-downloads/automated-code-review-for-pull-requests-mm8o520s/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/code-review' && cp -R '.skill-downloads/automated-code-review-for-pull-requests-mm8o520s' '.claude/skills/code-review'

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/automated-code-review-for-pull-requests-mm8o520s'

openskills read 'automated-code-review-for-pull-requests-mm8o520s'

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/automated-code-review-for-pull-requests-mm8o520s/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