Specialized Rules

Cursor rules for specialized domains — Vite, MongoDB, Firebase, Pandas, Pydantic, Solidity, Docker, GraphQL, Prisma, Supabase, Playwright, Vitest and more

April 14, 2026by PromptGenius Team
cursor-rulesspecializedsoliditydockergraphqlprismasupabaseplaywrightvitestvitemongodbfirebasepandaspydantic
Specialized Rules

Overview

Specialized cursor rules cover development domains outside standard web and mobile frameworks. These rules address niche programming languages, domain-specific frameworks, and emerging technologies that require tailored AI assistance patterns.

Unlike general-purpose language rules, specialized rules focus on:

  • Domain-specific security patterns (e.g., reentrancy guards in Solidity)
  • Platform-specific idioms and conventions
  • Performance optimization for constrained environments
  • Compliance and audit readiness

Available Rules

Solidity

Smart contract development for Ethereum and EVM-compatible chains. Best for DeFi, NFTs, and blockchain applications.

The Solidity rules enforce:

  • Security best practices including reentrancy guards and access control
  • Gas optimization patterns for efficient contract execution
  • Auditable code structures for security reviews
  • OpenZeppelin integration patterns for standard token implementations

Docker

Containerization for consistent development and deployment environments. Best for microservices, CI/CD pipelines, and cloud deployments.

The Docker rules enforce:

  • Multi-stage builds for minimal production images
  • Layer caching strategies for faster builds
  • Non-root execution and security hardening
  • docker-compose service orchestration with health checks

GraphQL

Type-safe API query language with Apollo Server. Best for flexible data fetching, mobile-first APIs, and microservice gateways.

The GraphQL rules enforce:

  • Schema-first design with type generation
  • Resolver patterns and DataLoader for N+1 prevention
  • Error handling via union types instead of throwing
  • Subscriptions for real-time data

Prisma

Modern TypeScript ORM replacing raw SQL and query builders. Best for PostgreSQL, MySQL, and SQLite with full type safety.

The Prisma rules enforce:

  • Declarative schema modeling with explicit relations
  • Migration hygiene with prisma migrate workflows
  • Typed Client queries with include/select for relation loading
  • Idempotent seed scripts and singleton client patterns

Supabase

Open-source Firebase alternative on Postgres with Auth, Realtime, and Storage. Best for full-stack apps needing a managed backend.

The Supabase rules enforce:

  • Row Level Security on all tables with auth.uid() policies
  • Typed supabase-js client with generated Database types
  • Realtime subscriptions with channel lifecycle management
  • Local development with supabase CLI and SQL migrations

Playwright

Cross-browser end-to-end testing by Microsoft. Best for testing web apps across Chromium, Firefox, and WebKit.

The Playwright rules enforce:

  • Locator priority: getByRole > getByLabel > getByPlaceholder > getByText > getByTestId
  • Web-first assertions with auto-waiting (no manual timeouts)
  • API mocking with page.route() for isolated component testing
  • Authentication state reuse with storageState for fast test suites

Vitest

Next-generation unit testing framework powered by Vite. Best for fast TypeScript-first tests in Vite projects.

The Vitest rules enforce:

  • Explicit imports from vitest (avoid globals) for clarity
  • vi.mock hoisting rules and vi.hoisted() for scoped variables
  • Coverage thresholds and provider configuration (v8 or istanbul)
  • Workspace config for monorepo test orchestration

Vite

Next-gen build tool powering modern web projects. Best for dev servers with HMR and optimized production builds.

The Vite rules enforce:

  • vite.config.ts structure with defineConfig and path aliases
  • import.meta.env conventions with VITE_ prefix
  • Plugin ordering (framework first, then utilities)
  • Library mode with externalized peer dependencies

MongoDB

Document database with flexible JSON-like schema. Best for apps needing horizontal scaling and real-time data.

The MongoDB rules enforce:

  • Connection pooling with MongoClient reuse
  • Schema design patterns (embedded vs referenced data)
  • Index strategies (ESR rule: equality, sort, range)
  • Aggregation pipeline over map-reduce

Firebase

Google's backend-as-a-service platform. Best for mobile/web apps needing auth, database, and hosting.

The Firebase rules enforce:

  • Firestore query patterns with composite indexes
  • Security Rules denying all by default, allowing specific access
  • Cloud Functions triggers (onCall, onRequest, onDocumentCreated)
  • Emulator suite for all local development

Pandas

Python data analysis library with DataFrames. Best for data manipulation, ETL pipelines, and analytics.

The Pandas rules enforce:

  • Vectorized operations over Python loops (iterrows banned)
  • loc/iloc filtering with boolean conditions
  • GroupBy with named aggregations
  • Chunked I/O for large datasets

Pydantic

Python data validation with type hints. Best for API input validation, settings management, and FastAPI.

The Pydantic rules enforce:

  • BaseModel with explicit type annotations
  • @field_validator/@model_validator patterns
  • ConfigDict for frozen, extra, and from_attributes
  • BaseSettings for environment variable config

Planned Additions

DomainStatusDescription
tRPCPlannedEnd-to-end type safety, procedure patterns, middleware
TerraformPlannedInfrastructure as Code, HCL syntax, state management

Creating Custom Specialized Rules

Specialized rules follow the same format as all Cursor rules — .mdc files in the .cursor/rules/ directory. When creating custom specialized rules:

  1. Identify the domain constraints that generic AI assistance might miss
  2. Document security patterns specific to the domain
  3. Include code examples showing both correct and incorrect patterns
  4. Reference official documentation and community standards
  5. Test the rules with real AI-assisted development tasks