Fixing the PR Bottleneck — Matt Pocock, AIHero
Talk notes · AI Engineer ·A close reading of the source at ai.engineer (also youtube.com): what it says, what it means for someone who builds with AI, and which claims are the publisher’s own.
Coding AgentsSoftware FactoryAI Code ReviewAI Slop
Problem
Matt Pocock (AIHero, known for a set of agent "skills" he publishes) says the pull request has always been the bottleneck: even before AI, organizations had piles of PRs nobody reviewed. Agents make it trivial to open a PR and only slightly easier to open one worth reviewing (0:01). (The video has poor audio for its first two minutes.)
He defines a software factory as one where, instead of a human starting all work, deterministic triggers do: an issue goes to a classifier that makes a fix or a reproduction, a database tool sends slow-query reports, and so on (1:03). That speeds the factory up, but permanent acceleration without brakes gives a "slop cannon" of PRs nobody can review. Worse, code is the environment your agent works in, so bad code begets more bad code (2:05).
Approach
His brakes are three layers in front of the human, meant to make human review faster (3:06):
- Automated checks: linting, tests, type checks, code quality metrics. Cheap, deterministic, they cost CPU not tokens, so layer on lots (4:07).
- Automated review: agents that look for what the tests missed.
- Human review.
Checks can lie (4:07 to 7:10). Green CI does not mean ready to merge, so review exists to catch lies in the checks. His examples from his own agents' code, where he says Opus 5 "got addicted" to the first:
- Tautological tests that re-assert the implementation (a test that expects a post character limit constant to equal 280), tied so tightly to structure that you cannot rename or change the constant without a failure (5:08, 6:10).
- A test that reads a source file into memory to check that one UI section comes after another, instead of rendering it (6:10).
- Tests that cannot fail because heavy mocking stubs out an API (an audio-context example) so real error modes are never exercised (7:10). He says the AI is not trying to cheat; it follows instructions into structure-coupled tests.
Fix 1: design the codebase to resist bad tests (8:11 to 10:13). Use deep modules (John Ousterhout's idea: a big implementation behind a small interface), so tests go through the small interface. A skill of his scans a codebase and writes an HTML before-and-after of "deepening opportunities". Another gives teams shared vocabulary (locality, leverage, seam) so the many code-structure schools do not clash.
Fix 2: split implement from review (11:14 to 13:16). Do not put coding standards in the implementer agent: it already has to explore, change code and debug in one context window, so "implementation is overloaded". Put them in a coding-standards file read by a separate code review skill that runs in a sub-agent with its own context. Review is underloaded, so you can pile standards onto it. He calls this red-green-refactor with two context windows: implement to make it work, review to make it good. Keep standards out of the global AGENTS file, where they drown out the implementer.
Fix 3: build your own reviewer and let it commit (14:18, 15:18). Generic third-party review bots tend to give false positives or be too language-specific, so build your own and share the standards across the team. The reviewer should make fixes as commits, not post verbose comments that give the human more work; comment only for real questions.
A human-friendly PR (16:19 to 18:23). Classify each PR as a one-way or two-way door (AWS's terms). Most are two-way and can be reverted; one-way ones (an email to 60,000 people, expensive migrations, data loss) get serious review. Add a "blast radius", and a short merge-danger summary at the bottom of each PR. Explain the change with diagrams and pseudo-code, borrowing the Show Me skill from Dex Horthy's HumanLayer skills repo (the captions garble the name).
Retro (19:24 to 21:28). Treat the process that produces code as important as the code: "you never want to write the same comment twice." His retro skill reads a session, or a PR plus its session, or a week of PRs and reviews, and suggests new automated checks and standards, navigation pointers for the agent, token-saving tool changes and cuts to bloated steering files or skills.
Lessons learned
- Pocock: raise the quality that enters review and you need less human review, so brakes make a factory faster in the end (3:06).
- Do not trust green CI; review exists to find lies in the checks (4:07, 5:08).
- Separate making it work from making it good, with a fresh context for the second (12:15, 13:16).
- Spend human review on one-way doors and large blast radius; skip heavy review of easy-to-revert changes (16:19, 17:21).
- Each human review comment should become a check or a standard so it is not repeated (19:24, 20:26).
- Evidence caveats: all of this is one practitioner's workflow and examples. No measurements of speed or defect rates were shown. The "Opus 5 addicted to tautological tests" observation is anecdotal.
Theme
Group: AI Coding & Software Factories. Pocock is the workflow-craft voice on review. He agrees with Dex Horthy (card) on lint and agent review as back pressure and on borrowing the Show Me idea; with Manish Kapur and Addy Osmani (card) on layered verification; and with Gautam Korlam (card) that review is the queue. His retro skill is a human-led version of Dru Knox's meta loop (card) and Zach Lloyd's self-improvement (card). Jarred Sumner's note (card) that you cannot trust tests you rewrote ties to his "checks can lie". His "let the reviewer commit" differs from teams where review bots only comment.