Overview Version History Q & A Rating & Review
PR & SonarQube Review Agent
A GitHub Copilot Chat participant extension that reviews only your uncommitted changes . It provides AI-powered PR review, live SonarQube issue filtering, and JUnit 5 test generation — all scoped to the code you actually changed.
Features
Type @pr-review in GitHub Copilot Chat to use any of these commands:
Command
Description
/pr-review
AI-powered code review of uncommitted changes — naming, logic, impact, security, performance, architecture — with APPROVE / REQUEST CHANGES / NEEDS DISCUSSION verdict
/sonar-check
Fetches issues from your live SonarQube server, filtered to only the lines you changed — includes quality gate status and project metrics
/test
Generates or updates JUnit 5 test cases for changed methods with Copilot-style Accept / Reject UI in the editor
How It Works
Git Diff Detection — Automatically detects uncommitted changes via git diff HEAD
Scoped Analysis — Only reviews files and lines you actually modified
LLM-Powered — Uses GitHub Copilot's language models (GPT-4o, Claude 3.5 Sonnet) for review and test generation
/pr-review — AI Code Review
Reviews naming conventions, logic correctness, security, performance, and architecture
Provides a clear verdict : ✅ APPROVE, ⚠️ REQUEST CHANGES, or 💬 NEEDS DISCUSSION
Analyzes impact on existing functionality
/sonar-check — Live SonarQube Integration
Connects to your SonarQube server (including self-signed certs)
Fetches only OPEN/CONFIRMED/REOPENED issues
Filters issues to changed lines only — no noise from untouched code
Shows quality gate status and project metrics (bugs, vulnerabilities, code smells, coverage, duplication)
Supports Basic auth with Bearer token fallback (SonarQube 10+)
/test — Test Generation
Generates JUnit 5 tests for changed methods using Mockito
For existing test files: merges new test methods without removing existing ones
For new files: creates complete test classes with proper annotations
Uses Copilot-style Accept / Reject UI — review proposed changes before applying
Supports @WebMvcTest for controllers, @ExtendWith(MockitoExtension.class) for services, @DataJpaTest for repositories
Setup
Requirements
VS Code 1.93+
GitHub Copilot Chat extension
A Git repository with uncommitted changes
SonarQube (optional, for /sonar-check)
Set your server URL: Settings → PR Review → SonarQube Server URL
Set your project key: Settings → PR Review → SonarQube Project Key
Run command PR Review: Set SonarQube Token to store your auth token securely
Run command PR Review: Test SonarQube Connection to verify
VS Code Commands
Command
Description
PR Review: Set SonarQube Token
Store/update/remove your SonarQube authentication token
PR Review: Test SonarQube Connection
Verify server reachability, authentication, and project access
Installation
Clone or download this extension
Run npm install and npm run compile
Press F5 to launch the Extension Development Host
Open a project with uncommitted changes and type @pr-review in Copilot Chat
To package as a .vsix:
npm install -g @vscode/vsce
vsce package