Agent rule: layout is changed through the CMS, and every change is checked in a browser
Back to our planProblem
Agents change layout in code by default. The owner's standing direction is that layout is content: it should be changed through the CMS, never through a code change and deploy, and the repo's rules don't say so yet. The same direction asks that every content, markup or code change is checked in a browser.
Proposed fix
Add one short rule where agents already read about CMS content and page building (the docs/guidelines/payload-cms.md Blocks section; the owner may prefer another file), drafted as a principle only:
Layout is content. Every layout choice (width, alignment, position, order, spacing, grouping) is a field an editor, or an agent through Admin, can change in the CMS with no code change and no deploy. Build layouts from the CMS's native blocks and layout fields. When a layout can't be expressed, add the missing field to the block; never hard-code an arrangement in a component. A code change for layout is the last resort.
After any content, markup or code change, check the result in a browser.
This is a policy change, so it waits for the owner. The first use is the layout-builder work in the linked feature issue.
Acceptance criteria
- The owner approves the wording and the file.
- The rule is added in a pull request that records his decision, with the date and where he gave it.
- The generated agent context under
.claude/rules/generated/is refreshed (npm run agent-context -- --write) and the budget check passes.
Open questions
- Which file: the CMS guideline's Blocks section, or somewhere agents read earlier?
Generated by Claude Code, opens in a new tab