AI Coding Agents in Brownfield Repositories
A disciplined workflow for using modern coding agents in mature codebases without sacrificing conventions, tests, or review quality.

A mature repository contains years of implicit decisions: naming, deployment constraints, compatibility promises, and tests whose purpose is no longer obvious. A capable coding agent can explore that history quickly, but it still needs a workflow that turns speed into trustworthy change.
Orient before editing
Start with repository guidance, the dependency graph, recent changes, and the smallest reproduction of the problem. Ask the agent to identify the behavioral contract and likely blast radius before proposing a patch.
- Reproduce the issue with a focused test or trace
- Read adjacent code and history before introducing a new pattern
- Keep the patch scoped to the verified cause
- Run the repository’s own checks and inspect the generated diff
- Record assumptions reviewers cannot infer from the code alone
Use agents to improve evidence
The most valuable output is often not the patch but the evidence around it: a failing test, a dependency map, a performance comparison, or an explanation of why alternatives were rejected. Those artifacts make human review faster and safer.
Preserve maintainability
Agents can generate more code than a team should own. Prefer removing duplication, reusing established components, and leaving the codebase easier to understand. Throughput is valuable only when the repository remains cheaper to change tomorrow.
Primary sources
First-party documentation and announcements used to ground this field note.
