RepoRoast is a brutal, lightning-fast, AI-powered codebase auditor and pull request reviewer. It combines deterministic static code analysis with state-of-the-art LLM capabilities (Google Gemini) to instantly identify architectural flaws, security risks, anti-patterns, and code quality issues.
Unlike standard "AI wrappers", RepoRoast uses an intelligent Token Optimization Engine and Abstract Syntax Tree (AST) Parsing to analyze entire repositories—up to hundreds of files—without exhausting AI context limits or breaking the bank.
- Zero-Budget OOM Protection & Smart Selection: Intelligently skips binary files, massive blobs (>50KB), and lock files, preventing Out-of-Memory crashes and wasted bandwidth.
- Deterministic AST Static Analysis: Locally parses JavaScript/TypeScript and Python to compute Lines of Code (LOC), Comment/Code ratios, Magic Numbers, and Architectural Hubs & Orphans before sending data to the AI.
- Advanced Token Allocation: Uses
gpt-tokenizerto accurately measure file sizes in tokens, automatically prioritizing core files (likepackage.jsonandDockerfile) and dynamically allocating the remaining context budget. - Incremental Pull Request (Diff) Review: Supports pasting PR, compare, or commit URLs (e.g.,
https://github.com/owner/repo/pull/1) to run targeted, deep analysis on just the changed files. - Interactive Architecture Dashboard: A sleek, fluid web interface that visualizes code scores, dependency hubs, and critical security issues, complete with a generated "Auto-Fix Prompt" you can paste directly into an IDE.
RepoRoast is a full-stack web application consisting of a React-based frontend and an Express-based Node.js backend.
- Frontend: React 18, TypeScript, Tailwind CSS, Framer Motion, Lucide Icons, Vite.
- Backend: Node.js, Express, Axios, Zod, Google Generative AI (
@google/generative-ai). - Static Analysis: Babel Parser (for JS/TS), Pyright-inspired regex fallback (for Python).
- Testing: Vitest with
@vitest/uiHTML reporting.
- Node.js: v18 or newer
- GitHub Token: (Optional but highly recommended) A personal access token to avoid GitHub API rate limits.
- Google Gemini API Key: Required for the LLM analysis. Get one from Google AI Studio.
-
Clone the repository:
git clone https://github.com/Justinvcj/RepooRoast.git cd RepooRoast -
Setup the Backend Server:
cd server npm installCreate a
.envfile in theserverdirectory:PORT=5000 GEMINI_API_KEY=your_gemini_api_key_here GITHUB_TOKEN=your_optional_github_token_here
-
Setup the Frontend Client:
cd ../client npm installCreate a
.envfile in theclientdirectory:VITE_API_URL=http://localhost:5000
You need to run both the frontend and backend concurrently.
Start the Backend:
cd server
npm start
# Server will start on http://localhost:5000Start the Frontend:
cd client
npm run dev
# Frontend will start on http://localhost:5173RepoRoast employs a robust, real-world testing strategy using Vitest. We don't just mock data; we execute live integration tests against the actual GitHub API to ensure the full analysis pipeline works end-to-end.
Navigate to the server directory and run:
cd server
npm run testWe generate a beautiful, interactive HTML test report for all passed and failed suites. After running the tests, you can view the report via:
npx vite preview --outDir test-reportsThe report details AST parsing accuracy, Token Allocation algorithms, prompt injection security validation, and schema enforcement.
RepoRoast is designed with strict boundaries to mitigate Prompt Injection.
- Fencing: Untrusted repository content and diff payloads are isolated using XML fences (e.g.,
<repository_data>). - Instruction Precedence: Critical system instructions and the
CRITICAL SECURITY RULEare appended after the untrusted payload to reinforce AI containment. - Validation: All API endpoints use strict input sanitization via custom middleware and
zodschema parsing for LLM outputs.
This project is licensed under the MIT License.