Skip to content

pbakaus/code-review-assistant

Repository files navigation

Code Review Assistant

This is a code review assistant skill and bundled CLI agent. Rather than reviewing the code entirely on its own, it's serving as an intelligent companion to a reviewer, by providing the following:

  1. Automatic matching of reviewers on your team based on their expertise
  2. First code review pass based on team-specific code patterns and concerns
  3. Visual explanation of complex architectural changes (feat. Nano Banana Pro)

Sample output

For a representative example, take a look at this PR comment: #1 (comment)

How to Use

Setup

npm install

# Copy and edit .env with your API keys
cp .env.example .env

Required API keys:

Option 1: CLI Agent (Automation & CI/CD)

Use the bundled agent for automated reviews on any PR:

# Interactive mode (default) - prompts for actions after review
./agent facebook/react#28000

# Non-interactive mode (for CI/CD)
./agent facebook/react#28000 --non-interactive

# Force diagram generation for all PRs
./agent facebook/react#28000 --force-diagrams

CLI Options:

  • --non-interactive: Skip prompts (for CI/CD pipelines)
  • --force-diagrams: Always generate visual diagrams, even for simple PRs

Interactive Mode (default): After the review, you'll be prompted to:

  • Auto-assign the recommended reviewers via gh pr edit
  • Post the review as a PR comment via gh pr comment

Non-Interactive Mode: Just displays the review and exits (perfect for CI/CD pipelines).

Option 2: Claude Code (Ad-Hoc Reviews)

Use the skill directly in Claude Code for quick reviews during development:

  1. Copy skill to your project:

    cp -r .claude/skills/code-review-assistant /your/repo/.claude/skills/
  2. In Claude Code, ask:

    Review the current PR
    

Claude will automatically:

  • Fetch PR using GitHub CLI
  • Analyze changes against your team's standards
  • Generate diagrams for complex logic
  • Offer to auto-assign reviewers via gh pr edit
  • Offer to post the review as a comment via gh pr comment

Option 3: Agent SDK (Programmatic)

Use the skill programmatically in your own code:

import { query } from '@anthropic-ai/claude-agent-sdk';

for await (const message of query({
  prompt: `Review this PR: ${prData}`,
  options: {
    settingSources: ["user", "project"], // Load skills from filesystem
    allowedTools: ["Skill", "Bash", "Read", "Write", "Grep", "Glob", "WebFetch"],
  }
})) {
  console.log(message);
}

Customization

  1. Update team expertise: Edit .claude/skills/code-review-assistant/reference/team-expertise.md
    • Add your team members with their GitHub usernames (e.g., @username)
    • List their areas of expertise
  2. Add your standards: Edit code-standards.md and code-standards-map.md
  3. Customize output: Modify the "Output Format" section in SKILL.md

Resources

License

Apache 2.0 - See LICENSE.txt

About

Skill for Claude Code that provides code review assistance

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors