What agents should know before contributing
payloadcms/payload
Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.
Read by Bluet from 2 files written for agents and 300 merged pull requests on 2026-09-25. Not reviewed by the maintainers.
Rules its files tell agents (15)
- CONTRIBUTING.md
mustNever commit a baseline PNG from any other source — a manual screenshot, a screenshot tool, an editor extensio…
Never commit a baseline PNG from any other source — a manual screenshot, a screenshot tool, an editor extension, an AI agent's screenshot capability, or a browser's own "save image" — even if it looks identical to you. Only a PNG written by the commands above is guaranteed to match what CI renders; anything else reads as a match locally and then fails every time on CI.
- AGENTS.md
mustNever reference raw --ramp-* palette tokens directly outside of colors.css as they aren't theme-aware.
Colors: use semantic --color-* tokens from colors.css (e.g. --color-bg, --color-text-brand, --color-border). Never reference raw --ramp-* palette tokens directly outside of colors.css as they aren't theme-aware.
- CONTRIBUTING.md
mustBaselines must be generated or updated inside the pinned Playwright Docker image, never on a bare host.
Baselines must be generated or updated inside the pinned Playwright Docker image, never on a bare host. Font rendering differs enough between operating systems that a baseline captured on macOS or Windows will fail the comparison on CI even when nothing visually changed.
- AGENTS.md
mustMobile-first media queries only - never max-width:
- AGENTS.md
mustNever use !important (plugin/no-important).
Never use !important (plugin/no-important). Refactor selector specificity instead. Exceptions to this rule are when it's not possible to do so when dealing with external libraries.
- AGENTS.md
mustBaselines must be generated/updated inside the pinned Playwright Docker image, never on a bare host — font ren…
Baselines must be generated/updated inside the pinned Playwright Docker image, never on a bare host — font rendering differs enough between operating systems to fail the comparison on CI even when nothing visually changed. Use pnpm test:visual:update.
- AGENTS.md
mustMemoize arrays/objects passed to hooks: Never pass inline array/object literals to custom hooks - they create…
Memoize arrays/objects passed to hooks: Never pass inline array/object literals to custom hooks - they create new references on every render, breaking memoization and causing unnecessary re-renders or remounts.
- AGENTS.md
shouldRelative imports don't respect 'use client' boundaries in production builds.
When a .server.tsx file needs to render a client component, it must import from the client exports bundle, not via relative path. Relative imports don't respect 'use client' boundaries in production builds.
- CONTRIBUTING.md
shouldIf you come across an issue related to security, or a potential attack vector within Payload or one of its dep…
If you come across an issue related to security, or a potential attack vector within Payload or one of its dependencies, please DO NOT create a publicly viewable issue. Instead, please contact us directly at dev@payloadcms.com. We will do everything we can to respond to the issue as soon as possible.
- AGENTS.md
shouldDon't invent one-off breakpoint values.
Only the four canonical breakpoints are allowed in a media query (plugin/no-non-standard-breakpoints): 400px, 768px, 1024px, 1440px. Don't invent one-off breakpoint values.
- AGENTS.md
shouldDo not initialize Payload manually or add database reset/seed hooks; the fixture initializes Payload once per…
Do not initialize Payload manually or add database reset/seed hooks; the fixture initializes Payload once per file, resets and seeds before each test that uses it, and destroys it afterward
- AGENTS.md
shouldDon't: Place multiple ComponentName.tsx files in a single folder with one shared .css file
- AGENTS.md
shouldUse test.suite('My Feature', {}, () => { ... }) only for integration tests that do not use Payload
- AGENTS.md
shouldInvalid: payload.logger.error('message', err) - don't pass error as second argument
- AGENTS.md
shouldDon't write custom if/else logic to handle different label types.
Translation/Label handling: Always use getTranslation from @payloadcms/translations when you need to render labels defined in the config - it already handles functions, strings, and translation objects correctly. Don't write custom if/else logic to handle different label types.
Decisions its pull requests settled (16)
- #17476mark website button as client component for radix-slot context
- #17474mark website button as client component for radix-slot context
- #17510reduce default query depth from 2 to 1
- #17540apply the documented auth.depth default of 0
- #17520restore depth 2 in templates and examples
- #17580faster config sanitization by making it synchronous
- #17632connect to the correct Next.js dev HMR endpoint per version
- #17644connect to the correct Next.js dev HMR endpoint per version (3.x)
- #17790rich text fields not read-only inside tabs on trashed and locked documents
- #17674support PAYLOAD_SECRET rotation with a versioned keyring
- #17791rich text fields not read-only inside tabs on trashed and locked documents 3.x
- #17856avoid buffering large client uploads into memory
- #17872avoid buffering large client uploads into memory
- #18092add additional regression tests for client-upload fields
- #17874publish active locale by default, remove `defaultLocalePublishOption`
- #18198lint all CSS files instead of only changed ones