<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/brownfield-agentic-engineering-eirx4lwda" -->

---
title: Brownfield Agentic Engineering | daily.dev
description: Working with AI coding agents in old, brownfield codebases requires making hidden institutional knowledge explicit and proving changes are safe before letting...
canonical: https://daily.dev/posts/brownfield-agentic-engineering-eirx4lwda
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Brownfield Agentic Engineering | daily.dev
og:description: Working with AI coding agents in old, brownfield codebases requires making hidden institutional knowledge explicit and proving changes are safe before letting...
og:url: https://daily.dev/posts/brownfield-agentic-engineering-eirx4lwda
og:image: https://api.daily.dev/og/posts/EIRx4LWda.png
og:image:alt: Brownfield Agentic Engineering
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Brownfield Agentic Engineering

**[Addy Osmani](https://daily.dev/sources/addy)** · [@addyosmani](https://daily.dev/addyosmani) · 15 min read · 1 upvotes · 0 comments

## Summary

Working with AI coding agents in old, brownfield codebases requires making hidden institutional knowledge explicit and proving changes are safe before letting agents act autonomously. The piece proposes zoning code into green (safe, well-tested), yellow (mixed quality, needs characterization tests first), and red (sensitive areas like auth/billing requiring human pairing on every step), with a human always drawing the map. It argues instructions, skills, and plugins should form a durable harness so repeated corrections become lint rules, tests, or hooks rather than being relearned each session. Migrations should be completed as whole units rather than left half-converted, since agents get confused by contradictory precedent when old and new patterns coexist. Real-world examples cited include Bun's Zig-to-Rust port, Stripe's TypeScript migration, Asana's Enzyme backlog cleared for about $12,000, and Shopify's Shop app rewrite from React Native to native Swift/Kotlin in twelve weeks. The core claim is that agents changed the cost of trying multiple implementations but not the evidence needed to trust and choose one, so parallelizing agent work should come only after a single reliable review and recovery loop is proven.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://addyosmani.com/blog/brownfield-agentic-engineering>

## Questions this post answers

### What is a characterization test and why does it matter when using AI agents on legacy code?

A characterization test is an automated test that documents a system's actual current behavior, including its ugly or unintended parts, so it can be safely refactored or changed. When an AI agent both writes the code and the tests in the same session, it may 'fix' unintended behavior the business actually depends on, so the behavior should be pinned down by a separate pass or a person before the agent starts working.

_Teams weighing agent-driven refactors can compare approaches to legacy testing discipline on daily.dev._

### How did Bun's team manage the Zig-to-Rust rewrite of their 535,000-line codebase using AI agents?

Bun's team ran roughly 50 agent workflows over 11 days, using two adversarial reviewers on every generated unit and the entire pre-existing test suite as the merge gate. Before any agent ran, the team spent hours writing a porting guide mapping Zig idioms to Rust, which is considered the most transferable part of the process for other large-scale agent migrations.

_Engineers planning a large agent-assisted rewrite can weigh this migration structure via daily.dev._

### What did the SWE Refactor Bench study find about AI agents completing code migrations?

Across 520 agent runs on migration tasks, only 28 passed the full audit combining migration completeness, behavioral tests, and independent verification. The study identified a failure pattern called migration 'blindness,' where tests stay green even though a supposedly replaced code path still calls the old legacy implementation underneath.

_Anyone auditing agent-driven migrations for hidden legacy dependencies can track findings like this on daily.dev._

## Similar posts on daily.dev

- [Why are good developers so wary of agentic development?](https://daily.dev/posts/why-are-good-developers-so-wary-of-agentic-development--znygdiaw1) · Martin Fowler · 1 upvotes · 0 comments
- [Simon Willison’s Weblog](https://daily.dev/posts/simon-willison-s-weblog-ypcurxob3) · Hacker News · 1 upvotes · 1 comments
- [When code is abundant](https://daily.dev/posts/when-code-is-abundant-gezbqtizx) · GitLab · 0 upvotes · 0 comments
- [AI Agents Don’t Fix Bad Architecture. They Accelerate It.](https://daily.dev/posts/ai-agents-don-t-fix-bad-architecture-they-accelerate-it--y0bkycqlx) · Medium · 1 upvotes · 0 comments

---

Tags: [#ai-agents](https://daily.dev/tags/ai-agents), [#architecture](https://daily.dev/tags/architecture), [#code-review](https://daily.dev/tags/code-review)

[View this post on daily.dev](https://daily.dev/posts/brownfield-agentic-engineering-eirx4lwda)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Brownfield Agentic Engineering","url":"https://daily.dev/posts/brownfield-agentic-engineering-eirx4lwda","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/brownfield-agentic-engineering-eirx4lwda"},"datePublished":"2026-09-20T18:35:04.075Z","dateModified":"2026-09-21T15:00:13.347Z","description":"Working with AI coding agents in old, brownfield codebases requires making hidden institutional knowledge explicit and proving changes are safe before letting...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/fde091b31d74b7aa3f9ceba722eb6d81?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/fde091b31d74b7aa3f9ceba722eb6d81?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Addy Osmani","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Person","name":"Addy Osmani","url":"https://daily.dev/addyosmani","image":"https://avatars2.githubusercontent.com/u/110953?v=4","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":5510}},"commentCount":0,"discussionUrl":"https://daily.dev/posts/brownfield-agentic-engineering-eirx4lwda","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ai-agents,architecture,code-review","timeRequired":"PT15M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Addy Osmani","item":"https://daily.dev/sources/addy"},{"@type":"ListItem","position":3,"name":"Brownfield Agentic Engineering"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/brownfield-agentic-engineering-eirx4lwda#faq","mainEntity":[{"@type":"Question","name":"What is a characterization test and why does it matter when using AI agents on legacy code?","acceptedAnswer":{"@type":"Answer","text":"A characterization test is an automated test that documents a system's actual current behavior, including its ugly or unintended parts, so it can be safely refactored or changed. When an AI agent both writes the code and the tests in the same session, it may 'fix' unintended behavior the business actually depends on, so the behavior should be pinned down by a separate pass or a person before the agent starts working. Teams weighing agent-driven refactors can compare approaches to legacy testing discipline on daily.dev."}},{"@type":"Question","name":"How did Bun's team manage the Zig-to-Rust rewrite of their 535,000-line codebase using AI agents?","acceptedAnswer":{"@type":"Answer","text":"Bun's team ran roughly 50 agent workflows over 11 days, using two adversarial reviewers on every generated unit and the entire pre-existing test suite as the merge gate. Before any agent ran, the team spent hours writing a porting guide mapping Zig idioms to Rust, which is considered the most transferable part of the process for other large-scale agent migrations. Engineers planning a large agent-assisted rewrite can weigh this migration structure via daily.dev."}},{"@type":"Question","name":"What did the SWE Refactor Bench study find about AI agents completing code migrations?","acceptedAnswer":{"@type":"Answer","text":"Across 520 agent runs on migration tasks, only 28 passed the full audit combining migration completeness, behavioral tests, and independent verification. The study identified a failure pattern called migration 'blindness,' where tests stay green even though a supposedly replaced code path still calls the old legacy implementation underneath. Anyone auditing agent-driven migrations for hidden legacy dependencies can track findings like this on daily.dev."}}]}
```

