Skip to main content
ClaudeWave
Slash Command80 repo starsupdated 4mo ago

review

The review slash command performs a comprehensive pull request analysis using GitHub MCP tools and git commands to examine code changes, verify best practices adherence, and evaluate architectural alignment. Use this command when you need systematic PR feedback covering code quality, testing, documentation, security, performance, and commit hygiene before merging changes to a repository.

Install in Claude Code
Copy
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/sysnet4admin/_Book_Claude-Code/HEAD/week4/Tue/custom_command/.claude/commands/review.md -o ~/.claude/commands/review.md
Then start a new Claude Code session; the slash command loads automatically.

review.md

Please perform a comprehensive pull request review following these steps:

1. Context
  - Current git status: !`git status`
  - Current git diff (staged and unstaged changes): !`git diff HEAD`
  - Current branch: !`git branch --show-current`
  - Recent commits: !`git log --oneline -10`

2. Fetch PR Information
  - Use GitHub MCP tools (`mcp__github__get_pull_request`) to get PR details
  - Get PR files changed with `mcp__github__get_pull_request_files`
  - Retrieve PR diff using `mcp__github__get_pull_request_diff`
  - Check existing reviews with `mcp__github__get_pull_request_reviews`
  - Alternative: Use `git fetch` and `git diff origin/main...feature-branch` if needed

3. Code Analysis
  - Read changed files using file reading tools
  - Check code quality and style consistency
  - Identify potential bugs or issues
  - Review error handling and edge cases
  - Evaluate performance implications
  - Check for security vulnerabilities
  - Run linting commands if available (`npm run lint`, etc.)

4. Best Practices Review
  - Verify adherence to project conventions
  - Check naming conventions and code patterns
  - Review code organization and structure
  - Evaluate test coverage if tests are included
  - Check documentation and comments
  - Verify commit messages follow conventions

5. Architecture & Design
  - Assess if changes align with existing architecture
  - Review dependency management
  - Check for code duplication
  - Evaluate maintainability and scalability
  - Consider backward compatibility

6. Git History Analysis
  - Use `git log --oneline -n 10` to check recent commits
  - Review commit structure and messages
  - Check for clean, logical commit organization

7. Provide Feedback
  - List critical issues that must be fixed
  - Suggest improvements and optimizations
  - Highlight good practices used
  - Provide specific, actionable feedback with code examples
  - Use `mcp__github__add_pull_request_review_comment_to_pending_review` for inline comments if requested

8. Summary & Actions
  - Overall assessment (Approve/Request Changes/Comment)
  - Key points for the author to address
  - Positive aspects of the implementation
  - Optionally create/submit review using GitHub MCP tools if requested 

Available Tools:
  - GitHub MCP: `get_pull_request`, `get_pull_request_files`, `get_pull_request_diff`,
  `get_pull_request_reviews`
  - Git commands: `git status`, `git diff`, `git log`, `git show`, `git fetch`
  - File operations: Read files, analyze code structure
  - Linting: Run project-specific lint/test commands