What is your developer-dependent CMS actually costing you? Calculate your costs and get a full report
What is your developer-dependent CMS actually costing you? Calculate your costs and get a full report
Vibe Coding
The AGENTS.md conventions that make each AI-built Agility site faster than the last: one canonical file, non-negotiables, one component pattern, Web Studio attribute rules, an instance ledger and an MCP gotchas list.
An AI coding tool starts every session knowing nothing about your project except what it can read. AGENTS.md is where you put the things it can't read from the code: your conventions, your instance's facts, and the mistakes you don't want repeated.
This article covers the conventions that made the biggest difference across our proof-of-concept builds (see Vibe Coding with Agility). For a complete, ready-to-extend file for the Agility Next.js Starter, including MCP rules, list limits, reference-name case and the cache-tag contract, use the template in Building an Agility Site with AI Coding Tools. This article doesn't repeat it.
Make AGENTS.md the single source of truth, and make every tool-specific file a short pointer to it:
CLAUDE.md for Claude Code.cursor/rules or .cursorrules for Cursor.github/copilot-instructions.md for GitHub CopilotEach pointer can be a single line: "Read AGENTS.md first. It is the source of truth for this project." When conventions live in five files they drift apart, and the AI tool follows whichever one it happened to read.
Put five to eight rules at the top, before anything else. These are the rules that, if broken, cause bugs the AI tool can't see in development. Typical ones for an Agility project:
Write project constraints as rules too. If a customer's security review rules out AI features in the shipped site, say "No AI features, MCP endpoints or analytics in this repo" in the non-negotiables, not in a paragraph on page three.
Give the AI tool one way to build a component, and an example to copy. For the Agility Next.js Starter that pattern is:
take.AgilityPic), and rich text uses the SDK's HTML rendering.When there's exactly one pattern, the AI tool's output is consistent and every component can be reviewed the same way.
Web Studio in-context editing depends on data-agility-* attributes in the rendered HTML. AI tools get these subtly wrong, so spell the rules out:
data-agility-component goes only on a component's root element.data-agility-field with the field name, and the element should contain only that field's value. If an element mixes a field with other text, an edit can overwrite the extra text.data-agility-nested-listitem, not data-agility-component.data-agility-html.Two more rules we have seen matter in practice: if your image component doesn't pass the field attribute through to the rendered element, wrap the image in an element that carries it; and some link-field layouts edit better without a field attribute than with one. Check each in Web Studio rather than assuming.
Agility Decorate can add these attributes for you and check them in CI.
Record the facts about your Agility instance in AGENTS.md, and update them the moment anything is created. Later sessions then start from facts, not from guesses or another round of lookups:
Ask the AI tool to add each entry as it creates the thing, in the same step. Recording IDs at the end of a session is how they get lost.
Every time you lose time to surprising behavior from the MCP server, the APIs or the framework, add one line to an "MCP gotchas" list in AGENTS.md: the symptom and what to do instead. Copy the list into each new project. It's the part of the file that compounds most.
Start with the ones in MCP and Agility Gotchas to Know Before You Build.
proxy file, Cache Components) that an AI tool working from older habits will write outdated code.AGENTS.md. Repeatable tasks such as "create a news article through the MCP server" or "review a pull request" work well as skills that AGENTS.md links to.Here's a generic skeleton with the sections above. Fill in the brackets, delete what doesn't apply, and add the starter-specific sections from Building an Agility Site with AI Coding Tools.
# AGENTS.md
Source of truth for AI coding tools in this repo. CLAUDE.md, Cursor rules
and Copilot instructions point here. Keep this file current: any change
to a convention, model or ID updates this file in the same change.
## Project
[One paragraph: who the site is for, the use case, the demo moment or
core feature to protect.]
## Non-negotiables
1. Every CMS read goes through lib/cms/ (it sets cache tags).
2. Every component is registered in components/agility-components/index.ts.
3. Env vars are read only through lib/env.ts.
4. Colors come only from CSS custom properties in the global stylesheet.
5. Saves go to Staging. Publishing level: [manual | via approval | autonomous].
6. Keep it small. Don't add features that aren't in docs/plan.md.
7. [Project constraint, e.g. "Use real public content; anything we wrote
is listed in docs/content-provenance.md".]
## Stack
Next.js 16 (App Router), React 19, TypeScript, Tailwind CSS 4, Node 24 LTS.
Next.js 16 may differ from your training data. Check the Next.js docs
before using caching, routing or proxy APIs.
## Component pattern
- Async server component. Receives its content ID, fetches its own
fields with getContentItem from lib/cms/.
- Linked lists: getContentList by reference name, with an explicit take.
- Images: AgilityPic. Rich text: render the HTML field, never raw strings.
- Register under the component model's reference name.
## Web Studio attributes
- data-agility-component on the component root only.
- data-agility-field="<fieldName>" on every rendered field; the element
contains only that field's value.
- data-agility-nested-listitem on each item rendered from a linked list.
- data-agility-html on rich text fields.
## Instance ledger
- Instance GUID: [guid] Locales: [en-us] Sitemap: [website]
- Page models: [Main] (zones: [MainContentZone])
| Kind | Reference name | ID | Notes |
| --- | --- | --- | --- |
| Content model | [Event] | [id] | |
| Container | [Events] | [id] | |
| Component model | [EventList] | [id] | |
| Seed content | [Event: Spring Open House] | [id] | from [source], [date] |
## MCP gotchas
- [Symptom] -> [what to do instead]
## Commands
npm run dev | npm run build | [test command]