cd /news/ai-agents/the-agents-md-file-i-drop-into-every… · home › topics › ai-agents › article
[ARTICLE · art-175786] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

The AGENTS.md file I drop into every client repo before my coding agent touches it

A developer at a web agency has standardized an AGENTS.md file placed in every client repo before a coding agent (Claude Code, Cursor, or Codex) begins work, with symlinks so each tool reads the same brief. The file defines do-not-edit paths like client-edited JSON and _redirects, a single source of truth for contact details, pre-finish checks such as build, link validation and Lighthouse scores, deploy rules requiring preview-first and explicit approval, and a running gotchas list. The developer says the practice shifted review from line-by-line diffs to checking preview URLs.

recommendation

Write an AGENTS.md in each repo listing do-not-edit paths, single-source-of-truth files, pre-finish checks and preview-only deploys, and add one line to a gotchas section each time the agent errs.

more in playbook: Working with AI coding agents
by read4 min views2 publishedNov 25, 2026

I build most client sites with a coding agent now. Claude Code mostly, Cursor when I want to watch the diff. The agent is fast, but the first few months it kept doing dumb stuff on client repos. Renaming image folders and breaking old URLs. Hardcoding the phone number in five places. Deleting a JSON file the client had just edited. Running a deploy from the wrong folder.

None of that was the agent being bad. It just didn't know the rules of my agency. So now every client repo gets an AGENTS.md file in the root before the agent touches anything. Claude Code reads CLAUDE.md, Cursor reads its rules, Codex reads AGENTS.md. I keep one file and symlink the others to it so they all get the same brief.

Here's roughly what goes in mine and why.

Astro static site, 9 pages, migrated from WordPress in 2026.
Audience: local patients booking appointments. Phone calls matter more than anything else.

Sounds obvious but it changes the agent's choices. When it knows phone calls are the goal it stops burying the number in the footer.

This is the most important section. On my sites the client edits their own content (hours, team bios, prices) and that lives in /data/*.json. If the agent "tidies up" those files it overwrites the clients changes.

## Do not edit
- public/data/*.json  (client edits these through /edit, pull latest before any change)
- public/_redirects    (old WordPress URLs, only append, never remove lines)
- src/assets/legal/*   (client supplied, don't reword)

The _redirects line saved me twice. Agents love deleting stuff that looks unused, and a 301 from /our-services-2/ looks very unused untill Google stops sending traffic.

Business name, phone, address, ABN, booking link. One file, src/site.ts, and the agent is told to import from it and never hardcode.

## Single source of truth
- Contact details, hours fallback, socials: src/site.ts
- Never hardcode phone/email/address in components

When the client changes their number I change one line and the agent greps to confirm nothing else has it.

Not "write clean code". Specific stuff:

src/assets and use <Image />, nothing raw in public/ except favicons That last one stops the agent reaching for React for a contact form. The form is plain HTML with a data- attribute and the host handles submissions. Zero JS.

## Before you finish
1. npm run build passes with no warnings
2. Every internal link resolves (npm run check:links)
3. Every page has a unique title and meta description
4. Lighthouse mobile perf >= 95 on home and contact
5. grep dist/ for "wp-content" returns nothing

I wrote about the checks themselves before, the point here is that they're written in the repo. A new agent session doesn't need me to remember them.

## Deploy
- Preview: npx novence deploy (gives a preview URL, send that to me)
- Production: only when I say "ship it". Never deploy to prod on your own.
- Never touch DNS. Ever.

All my client sites sit on novence.ai so the deploy line is the same in every repo, which is half the reason the file works. If each client was on a different host this section would be a mess. Some days I deploy through the MCP server instead of the CLI, same rule applies, preview first.

The bottom of the file is a running list:

## Gotchas
- 2026-10: client logo has a white box on dark bg, use logo-transparent.svg
- 2026-11: /book redirects to Cliniko, don't build a booking page

Every time the agent screws something up, one line goes here. It doesn't repeat it. This section ends up being the most valuable part after a few months.

I keep a starter AGENTS.md in my agency template repo, so a fresh migration starts with sections 2 to 6 filled in and I only write the client specific bits. Takes about ten minutes per site.

The difference is big. Before this file I'd review every diff line by line. Now I mostly review the preview URL and the check output, and the agent asks before it does anything risky because the file tells it what risky means.

If you're running client work through a coding agent and you don't have one of these yet, start with just the "do not edit" and "deploy" sections. Those two alone stop most of the expensive mistakes.

── more in #ai-agents 4 stories · sorted by recency
── more on @claude code 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/the-agents-md-file-i…] indexed:0 read:4min 2026-11-25 · —