mdc-files

mdc-files is a cursor rule for Cursor from Khan/wonder-blocks. It costs 3,103 tokens per session, scanned A, original, MIT.

A set of writing rules for .mdc files, which are Cursor rule files that give an AI coding assistant project-specific guidance. It covers required metadata, file patterns, headings, and content structure.

In plain words
What is it for?
Use it when creating or reviewing Cursor rules, especially their YAML frontmatter, file-matching patterns, automatic-application setting, and document layout.
Why use it?
It helps keep these rule files consistent and ensures they apply to the intended files or situations. This reduces unclear instructions and rules that are missing required settings.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: mentions CLAUDE.md; mentions Cursor.

Good fit Use it when creating or reviewing Cursor rules, especially their YAML frontmatter, file-matching patterns, automatic-application setting, and document layout.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/khan/wonder-blocks/mdc-files
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/Khan/wonder-blocks

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 mdc-files

README.md
[![agentmods](https://agentmods.dev/badge/rules/khan/wonder-blocks/mdc-files/github.svg)](https://agentmods.dev/rules/khan/wonder-blocks/mdc-files)
Your own site
<a href="https://agentmods.dev/rules/khan/wonder-blocks/mdc-files"><img src="https://agentmods.dev/badge/rules/khan/wonder-blocks/mdc-files/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 mdc-files

Your own site · 80×15
<a href="https://agentmods.dev/rules/khan/wonder-blocks/mdc-files"><img src="https://agentmods.dev/badge/rules/khan/wonder-blocks/mdc-files.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 3,103 This file is loaded in full into every session.
When invoked 3,103 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found 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.03103 $0.03103
Opus 5.5 $0.01241 $0.01241
Sonnet 5.5 $0.00621 $0.00621
Haiku 4.5 $0.00310 $0.00310

Measured 1mo ago against content hash f8e57a2247fb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

mdc-files 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 1mo 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.

.cursor/rules/mdc-files.mdc · 521 lines

How it starts

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

MDC Files Best Practices

This guide covers conventions and best practices for creating and maintaining .mdc cursor rules files that provide context and guidance to AI assistants.

File Structure

Frontmatter Block

⚠️ ALWAYS include YAML frontmatter at the top of every .mdc file:

---
description: Brief description of what this rules file covers
globs: *.ext,*.pattern
alwaysApply: false
---

Frontmatter Properties:

  • ✅ description: Short, clear description of the file's purpose (one line)
  • ✅ globs: Comma-separated list of file patterns that trigger this rule (e.g., *.test.ts,*.test.tsx)
  • ✅ alwaysApply: Boolean (true or false) - whether this rule applies to all contexts

✅ DO: Use specific glob patterns

---
description: Jest testing best practices and patterns for unit tests
globs: *.test.ts,*.test.tsx
alwaysApply: false
---

❌ DON'T: Use vague descriptions or missing properties

---
description: Some rules
globs:
alwaysApply: false
---

Document Title

✅ ALWAYS start content with a single H1 heading:

# Document Title

Introduction paragraph explaining the document's purpose and scope.

Best practices:

  • ✅ Use a clear, descriptive title
  • ✅ Match the title to the description in frontmatter
  • ✅ Include a brief introduction after the H1
  • ❌ Never use multiple H1 headings in a single document

Markdown Structure

Heading Hierarchy

✅ Use proper heading levels (H1 → H2 → H3 → H4):

# Main Title (H1)

## Major Section (H2)

### Subsection (H3)

#### Sub-subsection (H4)

##### Rarely needed (H5)

Best practices:

  • ✅ Use H1 for document title only
  • ✅ Use H2 for major sections
  • ✅ Use H3 for subsections within major sections
  • ✅ Maintain consistent nesting (don't skip levels)
  • ❌ Never jump from H2 to H4 without H3

Visual Indicators

✅ Use emoji symbols for emphasis and clarity:

  • ✅ Checkmark: Recommended patterns, correct examples
  • ❌ Cross mark: Anti-patterns, incorrect examples
  • ⚠️ Warning: Critical rules, important notes
  • 🥇 Medal: Priority or ranking indicators

Read the full file on GitHub · 521 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. 1mo ago First seen · 521 lines · 3,103 tokens per session scan A f8e57a2247fb

Subscribe to this mod's changes

mdc-files is a cursor rule published in the GitHub repository Khan/wonder-blocks (163 stars, last pushed yesterday), licensed MIT. It adds 3,103 tokens to every session, about $0.0124 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.