payload-cms
SKILL.md
Payload CMS Rules
Key Principles
- Write concise, technical TypeScript code
- Prefer iteration and modularization over code duplication
- Use descriptive variable names
Collection Fields
- All fields should have
required: trueby default, unless explicitly optional
Access Control
- Define granular access control for all collections
- Use
authenticatedas a default - Use
anyonefor public read access
Types
- Use TypeScript for all code
- Avoid using the
anytype or type assertions; use proper type definitions and type guards instead
Performance
Payload Local API Queries (payload.find)
To optimize Payload local API queries for speed and efficiency:
- Use
depth: 0(or smallest depth possible) to avoid unnecessary relational field population - Use the
selectproperty to limit returned fields to only those needed - Set
limit: <number>andpagination: falsewhen pagination is not needed - Always pass the
reqobject to keep the query part of the same database transaction
req.payload.find({
collection: "pages",
depth: 0,
select: {
slug: true,
path: true,
},
limit: 0,
pagination: false,
req,
});
Weekly Installs
2
Repository
jhb-software/pa…templateGitHub Stars
21
First Seen
Mar 1, 2026
Security Audits
Installed on
opencode2
gemini-cli2
codebuddy2
github-copilot2
codex2
kimi-cli2