Cursor .mdc rules and architecture without technical debt

Ready-made .mdc rules for Cursor IDE: Feature-Sliced ​​Design, Zod validation, protection against AI hallucinations and pure TypeScript in production.

TL;DR · Key Answer

Cursor .mdc files (Markdown with YAML frontmatter) set strict architectural boundaries for the AI ​​agent: alwaysApply, globs by layer (shared/entities/features/widgets) and a ban on duplicating logic. This reduces the number of bugs during vibecoding by 3–4 times.

Checklist

  • Add YAML frontmatter with alwaysApply: true for base rules and layer-specific globs.
  • Limit the size of functions to 40-50 lines and prohibit circular imports between slices.
  • Require Zod schema on every API route and tsc --noEmit check after every change.
  • Fix the 50% context rule: start a new session when half the window is full.

Forum Discussions (vbcd4u.com)

Все обсуждения →

Engineering Guides (MurdaSoft)

FAQ

Where to save .mdc rules in the Cursor project?

To the .cursor/rules/ folder with the .mdc extension (for example, .cursor/rules/architecture.mdc). Cursor automatically connects them using the globs or alwaysApply field.

How is .mdc better than regular .cursorrules?

.mdc supports modularization by files and path masks (globs), so the context is not overloaded with unnecessary instructions.