// rules.md
AI coding rules for every editor.
Fill the form once. Get .cursorrules, copilot-instructions.md, and .windsurfrules — all formatted correctly for each tool.
Preview updates as you type
Switch tabs above to see each format
// what are ai coding rules
Tell your AI editor how to code — once.
AI coding tools like Cursor, GitHub Copilot, and Windsurf read a rules file at the root of your project. Every suggestion they make is shaped by that file. Without one, the AI guesses your stack, your style, and your conventions — and it often guesses wrong.
With a rules file, you define the persona once: the language, the framework, what to always do, what to never do. Every session starts with the AI already knowing your project — no more correcting the same mistakes over and over.
# Cursor Rules # Generated by SuperMD · supermd.dev/rules-md You are an expert TypeScript / Next.js App Router developer. This is a B2B SaaS dashboard. Keep components focused, server-first, and below 150 lines. ## Stack - Language: TypeScript - Framework: Next.js App Router ## Always - Use server components by default - Add JSDoc for exported functions ## Never - Use `any` or type casting - Import from barrel files
// which tool should I use
Cursor vs Copilot vs Windsurf — what's the difference?
Cursor
Most popular.cursorrules📁 Project root
A plain text/markdown file that acts as the system prompt for Cursor's AI. Cursor reads it automatically when you open the project. Can also use @Rules in Cursor's composer.
GitHub Copilot
Works in VS Codecopilot-instructions.md📁 .github/ folder
Placed in .github/copilot-instructions.md. Copilot reads this across JetBrains, VS Code, and GitHub.com. Structured markdown works best — headers help Copilot parse the sections.
Windsurf
Same format as Cursor.windsurfrules📁 Project root
Windsurf by Codeium uses .windsurfrules at the project root. Format is identical to .cursorrules — if you use both editors, the same rules work in both files with a rename.
// faq
Frequently asked questions
Do these files affect AI performance?
Yes — meaningfully. A well-written rules file reduces the number of corrections you need to make per session. AI tools use the file as a persistent system prompt, so every suggestion is pre-filtered through your conventions.
Should I commit rules files to git?
Yes. Committing rules files means every developer on your team gets the same AI behavior. This is especially important for conventions like naming, import patterns, and testing frameworks that differ project-to-project.
How long should a rules file be?
Aim for 200–600 tokens (roughly 150–450 words). Short enough that the AI reads and applies all of it; long enough to cover your stack, conventions, and the most common mistakes to avoid. Longer files get truncated or deprioritized.
Can I use multiple rules files?
Cursor supports project-level .cursorrules and global rules in settings. Windsurf similarly allows both. Copilot only reads the single .github/copilot-instructions.md. For Cursor/Windsurf, use project-level files for project-specific conventions and global rules for personal style.
Do rules work for all languages?
Yes. The rules files are plain text — they work regardless of programming language. The AI uses them as instructions, not as code. You can write rules for Python, Go, Rust, or any language your AI editor supports.
What makes a rules file effective?
Be specific and opinionated. 'Write clean code' does nothing — 'use named exports, never default exports' does. Focus on the decisions the AI gets wrong most often in your codebase: naming, import style, state management approach, and error handling patterns.