review-crdb

cockroachdb/cockroach

Ревью изменений и PR на качество и корректность с параллельным запуском специализированных агентов.

Звёзды32 624
Авторcockroachdb
Установок6

Установка

SKILL.md

Code Review

Review the change and provide structured, actionable feedback.

The primary goal is correctness. This is a distributed database — read the code with a critical eye for concurrency issues, locking discipline, failure modes, and architectural soundness. The specialized agents below are a checklist of common patterns to verify, but they're secondary to understanding whether the code is actually correct.

Identifying the change

Determine what to review based on context:

  • Current branch vs merge base: find the merge base against the most up-to-date master ref (local master is often stale — prefer remote-tracking refs):<!-- -->
    # Pick the most recently updated master-like ref (upstream/master, origin/master, etc.)
    master_ref=$(git for-each-ref --sort=-committerdate --format='%(refname:short)' \
      --count=1 'refs/remotes/*/master' 'refs/heads/master')
    merge_base=$(git merge-base HEAD "$master_ref")
    git log --oneline "$merge_base"..HEAD
    git diff "$merge_base"..HEAD
    
  • Staged changes: git diff --cached.
  • A PR: gh pr diff <number> and gh pr view <number>.
  • Specific files: as named by the user.

Read enough surrounding code to understand context — don't review the diff in isolation. When reviewing a PR, this may require checking out the branch (gh pr checkout <number>) to read files at the PR's version. Before doing so, check git status — if the user has uncommitted changes to tracked files, ask before checking out.

Review aspects

Each aspect is handled by a specialized agent in .claude/agents/. Not every aspect applies to every change — scan the diff, determine which apply, and skip the rest.

AspectAgentApplies when
Correctness & safetycrdb-correctness-reviewerAlways for non-trivial changes
Error handlingcrdb-error-reviewerCode touches error paths, retry logic, or resource cleanup
Go conventions & commentscrdb-conventions-reviewerAlways — focuses on new/changed code
Test coveragecrdb-test-reviewerTest files changed, or new behavior without tests
Commit structure & PR descriptioncrdb-commit-reviewerReviewing a branch/PR with commits
Type designcrdb-type-reviewerNew structs/interfaces added or significantly modified
Metric hygienecrdb-metric-reviewerDiff adds or modifies metric.Metadata definitions or introduces new metrics
Simplificationcrdb-simplifierAfter other aspects pass — polish step

Selecting aspects

The user can request specific aspects:

  • /review-crdb — run all applicable aspects (default)
  • /review-crdb correctness tests — run only those two
  • /review-crdb simplify — run only the simplifier

Valid aspect names: correctness, errors, conventions, tests, commits, types, metrics, simplify, all.

Dispatching agents

Parallel approach (default)

Launch all applicable agents simultaneously using the Agent tool. Each agent receives:

  • The diff (or file list) to review
  • Instructions to save its output as structured findings

This is faster and gives comprehensive results. Use this unless the user requests sequential review.

Correctness agent: run in the foreground (not background). It reads more surrounding context and takes longer than the other agents. Launch all other agents in the background first, then run the correctness agent in the foreground.

Do NOT poll with TaskOutput. Background agents frequently take 1–3 minutes, which exceeds TaskOutput timeout limits and causes unreliable results. Instead, rely on the automatic task notification system:

  1. Launch background agents with run_in_background: true.
  2. Run foreground agents (correctness, and any others if few agents apply).
  3. When a background agent completes, you receive a <task-notification> automatically — no polling needed.
  4. After all foreground work is done, if background notifications haven't arrived yet, continue waiting. Do not attempt to read output files or poll manually.
  5. Once all notifications arrive, aggregate the results into the summary.

Handling agent failures

If an agent fails (API error, empty result in the task notification, or other error):

  1. Retry once. Transient API errors are common — a single retry usually succeeds.
  2. If the retry also fails, report the aspect as "not reviewed" in the summary under Aspects skipped, with a brief reason (e.g., "correctness: agent hit API errors on both attempts").
  3. Don't silently drop an aspect. The user should always know which aspects were reviewed and which weren't.

Sequential approach

Run agents one at a time. Useful for interactive review where the user wants to discuss findings as they come in. The user can request this with "review sequentially" or similar phrasing.

Agent input

When dispatching each agent, provide:

  1. The diff output (or instructions on how to get it)
  2. The list of changed files
  3. Any relevant context about what the change does (from PR description, commit messages, or user explanation)

Aggregating results

After all agents complete, produce a unified summary. Keep it concise — only report findings that need action or highlight a genuinely noteworthy pattern. Don't include empty sections for aspects where no issues were found.

# Review Summary

## Blocking Issues (must fix)
- [agent]: issue description [file:line]

## Suggestions (should fix)
- [agent]: issue description [file:line]

## Nits (take it or leave it)
- [agent]: observation [file:line]

## Strengths
- What's well-done in this change

## Aspects skipped
- [aspect]: why it didn't apply

## Next steps
1. Fix blocking issues first
2. Address suggestions
3. Re-run `/review-crdb` on the affected aspects to verify fixes

Deduplicate findings across agents. If two agents flag the same issue, keep the more specific one.

Posting reviews on PRs

If the user asks to "post a review" or "submit feedback" on a PR, post a single batched review using the GitHub API. This puts the summary in the review body and each finding as an inline comment on the relevant line.

Use gh api to create the review in one call:

gh api repos/{owner}/{repo}/pulls/<number>/reviews \
  --method POST \
  --input /tmp/review-payload.json

Build the JSON payload with this structure:

{
  "event": "REQUEST_CHANGES or COMMENT",
  "body": "Summary of the review (the top-level review comment).",
  "comments": [
    {
      "path": "pkg/some/file.go",
      "line": 42,
      "side": "RIGHT",
      "body": "/review-crdb(suggestion): The comment should reflect that the key is only used for cleanup.\n\n```suggestion\n// DeprecatedStoreClusterVersionKey is only read during cleanup migration\n// and then deleted. Retained until MinSupported > V26_2.\n```"
    }
  ]
}
  • body: the summary — what the change does, overall assessment, and any findings that aren't tied to a specific line (e.g., commit structure suggestions, missing version gating). Commit structure and brief PR description feedback belong here. Don't paste rewritten descriptions — just note what's missing or misleading. End the body with a footer line: \n\n---\n*(made with [/review-crdb](https://github.com/cockroachdb/cockroach/blob/master/.claude/skills/review-crdb/SKILL.md))*
  • comments: one entry per finding that has a specific file and line. Use line (the actual line number in the file) and side: "RIGHT" (commenting on the new code). Start each comment body with /review-crdb(<severity>): where severity is blocking, suggestion, or nit. This makes the origin and severity immediately visible during review. For small, concrete fixes, use GitHub's suggested changes syntax — a fenced code block with the suggestion language tag. GitHub renders this as a diff with an "Apply suggestion" button. The content replaces the line(s) the comment is attached to. Use start_line + start_side to cover multi-line replacements. Only use suggestions for small, local changes — not for structural feedback.
  • event:<!-- -->
    • REQUEST_CHANGES: if there are any blocking or suggestion findings.
    • COMMENT: if there are only nit findings, or the change looks good but you have minor observations.
    • Never APPROVE unless the user explicitly says to approve (e.g., "post a review, approve if appropriate"). If the review has no findings and you would otherwise approve, ask the user: "No issues found — do you want me to approve this for you?"

Always confirm with the user before posting. Show them a preview of the review body, the inline comments, and the event, then ask for the go-ahead.

Вставить в README

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

[DarkPlay: review-crdb](https://darkplay.ru/ai/skills/cockroachdb-cockroach-review-crdb)

Описание

Проверяет изменения кода или PR на качество, корректность и удобство ревью. Используй по запросам "review", "check", "provide feedback" или "post a review". Параллельно запускает специализированных агентов для тщательного анализа.

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

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

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

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 ★

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

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

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

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

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

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

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

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

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

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

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