Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/nedcodes-ok/cursorrules-collection/payload-cmsgit clone --depth 1 https://github.com/nedcodes-ok/cursorrules-collectionWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/nedcodes-ok/cursorrules-collection/payload-cms)<a href="https://agentmods.dev/rules/nedcodes-ok/cursorrules-collection/payload-cms"><img src="https://agentmods.dev/badge/rules/nedcodes-ok/cursorrules-collection/payload-cms.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00734 | $0.00734 |
| Opus 5 | $0.00367 | $0.00367 |
| Sonnet 5 | $0.00147 | $0.00147 |
| Haiku 4.5 | $0.00073 | $0.00073 |
Grade A, and why
payload-cms scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 63 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Payload CMS Cursor Rules
You are an expert in Payload CMS (v3+). Follow these rules:
Collections
- Define collections in separate files, export from
payload.config.ts - Use TypeScript-first config, every collection gets generated types via
payload generate:types - Set
slugto lowercase kebab-case matching the filename - Always define
accesscontrol on every collection, never leave defaults in production - Use
admin.useAsTitleto set which field displays in the admin list view - Group related collections with
admin.group
Fields
- Use the most specific field type:
emailnottextfor emails,numbernottextfor counts - Set
required: trueexplicitly on mandatory fields - Use
validatefunctions for custom validation, return a string on error - Relationship fields: set
hasManyexplicitly, userelationTowith collection slugs - Rich text: use Lexical editor (default in v3), configure toolbar features explicitly
- Use
tabsandcollapsiblefor organizing complex field schemas - Define reusable field groups as shared configs, not copy-paste
Hooks
- Use
beforeChangefor data transformation, validation, and slug generation - Use
afterChangefor side effects (emails, webhooks, cache invalidation) - Use
beforeRead/afterReadfor computed fields or data enrichment - Keep hooks focused on one concern, chain multiple hooks for complex logic
- Always type hook arguments:
CollectionBeforeChangeHook<YourType> - Access
req.userin hooks for auth context,req.payloadfor API calls
Access Control
- Define
access.create,access.read,access.update,access.deleteon every collection - Return
true/falsefor simple rules, return aWherequery for field-level filtering - Use
req.userto check roles/permissions, never trust client-side data - Create a reusable
isAdminaccess function, don't repeat role checks - Field-level access via
access.readandaccess.updateon individual fields
API Usage
- Use the Local API (
payload.find,payload.create) in server-side code, not REST - Always pass
depthto control relationship population, default can be expensive - Use
wherequeries with proper operators (equals,contains,in) - Paginate with
limitandpage, never fetch all documents without limits - Use
selectto fetch only needed fields when performance matters
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 63 lines · 734 tokens per session scan A cb15c35990e7
payload-cms is a cursor rule published in the GitHub repository nedcodes-ok/cursorrules-collection (37 stars, last pushed 6mo ago), licensed MIT. It adds 734 tokens to every session, about $0.0037 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other cursor rules, from other repositories
12-new-project
Workflow for starting a new app from this template - rebranding, identity, cleanup and first feature.
13-updating-project
Workflow for updating an existing project - dependency and SDK upgrades, migrations, refactors, bug fixes.
express
Express/Node.js best practices.
35-api-contracts
API versioning, contracts, and schema evolution rules.
cloudflare-workers-hono-auto
Cloudflare Workers with Hono framework development standards and best practices.
cloudflare-workers-auto
Cloudflare Workers development standards and best practices.