Skip to content

Set of go to cursor rules for multiple languages and tools

Notifications You must be signed in to change notification settings

shawk08033/Cursor-Rules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Cursor Rules Repository

A comprehensive collection of coding standards and best practices for different programming languages and frameworks, designed to be used with Cursor IDE's rule system.

Overview

This repository contains structured rules and guidelines that help maintain consistent code quality, security standards, and development practices across different technology stacks. Each rule is designed to be automatically applied by Cursor IDE to ensure adherence to best practices.

Repository Structure

Cursor-Rules/
├── PHP/
│   ├── php.mdc          # PHP coding standards and best practices
│   └── testing.mdc      # PHP testing guidelines
├── React/
│   ├── react.mdc        # React development best practices
│   └── testing.mdc      # React testing guidelines
└── README.md           # This file

Available Rules

PHP Rules

php.mdc - PHP Coding Standards

  • Purpose: Comprehensive PHP development guidelines
  • Coverage: Code organization, security, naming conventions, documentation
  • Key Features:
    • Directory structure best practices
    • Security guidelines (input validation, authentication)
    • File naming conventions
    • Comment generation standards
    • Error handling practices

testing.mdc - PHP Testing Guidelines

  • Purpose: PHP application testing workflow
  • Coverage: API testing, authentication, Docker integration
  • Key Features:
    • API endpoint testing with curl
    • Authentication troubleshooting
    • Docker container management
    • Environment setup verification

React Rules

react.mdc - React Best Practices

  • Purpose: Modern React development standards
  • Coverage: Component structure, state management, performance
  • Key Features:
    • Functional components and hooks usage
    • State management best practices
    • Performance optimization techniques
    • API constants organization

testing.mdc - React Testing Guidelines

  • Purpose: React application testing workflow
  • Coverage: Playwright testing, environment setup, error handling
  • Key Features:
    • Playwright MCP tool integration
    • Environment and credential management
    • Test data handling
    • Screenshot and file management

Rule File Format

Each rule file uses the following format:

---
description: Brief description of the rule's purpose
globs: File patterns to apply the rule to
alwaysApply: Whether to always apply the rule (true/false)
---

# Rule Title

## Section Name
- Specific guideline or instruction
- Another guideline

Usage

Setting Up Rules in Cursor

  1. Clone this repository to your local machine
  2. Copy rule files to your Cursor rules directory (typically ~/.cursor/rules/)
  3. Restart Cursor to load the new rules
  4. Rules will automatically apply when working with matching file types

Customizing Rules

  • Modify existing rules to match your team's specific requirements
  • Add new rules for additional languages or frameworks
  • Adjust alwaysApply settings based on your preferences
  • Update file patterns in globs to match your project structure

Contributing

Adding New Rules

  1. Create a new .mdc file in the appropriate language directory
  2. Follow the established format with proper frontmatter
  3. Include comprehensive guidelines and best practices
  4. Test the rule with actual code to ensure it works as expected

Rule Guidelines

  • Be specific: Provide clear, actionable instructions
  • Include examples: Use code examples where helpful
  • Cover edge cases: Address common issues and troubleshooting
  • Maintain consistency: Follow the established format and style

Best Practices

Rule Development

  • Focus on automation: Rules should be specific enough for automated application
  • Include context: Explain why certain practices are recommended
  • Stay current: Keep rules updated with latest language/framework versions
  • Test thoroughly: Verify rules work correctly with actual code

Rule Organization

  • Group by language/framework: Keep related rules together
  • Use clear naming: Make rule purposes obvious from filenames
  • Maintain documentation: Keep README updated with new rules
  • Version control: Track changes and improvements over time

Support

For issues or questions about specific rules:

  • Check the rule file comments for clarification
  • Review the language-specific documentation
  • Consider the context and specific use case

License

This repository is provided as-is for educational and development purposes. Feel free to adapt and modify rules to suit your specific needs.


Note: These rules are designed to work with Cursor IDE's rule system. Make sure you have the latest version of Cursor for optimal compatibility.

About

Set of go to cursor rules for multiple languages and tools

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published