← Back to Blog

Creating Project-Specific AI Rules


Creating Project-Specific AI Rules


Different projects need different rules. Here's how to tailor your cursor rules for various scenarios.


Next.js Projects


For Next.js, emphasize:

  • App Router vs Pages Router conventions
  • Server vs Client Components
  • Data fetching patterns
  • Image optimization

  • React Projects


    Focus on:

  • Component patterns (functional vs class)
  • State management approach
  • Hook usage guidelines
  • Performance optimization techniques

  • Python Projects


    Specify:

  • PEP 8 compliance
  • Type hints requirements
  • Virtual environment expectations
  • Testing framework preferences

  • API Development


    Include:

  • REST vs GraphQL conventions
  • Error response formats
  • Authentication patterns
  • Documentation requirements

  • Monorepo Projects


    Address:

  • Package boundaries
  • Shared code conventions
  • Import path rules
  • Build and test configurations

  • Team Considerations


    When writing rules for team projects:

  • Document the reasoning behind rules
  • Keep rules in version control
  • Review rules in PRs
  • Update rules during retrospectives

  • Template Approach


    Consider creating rule templates for common project types, then customizing for specific needs. CursorRulesSpark can help generate these templates quickly.


    Generate your own cursor rules with CursorRulesSpark