Back to .md Directory

Cursor rules documentation

Documents Cursor editor rules for enforcing consistent formatting and structure in a codebase, with configurable JSON and file-based rules.

May 2, 2026
0 downloads
1 views
ai cursor
View source

What this file does

Documents Cursor editor rules for enforcing consistent formatting and structure in a codebase, with configurable JSON and file-based rules.

When to use it

  • Setting up Cursor rules for a team project
  • Enforcing heading case and Jira ticket conventions
  • Adding custom linting rules to Cursor editor
  • Standardizing markdown formatting across a repo

Assumes this stack

CursorJSONMarkdown

Cursor rules documentation

This directory contains rules that Cursor uses to enforce consistent formatting and structure in our codebase.

Rule structure

Rules defined in the config.json follow this structure:

{
	"version": 1,
	"rules": {
		"category": {
			"rule_name": {
				"enabled": true,
				"pattern": "regex_pattern",
				"message": "Error message"
			}
		}
	}
}

Additional, more specific rules can be found in the rules directory in either a json or mdc format.

Available rules

Text formatting

  • heading_case: Enforces sentence case in headings with specific exceptions
    • Applies to: .md, .txt, .mdx files
    • Exceptions: Technical terms and acronyms

Jira tickets

  • ticket_title: Validates Jira ticket title format
    • Optional component in brackets
    • Max length: 80 characters
  • required_sections: Ensures required sections are present
  • templates: Enforces template structure for different ticket types
  • labels: Validates that only allowed labels are used
  • issue_types: Ensures correct issue type selection

Usage

  1. Cursor will automatically enforce these rules while editing relevant files; however, if you wish to enable a rule that is not triggered by default, you can do so by @ mentioning it in the chat.
  2. Rules can be toggled using the enabled flag
  3. Custom error messages will be shown when rules are violated
  4. Exceptions are handled through the exceptions field in relevant rules

Updating rules

To modify these rules:

  1. Edit the config.json or the appropriate file in the rules directory
  2. Try to follow the existing structure and format where possible
  3. Ensure valid regex patterns, where applicable
  4. Include clear error messages
  5. Test changes before committing

What's inside

1 rule structure example, 2 rule categories with 6 sub-rules, usage and update instructions

Change this for your project

  • Replace adobe/spectrum-css with your own repository name
  • Replace config.json path with your own rules file location
  • Replace rules directory path with your own rules directory

Where it goes

Keep it in your repository where the agent or team that needs it will read it.

Related Documents