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.
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.
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
- 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
- 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
- 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
- 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
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- Clone this repository to your local machine
- Copy rule files to your Cursor rules directory (typically
~/.cursor/rules/) - Restart Cursor to load the new rules
- Rules will automatically apply when working with matching file types
- Modify existing rules to match your team's specific requirements
- Add new rules for additional languages or frameworks
- Adjust
alwaysApplysettings based on your preferences - Update file patterns in
globsto match your project structure
- Create a new
.mdcfile in the appropriate language directory - Follow the established format with proper frontmatter
- Include comprehensive guidelines and best practices
- Test the rule with actual code to ensure it works as expected
- 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
- 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
- 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
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
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.