agentleFS
markmhendricksonmarkmhendrickson/neotoma/.cursor/rules/cursor_rules_editing.mdc

neotoma / rules

Cursor rule38 starsChanged 2 months agoMITView on GitHub

Load when editing rules or commands: edit source in docs/ or foundation/agent_instructions/, never .cursor/rules or .cursor/commands; run setup_cursor_copies after editing.

The file

We split this cursor_rules_editing.mdc into the rules it gives an agent

9 rules. About 0 are common, 5 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Not the source of truth

    line 44
  2. Distinctive:

    Check the header comment (added by setup script) for source file path

    line 63
  3. Very specific:

    Look for pattern: docs/{subdirectory}/*_rules.mdc or foundation/agent_instructions/cursor_rules/*.mdc

    line 67
  4. Distinctive:

    Use file naming pattern:

    line 68
  5. Very specific:

    MUST NOT edit files in .cursor/rules/ or .cursor/commands/

    line 75
  6. Very specific:

    MUST edit source files in docs/ or foundation/agent_instructions/

    line 76
  7. Very specific:

    MUST run /setup_cursor_copies after editing source files to sync changes

    line 77
  8. Distinctive:

    MUST verify edits are in source files, not copies

    line 78
  9. Distinctive:

    Before committing rule or command changes:

    line 90

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
cursor_rules_editing.mdc
---
description: "Load when editing rules or commands: edit source in docs/ or foundation/agent_instructions/, never .cursor/rules or .cursor/commands; run setup_cursor_copies after editing."
alwaysApply: false
---

# ⚠️  DO NOT EDIT THIS FILE DIRECTLY
#
# This is a copy of: foundation/agent_instructions/cursor_rules/cursor_rules_editing.mdc
# Source of truth: foundation/agent_instructions/cursor_rules/cursor_rules_editing.mdc
#
# To edit this rule:
# 1. Edit the source file: foundation/agent_instructions/cursor_rules/cursor_rules_editing.mdc
# 2. Run '/setup_cursor_copies' to sync changes
#
# This file will be overwritten when running setup_cursor_copies.

# Cursor Rules Editing Rule

## Purpose

Ensures agents always edit the source files for cursor rules and commands, never the copies in `.cursor/rules/` or `.cursor/commands/` directories.

## Source of Truth Locations

**Foundation rules and commands:**
- Source: `foundation/agent_instructions/cursor_rules/` and `foundation/agent_instructions/cursor_commands/`
- Copies: `.cursor/rules/` and `.cursor/commands/` (created by `/setup_cursor_copies`)

**Repository rules:**
- Source: `docs/` subdirectories (e.g., `docs/foundation/`, `docs/conventions/`, `docs/developer/`)
- Copies: `.cursor/rules/` (created by `/setup_cursor_copies`)

**Repository commands:**
- Source: `docs/` subdirectories or repository-specific command locations
- Copies: `.cursor/commands/` (created by `/setup_cursor_copies`)

## Rule

**MUST NOT edit files in `.cursor/rules/` or `.cursor/commands/`**

These directories contain copies that are:
- Automatically generated by `/setup_cursor_copies`
- Overwritten when running `/setup_cursor_copies`
- Not the source of truth

## Agent Actions

### When Editing Rules or Commands

1. **Identify the source file:**
   - Foundation rules: `foundation/agent_instructions/cursor_rules/{name}.mdc`
   - Foundation commands: `foundation/agent_instructions/cursor_commands/{name}.md`
   - Repository rules: `docs/{subdirectory}/{name}_rules.mdc` or `docs/{subdirectory}/{name}_rules.md`
   - Repository commands: `docs/{subdirectory}/{name}_command.md` or repository-specific command locations

2. **Edit the source file directly**

3. **After editing, run `/setup_cursor_copies`** to sync changes to `.cursor/` directory

### Detecting Source Files

**For files in `.cursor/rules/` or `.cursor/commands/`:**
- Check the header comment (added by setup script) for source file path
- Header format:
  - `.mdc` files: YAML frontmatter comment style (`---` with `#` comments)
  - `.md` files: HTML comment style (`<!-- -->`)
- Look for pattern: `docs/{subdirectory}/*_rules.mdc` or `foundation/agent_instructions/cursor_rules/*.mdc`
- Use file naming pattern:
  - Foundation rules use original filenames (no prefix)
  - `{subdirectory}_{name}_rules.mdc` → `docs/{subdirectory}/{name}_rules.mdc`
  - Commands use original filenames (no prefix)

## Constraints

- MUST NOT edit files in `.cursor/rules/` or `.cursor/commands/`
- MUST edit source files in `docs/` or `foundation/agent_instructions/`
- MUST run `/setup_cursor_copies` after editing source files to sync changes
- MUST verify edits are in source files, not copies

## Forbidden Patterns

- Editing `.cursor/rules/*.mdc` or `.cursor/rules/*.md` directly
- Editing `.cursor/commands/*.md` directly (foundation commands or repository commands)
- Assuming `.cursor/` files are the source of truth
- Skipping `/setup_cursor_copies` after editing source files
- Removing header comments from copied files (they will be re-added by the script)

## Validation

Before committing rule or command changes:
- [ ] Changes are in source files (`docs/` or `foundation/agent_instructions/`)
- [ ] No changes were made to `.cursor/rules/` or `.cursor/commands/`
- [ ] `/setup_cursor_copies` has been run to sync changes
- [ ] All copied files in `.cursor/` have header comments (verify by checking first few lines)

## Related Documents

- `foundation/agent_instructions/cursor_rules/instruction_documentation.mdc` - How to document instructions
- `foundation/agent_instructions/cursor_commands/setup_cursor_copies.md` - Command to sync copies

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.