Cursor Rules
Introduction to Cursor Rules
Cursor rules are a core feature of this template, providing AI-guidance for development.
These rules are stored in the .cursor/rules/
directory and serve several purposes:
Guide the Cursor AI: Provide context-specific guidance to the Cursor AI assistant
Enforce Standards: Establish consistent coding and documentation standards
Streamline Development: Provide templates and patterns for common tasks
Ensure Quality: Set expectations for testing, code review, and documentation
The rules are written in .mdc
files (Markdown with YAML frontmatter) that Cursor’s AI can interpret
and apply during development.
Rule Structure
Each rule file typically has:
Metadata Section: YAML frontmatter that defines: -
description
: Brief purpose of the rule -globs
: File patterns where the rule applies -alwaysApply
: Whether the rule applies without being explicitly invokedContent Section: Markdown content that includes: - Headers and sections for organization - Code examples and patterns - Guidelines and requirements - Best practices and recommendations
How Rules Work
When using Cursor as your editor:
The AI automatically loads these rules at startup
When you work with files that match the rule’s glob patterns, the relevant rules are applied
The AI uses these rules to provide context-aware suggestions and assistance
You can also explicitly instruct the AI to follow specific rules
Customizing Rules
When using this template for your own project, you should:
Keep the generic rules as-is for standard guidance
Create new project-specific rule files to add your own standards and patterns
Don’t modify the existing generic rules directly unless contributing back to the template
Creating custom rules is covered in the Customization section.
For detailed documentation of all available rules, see the Rule Documentation section.