Cursor Rules vs. AGENTS.md: Set Up AI Rules for Vibe Coding (2026)
Your AI coding assistant forgets everything between chats. It doesn't know you use pnpm, that you hate default exports, or that it must never touch the payment code. Rules files fix that. This guide explains Cursor rules and AGENTS.md, when to use which, and gives you a starter file you can copy today.
Why rules matter for vibe coding
Large language models don't keep memory between completions. As Cursor's rules documentation puts it, rules provide "persistent, reusable context at the prompt level": their content is placed at the start of the model's context every time they apply.
Without rules, you repeat yourself in every prompt, and the assistant still drifts: new folders, new libraries, new naming styles. With rules, the project explains itself.
What are Cursor rules?
Cursor supports four kinds of rules:
- Project rules in
.cursor/rules, version-controlled with your code. - User rules, global preferences for all your projects.
- Team rules, managed from the dashboard on Team and Enterprise plans.
- AGENTS.md, plain Markdown as a simpler alternative.
Project rules are .mdc files with a small front-matter block. The three fields decide when a rule applies:
alwaysApply | description | globs | Behavior |
|---|---|---|---|
true | – | – | Always included |
false | – | set | Attached when a matching file is in context |
false | set | – | Agent pulls it in when the description fits |
false | – | – | Only when you @-mention it |
One trap: a plain .md file in .cursor/rules is ignored, because it has no front matter. Use .mdc, or use AGENTS.md.
What is AGENTS.md?
AGENTS.md is an open format, "a README for agents". It's plain Markdown in your repo root with no required fields. The project site says it's used by over 60,000 open-source projects and lists Cursor, Aider, Gemini CLI, Zed, Warp and many other tools as compatible. It's now stewarded by the Agentic AI Foundation under the Linux Foundation.
Nested files work too: put another AGENTS.md in a subfolder, and the closest one to the edited file wins. Explicit instructions in your chat prompt override everything.
Cursor rules vs. AGENTS.md: which should you use?
.cursor/rules/*.mdc | AGENTS.md | |
|---|---|---|
| Format | Markdown + front matter | Plain Markdown |
| Scoping | Globs, descriptions, manual | By folder (nested files) |
| Works in | Cursor | Cursor and many other agents |
| Best for | Fine-grained, file-specific rules | One shared source of truth |
Rule of thumb: start with one AGENTS.md. It works across tools, so switching from Cursor to Claude Code or Copilot doesn't mean rewriting your rules. Add .mdc rules only when one area (say, src/components/**) needs its own conventions.
A starter AGENTS.md you can copy
# Project: my-app (Next.js App Router, TypeScript)
## Commands
- Install: pnpm install
- Dev: pnpm dev
- Test: pnpm test (must pass before you finish)
- Lint: pnpm lint
## Code style
- TypeScript strict, no `any`
- Named exports for components
- Server components by default; add "use client" only when needed
## Boundaries
- Never edit files in /app/api/webhooks without asking
- Never commit .env files or secrets
- Don't add new dependencies without saying why
## When unsure
- Read existing code in the same folder first
- Ask before large refactorsKeep it short. Cursor recommends keeping rules under 500 lines, splitting big ones, and referencing files instead of pasting them in.
Best practices from the docs
- Be concrete. "Use zod for API input validation" beats "write clean code".
- Don't copy a style guide. A linter enforces style better than a rule.
- Don't list every command. Agents already know npm and git.
- Add rules when mistakes repeat. Start simple; when the agent makes the same error twice, write the rule.
- Commit your rules. They're part of the project, like the README.
Rules alone aren't enough: start from a clean base
Rules tell the agent how to work. A clean starter tells it where. An empty folder invites the AI to invent a structure; a small, typed, well-organized codebase gives it something to follow.
Example: Botnexio Vibe Coding Starter, €19
The Botnexio Vibe Coding Starter combines both. According to its listing it includes:
- A Next.js starter (App Router, TypeScript)
- Rules for AI coding tools: AGENTS.md, Cursor, Claude Code and GitHub Copilot
- 6 prompts for AI coding tools
Not included: authentication, database, payments, hosting, or any AI tool subscription. Delivery: ZIP download after payment. Price: €19 incl. VAT.
Need subscriptions on day one? The SaaS Starter (€39) adds Stripe Checkout, the customer portal and a webhook with signature verification. Prefer ready prompts for research tasks? Try the Research Prompt Pack (€12).
A 4-step vibe coding workflow
- Rules first. Drop in AGENTS.md before your first prompt.
- Small prompts. One feature per prompt: "Add a /settings page with a dark-mode toggle."
- Let it test. List your test command in AGENTS.md; agents will run it and fix failures.
- Update the rules. Every repeated mistake becomes one new line.
FAQ
Does Cursor read AGENTS.md?
Yes. Cursor supports AGENTS.md in the project root and in subdirectories, as an alternative to .cursor/rules.
Why is my Cursor rule ignored?
Check the file extension and type. Project rules must be .mdc; plain .md files in .cursor/rules are ignored. "Apply Intelligently" rules need a description, and file-scoped rules need a matching glob.
Is AGENTS.md the same as CLAUDE.md?
No. They're separate files for different tools. AGENTS.md is the shared open format; check your tool's docs for whether it reads AGENTS.md directly.
Do rules affect Cursor Tab autocomplete?
No. According to Cursor's docs, rules apply to Agent (Chat), not to Tab.
What does the Vibe Coding Starter include?
A Next.js App Router starter in TypeScript, rules for AGENTS.md, Cursor, Claude Code and Copilot, and 6 prompts. No auth, database or payments.
Start with rules that work
Stop repeating yourself. Ship faster.
→ Get the Vibe Coding Starter for €19