Best Cursor Rules

Cursor is an AI-first code editor built on VS Code. .cursorrules files define project-level rules that guide Cursor's AI to write code that fits your team's standards.

Add these rules to your .cursorrules file to get better AI code generation.

30 rules available

Python Cursor Rules

CursorPython

Best Cursor AI coding rules for Python development. Enforce type hints, PEP 8, Pythonic patterns, and modern Python best practices in your .cursorrules file.

Code Style
python · type-hintsCopy Ready

TypeScript Cursor Rules

CursorTypeScript

Cursor rules for TypeScript: enforce strict mode, eliminate any types, and write type-safe code with these .cursorrules configurations.

Code Style
typescript · strictCopy Ready

React Cursor Rules

CursorReact

Cursor rules for React: component patterns, hooks best practices, performance optimization, and clean state management conventions.

Architecture
react · hooksCopy Ready

Next.js Cursor Rules

CursorNext.js

Cursor rules for Next.js App Router: server components, data fetching, routing, and deployment best practices.

Architecture
nextjs · app-routerCopy Ready

Rust Cursor Rules

CursorRust

Cursor rules for Rust: ownership patterns, error handling with Result, idiomatic Rust, and performance-aware coding conventions.

Code Style
rust · ownershipCopy Ready

Go Cursor Rules

CursorGo

Cursor rules for Go: idiomatic Go patterns, error handling, concurrency, and Go module conventions.

Code Style
go · golangCopy Ready

Java Cursor Rules

CursorJava

Cursor rules for Java: modern Java patterns, Stream API, Optional, records, and best practices for Java 17+.

Code Style
java · recordsCopy Ready

Docker Cursor Rules

CursorDocker

Cursor rules for Docker: multi-stage builds, security hardening, layer optimization, and production-ready Dockerfile conventions.

Security
docker · containersCopy Ready

SQL Cursor Rules

CursorSQL

Cursor rules for SQL: query optimization, indexing strategy, safe migrations, and database security best practices.

Database
sql · databaseCopy Ready

Tailwind CSS Cursor Rules

CursorTailwind CSS

Cursor rules for Tailwind CSS: class organization, component extraction, responsive design, and dark mode conventions.

Code Style
tailwind · cssCopy Ready

Django Cursor Rules

CursorDjango

Cursor rules for Django: security settings, ORM best practices, performance patterns, and production Django configuration.

Security
django · pythonCopy Ready

FastAPI Cursor Rules

CursorFastAPI

Cursor rules for FastAPI: Pydantic models, dependency injection, async patterns, and production API best practices.

API Design
fastapi · pythonCopy Ready

Vue.js Cursor Rules

CursorVue

Cursor rules for Vue 3: Composition API patterns, script setup, TypeScript integration, and Vue ecosystem best practices.

Code Style
vue · composition-apiCopy Ready

Prisma Cursor Rules

CursorPrisma

Cursor rules for Prisma ORM: schema design, query optimization, migrations, and type-safe database access patterns.

Database
prisma · ormCopy Ready

GraphQL Cursor Rules

CursorGraphQL

Cursor rules for GraphQL: schema design, resolver patterns, DataLoader, and security best practices.

API Design
graphql · apiCopy Ready

Kubernetes Cursor Rules

CursorKubernetes

Cursor rules for Kubernetes: resource limits, security contexts, RBAC, and production-ready manifest conventions.

Security
kubernetes · k8sCopy Ready

Swift Cursor Rules

CursorSwift

Cursor rules for Swift: value types, protocol-oriented programming, async/await, and modern Swift best practices.

Code Style
swift · iosCopy Ready

Kotlin Cursor Rules

CursorKotlin

Cursor rules for Kotlin: null safety, coroutines, functional patterns, and idiomatic Kotlin best practices.

Code Style
kotlin · androidCopy Ready

Solidity Cursor Rules

CursorSolidity

Cursor rules for Solidity: smart contract security, gas optimization, reentrancy guards, and audit-ready coding patterns.

Security
solidity · smart-contractsCopy Ready

Testing Best Practices Cursor Rules

Cursortesting

Universal Cursor rules for writing better tests: test structure, naming conventions, test isolation, and TDD practices.

Testing
testing · tddCopy Ready

Security Cursor Rules

Cursorsecurity

Security-focused Cursor rules: input validation, secrets management, auth patterns, and OWASP best practices.

Security
security · owaspCopy Ready

Performance Cursor Rules

Cursorperformance

Performance-focused Cursor rules: profiling-first approach, caching strategy, async patterns, and optimization techniques.

Performance
performance · cachingCopy Ready

Bash Cursor Rules

CursorBash

Cursor rules for Bash scripting: error handling, shellcheck compliance, POSIX portability, and safe scripting patterns.

Code Style
bash · shellCopy Ready

CSS Cursor Rules

CursorCSS

Cursor rules for CSS: custom properties, logical properties, modern layout, and maintainable CSS architecture.

Code Style
css · stylingCopy Ready

Angular Cursor Rules

CursorAngular

Cursor rules for Angular: standalone components, signals, OnPush strategy, and modern Angular 17+ patterns.

Architecture
angular · signalsCopy Ready

Express.js Cursor Rules

CursorExpress

Cursor rules for Express.js: middleware patterns, error handling, security, and production Node.js API best practices.

API Design
express · nodejsCopy Ready

Ruby Cursor Rules

CursorRuby

Cursor rules for Ruby: idiomatic Ruby patterns, Rubocop compliance, OOP design, and Ruby 3.x best practices.

Code Style
ruby · rubocopCopy Ready

PHP Cursor Rules

CursorPHP

Cursor rules for PHP: modern PHP 8 patterns, strict types, type declarations, and secure PHP development.

Code Style
php · php8Copy Ready

Flutter Cursor Rules

CursorFlutter

Cursor rules for Flutter: widget architecture, state management, performance, and production Flutter best practices.

Architecture
flutter · dartCopy Ready

Laravel Cursor Rules

CursorLaravel

Cursor rules for Laravel: Eloquent patterns, service layer design, jobs and queues, and production Laravel best practices.

Architecture
laravel · phpCopy Ready