Cursor rule
.cursor/rules/999-mdc-format.mdcUse when user asks to create or update *.mdc files
Cursor rules
Quality
73/100
Scores the file, not the repository.Length
665 words
16 headings · 5 code blocksRepository
1
— · pushed 196 days agoLast changed
3 days ago
First indexed 3 days ago.123456# MDC File Format Guide78MDC (Markdown Configuration) files are used by Cursor to provide context-specific instructions to AI assistants. This guide explains how to create and maintain these files properly.910## File Structure1112Each MDC file consists of two main parts:13141. **Frontmatter** - Configuration metadata at the top of the file152. **Markdown Content** - The actual instructions in Markdown format1617### Frontmatter1819The frontmatter must be the first thing in the file and must be enclosed between triple-dash lines (`---`). Configuration should be based on the intended behavior:2021```22---23description: Brief description of what the rule does24globs: **/*.ts, **/*.ts # Optional: Comma-separated list, not an array25alwaysApply: false # Set to true for global rules26---27```2829> **Important**: Despite the appearance, the frontmatter is not strictly YAML formatted. The `globs` field is a comma-separated list and should NOT include brackets `[]` or quotes `"`.3031#### Guidelines for Setting Fields3233- **description**: Should be agent-friendly and clearly describe when the rule is relevant. Format as `<topic>: <details>` for best results.34- **globs**:35 - If a rule is only relevant in very specific situations, leave globs empty so it's loaded only when applicable to the user request.36 - If the only glob would match all files (like `**/*`), leave it empty and set `alwaysApply: true` instead.37 - Otherwise, be as specific as possible with glob patterns to ensure rules are only applied with relevant files.38- **alwaysApply**: Use sparingly for truly global guidelines.3940#### Glob Pattern Examples4142- `**/*.js` - All JavaScript files43- `src/**/*.jsx` - All JSX files in the src directory44- `**/components/**/*.vue` - All Vue files in any components directory4546### Markdown Content4748After the frontmatter, the rest of the file should be valid Markdown:4950```markdown51# Title of Your Rule5253## Section 154- Guidelines and information55- Code examples5657## Section 258More detailed information...59```6061## Special Features6263### File References6465You can reference other files from within an MDC file using the markdown link syntax:6667```68[rule-name.mdc](mdc:location/of/the/rule.mdc)69```7071When this rule is activated, the referenced file will also be included in the context.7273### Code Blocks7475Use fenced code blocks for examples:7677```markdown78```javascript79// Example code80function example() {81 return "This is an example";82}83```84```8586## Best Practices87881. **Clear Organization**89 - Use numbered prefixes (e.g., `01-workflow.mdc`) for sorting rules logically90 - Place task-specific rules in the `tasks/` subdirectory91 - Use descriptive filenames that indicate the rule's purpose92932. **Frontmatter Specificity**94 - Be specific with glob patterns to ensure rules are only applied in relevant contexts95 - Use `alwaysApply: true` for truly global guidelines96 - Make descriptions clear and concise so AI knows when to apply the rule97983. **Content Structure**99 - Start with a clear title (H1)100 - Use hierarchical headings (H2, H3, etc.) to organize content101 - Include examples where appropriate102 - Keep instructions clear and actionable1031044. **File Size Considerations**105 - Keep files focused on a single topic or closely related topics106 - Split very large rule sets into multiple files and link them with references107 - Aim for under 300 lines per file when possible108109## Usage in Cursor110111When working with files in Cursor, rules are automatically applied when:1121131. The file you're working on matches a rule's glob pattern1142. A rule has `alwaysApply: true` set in its frontmatter1153. The agent thinks the rule's description matches the user request1164. You explicitly reference a rule in a conversation with Cursor's AI117118## Creating/Renaming/Removing Rules119120- When a rule file is added/renamed/removed, update also the list under [010-workflow.mdc](mdc:.cursor/rules/010-workflow.mdc).121- When changes are made to multiple `mdc` files from a single request, review also [999-mdc-format.mdc](mdc:.cursor/rules/999-mdc-format.mdc) to consider whether to update it too.122123## Updating Rules124125When updating existing rules:1261271. Maintain the frontmatter format1282. Keep the same glob patterns unless intentionally changing the rule's scope1293. Update the description if the purpose of the rule changes1304. Consider whether changes should propagate to related rules131132```
Also in stvmachine/arr-config
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| stvmachine/arr-config.cursor/rules/010-workflow.mdc · 1 | Cursor rules | gitdo-notagent-behaviour | 46/100 | 3 days ago | |
| stvmachine/arr-config.cursor/rules/011-conventional-commits.mdc · 1 | Cursor rules | typesgit | 45/100 | 3 days ago | |
| stvmachine/arr-config.cursor/rules/012-minimal-code-changes.mdc · 1 | Cursor rules | no sections | 4/100 | 3 days ago | |
| stvmachine/arr-config.cursor/rules/030-bug-handling.mdc · 1 | Cursor rules | no sections | 16/100 | 3 days ago | |
| stvmachine/arr-config.cursor/rules/040-python-style.mdc · 1 | Cursor rules | style | 20/100 | 3 days ago | |
| stvmachine/arr-config.cursor/rules/050-docker-compose.mdc · 1 | Cursor rules | no sections | 16/100 | 3 days ago | |
| stvmachine/arr-config.cursor/rules/070-best-practices.mdc · 1 | Cursor rules | stylesecuritydo-not | 27/100 | 3 days ago | |
| stvmachine/arr-config.cursor/rules/080-common-tasks.mdc · 1 | Cursor rules | no sections | 25/100 | 3 days ago |
Diff against .cursor/rules/010-workflow.mdc Diff against .cursor/rules/011-conventional-commits.mdc Diff against .cursor/rules/012-minimal-code-changes.mdc Diff against .cursor/rules/030-bug-handling.mdc Diff against .cursor/rules/040-python-style.mdc Diff against .cursor/rules/050-docker-compose.mdc Diff against .cursor/rules/070-best-practices.mdc Diff against .cursor/rules/080-common-tasks.mdc
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 3 days ago | |
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 3 days ago | |
| skillrecordings/egghead-next.cursor/rules/project-update-rules.mdc · 1.4k | Cursor rules | buildtestlint-formatstyle+7 | 96/100 | 3 days ago | |
| skillrecordings/egghead-next.cursor/rules/project-update-user-rules.mdc · 1.4k | Cursor rules | buildtestlint-formatstyle+7 | 96/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/cli.mdc · 49 | Cursor rules | setupbuildteststyle+4 | 96/100 | 3 days ago | |
| hiromaily/go-crypto-wallet.cursor/rules/proto.mdc · 126 | Cursor rules | buildlint-formatstylearch+3 | 96/100 | 3 days ago |
