/kata:kata-review-pull-requestsfrom kata
Run a comprehensive pull request review using multiple specialized agents. Each agent focuses on a different aspect of code quality, such as comments, tests, error handling, type design, and general code review. The skill aggregates results and provides a clear action plan for improvements. Triggers include "review PR", "analyze pull request", "code review", and "PR quality check".
Ships in kata. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Run a comprehensive pull request review by spawning general-purpose subagents with inlined reference instructions. Each subagent gets a fresh context window with its specialized review instructions, the diff, and project context.
Review Aspects (optional): "$ARGUMENTS"
| Aspect | Reference File | Purpose |
|---|---|---|
| code | code-reviewer-instructions.md | General code review for project guidelines |
| tests | pr-test-analyzer-instructions.md | Test coverage quality and completeness |
| comments | comment-analyzer-instructions.md | Code comment accuracy and maintainability |
| errors | failure-finder-instructions.md | Silent failures and error handling |
| types | type-design-analyzer-instructions.md | Type design and invariants |
| simplify | code-simplifier-instructions.md | Code clarity and maintainability |
| all | (all applicable) | Run all reviews (default) |
git diff --name-only to see modified filesgh pr viewError handling:
git diff fails (not a git repo): Report error clearly and stopgh pr view fails with "no PR found": Expected for pre-PR reviews, continue with git diffgh pr view fails with auth error: Note that GitHub CLI authentication is neededBased on changes:
Read each applicable reference file into a variable for inlining into subagent prompts:
code_instructions = Read("./references/code-reviewer-instructions.md")
test_instructions = Read("./references/pr-test-analyzer-instructions.md")
comment_instructions = Read("./references/comment-analyzer-instructions.md")
errors_instructions = Read("./references/failure-finder-instructions.md")
types_instructions = Read("./references/type-design-analyzer-instructions.md")
simplify_instructions = Read("./references/code-simplifier-instructions.md")
Only read files for applicable review aspects. Also read:
git diff output into diff_contentCLAUDE.md (if exists) into project_contextMODEL_PROFILE=$(node "${CLAUDE_PLUGIN_ROOT}/skills/kata-review-pull-requests/scripts/kata-lib.cjs" read-config "model_profile" "balanced")
WORKTREE_ENABLED=$(node "${CLAUDE_PLUGIN_ROOT}/skills/kata-review-pull-requests/scripts/kata-lib.cjs" read-config "worktree.enabled" "false")
Default to "balanced" if not set.
Model lookup table:
| Agent | quality | balanced | budget |
|---|---|---|---|
| code-reviewer | opus | sonnet | sonnet |
| test-analyzer | sonnet | sonnet | haiku |
| comment-analyzer | sonnet | sonnet | haiku |
| failure-hunter | sonnet | sonnet | haiku |
| type-analyzer | sonnet | sonnet | haiku |
| code-simplifier | sonnet | sonnet | haiku |
Spawn general-purpose subagents via parallel Task calls. Each agent receives its reference instructions inlined as <agent-instructions>, the diff, and project context.
Task call pattern:
Task(
prompt="<agent-instructions>\n{instructions_content}\n</agent-instructions>\n\nReview the following changes:\n\n<diff>\n{diff_content}\n</diff>\n\n<project-context>\n{project_context}\n</project-context>",
subagent_type="general-purpose",
model="{resolved_model}",
description="PR review: {aspect}"
)
Example parallel launch (3 agents):
Task(prompt="<agent-instructions>\n{code_instructions}\n</agent-instructions>\n\nReview these changes:\n<diff>\n{diff_content}\n</diff>\n<project-context>\n{project_context}\n</project-context>", subagent_type="general-purpose", model="{code_model}", description="PR review: code")
Task(prompt="<agent-instructions>\n{test_instructions}\n</agent-instructions>\n\nReview these changes:\n<diff>\n{diff_content}\n</diff>\n<project-context>\n{project_context}\n</project-context>", subagent_type="general-purpose", model="{test_model}", description="PR review: tests")
Task(prompt="<agent-instructions>\n{errors_instructions}\n</agent-instructions>\n\nReview these changes:\n<diff>\n{diff_content}\n</diff>\n<project-context>\n{project_context}\n</project-context>", subagent_type="general-purpose", model="{errors_model}", description="PR review: errors")
All run in parallel. Task tool blocks until all complete.
Agent failure handling:
After agents complete, summarize:
Edge cases:
Organize findings:
# PR Review Summary
## Critical Issues (X found)
- [aspect]: Issue description [file:line]
## Important Issues (X found)
- [aspect]: Issue description [file:line]
## Suggestions (X found)
- [aspect]: Suggestion [file:line]
## Strengths
- What's well-done in this PR
## Recommended Action
1. Fix critical and important issues
2. Consider suggestions
3. Re-run review after fixes
Route based on review results:
| Findings | Route |
|---|---|
| Critical issues found | Route A (must address) |
| Important issues, no critical | Route B (should address) |
| Suggestions only | Route C (optional) |
| No issues | Route D (clean) → step 11 |
Route A: Critical issues found
Use AskUserQuestion:
Route B: Important issues, no critical
Use AskUserQuestion:
Route C: Suggestions only
Use AskUserQuestion:
Handling "Fix" paths:
fix: address PR review findingsHandling "Add to backlog":
gh issue createAfter handling (or Route D): Proceed to step 11.
Resolve phase context for next-up routing:
# Current phase from STATE.md
CURRENT_PHASE=$(grep -oP 'Current Phase:\s*\K\d+' .planning/STATE.md 2>/dev/null || echo "")
NEXT_PHASE=$((CURRENT_PHASE + 1))
# Check if more phases remain
TOTAL_PHASES=$(grep -c '^## Phase' .planning/ROADMAP.md 2>/dev/null || echo "0")
{If PR exists from step 3:}
Use AskUserQuestion:
{If no PR exists:}
Use AskUserQuestion:
If user chose "Merge PR":
gh pr merge "$PR_NUMBER" --merge
Then update local state:
if [ "$WORKTREE_ENABLED" = "true" ]; then
# Bare repo layout: update main/ worktree, reset workspace/ to workspace-base
git -C main pull
bash "${CLAUDE_PLUGIN_ROOT}/skills/kata-review-pull-requests/scripts/manage-worktree.sh" cleanup-phase workspace "$PHASE_BRANCH"
else
git checkout main && git pull
fi
{If TODOS_CREATED: Backlog: {N} issues created from review findings}
Show: PR: #{pr_number} — merged ✓
Then show post-merge next up:
───────────────────────────────────────────────────────────────
{If NEXT_PHASE <= TOTAL_PHASES:}
Phase {Z+1}: {Name} — {Goal from ROADMAP.md}
/kata-discuss-phase {Z+1} — gather context and clarify approach
/clear first → fresh context window
───────────────────────────────────────────────────────────────
Also available:
/kata-plan-phase {Z+1} — skip discussion, plan directly/kata-execute-phase {Z+1} — skip to execution (if already planned){If last phase (NEXT_PHASE > TOTAL_PHASES):}
Audit milestone — verify requirements, cross-phase integration
/kata-audit-milestone
/clear first → fresh context window
───────────────────────────────────────────────────────────────
Also available:
/kata-complete-milestone — skip audit, archive directly{If no phase context:}
Walk through deliverables — conversational acceptance testing
/kata-verify-work
/clear first → fresh context window
───────────────────────────────────────────────────────────────
If user chose "Verify work":
{If TODOS_CREATED: Backlog: {N} issues created from review findings}
───────────────────────────────────────────────────────────────
Walk through deliverables — conversational acceptance testing
/kata-verify-work {Z}
/clear first → fresh context window
───────────────────────────────────────────────────────────────
If user chose "Done": Stop.
{If TODOS_CREATED: Backlog: {N} issues created from review findings}
references/code-reviewer-instructions.md (opens in a new tab)references/code-simplifier-instructions.md (opens in a new tab)references/comment-analyzer-instructions.md (opens in a new tab)references/failure-finder-instructions.md (opens in a new tab)references/pr-test-analyzer-instructions.md (opens in a new tab)references/type-design-analyzer-instructions.md (opens in a new tab)scripts/kata-lib.cjs (opens in a new tab)scripts/manage-worktree.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
32 skills in this plugin
/kata-add-issueCapture an idea, task, or issue that surfaces during a Kata session as a structured issue for later work. This skill creates markdown issue files in the .planning/issues/open directory with relevant metadata and content extracted from the conversation. Triggers include "add issue", "capture issue", "new issue", "create issue", "log issue", "file issue", "add todo" (deprecated), "capture todo" (deprecated), "new todo" (deprecated)./kata-add-milestoneAdd a milestone to an existing project, starting a new milestone cycle, creating the first milestone after project init, or defining what's next after completing work. Triggers include "add milestone", "new milestone", "start milestone", "create milestone", "first milestone", "next milestone", and "milestone cycle"./kata-npx claudepluginhub gannonh/kata-marketplace --plugin kata