# cursor-rules-location

cursor-rules-location keeps repository rule files organized by rejecting any .mdc files created outside the .cursor/rules directory.

- rule · `type=rule` · Claude Code, Cline, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop) · ★ 1054 repo stars
- Author: Bhartendu-Kumar
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/Bhartendu-Kumar/rules_template/tree/HEAD/specific_rule_files/cursor-rules-location.mdc
- Updated: 2025-07-17
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/rules/cursor-rules-location

## What it does

This rule monitors the creation of `.mdc` files and content containing `<rule>` blocks. When an assistant attempts to write instructions into the project root or arbitrary directories, the rule immediately rejects the operation.

It enforces placing all Cursor instructions strictly inside `.cursor/rules/`, assigning kebab-case filenames, and using the `.mdc` extension. Any rule written to unauthorized paths will fail to save.

## Install

### Cursor (native platform)

**Manually: put the files in place**
- File: `.cursor/rules/cursor-rules-location.mdc` — Frontmatter: description, globs, alwaysApply

### Claude Code

**Manually: put the files in place**
- File: `.claude/rules/cursor-rules-location.md` — The paths frontmatter field limits the files: move globs from the source into paths

### Codex

**AGENTS.md**
- Codex reads AGENTS.md: paste the rule text there

### GitHub Copilot

**Manually: put the files in place**
- File: `.github/instructions/cursor-rules-location.instructions.md` — The applyTo field sets which files it applies to: move globs from the source into applyTo

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/rules/cursor-rules-location.md`

### Cline

**Manually: put the files in place**
- File: `.clinerules/cursor-rules-location.md`

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/Bhartendu-Kumar/rules_template/tree/HEAD/specific_rule_files/cursor-rules-location.mdc

## When to use it
- prevent `.mdc` rule files from cluttering the repository root
- enforce storing all Cursor instructions inside `.cursor/rules`
- enforce kebab-case naming for rule files

## Example prompts
- Create a new rule for linting standards in `.cursor/rules/linting.mdc`
- Set up a project guideline file for testing conventions

## Similar
- [meta](https://affpapa.org/en/nevibecode/rules/meta.md) — rule · ★ 138 repo stars
- [nuxt-content](https://affpapa.org/en/nevibecode/skills/nuxt-content.md) — skill · 3000 installs
- [c-location](https://affpapa.org/en/nevibecode/skills/c-location.md) — skill · ★ 179 repo stars
- [mapbox-location-grounding](https://affpapa.org/en/nevibecode/skills/mapbox-location-grounding.md) — skill · 1300 installs
- [amazon-location-service](https://affpapa.org/en/nevibecode/skills/amazon-location-service.md) — skill · 1300 installs
- [axiom-location](https://affpapa.org/en/nevibecode/skills/axiom-location.md) — skill · 1100 installs

From the same set: [bhartendu-kumar/rules_template](https://affpapa.org/en/nevibecode/by/bhartendu-kumar/rules_template.md) — 11 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
