# payload

Guides Payload CMS development across collections, hooks, and access control. Useful when debugging queries, validation, and database transactions.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 6900 installs · ★ 170
- Author: payloadcms
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/payloadcms/skills/tree/HEAD/skills/payload/SKILL.md
- Updated: 2026-08-10
- HTML: https://affpapa.org/en/nevibecode/skills/payload

## What it does

This skill guides coding assistants through Payload CMS architecture in Next.js and TypeScript. It covers `payload.config.ts` configuration, field declarations, row-level access control, and the Local API.

Inside, it outlines patterns for collections and fields: draft workflows with `versions: { drafts: true }`, virtual fields using field-level `hooks.afterRead`, and conditional fields via `admin.condition`. Transactions require threading `req` through every operation, otherwise database state can desynchronize. To avoid infinite loops inside hooks, check `req.context`.

It also details background task queues, geospatial queries with `point` fields, and plugin creation using SWC compilation.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add payloadcms/skills --skill payload -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/payload/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/payload/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add payloadcms/skills --skill payload -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/payload/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add payloadcms/skills --skill payload -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/payload/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install payloadcms/skills payload
```

2. **Manually: put the files in place**
- File: `.github/skills/payload/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add payloadcms/skills --skill payload -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/payloadcms/skills --path skills/payload
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/payload/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add payloadcms/skills --skill payload -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/payloadcms/skills/tree/HEAD/skills/payload/SKILL.md

## When to use it
- configure row-level access control with query filters
- stop infinite hook loops by checking `req.context`
- enable drafts and versioning in collection configs
- thread `req` across operations for transaction integrity

## Example prompts
- How do I configure draft workflows in payload.config.ts?
- Show me how to stop afterChange hooks from looping during Next.js revalidation.
- Write a beforeDelete hook to cascade document deletions.

## Similar
- [modern-web-development](https://affpapa.org/en/nevibecode/skills/modern-web-development.md) — skill · 1200 installs
- [graphql-development](https://affpapa.org/en/nevibecode/skills/graphql-development.md) — skill · 661 installs
- [sanity-best-practices](https://affpapa.org/en/nevibecode/skills/sanity-best-practices.md) — skill · 31800 installs
- [contentful-nextjs](https://affpapa.org/en/nevibecode/skills/contentful-nextjs.md) — skill · 333 installs
- [contentful-api](https://affpapa.org/en/nevibecode/skills/contentful-api.md) — skill · 382 installs
- [nestjs](https://affpapa.org/en/nevibecode/skills/nestjs.md) — skill · 4200 installs

From the same set: [payloadcms/skills](https://affpapa.org/en/nevibecode/by/payloadcms/skills.md) — 2 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
