<?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: Hoang Nguyen Bang</title>
    <description>The latest articles on DEV Community by Hoang Nguyen Bang (@hoangnb).</description>
    <link>https://dev.to/hoangnb</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%2F3087052%2F917c4936-614a-4c61-b6f2-89229c0e1e7f.png</url>
      <title>DEV Community: Hoang Nguyen Bang</title>
      <link>https://dev.to/hoangnb</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hoangnb"/>
    <language>en</language>
    <item>
      <title>Why Coding Agents Need a Repository Harness (Not Just Better Prompts)</title>
      <dc:creator>Hoang Nguyen Bang</dc:creator>
      <pubDate>Tue, 02 Jun 2026 11:52:10 +0000</pubDate>
      <link>https://dev.to/hoangnb/why-coding-agents-need-a-repository-harness-not-just-better-prompts-e2p</link>
      <guid>https://dev.to/hoangnb/why-coding-agents-need-a-repository-harness-not-just-better-prompts-e2p</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftsc9hntsqnhdb29vsrjr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftsc9hntsqnhdb29vsrjr.png" alt="agent-between-repositories"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;The Problem&lt;/strong&gt;&lt;br&gt;
Coding agents are only as good as the context you give them.&lt;/p&gt;

&lt;p&gt;The better your prompt, the better the output. Most advice focuses on prompt engineering — clearer instructions, better few-shot examples, smarter questions. That all helps.&lt;/p&gt;

&lt;p&gt;But no matter how good your prompt is, there's a ceiling — because the repository itself is missing the context the agent needs.&lt;/p&gt;

&lt;p&gt;When a human joins a new project, they get a briefing: product intent, architecture decisions, what "done" looks like, team conventions, what not to touch, who to ask when stuck. They might get a doc, a walkthrough, a Slack thread from six months ago — but they get something.&lt;/p&gt;

&lt;p&gt;When a coding agent joins a project, it gets a task description and a pile of files.&lt;/p&gt;

&lt;p&gt;The result is predictable: agents make assumptions. They ship something that technically works but breaks a caching layer they didn't know existed. They undo an architectural decision without understanding why it was made. They write tests that don't match what the team actually considers solid work. You spend more time reviewing and fixing than if you'd just done it yourself.&lt;/p&gt;

&lt;p&gt;This isn't a model problem. It's a repository problem.&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;The Five-Layer Context Stack&lt;/strong&gt;&lt;br&gt;
Every coding context sits on a stack:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Layer 1 — Task prompt        What to do right now
Layer 2 — Session context   What was already decided this session
Layer 3 — Repo instructions What the repo knows about itself
Layer 4 — Decision history  Why things are the way they are
Layer 5 — Validation        What "good enough" looks like
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Most repositories only have Layer 1. The agent's session provides Layer 2. But Layers 3, 4, and 5 — the repo-level context that took years to accumulate — are invisible to the agent.&lt;/p&gt;

&lt;p&gt;This is why the same agent that writes clean, thoughtful code in one project produces awkward, context-blind work in another. The model didn't change. The repo did.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;The Solution: A Repository Harness&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A repository harness fills the missing layers. It's not a framework or a library. It's a structured layer of repo-level instructions — files that agents can read, right alongside the code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AGENTS.md&lt;/strong&gt; — What kind of project this is, where to start, who to ask. Think of it as the agent's first-day briefing, always available.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Feature intake&lt;/strong&gt; — Classify work by risk before touching production. Is this a quick patch or a structural change? Does it need a design discussion first?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Architecture discovery&lt;/strong&gt; — What the modules are, what the contracts between them are, what data flows where. The agent stops treating the codebase as undifferentiated text.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Test matrices&lt;/strong&gt; — Not just "do the tests pass" but "what does solid look like for this kind of change?" Different work has different standards.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Decision records&lt;/strong&gt; — Why previous choices were made. The context that lives in the lead developer's head, written down and made permanent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Story packets&lt;/strong&gt; — Story-sized units that fit the team's review bandwidth. The agent stops generating three-week PRs no reviewer wants to touch.&lt;/p&gt;

&lt;p&gt;The goal isn't more agent autonomy. The goal is inspectable AI-assisted work: humans still steer, agents have enough context to make good decisions independently.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;It Works With Any Agent&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Claude Code, Codex, Cursor — any agent that reads files benefits from a repo that knows how to brief itself. You don't change the agent. You change the repository.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Try It&lt;/strong&gt;&lt;br&gt;
If you're running coding agents on your own repos, you already know what I'm describing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/hoangnb24/repository-harness" rel="noopener noreferrer"&gt;repository-harness&lt;/a&gt; is a starting point — fork it and adapt the pattern to your project.&lt;/p&gt;

&lt;p&gt;What context do you wish your agents had?&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>opensource</category>
      <category>devtools</category>
    </item>
  </channel>
</rss>
