110+ tested rules for AI coding tools β Cursor, Claude Code, Copilot, Windsurf, Gemini CLI, and Codex. Every rule contains something you can't get from a generic LLM prompt. Copy to your project and start getting better output.
β οΈ Using Cursor agent mode? Use the.mdcfiles inrules-mdc/. Both.cursorrulesand.mdcare loaded, but.mdctakes precedence on conflicts and gives you frontmatter (alwaysApply, globs). More details.
Before adding new rules, see if your current setup has issues:
npx cursor-doctor scanCatches broken frontmatter, conflicting rules, token budget problems, and missing coverage. Takes about 2 seconds.
β cursor-doctor on GitHub Β· β cursor-doctor on npm
For agent mode (recommended):
# Copy the .mdc file into your project's .cursor/rules/ directory
mkdir -p .cursor/rules
curl -o .cursor/rules/typescript.mdc https://raw.githubusercontent.com/nedcodes-ok/cursorrules-collection/main/rules-mdc/languages/typescript.mdcFor regular Cursor sessions (composer, chat):
curl -o .cursorrules https://raw.githubusercontent.com/nedcodes-ok/cursorrules-collection/main/rules/languages/typescript.cursorrulesEach .mdc file includes:
alwaysApply: true(required for agent mode)globsfor file-type scoping where applicable (e.g. Python rules only apply to*.py)descriptionfor Cursor's context
These rules are starting points, not finished configs. The more specific they are to YOUR project, the better they work.
Step 1: Grab the rule for your stack (e.g. react.mdc)
Step 2: Open it and delete anything that doesn't match your patterns. Using Redux instead of Context? Zustand instead of TanStack Query? Edit the rule.
Step 3: Add your project-specific conventions:
## Our Conventions
- All API calls go through src/lib/api.ts
- Use date-fns, not moment
- Component files are PascalCase, utilities are camelCase
- Tests live next to the file they test (Button.test.tsx)Step 4: Validate with npx cursor-doctor lint to make sure the frontmatter is correct.
The generic version gets you 70% there. The last 30% is what makes the rule actually useful for your codebase.
- Cursor Agent Mode Ignores .cursorrules β Use .mdc Instead
- 5 .cursorrules That Actually Changed Cursor's Output
- How to Write .cursorrules That Actually Work
- 5 .cursorrules That Actually Changed What Cursor Generates (React/Next.js)
Same prompts, different output. Left side is vanilla Cursor, right side is with rules applied.
Deep coverage: Python, JavaScript, TypeScript, Go, Rust, Java β version-specific gotchas, tested patterns, real traps. Starter templates: C#, Ruby, PHP, Swift, Kotlin, Elixir, Scala, C++ β solid foundations, customize for your project.
| Rule | .mdc (agent mode) | .cursorrules (legacy) |
|---|---|---|
| Python | python.mdc | python.cursorrules |
| JavaScript | javascript.mdc | javascript.cursorrules |
| TypeScript | typescript.mdc | typescript.cursorrules |
| Go | go.mdc | go.cursorrules |
| Rust | rust.mdc | rust.cursorrules |
| Java | java.mdc | java.cursorrules |
| C# | csharp.mdc | csharp.cursorrules |
| Ruby | ruby.mdc | ruby.cursorrules |
| PHP | php.mdc | php.cursorrules |
| Swift | swift.mdc | swift.cursorrules |
| Kotlin | kotlin.mdc | kotlin.cursorrules |
| Elixir | elixir.mdc | elixir.cursorrules |
| Scala | scala.mdc | scala.cursorrules |
| C++ | cpp.mdc | cpp.cursorrules |
Deep coverage: React, Next.js, Vue, Angular, Django, FastAPI, Express, Tailwind CSS, shadcn/ui β version-specific, gotcha-heavy, opinionated. Solid coverage: Everything else β good patterns and conventions, ready to customize.
| Rule | .mdc (agent mode) | .cursorrules (legacy) |
|---|---|---|
| Clean Code | clean-code.mdc | clean-code.cursorrules |
| Testing | testing.mdc | testing.cursorrules |
| Documentation | documentation.mdc | documentation.cursorrules |
| Git Workflow | git-workflow.mdc | git-workflow.cursorrules |
| Code Review | code-review.mdc | code-review.cursorrules |
| Security | security.mdc | security.cursorrules |
| Performance | performance.mdc | performance.cursorrules |
| Accessibility | accessibility.mdc | accessibility.cursorrules |
| API Design | api-design.mdc | api-design.cursorrules |
| Error Handling | error-handling.mdc | error-handling.cursorrules |
| Logging | logging.mdc | logging.cursorrules |
| Monitoring | monitoring.mdc | monitoring.cursorrules |
| Migration Safety | migration-safety.mdc | migration-safety.cursorrules |
| Refactoring | refactoring.mdc | refactoring.cursorrules |
| AI-Assisted Development | ai-assisted-development.mdc | ai-assisted-development.cursorrules |
| Monorepo | monorepo.mdc | monorepo.cursorrules |
| Database Migrations | database-migrations.mdc | database-migrations.cursorrules |
Not just Cursor β rules and patterns for configuring any AI coding tool.
| Rule | .mdc |
|---|---|
| CLAUDE.md (Claude Code) | claude-md.mdc |
| AGENTS.md (OpenAI Codex) | agents-md.mdc |
| GitHub Copilot Instructions | copilot-instructions.mdc |
| Windsurf Rules & Workflows | windsurf-rules.mdc |
| GEMINI.md (Gemini CLI) | gemini-md.mdc |
| Cross-Tool Config Guide | cross-tool-config.mdc |
With .mdc (recommended): Just copy multiple files into .cursor/rules/. Each one works independently. Glob patterns keep them scoped to the right files.
mkdir -p .cursor/rules
cp rules-mdc/languages/typescript.mdc .cursor/rules/
cp rules-mdc/frameworks/nextjs.mdc .cursor/rules/
cp rules-mdc/practices/testing.mdc .cursor/rules/With .cursorrules: Combine them into one file:
cat rules/languages/typescript.cursorrules rules/frameworks/nextjs.cursorrules > .cursorrulesPRs welcome. See CONTRIBUTING.md. The bar: rules should be specific enough to actually change Cursor's output. "Write clean code" doesn't count.
cursor-doctor catches broken frontmatter, conflicting rules, token budget waste, and other silent failures before they hurt your output.
npx cursor-doctor scan # health score + issues
npx cursor-doctor lint # detailed rule linting
npx cursor-doctor fix # auto-repair (Pro)cursor-doctor Pro ($9 one-time) β full diagnostic report with conflict detection, redundancy analysis, token budget breakdown, and auto-fix. Run npx cursor-doctor audit for the full report.
- Articles on Dev.to β Tests, experiments, and guides on making Cursor actually listen
If these rules saved you time, β star the repo so others can find it.
MIT
π Free Cursor Safety Checklist β pre-flight checklist for AI-assisted coding sessions, based on tested experiments
- cursor-doctor β CLI tool to diagnose and auto-fix your Cursor AI setup
- cursor-doctor Pro β Full diagnostics, conflict detection, and auto-repair ($9)
- Articles on Dev.to β Guides on writing effective Cursor rules


