payload

Diagnose validation errors, security issues, and hook behavior in Payload CMS projects.

322|45|Updated Dec 1, 2025
One-click install
npx skills add https://github.com/Microck/ordinary-claude-skills --skill payload
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: payload
Source: https://github.com/Microck/ordinary-claude-skills/tree/main/skills_all/payload
Command: npx skills add https://github.com/Microck/ordinary-claude-skills --skill payload

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Provides guidance for Payload CMS projects, covering payload.config.ts, collections, fields, hooks, access control, and API usage.

Core Features & Use Cases

  • Auto-generated field and collection patterns
  • Access control and hook behavior guidance
  • Local API usage and validation tips

Quick Start

Configure a new collection in payload.config.ts and define a simple hook for afterRead.

Frequently Asked Questions about payload

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug validation errors in Payload CMS collections?

Validation errors in Payload CMS occur when field constraints are violated during document creation or updates. Configure field validators in your collection schema, use the Local API to test validation logic before deployment, and check hook execution order to isolate where validation fails. The Skill provides patterns for diagnosing and resolving these errors across different field types.

How do I set up access control rules in Payload CMS?

Access control in Payload CMS is enforced through access functions on collections and fields in payload.config.ts. These functions return boolean or role-based logic to determine read, create, update, and delete permissions. The Skill covers security constraint patterns and practical scenarios for implementing and debugging access control across your API and admin UI.

Can I use hooks to transform data in Payload CMS and when should I use them?

Hooks in Payload CMS—beforeValidate, afterRead, beforeChange, afterChange—trigger custom logic at specific lifecycle points. Use them to transform fields, enforce relationships, generate slugs, or handle complex side effects. The Skill provides guidance on hook behavior, transaction handling, and tuning logic to avoid performance issues.

How do I resolve complex relationship queries in Payload CMS?

Relationship queries in Payload CMS let you populate nested documents and filter across collections. Use the Local API with depth parameters, leverage hooks for relationship validation, and structure your queries to avoid N+1 problems. The Skill addresses debugging relationship errors and optimizing query performance in TypeScript/JavaScript projects.

What's the best way to configure drafts and versions in Payload CMS?

Drafts and versions in Payload CMS preserve document history and allow staged publishing. Enable versioning in payload.config.ts, use access control to restrict draft visibility, and leverage hooks to enforce publish workflows. The Skill covers documented patterns for configuring these features alongside validation and security constraints.

Does Payload CMS support custom storage adapters and how do I configure them?

Payload CMS supports custom storage adapters for file uploads through the storage adapter interface in payload.config.ts. Configure upload collection settings and adapter functions to handle storage logic. The Skill provides technical guidance on adapter setup as part of comprehensive Payload project configuration.