oleksiv.com

oleksiv.com > Notes

Rules for coding agents in a production codebase

The loop

Business requirements become tests. The agent writes code against the tests. The tests run. Fix, repeat, until green. The tests define what correct means, not the agent and not my reading of the diff at midnight. Writing the tests is where I spend my own attention, because that is where the requirement gets pinned down.

Rules live in the repository

Before the agent writes a line it reads the rules that live next to the code: naming, the layering of the codebase (domain, application, infrastructure, presentation), and what must never be imported where. A rule that lives in a chat message is forgotten by the next session. A rule in the repo is read by every session and by every human too.

Rules that fail the build beat rules that need a reviewer

Keep it practical

The simplest approach that works wins. Agents are good at producing more code; the job is to want less of it. A client put it this way after a year of working together:

“He put real thought into working with AI coding tools, setting up rules and structure in the codebase so the generated code actually fit. But he stayed practical about it, going for the simplest approach that works and flagging things like licensing questions early instead of after the fact.”

All notes | Home