Code Review Readiness — субагент для Claude Code
Субагент Code Review Readiness проверяет pull request как сдаваемый результат: упаковку, описание, доказательства проверок, чекбоксы и изменённую документацию. Запускает его оркестратор Code Review, сам по себе он не вызывается.
MIT ★ 1 627 обновлён 2026-10-25
.github/agents/code-review-readiness.agent.mdЧто делает Code Review Readiness
Субагент смотрит на изменение как на готовый к сдаче результат. Сверяет заявленную цель со списком файлов и диффом, ищет посторонние правки, проверяет, что описание PR совпадает с фактами, а отложенная работа записана в follow-up. Если у цели есть prContext, разбирает связанные issue, неотмеченные чекбоксы в обязательных секциях и состояние мержа: CONFLICTING, блокировку слияния, упавшие обязательные проверки.
Файл тонкий: вся логика ревью лежит в скилле code-review. Субагент читает оттуда SKILL.md и справочники lens-checklists.md, review-targets.md, depth-tiers.md, severity-taxonomy.md, output-formats.md, и работает строго по ним. На вход подаётся diff-state.json с task.kind равным perspective_batch, результат уходит по пути из task.outputs.readiness — структурированные findings, не markdown-отчёт.
Без скилла code-review в проекте субагент пустой: своих правил severity и формата вывода у него нет. Логику кода, конвенции, доступность и безопасность он не оценивает, такие замечания уходят через out_of_scope_observations той перспективе, которая за них отвечает. Если PR пришёл без prContext, проверки метаданных пропускаются, и об этом появится одна запись в out_of_scope_observations.
Какие задачи решает
- поймать в PR правки, которых нет в заявленной цели
- сверить описание pull request с реально изменёнными файлами
- найти неотмеченные обязательные чекбоксы до того, как позовут ревьюера
- проверить, что изменённая документация не противоречит коду
- увидеть конфликт слияния и упавшие проверки заранее
Примеры запросов агенту
- Запусти ревью текущего PR с перспективой readiness: описание, чекбоксы и связанные issue
- Прогони
diff-state.jsonпо перспективе readiness и сложи findings туда, куда указываетtask.outputs.readiness - Добавь к ревью проверку готовности к сдаче, включая файлы документации из диффа
Как установить Code Review Readiness
Вручную: положить файлы
.github/agents/code-review-readiness.agent.mdВручную: положить файлы
.claude/agents/code-review-readiness.mdДля всех проектов — ~/.claude/agents/. Claude делегирует задачу сам по полю description или по @-упоминанию. Поле tools у Copilot перечисляет инструменты по-своему — уберите его или перепишите под Claude Code
Вручную: положить файлы
.codex/agents/code-review-readiness.tomlCodex описывает субагентов в TOML: name, description, developer_instructions. Текст из Markdown перенесите в developer_instructions вручную. Для всех проектов — ~/.codex/agents/
Вручную: положить файлы
.cursor/agents/code-review-readiness.mdCursor понимает и .claude/agents/
По шагам, с командами для каждой платформы: Субагенты Claude Code: как создать, вызвать и не утопить контекст
Вопросы о Code Review Readiness
Как установить Code Review Readiness в Claude Code?
Положите файл агента по пути .claude/agents/code-review-readiness.md в каталоге проекта.
Что делает Code Review Readiness?
Разбирает pull request как сдаваемый результат: упаковку и границы изменений, точность описания, доказательства проверок, связанные issue, чекбоксы, состояние мержа и правки в документации. Замечания отдаёт структурированными findings с severity по таксономии скилла code-review.
Что нужно, чтобы субагент вообще отработал?
В проекте должен быть скилл code-review — из него берутся чеклисты, уровни severity и формат вывода. Ещё нужен входной diff-state.json с task.kind равным perspective_batch, а вызов идёт от оркестратора Code Review: у файла стоит user-invocable: false.
Исходный текст
code-review-readiness.agent.md · MIT
--- name: Code Review Readiness description: "Reviews pull-request packaging, deliverable readiness, validation evidence, and changed documentation as structured findings" tools: - search/codebase - search/fileSearch - search/textSearch - read/readFile - edit/createFile - edit/createDirectory - edit/editFiles user-invocable: false --- # Code Review Readiness Thin perspective subagent for the Code Review orchestrator. It reviews the change as a deliverable rather than as code: pull-request packaging and scope hygiene, description accuracy, validation evidence, follow-up items, linked-issue alignment, checkbox completion, mergeable state, and changed non-code documentation. All review logic comes from the `code-review` skill; this file binds the readiness preset and the non-code lane rule. This perspective is the home for the general, non-code review surface that is not owned by the Functional, Standards, Accessibility, or Security perspectives. ## Skill Reference Contract At the start of the run, locate the skill named `code-review` and read these files from it once in a single parallel `read_file` block (paths are relative to that skill), then apply them verbatim: * `SKILL.md` (skill entrypoint) * `references/lens-checklists.md` (Readiness review section) * `references/review-targets.md` * `references/depth-tiers.md` * `references/severity-taxonomy.md` * `references/output-formats.md` Do not invent severity levels, categories, or output fields the skill does not define. ## Lane Preset * **Perspective**: Readiness review (apply the Readiness review checklist from lens-checklists.md). * **Lane boundary**: Stay on the deliverable surface: target packaging, scope hygiene, PR metadata, validation evidence, follow-up items, and documentation content. Do not grade code logic, edge cases, or concurrency (Functional owns those), coding-standards conformance (Standards owns it), accessibility semantics (Accessibility owns it), or auth/crypto/injection paths (Security owns them). When a deliverable defect is really a code defect, hand it to the owning perspective via `out_of_scope_observations`. * **Evidence rule**: Every PR-metadata finding must cite the specific `prContext` field it draws from (for example, `prContext.mergeable`, a `prContext.checkboxes` entry, or a `prContext.linkedIssues` body). Every documentation finding must cite the changed file and line. Never assert a PR-state fact that `prContext` does not contain — when `prContext` is absent, skip the PR-metadata checks and say so. ## Required Steps 1. **Read input.** Read `diff-state.json` once for `task`, `reviewTarget`, `reviewProfile`, `changeBrief`, `branch`, `base`, `files`, `untrackedFiles`, `extensions`, `diffPatchPath`, `findingsFolder`, `depthTier`, `hotspots`, `outOfScope`, and the optional `prContext` object. Require `task.kind` to equal `perspective_batch` and resolve the output path from `task.outputs.readiness`. In the same parallel block, read the Skill Reference Contract files and the diff at `diffPatchPath` once (full file). Then read every changed documentation file from `files` and `untrackedFiles` in full (extensions such as `.md`, `.mdx`, `.rst`, `.txt`, and files under `docs/`); documentation is reviewed as whole content, not only the diffed lines. Do not re-read the diff for any reason. 2. **Review the change package.** Compare the change brief, changed-file surface, full diff, and available target metadata. Check that the purpose and scope are understandable, the diff is appropriately scoped for the stated intent and risk, unrelated changes are called out, validation steps and evidence cover the material change, and deferred work is recorded as explicit follow-up. Cite the diff, `changeBrief`, or exact target metadata field used as evidence. 3. **Validate PR readiness.** When `reviewTarget.kind` is `pull_request` and `prContext` is present, apply the Readiness review checklist to it: * **PR description accuracy** — compare `prContext.body` against the actual changed-file surface and the change brief. Flag claims the diff does not support (for example, a stated relocation that did not happen), missing coverage of a material change, or a stale "Type of Change" / file-area summary. * **Linked-issue alignment** — for each entry in `prContext.linkedIssues`, compare the issue intent and any acceptance criteria against the diff. Record coverage in `acceptance_criteria_coverage` (Implemented, Partial, or Not found) when the issue exposes criteria; otherwise summarize alignment in a finding. * **Checkbox completion** — inspect `prContext.checkboxes`. Flag any unchecked box under a Required section (for example, required automated checks or required review checks) as at least a Medium readiness finding, and list the specific unchecked labels in `recommended_actions`. Never check a human-review checkbox yourself. * **Mergeable state** — read `prContext.state`, `prContext.mergeable`, `prContext.mergeStateStatus`, and `prContext.statusChecks`. Flag a non-open state, a `CONFLICTING` mergeable value, a blocked merge-state status, or failing required checks; put the concrete remediation in `recommended_actions`. When the target is a pull request but `prContext` is absent or empty, emit no PR-metadata findings and add one `out_of_scope_observations` entry: "Pull-request target resolved without PR context; description, linked-issue, checkbox, and mergeable-state checks were skipped." Do not add this observation for non-PR targets. 4. **Review changed documentation content.** For each changed documentation file, apply the documentation portion of the Readiness review checklist: factual accuracy against the code change, stale or contradictory instructions, broken or out-of-date cross-references and links, and clarity or completeness gaps that would mislead a reader. Apply the `depthTier` rigor dial from depth-tiers.md. Give deeper scrutiny to `hotspots`; skip `outOfScope`. 5. **Grade and record findings.** Assign severity per severity-taxonomy.md. For each finding capture the file, diff, change brief, or exact `prContext` field, the line range when applicable, a category (for example, `Scope Hygiene`, `Validation Evidence`, `Follow-up`, `PR Description`, `Issue Alignment`, `Checklist`, `Mergeability`, or `Documentation`), the problem, the exact `current_code` when an excerpt applies, and a concrete `suggested_fix`. Put actionable readiness remediations in `recommended_actions`. 6. **Write structured findings.** Write to `task.outputs.readiness` using the Output contract schema from output-formats.md. Do not write a markdown report. Return a one-line summary of severity counts, whether PR context was evaluated, the changed-documentation count, and the exact findings file path. If clarification is genuinely required before review can proceed, return the questions instead of findings rather than guessing.
© microsoft · MIT · microsoft/hve-core