Ревью GitHub pull request с многоракурсным анализом кода через параллельных субагентов.

Звёзды1 682
Авторfeiskyer

Установка

SKILL.md

Review GitHub Pull Request

A structured, multi-agent workflow for thorough code reviews on GitHub PRs. The approach uses parallel specialized reviewers, adversarial verification with confidence scoring, and false positive filtering to produce high-signal, actionable feedback.

Use gh for all GitHub interactions. Do not use web fetch or attempt to build/typecheck the app — CI handles that separately.

Workflow

Before starting, create a todo list with one item per step below (1. Eligibility check, 2. Gather context, 3. Parallel code review, 3.5 Deduplicate, 4. Adversarial verification & scoring, 5. Filter, 6. Re-check eligibility, 7. Post review or approve) and mark each item complete as it finishes. Never post the review or approval (step 7) unless the eligibility re-check (step 6) passed during this same run.

1. Eligibility Check

Use a subagent to verify the PR is eligible for review. Skip the review if any of these are true:

  • The PR is closed or merged
  • The PR is a draft
  • The PR doesn't need review (e.g., automated/bot PR, or trivially simple)
  • You've already reviewed it (posted a review, an approval, or a "### Code review" comment) AND there are no new commits since then. To check: get your login (gh api user --jq '.login'), find the timestamp of your most recent review — submittedAt under reviews (including a bare LGTM approval), or createdAt of a "### Code review" comment from older runs (gh pr view 78 --json comments,reviews) — and get the latest commit time (gh pr view 78 --json commits --jq '.commits[-1].committedDate'). If commits landed after your last review, proceed as a follow-up review: review the full current diff as usual (do not attempt to diff only "new" commits — the last-reviewed SHA may be unknown or force-pushed away), pass your previous review to the review and scoring agents so they do not re-raise previously reported issues unless still unfixed, and use the heading ### Code review (follow-up) in the review body.

Exception: if the user explicitly pointed at this PR (gave its number or URL), only closed/merged remains a hard stop. For draft, bot, or trivially-simple PRs, tell the user the status and proceed with the review (for drafts, note in the posted review that the PR was a draft at review time). If you already reviewed it, say so and proceed only if the PR has new commits since that review or the user confirms they want a re-review.

If no PR number is provided, run gh pr list to show open PRs and ask which one to review.

2. Gather Context (parallel)

Size check. Probe the PR before launching subagents: gh pr view 78 --json changedFiles,additions,deletions.

  • Fewer than 20 changed files: proceed normally; reviewers may read changed files in full.
  • 20-100 files: exclude generated/vendored files (lockfiles, *.min.js, snapshots, dist/, codegen output) from review and note them as "not reviewed" in the summary; reviewers work from the diff, deep-reading only high-risk files (auth, payments, config, migrations, shared utilities).
  • More than 100 files or ~10,000 changed lines: gh pr diff may fail or truncate. Instead, build a file manifest with gh api repos/OWNER/REPO/pulls/78/files --paginate --jq '.[] | {filename, additions, deletions}' and give each of the 6 reviewers the manifest — keeping all 6 angles over the whole PR, NOT partitioning files across angles — instructing each to fetch individual patches on demand for the files relevant to its angle (gh api repos/OWNER/REPO/pulls/78/files --paginate --jq '.[] | select(.filename == "PATH") | .patch'; note GitHub omits patch for very large files and lists at most 3000 files). If one angle's relevant file set is still too large for a single agent, split that angle across multiple instances of the same agent, each taking a slice of the manifest. If the PR remains unmanageable, tell the user it is too large for a high-signal review and ask them to scope it (e.g., to a monorepo path via --jq '.[] | select(.filename | startswith("packages/api/"))').

Launch two subagents in parallel:

Subagent A — Project guidance discovery: Find all relevant CLAUDE.md and AGENTS.md files — check the repo root and any directories whose files the PR modified. Return a list of file paths (not contents).

Subagent B — PR summary: View the PR with gh pr view and gh pr diff, then return a concise summary of what changed.

3. Parallel Code Review (6 specialized agents)

Read references/subagent-prompts.md and launch 6 parallel subagents using those templates, substituting the placeholders and keeping the embedded shared blocks intact. Subagents cannot see this skill file — everything they need must be in their prompt. Each agent returns a list of issues found, with a reason tag for why it was flagged (e.g., "CLAUDE.md adherence", "bug", "historical git context", "past PR feedback", "code comment violation", "security").

Every issue returned by a review agent MUST include all of: (a) file path and line numbers (e.g., src/auth.ts:42-45) pointing at lines this PR modified; (b) a verbatim quote of the offending line(s), copied from the diff, never paraphrased from memory; (c) evidence for why it is wrong — for bug findings, a concrete failure trace in the form "when X, Y happens because Z"; for guidance findings (CLAUDE.md/AGENTS.md, code comments, past PR feedback), a verbatim quote of the specific guidance violated and where it lives; (d) the reason tag. Findings missing any of these are dropped before step 4 — do not score them. Never assert "this project's convention is X" without checking mechanically: grep for the pattern and cite the occurrence count in the finding.

Summary of the six angles for the orchestrator (if this table and the templates ever diverge, the templates are canonical):

AgentFocusApproach
#1 CLAUDE.md / AGENTS.md complianceCheck changes against project guidanceRead the CLAUDE.md and AGENTS.md files from step 2. Note that these files are guidance for AI agents as they write code, so not all instructions apply during code review.
#2 Shallow bug scanObvious bugs in the diffRead only the changed lines (avoid extra context beyond the diff). Focus on significant bugs, not nitpicks. Ignore likely false positives.
#3 Git history contextBugs visible through historical contextRead git blame and history of modified code. Identify issues that become apparent in light of how the code evolved.
#4 Past PR feedbackRecurring issuesFind previous PRs that touched these files. Check their comments for feedback that may also apply here. Use the "PRs that previously touched a file" recipe in the command reference; limit to the 3-5 most recently merged PRs.
#5 Code comment complianceRespect inline guidanceRead code comments in modified files. Verify the PR changes comply with any guidance expressed in those comments.
#6 Security scan of the diffConcrete, exploitable vulnerabilities introduced by this PRLook only at changed lines for: hardcoded secrets/credentials, injection (SQL/command/path), missing authn/authz on new endpoints, unsafe deserialization, SSRF. Report only issues where you can state the concrete exploit path; general security hygiene suggestions ("should add rate limiting", "consider CSP") are false positives.

3.5 Deduplicate (merge only — no judging)

Before scoring, merge findings from the 6 agents that describe the same defect — same file, overlapping lines, same described problem. Record which agents flagged each merged issue (e.g., "flagged by #2 and #3") and preserve each agent's reason tag. Do NOT read the code, evaluate validity, or drop any finding at this stage: verification belongs to step 4, and pre-judging here turns the orchestrator into a seventh reviewer with a veto. Merge only on what the findings themselves say, not on your own opinion of the code.

4. Adversarial Verification & Confidence Scoring

For each issue from step 3.5, launch a parallel subagent acting as a skeptic whose job is to disprove the finding, not confirm it. Give it the issue as reported (including its quoted code and evidence), the PR number, and the CLAUDE.md/AGENTS.md file list. Include the agreement count from step 3.5 in the skeptic's context, with this framing: convergence by multiple agents is supporting context, but it never substitutes for the skeptic's own verification — the score must still be justified by the rubric below. A finding flagged by only one agent is the normal case (the six angles are intentionally disjoint — e.g., only agent #4 sees past PR feedback) and must not be penalized for that alone.

Before assigning any score the skeptic MUST:

  1. Independently re-read the relevant code via gh pr diff and, where file context beyond the diff is needed, gh api repos/OWNER/REPO/contents/PATH?ref=HEAD_SHA — never score from the issue description alone.
  2. Confirm the cited file and lines actually exist at the PR head SHA — if they do not, or if the issue quotes a code snippet that does not match the actual code, score 0: the finding is fabricated.
  3. Confirm the behavior at issue is introduced or altered by lines this PR modifies — if the root cause is untouched by the diff, score 0 as pre-existing.
  4. Answer in writing: on what concrete execution path does the failure occur, what input or state triggers it, and what breaks in practice when it fires.
  5. If after reading the code the skeptic can neither disprove nor confirm the finding, cap the score at 25.

Then score 0-100:

ScoreMeaning
0False positive that doesn't stand up to light scrutiny, or a pre-existing issue.
25Might be real, but could be a false positive. Couldn't verify. If stylistic, not explicitly called out in CLAUDE.md or AGENTS.md.
50Verified as real, but may be a nitpick or unlikely to hit in practice. Not very important relative to the rest of the PR.
75Very likely real and will be hit in practice, but after re-reading the code some doubt remains about impact or intent. The existing approach is insufficient.
100Definitely real and confirmed. Will happen frequently. Evidence directly confirms the issue.

Calibration note: the 75 band is for findings that remain probable-but-not-fully-confirmed after the mandatory re-read. A finding the skeptic HAS confirmed per the steps above — a guidance violation whose quoted rule matches the CLAUDE.md/AGENTS.md file verbatim and whose cited code matches the diff, or a security vulnerability with a concrete exploit path — scores 90 or above, never 75. Band descriptions must not cap a confirmed finding below the step 5 publish filter.

For issues flagged due to CLAUDE.md/AGENTS.md instructions, the scoring agent should double-check that the relevant file actually calls out that issue specifically.

This rubric table and the False Positive Examples section must appear verbatim in every scoring subagent's prompt — do not paraphrase either. The canonical scorer prompt is in references/subagent-prompts.md.

5. Filter

Discard any issues scoring below 80. If no issues meet this threshold, skip to step 7's no-issues path (approve with LGTM).

6. Re-check Eligibility

Before posting, use a subagent to repeat the eligibility check from step 1. PRs can be closed or updated while the review runs. Apply the same explicit-request exception from step 1. Also re-fetch the head SHA (gh api repos/OWNER/REPO/pulls/78 --jq '.head.sha'); if it differs from the SHA you reviewed, verify each surviving issue still applies to the new head before posting, and use the new SHA in links.

7. Post Review or Approve

No issues passed the filter — do not post a findings comment; approve instead:

gh pr review 78 --approve --body "LGTM"

Если утверждение не удаётся (GitHub запрещает утверждать собственный PR), переключитесь на gh pr comment 78 --body "LGTM".

Найденные проблемы — опубликуйте ОДИН пакетный отзыв через API отзывов (см. справочник команд), разделив находки по тому, привязаны ли они к изменённой строке:

  • Проблемы уровня кода (указанные строки входят в диф PR): публикуйте как встроенные комментарии в comments[] массиве, привязанные к проблемным строкам. Каждая привязанная строка должна входить в диф PR, иначе API вернёт 422 — сначала проверьте привязки по gh pr diff хункам; всё, что не привязывается, идёт в тело.
  • Проблемы уровня дизайна и прочие непривязанные к строкам (архитектурные замечания, межфайловые проблемы, находки, чьи строки выходят за пределы дифа): перечислите их в отзыве body.

Правила:

  • Каждая находка, прошедшая фильтр, должна быть опубликована — встроенно, если её можно привязать, иначе в теле; никогда не пропускайте ни одну
  • Держите вывод кратким; без эмодзи
  • Встроенные комментарии уже привязаны к коду, поэтому цитируйте только обоснование (например, цитату из CLAUDE.md или трассировку сбоя); проблемы в теле должны ссылаться на код, к которому относятся
  • Вы должны указать полный git SHA в ссылках в теле (не $(git rev-parse HEAD) — комментарий отображается как Markdown)
  • Указывайте как минимум 1 строку контекста до и после строки проблемы в диапазонах ссылок
  • Если в теле перечислено более 5 проблем, ограничьте каждую одной строкой (описание + ссылка)

Формат тела отзыва

Для повторного отзыва по новым коммитам используйте заголовок ### Code review (follow-up) вместо этого.

### Code review

Found 3 issues (2 inline).

1. <design-level or non-anchored issue> (AGENTS.md says "<quote>")

https://github.com/OWNER/REPO/blob/FULL_SHA/path/to/file.ts#L30-L35

<sub>- If this code review was useful, please react with a thumbs up. Otherwise, react with a thumbs down.</sub>

Формат встроенного комментария

<brief description> (CLAUDE.md says "<quote>" | bug: when X, Y happens because Z)

Формат ссылки

Ссылки должны следовать этому точному формату, чтобы Markdown отображался корректно:

https://github.com/OWNER/REPO/blob/FULL_SHA/path/to/file.ext#L[start]-L[end]
  • Полный 40-символьный git SHA (без раскрытия оболочки)
  • Имя репозитория должно совпадать с проверяемым репозиторием
  • # после имени файла
  • Диапазон строк как L[start]-L[end]
  • Включайте как минимум 1 строку контекста до/после (например, комментируя строки 5-6, следует ссылаться на L4-L7)

Примеры ложных срабатываний

Их следует отфильтровать на шагах 3-5. Передайте этот контекст агентам отзыва и оценки:

  • Ранее существовавшие проблемы (не внесённые этим PR)
  • То, что выглядит как баг, но на самом деле им не является
  • Педантичные придирки, которые старший инженер не стал бы отмечать
  • Проблемы, которые поймал бы линтер, проверка типов или компилятор (импорты, типы, форматирование, сбои тестов)
  • Общие вопросы качества кода (покрытие тестами, документация, общая безопасность), если только они явно не требуются в CLAUDE.md или AGENTS.md — но конкретная эксплуатируемая уязвимость, внесённая этим PR (например, инъектируемый запрос, закоммиченные учётные данные), никогда не является ложным срабатыванием по этому правилу
  • Проблемы, отмеченные в CLAUDE.md/AGENTS.md, но явно заглушённые в коде (например, комментарии игнорирования линтера)
  • Намеренные изменения функциональности, напрямую связанные с целью PR
  • Реальные проблемы в строках, которые автор не изменял

Справочник команд gh

# List open PRs
gh pr list

# View PR description and metadata
gh pr view 78

# View PR code changes
gh pr diff 78

# Get repo owner/name
gh repo view --json nameWithOwner --jq '.nameWithOwner'

# Get PR head commit SHA (full 40-char)
gh api repos/OWNER/REPO/pulls/78 --jq '.head.sha'

# Your login (for the "already reviewed" check in steps 1 and 6)
gh api user --jq '.login'

# Existing top-level comments and reviews on this PR
gh pr view 78 --json comments,reviews

# PRs that previously touched a file (agent #4).
# Note: walks the default branch only; does not follow renames. Exclude the current PR number.
gh api "repos/OWNER/REPO/commits?path=path/to/file&per_page=10" --jq '.[].sha' | head -5 \
  | xargs -I{} gh api repos/OWNER/REPO/commits/{}/pulls --jq '.[].number' | sort -un

# Feedback left on a past PR
gh api repos/OWNER/REPO/pulls/72/comments --paginate --jq '.[] | {path, line, body}'   # inline review comments
gh api repos/OWNER/REPO/issues/72/comments --jq '.[] | {user: .user.login, body}'      # top-level comments

# Approve when no issues found (fallback if approving your own PR fails: gh pr comment 78 --body "LGTM")
gh pr review 78 --approve --body "LGTM"

# Post the review when issues found — ONE batched review per run (one notification):
# code-level findings as inline comments anchored to diff lines, design-level /
# non-anchored findings in the body. commit_id is the full head SHA from the command above.
cat > /tmp/review.json <<'EOF'
{
  "commit_id": "FULL_HEAD_SHA",
  "event": "COMMENT",
  "body": "### Code review\n\nFound 3 issues (2 inline).\n\n1. <design-level issue> (AGENTS.md says \"<quote>\")\n\nhttps://github.com/OWNER/REPO/blob/FULL_SHA/path/to/file.ts#L30-L35",
  "comments": [
    {"path": "src/a.ts", "line": 42, "side": "RIGHT", "body": "<finding 1>"},
    {"path": "src/b.ts", "start_line": 10, "start_side": "RIGHT", "line": 14, "side": "RIGHT", "body": "<finding 2>"}
  ]
}
EOF
gh api repos/OWNER/REPO/pulls/78/reviews --method POST --input /tmp/review.json

Вставить в README

Ссылка на карточку для вашего README — без картинок и счётчиков.

[DarkPlay: github-review-pr](https://darkplay.ru/ai/skills/feiskyer-claude-code-settings-github-review-pr)

Похожие скиллы и другие разделы каталога

Популярное в разделе «Скиллы»

Самые востребованные скиллов раздела по установкам и звёздам.

find-skillsvercel-labs · Помогает находить и устанавливать навыки агентов по запросам вроде «как сделать X»…
4 400 000 устан.
grill-memattpocock · Настойчивое интервью для доработки плана или дизайна.
1 600 000 устан.
hyperframesheygen-com · Обязательная точка входа для любых задач по видео, анимации и motion-графике в…
1 600 000 устан.
hyperframes-cliheygen-com · Цикл разработки HyperFrames CLI: init, add, render, preview, publish и другие команды.
1 600 000 устан.
agent-browservercel-labs · CLI для автоматизации браузера для ИИ-агентов: навигация по страницам, заполнение форм…
1 600 000 устан.
media-useheygen-com · Agent Media OS: единый навык для медиа в HyperFrames — BGM, SFX, изображения, голос, LUT.
1 500 000 устан.
hyperframes-registryheygen-com · Установка и подключение блоков реестра в композиции HyperFrames через add и catalog.
1 400 000 устан.
grill-with-docsmattpocock · Настойчивое интервью для доработки плана или дизайна, попутно создающее документацию (ADR…
1 300 000 устан.
improve-codebase-architecturemattpocock · Поиск в кодовой базе возможностей для углубления, визуальный HTML-отчёт о них и детальный…
1 300 000 устан.
tddmattpocock · Разработка через тестирование (TDD): red-green-refactor и интеграционные тесты.
1 300 000 устан.
Похожее в других разделах каталога

Соседние разделы каталога: возможно, нужный инструмент живёт там.

mattpocock-skillsmattpocock · Агентские навыки Matt Pocock для настоящей инженерии: разбор задач, потоки спецификаций и…
41 комп.
Code Revieweraffaan-m · Эксперт по ревью кода. Проактивно проверяет код на качество, безопасность и…
225 587 ★
Cpp Revieweraffaan-m · Ревьюер C++: безопасность памяти, современные идиомы, конкурентность, производительность.
225 587 ★
Csharp Revieweraffaan-m · Ревьюер C#: конвенции .NET, async, безопасность, nullable-типы, производительность.
225 587 ★
Database Revieweraffaan-m · Специалист PostgreSQL: оптимизация запросов, схемы, безопасность, Supabase.
225 587 ★
Django Revieweraffaan-m · Ревьюер Django: ORM, DRF, миграции, безопасность и production-практики.
225 587 ★
Fastapi Revieweraffaan-m · Проверяет FastAPI-приложения: async, DI, Pydantic, безопасность, OpenAPI и тесты.
225 587 ★
Flutter Revieweraffaan-m · Ревьюер кода Flutter и Dart: виджеты, управление состоянием, идиомы и архитектура.
225 587 ★
Fsharp Revieweraffaan-m · Ревьюер кода F#: функциональные идиомы, типы, сопоставление с образцом и…
225 587 ★
Go Revieweraffaan-m · Ревьюер кода Go: идиоматичность, конкурентность, обработка ошибок и производительность.
225 587 ★

Лучшие ИИ-инструменты для программирования

ИИ для программирования

Подборка нейросетей и ИИ-ассистентов для разработки и автоматизации кода. Сервисы, которые ускоряют написание, ревью и отладку, экономят часы рутины и снижают порог входа в сложные

GenAPIGenapi
По запросу
5.0
Notepad++ AINotepad-plus-plus
По запросу
4.9
GitHub CopilotGitHub
По подписке
4.9
Creatium MaxCremax
По запросу
4.8
Emacs AIGnu
По запросу
4.8
KiteKite
По запросу
4.8
Amazon Q DeveloperAmazon
По запросу
4.8
VECTA
Есть бесплатный тариф
4.8
SoftPractice
Есть бесплатный тариф
4.8
VibeForge
Есть бесплатный тариф
4.7

Лучшие ИИ-инструменты для автоматизации и ассистентов

Ассистенты и автоматизация

Подборка ИИ-ассистентов для автоматизации рутины и ускорения рабочих процессов. Сервисы, которые берут на себя переписку, анализ данных, ведение базы знаний и подготовку продаж, эк

Give Me Public
Есть бесплатный тариф
5.0
AITunnelAitunnel
По запросу
5.0
STIVAStiva
По запросу
5.0
Wikibot (Викибот)Wikibot
По запросу
4.9
mymeet.aiMymeet
По запросу
4.9
InsighterInsighter
По запросу
4.9
TGHuntTghunt
Есть бесплатный тариф
4.9
LegiscanLegiscan
По запросу
4.9
RouterAIRouterai
По запросу
4.9
Wikibot 1.0 (Викибот)Wikibot
По запросу
4.9

Лучшие ИИ-инструменты для генерации видео

Генерация видео

Подборка нейросетей для генерации и монтажа видео. Инструменты, которые превращают текст в готовые ролики, экономят часы на съемках и постпродакшне. Подходит для SMM-специалистов,

VEED.IOVeed
По запросу
5.0
MootionMootion
По запросу
5.0
FlyviFlyvi
Есть бесплатный тариф
4.9
Google Veo 3.1Google
Платно
4.9
Sora (OpenAI)OpenAI
Платно
4.9
PikaPika
Платно
4.9
captions space
Есть бесплатный тариф
4.8
Клайп
Есть бесплатный тариф
4.8
viralpulse.appViralpulse
По запросу
4.8
Viral Maker AIViral-maker
Есть бесплатный тариф
4.8