agentleFS
DXHeroesDXHeroes/mcp-devtools/.cursor/rules/rules-for-cursor.mdc

mcp-devtools / rules

Cursor rule13 starsChanged 21 months agoMITArchived repositoryView on GitHub

Rules for Writing Cursor Rules

The file

Files
rules-for-cursor.mdc
---
description: Rules for Writing Cursor Rules
globs: .cursor/rules/*.mdc
alwaysApply: true
---

# Rules for Writing Cursor Rules

This document provides guidelines for creating and maintaining Cursor IDE rules for the MCP DevTools repository.

@url https://docs.cursor.com/context/rules-for-ai
@file .cursor/rules/repository-structure.mdc
@file .cursor/rules/ai-assisted-development.mdc

## Rule Structure

Each rule file should follow this structure:

````markdown
---
description: Brief description of what the rule enforces
globs: pattern/to/match/files.ts
alwaysApply: true|false
---

# Rule Title

Brief introduction to the rule and its purpose.

@file path/to/example/file.ts
@file path/to/related/rule.mdc
@url https://relevant-docs-url.com/

## Sections

Content organized into clear sections with examples.

## Examples

```typescript
// Code examples demonstrating the rule
```
````

## Guidelines

1. **First Guideline**

   - Explanation point 1
   - Explanation point 2

2. **Second Guideline**
   - Explanation point 1
   - Explanation point 2

```

## Frontmatter Requirements

Every rule must include these frontmatter fields:

1. **description**: A concise one-line description of the rule
2. **globs**: File pattern(s) the rule applies to
3. **alwaysApply**: Whether the rule should automatically apply

## File References

Rules should reference:

1. **Example Files**: Include `@file` references to real examples in the codebase
2. **Related Rules**: Link to related rules with `@file` references
3. **External Documentation**: Link to relevant external documentation with `@url`

## Guidelines for Writing Effective Rules

1. **Be Specific**
   - Rules should provide clear, actionable guidance
   - Include real examples from the codebase when possible
   - Explain both what to do and what to avoid

2. **Organize Content**
   - Use clear headings and subheadings
   - Group related information together
   - Use numbered lists for sequential steps
   - Use bullet points for related items

3. **Include Code Examples**
   - Provide complete, working examples
   - Comment code examples to explain important points
   - Show both correct and incorrect patterns

4. **Connect with Other Rules**
   - Reference related rules
   - Avoid duplicating content across rules
   - Ensure consistent guidance across all rules

5. **Keep Updated**
   - Review and update rules when project standards change
   - Ensure examples remain valid as the codebase evolves
   - Add new rules as needed for new patterns or technologies
```

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.