<?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: Đạt Nguyễn Thành</title>
    <description>The latest articles on DEV Community by Đạt Nguyễn Thành (@datnguyendevai).</description>
    <link>https://dev.to/datnguyendevai</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4051066%2Ff4acb3ae-30b3-46fa-841d-9caacdfcf97d.jpg</url>
      <title>DEV Community: Đạt Nguyễn Thành</title>
      <link>https://dev.to/datnguyendevai</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/datnguyendevai"/>
    <language>en</language>
    <item>
      <title>Your AI coding agent doesn't need better prompts. It needs a harness.</title>
      <dc:creator>Đạt Nguyễn Thành</dc:creator>
      <pubDate>Fri, 31 Jul 2026 03:48:31 +0000</pubDate>
      <link>https://dev.to/datnguyendevai/your-ai-coding-agent-doesnt-need-better-prompts-it-needs-a-harness-5al3</link>
      <guid>https://dev.to/datnguyendevai/your-ai-coding-agent-doesnt-need-better-prompts-it-needs-a-harness-5al3</guid>
      <description>&lt;p&gt;I've spent the last year running AI coding agents (Claude Code, Cursor) against real, boring, enterprise-grade codebases — the kind with specs, reviewers, and consequences. Here's the uncomfortable summary:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The model was almost never the problem. The missing structure around it was.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Three failures that will find you
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. The agent asserts wishes, not behavior.&lt;/strong&gt;&lt;br&gt;
Ask an agent to "fix the failing test" and watch closely. Sometimes it fixes the code. Sometimes it edits the &lt;em&gt;test&lt;/em&gt; until it passes — and writes a confident commit message about it. Under deadline-style pressure ("the stakeholder says this is a bug"), agents will happily change production behavior and assert the new behavior as if it were always the spec.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Requirements silently evaporate.&lt;/strong&gt;&lt;br&gt;
Your spec has 12 rules. The generated code implements 9. Nothing fails, nothing warns. Humans do this too — but a human reviewer at least &lt;em&gt;knows&lt;/em&gt; the spec exists. An agent that read the spec 40 minutes of context ago effectively hasn't read it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Scope creep you can't review.&lt;/strong&gt;&lt;br&gt;
You asked for one field. You got a nine-file refactor with renamed variables. Each individual change is defensible; the diff as a whole is unreviewable. That's how trust dies.&lt;/p&gt;

&lt;h2&gt;
  
  
  What actually worked
&lt;/h2&gt;

&lt;p&gt;Not better prompting. &lt;strong&gt;Mechanical discipline&lt;/strong&gt; — the same thing that works for human teams, encoded so the agent can't skip it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Role separation.&lt;/strong&gt; One agent derives requirements from the spec and writes failing tests. A &lt;em&gt;different&lt;/em&gt; agent implements. A third reviews. The implementer never gets to decide what "done" means.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A coverage gate that computes, not vibes.&lt;/strong&gt; Every requirement gets a stable ID (&lt;code&gt;[REQ-7]&lt;/code&gt;). Tests are tagged with the IDs they cover. A dumb script cross-references them and &lt;strong&gt;fails CI if any requirement has no test&lt;/strong&gt;. No judgment calls, no "looks complete to me."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Spec → red test → code, enforced by templates.&lt;/strong&gt; The order isn't a suggestion in a prompt — it's the folder structure and the workflow files the agent operates in.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A pitfall list with teeth.&lt;/strong&gt; Every failure we hit became a named rule the reviewer agent checks for. Example: spec rows deleted with strikethrough in Excel got silently converted to "active requirements" by a naive converter — the fix is a formatting-aware conversion rule, not a smarter prompt.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The result
&lt;/h2&gt;

&lt;p&gt;The agent got &lt;em&gt;more&lt;/em&gt; useful as we trusted it with more, because every increase in autonomy was matched by a gate that would catch the failure mode we feared. That's the whole trick: &lt;strong&gt;autonomy is earned by gates, not by model upgrades.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;I'm packaging this whole setup — the subagent harness, the CI gates, the spec-driven templates, a runnable demo repo, and the pitfall handbook — into a kit you can drop into your own repo: &lt;strong&gt;SpecGate Kit&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It's &lt;strong&gt;$49&lt;/strong&gt;, instant download, 14-day refund: &lt;a href="https://datnguyendevai.gumroad.com/l/specgate-kit" rel="noopener noreferrer"&gt;https://datnguyendevai.gumroad.com/l/specgate-kit&lt;/a&gt;&lt;br&gt;
The demo repo is public if you just want to see the workflow: &lt;a href="https://github.com/datnguyen-dev-ai/spec-driven-ai-pipeline-demo" rel="noopener noreferrer"&gt;https://github.com/datnguyen-dev-ai/spec-driven-ai-pipeline-demo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Questions about the approach? Ask below — the pitfall stories have plenty more where that came from.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>productivity</category>
      <category>claude</category>
    </item>
  </channel>
</rss>
