Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

payload-cms

БесплатноБез исполняемых скриптовНе проверен

Payload is an open-source, code-first headless CMS and application framework that runs inside a Next.js app, with collections defined in TypeScript. Use this…

TerminalSkillsот TerminalSkills★ 221 звезда на GitHub

Об этом скилле

Payload CMS

Overview

Payload CMS is a code-first headless CMS where collections and fields are defined in TypeScript, auto-generating an admin panel, REST/GraphQL APIs, and TypeScript types. It supports PostgreSQL, MongoDB, and SQLite, and integrates directly into Next.js applications with the Local API.

Overview

Payload (3.x) is a code-first headless CMS where collections and fields are defined in TypeScript, auto-generating an admin panel, REST/GraphQL APIs, and TypeScript types. It installs into a Next.js app (the admin lives at /admin in your own project), supports MongoDB, PostgreSQL and SQLite through separate database adapters, and exposes a Local API that queries the database directly without HTTP.

Instructions

  • Install. New project: npx create-payload-app@latest. Existing Next.js app: pnpm i payload @payloadcms/next @payloadcms/richtext-lexical sharp graphql, plus one adapter (@payloadcms/db-mongodb, @payloadcms/db-postgres or @payloadcms/db-sqlite), copy the app/(payload) folder from the official template, and wrap next.config with withPayload from @payloadcms/next/withPayload. The payload.config.ts calls buildConfig({ secret: process.env.PAYLOAD_SECRET, db, editor, collections, globals, sharp }); the rich-text editor is not bundled, so pass lexicalEditor() from @payloadcms/richtext-lexical.
  • Collections. Config objects with slug, fields, access, hooks, using field types such as text, richText, relationship, upload, array, group, blocks and select. Run payload generate:types after schema changes to refresh payload-types.ts, and payload generate:importmap after adding custom admin components.
  • Access control. Functions per operation (create, read, update, delete) on the collection and per field, receiving { req } and returning a boolean or a query constraint, for example ({ req: { user } }) => user?.role === 'admin'. Write reusable functions like isAdmin once and import them.
  • Local API. const payload = await getPayload({ config }) (config from @payload-config) in Server Components, then payload.find({ collection, where, depth, limit }) and payload.create(...). The Local API skips access control by default; pass overrideAccess: false and user whenever the call runs on behalf of a visitor.
  • Drafts and versions. versions: { drafts: true } adds a _status field (draft or published). Saving with draft: true writes only to the versions table; publishing means setting _status: 'published'. autosave and scheduled publishing are options (scheduling needs the jobs queue). Query unpublished content with draft: true and restrict who may read it.
  • Pages from blocks. A blocks field lets editors compose pages from block types you define; share field groups as functions that return field arrays.
  • Admin panel. Replace components via admin.components using path strings, add custom views, and configure admin.livePreview with a url and breakpoints for real-time preview.
  • Globals hold singletons such as site settings, header and footer; use relationships rather than manual ID references.
  • Database changes. MongoDB needs no migrations. For Postgres/SQLite, dev mode pushes schema changes automatically, but production should use payload migrate:create and payload migrate.

Examples

Example 1: Build a blog CMS with Next.js

User request: "Set up Payload CMS for a blog with categories, authors, and rich text"

// src/collections/Posts.ts
import type { CollectionConfig } from 'payload'

export const Posts: CollectionConfig = {
  slug: 'posts',
  admin: { useAsTitle: 'title' },
  versions: { drafts: true },
  access: { read: ({ req: { user } }) => (user ? true : { _status: { equals: 'published' } }) },
  fields: [
    { name: 'title', type: 'text', required: true },
    { name: 'author', type: 'relationship', relationTo: 'users', required: true },
    { name: 'categories', type: 'relationship', relationTo: 'categories', hasMany: true },
    { name: 'content', type: 'richText' },
  ],
}
// app/(frontend)/blog/page.tsx (Server Component)
const payload = await getPayload({ config })
const { docs } = await payload.find({ collection: 'posts', limit: 10, sort: '-createdAt' })

Result: /admin shows Posts with Save Draft / Publish buttons; the blog page lists only published posts, fully typed.

Example 2: Create a multi-role content workflow

User request: "Set up Payload with editor, reviewer, and admin roles with different permissions"

// src/access/roles.ts
import type { Access, FieldAccess } from 'payload'

export const isAdmin: Access = ({ req: { user } }) => user?.role === 'admin'
export const isStaff: Access = ({ req: { user } }) => Boolean(user && ['editor', 'reviewer', 'admin'].includes(user.role))
export const adminOnlyField: FieldAccess = ({ req: { user } }) => user?.role === 'admin'

Add `{ name: 'role',

Полный SKILL.md на GitHub

Установить payload-cms в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

_scores.json

FAQ

Что делает скилл payload-cms?

Payload is an open-source, code-first headless CMS and application framework that runs inside a Next.js app, with collections defined in TypeScript. Use this skill when defining collections in TypeScript, configuring access control, customizing the admin panel, or integrating with Next.js. Trigger words: payload, payload cms, headless cms, collections, admin panel, content management, payload fields.

Как установить скилл payload-cms?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл payload-cms запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить payload-cms с