An open-source Chrome and Firefox extension that analyzes GitHub Pull Request diffs using AI and displays insights in a sidebar panel.
- AI-Powered Analysis: Uses OpenAI GPT-4o or Anthropic Claude to analyze PR diffs
- Impact Score: Gets a 1-10 impact score with detailed justification
- Bug Detection: Identifies potential bugs and categorizes by severity
- Dependency Analysis: Shows affected dependencies
- Review Questions: Generates thoughtful review questions for the PR
- Caching: Caches analyzed diffs to avoid redundant API calls
- Privacy-First: User supplies their own API keys, stored locally in browser storage
# Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run build
# Run tests
npm run test- Build the extension:
npm run build - Open
chrome://extensions/ - Enable "Developer mode" (top right)
- Click "Load unpacked"
- Select the
dist/folder
src/
├── background/
│ └── service-worker.ts # Message handling & analysis lifecycle
├── content/
│ └── github-detector.ts # PR detection & panel injection
├── panel/
│ ├── App.tsx # Main panel component
│ ├── components/
│ │ ├── ResultsPanel.tsx # Display analysis results
│ │ ├── ConfigPanel.tsx # API key configuration
│ │ └── LoadingSpinner.tsx # Loading state
│ └── index.tsx # Panel entry point
├── analyzer/
│ ├── diff-parser.ts # Parse unified diffs
│ └── prompt-builder.ts # Build AI prompts
├── providers/
│ ├── openai.ts # OpenAI API adapter
│ ├── anthropic.ts # Anthropic API adapter
│ └── index.ts # Provider factory
└── shared/
├── types.ts # TypeScript interfaces
└── cache.ts # Diff caching utilities
The extension requires API keys to function. You can configure them in the extension popup:
- Click the extension icon on a GitHub PR page
- Click the ⚙️ settings icon
- Enter your OpenAI or Anthropic API key
- Select your preferred provider
- Click "Save Configuration"
Keys are stored securely in chrome.storage.local.
- OpenAI: https://platform.openai.com/api-keys (requires paid account)
- Anthropic: https://console.anthropic.com/account/keys (requires paid account)
# Run all tests
npm run test
# Watch mode
npm run test -- --watch
# UI mode
npm run test:uiEach module has corresponding .test.ts files with unit tests.
- Content script detects a GitHub PR page
- Injects analysis button into PR header
- User clicks button → service worker fetches raw diff from GitHub API
- Diff is parsed into structured format
- Prompt is built from parsed diff
- Selected AI provider analyzes the prompt
- Results displayed in panel sidebar
- TypeScript (strict mode)
- React 18 + Tailwind CSS for UI
- Chrome Extension Manifest V3
- Vite + CRXJS for bundling
- Vitest for unit tests
- GitHub REST API v3 for diff retrieval
- OpenAI API (gpt-4o)
- Anthropic API (claude-sonnet)
- Functional components only, no classes
- Each file has a single responsibility
- All async operations use async/await
- Error boundaries for graceful failures
- No external UI libraries beyond Tailwind
- JSDoc comments on public functions
- Comprehensive unit tests for all modules
MIT
Contributions are welcome! Please feel free to submit a Pull Request.
Made with ❤️ for code reviewers everywhere