A carefully crafted collection of rules that optimize your Cursor AI experience. These rules enforce consistent practices, improve AI assistance quality, and streamline common development workflows.
Note: This is an opinionated preset designed to enhance productivity. Feel free to adapt these rules to your personal preferences! ✨
The apply-rules.sh script allows you to download rules directly to your project without cloning the entire repository:
# Download the script
curl -o apply-rules.sh https://raw.githubusercontent.com/mitas/cursor-rules/master/apply-rules.sh && chmod +x apply-rules.sh
# Basic usage - download all rules to target directory
./apply-rules.sh /path/to/your/project
# Overwrite existing rules
./apply-rules.sh --ow /path/to/your/project
# Filter rules by pattern (e.g., only download UV-related rules)
./apply-rules.sh --filter "uv*" /path/to/your/project
# Filter multiple rule types (e.g., UV and Python rules)
./apply-rules.sh --filter "uv*|python*" /path/to/your/projectParameters:
--ow: Optional flag to overwrite existing rules--filter PATTERN: Optional regex pattern to filter which rules to download<target_directory>: Required path where rules will be downloaded
After running the script:
- Reindex the project, so new rules are applied.
- Enjoy enhanced AI interactions!
- Structured Organization - Logically organized rules by domain and purpose
- Improved AI Responses - Guidelines for more helpful and consistent AI assistance
- Development Workflows - Optimized patterns for git, directory management, and more
- Language-Specific Rules - Specialized rules for Markdown and other languages
- Customizable Framework - Easily extend with your own rules
All rules are now stored directly in the .cursor/rules/ directory using a flat structure for simplicity and ease of management.
clean-code.mdc- Code Quality Guidelinescoding-principles.mdc- Code Quality Principlescursor-rules.mdc- Cursor Rules Formatemoji-usage.mdc- Emoji Usage Guidelinesgitflow.mdc- Gitflow Workflow Rules
commit-message.mdc- Semantic Commit Messagesdirectory-listing.mdc- Directory Listing Guidelinesgit.mdc- Git Command Usage
cpp.mdc- C++ Programming Guidelinestailwind.mdc- Tailwind CSS Best Practicesgolang.mdc- Go (Golang) Coding Standardsgolang-project-structure.mdc- Go Project Structure Best Practicesformatting.mdc- Markdown Formatting Standardsnode-express.mdc- Node.js and Express.js Best Practicesphp.mdc- PHP Coding Standards and Best Practicesphp-7.4.mdc- PHP 7.4 Features and Best Practicesphp-8.0.mdc- PHP 8.0 Features and Best Practicesphp-8.1.mdc- PHP 8.1 Features and Best Practicesphp-8.2.mdc- PHP 8.2 Features and Best Practicesphp-8.3.mdc- PHP 8.3 Features and Best Practicesphpunit-test.mdc- PHPUnit Testing Best Practicesfastapi.mdc- FastAPI Best Practicespython.mdc- Python Best Practicesnextjs.mdc- Next.js Best Practicesreact.mdc- React Best Practicesdatabase.mdc- Database Best Practicessvelte.mdc- Svelte Best Practicestypescript.mdc- TypeScript Best Practicesuv-tool-usage.mdc- UV Python Package Manager Best Practicesvue.mdc- Vue.js Best Practices
For optimal experience with .mdc files and to avoid flaky behavior of Cursor's MDC editor:
{
"files.associations": {
"*.mdc": "markdown"
},
"workbench.editorAssociations": {
"*.mdc": "default"
}
}This configuration sets the default text editor for .mdc files and enables markdown syntax highlighting.
During active development of your rules:
# Add to .cursorindexignore
.cursor/rules/*
This prevents rules from being embedded in the index while they're changing rapidly. After finalizing your rules, remove this entry and manually rebuild the index for better rule accessibility.
- Just ask agent to create new rule, outlining desired properties and application plain.
- Review and work on the rule with agent.
- Save and commit.
When creating or deleting rules:
- Update the
RULESarray in theapply-rules.shscript to keep it synchronized - Maintain alphabetical order in the array for easy management
- Commit both the rule changes and script updates together
For Cursor to apply updated or newly created rules:
- Restart the context so rules can be re-indexed, or
- Explicitly specify the updated rule files for Cursor to reindex them
The .ai/meta-prompt-example.md file provides a sample "User rule" that implements a self-questioning reasoning framework. This approach enhances the AI's problem-solving capabilities through structured internal dialogue.
Important: This approach is optimized for Cursor and not recommended for other AI platforms that may bill differently based on output token usage. The self-questioning framework generates substantial output tokens which could result in higher costs on platforms with different billing models.
Contributions are welcome! If you have ideas for new rules or improvements to existing ones, please:
- Fork the repository
- Create your feature branch
- Submit a pull request