Back in 2019, I wrote an article on Contino Engineering about seeding a winning engineering culture across distributed software teams. The core lesson from years of building scalable platforms was simple: good code begins with good engineering, and shared engineering norms are what stop a codebase from quietly eroding sprint by sprint.
Seven years later, AI coding agents have joined the delivery team, and interestingly, the exact same problem has come right back in a faster form.
Problem statement
When teams first try AI coding tools without shared norms, the experience is usually frustrating. You give an agent a loose prompt, it generates a thousand lines of plausible-looking code in thirty seconds, and at first glance it feels like huge progress.
Then you inspect the diff. Logic is duplicated across files, assumptions conflict with the rest of the architecture, a helper library gets invented or pulled in unnecessarily, and subtle edge-case bugs slip through. It is the exact same failure mode I used to see with siloed human coding, just happening ten times faster. Bad things lead to the creation of new bad things!
Engineers still want autonomy, speed, and clean architecture. The goal is not to slow coding agents down with bureaucracy; it is to give them the same shared engineering norms a strong delivery team works to.
Norms to the rescue (for agents too)
In 2019, the way to make engineering norms stick was to agree them early, document them clearly, and put them up on the wall where the entire team could see them every day.
With AI coding agents, the repository itself is that wall. Every codebase I deliver now, including intelligentstack-ai.com, carries four tracked documents at the root so any agent reads the exact same standards before editing a single file:
| Tracked file | Role in the repository | What it prevents |
|---|---|---|
CONSTITUTION.md | Non-negotiable architecture and security principles (static edge boundary, OAuth scopes, HTTP headers, client anonymisation) | Agents casually adding backend state or weakening security to make a feature easier |
AGENTS.md | Shared working norms imported identically by Claude Code, Gemini, and Codex (CLAUDE.md, GEMINI.md) | Tool drift when switching between different models across a project |
specs/NNN-*.md | Written functional requirements and concrete acceptance criteria | Ambiguous prompts and half-finished features |
docs/adr/ADR-NNNN-*.md | Short Architecture Decision Records for choices that are costly to reverse | Future sessions undoing deliberate architectural trade-offs |
Having a single AGENTS.md imported by CLAUDE.md and GEMINI.md matters more than it looks. Earlier on I kept slightly separate notes per tool and they drifted out of sync within a fortnight. One shared contract solves that cleanly.
Are markdown rules enough on their own?
Ok, great, so if we write AGENTS.md and a few specs, will coding agents follow every norm reliably?
Well, no, prose alone is not enough. In a long session, written guidelines can get overlooked. For any norm that genuinely protects quality or security, you want an automated check that fails loudly with a non-zero exit code.
On web platforms I wrap everything into one command (npm run verify); on Python FastAPI agent backends I use an equivalent single target covering pytest, ruff, mypy, and bandit.
# Enforced identically in .githooks/pre-commit, CI, and every agent run npm run test:security # Scans for secrets, .env files, local paths & unsafe links npm run build # Deterministic static build into dist/ npm run test:e2e # Verifies compiled HTML, interactive state & schema outputs npm run verify # Single verification gate before any commit succeeds Wiring that gate into tracked .githooks/pre-commit hooks (and explicitly prohibiting --no-verify) changes the whole dynamic. When an agent introduces a broken link, misses a security header, or regresses a DOM behaviour, it sees the exact failure immediately, fixes the root cause, and re-runs the checks before a pull request is ever opened.
Maintaining the norms and keeping humans on merge
Just like with human teams, repository norms are not static. They evolve as you hit real friction. Whenever an agent repeats a subtle mistake twice, I treat it the same way I used to treat a slow PR queue on a human team: pause briefly, ask what gap allowed it, and either tighten the verification script or add one crisp line to AGENTS.md. If a norm gets too dogmatic and slows delivery down without adding real safety, I trim it back.
The one norm I never relax is the merge boundary:
Agents open pull requests; engineers review and merge them.
Working across isolated feature branches or git worktrees keeps each diff focused on a single spec. Every pull request arrives with green security, build, and E2E checks, and I still read the diff myself before merging or triggering a production deployment. Often the tests pass, yet a simpler design is obvious once you read the code as a whole.
Thoughts
Building a good engineering culture has always been an investment that pays off steadily over time. In the AI era, encoding your engineering norms into version control and automated verification gates is the modern equivalent of putting them up on the team wall. It clears away repetitive boilerplate so experienced engineers can focus on architecture, security boundaries, and delivering software that holds up in production.
Originally published on Intelligentstack AI.
