awesome-cursorrules
tugkanboz · tugkanboz/awesome-cursorrules
Một danh sách được tuyển chọn giới thiệu các cấu hình Cursor Rules hiện đại theo định dạng MDC, cung cấp các ví dụ cho nhiều framework kiểm thử và kịch bản phát triển khác nhau.
Một danh sách tuyển chọn các tệp .cursorrules tuyệt vời để nâng cao trải nghiệm Cursor AI của bạn.
Xem trước
Bạn có thể làm gì với nó
- Nhanh chóng tìm và triển khai các Cursor rules cho các framework kiểm thử cụ thể như Cypress hoặc Playwright.
- Học hỏi các thực hành tốt nhất để tổ chức Cursor rules bằng định dạng MDC mới.
- Nâng cao khả năng hiểu của Cursor AI về cấu trúc dự án và quy ước mã hóa bằng cách nhập các bộ quy tắc liên quan.
Kiểm tra an toàn
Không thấy dấu hiệu rủi ro trong các file đã quét.
Quét tự động các file trong repo. Luôn xem lại code trước khi chạy.
Trích từ README
Awesome Cursor Rules 🚀
A curated showcase of modern Cursor Rules configurations for development teams
🎯 Evolution Notice: This repository demonstrates the transition from legacy
.cursorrulesfiles 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.mddeeper 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