When a coding agent gets something wrong, the usual reflex is to add a line to AGENTS.md. The next time it fails somewhere else, we add another line. A few months later the instruction file runs to hundreds of lines, and the agent still finds new ways to be wrong.
“All Code Is Slop (Except Mine)”, a talk by Lauren Tan, an engineer at SpaceXSI (poteto on GitHub), goes the other way. Its main idea is to stop trying to teach the agent to be right with words. Instead, build an environment where the agent has a hard time being wrong, and where mistakes get caught when it is.
In the talk, Lauren says the team shipped about 11,000 pull requests to production in one month, with a revert rate of about 0.5%. Lauren alone contributed about 3,000 of them that month. I have no independent way to check these numbers. What’s worth writing down, though, isn’t the speed. It’s how the team made thousands of agent-written changes trustworthy.
These are my notes from the talk, along with what I could check against pstack, the skill set Lauren has published.
Code constraints before AGENTS.md
Lauren proposes an order for investing in an agent’s environment, called the inverse trust pyramid. At the bottom, and most important, is the codebase itself, meaning API design, architecture and refactoring. Next come automated checks such as lint rules, the type system, the compiler and automated tests. Above that is verification, both at runtime and formal. Natural language sits at the top, which covers AGENTS.md, rules, skills and other instructions.
| Order | Layer | Examples | When the agent gets it wrong |
|---|---|---|---|
| 1 | Codebase | API, architecture, refactoring | The wrong code can’t be written |
| 2 | Automated checks | lint, types, compiler, tests | The build or CI fails |
| 3 | Verification | runtime, formal verification | The bug shows up when the app runs |
| 4 | Natural language | AGENTS.md, rules, skills | Depends on the agent reading and following it |
Layers 1 and 2 differ from layer 4 in that they don’t depend on the agent understanding anything. A line in AGENTS.md can be skipped or misread, especially once the context gets long. A lint rule or a compiler runs every time and gives the same answer. If the agent writes the wrong thing, the build fails right away, so the agent has to fix it.
So when an agent repeats a mistake, the first question isn’t “what instruction should I add?” but “can this lesson become a constraint in the codebase?” The correct skill in pstack follows the same order. It asks for a fix in the most reliable place possible, starting with architecture, then types, lint and CI, then tests, and only then docs.
Not every lesson can become a constraint, though. Naming conventions for readability, or a choice between two valid designs, still need words. This order doesn’t get rid of AGENTS.md. It just puts AGENTS.md where it belongs, and how to organize that written context is the subject of Building Effective Context for Coding Agents.
Lint rules instead of conventions
In the talk, Lauren describes Dune, an internal framework for the team’s desktop app. Rather than writing conventions and hoping agents follow them, the team puts architectural decisions directly into the framework and its lint rules.
Lauren gives three examples. The first is that React’s useEffect is banned in product code and allowed only inside parts of the framework itself. The other two concern Electron, which runs an app as two kinds of process. The main process handles the system side and the renderer process handles the UI. The team keeps code for the two in separate directory structures, then uses dependency analysis and lint rules to block invalid imports between them.
The useEffect ban isn’t about the hook always being bad. Using it correctly takes a lot of judgment, and in complex cases it’s easy to get wrong. If the framework offers an API that spares the agent from deciding when to use useEffect, the agent never gets the chance to decide wrong.
For me this is the part most worth keeping. Architecture shouldn’t live only in documents. Good architecture is checked automatically, so code that breaks it fails the build or the linter right away.
APIs with fewer ways to misuse them
Lauren sums this idea up as “nuance leads to slop”. The more subtle judgment an API needs to be used correctly, the more likely an agent is to write poor code with it. People pick up implicit conventions and know when a pattern fits and when it doesn’t. Agents don’t always make that call reliably.
When an API has many ways to use it, many exceptions, or needs a lot of context to use correctly, the odds of an agent picking the wrong one go up. So instead of asking agents to remember every exception, Lauren suggests removing choices. Design APIs that are hard to misuse, drop abstractions you don’t need, restrict error-prone patterns, and turn important conventions into automated checks.
Lauren also gives a provocative example, which is removing most explanatory comments from the codebase. In Lauren’s view, comments tend to collect workarounds and ambiguity that agents then read and follow. pstack even has a no-comments skill that strips comments before review. I’m not sure this suits every team, especially codebases where a comment is the only record of why a decision was made. But the question it raises is a good one. Which comments in your code explain something the code should make obvious on its own?
Feature maps
When we hand work to an agent, we often say things like “fix the button in the left sidebar” or “update the notification settings”. Anyone on the team knows what that means. The agent may not know which button it is, which component it lives in, or how that flow works.
Lauren’s team builds a feature map. It describes the app’s features from the user’s point of view, much like a sitemap. It tells the agent what the app can do, where each feature lives and how to reach it. More importantly, it gives agents and developers a shared vocabulary.
The feature map is also the foundation for the next step. Before an agent can check a feature, it has to know where that feature is. In pstack, the create-verification-skill skill generates a project-local verify skill that comes with a feature map.
Runtime verification
Finishing the code doesn’t mean the feature works. Lauren argues that agents need an environment where they can run the app themselves, with the same debugging tools developers use. Lauren mentions the Chrome DevTools Protocol, browser automation, screenshots, video, and custom command-line tools (CLIs) for driving and inspecting the app.
The most practical part, to me, is that the team packages ready-made CLIs and code that drives the app (drivers) inside its verification skills. Without that, the agent writes a fresh script every time it needs to check something. That burns tokens, and every script can be wrong in its own way. With shared tooling, verification gets cheaper, and the tooling itself can have tests that make sure it works.
This is where I see the line between AI writing code and AI doing engineering. The agent doesn’t just produce an implementation. It has to show that the implementation works.
Formal verification and property-based testing
Flows with many states, many devices or many interleaved actions are hard to cover with hand-written tests. Lauren describes three things the team is trying.
The first is TLA+, a language for describing a system at the design level. The description covers the states, the actions that move the system between them, and the conditions that must always hold (invariants). A tool called a model checker then walks through every combination of states to find a violation. The team uses TLA+ for complex flows such as notifications across multiple devices and platforms.
The second is Lean, a theorem prover. Lauren says the team uses Lean to prove some algorithms correct. One example is a custom virtualization library, the kind that only renders the rows currently on screen while the user scrolls a long list. For that library, the team proves properties related to flickering and jitter while scrolling.
The third is property-based testing for UI, with a library called Bombadil. Instead of scripting fixed scenarios like “click A, type B, check C”, you declare properties the UI must always hold. The tool then generates many sequences of actions to find one that breaks a property.
The lesson isn’t to bring TLA+ or Lean into every project. Most features only need ordinary tests. What’s worth learning is how to spot when ordinary tests fall short, which is usually around concurrency, state transitions and logic with many cross-cutting interactions.
Reviewing verification artifacts
When agents write thousands of PRs a month, reading every line of every diff stops being realistic. Lauren says the team now reads much less code in review. Instead, reviewers look at verification artifacts, meaning the evidence an agent attaches to show that a change works.
One piece of that evidence is a statechart, a diagram of a flow’s states. pstack has a statechart skill that draws a flow’s state machine from the user’s point of view, then checks that state machine with a TLA+ model. Reviewers don’t have to read thousands of lines to understand the flow. They can see the possible states, the transitions, the invalid transitions, the states that break an invariant, and the shortest path to a failure.
Beyond statecharts, agents are asked to attach other evidence. That can be a video of the flow working, screenshots of the UI, test results and formal verification results. The review question shifts from “does this code look right?” to “is this evidence convincing?”
In the talk, Lauren agrees with an observation that around 70% of daily tokens can go to verification. I don’t read that as a target for every team. It just shows how far effort is moving from generating code to checking it.
Software factory
Once the pieces above are solid, a team can move toward much deeper automation. An agent implements a feature, then runs and verifies it. A fuzzer finds a bug nobody has spotted, and an agent opens a PR to fix it. Verification runs again, and changes that qualify are merged automatically.
Lauren reports the result as about 11,000 production PRs in a month, a stable release almost every day, and about 227 contributors in October. A software factory here isn’t just many agents running in parallel. It’s a system that generates, verifies, fixes and ships software on its own, while people design the constraints and judge the evidence.
What I took away
As generating code gets cheaper, the expensive part moves to checking it. Without good enough verification, the amount of code to review and the number of bugs to fix grow as fast as the code being generated.
So before reaching for a better model, a better prompt or more agents, I want to invest in the order of the table at the start of this post. First comes architecture that is checked automatically, along with lint, types and tests. Then runtime verification, and formal verification where it’s really needed. After that, reusable verification workflows and evidence-based review. Instructions in plain language come last.
Lauren sums it up in one line I find worth remembering. “Don’t scale code generation before you scale trust.”
I’d like to dig further into Dune, pstack, TLA+ and how to build verification skills, so I can apply them to real-world workflows with coding agents.
Sources are Lauren Tan’s talk All Code Is Slop (Except Mine) and pstack on GitHub.