agentleFS
jimmypocockjimmypocock/cursor-rules/.cursor/rules/base.mdc

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.

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
  1. Distinctive:

    Write clean, readable, and maintainable code with consistent formatting

    line 18
  2. Distinctive:

    Follow DRY (Don't Repeat Yourself) principles

    line 20
  3. Distinctive:

    Consider future maintenance when designing components and architecture

    line 22
  4. Distinctive:

    Ensure proper error handling throughout the application

    line 23
  5. Distinctive:

    Write comprehensive documentation for all important code

    line 24
  6. Distinctive:

    Always consider security implications of your implementation

    line 25
  7. Distinctive:

    Use descriptive, meaningful names for all variables, functions, and classes

    line 30
  8. Very specific:

    Use camelCase for variables and functions (e.g., getUserData)

    line 31
  9. Very specific:

    Use PascalCase for classes and components (e.g., UserProfile)

    line 32
  10. Very specific:

    Use UPPER_SNAKE_CASE for constants (e.g., MAX_RETRY_COUNT)

    line 33
  11. Very specific:

    Use plurals for arrays/collections (e.g., users, eventIds)

    line 36
  12. Distinctive:

    Use 2-space indentation for all code

    line 39
  13. Distinctive:

    Add blank lines to separate logical blocks of code

    line 41
  14. Distinctive:

    Place opening braces on the same line as their statement

    line 42
  15. Distinctive:

    Always use curly braces for control statements, even for single-line blocks

    line 43
  16. Distinctive:

    Use consistent spacing around operators

    line 44
  17. Distinctive:

    Write self-documenting code where possible

    line 47
  18. Distinctive:

    Add comments explaining "why", not "what" the code does

    line 48
  19. Distinctive:

    Use JSDoc/TSDoc comments for public APIs and functions

    line 49
  20. Distinctive:

    Document expected input/output and potential edge cases

    line 51
  21. Distinctive:

    Never silently catch errors without proper handling or logging

    line 54
  22. Distinctive:

    Use specific error types when throwing exceptions

    line 55
  23. Distinctive:

    Add useful error messages that help with debugging

    line 57
  24. Distinctive:

    Write unit tests for critical business logic

    line 61
  25. Distinctive:

    Use integration tests for validating component interactions

    line 62
  26. Distinctive:

    Follow the Arrange-Act-Assert pattern in tests

    line 64
  27. Distinctive:

    Write tests that validate both normal and error cases

    line 66
  28. Distinctive:

    Avoid unnecessary re-renders in UI components

    line 70
  29. Distinctive:

    Use profiling tools to identify and fix bottlenecks

    line 74
  30. Distinctive:

    Never trust user input - always validate and sanitize

    line 77
  31. Distinctive:

    Use parameterized queries to prevent injection attacks

    line 78
  32. Distinctive:

    Never hardcode sensitive information in code

    line 79
  33. Distinctive:

    Keep dependencies updated to avoid vulnerabilities

    line 82
  34. Distinctive:

    Ensure applications are usable with screen readers

    line 85
  35. Distinctive:

    Use semantic HTML for better accessibility

    line 87
  36. Distinctive:

    Add appropriate ARIA attributes when necessary

    line 88
  37. Distinctive:

    Test with keyboard navigation

    line 89
  38. Distinctive:

    Follow green coding practices where possible

    line 94
  39. Distinctive:

    Document architectural decisions and their rationales

    line 101
  40. Distinctive:

    Always explain the intended changes and reasoning before making any modifications

    line 106
  41. Distinctive:

    Document the current state and why it exists

    line 107
  42. Distinctive:

    When encountering errors, first understand and explain the root cause

    line 112
  43. Distinctive:

    Document why the error is occurring before suggesting fixes

    line 113
  44. Distinctive:

    Never make changes without understanding the full context

    line 114
  45. Distinctive:

    If the cause is unclear, ask for clarification

    line 115
  46. Distinctive:

    Document why patterns exist before suggesting changes

    line 119
  47. Distinctive:

    Never "fix" working patterns without clear justification

    line 120
  48. Distinctive:

    When unsure about anything, ask for clarification

    line 124
  49. Distinctive:

    Never make assumptions about code patterns or conventions

    line 125
  50. Distinctive:

    Document uncertainties and get confirmation

    line 126
  51. Distinctive:

    If a change seems complex, break it down and get approval for each step

    line 127

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
base.mdc
---
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

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.