Установка
SKILL.md
PR Review — Adaptive Orchestration Protocol
Coordinates 6 specialized subagents (via the Task tool), then consolidates their findings into one summary. This skill is stack-agnostic: it owns no rules of its own. Instead it discovers what the project already documents — test runner, requirement specs, architecture conventions, project-local review skills — and each subagent loads and applies whatever that project actually has. It never invents stack-specific rules and never duplicates project docs.
Execution Contract (NON-NEGOTIABLE)
This skill is an orchestration-only protocol. Read these rules before anything else:
- You are the orchestrator. You MUST NOT analyze the diff, read source files, or write any review finding yourself. Your only jobs are gathering context (Step 1), launching subagents (Step 2), and spawning the consolidation subagent (Step 3).
- The six reviews MUST run as six separate, general-purpose subagents (no restricted toolset), launched in parallel in a single batch. Use whatever subagent / parallel-task mechanism your harness provides (in Claude Code, the Task tool).
- Doing the review inline — even partially, even "to save time", even for a small diff — is a FAILURE of this skill. There are no exceptions for diff size.
- Each subagent prompt MUST be self-contained: it receives
{REPO},{PR},{SHA}, the diff, the PR intent, the existing comment locations, and the DISCOVERY MAP. Subagents do not share your context.
Host prerequisite: operates on GitHub pull requests via the gh CLI — every fetch and post below uses gh. "Stack-agnostic" means language- and framework-agnostic, not host-agnostic: a GitLab/Bitbucket-hosted repo (which has MRs, not PRs) is out of scope.
Explicit invocation only (disable-model-invocation: true). Never auto-trigger during coding.
Step 1: Initialize
1a. PR context
- Resolve PR number from the user's request; ask if absent.
- Identify repo:
gh repo view --json nameWithOwner -q .nameWithOwner→{REPO}. - Fetch the diff:
gh pr diff {PR}. Get the head SHA:gh pr view {PR} --json headRefOid -q .headRefOid→{SHA}(required to anchor inline comments). - Load existing inline comments:
gh api repos/{REPO}/pulls/{PR}/comments— build a set of{id, path, line}records: use{path, line}to avoid reposting, keep each body to detect now-resolved issues, and keep eachidto post a threaded reply. - Read PR intent:
gh pr view {PR} --json title,body,headRefName.
1b. Project discovery (the adaptive spine)
Probe the repo once and record a project profile — the DISCOVERY MAP below — passed verbatim to every subagent. Spend real effort here; it is what makes the review fit this project. Prefer evidence the project states over guesses. Detect only what exists; mark anything absent as none.
- Test runner + layout — find the command CI actually runs. Check, in order: the CI workflow (
.github/workflows/*— or any CI config the repo keeps, e.g..gitlab-ci.yml, read only to recover the real test command) as the authoritative source, then fall back to the manifest (package.jsonscripts,pyproject.toml/tox.ini/pytest.ini,go.mod,Cargo.toml,Gemfile,Makefile,*.gradle). Derive the test-file glob(s) from existing tests (e.g.*.spec.ts,*_test.go,test_*.py,*_spec.rb) and note any unit vs integration/e2e split the repo uses. - Requirements sources — (A) an issue-tracker key in the branch name or PR body (e.g.
[A-Z]+-\d+for Jira/Linear,#\d+orowner/repo#\d+for GitHub issues, full ticket URLs); (B) in-repo spec/requirement files: a.specs/tree,docs/,*-spec.md,*-tasks.md, PRD files, or ADR/RFC directories. - Architecture / convention docs — whatever states the project's rules:
CONTRIBUTING*,ARCHITECTURE*,CONVENTIONS*,docs/**convention files,AGENTS.md,CLAUDE.md, and any coding/integration/security pattern docs the repo keeps. Record paths; do not read them yet — the owning subagent does. - Project-local review skills — scan skill dirs (
.claude/skills/,.cursor/skills/,.codex/skills/,.github/) for skills covering testing, architecture/modularity, or security. Record theirSKILL.mdpaths so subagents load the project's own reference instead of guessing.
Record the map compactly and pass it verbatim to every subagent:
TEST: <command> | globs: <...> | unit vs e2e: <split | none> | none-found
REQS: tracker=<Jira KEY-123 | GH #42 | Linear ABC-7 | none> ; specs=<paths | none>
CONVENTIONS: <doc/skill paths that state rules | none-found>
REVIEW_SKILLS: <project-local test/arch skill paths | none>
Each subagent loads only what the map lists; when a category is none, the subagent falls back to the generic checklist in its section and says so.
Step 2: Launch subagents in parallel
Send one message with six Task tool calls, launched simultaneously. Each subagent is self-contained — it cannot see this chat, so its prompt carries the full context: {REPO}, {PR}, {SHA}, the diff, the existing {id,path,line} comment set, the PR intent, and the project profile (the DISCOVERY MAP above). After all six finish, run Step 3.
Severity labels (all subagents use these)
- 🚨 Critical — bugs or logic errors that will cause failures
- 🔒 Security — vulnerabilities or data exposure
- ⚡ Performance — significant performance concerns
- ⚠️ Warning — code smells or maintainability issues
- 💡 Suggestion — optional improvements
Universal Rules (every subagent + consolidation must follow)
- Posting mechanics — never publish a broken body. For any multiline comment or summary, write the body to a temp file and post with
--body-fileor-F body=@file. See the exact commands below. This is the single most common failure mode — get it right. - Comment allowlist: post inline comments only on diff lines starting with
+(never+++). Anchor to the exact+line that is the evidence. - Skip duplicates: if a
{path, line}within ±3 lines already has a comment, skip it. - Mark resolved: on an existing comment whose issue the diff now fixes, reply
[RESOLVED] This appears resolved by the recent changes.— post it on that thread via the replies endpoint below, using the comment'sidfrom Step 1a.4. - Confidence gate: report a finding only at ≥80% confidence. When uncertain, stay silent.
- Positive highlight: every subagent surfaces at least one well-done aspect before listing issues.
- Comment-only, never destructive: never
--approve, never--request-changes, never modify files.--commentonly. - No attribution: never mention AI, an assistant, a model, or any tool in a comment body. Write as a reviewer.
- Marker: start every inline comment body with
<!-- pr-review:{type} -->(invisible when rendered; the consolidation step parses it).{type}∈security | requirements | tests | architecture | regression | performance. - Tone: specific, actionable, collegial. Always explain WHY.
Comment posting commands (copy exactly)
Write the body to a temp file first (e.g. body.md), then:
Inline review comment on an added line:
gh api repos/{REPO}/pulls/{PR}/comments \
-F body=@body.md -f commit_id={SHA} -f path={path} -F line={N} -f side=RIGHT
line={N} is the 1-based line number in the head file on the RIGHT side — count from the hunk header's +c start across added and context lines. It is not the diff/hunk offset; a diff-relative position returns 422 or lands the comment on the wrong line.
Reply on an existing comment thread (for Rule 4 [RESOLVED]), using {COMMENT_ID} from Step 1a.4:
gh api repos/{REPO}/pulls/{PR}/comments/{COMMENT_ID}/replies -F body=@body.md
PR-level summary (Requirements subagent and Consolidation):
gh pr review {PR} --comment --body-file body.md
-F/--field expands @file into the file's contents and types numbers; -f/--raw-field does NOT — -f body=@body.md publishes the literal string @body.md instead of your comment. So: -F body=@file for the body, -F line=N for the line number, -f for plain string fields (commit_id, path, side). Never -f body=@file. When in doubt for a body, prefer --body-file.
Subagent 1: Security — <!-- pr-review:security -->
If the profile lists security/integration convention docs or a security-focused project skill (from CONVENTIONS / REVIEW_SKILLS), load them and review the diff against those rules first. Then apply this generic sweep regardless: hardcoded secrets or credentials, missing authn/authz on new endpoints, PII or secrets in logs, missing webhook/callback signature validation, overly permissive CORS, unsanitized input reaching a query/command/template (injection), unsafe deserialization, broken access control on user-owned resources, sensitive fields leaking into response payloads, and internal clients/keys exported across a module boundary.
Second pass (mandatory): re-read the full diff top to bottom. List every file or hunk you did not comment on. For each, ask: "Does this violate any security rule in my scope?" Skip a file only when you can state explicitly why it is clean.
Comment format:
<!-- pr-review:security -->
🔒 Security — [Short title]
[What the issue is and why it matters]
**Recommendation:** [Specific fix]
Subagent 2: Requirements & Definition of Done — <!-- pr-review:requirements -->
Posts one PR-level summary comment only — no inline comments.
Discover requirements with two tracks (from the profile's REQS). Run both; use whichever yields content.
Track A — Issue tracker
Extract the ticket/issue reference from the branch name or PR body, then fetch it with whatever the environment allows. Adapt to the tracker present:
- GitHub issue
#N→gh issue view {N} --json title,body(or theowner/repo#Nform). - Jira
KEY-123→ the project's Jira API/CLI, e.g.curl -su "$JIRA_USER:$JIRA_API_TOKEN" "$JIRA_BASE_URL/rest/api/2/issue/KEY-123?fields=summary,description". - Linear / other → whatever the project documents.
Parse acceptance criteria, user stories, and DoD items. If no reference or credentials, skip Track A and fall through to Track B.
Track B — In-repo spec files
Scan the PR title/body for referenced spec/task files (explicit paths, markdown links, spec:/tasks: mentions). Also check any .specs/, docs/, ADR/RFC dirs from the profile for a file matching the branch, ticket, or feature name (fuzzy match on file stem). Read each candidate and extract acceptance criteria, task checklist items, and stated goals / non-goals. Treat ADR/RFC "Decision" and "Consequences" sections as requirements too.
Resolution logic
| Tracks with content | Action |
|---|---|
| Both A and B | Merge requirements; note the source of each item |
| A only | Use tracker requirements |
| B only | Use spec-file requirements |
| Neither | Post: ⚠️ No issue ticket or spec file found — requirements verification skipped. and stop |
Evaluate case by case, evidence-based. For each criterion, locate the implementing code and mark it ✅ Implemented (cite path:line), 🟡 Partial (a meaningful clause missing), or ❌ Missing. No located evidence ⇒ not implemented — never award credit from the PR description restating intent. A behavior only exercised by a test but not asserted does not count as verified.
Second pass (mandatory): re-read the merged requirement list one item at a time: "Did I evaluate this against the diff?" Mark every unassessed item ✅/🟡/❌ against the actual diff.
Summary format:
<!-- pr-review:requirements -->
## 📋 Requirements Review
**Sources:** {e.g. "Jira: KEY-123" | "Spec: .specs/<feature>/spec.md" | "Both" | "None"}
### ✅ Implemented — [criterion — `path:line`]
### 🟡 Partial — [criterion — what's missing]
### ❌ Missing — [criterion]
### 🔲 Definition of Done — [x] covered / [ ] not covered
### 💬 Notes
Subagent 3: Test Coverage — <!-- pr-review:tests -->
Use the profile's TEST runner + layout to know where tests belong and what a "correct test" looks like here. If REVIEW_SKILLS lists a project-local testing skill, load it and use its patterns as the reference for placement, naming, setup/teardown, and assertion style. Otherwise apply generic standards. Do not impose a framework the project does not use.
Review the diff for: new or changed behavior with no corresponding test (🚨 Critical for public/entry-point behavior — new endpoints, handlers, exported functions, event/queue consumers, jobs); required level wrong (pure logic needs a unit test; observable I/O — HTTP/persistence/queue — needs an integration/e2e test; behavior with both needs both); and quality gaps (wrong location per project layout, missing cleanup/teardown, no fixtures/factories, hardcoded IDs, missing negative/error case, assertions that exercise but don't assert the outcome).
Second pass (mandatory): re-read the full diff. List every new/modified entry point (endpoint, exported function, handler, consumer) you did not comment on. For each, ask: "Is there a test covering the happy path and at least one error case, at the right level?" Skip only when you can state why coverage already exists or is N/A.
Comment format:
<!-- pr-review:tests -->
[🚨/⚠️/💡] — [Short title]
[The coverage gap or test anti-pattern]
**Recommendation:** [Test to add, at which level, following project patterns]
Subagent 4: Architecture & Conventions — <!-- pr-review:architecture -->
Phase 0 — Load the project's own convention sources
Load every architecture/convention doc and project-local architecture skill named in the profile (CONVENTIONS + REVIEW_SKILLS) to EOF — do not skip any, and do not substitute stack knowledge for the project's documented rules. If the profile lists none, fall back to a minimal generic sweep (module boundaries respected, no layering violations, no cyclic/cross-boundary imports, naming consistent with neighbors) and state in each comment that no project convention docs were found.
Phase 1 — Extract the rule matrix (do not hardcode)
Read each loaded document and extract every explicit rule it states — checklist items (□/- [ ]), ✅ do / ❌ don't маркеры, утверждения "must"/"never", структурные ограничения — в один нумерованный список. Нумеруй последовательно с 1. Не добавляй ничего, чего нет в документации; не пропускай ничего из найденного. Этот нумерованный список, составленный на основе документации самого проекта, и есть матрица оценки.
Фаза 2 — Оценка матрицы, по одному файлу за раз
Для каждого изменённого файла определи PASS / VIOLATION / N/A по каждому правилу. N/A действителен только тогда, когда правило структурно неприменимо к данному типу файла. Для каждого VIOLATION оставь inline-комментарий на точной + строке, сославшись на номер правила и его исходный документ.
Второй проход (обязательный): после прохода по матрице перечитай полный diff. Перечисли каждый файл, который ты не оценил, и прогони по нему матрицу снова. Пропускай файл только с указанием, какие правила N/A и почему.
Формат комментария:
<!-- pr-review:architecture -->
[🚨/⚠️/💡] — [Short title]
Rule: [number + source doc, e.g. "Rule 8 — CONTRIBUTING.md Module Boundaries"]
[What in the diff violates it — quote the offending line]
**Recommendation:** [Exact fix; code snippet if < 6 lines]
Subagent 5: Regression & Hallucination Detection — <!-- pr-review:regression -->
Проверь diff на изменения, не связанные с заявленной целью PR, или на признаки машинно-сгенерированных артефактов: удаления кода, не связанного с изменением (🚨), импорты/ссылки на символы, которых нет в репозитории (🚨), вызовы с неверной сигнатурой или арностью (🚨), TODO/FIXME/stub, оставленный в production-путях, утверждения типов или приведения, скрывающие реальную ошибку типов, логика, дублирующая то, что уже предоставляет кодовая база, ослабленная обработка ошибок или валидация, молча проглатываемые ошибки, ослабленные или удалённые тестовые утверждения и мёртвый код, до которого никогда не доходит выполнение.
Второй проход (обязательный): перечитай полный diff. Перечисли каждый файл, который ты не прокомментировал: "Есть ли здесь несвязанные удаления, фантомные ссылки, дублированная логика или ослабленные утверждения?" Пропускай только тогда, когда можешь указать, почему ничего из этого не применимо.
Формат комментария:
<!-- pr-review:regression -->
[🚨/⚠️/💡] — [Short title]
Type: [unrelated-deletion | phantom-reference | wrong-signature | duplicate | weakened-check | dead-code]
[Specific description with quoted evidence from the diff]
**Recommendation:** [Exact fix]
Subagent 6: Performance — <!-- pr-review:performance -->
Если профиль перечисляет документы о доступе к данным или соглашениях о производительности, загрузи их как эталон ожидаемого паттерна проекта. Отмечай только проблемы, явно видимые в diff — без домыслов. Ищи: запрос/поиск внутри цикла (N+1), неограниченные выборки без пагинации или лимита, лениво загружаемые связи, вызывающие I/O на каждую строку, последовательные await/блокирующие вызовы для независимых операций, которые могли бы выполняться параллельно, повторное перевычисление инварианта внутри цикла и множественные записи, которые должны разделять одну транзакцию/пакет.
Второй проход (обязательный): перечитай полный diff. Перечисли каждую функцию, запрос и цикл, которые ты не прокомментировал: "Есть ли здесь явно видимая проблема производительности?" Пропускай только тогда, когда можешь указать, почему ничего из этого не применимо.
Формат комментария:
<!-- pr-review:performance -->
⚡ Performance — [Short title]
[Description with estimated impact, e.g. "O(N) queries per request"]
**Recommendation:** [Fix with short code sketch if < 6 lines]
Шаг 3: Консолидация
После завершения всех 6 субагентов запусти ещё один Task-субагент для консолидации:
gh api repos/{REPO}/pulls/{PR}/comments— получи все inline-комментарии.- Оставь те, чьё тело начинается с
<!-- pr-review:; разбери{type}из маркера. - Получи review тела, чтобы подхватить
<!-- pr-review:requirements -->summary:gh api repos/{REPO}/pulls/{PR}/reviews. Субагент Requirements публикует его черезgh pr review --comment, so it is a review body — не inline-/pulls/{PR}/commentsзапись (Шаг 3.1) и не/issues/{PR}/commentsзапись. Оставь тот review, чьё тело содержит маркер. - Сгруппируй находки по серьёзности: 🔒 Security → 🚨 Critical → ⚡ Performance → ⚠️ Warning → 💡 Suggestion.
- Дедуплицируй находки на одном
{path, line}(±3 строки); отметь каждого субагента, внёсшего вклад, в записи. - Собери один положительный момент от каждого субагента.
- Обнаружение пробелов: запусти
gh pr diff {PR} --name-onlyдля полного списка изменённых файлов. Сопоставь с каждым путём, получившим inline-комментарий. Перечисли любой изменённый файл с логикой, имеющий ноль inline-комментариев, в разделе### 🔍 Files With No Inline Comments. Пропускай только конфигурационные/lock-файлы (*.json,*.yaml,*.lock) и чисто типовые/декларационные файлы без логики. - Запиши сводку во временный файл и опубликуй:
gh pr review {PR} --comment --body-file summary.md.
Формат сводки:
## 📋 PR Review Summary
| | |
|---|---|
| **Subagents** | 6 (Security · Requirements & DoD · Test Coverage · Architecture · Regression · Performance) |
| **Detected runner** | {TEST command, from the map — or "none found"} |
| **Requirements source** | {tracker / spec path / none} |
| **Project refs loaded** | {convention docs + project-local skills used, from the profile} |
| **Findings** | {N} across {M} files |
---
### 🔒 Security ({N})
- [`path/file:L42`] Finding title
### 🚨 Critical ({N})
### ⚡ Performance ({N})
### ⚠️ Warnings ({N})
### 💡 Suggestions ({N})
---
### 🔍 Files With No Inline Comments
- `path/to/file` — no findings from any subagent (verify manually or re-run a targeted review)
_(Omit this section if every logic file received at least one comment.)_
---
### ✅ Highlights
- [One positive highlight per subagent]
---
> See inline comments for details and recommendations.
Если находок нет ни у одного субагента: опубликуй ✅ No issues found across all review dimensions. и всё равно включи таблицу метаданных.
Примеры
A — Requirements привязывается к тому, что есть в репозитории. В репозитории, чья ветка — feat/PLAT-482-trial, Track A извлекает PLAT-482, получает тикет Jira (curl -su "$JIRA_USER:$JIRA_API_TOKEN" .../issue/PLAT-482?fields=summary,description) и оценивает его критерии приёмки против diff → Sources: Jira: PLAT-482. Во втором репозитории без трекера, но с .specs/checkout/spec.md со ссылкой из тела PR, Track B читает эту спецификацию и оценивает её ID требований. В третьем репозитории, где нет ни того, ни другого, но есть docs/adr/0007-rate-limits.md со ссылкой в PR, Track B рассматривает Decision/Consequences из ADR как критерии. Четвёртый репозиторий без всего этого → опубликуй строку пропуска и остановись. Один и тот же субагент, четыре исхода — полностью определяется профилем проекта.
B — Architecture извлекает собственную матрицу. Репозиторий X документирует соглашения в CONTRIBUTING.md; Фаза 1 превращает его маркеры "must/never" в Правила 1–12, и diff оценивается по ним. Репозиторий Y вместо этого поставляет локальный для проекта .cursor/skills/modular-architecture/SKILL.md; субагент загружает его и извлекает чек-лист этого скилла как матрицу. В репозитории Z вообще нет документов с соглашениями → субагент заявляет об этом и выполняет только минимальный общий обход границ. Никакие правила стека никогда не зашиты жёстко.
C — Исправление публикации -F vs -f , правильное против сломанного.
# ✅ posts the file's contents (uppercase -F expands @)
gh api repos/acme/app/pulls/12/comments \
-F body=@body.md -f commit_id={SHA} -f path=src/x -F line=88 -f side=RIGHT
# ❌ posts the literal string "@body.md" (lowercase -f does NOT expand @)
gh api repos/acme/app/pulls/12/comments -f body=@body.md -f path=src/x ...
Для сводки уровня PR всегда gh pr review 12 --comment --body-file summary.md — никогда не встроенный многострочный --body.
Вставить в README
Ссылка на карточку для вашего README — без картинок и счётчиков.
[DarkPlay: pr-review](https://darkplay.ru/ai/skills/tech-leads-club-agent-skills-pr-review)
Из того же репозитория
Похожие скиллы и другие разделы каталога
Самые востребованные скиллов раздела по установкам и звёздам.
find-skillsvercel-labs · Помогает находить и устанавливать навыки агентов по запросам вроде «как сделать X»…
grill-memattpocock · Настойчивое интервью для доработки плана или дизайна.
hyperframesheygen-com · Обязательная точка входа для любых задач по видео, анимации и motion-графике в…
hyperframes-cliheygen-com · Цикл разработки HyperFrames CLI: init, add, render, preview, publish и другие команды.
agent-browservercel-labs · CLI для автоматизации браузера для ИИ-агентов: навигация по страницам, заполнение форм…
media-useheygen-com · Agent Media OS: единый навык для медиа в HyperFrames — BGM, SFX, изображения, голос, LUT.
hyperframes-registryheygen-com · Установка и подключение блоков реестра в композиции HyperFrames через add и catalog.
grill-with-docsmattpocock · Настойчивое интервью для доработки плана или дизайна, попутно создающее документацию (ADR…
improve-codebase-architecturemattpocock · Поиск в кодовой базе возможностей для углубления, визуальный HTML-отчёт о них и детальный…
tddmattpocock · Разработка через тестирование (TDD): red-green-refactor и интеграционные тесты.Соседние разделы каталога: возможно, нужный инструмент живёт там.
mattpocock-skillsmattpocock · Агентские навыки Matt Pocock для настоящей инженерии: разбор задач, потоки спецификаций и…
Code Revieweraffaan-m · Эксперт по ревью кода. Проактивно проверяет код на качество, безопасность и…
Cpp Revieweraffaan-m · Ревьюер C++: безопасность памяти, современные идиомы, конкурентность, производительность.
Csharp Revieweraffaan-m · Ревьюер C#: конвенции .NET, async, безопасность, nullable-типы, производительность.
Database Revieweraffaan-m · Специалист PostgreSQL: оптимизация запросов, схемы, безопасность, Supabase.
Django Revieweraffaan-m · Ревьюер Django: ORM, DRF, миграции, безопасность и production-практики.
Fastapi Revieweraffaan-m · Проверяет FastAPI-приложения: async, DI, Pydantic, безопасность, OpenAPI и тесты.
Flutter Revieweraffaan-m · Ревьюер кода Flutter и Dart: виджеты, управление состоянием, идиомы и архитектура.
Fsharp Revieweraffaan-m · Ревьюер кода F#: функциональные идиомы, типы, сопоставление с образцом и…
Go Revieweraffaan-m · Ревьюер кода Go: идиоматичность, конкурентность, обработка ошибок и производительность.Лучшие ИИ-инструменты для программирования
Подборка нейросетей и ИИ-ассистентов для разработки и автоматизации кода. Сервисы, которые ускоряют написание, ревью и отладку, экономят часы рутины и снижают порог входа в сложные
GenAPIGenapi
Notepad++ AINotepad-plus-plus
Creatium MaxCremax
Emacs AIGnu
KiteKite
Amazon Q DeveloperAmazonЛучшие ИИ-инструменты для автоматизации и ассистентов
Подборка ИИ-ассистентов для автоматизации рутины и ускорения рабочих процессов. Сервисы, которые берут на себя переписку, анализ данных, ведение базы знаний и подготовку продаж, эк
Give Me Public
AITunnelAitunnel
STIVAStiva
Wikibot (Викибот)Wikibot
mymeet.aiMymeet
InsighterInsighter
TGHuntTghunt
LegiscanLegiscan
RouterAIRouterai
Wikibot 1.0 (Викибот)WikibotЛучшие ИИ-инструменты для генерации видео
Подборка нейросетей для генерации и монтажа видео. Инструменты, которые превращают текст в готовые ролики, экономят часы на съемках и постпродакшне. Подходит для SMM-специалистов,
VEED.IOVeed
MootionMootion
Sora (OpenAI)OpenAI
viralpulse.appViralpulse
Viral Maker AIViral-maker