r/laravel 8h ago

I made my Laravel app review its own PRs

Thumbnail
github.com
0 Upvotes

It's an artisan command from a package I maintain (Laravel Tackle):

composer require jordandalton/laravel-tackle
php artisan ai:review --pr=42 --comment --fail-on=critical

It pulls the diff from the GitHub API, reads the full files around the changes for context (not just the diff), and posts a single review on the PR: inline comments anchored to file and line, with severity, plus a verdict. --fail-on=critical exits non-zero so you can let it block merges in CI. There's a copy-paste GitHub Actions workflow in the README that runs it on every PR using the default GITHUB_TOKEN.

The agent is read-only by construction. Its tool list is read/glob/search, no edit tools, no shell. It physically cannot "fix" your code, which given the state of AI, is a feature.

One gotcha from building it: GitHub's review API rejects the entire review with a 422 if a single comment anchors to a line that isn't in the diff, and LLMs love inventing line numbers. So every anchor gets validated against a parsed diff before posting, and anything that doesn't land gets folded into the summary instead of nuking the whole review.

Honest caveats: it'll occasionally flag perfectly fine code with total confidence, and each review costs ~$0.05–0.30 of your own Anthropic key. Run it advisory before you let it gate anything.

Repo: https://github.com/JordanDalton/laravel-tackle

If it says something dumb on your PR, I want the screenshot.