Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

sc-code-review

FreeNo executable scriptsNot checked

Interactive multi-model consensus code review using PAL MCP. Reviews commits, staged changes, or branch diffs with user-directed scope and interactive…

Tony363by Tony363★ 21 GitHub stars

About this skill

Code Review Skill

Comprehensive code review using PAL MCP multi-model consensus. Reviews recent commits, staged changes, or branch comparisons with focus on security, quality, performance, and architecture.

Quick Start

# Review last 5 commits (default)
/sc:code-review

# Review staged changes
/sc:code-review --staged

# Compare feature branch against main
/sc:code-review --branch main

# Security-focused review
/sc:code-review commits=3 --focus security

# Post review as PR comment
/sc:code-review --branch main --post-pr

Philosophy: Ask Early, Ask Often

This skill liberally uses AskUserQuestion at every decision point. Code review is subjective — what matters depends on context, and assumptions about reviewer priorities are frequently wrong. The cost of asking is low; the cost of reviewing the wrong scope or missing what the user cares about is high.

Interactive checkpoints:

  • Before reviewing — confirm the review scope and what the user cares about
  • When the diff is large — let the user choose what to focus on first
  • When categorization is ambiguous — ask about severity levels
  • When models disagree — let the user break the tie on issue severity
  • After findings — ask what to do next (fix, re-review, post to PR)
  • When tradeoffs exist — present them explicitly instead of picking silently
  • For critical/high findings — validate severity with user before finalizing

The user should feel like they're directing the review, not receiving a fire-and-forget report.

Behavioral Flow

  1. Parse - Extract review mode, focus area, and commit range from arguments
  2. Validate - Verify git state, branch existence, staged changes
  3. Confirm Scope - Interactive scope confirmation with user
  4. Discover - List available models via mcp__pal__listmodels
  5. Gather - Collect git diff, changed files, commit history
  6. Categorize - Map changed files to review focus areas
  7. Handle Large Diffs - Interactive chunking strategy for large changes
  8. Review - Run PAL MCP consensus with multi-model evaluation
  9. Resolve Disagreements - User adjudicates model conflicts
  10. Validate Findings - User confirms critical/high severity items
  11. Format - Present findings in GitHub PR comment style
  12. Follow-up - Ask user what to do next (fix, deep-dive, post to PR)
  13. Post - Optionally post to PR via gh CLI

Flags

Flag Type Default Description
commits int 5 Number of recent commits to review
--staged bool false Review only staged changes
--branch string - Compare current branch against target branch
--focus string full Focus: security, performance, quality, architecture, full
--post-pr bool false Post review as PR comment
--models int 2 Number of models for consensus (2-5)

Review Modes

Modes are mutually exclusive:

Mode Trigger Git Command
Commits Default or commits=N git diff -U10 HEAD~N..HEAD
Staged --staged git diff -U10 --cached
Branch --branch <target> git diff -U10 origin/<target>...HEAD

Phase 1: Validate Git State

# Verify git repository
git rev-parse --is-inside-work-tree

# Get current branch
git branch --show-current

Mode-specific validation:

  • Commits: Check git rev-list --count HEAD >= N
  • Staged: Check git diff --cached --name-only is non-empty
  • Branch: Check git rev-parse --verify "origin/$TARGET" exists

Phase 1b: Confirm Review Scope

After gathering git context, present a summary and let the user confirm or adjust:

AskUserQuestion:
  question: "Here's what I'll be reviewing. Does this scope look right?"
  header: "Scope"
  multiSelect: false
  options:
    - label: "Looks good — proceed"
      description: "<N files changed, +X/-Y lines, commits/staged/branch summary>"
    - label: "Too much — narrow scope"
      description: "I only want to review a subset of these changes"
    - label: "Too little — expand scope"
      description: "Include more commits or compare against a different branch"
    - label: "Different focus"
      description: "I want to focus on a specific area (security, performance, etc.)"

If "Too much — narrow scope": Ask which files or directories to focus on:

AskUserQuestion:
  question: "Which areas should I focus the review on?"
  header: "Focus"
  multiSelect: true
  options:
    - label: "Backend (app/)"
      description: "<N files, +X/-Y lines in app/>"
    - label: "Frontend (frontend/)"
      description: "<N files, +X/-Y lines in frontend/>"
    - label: "Tests"
      description: "<N files, +X/-Y lines in tests/>"
    - label: "Config/Infra"
      description: "<N files in Docker, CI, config>"

If "Too little — expand scope": Ask how to expand (more commits, different branch).

*If "Different focus"

Full SKILL.md on GitHub

Install sc-code-review in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

AskUserQuestion
Bash
Read
Edit
Glob
Grep
mcp__pal__consensus
mcp__pal__codereview
mcp__pal__listmodels
mcp__pal__challenge

Bundled files

IMPORT_NOTES.md

FAQ

What does the sc-code-review skill do?

Interactive multi-model consensus code review using PAL MCP. Reviews commits, staged changes, or branch diffs with user-directed scope and interactive decision points.

How do I install the sc-code-review skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the sc-code-review skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare sc-code-review with