Logo di Gh Pr Code Review

Gh Pr Code Review

Community
ericmjl
gh-pr-code-review

PR code review workflow: pull diff, two-pass findings, draft and prioritize comments, then optionally post via gh api.

Panoramica

Autoreericmjl
Repositoryskills
Nome della skillgh-pr-code-review
Stelle
41
Fork
5
File inclusi
Solo istruzioni
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

    Pubblicata da ericmjl su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Gh Pr Code Review in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/ericmjl/skills/tree/main/skills/gh-pr-code-review
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Nuova skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella nella cartella delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ericmjl/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/gh-pr-code-review .claude/skills/gh-pr-code-review
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Gh Pr Code Review in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Gh Pr Code Review non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Gh Pr Code Review non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

PR code review (gh)

This skill guides a repeatable pull request review workflow using the GitHub CLI.

It emphasizes two-pass review (to find more issues), drafting comments before posting, and posting only after explicit user confirmation.

Usage

Use this skill when the user asks you to review a pull request and leave actionable feedback.

Inputs you should accept:

  • PR number, PR URL, or branch name accepted by gh pr view / gh pr diff
  • Optional repo override via -R owner/repo if not in a git checkout

Requirements

  • gh authenticated (gh auth status)
  • Permission to comment on the PR
  • Optional but useful: jq

What it does

A code review in two passes, then a drafting and posting phase:

A) Pull down the PR diff and identify issues

B) Repeat the review, finding only new issues

C) Draft review comments but do not post yet

D) Prioritize comments by criticality:

  • critical: correctness/security/data loss/broken API/test failures
  • optional: maintainability/performance/edge cases/docs/test gaps
  • trivial: nits/style/micro-optimizations (do not show by default)

E) Show only critical and optional items to the user. Then, if (and only if) the user explicitly confirms, post:

  • inline (line-level) review comments where anchoring is unambiguous
  • a single summary timeline comment containing only critical + optional items

How it works

0) Gather PR context

  1. Identify the PR. Prefer a PR number or URL.
  2. Fetch PR metadata (including the head commit SHA):
bash
gh pr view <PR> --json number,title,url,baseRefName,headRefName,headRefOid,files,additions,deletions
  1. Fetch the diff (the primary review artifact):
bash
gh pr diff <PR> --color=never

Optional: check CI signal while reviewing:

bash
gh pr checks <PR>

1) Stage A: first-pass review

Review the diff and record issues as structured items. For each issue capture:

  • severity: critical | optional | trivial
  • path: file path when applicable
  • side: RIGHT (new code / additions / context) or LEFT (deletions)
  • line: line number in the diff blob when you can anchor reliably
  • body: the draft comment text (short, actionable)

Focus this pass primarily on:

  • correctness and logic errors
  • security risks
  • API breaks
  • data loss / irreversible behavior
  • missing or failing tests

2) Stage B: second-pass review (new issues only)

Re-review the same diff from scratch with a different lens:

  • edge cases
  • performance and algorithmic complexity
  • naming, clarity, ergonomics
  • documentation and user-facing behavior
  • consistency with project conventions

Critical rule: do not repeat issues from stage A. Only append genuinely new issues.

3) Stage C: draft comments (do not post)

Convert each issue into a comment draft that is ready to paste/post:

  • one idea per comment
  • include why it matters and a concrete suggestion
  • avoid bikeshedding; keep tone constructive

4) Stage D: prioritize

Assign each comment a criticality:

  • critical: must-fix
  • optional: should-fix
  • trivial: nice-to-fix

5) Stage E: show only critical + optional, then optionally post

  1. Show the user only critical + optional comments.
  2. Ask for explicit confirmation before posting:

"Post these to the PR now? (yes/no)"

  1. If user says yes:
  • Post inline comments for items with reliable path + line + side.
  • Post one summary timeline comment that includes all critical + optional items.
  • Do not post trivial items.

Posting comments with gh

Summary timeline comment (PR is an issue)

Use the Issues API to post one summary comment:

bash
gh api -X POST "repos/{owner}/{repo}/issues/<PR_NUMBER>/comments" \
  -f body="<summary markdown>"

Endpoint reference: POST /repos/{owner}/{repo}/issues/{issue_number}/comments.

Inline (line-level) review comments

Use the Pull Request Review Comments API:

bash
SHA="$(gh pr view <PR> --json headRefOid -q .headRefOid)"

gh api -X POST "repos/{owner}/{repo}/pulls/<PR_NUMBER>/comments" \
  -f body="<comment markdown>" \
  -f commit_id="$SHA" \
  -f path="path/to/file.py" \
  -F line=42 \
  -f side=RIGHT

Endpoint reference: POST /repos/{owner}/{repo}/pulls/{pull_number}/comments.

Mapping a unified diff to (path, line, side)

Inline comments require an exact file path, a line number, and a side.

Use this deterministic approach for unified diffs:

  • Each hunk header looks like @@ -old_start,old_count +new_start,new_count @@.

  • Initialize counters: old_line = old_start, new_line = new_start.

  • Walk each subsequent hunk line:

    • If the line starts with ' ' (context): increment both old_line and new_line.
    • If the line starts with '+' (addition): increment new_line only.
    • If the line starts with '-' (deletion): increment old_line only.
  • To comment on the new code, use side=RIGHT and set line=new_line.

  • To comment on a deletion, use side=LEFT and set line=old_line.

If you cannot reliably determine line/side (for example, complex hunks or uncertainty), do not post an inline comment. Include the item only in the summary timeline comment.

Domande frequenti

Cosa fa la skill IA Gh Pr Code Review?

PR code review workflow: pull diff, two-pass findings, draft and prioritize comments, then optionally post via gh api.

Perché usare Gh Pr Code Review su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Gh Pr Code Review è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Gh Pr Code Review in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/ericmjl/skills/tree/main/skills/gh-pr-code-review. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Gh Pr Code Review?

Qualsiasi modello che colleghi in TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Gh Pr Code Review?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Gh Pr Code Review: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Gh Pr Code Review è gratuita?

Sì. È pubblicata su GitHub da ericmjl con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, modelli o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇