AGENTS.md Generator: Practical Tips and Common Mistakes
Reviewed by the OnlineFree.app team · Updated
Key points
- AGENTS.md tells an AI coding agent your stack, commands and constraints before it edits a repository.
- The AGENTS.md Generator builds one from three inputs: project name, tech stack and a rule-per-line list.
- Keep the finished file near 120 lines because every line is re-sent on every agent turn.
- Anything in parentheses or after a # in your rules is trimmed as an explanation.
- The generator infers commands from your stack string, so verify each one by running it.
What is AGENTS.md?
AGENTS.md is a plain Markdown file committed at the root of a repository that tells an AI coding agent your stack, your exact commands and your project constraints before it edits anything. The AGENTS.md Generator builds that file from three answers in about a minute.
Because the agent reads the file at the start of a session, every line in it is context the model pays for repeatedly. A 400-line document competes with your actual source code for attention, which is why the generator is deliberately terse.
Its output has no frontmatter and no boilerplate: an H1 project title, a one-line overview, a Stack section, a Commands section inferred from your stack string, and a Rules section. Nothing else is added unless your input requires it.
How do you generate an AGENTS.md step by step?
Open the generator and fill three fields: project name (required, for example acme-dashboard), tech stack (free text or comma-separated, for example "Next.js 15, TypeScript, Tailwind, Vitest, pnpm") and rules, one per line, up to a 4,000-character limit.
The stack string does the heavy lifting. It drives the inferred command block, so naming pnpm instead of Node produces pnpm build, pnpm dev and pnpm test rather than npm equivalents. Name the package manager, framework and test runner explicitly — vaguer strings produce vaguer commands.
Rules are normalized on output: duplicate lines collapse into one, bullets are tightened, and anything inside (parentheses) or after a # is treated as an explanation and trimmed. A line like "Use pnpm, not npm (CI enforces this)" lands as "Use pnpm, not npm", which is the part an agent needs.
Finish by copying to clipboard or downloading the file. The filename is kebab-cased from the project name and falls back to AGENTS, and the download is served as text/markdown. Read it once before committing — the generator knows your stack string, not your codebase.
Why keep the file under 120 lines?
Every line is re-sent on every agent turn in a session, so a bloated instruction file is a recurring cost rather than a one-off one. The generator targets roughly 120 lines or fewer by design; if your rules list runs to 60 items, the file has stopped being an instruction sheet and become documentation.
You can put a number on it. Paste the generated file into the LLM Token Cost Calculator to see what it costs per turn at your model's rates, then multiply by your realistic turns per day. Treat the result as an estimate, not a bill — pricing and caching behaviour change.
A useful test: if a rule would be enforced automatically by a formatter or linter, delete it. Saying "2-space indentation" in AGENTS.md duplicates Prettier and risks contradicting it when the config changes.
Common mistakes when writing project rules
The most frequent problem is writing rules as flowing paragraphs. The tool expects one rule per line, and paragraph-style input produces a bullet list that is hard for an agent to act on and hard for you to audit later.
The second is leaving the stack vague. "React app" gives the generator almost nothing to infer commands from; "React 19, Vite, TypeScript, Vitest, npm" produces a real Commands block. Include the package manager even if it feels obvious.
The third is writing only negative rules — what the agent must never do — without stating what it should do instead. "Never edit /generated" is stronger paired with "Regenerate via pnpm codegen". Positive instructions give the agent a path forward rather than a dead end.
Finally, never put secrets, API keys, internal hostnames or credentials in the file. AGENTS.md is committed to version control and is read by every agent and every collaborator with repository access.
What the AGENTS.md Generator can't do
It never reads your repository, so it cannot know that your tests actually run through pnpm test:unit or that your dev server needs a specific port. Run each inferred command once before you commit the file.
It produces a single root-level file. Monorepos where each package needs its own instructions, or teams that want a nested AGENTS.md per directory, require manual structuring. There is also no frontmatter, which some agent configurations expect.
Naming conventions still vary. As of 2026, AGENTS.md is a widely adopted cross-tool convention, but some agents check their own filename or a rules directory first, so confirm against your tool's documentation rather than assuming.
Because the generator runs entirely in the browser on OnlineFree.app with no signup and no telemetry, nothing you paste is transmitted or stored — which also means no history. Keep your canonical rules in version control and regenerate from there.
Frequently asked questions
What is the AGENTS.md Generator and is it free?
It is a free browser-based tool on OnlineFree.app that turns a project name, a tech stack and a rules list into a clean AGENTS.md you can copy or download. There is no signup, no account and no telemetry; the file is assembled in your browser.
How many rules should I put in an AGENTS.md file?
Keep the finished file at roughly 120 lines or fewer, which usually means about 10 to 25 rules. Every rule is re-sent to the agent on every turn, so a 60-item list costs tokens and dilutes attention. Move anything that belongs in a linter config or README out.
Does the AGENTS.md Generator store the rules I type in?
No. The output is assembled in your browser, so the tool does not transmit or keep what you paste, and it works without an account. That also means there is no saved history — closing the tab loses your input, so keep the canonical rules in version control.
Can I use the generated AGENTS.md with Cursor or Claude Code?
AGENTS.md is a cross-tool convention, and as of 2026 several coding agents read it from the repository root automatically. Some tools check their own filename or rules directory first, so confirm against your agent's documentation. The generated output is plain Markdown, so you can rename or adapt it freely.
What does the AGENTS.md Generator infer from my tech stack?
It uses the stack string to build the Commands section: the package manager plus framework and test runner produce build, dev and test commands such as pnpm build, pnpm dev and pnpm test. It does not read your repository, so verify each command actually runs before committing the file.