Skip to main content
rule CX Codex

meta — Claude Code rule: what it does, how to install

The meta rule guides edits to *.mdc files, preserving their formatting and steering agents toward existing rule files before creating new ones.

Apache-2.0 ★ 138 updated 2025-03-29

Install into Cursor · Manually: put the files in place All methods and platforms ↓
.cursor/rules/meta.mdc
Open on GitHub

What meta does

meta sets editing conventions for *.mdc files. It tells the agent to retain the file’s line endings, trailing spaces, indentation style, and existing formatting patterns. Changes to a rule should stay aligned with its implementation. This matters in repositories where switching between CRLF and LF would alter files unintentionally.

Before adding a rule, the agent should check whether it belongs in an existing file. A new file is warranted when the user requests one, the content does not fit elsewhere, or a separate file would make the structure clearer; the reason belongs in README.md. Examples of file or syntax changes should show both a recommended and a discouraged form, with comments explaining each. The rule covers *.mdc; its Claude Code install path is .claude/rules/meta.md.

What it helps with

  • preserve line endings when editing a rule
  • retain trailing spaces and the existing indentation style
  • find an appropriate file for new rule content
  • keep .mdc changes aligned with their implementation
  • record why a new rule file was created in README.md

Example prompts for the agent

  • Edit the *.mdc rule and preserve its line endings and indentation.
  • Add this instruction to an existing rule file if it fits; avoid creating a separate file without a reason.
  • Show recommended and discouraged syntax examples, with comments explaining the difference.

How to install meta

Manually: put the files in place

.cursor/rules/meta.mdc

Frontmatter: description, globs, alwaysApply

Step by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules

Questions about meta

How do I install meta in Claude Code?

Place the file at .claude/rules/meta.md.

What does the meta rule do?

It sets editing conventions for *.mdc files, including formatting preservation and when to add a separate rule file.

When should I create a new rule file?

When the user asks for one, the content does not fit an existing rule, or a separate file would make the structure clearer. Record the reason in README.md.

Source text

meta.mdc · Apache-2.0
---
description: A meta-rule for using Cursor to update *.mdc file in this repository.
globs: *.mdc
---
# Cursor Rules

This document outlines the meta-rules for cursor operations in this repository.

## Line Ending & Formatting Rules

1. **Line Endings**
   - Don't modify existing line endings
   - Preserve CRLF/LF as found in the original file

2. **Whitespace**
   - Preserve trailing whitespace where it exists
   - Maintain existing indentation style (spaces vs tabs)
   - Keep line length consistent with existing code

## File Handling

1. **MDC Files**
   - Always commit changes to `*.mdc` files directly
   - Ensure changes to `*.mdc` files are synchronized with their implementation
   - Maintain consistent formatting within MDC files
   - Prefer modifying existing files over creating new ones unless explicitly requested
   - When adding new content, first check if it fits within an existing rule file


2. **File Creation**

   - Only create new rule files when:
     - Explicitly requested by the user
     - The content doesn't logically fit in any existing rule file
     - Creating a new file would significantly improve organization and clarity
   - Document the rationale for creating new files in their README.md

## Code Style & Structure

1. **Formatting**
   - Preserve existing code formatting patterns
   - Maintain consistent naming conventions
   - Keep indentation consistent with file style

2. **Organization**
   - Keep file structure consistent
   - Don't move files without updating all references
   - Maintain existing import/include order

## Rule Content

1. **Examples**
    - Always include "do" and "don't" examples when showing specific changes to files or syntax
    - Include helpful comments that explain why an example is a "do" or a "don't"

## Documentation

1. **README.md**
    - Each `*.mdc` file is lumped into a folder with a `README.md` file explaining what the rule does and when it's used. 

© Aaronontheweb · Apache-2.0 · Aaronontheweb/dotnet-cursor-rules

Similar IDE rules

All IDE rules for Agent setup: memory, context, orchestration →

From the same set11

The whole set →
publishing-dotnettool Guides AI agents when creating and publishing dotnet tools to NuGet. Ensures semantic versioning, correct packaging, and compatibility across .NET versions. CX Codex +1 ★ 138repo stars code-signing Enforces .NET code signing patterns and SignClient configuration for NuGet packages in CI/CD pipelines. CX Codex +1 ★ 138repo stars consuming-dotnettool The consuming-dotnettool rule keeps .NET tool dependencies in a manifest, pins their versions, and adds restore steps for CI/CD. Use it when projects need repeatable tool setup. CX Codex +1 ★ 138repo stars dependency-management Rule for secure NuGet dependency management: vulnerability scanning, license compliance, versioning via dotnet CLI. Auto-applies to project files. CX Codex +1 ★ 138repo stars solution-management solution-management standardizes .NET solution architecture with explicit SDK pinning, shared build properties, and centralized package management. CX Codex +1 ★ 138repo stars benchmarking The benchmarking rule teaches the agent to write valid .NET performance tests using BenchmarkDotNet. Useful when you need to measure code speed and track regressions. CX Codex +1 ★ 138repo stars nuget-package-publishing nuget-package-publishing — a rule that teaches the agent to pack .NET libraries into NuGet packages following industry standards: SPDX license, README, and debug symbols. CX Codex +1 ★ 138repo stars testing Defines xUnit testing conventions for .NET: project configurations, test isolation, coverage thresholds, and integration test setup. CX Codex +1 ★ 138repo stars

Project sponsors

Companies that keep this analytics open