Streamline your code reviews with flexible, AI-powered analysis
PRism is an open-source, self-hosted AI tool designed to automate and enhance reviews of code, documentation, and more. It empowers teams to enforce standards, streamline workflows, and improve security without vendor lock-in or hidden costs. Choose any language model (LLM), including self-hosted ones via Ollama or open-source alternatives.
- Define your team's standards in a
RULES.md, YAML, or JSON file - Enforce coding standards, documentation guidelines, and security best practices
- Automatically flag inconsistencies like mixed naming conventions or inadequate error handling
- Combines traditional static analysis with advanced AI reasoning
- Analyzes PRs based on your custom rule set
- Highlights style, security, and architectural concerns
- Provides actionable improvement suggestions
- Choose the best model for your specific use case:
- For code reviews: Models like OpenAI Codex or Mistral
- For documentation: Models better suited for writing, such as GPT-4 or Claude
- Supports both open-source and commercial LLMs
- Configure via
prism-config.jsonfile
- Automatically reviews pull requests when opened or updated
- Provides inline comments directly in your PRs
- Works with your existing GitHub workflow
- Node.js v18 or higher
- npm or yarn
- GitHub account and repository (for GitHub integration)
-
Clone the repository
git clone https://github.com/SkySingh04/PRism.git cd PRism -
Install dependencies
npm install
-
Configure PRism Run the CLI configuration tool to set up PRism for your use case:
npm run dev
This will prompt you to select:
- Your use case (code review, documentation review, etc.)
- API endpoint for your LLM
- Preferred language model
Alternatively, you can manually create a
prism-config.jsonfile in the project root:{ "useCase": "Code Review", "apiEndpoint": "YOUR_LLM_API_ENDPOINT", "selectedModel": "YOUR_PREFERRED_MODEL" } -
Setup GitHub App (for GitHub integration)
- Create a new GitHub App in your GitHub account
- Set the following permissions:
- Pull requests: Read & Write
- Repository contents: Read
- Subscribe to pull request events
- Generate and download a private key
- Install the app on your repositories
- Configure environment variables (create a
.envfile):APP_ID=your_github_app_id PRIVATE_KEY=your_github_app_private_key WEBHOOK_SECRET=your_webhook_secret
-
Start PRism
npm start
Create a RULES.md file in your repository with your team's standards:
# Code Review Rules
## Naming Conventions
- Use camelCase for variables and functions
- Use PascalCase for classes and interfaces
## Error Handling
- All errors must be properly caught and logged
- No empty catch blocks allowed
## Documentation
- All public functions must have JSDoc comments
- Include examples for complex functionsTo review code locally before committing:
npm run startOnce configured, PRism will automatically:
- Monitor pull requests in repositories where the GitHub App is installed
- Analyze the code changes against your defined rules
- Provide feedback as comments directly in the PR
For using specific LLMs, update your prism-config.json:
{
"useCase": "Security Review",
"apiEndpoint": "https://api.openai.com/v1/chat/completions",
"selectedModel": "gpt-4"
}PRism supports multiple rule formats:
RULES.mdfor human-readable rules- JSON or YAML for machine-optimized rules
We welcome contributions from the community! Please check our CONTRIBUTING.md guide for:
-
Development Setup
- Fork and clone the repository
- Install dependencies:
npm install - Start the development server:
npm run start
-
Coding Standards
- Use TypeScript for all new code
- Follow the existing code style
- Add comments for complex logic
- Include tests for new features
-
Pull Request Process
- Create a branch for your changes
- Make your changes and commit them
- Write clear commit messages
- Update documentation if needed
- Submit a PR with a description of your changes
Looking for something to work on? Check out our good first issues - these are perfect for getting started!
PRism.Demo.Video.-.Made.with.Clipchamp_1740285601615.1.mp4
This project is licensed under the ISC License - see the LICENSE file for details.
PRism isn't just a tool—it's a customizable, AI-driven partner for code and documentation reviews. Let it help you unlock new levels of productivity and consistency across your projects. Try it today!