<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Rafael Tedesco</title>
    <description>The latest articles on DEV Community by Rafael Tedesco (@rafaeltedesco).</description>
    <link>https://dev.to/rafaeltedesco</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F826016%2F54973602-a560-4baa-b6ed-f8654db5904a.JPG</url>
      <title>DEV Community: Rafael Tedesco</title>
      <link>https://dev.to/rafaeltedesco</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rafaeltedesco"/>
    <language>en</language>
    <item>
      <title>Modernizing Legacy Systems Using Agent Harnesses TDD and the Seam Model</title>
      <dc:creator>Rafael Tedesco</dc:creator>
      <pubDate>Fri, 08 May 2026 23:08:16 +0000</pubDate>
      <link>https://dev.to/rafaeltedesco/modernizing-legacy-systems-using-agent-harnesses-tdd-and-the-seam-model-1f96</link>
      <guid>https://dev.to/rafaeltedesco/modernizing-legacy-systems-using-agent-harnesses-tdd-and-the-seam-model-1f96</guid>
      <description>&lt;p&gt;Over the past few months, I’ve been investing a lot of time building agentic development workflows for real production environments.&lt;/p&gt;

&lt;p&gt;Not only prompts.&lt;/p&gt;

&lt;p&gt;Actual operational environments around agents.&lt;/p&gt;

&lt;p&gt;Things like skills, execution tooling, validation layers, testing flows, memory handling, Git integrations, and constrained execution paths.&lt;/p&gt;

&lt;p&gt;One thing became very clear very quickly.&lt;/p&gt;

&lt;p&gt;Using agents in legacy or mission critical systems without a proper harness can become dangerous surprisingly fast.&lt;/p&gt;

&lt;p&gt;Especially in financial systems.&lt;/p&gt;

&lt;p&gt;Even with specification driven development (SDD), detailed tasks, and explicit instructions, I noticed a recurring problem.&lt;/p&gt;

&lt;p&gt;The agent would correctly implement the requested functionality, but at the same time introduce large unintended changes across the codebase.&lt;/p&gt;

&lt;p&gt;Not because the model was “bad”.&lt;/p&gt;

&lt;p&gt;But because the environment still gave it too much freedom.&lt;/p&gt;

&lt;p&gt;A small business change could suddenly trigger a massive refactor in tightly coupled parts of the application.&lt;/p&gt;

&lt;p&gt;The functionality worked.&lt;/p&gt;

&lt;p&gt;But reviewing the pull request became painful.&lt;/p&gt;

&lt;p&gt;Risk analysis became harder.&lt;/p&gt;

&lt;p&gt;The blast radius became unpredictable.&lt;/p&gt;

&lt;p&gt;And in highly sensitive systems, this matters a lot.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Shift That Changed Everything
&lt;/h2&gt;

&lt;p&gt;To address this, I started combining a few ideas together:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;TDD&lt;/li&gt;
&lt;li&gt;Harness Engineering&lt;/li&gt;
&lt;li&gt;The Seam Model from Michael Feathers&lt;/li&gt;
&lt;li&gt;Constrained execution environments for agents&lt;/li&gt;
&lt;li&gt;This changed the workflow completely.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of letting the agent freely reshape large parts of the codebase, I started designing the environment to naturally constrain behavior.&lt;/p&gt;

&lt;p&gt;The agent now operates through a harness I built around it.&lt;/p&gt;

&lt;p&gt;This harness provides structured skills and controlled capabilities such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reading specific files&lt;/li&gt;
&lt;li&gt;Analyzing code diffs&lt;/li&gt;
&lt;li&gt;Running tests incrementally&lt;/li&gt;
&lt;li&gt;Validating architectural constraints&lt;/li&gt;
&lt;li&gt;Checking impacted dependencies&lt;/li&gt;
&lt;li&gt;Generating isolated implementations&lt;/li&gt;
&lt;li&gt;Blocking risky operations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One of the biggest improvements came from applying the Seam Model mindset.&lt;/p&gt;

&lt;p&gt;“A seam is a place where you can alter behavior in your program without editing in that place.”&lt;br&gt;
— Michael Feathers, Working Effectively with Legacy Code&lt;/p&gt;

&lt;p&gt;Instead of modifying deeply coupled code directly, the agent identifies stable seams where behavior can be isolated safely.&lt;/p&gt;

&lt;p&gt;Then new functionality gets introduced incrementally behind those seams.&lt;/p&gt;

&lt;p&gt;This dramatically reduces unintended side effects.&lt;/p&gt;

&lt;h2&gt;
  
  
  Critique and Validation Skills
&lt;/h2&gt;

&lt;p&gt;Another important part of the harness is the critique and validation layer.&lt;/p&gt;

&lt;p&gt;The agent is not only responsible for generating code.&lt;/p&gt;

&lt;p&gt;It also needs to review its own changes against explicit acceptance criteria and architectural constraints.&lt;/p&gt;

&lt;p&gt;I created specialized skills focused on critique workflows, where the agent analyzes the generated diff and verifies things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Did the implementation fully satisfy the acceptance criteria?&lt;/li&gt;
&lt;li&gt;Did the agent modify unrelated modules?&lt;/li&gt;
&lt;li&gt;Did it introduce unnecessary refactors?&lt;/li&gt;
&lt;li&gt;Did it violate architectural boundaries?&lt;/li&gt;
&lt;li&gt;Did it expand the blast radius beyond the intended scope?&lt;/li&gt;
&lt;li&gt;This changes the workflow significantly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of treating code generation as the final step, generation becomes only one phase inside a larger controlled execution pipeline.&lt;/p&gt;

&lt;p&gt;In practice, this dramatically improves reviewability and reduces the risk of unintended modifications in legacy or mission critical systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  Practical Example
&lt;/h2&gt;

&lt;p&gt;Imagine a legacy financial reconciliation service.&lt;/p&gt;

&lt;p&gt;A new business rule needs to be introduced into the settlement calculation flow.&lt;/p&gt;

&lt;p&gt;Without constraints, the agent might attempt to “improve” the architecture while implementing the feature.&lt;/p&gt;

&lt;p&gt;Suddenly:&lt;/p&gt;

&lt;p&gt;Shared abstractions get rewritten&lt;br&gt;
Core flows get reorganized&lt;br&gt;
Multiple services are refactored together&lt;br&gt;
Dozens of unrelated files change&lt;/p&gt;

&lt;p&gt;Technically impressive.&lt;/p&gt;

&lt;p&gt;Operationally dangerous.&lt;/p&gt;

&lt;p&gt;With the harnessed approach, the flow becomes very different.&lt;/p&gt;

&lt;p&gt;The agent:&lt;/p&gt;

&lt;p&gt;Identifies stable seams in the codebase&lt;br&gt;
Creates isolated extension points&lt;br&gt;
Implements behavior incrementally&lt;br&gt;
Runs targeted tests after every step&lt;br&gt;
Validates architectural boundaries&lt;br&gt;
Restricts modifications outside approved scopes&lt;br&gt;
Critiques its own generated diff against acceptance criteria&lt;/p&gt;

&lt;p&gt;The final result is much smaller, easier to review, safer to deploy, and significantly more predictable.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Most Interesting Part
&lt;/h2&gt;

&lt;p&gt;What surprised me most is that the value was not only personal productivity.&lt;/p&gt;

&lt;p&gt;The biggest impact came after I shared these agents, skills, and harness environments with the engineering teams I lead.&lt;/p&gt;

&lt;p&gt;Now the entire team benefits from the same operational guardrails.&lt;/p&gt;

&lt;p&gt;Developers can leverage the toolkit to:&lt;/p&gt;

&lt;p&gt;Reduce risky refactors&lt;br&gt;
Improve reviewability&lt;br&gt;
Increase delivery confidence&lt;br&gt;
Work more safely in legacy systems&lt;br&gt;
Move faster without increasing instability&lt;/p&gt;

&lt;p&gt;This starts creating organizational leverage, not just individual acceleration.&lt;/p&gt;

&lt;p&gt;And honestly, this is where I believe a huge part of software engineering is heading.&lt;/p&gt;

&lt;p&gt;The conversation is moving far beyond prompt engineering.&lt;/p&gt;

&lt;p&gt;The real challenge is designing reliable operational environments where agents can safely participate in software delivery pipelines.&lt;/p&gt;

&lt;p&gt;Especially in systems where reliability matters more than raw speed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;I don’t think agents replace engineering discipline.&lt;/p&gt;

&lt;p&gt;Actually, I think they amplify the importance of it.&lt;/p&gt;

&lt;p&gt;The better the engineering foundations, the more powerful these systems become.&lt;/p&gt;

&lt;p&gt;TDD becomes more important.&lt;br&gt;
Architectural boundaries become more important.&lt;br&gt;
Observability becomes more important.&lt;br&gt;
Validation becomes more important.&lt;br&gt;
Harness design becomes more important.&lt;/p&gt;

&lt;p&gt;The model is only one part of the system.&lt;/p&gt;

&lt;p&gt;The environment around it is what determines whether the outcome is production ready or operational chaos.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>agentskills</category>
      <category>automation</category>
    </item>
  </channel>
</rss>
