with one click
code-review
// Review code changes across multiple dimensions (quality, bugs, concurrency, crash-safety, security, performance) using specialized agents with triage-based selection.
// Review code changes across multiple dimensions (quality, bugs, concurrency, crash-safety, security, performance) using specialized agents with triage-based selection.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | code-review |
| description | Review code changes across multiple dimensions (quality, bugs, concurrency, crash-safety, security, performance) using specialized agents with triage-based selection. |
| argument-hint | [branch | commit-range | uncommitted | PR-number] |
| user-invocable | true |
Review code changes across multiple dimensions by dispatching to specialized review agents and synthesizing their findings.
Use $ARGUMENTS as the review target if provided (branch name, commit range, or "uncommitted").
Determine the review context using the following priority:
$ARGUMENTS is provided:ytdb-605-unified-edges): Review all changes on that branch that are absent from the base branch.abc123..def456): Review that specific range.last 3 commits): Review HEAD~N...HEAD.git diff HEAD).#42 or https://github.com/.../pull/42): Fetch PR details and review its diff.$ARGUMENTS is empty:gh pr list --head $(git branch --show-current) --json number,title,body,baseRefName,url --limit 1
develop:
git log develop..HEAD --oneline
develop, review those.develop or has no commits ahead, ask the user what to review.The base branch determines what "new changes" means:
baseRefName (fetched via gh pr view).develop.Based on the review mode, collect:
# Changed files
git diff {base}...HEAD --name-only
# Full diff
git diff {base}...HEAD
# Commit log
git log {base}..HEAD --oneline
git diff {start}..{end} --name-only
git diff {start}..{end}
git log {start}..{end} --oneline
git diff HEAD --name-only
git diff HEAD
gh pr view {number} --json body --jq '.body'
Store the collected context:
DIFF โ the full diff outputCHANGED_FILES โ the list of changed file pathsCOMMIT_LOG โ the commit historyPR_DESCRIPTION โ the PR body text (empty string if no PR)REVIEW_SCOPE โ human-readable description of what's being reviewed (e.g., "Branch ytdb-605-unified-edges vs develop (15 commits, 23 files)")Before dispatching, note files that should be skipped:
core/src/main/java/com/jetbrains/youtrackdb/internal/core/sql/parser/generated-sources/ or generated-test-sources/Include this filter note in the context passed to agents.
Before dispatching agents, perform a quick triage pass over the diff to determine which review dimensions are actually relevant. This avoids wasting time on agents that have nothing meaningful to review.
Scan the diff and assign one or more categories to each changed file:
| Category | Signals |
|---|---|
| storage-engine | Files in storage/, cache/, wal/, StorageComponent subclasses, page read/write logic, DiskStorage, WriteCache, ReadCache, LogSequenceNumber, double-write log |
| concurrency | synchronized, Lock, Atomic*, volatile, StampedLock, ReentrantLock, thread pools, ConcurrentHashMap, CompletableFuture, shared mutable state, @GuardedBy |
| index-data-structures | Files in index/, B-tree, hash index, SBTree, CellBTree, histogram, IndexEngine |
| network-server | Files in server/, driver/, Gremlin Server, protocol handling, TLS/SSL, authentication, session management |
| sql-query | Files in sql/ (excluding parser/), query execution, command handlers, SELECT/INSERT/UPDATE/DELETE logic |
| gremlin | Files in gremlin/, traversal steps, YTDBGraph* classes, TinkerPop integration |
| public-api | Files in com.jetbrains.youtrackdb.api, YourTracks, YouTrackDB interface |
| serialization | Record serializers, binary format, property map encoding/decoding |
| crash-durability | WAL operations, crash simulation, durable StorageComponent recovery, page corruption handling, transaction atomicity under failure, LogSequenceNumber manipulation, double-write log, Java assert statements in production code |
| configuration | GlobalConfiguration, config parameters, system properties |
| tests-only | Changes exclusively in test files with no production code changes |
| build-config | pom.xml, CI workflows, Maven profiles, Docker configs |
| docs-only | Markdown, documentation, comments-only changes |
A file can belong to multiple categories (e.g., a lock change in storage code is both storage-engine and concurrency).
Use the following mapping to decide which agents to launch:
| Agent | Launch when ANY of these categories are present |
|---|---|
| review-code-quality | Always launched (unless docs-only is the ONLY category) |
| review-bugs-concurrency | concurrency, storage-engine, index-data-structures, network-server, serialization, gremlin, sql-query |
| review-crash-safety | crash-durability |
| review-security | network-server, public-api, sql-query, serialization, configuration, OR when new dependencies are added in pom.xml |
| review-performance | storage-engine, index-data-structures, concurrency, serialization, sql-query, gremlin |
Before launching agents, output a brief triage summary so the user can see the reasoning:
### Triage Summary
- **Categories detected**: storage-engine, concurrency, index-data-structures
- **Agents selected**: review-code-quality, review-bugs-concurrency, review-crash-safety, review-performance
- **Agents skipped**: review-security (no network/API/SQL/config/dependency changes)
docs-only: Skip all agents. Just report that only documentation changed and no code review is needed.build-config: Launch review-code-quality (to check for misconfigurations) and review-security (to check for dependency changes).tests-only: Launch only review-code-quality and review-bugs-concurrency (test logic can have bugs too).Launch the selected agents in parallel using the Agent tool. Each agent receives the same context but reviews from its own dimension.
For each agent, use this prompt template (fill in the agent-specific name):
Review the following code changes from your specialized perspective.
## Review Scope
{REVIEW_SCOPE}
## PR Description
{PR_DESCRIPTION or "No PR associated with these changes."}
## Commit Log
{COMMIT_LOG}
## Changed Files
{CHANGED_FILES}
## Skip These Files (generated code)
- core/src/main/java/com/jetbrains/youtrackdb/internal/core/sql/parser/*
- Any files under generated-sources/ or generated-test-sources/
- Generated Gremlin DSL classes
## Tooling
Use **mcp-steroid PSI find-usages / find-implementations / type-hierarchy
via `steroid_execute_code`, not grep**, for any reference-accuracy
question about a Java symbol in this diff (callers/overrides/usages of
a method, field, class, or annotation; whether a slot is genuinely
unused; whether a renamed symbol still has stale references). Grep is
acceptable for filename globs, unique string literals, and orientation
reads, but the load-bearing answer behind a finding must be PSI-backed
when the mcp-steroid MCP server is reachable per the SessionStart hook
(`steroid_list_projects` once at the start confirms the open project
matches the working tree). Fall back to grep with an explicit
reference-accuracy caveat in the finding only when mcp-steroid is
unreachable. See `CLAUDE.md` ยง MCP Steroid โ "Grep vs PSI โ when to switch" for the full routing rule.
## Diff
{DIFF}
The 5 possible agents (launch only those selected in Step 5):
Set subagent_type to the agent name and model to opus for each.
After all selected agents complete, produce a unified review report. Do NOT simply concatenate the outputs. Instead:
Deduplicate: If multiple agents flagged the same issue (e.g., a resource leak flagged by both bugs-concurrency and performance), merge into one finding and note which dimensions it affects.
Prioritize: Order findings by severity:
Attribute: For each finding, indicate which review dimension(s) identified it.
Summarize: Write a brief overall assessment (2-3 sentences).
## Code Review: {REVIEW_SCOPE}
### Overall Assessment
[2-3 sentences: is this ready to merge? What are the main concerns?]
### Blockers
[Must fix before merge]
1. **[Dimension]** `path/to/file.ext` (line X-Y)
- **Issue**: ...
- **Suggestion**: ...
### Should-Fix
[Should fix before merge]
1. **[Dimension]** `path/to/file.ext` (line X-Y)
- **Issue**: ...
- **Suggestion**: ...
### Suggestions
[Recommended improvements]
1. **[Dimension]** `path/to/file.ext` (line X-Y)
- **Issue**: ...
- **Suggestion**: ...
### Questions for the Author
[Clarifying questions aggregated from all reviewers]
If a priority level has no findings, omit it entirely.
gh CLI for GitHub API calls, not WebFetch..claude/workflow/review-iteration.md).