Learn-skills.dev payload
Expert guidance for building with Payload CMS - collections, fields, hooks, access control, Local API, authentication, uploads, and admin theming
install
source · Clone the upstream repo
git clone https://github.com/NeverSight/learn-skills.dev
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/NeverSight/learn-skills.dev "$T" && mkdir -p ~/.claude/skills && cp -r "$T/data/skills-md/aaronbakerdev/knearme-platform/payload" ~/.claude/skills/neversight-learn-skills-dev-payload && rm -rf "$T"
manifest:
data/skills-md/aaronbakerdev/knearme-platform/payload/SKILL.mdsource content
Payload CMS Skill
Comprehensive reference for Payload CMS development including data modeling, API usage, and admin customization.
Overview
Payload is a headless CMS and application framework built on Next.js. This skill covers collections, fields, hooks, access control, Local API operations, authentication, uploads, globals, plugins, and admin panel styling.
Quick Reference: Which File Do I Need?
| Task | Reference File |
|---|---|
| Create/configure a collection | |
| Add fields to a collection | |
| Run code before/after operations | |
| Control who can read/write data | |
| Query or mutate data server-side | |
| Use REST API externally | |
| Use GraphQL API | |
| Set up user login/auth | |
| Handle file/image uploads | |
| Organize uploads in folders | |
| Create site-wide settings | |
| Add official plugins (SEO, forms) | |
| Theme the admin panel | |
| Build custom admin components | |
| Configure rich text editor | |
| Set up live preview | |
| Enable drafts/versions | |
| Configure database/migrations | |
| Customize payload.config.ts | |
| Set up email/notifications | |
| Background jobs/scheduling | |
| Saved list view filters | |
| Soft delete/trash | |
| TypeScript type generation | |
| Deploy to production | |
Reference Files Summary
Core Data & API
| File | Lines | Description |
|---|---|---|
| ~200 | Collection config, slugs, admin options |
| ~220 | All field types, validation, conditional logic |
| ~50 | Single-document data (settings, nav) |
| ~170 | Lifecycle hooks for collections, fields, globals |
| ~200 | Permissions, RBAC, query constraints |
| ~190 | Server-side find, create, update, delete |
| ~240 | REST endpoints, query params, auth headers |
| ~245 | GraphQL queries, mutations, schema |
Authentication & Users
| File | Lines | Description |
|---|---|---|
| ~200 | Auth config, strategies, password reset |
| ~180 | Email adapters (Nodemailer, Resend), templates |
Content & Media
| File | Lines | Description |
|---|---|---|
| ~60 | Media uploads, image sizes, storage adapters |
| ~120 | Organize uploads in folder hierarchies |
| ~270 | Lexical editor, features, serialization |
| ~265 | Drafts, publishing, autosave, version history |
| ~115 | Soft delete, restore, permanent delete |
Admin Panel
| File | Lines | Description |
|---|---|---|
| ~180 | CSS variables, BEM classes, theming |
| ~300 | Field/Cell/View components, React hooks |
| ~215 | Real-time content preview in admin |
| ~125 | Saved filters for list views |
Configuration & Infrastructure
| File | Lines | Description |
|---|---|---|
| ~240 | payload.config.ts structure, all options |
| ~200 | MongoDB/Postgres adapters, migrations |
| ~60 | Official plugins and installation |
| ~220 | Type generation, payload-types.ts |
| ~215 | Background tasks, workers, scheduling |
| ~190 | Deployment (Vercel, Docker), env vars |
Common Workflows
Creating a New Collection
- Read
for config structurecollections.md - Read
to add your data fieldsfields.md - Read
to set permissionsaccess-control.md - Optionally read
for lifecycle logichooks.md
Building a Custom API Endpoint
- Read
for query syntaxlocal-api.md - Read
if auth context neededauthentication.md - Read
to understand permissionsaccess-control.md
Enabling File Uploads
- Read
for upload configuploads.md - Read
for upload/relationship field linkingfields.md - Read
if using cloud storage (S3, etc.)plugins.md
Theming the Admin Panel
- Read
for CSS variables and classesadmin-styling.md - Focus on elevation variables for dark/light mode
- Use
for overrides@layer payload
Quick Lookup Patterns
# Find hook types grep -n "beforeChange\|afterChange" references/hooks.md # Find field types grep -n "type:" references/fields.md # Find access control patterns grep -n "role\|RBAC" references/access-control.md # Find query operators grep -n "equals\|contains\|greater" references/local-api.md # Find CSS variables grep -n "elevation\|gutter" references/admin-styling.md
Key Patterns
Getting Payload Instance (Server-Side)
import { getPayload } from 'payload' import config from '@payload-config' const payload = await getPayload({ config })
Basic Query
const posts = await payload.find({ collection: 'posts', where: { status: { equals: 'published' } }, limit: 10, })
Access Control Function
access: { read: () => true, // Public create: ({ req }) => !!req.user, // Authenticated update: ({ req, id }) => req.user?.id === id, // Owner only }