How to Set Up Cursor to Self-Improve Its Rules and Supercharge Your Codebase Automatically
Let’s be real, writing rules manually for your AI assistant in 2025 is starting to feel a lot like coding without version control in 2010.
Still doing it? You’re not alone.
Still doing it manually? There's a better way.
If you're working with Cursor(or planning to) and your SashiDo-powered backend or fullstack app, this guide will walk you through how to make your Cursor rules evolve automatically based on how your codebase grows.
Yes, you read that right - your codebase can start teaching itself! And it only takes one file to unlock that capability. Let me show you how.
Build a Self-Improving AI Codebase with Cursor
You might already know Cursor lets you define .mdc
rules—markdown-based config files that guide your AI assistant. But one rule takes things to another level: the self-improvement rule.
Photo by Tara Winstead
This is how you create a feedback loop that:
- Helps Cursor learn from your patterns
- Prevents repeating the same prompts
- Boosts your dev velocity on autopilot
Let’s walk through the steps together.
Step 1:Define the Foundational Rules
Create cursor-rules.mdc
file to teach Cursor how to process, format, and locate other rules in your project. Without it, Cursor is essentially guessing. With it, you're giving it a playbook of your structure and training it to follow it exactly.
File: .cursor/rules/cursor-rules.mdc
Tip: Keep examples relevant and up to date.
Step 2: Create the Self-Evolving Brain
Once the foundational rules are in place, it’s time to add a self-improvement.mdc
file to set up the feedback loop. These rules tells Cursor to analyze your codebase over time, learn from recurring patterns, and recommend or evolve new rules.
Photo by ThisIsEngineering
File: .cursor/rules/self-improvement.mdc
Make Rule Maintenance a Habit
Rules are not a set-and-forget operation. Like your codebase, your rule system should evolve with your team, your tech stack, and your workflows. Treat your rules as part of your product.
Here’s how to build a culture of ongoing refinement:
Monitor and Iterate
- Watch PR comments - If reviewers keep pointing out the same issue, that’s a rule waiting to be created.
- Track onboarding questions - When new devs get stuck or ask for clarification, your rules (or docs) probably need an update. Keep track of onboarding questions from new developers
- Update rules after large-scale refactors - Big refactors change structure and logic. Make sure the rules reflect those shifts.
- Cross-reference related rules to improve discoverability - Rules are more useful when they connect to deeper references, examples, or related context.
Photo by Mikhail Nilov
Handle Rule Deprecation
Not all rules age well. And as we all know tech evolves fast so best practices shift as well. Clean out the stale stuff and do it regularly.
- Mark outdated practices - Add a deprecated notice at the top.
- Update deprecated rules - Modernize where possible.
- Document migration paths - If rules are being retired, explain what to do instead and where it’s documented.
Rules should never be a liability. Make them an asset—living documentation that grows smarter and improves with your team and projects.
Follow cursor-rules.mdc
for proper structure and consistency.
Wrap-Up
The smartest developers don’t just ship code. They build systems that teach the next dev, the AI assistant, and their future selves how to think.
By connecting cursor-rules.mdc
with self-improvement.mdc
, you're not just writing rules, you’re building a feedback-powered rule engine that teaches itself, helping your team stay consistent, efficient, and forward-moving.
No more repetitive code reviews. No more retraining your AI every time you switch context. Just structured, automated, and evolving workflows that scale.
Start building smarter today. Let your codebase grow its own brain.
🚀 Deploy your app with SashiDo in minutes. Start your Free Trial Now. And here is a quick Getting Started Guide for a smooth take off.
Happy Coding!
This self-improving rules setup was inspired by real-world examples from danmindru/page-ui open-source repo.
If you liked this post, you might want to also check out:
10 Pro Tips to Master Cursor Agent (and Boost Your Coding Flow)
Vibe Coding with AI Agents: Best Practices for Using Cursor with Node.js and SashiDo - Part 1
Vibe Coding with AI Agents: A Non-Developer’s Journey to Shipping an MVP on SashiDo - Part 2
How to Master Vibe Coding: Best Practices and Useful AI Tool