I've built a GitHub Action that automatically reviews pull requests using GPT-4o or Claude, enforcing custom project rules through inline comments.
Key Features:
• Custom rule enforcement via .project-rules.md configuration • Support for both OpenAI GPT-4o and Anthropic Claude • Gitignore-style file filtering with .ignore files • Inline PR comments with specific line-level feedback • Zero-config setup beyond adding your API key, rules file and ignore file (optional)
How it works: The action fetches PR diffs, parses only added lines, and sends them to your chosen AI provider along with your project rules. The AI returns structured JSON feedback that gets posted as inline comments on the specific lines that need attention. It is a one-shot prompt.
Example project rules:
## Security - Never hardcode API keys or secrets - Validate all user inputs
## Code Style - Use descriptive variable names (whatever that means) - Mark typos as warnings
Setup is straightforward:
1. Add .project-rules.md with your coding standards 2. Create a GitHub workflow that runs on PR events 3. Add your AI provider API key to repository secrets
The action only reviews new code additions, keeping noise low while ensuring consistency across your codebase. It's particularly useful for teams wanting to automate enforcement of coding standards and security practices.
Built with Python, uses the GitHub API for PR integration and unidiff for parsing changes. The AI providers are abstracted, making it easy to switch between OpenAI and Anthropic or add new providers.
GitHub: https://github.com/vayqerlukashakkarainen/gpt-reviewer
Would love feedback from teams already using AI in their development workflows, or anything really. I personally like "one task" AI applications, which does only what it is told to do. I am really into researching AI uses at the moment.
Kinda funny note: I generated most of this post using OpenCode, which is an CLI agent to code and vibe with. But it seems it can be used to generate great summaries of the project as well :)