<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Loracle - Make your design system AI-native]]></title><description><![CDATA[Loracle - Make your design system AI-native]]></description><link>https://blog.getloracle.com</link><image><url>https://cdn.hashnode.com/uploads/logos/69ecbebe17d72fa4cd8d391f/e9fc7191-853e-4286-bc7d-bf622c1df333.png</url><title>Loracle - Make your design system AI-native</title><link>https://blog.getloracle.com</link></image><generator>RSS for Node</generator><lastBuildDate>Sat, 25 Apr 2026 22:43:56 GMT</lastBuildDate><atom:link href="https://blog.getloracle.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Your coding agent reads forty files and still picks the wrong component]]></title><description><![CDATA[Component discovery is an information problem, not a prompting problem.

You hand Claude Code a ticket: build the confirmation modal for the delete-account flow. Straightforward work. Two minutes of t]]></description><link>https://blog.getloracle.com/your-coding-agent-reads-forty-files-and-still-picks-the-wrong-component</link><guid isPermaLink="true">https://blog.getloracle.com/your-coding-agent-reads-forty-files-and-still-picks-the-wrong-component</guid><dc:creator><![CDATA[Loracle]]></dc:creator><pubDate>Sat, 25 Apr 2026 20:25:36 GMT</pubDate><content:encoded><![CDATA[<p><em>Component discovery is an information problem, not a prompting problem.</em></p>
<hr />
<p>You hand Claude Code a ticket: build the confirmation modal for the delete-account flow. Straightforward work. Two minutes of thinking, maybe fifty lines of code.</p>
<p>Before it writes any of them, the agent goes spelunking through your repo.</p>
<p>It opens <code>package.json</code>. It finds <code>@acme/ui</code>. It globs the dist directory and sees forty-odd files. It reads the barrel export to figure out what the library actually ships. Then it starts opening component files, one by one, trying to piece together a mental model of a system you spent eighteen months building. Eventually it picks something, writes the feature, and hands you a PR.</p>
<p>That PR uses the wrong component.</p>
<p>This is the shape of almost every agent session that touches an unfamiliar design system. I want to walk through exactly what's happening — and why the agent, despite doing reasonable work, is nearly guaranteed to arrive at a guess.</p>
<h3>The walkthrough</h3>
<p>Here's a realistic trace. The agent has Read, Glob, and Grep. It has the ticket. It has no prior knowledge of your library.</p>
<p><strong>Step 1.</strong> It reads <code>package.json</code> and spots <code>@acme/ui</code> in the dependencies.</p>
<p><strong>Step 2.</strong> It globs <code>node_modules/@acme/ui/dist</code> — or <code>src/ui/</code>, depending on where your library lives — and gets back a list of forty files. That list is now in the context window.</p>
<p><strong>Step 3.</strong> It reads the barrel <code>index.ts</code> to learn what's exported. Good instinct. This is how a new engineer would orient themselves too.</p>
<p><strong>Step 4.</strong> The barrel reveals a problem. The library exports <code>Dialog</code>, <code>Modal</code>, <code>AlertDialog</code>, and <code>ConfirmDialog</code>. Four things that all sound like they might do what the ticket asks for.</p>
<p><strong>Step 5.</strong> The agent opens all four files. It reads the props. It reads the TypeScript signatures. It notices that <code>Dialog</code> is the lowest-level primitive, <code>Modal</code> wraps <code>Dialog</code> with a portal, <code>AlertDialog</code> adds a specific focus-trap behavior, and <code>ConfirmDialog</code> is a convenience wrapper with an opinionated button layout.</p>
<p><strong>Step 6.</strong> If you have Storybook stories colocated with your components — and if the agent happens to find them — it reads a few of those too. Another five to ten files worth of context.</p>
<p><strong>Step 7.</strong> It picks one. Usually <code>Dialog</code>, because it's the most generic and has the cleanest props. Or <code>ConfirmDialog</code>, because the name matches the ticket.</p>
<p>Your team's convention is <code>AlertDialog</code> for destructive actions. The reviewer asks for changes. The next ticket starts from scratch.</p>
<h3>The part nobody talks about</h3>
<p>Here's what I want to draw your attention to, because it's the step the "just give the agent better tools" crowd keeps missing.</p>
<p>After step 5, the agent knows the props of every dialog in the library. It knows their file paths, their export names, their type signatures, their internal composition. It has read the code thoroughly.</p>
<p>It still doesn't know which one to pick.</p>
<p>Because the thing that makes <code>AlertDialog</code> the right answer for destructive actions isn't in <code>AlertDialog.tsx</code>. It isn't in the barrel export. It isn't in the TypeScript. It's in a Figma frame somewhere, or a sentence in a Notion doc, or the design system lead's head, or a convention that emerged organically from three PRs eighteen months ago and became tribal knowledge.</p>
<p>The agent can read every file in your repo and still not find it — because the file doesn't exist.</p>
<p>More tool calls don't fix this. A better prompt doesn't fix this. A more thorough <a href="http://AGENTS.md">AGENTS.md</a> helps a little, until your library has sixty components and the rules file becomes its own context-window problem. The ceiling is set by what's in the files, and what's in the files isn't enough.</p>
<p>This is why the session ends in a guess. Not because the agent is lazy. Because it's searching a corpus that doesn't contain the answer.</p>
<h3>Three things going wrong at once</h3>
<p>It's worth naming each one, because they compound.</p>
<p><strong>The context window is full of the wrong thing.</strong> By the time the agent is ready to write the feature, most of its context is component source code. Everything downstream — the plan, the implementation, the self-review — happens with a working memory that's mostly noise. You're paying tokens to degrade the output.</p>
<p><strong>The information isn't there to find.</strong> What a component looks like when rendered, when to use it, which of four near-synonyms the team prefers — none of that is reliably encoded in the source. The agent is excavating a site that doesn't contain the artifact.</p>
<p><strong>It happens every session.</strong> Agents don't remember across tasks. The next ticket that touches <code>@acme/ui</code> starts the same archaeology from the same blank slate. Multiply by every engineer, every day.</p>
<p>You end up with a workflow where most of the agent's effort on design-system work goes into rediscovering the design system, and the actual feature gets built with whatever context window is left over.</p>
<h3>This is a retrieval problem</h3>
<p>Notice what changed when I described the problem that way. It stopped being about the agent and started being about the index.</p>
<p>The agent is doing fine. Reading files and pattern-matching on names is the right strategy when the filesystem is all you have. The failure isn't in the search; it's in the corpus. If you want the agent to pick the right component on the first try, you need an index that contains the information the filesystem doesn't — appearance, intent, convention, the relationships between components that only become visible when you've seen the whole library at once.</p>
<p>We built Loracle because we kept watching this exact session play out.</p>
<p>The CLI points at your running Storybook and renders every story. It captures the rendered appearance of each component, the args and controls that define its variants, the docs and usage examples from your MDX, and the structural relationships across the library. That catalog gets published to Loracle and exposed to your agent over MCP.</p>
<p>Back to the ticket. With Loracle wired in, the session looks different:</p>
<pre><code class="language-plaintext">get_components({
  intent: "confirmation dialog for a destructive action"
})
</code></pre>
<p>One call. The response names <code>AlertDialog</code> — and more importantly, it returns the exact props and values that produce a destructive confirmation: which variant to set, what to pass for the action button, which slot holds the description. Not a link to the docs. Not a generic usage example. The specific configuration that achieves the result the agent was asked for. The agent writes the feature. The PR uses the component the team was going to ask for anyway.</p>
<p>The reason one call is enough isn't magic, and it isn't a clever prompt. It's that the index contains what the filesystem doesn't. Rendered appearance, captured from the real Storybook. Usage patterns, captured from stories written by people who know the library — which means Loracle knows not just that <code>AlertDialog</code> exists, but what props and values produce a destructive confirmation, a permission prompt, or an unsaved-changes warning. Cross-component context, captured because the whole library was indexed together. The agent stops guessing because it stops being asked to guess.</p>
<h3>The job the agent was hired to do</h3>
<p>Your agent's job is to build the feature. Not to rediscover your design system every morning, not to read forty files to answer a question the files can't answer, not to ship PRs that get bounced because a naming collision sent it down the wrong path.</p>
<p>Give it an index that knows the answer. Let it ask.</p>
<p><a href="https://docs.getloracle.com">Docs →</a></p>
]]></content:encoded></item></channel></rss>