<?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: shawbuilds</title>
    <description>The latest articles on DEV Community by shawbuilds (@shnuxjt).</description>
    <link>https://dev.to/shnuxjt</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%2F4101164%2F8157d2cf-0b83-419a-a0c3-d7653a71080d.png</url>
      <title>DEV Community: shawbuilds</title>
      <link>https://dev.to/shnuxjt</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shnuxjt"/>
    <language>en</language>
    <item>
      <title>Do More Rules Make a Coding Agent Better? An Experiment on a Real Industrial RAG Frontend</title>
      <dc:creator>shawbuilds</dc:creator>
      <pubDate>Sun, 30 Aug 2026 08:57:39 +0000</pubDate>
      <link>https://dev.to/shnuxjt/do-more-rules-make-a-coding-agent-better-an-experiment-on-a-real-industrial-rag-frontend-2j3m</link>
      <guid>https://dev.to/shnuxjt/do-more-rules-make-a-coding-agent-better-an-experiment-on-a-real-industrial-rag-frontend-2j3m</guid>
      <description>&lt;p&gt;Lately I've been using Coding Agents more and more frequently.&lt;/p&gt;

&lt;p&gt;It started with:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Help me write a component."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And gradually became:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Help me analyze the entire project, find the problems, and fix them."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;At the same time, we've started stuffing more and more context into the Agent:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;AGENTS.md&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Project Rules&lt;/li&gt;
&lt;li&gt;Skills&lt;/li&gt;
&lt;li&gt;MCP&lt;/li&gt;
&lt;li&gt;Memory&lt;/li&gt;
&lt;li&gt;All kinds of Coding Guidances&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And a question naturally follows:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Does any of this context actually improve a Coding Agent's engineering capability?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Rules, in particular — &lt;strong&gt;the more rules you give it, the stronger the Agent becomes?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So I ran an experiment.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Subject: An Industrial RAG Frontend
&lt;/h2&gt;

&lt;p&gt;The experiment was run on a real, in-development industrial knowledge-base RAG frontend project. The stack:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Next.js 16.3.2&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;React 19&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tailwind 4&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;base-ui&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Coding Agent setup:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Model:&lt;/strong&gt; deepseek-v4-pro&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Harness:&lt;/strong&gt; DSH&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Skills:&lt;/strong&gt; None&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MCP:&lt;/strong&gt; None&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To control variables, every run started from the &lt;strong&gt;same repository commit&lt;/strong&gt;, and the backend API contract was never modified during the experiment.&lt;/p&gt;

&lt;h3&gt;
  
  
  What I Actually Asked the Agent to Do
&lt;/h3&gt;

&lt;p&gt;The task was simple:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Optimize streaming message handling so the UI updates more efficiently during long answers. Do not modify the backend API. Preserve existing capabilities and UI behavior. Final result must pass &lt;code&gt;lint&lt;/code&gt; + &lt;code&gt;build&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is &lt;strong&gt;not&lt;/strong&gt; telling the Agent:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Change function B in file A."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Instead, I gave it an engineering goal and expected it to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Understand the code
      ↓
Locate the problem
      ↓
Choose a solution
      ↓
Modify the code
      ↓
Validate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can also observe whether the Agent can complete a full engineering loop on its own.&lt;/p&gt;




&lt;h2&gt;
  
  
  Phase 1: No Rules vs. &lt;code&gt;AGENTS.md&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;I ran three groups. The only variable was Rules.&lt;/p&gt;

&lt;h3&gt;
  
  
  Experiment A: No Rules
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Rules:&lt;/strong&gt; None&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Skills:&lt;/strong&gt; None&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MCP:&lt;/strong&gt; None&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Results:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Time:&lt;/strong&gt; ~6 min&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tool Calls:&lt;/strong&gt; 27&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Wrong Turns:&lt;/strong&gt; 0&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Human Intervention:&lt;/strong&gt; 0&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Agent found two main problems:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Problem 1 — The streaming hot path causes unrelated components to re-reconcile.&lt;/strong&gt;&lt;br&gt;
Streaming answers flush every ~80 ms, and components like &lt;code&gt;Header&lt;/code&gt; / &lt;code&gt;MessageInput&lt;/code&gt; — which don't actually depend on message content — get dragged into every update.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Problem 2 — Write amplification on the send path.&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;handleSend&lt;/code&gt; calls &lt;code&gt;appendMessage&lt;/code&gt; twice in a row, causing unnecessary storage / state updates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Outcome:&lt;/strong&gt; Both problems fixed. &lt;code&gt;lint&lt;/code&gt; and &lt;code&gt;build&lt;/code&gt; both pass.&lt;/p&gt;
&lt;h3&gt;
  
  
  Experiment B: Add &lt;code&gt;AGENTS.md&lt;/code&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Rules:&lt;/strong&gt; &lt;code&gt;AGENTS.md&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Skills:&lt;/strong&gt; None&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MCP:&lt;/strong&gt; None&lt;/li&gt;
&lt;li&gt;Everything else unchanged.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Results:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Time:&lt;/strong&gt; ~4 min&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tool Calls:&lt;/strong&gt; 23&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Wrong Turns:&lt;/strong&gt; 0&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Human Intervention:&lt;/strong&gt; 0&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The problems the Agent found were essentially identical. Final code quality, regressions, and acceptance showed no meaningful difference.&lt;/p&gt;
&lt;h3&gt;
  
  
  Then Add 5 Project Rules
&lt;/h3&gt;

&lt;p&gt;I decided to keep adding constraints. The rules were very simple:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Understand the existing code before modifying it.&lt;/li&gt;
&lt;li&gt;Do not modify the backend API.&lt;/li&gt;
&lt;li&gt;Prefer reusing existing patterns.&lt;/li&gt;
&lt;li&gt;Minimize changes.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;lint&lt;/code&gt; + &lt;code&gt;build&lt;/code&gt; at the end.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Results:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Time:&lt;/strong&gt; ~3 min&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tool Calls:&lt;/strong&gt; 21&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Wrong Turns:&lt;/strong&gt; 0&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Human Intervention:&lt;/strong&gt; 0&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Side-by-Side
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;No Rules
6 min / 27 calls
      ↓
AGENTS.md
4 min / 23 calls
      ↓
AGENTS.md + 5 Rules
3 min / 21 calls
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;So far, the picture is clear: &lt;strong&gt;the more Rules, the more efficient the Coding Agent.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;But the next set of experiments seems to contradict that. Let's look at Phase 2.&lt;/p&gt;


&lt;h2&gt;
  
  
  Phase 2: The Effect of Rule Count
&lt;/h2&gt;

&lt;p&gt;This time I stopped comparing "rules vs. no rules" and directly tested:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;How many rules is the right amount?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I set up:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;0 Rules&lt;/li&gt;
&lt;li&gt;3 Rules&lt;/li&gt;
&lt;li&gt;5 Rules&lt;/li&gt;
&lt;li&gt;10 Rules&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything else (task, commit, model, harness, skills, MCP) stayed constant.&lt;/p&gt;

&lt;p&gt;The results were very interesting:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Rules&lt;/th&gt;
&lt;th&gt;Time&lt;/th&gt;
&lt;th&gt;Tool Calls&lt;/th&gt;
&lt;th&gt;Files Changed&lt;/th&gt;
&lt;th&gt;Code Quality&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;~3 min&lt;/td&gt;
&lt;td&gt;21&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;~3 min&lt;/td&gt;
&lt;td&gt;22&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;~3 min&lt;/td&gt;
&lt;td&gt;22&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;td&gt;~3 min&lt;/td&gt;
&lt;td&gt;22&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The four groups are almost a flat line.&lt;/p&gt;

&lt;p&gt;And it wasn't just the time. Across all four runs, the Agent:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Found the &lt;strong&gt;same two problems&lt;/strong&gt;;&lt;/li&gt;
&lt;li&gt;Modified the &lt;strong&gt;same 4 files&lt;/strong&gt;;&lt;/li&gt;
&lt;li&gt;Produced a diff of exactly &lt;strong&gt;+43 / −14&lt;/strong&gt;;&lt;/li&gt;
&lt;li&gt;Passed &lt;code&gt;lint&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;Passed &lt;code&gt;build&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;Had &lt;strong&gt;no regressions&lt;/strong&gt;;&lt;/li&gt;
&lt;li&gt;Required &lt;strong&gt;no human intervention&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  So… Are More Rules Better?
&lt;/h3&gt;

&lt;p&gt;The current data does &lt;strong&gt;not&lt;/strong&gt; support that conclusion.&lt;/p&gt;

&lt;p&gt;In fact, quite the opposite — on this task:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0 Rules
   ↓
3 Rules
   ↓
5 Rules
   ↓
10 Rules
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Increasing rules produced &lt;strong&gt;no observable performance gain&lt;/strong&gt;. The Agent's problem-discovery ability barely changed, and the final solutions were highly convergent.&lt;/p&gt;

&lt;p&gt;In other words:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;For an engineering task with a clear goal and a narrow solution space, the Agent probably doesn't need many rules at all.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Then When Are Rules Useful?
&lt;/h2&gt;

&lt;p&gt;I got curious. My working hypothesis:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The value of Rules likely depends on task complexity.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For a task like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Optimize a specific feature
      ↓
Problem space is well-defined
      ↓
Solutions are concentrated
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the Agent easily finds the right path. In that case, Rules have &lt;strong&gt;very low marginal returns&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;But if the task becomes:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Autonomously analyze the entire industrial RAG frontend — across performance, architecture, state management, UX, error handling, and maintainability — find the most worthwhile problems, and optimize them reasonably."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;the situation could be completely different. The Agent's decision space expands dramatically:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Performance?&lt;/li&gt;
&lt;li&gt;Architecture?&lt;/li&gt;
&lt;li&gt;State management?&lt;/li&gt;
&lt;li&gt;Caching?&lt;/li&gt;
&lt;li&gt;UX?&lt;/li&gt;
&lt;li&gt;Error handling?&lt;/li&gt;
&lt;li&gt;Component design?&lt;/li&gt;
&lt;li&gt;Data layer?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At that point, whether Rules can help the Agent &lt;strong&gt;narrow its search space&lt;/strong&gt; becomes a very worthwhile question.&lt;/p&gt;




&lt;h2&gt;
  
  
  One Experimental Caveat
&lt;/h2&gt;

&lt;p&gt;There's a methodological pitfall worth calling out.&lt;/p&gt;

&lt;p&gt;These experiments were run &lt;strong&gt;sequentially in the same session&lt;/strong&gt;, and the earlier runs had already led the Agent toward a similar solution. So the later runs suffer from &lt;strong&gt;priming contamination&lt;/strong&gt; — meaning:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"0 Rules" does &lt;strong&gt;not&lt;/strong&gt; mean "the Agent knows nothing about the project."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So this experiment supports:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Under these experimental conditions, adding 3 / 5 / 10 Rules produced no significant additional benefit.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But it does &lt;strong&gt;not&lt;/strong&gt; support the stronger claim:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;There is no relationship between the number of Rules and Agent performance.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That distinction matters.&lt;/p&gt;




&lt;h2&gt;
  
  
  One Observation I Find Interesting
&lt;/h2&gt;

&lt;p&gt;Abstract the whole experiment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Agent Performance
│
├── Problem Discovery
│
├── Planning
│
├── Execution
│
└── Validation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The current results seem to tell us:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Rules may not make the Agent discover &lt;strong&gt;more&lt;/strong&gt; problems.&lt;/p&gt;

&lt;p&gt;Instead, they may influence &lt;strong&gt;how&lt;/strong&gt; the Agent arrives at a solution.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Rules may not be an Intelligence Booster — they may be a Search-Space Reducer.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is currently a research hypothesis, not a proven conclusion. But I think it's well worth testing further.&lt;/p&gt;

&lt;p&gt;More exploration is left for the next experiment. For now, here's the summary:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Coding Agents can already autonomously complete a full loop on a real frontend project&lt;/strong&gt; — code understanding → problem localization → modification → &lt;code&gt;lint&lt;/code&gt; → &lt;code&gt;build&lt;/code&gt; — with no human intervention.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;In the first fixed-condition experiment, adding &lt;code&gt;AGENTS.md&lt;/code&gt; / Project Rules produced a clear drop in time and tool calls.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;But further increasing Rules — from 0 → 3 → 5 → 10 — produced no significant additional benefit in the second experiment.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Therefore, the value of Rules is probably not simply "more is better."&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>llm</category>
      <category>softwareengineering</category>
    </item>
  </channel>
</rss>
