This repository contains a comprehensive collection of Cursor.sh rules and best practices for Ruby and Ruby on Rails API development. These rules are designed to enhance your development experience by providing consistent guidelines, automated suggestions, and practical examples within the Cursor editor.
The rules are organized into several categories:
api.mdc
: Detailed API design guidelines, response formats, authentication, and performance optimizationsclean_code.mdc
: Comprehensive best practices for writing clean, maintainable code with practical examplescontrollers.mdc
: Controller-specific patterns and best practicesdatabase.mdc
: Database design, optimization guidelines, and query best practicesdesign_patterns.mdc
: Extensive guide on common design patterns with real-world implementation examplesgeneral.mdc
: General development practices and conventionsruby.mdc
: Ruby language specific guidelines and best practices
security.mdc
: Comprehensive security best practices, including authentication, data protection, and API securityperfomance.mdc
: Performance optimization guidelines and monitoring strategiesmonitoring.mdc
: Application and infrastructure monitoring, logging, and metrics collection
serializers.mdc
: Serialization patterns and best practices for API responsesswagger.mdc
: API documentation guidelines using Swagger/OpenAPI
git.mdc
: Git workflow and commit message conventionsdeployment.mdc
: Deployment strategies, CI/CD configuration, and infrastructure managementtesting.mdc
: Testing strategies, patterns, and best practices
- Comprehensive Examples: Each rule category includes practical code examples
- Modern Practices: Up-to-date with current Ruby/Rails best practices
- Security Focus: Strong emphasis on security best practices
- Performance Optimization: Detailed guidelines for optimizing application performance
- Monitoring & Observability: Complete monitoring and logging setup examples
- Infrastructure Management: Deployment and infrastructure configuration templates
- Clone this repository:
git clone https://github.com/nduartex/cursor-rules-ruby-api.git
- Copy the
.cursor
directory to your Ruby/Rails project:
cp -r cursor-rules-ruby-api/.cursor your-project/
- Cursor will automatically load these rules and provide suggestions based on them.
- Consistent JSON response format
- Proper error handling
- Authentication and authorization
- Rate limiting and pagination
- Performance optimization
- SOLID principles implementation
- Method and class organization
- Naming conventions
- Error handling patterns
- Code examples of good vs bad practices
- Authentication best practices
- Data encryption
- API security measures
- Secure headers configuration
- Audit logging
- Application monitoring setup
- Infrastructure monitoring
- Logging best practices
- CI/CD configuration
- Feature flags implementation
- Health checks
Feel free to submit pull requests to improve existing rules or add new ones. Please ensure your contributions:
- Include practical examples
- Follow Ruby/Rails best practices
- Include proper documentation
- Add tests when applicable
- Consider security implications