prompt-decorators / rules
Cursor rule44 starsChanged 20 months agoApache-2.0View on GitHub
Use ALWAYS when asked to CREATE A RULE or UPDATE A RULE or taught a lesson from the user that should be retained as a new rule for Cursor
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 4,157 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 repository6 other files it gives its agents.
- .cursor/rules/001-emoji-communication.mdcCursor rule
- .cursor/rules/050-careful-code-modification.mdcCursor rule
- .cursor/rules/060-coding-patterns.mdcCursor rule
- .cursor/rules/070-workflow-preferences.mdcCursor rule
- .cursor/rules/400-md-docs.mdcCursor rule
- .cursor/rules/900-software-dev-decorators.mdcCursor rule
The file
Show its rules and text
We split this 000-cursor-rules.mdc into the rules it gives an agent
14 rules. About 0 are common, 14 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈14
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 77
Use Concise Markdown primarily
- Distinctive: line 86
Always indent content within XML or nested XML tags by 2 spaces
- Distinctive: line 87
Keep rules as short as possbile
- Distinctive: line 88
Use Mermaid syntax if it will be shorter or clearer than describing a complex rule
- Distinctive: line 89
Use Emojis where appropriate to convey meaning that will improve rule understanding by the AI Agent
- Distinctive: line 90
Keep examples as short as possible to clearly convey the positive or negative example
- Distinctive: line 94
Use precise, deterministic ACTION TRIGGER OUTCOME format in descriptions
- Distinctive: line 97
Remove any non-essential or redundant information
- Distinctive: line 98
Use standard glob patterns without quotes (e.g., *.js, src//*.ts)
- Distinctive: line 102
Keep frontmatter description under 120 characters (or less) while maintaining clear intent for rule selection by AI AGent
- Distinctive: line 104
Use hierarchical structure for quick parsing
- Distinctive: line 105
Remove redundant information across sections
- Distinctive: line 110
NEVER include verbose explanations or redundant context that increases AI token overhead
- Distinctive: line 111
Keep file as short and to the point as possible BUT NEVER at the expense of sacrificing rule impact and usefulness for the AI Agent.
≈ “Common” is an estimate: at least 1 in 5 of the 6,668 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: Use ALWAYS when asked to CREATE A RULE or UPDATE A RULE or taught a lesson from the user that should be retained as a new rule for Cursor
globs: .cursor/rules/*.mdc
---
# Cursor Rules Format
## Core Structure
```mdc
---
description: ACTION when TRIGGER to OUTCOME
globs: *.mdc
---
# Rule Title
## Context
- When to apply this rule
- Prerequisites or conditions
## Requirements
- Concise, actionable items
- Each requirement must be testable
## Examples
<example>
Good concise example with explanation
</example>
<example type="invalid">
Invalid concise example with explanation
</example>
```
## File Organization
### Location
- Path: `.cursor/rules/`
- Extension: `.mdc`
### Naming Convention
PREFIX-name.mdc where PREFIX is:
- 0XX: Core standards
- 1XX: Tool configs
- 3XX: Testing standards
- 1XXX: Language rules
- 2XXX: Framework rules
- 8XX: Workflows
- 9XX: Templates
- _name.mdc: Private rules
### Glob Pattern Examples
Common glob patterns for different rule types:
- Core standards: .cursor/rules/*.mdc
- Language rules: src/**/*.{js,ts}
- Testing standards: **/*.test.{js,ts}
- React components: src/components/**/*.tsx
- Documentation: docs/**/*.md
- Configuration files: *.config.{js,json}
- Build artifacts: dist/**/*
- Multiple extensions: src/**/*.{js,jsx,ts,tsx}
- Multiple files: dist/**/*, docs/**/*.md
## Required Fields
### Frontmatter
- description: ACTION TRIGGER OUTCOME format
- globs: `glob pattern for files and folders`
### Body
- <version>X.Y.Z</version>
- context: Usage conditions
- requirements: Actionable items
- examples: Both valid and invalid
## Formatting Guidelines
- Use Concise Markdown primarily
- XML tags limited to:
- <example>
- <danger>
- <required>
- <rules>
- <rule>
- <critical>
- <version>
- Always indent content within XML or nested XML tags by 2 spaces
- Keep rules as short as possbile
- Use Mermaid syntax if it will be shorter or clearer than describing a complex rule
- Use Emojis where appropriate to convey meaning that will improve rule understanding by the AI Agent
- Keep examples as short as possible to clearly convey the positive or negative example
## AI Optimization Tips
1. Use precise, deterministic ACTION TRIGGER OUTCOME format in descriptions
2. Provide concise positive and negative example of rule application in practice
3. Optimize for AI context window efficiency
4. Remove any non-essential or redundant information
5. Use standard glob patterns without quotes (e.g., *.js, src/**/*.ts)
## AI Context Efficiency
1. Keep frontmatter description under 120 characters (or less) while maintaining clear intent for rule selection by AI AGent
2. Limit examples to essential patterns only
3. Use hierarchical structure for quick parsing
4. Remove redundant information across sections
5. Maintain high information density with minimal tokens
6. Focus on machine-actionable instructions over human explanations
<critical>
- NEVER include verbose explanations or redundant context that increases AI token overhead
- Keep file as short and to the point as possible BUT NEVER at the expense of sacrificing rule impact and usefulness for the AI Agent.
- the front matter can ONLY have the fields description and globs.
</critical>
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.

