Phase 1: why rules matter (Cursor's context window + prompt engineering)
Cursor's AI surface has a limited context window — typically 200k tokens (the Claude Sonnet/Opus default). Every prompt you send includes: the file you're editing, related files you've @-referenced, conversation history, and... your rules. The rules are the bit you write once and Cursor injects every time.
Without rules, Cursor falls back to general programming knowledge — it'll write idiomatic Next.js, but 'idiomatic' for 2024 is different from 2026, and 'idiomatic' for the web is different from your team's specific conventions. Cursor doesn't know that your team prefers Zod over Yup, that you don't use `pages/` (you migrated to App Router), that your data layer is Supabase not Prisma, that your testing framework is Vitest not Jest. It guesses, often wrong.
Rules close that gap. A 200-line `.mdc` file describing your stack and conventions gets injected into every prompt, biasing Cursor's output toward what your team actually wants. The token cost is real (~500-2000 tokens per rule per prompt) but tiny relative to the win — Cursor's output goes from 'generally right' to 'team-specific right' on the first try, eliminating the back-and-forth iteration.
**Rules vs prompts:** prompts are the per-task instruction ('build me an X endpoint'). Rules are the always-on context ('we use App Router, Server Components by default, Supabase, Zod, shadcn, Vitest'). The combination — minimal prompt + comprehensive rules — produces 3-5x better output than either alone.
**Token-budget discipline.** Don't make rules sprawl. Each `.mdc` should be focused and scoped — 100-300 lines, with `globs` that target specific directories. Avoid one giant 1000-line rules file at the repo root with `alwaysApply: true` — it'll consume 8-10% of your context window on every prompt without delivering the per-task focus.