Rules file
Also called AGENTS.md, CLAUDE.md, or project rules
A file in your project, such as AGENTS.md or CLAUDE.md, with standing instructions that an AI coding agent reads at the start of every task.
# AGENTS.md
## Stack
- Next.js App Router, TypeScript, Tailwind CSS.
- Run the app with `npm run dev`. Test with `npm test`.
## Rules
- Style with Tailwind classes. Never use inline styles.
- Put shared UI in `components/` and name files in kebab-case.
- Ask before adding a new dependency.Create an AGENTS.md for this project with the stack, the commands to run, test, and build it, and the folder structure. Add these rules: use Tailwind classes instead of inline styles, ask before adding a dependency, and never edit generated migration files by hand.
Paste into Layerwise or any AI coding tool.
What is Rules file?
A rules file holds the instructions you would otherwise repeat in every prompt: the stack, how to run and test the app, naming and style conventions, and things to never do. Coding agents load it automatically, so every conversation starts from the same ground rules.
Tools look for different files. AGENTS.md is an open format that many agents read, including Codex, while Claude Code reads CLAUDE.md, and some editors keep rules in their own folder. Many tools also read a personal rules file in your home folder that applies to every project.
Keep it short and concrete. "Use Tailwind classes, never inline styles" works better than "write clean code." The file takes up room in the context window on every request, so cut rules the AI already follows and add one when you catch it repeating a mistake.
Related terms
All termsContext window
The amount of text an AI model can consider at once, including your messages, its replies, and the files it reads, measured in tokens.
Prompt
The instruction you give an AI model. In AI coding tools, the prompt describes what to build or change, and its detail shapes the result.
AI agent
An AI model that works toward a goal on its own by planning, using tools, checking the results, and repeating until the task is done.
MCP
The Model Context Protocol: an open standard that connects AI apps to outside tools and data, such as files, databases, and design apps.
Build it with Layerwise
Describe your app, watch it run in a live preview, and publish it with a database, storage, and sign-in built in.