Building with agents, lesson 6.3
Common gaps that block agents
When you score a repo, the same five gaps turn up again and again. This lesson names each one, shows how it stops an agent, and gives the fix.
Every example below changes to fit what you pick. The businesses are made up for teaching.
The picture, one step at a time
Each box is one stage. The picture lights up as you scroll.
The five gaps that block agents, in the order they bite
1Knowledge in someone's head
Decisions and steps that were never written down.
2A set-up only one laptop has
A file, a setting or a version that lives on one machine.
3No check to run
No tests, tests too slow to run, or a check that always fails.
4Errors that say nothing
"Something went wrong", with no word on what or where.
5Doors left open
Secrets in the repo, a live branch anyone can change, and never-rules written only as requests.
Never written down, so never read.
Step 1 of 6
Knowledge in someone's head
When you score a repo, the same few gaps turn up. None of them is clever. Each one makes the agent stop and ask, guess, or say "done" when it is not. The first is knowledge in someone's head: a decision from a meeting, a step one person always does. Fix it with a line in the instruction file.
Anthropic's docs name "a decision your team made in a meeting" and "a deploy process that lives in one person's head" as things an agent cannot find by reading the repo (as of November 2026).
Step 2 of 6
A set-up only one laptop has
If the app needs a file, a setting or a version that lives on one machine, the agent cannot run it. Fix it with one set-up command, a sample settings file that names every setting, and the versions written down. Then test it the honest way: on a fresh copy of the repo.
Step 3 of 6
No check to run
This is the biggest gap, and it comes in three forms. There are no tests. The tests are so slow nobody runs them. Or a check always fails, so a new failure hides among the old ones. Fix it with a quick way to run one test file, and bring every check back to a clean pass.
Your type check always shows 200 old errors. The agent adds one more. Will it notice?
Step 4 of 6
Errors that say nothing
"Something went wrong" tells an agent as little as it tells you. It guesses, changes things and tries again. Fix it with errors that name what failed and where, and logs it can read on its own copy of the app.
Step 5 of 6
Doors left open
Secrets written in the repo. A live branch anyone can change. Rules that must never be broken, written only as requests. Fix them with secrets kept outside the repo, a live branch that needs a person's approval, and hooks for the never-rules. A hook on edits does not see a shell command that changes the same file, so add a deny rule as well.
Anthropic's hooks guide warns that an agent can still change protected files with shell commands, and says to add a deny rule for them too.
Your instruction file has a rule the agent has now broken twice. What do you do?
Step 6 of 6
Close one gap a week
Every gap has one of three fixes: write it down, make it runnable, or make it enforced. Each week, pick the gap that stopped the agent most during a change to the checkout or any other job, close it, and score the repo again. Every fix helps people too. A new hire trips on the same gaps.
Which fix does it need?
Here are four gaps in your repo. Sort each one by the kind of fix that closes it.
1The team agreed last month to stop using the old discounts code, but only out loud, in a meeting.
2The delivery-cost tests take 20 minutes, so nobody runs them before a change.
3The instruction file says "don't edit the payment keys file", and the agent did it once anyway.
4Running the shop on your own machine needs a settings file that gets passed around by email.
0 of 4 right so far, 4 to go.
The gap list
This is what you keep: the five gaps on one card, each with its fix.
The gap list
- Knowledge in someone's head: write it in the instruction file, one line per decision or step.
- A set-up only one laptop has: one set-up command and a sample settings file, tested on a fresh copy.
- No check to run: a quick way to run one test file, and no check left failing every day.
- Errors that say nothing: every error names what failed and where.
- Doors left open: secrets out of the repo, the live branch needs a person's approval, never-rules as hooks plus deny rules.
Each week, close the gap that stopped the agent most, then score the repo again.
Next: Lesson 7.1: Scanning code and dependencies for leaks and holes. How to find leaked secrets and known weak spots before someone else does.