better-review - better github code review

toc
intro
https://github.com/loukotal/better-review
i got tired of using github for code review because it feels slow and clunky. since we started using ai agents more we have way more code to review meaning the slowness hurts even more. waiting multiple seconds for a pr / diff to load multiple times a day gets frustrating rather quickly. i thought the experience for PR review could be better. i also had an idea for an ai-assisted code review. i find it strange that no one is trying to do “ai assisted” code review. tools like coderabbit/greptile/and others do “ai review”. where as far as i can tell the ai does the full review. there’s value in that as well, though i think there’s value in seeing the code yourself.
so i created a little webapp that runs locally and wraps the gh cli and adds some ai features to assist you in the review.
though i think that the best (manual) code review would be a plugin in your editor where you can easily browse the diffs and also use lsp and editor feature (e.g. go to definition, …). many a times i need to go look at a usage of a function to make sure the call sites are correct after refactor etc.
how it works
it starts an api server (bun + effect) that also starts opencode. the webapp is solid SPA. it preloads bunch of information when it loads the PRs and caches things for faster loading.
the ai assisted review currently uses opencode to:
- you can ask anything about the PR / diffs
- generate review
- adds special annotation blocks for info/warning/critical review information the llm deems important
- the ai also specifies the order in which you should review the files (e.g. github is now just alphabetical order of filenames)
by wrapping the gh cli and being local, it means you don’t share any credentials etc. all code it loads stays local as well.
diffs rendering is done with diffs.com. this library prompted me to start working on this, very easy to integrate, great configuration options etc. you can customize the theme, fonts, how the diffs get rendered etc.
future features
i think there’s a big room for improvement with the ai features. the agent could search the github repo, it could browse (or maintain) a “knowledge base” of the repo and bunch of other things i have written down.
showcase
other tools
- i also found https://github.com/jnsahaj/lumen which looks interesting and it’s a tui.
- neovim (snacks) plugin from folke https://github.com/folke/snacks.nvim/blob/main/docs/gh.md that allows to review PRs in neovim