AI
Free AI Agent Rules File Generator
Generate CLAUDE.md, AGENTS.md, .cursorrules, .windsurfrules, .clinerules from a single form. Web app, CLI, library, and data-pipeline presets. Live preview, copy or download. 100% browser-based.
What an agent rules file actually does
Every AI coding agent — Claude Code, Cursor, Windsurf, Cline, Codex, Aider, Goose — starts a session knowing almost nothing about your codebase. It can list files and read them, but it has no idea which conventions you enforce in review, which files are auto-generated, which libraries are banned, or what "done" looks like in your repo. Without a rules file, the agent guesses, you correct, it guesses again. With one, the first answer is usually right.
A rules file is one markdown document at the repo root, loaded into the agent's context at the start of every session. It captures the conventions a senior engineer would tell a new hire on day one: stack choices, run commands, architecture sketch, off-limits paths, and soft/hard rules. The generator on this page assembles that file from a form — same output for Claude Code (CLAUDE.md), Cursor (.cursorrules), the cross-tool AGENTS.md standard, and two more.
Which file for which tool
| Filename | Tool | Location | Format |
|---|---|---|---|
| CLAUDE.md | Claude Code | Repo root (also ~/.claude/CLAUDE.md) | Markdown |
| AGENTS.md | Codex, Aider, Goose, others | Repo root | Markdown |
| .cursorrules | Cursor IDE | Repo root or any subdirectory | Plain text / markdown |
| .windsurfrules | Windsurf / Codeium | Repo root | Plain text / markdown |
| .clinerules | Cline (VS Code) | Repo root | Plain text / markdown |
All five formats are plain markdown or markdown-ish text — the differences are in the conventions the consumer tool expects at the top. Cursor prefers instruction-style prose addressed to the assistant ("You are an AI coding assistant working on…"). Claude Code and AGENTS.md prefer documentation-style prose addressed to the reader. The generator adapts the header per format; the rest of the body is identical, which is why committing two or three of these files to the same repo works fine.
What belongs in the file — and what doesn't
The single biggest mistake in rules files is putting things that rot. File paths move, package versions bump, team priorities change — if your rules file says "we use Next.js 14", it's wrong the day you upgrade. Describe conventions and intent, not facts the code already carries.
- Stack + run commands (install, dev, build, test, lint)
- Architecture sketch — what lives where, and why
- Conventions the agent can't guess (server components, no default exports, etc.)
- Banned patterns and libraries
- Paths that must never be hand-edited
- Off-repo context — auth provider, release flow, "we deploy via X"
- Exhaustive file lists — the agent can ls the directory
- Pinned library versions — read
package.json - JSDoc-style function documentation
- Recent decisions — git log is authoritative
- Secrets, credentials, or private URLs
- Anything that would be corrected in a PR review of CLAUDE.md itself
The right length: 100–300 lines
Rules files work best in the 100–300 line range. Under 50 lines and the agent keeps asking the same questions your teammates would answer automatically. Over 600 lines and the context gets bloated — the agent skims, the signal-to-noise drops, and you're paying token cost every call for content that doesn't change the answer. If the file grows past 500 lines, split by topic: universal rules in CLAUDE.md, deep architecture in docs/architecture.md, referenced by one line ("For system design details, read docs/architecture.md"). Agents will open linked files on demand.
Do vs Don't vs Never-touch
The generator splits rules into three lists because agents should treat them differently. "Do" items are positive defaults — what to reach for when there's a choice. "Don't" items are soft prohibitions — avoid, but override if explicitly asked with a reason. "Never touch" is a hard boundary — paths the agent is not allowed to modify under any circumstance, because they are auto-generated, legally signed-off, or managed by an external release workflow.
Calibrating pressure matters. "Don't use any" as a "never touch" makes the rules fragile — there will be a legitimate case where a short any is the right call. The same item as a "don't" is correct: default to proper types, override with justification. Conversely, "don't edit db/migrations/" is too soft — migrations are generated by a tool and hand-edits cause silent schema drift. That belongs in "never touch".
Keeping the file accurate over time
A rules file drifts the moment you ship the next feature. Three tactics keep it useful:
- Review it in PRs. When a PR changes architecture or conventions, the rules file change should land in the same PR. Add a reminder to your PR template: "does this change any rule in CLAUDE.md?"
- Promote correction loops. The second time you correct an agent with the same instruction, that instruction belongs in the rules file. Agents give you a ready-made list of gaps.
- Delete dead rules. A deprecated "don't use redux" after you've fully migrated off redux is noise. Prune as aggressively as you add.
Treat the rules file like documentation for humans, because that's also what it is. A new teammate reading CLAUDE.md on day one should be able to answer "what are our conventions?" without asking anyone.
AGENTS.md: the de-facto cross-tool standard
AGENTS.md emerged in late 2025 as a shared convention for describing a project to any AI coding agent. It is not an RFC or an official spec — it is a convention driven by adoption. Codex, Aider, Goose, and a growing list of CLIs read it at the repo root. The format is unstructured markdown, and the sections most files cover match the ones this generator produces: stack, commands, conventions, architecture, do/don't lists.
If your team uses more than one agent tool, or if you want the rules file to work with whatever tool a contributor happens to prefer, AGENTS.md is the portable choice. Many teams commit both AGENTS.md and CLAUDE.md — either maintained in parallel via this generator, or symlinked. The generator produces both from one form; regenerate whenever the rules change.
Related tools
FAQ
Common questions
Is anything I type sent to a server?
No. The generator is pure client-side string assembly — your project name, stack, and internal conventions never leave the browser. There is no API call, no telemetry, no analytics tied to the form fields. Open DevTools → Network and you will see zero outbound requests while you type or switch formats. Safe to paste private architecture notes, internal tooling commands, or unreleased product names.
Which file should I generate — CLAUDE.md, AGENTS.md, or .cursorrules?
Depends on the tool your team uses. CLAUDE.md is for Claude Code (Anthropic's CLI) and lives at the repo root — Claude loads it into context every session. AGENTS.md is the de-facto cross-tool standard adopted by Codex, Aider, Goose, and a growing list of agents; use it if your team uses multiple CLIs or wants portability. .cursorrules is for Cursor IDE, .windsurfrules is for Windsurf/Codeium, .clinerules is for the Cline VS Code extension. Many teams commit both CLAUDE.md and AGENTS.md — and since both are plain markdown, one can symlink or import the other.
Can I keep more than one of these files in the same repo?
Yes, and it's common. Claude Code reads CLAUDE.md, Cursor reads .cursorrules, AGENTS.md is read by Codex/Aider/Goose — they don't conflict. The practical issue is keeping them in sync. Two options: (1) commit a single AGENTS.md and symlink the others to it (works on macOS/Linux, awkward on Windows); (2) generate all five from this tool whenever the rules change — takes 20 seconds and guarantees consistency.
What goes in the rules file vs what should stay in code?
The rules file captures what the code cannot self-document: why you chose an approach, what files are off-limits, which libraries are forbidden, what conventions you'd correct in code review. Good content: "always use the existing Button primitive, never roll your own", "db/migrations/* is auto-generated — never hand-edit", "route all mutations through server actions". Bad content: function-level docs (JSDoc them), file paths that will rot (the agent can list the directory), library versions (read package.json), recent decisions (git log is authoritative). Rule of thumb: if a senior engineer would say it to a new hire on day one, it belongs here.
How long should the file be?
Short enough to load in full context, long enough to prevent repeated corrections. For most projects, 100–300 lines is the sweet spot. Under 50 lines usually means the agent keeps asking questions that could have been answered; over 600 lines means the context gets bloated and the agent skims. If the file grows past 500 lines, split by topic: keep the universal rules in CLAUDE.md and move deep-dive architecture into docs/ — reference them from CLAUDE.md so the agent can read on demand.
What do the presets seed?
Each preset populates every field with a realistic example of that project archetype. "Web app" seeds a Next.js + TypeScript + pnpm + Drizzle stack with server-component conventions and Clerk auth. "CLI tool" seeds a Node + Commander + vitest layout with stdout-as-data rules. "Library / SDK" seeds a tsup-based pnpm workspace with changesets and a public-surface discipline. "Data / ML project" seeds a Python 3.12 + Polars + DuckDB + uv pipeline with pure-function transforms. Use a preset as a starting skeleton — replace project name, tweak the stack, edit the rules — much faster than starting empty.
What is AGENTS.md and is it a real standard?
AGENTS.md emerged in late 2025 as a shared convention for telling any AI coding agent about a project. It's a plain-markdown file at the repo root, read by Codex, Aider, Goose, and a growing list of CLIs. It is not an RFC or an official spec — it is a de-facto standard driven by adoption. The pattern is: one file, any agent. The format is unstructured markdown, but most files cover the same sections this generator covers (stack, commands, conventions, architecture, do/don't lists). If you are writing rules for a multi-agent team or want portability, AGENTS.md is the safer bet than tool-specific files.
Why are Do / Don't / Never-touch separate sections?
They describe different kinds of rules and the agent treats them differently. "Do" items are positive defaults — pick these when deciding how to implement something. "Don't" items are soft prohibitions — the agent will avoid but may override if you explicitly ask. "Never touch" is a hard boundary — paths or files the agent is not allowed to modify even if asked, because they are auto-generated, legally signed-off, or managed by an external release workflow. Separating them lets you calibrate pressure: a "don't" can be overridden with a good reason; "never touch" requires explicit removal from the rules file.
Where do I put the file once I've generated it?
Repo root, always — every supported agent looks there first. CLAUDE.md, AGENTS.md, .cursorrules, .windsurfrules, and .clinerules all sit next to package.json. For user-wide rules that apply across every project you open, Claude Code also reads ~/.claude/CLAUDE.md. Cursor supports subdirectory .cursorrules files too, which override the root file inside that folder — useful for monorepos where each package has different conventions. Commit the file to git so every teammate and every agent gets the same context.
Should the rules file be committed to git?
Yes. The whole point is to give every contributor — human or AI — the same starting context. Commit it, review changes to it in PRs (rules drift is real), and treat it as part of the documentation surface. If it contains anything secret, you're doing it wrong — rules files should describe conventions and architecture, not credentials or private URLs.
Does this include test-framework-specific rules or language-specific style guides?
Not automatically. The generator scaffolds the universal sections — stack, commands, conventions, architecture, rules — and leaves the content to you. If you want vitest-specific rules ("every test starts with describe(), prefer it.each over for-loops"), add them to the Conventions field. If you want Python-specific ("type-hint every function, use ruff not black"), same. The tool is opinionated about structure, unopinionated about content — that's deliberate, because good rules are project-specific.
Can I edit the generated file by hand after downloading?
Yes — the output is plain markdown, no hidden metadata, no structure required to keep working. Add sections, reorder them, drop ones that don't apply. The generator is a scaffold, not a runtime. A common workflow is: generate once to seed the file, then maintain it by hand going forward; re-run the generator only if you want to regenerate across formats or reset to a clean preset.
More in AI