惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
J
Java Code Geeks
博客园 - 【当耐特】
宝玉的分享
宝玉的分享
腾讯CDC
D
DataBreaches.Net
Microsoft Azure Blog
Microsoft Azure Blog
Engineering at Meta
Engineering at Meta
V
V2EX
F
Fortinet All Blogs
MyScale Blog
MyScale Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Tailwind CSS Blog
Jina AI
Jina AI
GbyAI
GbyAI
大猫的无限游戏
大猫的无限游戏
A
About on SuperTechFans
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
U
Unit 42
B
Blog
M
MIT News - Artificial intelligence
N
Netflix TechBlog - Medium

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Stop Teaching Your AI the Same Rules Every Session — mirr...
joygqz · 2026-05-20 · via DEV Community

joygqz

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.

Then you opened Cursor and asked it to add a new list page.

It imported axios directly. It wrote inline fetch logic. It named the component wrong. It ignored your entire architecture.

Sound familiar?

The Real Problem with AI Coding Assistants

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

You end up spending more time correcting AI output than you saved generating it.

The fix isn't to write better prompts. The fix is to give the AI a permanent memory of how your project works.

Introducing mirrorai

mirrorai is a codebase-aware AI rules generator. It analyzes your existing code and produces rule files for the AI tools you actually use:

Output file Tool
CLAUDE.md + .claude/commands/ Claude Code
.cursorrules Cursor
.windsurfrules Windsurf
.github/copilot-instructions.md GitHub Copilot
.clinerules Cline

One command to install. One /mirror-init to run. Your AI assistant finally understands your project.

How It Works

npx mirrorai install

Enter fullscreen mode Exit fullscreen mode

This drops a single mirror-init.md into .claude/commands/. Then you run /mirror-init in your AI tool.

The AI does the real work — analyzing your project, not filling in some generic template:

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

Enter fullscreen mode Exit fullscreen mode

The entire analysis runs inside your AI tool on your existing subscription. No API key. No cloud service. No data leaves your machine.

What Gets Generated

Rule files built from your real code

Not a generic "write clean code" checklist. The generated CLAUDE.md contains:

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

Auto-execute rules that fire without a prompt

The real magic is the Auto-Execute Rules section in each generated file:

## Auto-Execute Rules

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

### New list page
- Trigger: "add a list page", "create a list view", "build a table page"
- Rule: use src/views/UserList.vue as reference; wrap requests with useRequest()
- Side effects: register the route in src/router/index.ts
- Scaffold first: npx mirrorai new new-list <name>

Enter fullscreen mode Exit fullscreen mode

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.

Zero-token scaffolding (opt-in)

If you opt in, mirrorai also generates a plopfile.js 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:

npx mirrorai new new-list LeaveApproval
# → generates the skeleton from your real project pattern
# → AI writes only the business logic on top

Enter fullscreen mode Exit fullscreen mode

Works With Any Stack

mirrorai is fully language-agnostic. It adapts to whatever it finds:

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

Re-running Is Safe

Run /mirror-init again after a major refactor. It detects existing files and asks what to do:

  • Regenerate everything
  • Refresh only existing files
  • Choose file by file

Files you wrote yourself — detected by the absence of a <!-- mirrorai:generated --> marker — get a per-file prompt: merge, overwrite, or skip. Your content is never silently clobbered.

The Before / After

Before mirrorai:

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*

Enter fullscreen mode Exit fullscreen mode

After mirrorai:

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

Enter fullscreen mode Exit fullscreen mode

Get Started in 30 Seconds

# Step 1: install the command into your project
npx mirrorai install

# Step 2: run this inside Claude Code, Cursor, Windsurf, or Cline
/mirror-init

Enter fullscreen mode Exit fullscreen mode

Answer two questions — which AI tools to target, and whether to generate scaffolding — and mirrorai does the rest.


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.