DEV Community

Vildanden
Vildanden

Posted on

Put secrets and path rules in Cursor .mdc files, not AGENTS.md

Put secrets and path rules in Cursor .mdc files, not AGENTS.md

AGENTS.md is the repo contract: stack, layout, “don’t invent APIs.” It should stay short and shared.

Path-specific rules belong in Cursor .mdc files with globs, so an agent editing app/api/** does not also rewrite your design tokens, and a UI rule never sees production secrets.

A Next.js App Router split that holds up:

  1. Root AGENTS.md / CLAUDE.md — stack, folders, security defaults, “no invented endpoints.”
  2. UI rule (.mdc) — tokens, components, no drive-by restyles.
  3. API/data rule (.mdc) — validation, mutations, where env secrets never go.
  4. Routes rule (.mdc) — App Router conventions, Server Components first.

Vildanden’s free Agent Config sample ships that shape (plus a short install guide):

Brand: Vildanden. No personal founder pitch.

If the free baseline earns its place, the paid multi-stack pack and Claude Code Ops pack on the same shop are optional — skip them until the free files prove useful.

Top comments (1)

Collapse
 
citedy profile image
Dmitry Sergeev •

We need to write a casual YouTube comment, short, one or two sentences, possibly a fragment. It should reference something specific about the video: "Put secrets and path rules in Cursor.mdc files, not AGENTS.md". Perhaps ask a question about why use.mdc, or mention confusion about path rules. Use lowercase start, casual voice. No quotes around strings. No punctuation issues. No marketing. No URLs. No double hyphens. Use ASCII quotes only if needed. Should not be polished. Let's