<?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>Forem: joygqz</title>
    <description>The latest articles on Forem by joygqz (@joygqz).</description>
    <link>https://forem.com/joygqz</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%2F3941208%2Ffd143ff3-ad8f-49ed-bedf-634264c8ec81.png</url>
      <title>Forem: joygqz</title>
      <link>https://forem.com/joygqz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/joygqz"/>
    <language>en</language>
    <item>
      <title>Stop Teaching Your AI the Same Rules Every Session — mirrorai Mirrors Your Codebase Automatically</title>
      <dc:creator>joygqz</dc:creator>
      <pubDate>Wed, 20 May 2026 02:25:41 +0000</pubDate>
      <link>https://forem.com/joygqz/stop-teaching-your-ai-the-same-rules-every-session-mirrorai-mirrors-your-codebase-automatically-5ae9</link>
      <guid>https://forem.com/joygqz/stop-teaching-your-ai-the-same-rules-every-session-mirrorai-mirrors-your-codebase-automatically-5ae9</guid>
      <description>&lt;p&gt;You spent six months building a Vue admin panel. You have a wrapped request layer, a shared component library, a consistent page structure. Every file follows the same pattern.&lt;/p&gt;

&lt;p&gt;Then you opened Cursor and asked it to add a new list page.&lt;/p&gt;

&lt;p&gt;It imported &lt;code&gt;axios&lt;/code&gt; directly. It wrote inline fetch logic. It named the component wrong. It ignored your entire architecture.&lt;/p&gt;

&lt;p&gt;Sound familiar?&lt;/p&gt;

&lt;h2&gt;
  
  
  The Real Problem with AI Coding Assistants
&lt;/h2&gt;

&lt;p&gt;The problem isn't that AI tools are bad — it's that &lt;strong&gt;every session starts from zero&lt;/strong&gt;. The AI doesn't know your conventions. It doesn't know your wrappers. It invents its own style on the spot.&lt;/p&gt;

&lt;p&gt;You end up spending more time correcting AI output than you saved generating it.&lt;/p&gt;

&lt;p&gt;The fix isn't to write better prompts. The fix is to give the AI a permanent memory of how &lt;em&gt;your&lt;/em&gt; project works.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introducing mirrorai
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/joygqz/mirrorai" rel="noopener noreferrer"&gt;&lt;strong&gt;mirrorai&lt;/strong&gt;&lt;/a&gt; is a codebase-aware AI rules generator. It analyzes your existing code and produces rule files for the AI tools you actually use:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Output file&lt;/th&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;CLAUDE.md&lt;/code&gt; + &lt;code&gt;.claude/commands/&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Claude Code&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;.cursorrules&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Cursor&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;.windsurfrules&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Windsurf&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;.github/copilot-instructions.md&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;GitHub Copilot&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;.clinerules&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Cline&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;One command to install. One &lt;code&gt;/mirror-init&lt;/code&gt; to run. Your AI assistant finally understands your project.&lt;/p&gt;

&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx mirrorai &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This drops a single &lt;code&gt;mirror-init.md&lt;/code&gt; into &lt;code&gt;.claude/commands/&lt;/code&gt;. Then you run &lt;code&gt;/mirror-init&lt;/code&gt; in your AI tool.&lt;/p&gt;

&lt;p&gt;The AI does the real work — analyzing &lt;em&gt;your&lt;/em&gt; project, not filling in some generic template:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Your project
   ↓
Detect language, framework, and stack from manifest files
   ↓
Scan business code and cluster files by unit type
   ↓
Score patterns: appears ≥ 3 times, ≥ 50 lines per file, ≥ 80% similarity
   ↓
Generate rule files + slash commands + scaffolding templates
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The entire analysis runs inside your AI tool on your existing subscription. &lt;strong&gt;No API key. No cloud service. No data leaves your machine.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What Gets Generated
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Rule files built from your real code
&lt;/h3&gt;

&lt;p&gt;Not a generic "write clean code" checklist. The generated &lt;code&gt;CLAUDE.md&lt;/code&gt; contains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your actual stack — exact frameworks, libraries, versions&lt;/li&gt;
&lt;li&gt;Your directory layout and what each folder is for&lt;/li&gt;
&lt;li&gt;Your core abstractions, and which layers must never be bypassed&lt;/li&gt;
&lt;li&gt;Your infrastructure wrappers (HTTP client, auth, logging) with real usage examples&lt;/li&gt;
&lt;li&gt;Your naming conventions, import order, and typing requirements&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;reference file per pattern&lt;/strong&gt;: "Before writing a new CRUD endpoint, read &lt;code&gt;internal/handler/user.go&lt;/code&gt;"&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Auto-execute rules that fire without a prompt
&lt;/h3&gt;

&lt;p&gt;The real magic is the &lt;em&gt;Auto-Execute Rules&lt;/em&gt; section in each generated file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## Auto-Execute Rules&lt;/span&gt;

When the current task matches any of the patterns below,
immediately apply the corresponding rule without asking.

&lt;span class="gu"&gt;### New list page&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Trigger: "add a list page", "create a list view", "build a table page"
&lt;span class="p"&gt;-&lt;/span&gt; Rule: use src/views/UserList.vue as reference; wrap requests with useRequest()
&lt;span class="p"&gt;-&lt;/span&gt; Side effects: register the route in src/router/index.ts
&lt;span class="p"&gt;-&lt;/span&gt; Scaffold first: npx mirrorai new new-list &lt;span class="nt"&gt;&amp;lt;name&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You describe the requirement in plain English. The AI recognizes the pattern and applies the right conventions — automatically, every single time, without you repeating yourself.&lt;/p&gt;

&lt;h3&gt;
  
  
  Zero-token scaffolding (opt-in)
&lt;/h3&gt;

&lt;p&gt;If you opt in, mirrorai also generates a &lt;code&gt;plopfile.js&lt;/code&gt; and Handlebars templates extracted from your actual code. Scaffold locally without spending a single token, then let the AI fill in only the business logic:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx mirrorai new new-list LeaveApproval
&lt;span class="c"&gt;# → generates the skeleton from your real project pattern&lt;/span&gt;
&lt;span class="c"&gt;# → AI writes only the business logic on top&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Works With Any Stack
&lt;/h2&gt;

&lt;p&gt;mirrorai is fully language-agnostic. It adapts to whatever it finds:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Vue / React / Svelte / Angular frontends&lt;/li&gt;
&lt;li&gt;Go / Rust / Python / Node.js backends&lt;/li&gt;
&lt;li&gt;FastAPI, Django, NestJS, Spring Boot, Rails&lt;/li&gt;
&lt;li&gt;Flutter mobile apps&lt;/li&gt;
&lt;li&gt;CLI tools, data pipelines, GraphQL services&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Re-running Is Safe
&lt;/h2&gt;

&lt;p&gt;Run &lt;code&gt;/mirror-init&lt;/code&gt; again after a major refactor. It detects existing files and asks what to do:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Regenerate everything&lt;/li&gt;
&lt;li&gt;Refresh only existing files&lt;/li&gt;
&lt;li&gt;Choose file by file&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Files you wrote yourself — detected by the absence of a &lt;code&gt;&amp;lt;!-- mirrorai:generated --&amp;gt;&lt;/code&gt; marker — get a per-file prompt: merge, overwrite, or skip. &lt;strong&gt;Your content is never silently clobbered.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Before / After
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Before mirrorai:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You: Add a leave-of-absence approval flow.
AI:  *imports axios directly*
     *creates a new custom fetch utility*
     *names the component inconsistently*
     *forgets to register the route*
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;After mirrorai:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You: Add a leave-of-absence approval flow.
AI:  (recognizes the approval pattern from CLAUDE.md)
     → reads src/views/ApprovalList.vue as reference
     → uses useRequest() for all data fetching
     → names and structures the component correctly
     → registers the route in src/router/index.ts
     → suggests: npx mirrorai new new-approval LeaveApproval
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Get Started in 30 Seconds
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Step 1: install the command into your project&lt;/span&gt;
npx mirrorai &lt;span class="nb"&gt;install&lt;/span&gt;

&lt;span class="c"&gt;# Step 2: run this inside Claude Code, Cursor, Windsurf, or Cline&lt;/span&gt;
/mirror-init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Answer two questions — which AI tools to target, and whether to generate scaffolding — and mirrorai does the rest.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;GitHub → &lt;a href="https://github.com/joygqz/mirrorai" rel="noopener noreferrer"&gt;github.com/joygqz/mirrorai&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;npm → &lt;a href="https://www.npmjs.com/package/mirrorai" rel="noopener noreferrer"&gt;npmjs.com/package/mirrorai&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If this saves you from re-explaining your architecture one more time, a ⭐ on GitHub goes a long way. Issues and PRs are very welcome.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>devtools</category>
      <category>claudecode</category>
    </item>
  </channel>
</rss>
