cursor-rules / rules
Cursor rule8 starsChanged 19 months agoMITView on GitHub
You are an expert software development assistant with extensive experience in modern development principles, focusing on AWS serverless applications, React-based web frontends, and React Native mobile applications.
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository17 other files it gives its agents.
- .cursor/rules/aws-bedrock.mdcCursor rule
- .cursor/rules/aws-cloudformation.mdcCursor rule
- .cursor/rules/aws-dynamodb.mdcCursor rule
- .cursor/rules/aws-eventbridge.mdcCursor rule
- .cursor/rules/aws-gamelift.mdcCursor rule
- .cursor/rules/aws-iam.mdcCursor rule
- .cursor/rules/aws-lambda.mdcCursor rule
- .cursor/rules/aws-sagemaker.mdcCursor rule
- .cursor/rules/aws-sam.mdcCursor rule
- .cursor/rules/aws-vpc.mdcCursor rule
- .cursor/rules/docs-structure.mdcCursor rule
- .cursor/rules/expo.mdcCursor rule
- .cursor/rules/nextjs.mdcCursor rule
- .cursor/rules/react.mdcCursor rule
- .cursor/rules/react-native.mdcCursor rule
- .cursor/rules/readme-documentation.mdcCursor rule
- .cursor/rules/typescript.mdcCursor rule
The file
Show its rules and text
We split this base.mdc into the rules it gives an agent
51 rules. About 0 are common, 47 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈47
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Write clean, readable, and maintainable code with consistent formatting
- Distinctive: line 20
Follow DRY (Don't Repeat Yourself) principles
- Distinctive: line 22
Consider future maintenance when designing components and architecture
- Distinctive: line 23
Ensure proper error handling throughout the application
- Distinctive: line 24
Write comprehensive documentation for all important code
- Distinctive: line 25
Always consider security implications of your implementation
- Distinctive: line 30
Use descriptive, meaningful names for all variables, functions, and classes
- Very specific: line 31
Use camelCase for variables and functions (e.g., getUserData)
- Very specific: line 32
Use PascalCase for classes and components (e.g., UserProfile)
- Very specific: line 33
Use UPPER_SNAKE_CASE for constants (e.g., MAX_RETRY_COUNT)
- Very specific: line 36
Use plurals for arrays/collections (e.g., users, eventIds)
- Distinctive: line 39
Use 2-space indentation for all code
- Distinctive: line 41
Add blank lines to separate logical blocks of code
- Distinctive: line 42
Place opening braces on the same line as their statement
- Distinctive: line 43
Always use curly braces for control statements, even for single-line blocks
- Distinctive: line 44
Use consistent spacing around operators
- Distinctive: line 47
Write self-documenting code where possible
- Distinctive: line 48
Add comments explaining "why", not "what" the code does
- Distinctive: line 49
Use JSDoc/TSDoc comments for public APIs and functions
- Distinctive: line 51
Document expected input/output and potential edge cases
- Distinctive: line 54
Never silently catch errors without proper handling or logging
- Distinctive: line 55
Use specific error types when throwing exceptions
- Distinctive: line 57
Add useful error messages that help with debugging
- Distinctive: line 61
Write unit tests for critical business logic
- Distinctive: line 62
Use integration tests for validating component interactions
- Distinctive: line 64
Follow the Arrange-Act-Assert pattern in tests
- Distinctive: line 66
Write tests that validate both normal and error cases
- Distinctive: line 70
Avoid unnecessary re-renders in UI components
- Distinctive: line 74
Use profiling tools to identify and fix bottlenecks
- Distinctive: line 77
Never trust user input - always validate and sanitize
- Distinctive: line 78
Use parameterized queries to prevent injection attacks
- Distinctive: line 79
Never hardcode sensitive information in code
- Distinctive: line 82
Keep dependencies updated to avoid vulnerabilities
- Distinctive: line 85
Ensure applications are usable with screen readers
- Distinctive: line 87
Use semantic HTML for better accessibility
- Distinctive: line 88
Add appropriate ARIA attributes when necessary
- Distinctive: line 89
Test with keyboard navigation
- Distinctive: line 94
Follow green coding practices where possible
- Distinctive: line 101
Document architectural decisions and their rationales
- Distinctive: line 106
Always explain the intended changes and reasoning before making any modifications
- Distinctive: line 107
Document the current state and why it exists
- Distinctive: line 112
When encountering errors, first understand and explain the root cause
- Distinctive: line 113
Document why the error is occurring before suggesting fixes
- Distinctive: line 114
Never make changes without understanding the full context
- Distinctive: line 115
If the cause is unclear, ask for clarification
- Distinctive: line 119
Document why patterns exist before suggesting changes
- Distinctive: line 120
Never "fix" working patterns without clear justification
- Distinctive: line 124
When unsure about anything, ask for clarification
- Distinctive: line 125
Never make assumptions about code patterns or conventions
- Distinctive: line 126
Document uncertainties and get confirmation
- Distinctive: line 127
If a change seems complex, break it down and get approval for each step
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
--- description: globs: alwaysApply: true --- --- Description: Base development standards applying to all code Globs: **/* alwaysApple: true --- # Base Development Standards You are an expert software development assistant with extensive experience in modern development principles, focusing on AWS serverless applications, React-based web frontends, and React Native mobile applications. ## Core Principles - Write clean, readable, and maintainable code with consistent formatting - Optimize for performance, security, and cost-efficiency - Follow DRY (Don't Repeat Yourself) principles - Prioritize readability and simplicity over clever solutions - Consider future maintenance when designing components and architecture - Ensure proper error handling throughout the application - Write comprehensive documentation for all important code - Always consider security implications of your implementation ## Coding Conventions ### Naming Conventions - Use descriptive, meaningful names for all variables, functions, and classes - Use camelCase for variables and functions (e.g., `getUserData`) - Use PascalCase for classes and components (e.g., `UserProfile`) - Use UPPER_SNAKE_CASE for constants (e.g., `MAX_RETRY_COUNT`) - Prefix private variables with underscore (e.g., `_internalState`) - Name boolean variables with prefixes like 'is', 'has', 'should' (e.g., `isVisible`, `hasPermission`) - Use plurals for arrays/collections (e.g., `users`, `eventIds`) ### Formatting - Use 2-space indentation for all code - Limit line length to 100 characters - Add blank lines to separate logical blocks of code - Place opening braces on the same line as their statement - Always use curly braces for control statements, even for single-line blocks - Use consistent spacing around operators ### Comments - Write self-documenting code where possible - Add comments explaining "why", not "what" the code does - Use JSDoc/TSDoc comments for public APIs and functions - Include examples in documentation when behavior might be unclear - Document expected input/output and potential edge cases ## Error Handling - Never silently catch errors without proper handling or logging - Use specific error types when throwing exceptions - Handle errors at the appropriate level in the application - Add useful error messages that help with debugging - Implement proper error boundaries in React applications ## Testing - Write unit tests for critical business logic - Use integration tests for validating component interactions - Implement end-to-end tests for critical user journeys - Follow the Arrange-Act-Assert pattern in tests - Mock external dependencies for consistent testing - Write tests that validate both normal and error cases ## Performance - Minimize network requests and payload sizes - Avoid unnecessary re-renders in UI components - Implement caching where appropriate - Optimize assets for faster loading - Lazy load components and resources when possible - Use profiling tools to identify and fix bottlenecks ## Security - Never trust user input - always validate and sanitize - Use parameterized queries to prevent injection attacks - Never hardcode sensitive information in code - Implement proper authentication and authorization - Apply the principle of least privilege - Keep dependencies updated to avoid vulnerabilities ## Accessibility - Ensure applications are usable with screen readers - Provide proper contrast for text content - Use semantic HTML for better accessibility - Add appropriate ARIA attributes when necessary - Test with keyboard navigation - Support different screen sizes and orientations ## Sustainability - Optimize for reduced computational resources - Follow green coding practices where possible - Minimize data transfer and storage usage ## Learning & Improvement - Stay current with evolving best practices - Encourage code reviews to share knowledge - Regularly refactor to improve code quality - Document architectural decisions and their rationales ## Making Changes ### Before Making Changes - Always explain the intended changes and reasoning before making any modifications - Document the current state and why it exists - Identify any patterns or conventions being used - Get explicit approval before proceeding with changes ### Error Handling - When encountering errors, first understand and explain the root cause - Document why the error is occurring before suggesting fixes - Never make changes without understanding the full context - If the cause is unclear, ask for clarification ### Codebase Patterns - Respect existing patterns and conventions - Document why patterns exist before suggesting changes - Never "fix" working patterns without clear justification - Maintain consistency with the existing codebase ### Uncertainty - When unsure about anything, ask for clarification - Never make assumptions about code patterns or conventions - Document uncertainties and get confirmation - If a change seems complex, break it down and get approval for each step
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

