pr-review-comments — скилл для Claude Code: суть и установка
Публикует замечания ревью из файла JSON в виде построчных комментариев к пулл-реквесту на GitHub. Пригодится, когда нужно привязать выводы проверки к конкретным строкам в диффе.
npx skills add giuseppe-trisciuoglio/developer-kit --skill pr-review-comments -a claude-codeЧто делает pr-review-comments
Скилл запускает скрипт scripts/post_pr_comments.py, который считывает массив замечаний из формата JSON и отправляет их в пулл-реквест через утилиту gh. Каждый объект должен содержать поля file и line, а текст замечания формируется из summary или явного body. Для многострочных диапазонов поддерживаются параметры start_line и start_side. Доступны два режима: группировка всех комментариев в единый обзор через POST /pulls/{n}/reviews либо публикация отдельных тредов через POST /pulls/{n}/comments.
Главное ограничение связано с логикой GitHub: комментарий можно прикрепить только к строке, входящей в дифф пулл-реквеста. Скрипт сверяет каждую запись с реальными чанками изменений и пропускает замечания вне диффа, выводя отчёт о них в консоль. Если файл изменился и номера строк устарели, скрипт не сможет прикрепить комментарий к неизменённому коду.
Для запуска понадобятся авторизованная утилита gh и подготовленный файл JSON с номером пулл-реквеста. Флаг --dry-run позволяет проверить привязку строк и увидеть полезную нагрузку без фактической отправки данных на сервер.
Какие задачи решает
- опубликовать структурированные замечания аудита в пулл-реквест на GitHub
- привязать комментарии ревью к изменённым строкам диффа
- проверить соответствие номеров строк через предварительный запуск без публикации
- объединить список замечаний в единый обзор пулл-реквеста
Примеры запросов агенту
- Опубликуй замечания из файла
review.jsonв пулл-реквест<N>черезscripts/post_pr_comments.py - Сделай предварительный запуск
--dry-runдля файлаfindings.jsonи PR<N> - Сгруппируй комментарии из
audit.jsonв единый review для текущего пулл-реквеста
Как установить pr-review-comments
1Через Skills CLI (Vercel)
npx skills add giuseppe-trisciuoglio/developer-kit --skill pr-review-comments -a claude-code2Вручную: положить файлы
~/.claude/skills/pr-review-comments/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/pr-review-comments/
1Через Skills CLI (Vercel)
npx skills add giuseppe-trisciuoglio/developer-kit --skill pr-review-comments -a codex2Вручную: положить файлы
.agents/skills/pr-review-comments/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add giuseppe-trisciuoglio/developer-kit --skill pr-review-comments -a cursor2Вручную: положить файлы
.cursor/skills/pr-review-comments/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install giuseppe-trisciuoglio/developer-kit pr-review-comments2Вручную: положить файлы
.github/skills/pr-review-comments/SKILL.md1Через Skills CLI (Vercel)
npx skills add giuseppe-trisciuoglio/developer-kit --skill pr-review-comments -a gemini-cli2Командой платформы
gemini skills install https://github.com/giuseppe-trisciuoglio/developer-kit --path plugins/developer-kit-core/skills/pr-review-commentsВручную: положить файлы
.devin/skills/pr-review-comments/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add giuseppe-trisciuoglio/developer-kit --skill pr-review-comments -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Из того же набора93
Похожие
Рядом в теме «Код-ревью и рефакторинг»
Всё по теме «Код-ревью и рефакторинг» →Вопросы о pr-review-comments
Как установить pr-review-comments в Claude Code?
Выполните команду npx skills add giuseppe-trisciuoglio/developer-kit --skill pr-review-comments -a claude-code в терминале.
Что делает скилл pr-review-comments?
Он считывает массив замечаний из файла JSON и публикует их как инлайн-комментарии к файлам и строкам в пулл-реквесте GitHub.
Почему комментарий может не опубликоваться в пулл-реквесте?
GitHub разрешает добавлять инлайн-комментарии только к тем строкам, которые входят в diff пулл-реквеста. Если строка осталась неизменённой или номера строк в JSON устарели, скрипт пропустит её и выведет в списке пропущенных.
Исходный текст
SKILL.md · MIT
---
name: pr-review-comments
description: Posts review findings from a JSON file as inline comments on a GitHub Pull Request, attaching each comment to its file and line. Use when you have a list/JSON of review findings (each with a file path, line number, and a message such as summary/failure_scenario) and want them published on a PR as inline review comments. Triggers include "post these review comments on the PR", "associate comments to files in the PR", "publish review findings to PR #N", or having a JSON array of {file, line, summary} to turn into PR comments.
allowed-tools: Read, Write, Bash
---
# PR Review Comments
Publish a JSON array of review findings as inline comments on a GitHub Pull Request,
each anchored to its file and line. Uses the GitHub API through the authenticated
`gh` CLI, so no token handling is needed.
## Prerequisites
- `gh` CLI installed and authenticated (`gh auth status`). The script auto-detects the
repo with `gh repo view`; pass `--repo OWNER/REPO` to override.
- The PR number to comment on.
- A JSON file: an **array** of objects. Required keys per object: `file`, `line`.
Message comes from `summary` and/or `failure_scenario` (combined into the body), or an
explicit `body`. See [references/json-schema.md](references/json-schema.md) for the full
schema and a sample.
## Key constraint: only diff lines are commentable
GitHub only accepts an inline comment if the target line is part of the PR's diff.
`line` is the line number in the **new** file (use `side: "LEFT"` for removed lines).
The script fetches the PR diff, validates every finding against the actual hunks, and
**skips** any whose line is outside the diff — reporting them at the end so nothing is
lost silently. There is no way to attach a line comment to an unchanged, undiffed line.
## Workflow
1. Confirm the JSON path and the PR number. If the repo isn't obvious, run `gh repo view`.
2. **Dry-run first** to see what will be posted and what gets skipped:
```bash
scripts/post_pr_comments.py --pr <N> --json <path> --dry-run
```
3. Review the "Postable" / "Skipped" counts with the user. If lines were skipped because
the diff moved, the line numbers in the JSON may be stale — reconcile before posting.
4. Post for real, choosing the mode (see below):
```bash
# Grouped (default): one PR review bundling all comments
scripts/post_pr_comments.py --pr <N> --json <path> --event COMMENT
# Individual: one separate inline comment per finding
scripts/post_pr_comments.py --pr <N> --json <path> --mode individual
```
5. Report back the created review/comment URLs and the list of any skipped findings.
## Choosing the mode
| Mode | Endpoint | Use when |
|------|----------|----------|
| `grouped` (default) | `POST /pulls/{n}/reviews` | Publishing a set of findings as one review. One notification; can set `--event APPROVE \| REQUEST_CHANGES \| COMMENT`. |
| `individual` | `POST /pulls/{n}/comments` | Adding standalone comments incrementally, or when each finding should be its own thread/notification. |
Default to `grouped` with `--event COMMENT` unless the user wants a verdict or separate threads.
## Options reference
```
--pr N PR number (required)
--json PATH JSON array of findings (required)
--repo OWNER/REPO Override auto-detected repo
--mode grouped|individual Default: grouped
--event COMMENT|APPROVE|REQUEST_CHANGES Grouped-mode verdict (default COMMENT)
--review-body TEXT Top-level summary body for the grouped review
--commit SHA Commit to anchor to (default: PR head SHA)
--dry-run Validate and print payloads without posting
```
## Notes
- Multi-line range comments: include `start_line` (and optional `start_side`) in the JSON
object alongside `line`; the script passes them through.
- Always `--dry-run` before a real post on an unfamiliar PR — stale line numbers are the
most common failure and the dry-run surfaces them as "skipped" without side effects.
- The script is the reliable path; don't hand-roll `gh api` calls for this — it handles
diff validation, repo/commit detection, and body assembly consistently.
© giuseppe-trisciuoglio · MIT · giuseppe-trisciuoglio/developer-kit