PromptsApr 6, 2026·3 min read

Cursor Rules Collection — Community .mdc Config Rules

Community-curated collection of Cursor AI .mdc rule files for 40+ tech stacks. Drop a rule file into your project and Cursor follows your coding standards automatically. 5,000+ stars.

PR
Prompt Lab · Community
Quick Use

Use it first, then decide how deep to go

This block should tell both the user and the agent what to copy, install, and apply first.

  1. Browse rules at cursor.directory
  2. Pick a rule for your tech stack (React, Python, Go, etc.)
  3. Save as .cursor/rules/my-rule.mdc in your project root
  4. Cursor AI automatically follows the rules in every conversation

Example for Next.js + TypeScript:

curl -o .cursor/rules/nextjs.mdc https://raw.githubusercontent.com/pontusab/cursor.directory/main/rules/nextjs-typescript.mdc

Intro

Cursor Rules Collection is a community-curated repository of .mdc rule files for 40+ technology stacks with 5,000+ GitHub stars. Each rule file is a structured set of coding conventions, patterns, and best practices that Cursor AI follows automatically when you place it in your project. Instead of repeating "use functional components" or "follow PEP 8" every conversation, write it once as a rule and Cursor remembers forever. Best for teams standardizing AI-generated code across projects. Works with: Cursor AI. Setup time: under 1 minute.


Popular Rules

Frontend

Rule Stack Key Conventions
nextjs-typescript.mdc Next.js + TS App Router, Server Components, Tailwind
react-hooks.mdc React 18+ Functional components, custom hooks, Zustand
vue-composition.mdc Vue 3 Composition API, Pinia, TypeScript
svelte-kit.mdc SvelteKit Runes, TypeScript, form actions
tailwind-ui.mdc Tailwind CSS Utility-first, responsive, dark mode

Backend

Rule Stack Key Conventions
python-fastapi.mdc FastAPI Type hints, Pydantic models, async
go-clean.mdc Go Clean architecture, error handling
rust-idiomatic.mdc Rust Ownership patterns, error handling
node-express.mdc Express.js Middleware patterns, validation
django-rest.mdc Django REST Serializers, viewsets, permissions

DevOps & Infrastructure

Rule Stack Key Conventions
docker-best.mdc Docker Multi-stage builds, security
terraform-modules.mdc Terraform Module patterns, state management
k8s-production.mdc Kubernetes Resource limits, health checks

Rule File Format

---
description: Next.js 14+ with TypeScript conventions
globs: ["**/*.tsx", "**/*.ts"]
alwaysApply: false
---

# Next.js TypeScript Rules

## Component Patterns

- Use functional components exclusively
- Extract custom hooks for shared logic
- Keep components under 150 lines
- Use Server Components by default, Client Components only when needed

## File Naming

- Components: PascalCase (UserProfile.tsx)
- Utilities: camelCase (formatDate.ts)
- API routes: route.ts in app/api/

## State Management

- Server state: React Query / SWR
- Client state: Zustand (not Redux)
- Form state: React Hook Form + Zod

## Styling

- Tailwind CSS utility classes
- No inline styles or CSS modules
- Use cn() for conditional classes

Creating Custom Rules

mkdir -p .cursor/rules
cat > .cursor/rules/my-project.mdc << 'EOF'
---
description: My project conventions
globs: ["**/*.ts"]
alwaysApply: true
---

# Project Rules
- Always use snake_case for database columns
- API responses use camelCase
- All functions must have JSDoc comments
EOF

Key Stats

  • 5,000+ GitHub stars
  • 40+ technology stacks covered
  • 200+ community-contributed rules
  • Compatible with Cursor AI .mdc format
  • Browsable at cursor.directory

FAQ

Q: What are Cursor Rules? A: Cursor Rules are .mdc files that define coding conventions for Cursor AI. Place them in your project and Cursor follows your standards automatically in every conversation.

Q: Are Cursor Rules free? A: Yes, the collection is open-source. Cursor AI itself requires a subscription.

Q: Can I use these rules with Claude Code? A: The .mdc format is Cursor-specific, but the conventions can be adapted into CLAUDE.md or SKILL.md files for Claude Code.


🙏

Source & Thanks

Created by Pontus Ab and community. Licensed under MIT.

cursor.directory — ⭐ 5,000+

Thanks to the community for standardizing AI-generated code quality.

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets