Agentic patterns - The PR student
tl;dr#
- Tell your agent to use GitHub MCP (or just the gh command line tool)
- Instruct it to get all the PR comments for your project, or just a selection like this:
For the current branch, please apply the teachings from AGENTS.md where they make sense. Note it could be no changes are required. Thanks
- Now the agent has learned from your pull requests and will code more to your teams preferences, thereby making future PRs easier to accept!
Story#
I’m currently working on a project written using Laravel - something I have never worked on before. At work, we have a Laravel expert who has been coding using it for years and has put my pull requests through the wringer!
I’ve been using claude code, and google anti-gravity to help me get the various bits of work over the line, but I was finding it was not coding to our way of doing things.
I didn’t want to have to keep telling the agent ‘oh, make sure you import classes rather than using their fully qualified names’ - something I found myself doing, but this was mentioned in a PR more than once.
By getting claude code to connect up to github and read through all the PR conversations it can boil that down into some handy guidelines for all future work.
After Claude had updated my AGENTS.md, I asked it to apply it’s new findings to my current branch and it knocked it out the park! Love it.