<?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: Roi</title>
    <description>The latest articles on DEV Community by Roi (@roi_d95df0bf6e689c571b39a).</description>
    <link>https://dev.to/roi_d95df0bf6e689c571b39a</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%2F3192299%2F603f42d1-0e40-454c-bfc9-02cbaf948e3a.png</url>
      <title>DEV Community: Roi</title>
      <link>https://dev.to/roi_d95df0bf6e689c571b39a</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/roi_d95df0bf6e689c571b39a"/>
    <language>en</language>
    <item>
      <title>From Chatting with AI to Architecting a Prompt Framework</title>
      <dc:creator>Roi</dc:creator>
      <pubDate>Tue, 09 Dec 2025 20:12:22 +0000</pubDate>
      <link>https://dev.to/roi_d95df0bf6e689c571b39a/from-chatting-with-ai-to-architecting-it-5a9k</link>
      <guid>https://dev.to/roi_d95df0bf6e689c571b39a/from-chatting-with-ai-to-architecting-it-5a9k</guid>
      <description>&lt;h2&gt;
  
  
  Why I stopped prompting for code and started treating AI as a system
&lt;/h2&gt;

&lt;p&gt;We’ve all been there.&lt;/p&gt;

&lt;p&gt;You ask your AI coding assistant to build a simple component.&lt;/p&gt;

&lt;p&gt;The code generates instantly. It looks clean. It runs without errors.&lt;/p&gt;

&lt;p&gt;But then you look closer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It introduced a new icon library we don’t use.
&lt;/li&gt;
&lt;li&gt;It ignored the project’s strict folder structure.
&lt;/li&gt;
&lt;li&gt;It hardcoded &lt;code&gt;20px&lt;/code&gt; padding instead of using the design system’s spacing scale.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What follows is usually a back-and-forth: nudging the model, refactoring the output, and correcting architectural drift.&lt;/p&gt;

&lt;p&gt;At some point it became clear to me that the issue wasn’t code quality.&lt;/p&gt;

&lt;p&gt;It was &lt;strong&gt;context&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The AI behaves like a highly capable junior developer who just joined the team:&lt;br&gt;&lt;br&gt;
it understands syntax, but not local conventions, constraints, or intent.&lt;/p&gt;

&lt;p&gt;Most attempts to fix this focus on “better prompts”.&lt;/p&gt;

&lt;p&gt;What proved more effective for me was a structural shift: treating AI interaction as a system design problem.&lt;/p&gt;




&lt;h2&gt;
  
  
  Building an AI “Operating System”
&lt;/h2&gt;

&lt;p&gt;Instead of using the AI as a conversational tool, I started treating it as a programmable engine.&lt;/p&gt;

&lt;p&gt;Inside the repository, I gradually introduced a file-based structure that governs how the AI behaves across different tasks.&lt;/p&gt;

&lt;p&gt;It doesn’t aim to be intelligent on its own.&lt;br&gt;&lt;br&gt;
It loads context explicitly.&lt;/p&gt;

&lt;p&gt;Some protocols are always available.&lt;br&gt;&lt;br&gt;
Others are loaded only when they provide clear value—primarily through &lt;code&gt;@plan&lt;/code&gt; or &lt;code&gt;@deep-think&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Over time, this evolved into a consistent working model.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. The Switchboard: A Single Entry Point
&lt;/h2&gt;

&lt;p&gt;One limitation of large system prompts is that they don’t scale well.&lt;/p&gt;

&lt;p&gt;As rules accumulate, behavior becomes harder to reason about.&lt;/p&gt;

&lt;p&gt;Instead of adding more instructions, I repurposed &lt;code&gt;copilot-instructions.md&lt;/code&gt;—a convention file provided by the tooling—as a routing layer.&lt;/p&gt;

&lt;p&gt;Functionally, it acts as a switchboard.&lt;/p&gt;

&lt;p&gt;It doesn’t contain rules.&lt;br&gt;&lt;br&gt;
It points to them.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“If the user types &lt;code&gt;@plan&lt;/code&gt;, load the Architecture Guidelines.&lt;br&gt;&lt;br&gt;
If they type &lt;code&gt;@ui-perfect&lt;/code&gt;, load the Design System rules.&lt;br&gt;&lt;br&gt;
If they type &lt;code&gt;@test&lt;/code&gt;, load the QA protocols.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Smaller prompts remain lightweight.&lt;br&gt;&lt;br&gt;
Complex tasks load additional context explicitly.&lt;/p&gt;

&lt;p&gt;This separation significantly reduced unpredictable behavior.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Deep Thinking as a Decision Step
&lt;/h2&gt;

&lt;p&gt;Directly asking an AI for a solution tends to produce common or generic patterns.&lt;/p&gt;

&lt;p&gt;For tasks involving trade-offs, I use a dedicated step: &lt;code&gt;@deep-think&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In this mode, the model is required to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Examine the problem from a system-level perspective
&lt;/li&gt;
&lt;li&gt;Propose multiple approaches
&lt;/li&gt;
&lt;li&gt;Make risks and constraints explicit
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To structure that reasoning, I use a simple traffic-light rubric:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🔴 &lt;strong&gt;BLOCKER&lt;/strong&gt; — conflicts with constraints or introduces clear risk
&lt;/li&gt;
&lt;li&gt;🟡 &lt;strong&gt;WARNING&lt;/strong&gt; — viable, but with notable trade-offs
&lt;/li&gt;
&lt;li&gt;🟢 &lt;strong&gt;OPTIMAL&lt;/strong&gt; — aligned, maintainable, and consistent with the system
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The value here isn’t the labels themselves, but the requirement to justify decisions before implementation.&lt;/p&gt;

&lt;p&gt;A key part of this step is &lt;strong&gt;“search before build”&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Before proposing new solutions, the model scans the existing codebase for patterns, utilities, and prior art.&lt;/p&gt;

&lt;p&gt;This consistently reduced duplication and divergence.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Governance as an Optional Layer
&lt;/h2&gt;

&lt;p&gt;For larger or long-lived features, I sometimes introduce explicit governance files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Architecture boundaries
&lt;/li&gt;
&lt;li&gt;Code style constraints
&lt;/li&gt;
&lt;li&gt;Known anti-patterns
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These files exist primarily to anchor AI behavior, not as human-facing documentation.&lt;/p&gt;

&lt;p&gt;They are intentionally opt-in.&lt;/p&gt;

&lt;p&gt;For smaller or exploratory work, I often skip them entirely.&lt;/p&gt;

&lt;p&gt;The goal is measurable leverage, not procedural overhead.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Separating Planning from Execution
&lt;/h2&gt;

&lt;p&gt;Another adjustment that proved useful was separating design from implementation.&lt;/p&gt;

&lt;p&gt;Rather than asking the AI to plan and build simultaneously, I split the process.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;@plan&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;This step produces a &lt;code&gt;PLAN.md&lt;/code&gt; document outlining:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Affected files
&lt;/li&gt;
&lt;li&gt;High-level data flow
&lt;/li&gt;
&lt;li&gt;Module boundaries and contracts
&lt;/li&gt;
&lt;li&gt;Testing considerations
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No code is generated.&lt;/p&gt;

&lt;p&gt;The plan can be reviewed and adjusted independently.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;@build&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Only after the plan is accepted do I run &lt;code&gt;@build&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;At that point, the AI treats the plan as a specification and implements it directly.&lt;/p&gt;

&lt;p&gt;This separation reduced unintended structural changes.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Handling UI Accuracy
&lt;/h2&gt;

&lt;p&gt;Visual accuracy remains an area where AI output is unreliable without guidance.&lt;/p&gt;

&lt;p&gt;When UI details matter, I use a dedicated &lt;code&gt;@ui-perfect&lt;/code&gt; step.&lt;/p&gt;

&lt;p&gt;The flow is straightforward:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Analyze&lt;/strong&gt; layout and spacing from the design
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Map&lt;/strong&gt; measurements to design-system tokens
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Implement&lt;/strong&gt; only after normalization
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This step isn’t universal, but when precision is required, separating analysis from implementation produces more consistent results.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. A Typical Flow
&lt;/h2&gt;

&lt;p&gt;A standard feature workflow now looks like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Run &lt;code&gt;@plan&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Review and refine &lt;code&gt;PLAN.md&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;@build&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Validate behavior
&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;@ui-perfect&lt;/code&gt; if visual precision matters
&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;@extract-concerns&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;@test&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The process itself isn’t complex.&lt;/p&gt;

&lt;p&gt;What changed was predictability.&lt;/p&gt;




&lt;h2&gt;
  
  
  Outcome
&lt;/h2&gt;

&lt;p&gt;This approach didn’t eliminate the need for judgment.&lt;/p&gt;

&lt;p&gt;What it changed was where that judgment is applied.&lt;/p&gt;

&lt;p&gt;Instead of correcting output after the fact, effort is invested upfront in defining the context in which output is produced.&lt;/p&gt;

&lt;p&gt;This isn’t presented as a general prescription.&lt;/p&gt;

&lt;p&gt;It’s simply the working style that emerged for me—and the one that brought AI output in line with production expectations.&lt;/p&gt;




&lt;h3&gt;
  
  
  Further reading
&lt;/h3&gt;

&lt;p&gt;The ideas described in this article are captured as a lightweight, practical framework here: &lt;a href="https://github.com/roiavidar/prompt-notes" rel="noopener noreferrer"&gt;prompt-notes&lt;/a&gt;&lt;/p&gt;

</description>
      <category>promptengineering</category>
      <category>ai</category>
      <category>productivity</category>
      <category>tooling</category>
    </item>
  </channel>
</rss>
