What is it
The automatic code reviewer is a github action which will send the files that have changes to Claude, which will generate a comprehensive code review on changes and suggest improvements. It uses github actions, anthropic API, and pylint to generate the reviews. The output is a line/lines specific reviews, with detailed comments. It is very easy to improve/customize the review for your specific usecase, sine all you need to do is edit the prompt.
Key Components
- Github Actions: The key part of the system is a custom github action, which can be implemented into any repo by configuring the github workflow yml file.
- Anthropic API: We use anthropic to generate the reviews. We create a prompt which consists of some review instructions, as well as some parameters to exclude.
- Github API: To get the pull requests information, and other metadata such as line number, PR description, and automate the actual review comments generated by Anthropic, we use the github API through OctoKit.
- Pylint: We also create a review comment which gives the pylint score of the repo without any of the other information, just the single number.
What I learned
This is probably one of the more useful tools I’ve built, and i’m excited for it to be used in my lab across different projects. I like how it can be useful across many different projects by configuring the prompt, and including or excluding more context.