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

neotoma / rules

Cursor rule38 starsChanged 2 months agoMITView on GitHub

Load when modifying rule/command sources: pre-commit runs setup_cursor_copies when staged; edit source in docs/ or foundation only; do not use --no-verify to bypass.

The file

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

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When files matching docs//*.mdc or foundation/agent_instructions/cursor_rules//*.mdc or foundation/agent_instructions/cursor_commands//*.md …

    line 28
  2. Distinctive:

    Commit proceeds with synced files

    line 31
  3. Distinctive:

    When creating or modifying rule/command sources:

    line 47
  4. Distinctive:

    If editing outside of a commit (rare), run the setup script manually

    line 50
  5. Distinctive:

    If hook fails, fix the issue and retry commit

    line 67

≈ “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_sync.mdc
---
description: "Load when modifying rule/command sources: pre-commit runs setup_cursor_copies when staged; edit source in docs/ or foundation only; do not use --no-verify to bypass."
alwaysApply: false
---

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

# Cursor Rules Sync Rule

Ensures `.cursor/rules/` and `.cursor/commands/` remain synchronized with their source files in `docs/` or `foundation/agent_instructions/`.

## Implementation

**Automated:** Rule and command syncing is enforced by a pre-commit hook that runs when source files change.

**Hook:** `scripts/linters/cursor_rules_sync_pre_commit.sh` (configured in `.pre-commit-config.yaml` as `cursor-rules-sync`)

**How it works:**
1. When files matching `docs/**/*.mdc` or `foundation/agent_instructions/cursor_rules/**/*.mdc` or `foundation/agent_instructions/cursor_commands/**/*.md` are staged, the hook runs automatically
2. Script executes `foundation/scripts/setup_cursor_copies.sh` (or repo equivalent)
3. Updated `.cursor/rules/` and `.cursor/commands/` files are staged automatically
4. Commit proceeds with synced files

**Manual execution:**
```bash
# Run the setup script directly
./foundation/scripts/setup_cursor_copies.sh

# Or via command
/setup_cursor_copies
/sync_cursor_files copies
```

## Agent Actions

Agents do NOT need to manually run `/setup_cursor_copies` after editing rule sources — the pre-commit hook handles this automatically.

When creating or modifying rule/command sources:
1. **Edit source files only** — in `docs/` or `foundation/agent_instructions/`, never `.cursor/`
2. **Commit changes** — pre-commit hook will sync `.cursor/` automatically
3. If editing outside of a commit (rare), run the setup script manually

## Source File Locations

**Foundation rules and commands:**
- Source: `foundation/agent_instructions/cursor_rules/*.mdc`, `foundation/agent_instructions/cursor_commands/*.md`
- Copies: `.cursor/rules/`, `.cursor/commands/` (synced via setup script)

**Repository rules and commands:**
- Source: `docs/**/*_rules.mdc`, `docs/**/*_command.md`
- Copies: `.cursor/rules/`, `.cursor/commands/` (synced via setup script)

## Constraints

- **MUST NOT** edit files in `.cursor/rules/` or `.cursor/commands/` directly
- **MUST** edit source files in `docs/` or `foundation/agent_instructions/`
- **MUST** respect the pre-commit hook (do not use `--no-verify` to bypass)
- If hook fails, fix the issue and retry commit

## Related Files

- `scripts/linters/cursor_rules_sync_pre_commit.sh` — Pre-commit hook implementation
- `.pre-commit-config.yaml` — Hook configuration (cursor-rules-sync)
- `foundation/scripts/setup_cursor_copies.sh` — Setup script (invoked by hook)
- `.cursor/rules/cursor_rules_editing.mdc` — Rule about not editing .cursor/ directly

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.