Skip to content

tugkanboz/awesome-cursorrules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Awesome Cursor Rules πŸš€

A curated showcase of modern Cursor Rules configurations for development teams

🎯 Evolution Notice: This repository demonstrates the transition from legacy .cursorrules files to the powerful new Cursor Rules system with MDC format, rule types, and advanced organizational features.

🌟 What Changed: From .cursorrules to Cursor Rules

Cursor has revolutionized AI-assisted development by moving beyond the limitations of single-file .cursorrules:

Legacy .cursorrules New Cursor Rules
❌ Single file approach βœ… Organized rule directories
❌ Plain text only βœ… MDC format with metadata
❌ Always active βœ… Smart rule types (Always, Auto, Manual, Agent)
❌ No file organization βœ… Nested rules for complex projects
❌ Limited context βœ… File references and templates
❌ Hard to maintain βœ… Modular and scalable

πŸŽͺ Repository Overview

This repository serves as a living showcase of modern Cursor Rules implementations across various development scenarios:

awesome-cursorrules/
β”œβ”€β”€ πŸ“š rules/                       # Legacy .cursorrules files (migration source)
β”‚   β”œβ”€β”€ appium-mobile-test-automation-framework/
β”‚   β”œβ”€β”€ cypress-javascript-test-automation-framework/
β”‚   β”œβ”€β”€ k6-performance-test-framework/
β”‚   β”œβ”€β”€ playwright-javascript-test-automation-framework/
β”‚   β”œβ”€β”€ restassured-java-framework/
β”‚   β”œβ”€β”€ selenium-net-test-automation-framework/
β”‚   β”œβ”€β”€ selenium-python-test-automation-framework/
β”‚   └── vitest-javascript-unit-test-framework/
β”œβ”€β”€ πŸ—οΈ frameworks/                  # Framework .cursor/rules examples (with nested rules)
β”‚   β”œβ”€β”€ cypress/                    # .cursor/rules/{core,patterns}/*.mdc
β”‚   └── selenium-python/            # .cursor/rules/patterns/*.mdc
β”œβ”€β”€ 🎯 example-structures/          # Flat, focused .mdc structure examples
β”‚   β”œβ”€β”€ cypress/                    # testing-fundamentals, api-testing
β”‚   β”œβ”€β”€ next-js/                    # app-router-patterns
β”‚   β”œβ”€β”€ react-typescript/           # component-development
β”‚   └── selenium-python/            # architecture, page-objects, test-patterns
└── πŸ“– legacy-migration/            # Before/after migration guides

πŸ”„ The Great Migration: Before & After

Legacy .cursorrules Approach

# Old way - Everything in one file
project/
β”œβ”€β”€ .cursorrules    # 200+ lines of mixed rules
β”œβ”€β”€ src/
└── tests/

Problems with legacy approach:

  • ❌ Difficult to maintain as projects grow
  • ❌ No context awareness for different file types
  • ❌ All rules active all the time
  • ❌ Hard to share and collaborate on rules
  • ❌ No template or example integration

Modern Cursor Rules System

# New way - Organized, contextual, powerful
project/
β”œβ”€β”€ .cursor/rules/
β”‚   β”œβ”€β”€ core-standards.mdc         # Always applied
β”‚   β”œβ”€β”€ testing-patterns.mdc       # Auto-attached to test files
β”‚   β”œβ”€β”€ framework-specific.mdc     # Context-aware activation
β”‚   β”œβ”€β”€ advanced-optimizations.mdc # Agent-requested when relevant
β”‚   └── templates/
β”‚       β”œβ”€β”€ component-template.tsx
β”‚       β”œβ”€β”€ test-template.spec.js
β”‚       └── api-endpoint.js
β”œβ”€β”€ src/
└── tests/

Benefits of modern approach:

  • βœ… Context-aware rule activation
  • βœ… Organized and maintainable structure
  • βœ… Template integration and file references
  • βœ… Team collaboration and version control friendly
  • βœ… Scalable for enterprise projects

🎨 Understanding Rule Types

πŸ”„ Always Rules

Core standards that apply to every AI interaction:

---
description: Universal coding standards for all projects
alwaysApply: true
---

# Core Development Standards
- Use TypeScript for type safety across all projects
- Implement comprehensive error handling and logging
- Write self-documenting code with clear naming
- Follow established architectural patterns

🎯 Auto Attached Rules

Automatically activated based on file patterns:

---
description: React component development patterns
globs: **/*.tsx,**/components/**/*.js,**/hooks/**/*.ts
alwaysApply: false
---

# React Development Excellence
- Use functional components with React hooks
- Implement proper prop validation with TypeScript
- Follow component composition patterns
- Optimize performance with useMemo and useCallback

@react-component-template.tsx
@custom-hook-template.ts

πŸ€– Agent Requested Rules

AI intelligently applies based on context:

---
description: Advanced performance optimization techniques
globs: **/*.js,**/*.ts,**/*.tsx
alwaysApply: false
---

# Performance Optimization Strategies
- Implement code splitting and lazy loading
- Use efficient algorithms and data structures
- Optimize bundle size and loading times
- Monitor and profile application performance

πŸ“ Manual Rules

Explicitly invoked with @ruleName:

---
description: Complete test automation setup generator
alwaysApply: false
---

# Test Automation Project Generator
Creates a complete test automation project structure:

@selenium-project-structure
@cypress-configuration  
@playwright-setup
@github-actions-ci

πŸ“„ AGENTS.md: The Simpler Alternative

Alongside .mdc rules, Cursor now supports AGENTS.md β€” a plain Markdown file (no frontmatter, no metadata) that Cursor reads as project guidance. It's the lowest-friction way to give the agent context, and it's portable across other AI coding tools that adopt the same convention.

project/
β”œβ”€β”€ AGENTS.md                # Project-wide guidance (always read)
β”œβ”€β”€ frontend/
β”‚   └── AGENTS.md            # Frontend-specific guidance
└── backend/
    └── AGENTS.md            # Backend-specific guidance

How it works:

  • βœ… Plain Markdown β€” just write instructions, no YAML frontmatter
  • βœ… Nested directories: an AGENTS.md deeper in the tree takes precedence over a parent one for files in that subtree
  • βœ… Great for tech-stack notes, conventions, and "how to run things" that should always be in context

AGENTS.md vs .mdc rules β€” when to use which:

Use AGENTS.md Use .cursor/rules/*.mdc
Always-on project context Context-aware, file-scoped activation
Simple, portable, no metadata globs, description, alwaysApply control
One file per directory Multiple focused rules per project

πŸ’‘ Note: .cursor/rules/ only loads files with the .mdc extension β€” a plain .md placed there is ignored, except when it's named AGENTS.md.

πŸš€ Featured Framework Transformations

Python Test Automation Evolution

Legacy .cursorrules (Old Way):

# Selenium Python Test Automation Framework
- Use pytest as testing framework
- Implement Page Object Model pattern
- Follow PEP 8 style guide
- Use webdriver_manager for browser setup
- Implement proper logging

Modern Cursor Rules (New Way):

---
description: Advanced Selenium Python automation patterns
globs: **/*.py,**/test_*.py,**/pages/**/*.py,**/conftest.py
alwaysApply: false
---

# Selenium Python Excellence

## Architecture Patterns
- Implement advanced Page Object Model with base classes
- Use pytest fixtures for robust test data management
- Create reusable utility functions and custom assertions
- Implement proper WebDriver lifecycle management

## Code Quality Standards
- Follow PEP 8 with Black formatter integration
- Use type hints for better code maintainability
- Implement comprehensive error handling and logging
- Create detailed docstrings for all classes and methods

## Example Implementations:
@advanced-page-object.py
@pytest-configuration.py
@custom-assertions.py
@webdriver-factory.py

JavaScript E2E Testing Revolution

Modern Cypress Rules:

---
description: Advanced Cypress testing patterns and best practices
globs: **/*.cy.js,**/*.cy.ts,**/cypress/**/*.js
alwaysApply: false
---

# Cypress Testing Excellence

## Smart Element Selection
- Use `data-cy` attributes for reliable, maintainable selectors
- Implement custom commands for complex user interactions
- Create reusable page object patterns for large applications
- Handle dynamic content with proper wait strategies

## API Testing Integration
- Use `cy.intercept()` for comprehensive network testing
- Mock external services for reliable test execution
- Implement request/response validation patterns
- Create data-driven test scenarios

@cypress-page-object.js
@custom-commands.js
@api-testing-helpers.js

🏒 Enterprise-Scale Examples

Monorepo Organization Strategy

enterprise-monorepo/
β”œβ”€β”€ .cursor/rules/                    # Global company standards
β”‚   β”œβ”€β”€ security-compliance.mdc      # Security guidelines for all teams
β”‚   β”œβ”€β”€ code-quality-standards.mdc   # Universal quality requirements
β”‚   β”œβ”€β”€ documentation-rules.mdc      # Documentation standards
β”‚   └── performance-guidelines.mdc   # Performance best practices
β”œβ”€β”€ backend/
β”‚   └── .cursor/rules/                # Backend-specific rules
β”‚       β”œβ”€β”€ api-design-patterns.mdc   # RESTful API standards
β”‚       β”œβ”€β”€ database-interactions.mdc # Database best practices
β”‚       └── microservices-patterns.mdc # Service architecture
β”œβ”€β”€ frontend/
β”‚   └── .cursor/rules/                # Frontend-specific rules
β”‚       β”œβ”€β”€ react-architecture.mdc    # Component architecture
β”‚       β”œβ”€β”€ state-management.mdc      # Redux/Context patterns
β”‚       └── ui-accessibility.mdc      # Accessibility standards
β”œβ”€β”€ mobile/
β”‚   └── .cursor/rules/                # Mobile-specific rules
β”‚       β”œβ”€β”€ react-native-patterns.mdc # Mobile development
β”‚       └── performance-mobile.mdc    # Mobile optimization
└── testing/
    └── .cursor/rules/                # Testing-specific rules
        β”œβ”€β”€ e2e-strategies.mdc         # End-to-end testing
        β”œβ”€β”€ unit-testing-patterns.mdc  # Unit test standards
        └── performance-testing.mdc    # Load testing guidelines

Team Collaboration Benefits

  • 🎯 Consistent Standards: Shared rules ensure code consistency across teams
  • ⚑ Faster Onboarding: New developers get immediate context and guidance
  • πŸ“š Knowledge Sharing: Best practices are encoded and automatically shared
  • πŸ›‘οΈ Quality Assurance: Automated compliance with company standards
  • πŸ”„ Continuous Improvement: Rules evolve with team learnings

πŸ“ˆ Migration Strategy

Phase 1: Assessment

# Analyze your current .cursorrules
echo "Current .cursorrules content:"
cat .cursorrules

# Identify different rule categories
# - Core standards (always apply)
# - Framework-specific patterns (auto-attach)
# - Advanced techniques (agent-requested)
# - Templates and examples (manual)

Phase 2: Organization

# Create modern structure
mkdir -p .cursor/rules/{core,frameworks,templates,advanced}

# Categorize existing rules
# Move content to appropriate MDC files
# Add metadata and glob patterns

Phase 3: Enhancement

# Add file references and templates
# Implement different rule types
# Create project-specific examples
# Test rule activation patterns

Phase 4: Team Adoption

# Share with team members
# Gather feedback and iterate
# Create team-specific customizations
# Monitor effectiveness and improve

🎯 Quick Start Scenarios

For Test Automation Teams

# Clone the showcase repository
git clone https://github.com/your-org/awesome-cursor-rules

# Set up Selenium Python automation
cp -r example-structures/selenium-python/.cursor/rules/* .cursor/rules/

# Add Cypress for E2E testing
cp -r example-structures/cypress/.cursor/rules/* e2e/.cursor/rules/

# Include React TypeScript patterns
cp -r example-structures/react-typescript/.cursor/rules/* frontend/.cursor/rules/

For Web Development Teams

# Full-stack development setup
cp -r example-structures/react-typescript/.cursor/rules/* frontend/.cursor/rules/
cp -r example-structures/selenium-python/.cursor/rules/* backend-tests/.cursor/rules/
cp -r example-structures/cypress/.cursor/rules/* e2e-tests/.cursor/rules/

For Enterprise Organizations

# Large-scale monorepo setup - use enterprise patterns from README examples
mkdir -p .cursor/rules
# Copy relevant rules based on your tech stack
# Customize global standards for your organization
# Set up team-specific rules in subdirectories
# Integrate with CI/CD pipelines for consistency

🌟 Community Showcase

Most Popular Configurations

  • πŸ† React + TypeScript + Testing Library: Complete frontend development stack
  • πŸš€ Python + Selenium + pytest: Comprehensive test automation framework
  • 🏒 Enterprise Monorepo: Multi-team, multi-project organization
  • πŸŽ“ Educational: Learning-focused development with guided examples

Success Stories

"We reduced our code review cycle time by 40% after implementing shared Cursor Rules across our engineering teams. The AI now understands our patterns and generates code that follows our standards automatically."
β€” Sarah Chen, Engineering Manager at TechCorp

"New team members are productive on day one instead of week three. The rules provide immediate context about our coding patterns, testing strategies, and architectural decisions."
β€” Marcus Rodriguez, Senior Developer at StartupXYZ

🀝 Contributing to the Showcase

Adding New Framework Support

  1. Research: Study framework best practices and common patterns
  2. Structure: Create organized rule directory with proper MDC format
  3. Examples: Include comprehensive template files and examples
  4. Documentation: Provide clear setup and usage instructions
  5. Testing: Validate rules with real-world projects

Sharing Real-World Examples

  1. Document Journey: Show before/after migration experience
  2. Measure Impact: Include metrics on productivity improvements
  3. Share Learnings: Explain what worked and what didn't
  4. Provide Templates: Create reusable configurations for similar teams

Improving Existing Rules

  1. Real-World Testing: Use rules in actual development projects
  2. Community Feedback: Gather input from diverse development teams
  3. Performance Optimization: Ensure rules don't slow down AI responses
  4. Regular Updates: Keep rules current with evolving best practices

πŸ“š Essential Resources

πŸŽ‰ The Future of AI-Assisted Development

The evolution from .cursorrules to Cursor Rules represents more than just a technical upgradeβ€”it's a fundamental transformation in how AI understands and enhances the development process:

🎯 Context-Aware Intelligence

AI that truly understands your project structure, coding patterns, and team preferences

⚑ Accelerated Development

Faster feature development with AI that knows your exact requirements and standards

🀝 Enhanced Collaboration

Shared knowledge base that ensures consistency across team members and projects

πŸ“ˆ Continuous Learning

Rules that evolve and improve based on team feedback and project growth

πŸ”„ Scalable Organization

Infrastructure that grows from individual projects to enterprise-scale monorepos


πŸš€ Ready to Transform Your Development Workflow?

Start your journey from legacy .cursorrules to modern Cursor Rules:

  1. πŸ“Š Assess: Evaluate your current .cursorrules setup
  2. πŸ—οΈ Plan: Choose the appropriate migration strategy
  3. ⚑ Implement: Set up organized rule structure
  4. 🎯 Optimize: Fine-tune rules based on team feedback
  5. 🌟 Scale: Expand to enterprise-level organization

πŸ’‘ Remember: The transition from .cursorrules to Cursor Rules isn't just about new syntaxβ€”it's about unlocking the full potential of AI-assisted development for your team.

πŸ“š Explore Our Resources

🎯 Quick Start Guides

πŸ› οΈ Framework Examples

πŸŽ“ Learning Resources

πŸš€ Advanced Topics


πŸ’‘ Pro Tips for Success

🎯 Start Small, Think Big

Begin with one framework example, then expand to your full tech stack

🀝 Involve Your Team

Collaborative rule creation ensures buy-in and better adoption

πŸ“Š Measure Impact

Track code review time, onboarding speed, and quality metrics

πŸ”„ Iterate & Improve

Regular rule updates keep pace with evolving best practices


Ready to revolutionize your development experience? Pick a framework above and start your transformation today! πŸš€

About

A curated list of awesome .cursorrules files for enhancing your Cursor AI experience.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors