guidelines-for-writing-new-cursor-rules

guidelines-for-writing-new-cursor-rules is a cursor rule for Cursor from fumito-ito/mdcvalult. It costs 0 tokens per session (780 once invoked), scanned A, a copy of 000-cursor-rules, MIT.

A set of instructions for creating and updating Cursor Rules, which are project-specific guidance files that shape how Cursor behaves. It defines their format, location, naming, and required sections.

In plain words
What is it for?
Use it when creating a Cursor Rule, updating one, or turning a lesson from the user into a lasting rule.
Why use it?
It keeps new rules consistent, easy to find, and testable instead of leaving their structure to guesswork.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc). Also seen: mentions Cursor.

Good fit Use it when creating a Cursor Rule, updating one, or turning a lesson from the user into a lasting rule.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/fumito-ito/mdcvalult/guidelines-for-writing-new-cursor-rules
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/fumito-ito/mdcvalult

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for guidelines-for-writing-new-cursor-rules

README.md
[![agentmods](https://agentmods.dev/badge/rules/fumito-ito/mdcvalult/guidelines-for-writing-new-cursor-rules/github.svg)](https://agentmods.dev/rules/fumito-ito/mdcvalult/guidelines-for-writing-new-cursor-rules)
Your own site
<a href="https://agentmods.dev/rules/fumito-ito/mdcvalult/guidelines-for-writing-new-cursor-rules"><img src="https://agentmods.dev/badge/rules/fumito-ito/mdcvalult/guidelines-for-writing-new-cursor-rules/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for guidelines-for-writing-new-cursor-rules

Your own site · 80×15
<a href="https://agentmods.dev/rules/fumito-ito/mdcvalult/guidelines-for-writing-new-cursor-rules"><img src="https://agentmods.dev/badge/rules/fumito-ito/mdcvalult/guidelines-for-writing-new-cursor-rules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 780 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 95% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00780
Opus 5 $0.00000 $0.00390
Sonnet 5 $0.00000 $0.00156
Haiku 4.5 $0.00000 $0.00078

Measured 9d ago against content hash 07471123c97b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

guidelines-for-writing-new-cursor-rules scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

95% identical to 000-cursor-rules — 3 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

mdc/guidelines-for-writing-new-cursor-rules.mdc · 115 lines

How it starts

The opening of the file, as written. The whole thing — 115 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Cursor Rules Format

Core Structure

---
description: ACTION when TRIGGER to OUTCOME
globs: *.mdc
---

# Rule Title

## Context
- When to apply this rule
- Prerequisites or conditions

## Requirements
- Concise, actionable items
- Each requirement must be testable

## Examples
<example>
Good concise example with explanation
</example>

<example type="invalid">
Invalid concise example with explanation
</example>

File Organization

Location

  • Path: .cursor/rules/
  • Extension: .mdc

Naming Convention

PREFIX-name.mdc where PREFIX is:

  • 0XX: Core standards
  • 1XX: Tool configs
  • 3XX: Testing standards
  • 1XXX: Language rules
  • 2XXX: Framework rules
  • 8XX: Workflows
  • 9XX: Templates
  • _name.mdc: Private rules

Glob Pattern Examples

Common glob patterns for different rule types:

  • Core standards: .cursor/rules/*.mdc
  • Language rules: src/**/*.{js,ts}
  • Testing standards: **/*.test.{js,ts}
  • React components: src/components/**/*.tsx
  • Documentation: docs/**/*.md
  • Configuration files: *.config.{js,json}
  • Build artifacts: dist/**/*
  • Multiple extensions: src/**/*.{js,jsx,ts,tsx}
  • Multiple files: dist//*, docs//*.md

Required Fields

Frontmatter

  • description: ACTION TRIGGER OUTCOME format
  • globs: glob pattern for files and folders

Body

  • X.Y.Z
  • context: Usage conditions
  • requirements: Actionable items
  • examples: Both valid and invalid

Formatting Guidelines

  • Use Concise Markdown primarily
  • XML tags limited to:
  • Always indent content within XML or nested XML tags by 2 spaces
  • Keep rules as short as possbile
  • Use Mermaid syntax if it will be shorter or clearer than describing a complex rule
  • Use Emojis where appropriate to convey meaning that will improve rule understanding by the AI Agent
  • Keep examples as short as possible to clearly convey the positive or negative example

AI Optimization Tips

Read the full file on GitHub · 115 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 115 lines · 0 tokens per session scan A 07471123c97b

Subscribe to this mod's changes

guidelines-for-writing-new-cursor-rules is a cursor rule published in the GitHub repository fumito-ito/mdcvalult (33 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 780 tokens. A static security scan graded it A with 0 findings. It is 95% identical to 000-cursor-rules, differing in 3 lines, and is treated as a copy.