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 (0)