~/writing/one-kit-every-repo
One kit, every repo: how my agents work the same everywhere
Three notes on running agents were not enough: every repo drifted. So the way of working became a versioned kit. The project keeps its docs, the kit owns the agent layer, and an update is a diff someone reviews.
In October I wrote three notes on running agents: read by default, models by role, close the loop. They held up. Then I opened another repo, and none of it was there. The rules lived in a blog post and in one repository's prompt files. Every new project started from a copy of a copy, a little older than the last one.
Advice does not run. So I packaged it: one kit, versioned, shipped as a Claude Code plugin, that installs in any repo and makes the agents work the same way in each one. It reached 0.5.0 today. This note is the shape of it, not the files. The repo is private on purpose. My files fit my stack and my blind spots, and the shape is the part that travels.
What it promises
I wrote the promises before the parts, so I could hold every part up against them.
- Same everywhere. Every repo says which version of the kit it was set up with. Two repos on the same version get the same rules.
- Safe by default. An agent can look at an environment without seeing a secret. A write to anything that matters goes through a person. Code is scanned on every change.
- Checked. A command verifies the work before anything is called done, and evals measure whether a rule earned its place.
- Current. Every rule names where it came from, and gets reviewed when the models or the tools change.
It is also worth saying what it is not. It is not a framework for building agents, and it is not the documentation of the projects. It is not tied to a stack. It does not replace review by a person.
Two folders that never mix
The first repo I set up showed the problem in an afternoon. Its docs folder held the stack's rules next to a prompt library and a report an agent had written about the codebase. People reading the docs had to wade through agent material, and the agents had no clear place to look. Nobody could say which file to update when something changed, so everything went stale at the same speed.
Now the split is hard. One folder is the project: what it does, how its code is written, the decisions behind it. People write it, and the kit never touches it. The other folder is how the agents work: verification, guards, models, the lessons loop. The kit owns that one. An agent reads both, and an update to the kit can only change the second.
Who decides what
A kit that installs anywhere is only useful if it is clear who wins an argument. There are three owners, and each one has its own place:
- The kit decides how agents work. Each repo carries a copy, stamped with the kit's version.
- The repo decides what depends on its stack: the command that verifies a change, the scripts that read its logs and queues, the names of its production systems. If an adaptation would serve every repo, it goes back into the kit.
- The project decides what it is and how its code is written. The kit does not touch that.
The kit moves on its own schedule, and a repo does not follow by itself. To update, you run the setup again in that repo. It shows the diff and asks. Without the stamp, every repo would hold its own version of the truth, and nobody would notice the day they parted.
One piece at a time
Nothing switches on by itself. The kit changes no repo until the setup runs there and someone accepts the diff. Inside a repo, each piece starts when you add it: the scanners, the security review, the read-only connections.
Luckybites went first, with the folder split and the model rules and nothing else. That was enough to surface the docs problem above, while nothing else depended on the kit yet. A kit you adopt all at once teaches you nothing about which part was wrong.
Eyes without keys
An agent that cannot see production guesses. An agent that can see all of production is the incident from Read by default. The kit sits in between, with three rules.
- It looks through scripts. Each script reads with a credential that cannot write: a database user that can only select from masked views, a read-only token for the logs. The database enforces that. A sentence in a prompt would not.
- It never sees a value. The config says where each secret comes from, whether the environment, a password manager or the system keychain, and never what it is. The script fetches the value at the moment it needs it. A guard in front of every tool blocks the obvious ways to print one, like dumping the environment or reading a dotenv file. When something is missing, the agent names the variable and where it is set. It does not ask for it in the chat.
- What it sees arrives masked. Tokens, passwords, card numbers and IBANs are gone before the output reaches the model. Emails keep the first letter and the domain. Identifiers stay, so you can still follow an order from the logs to the database.
A write is a person saying yes
Writing goes through a different script, with its own credential. That one is better kept in a password manager, so it is read only at the moment of use. The script shows the impact first. Then it stops at the permission prompt, and the only thing that moves it is a person answering yes.
The prompt is the point. Nothing the agent reads can open it: a log line, a ticket, a web page, a message in a queue that says the user already approved. That text is input, and input is what an attacker controls. It is Meta's rule of two in practice, and Simon Willison's lethal trifecta seen from the other side. An agent that reads untrusted text and touches sensitive systems does not also get to change state on its own.
The rest, briefly
- Models. One strong model for the session at medium effort, and a cheap one to search the code. When the work falls short, climb in order: make it checkable, raise the effort one level, then try the next model up. Addy Osmani's guide from 9 November lands in the same place. The long version is Models by role.
- Security. Dependency, secret and code scanners run on every pull request. An agent triages what they find, and it can only read: it explains a finding, and a person decides what happens to it.
- Lessons. The loop from Close the loop, shipped with the kit instead of rebuilt in every repo.
What I am keeping back
The files. The guard's list, the masking rules, the setup that adapts the kit to a stack, the eval cases. They are the part that ages fastest, and copying them would hand you my blind spots along with my defaults. If you build your own, start where I would start again:
- Split the project's docs from the agents' rules, and give each an owner.
- Stamp a version in every repo, and update by diff.
- Give every read a credential that cannot write.
- Make every write wait for a person, enforced by the harness.
Everything else is detail you will tune to your own stack anyway. If you run a team and want to compare notes, write to me. I usually reply within the day.
Where this comes from
- Meta AI, Agents Rule of Two, 31 Oct 2025.
- The lethal trifecta for AI agents, Simon Willison, 16 Jun 2025.
- OWASP Top 10 for LLM Applications 2025, on sensitive information disclosure.
- Which Claude model should you build with?, Addy Osmani, 9 Nov 2026.
- Claude Code documentation from Anthropic: hooks and best practices.