Skip to content

Commit 4de9088

Browse files
authored
feat(claude): create payload plugin (#14403)
- Adds preliminary Payload plugin for Claude Code (**beta**) - Provides comprehensive Payload 3.x development guidance (collections, fields, hooks, access control, queries, adapters, plugins) - Auto-activates when working with `payload.config.ts` or collection configs - Installable via `/plugin install github:payloadcms/payload` - Includes plugin development reference documentation
1 parent a3df837 commit 4de9088

File tree

13 files changed

+1531
-1
lines changed

13 files changed

+1531
-1
lines changed

.claude-plugin/README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Payload Skill for Claude Code
2+
3+
Claude Code skill providing comprehensive guidance for Payload 3.x development with TypeScript patterns, field configurations, hooks, access control, and API examples.
4+
5+
## Installation
6+
7+
### From GitHub
8+
9+
Install this skill directly from the Payload repository:
10+
11+
```bash
12+
/plugin install github:payloadcms/payload
13+
```
14+
15+
## What's Included
16+
17+
The `payload` skill provides expert guidance on:
18+
19+
- **Collections**: Auth, uploads, drafts, live preview configurations
20+
- **Fields**: All field types including relationships, arrays, blocks, joins, virtual fields
21+
- **Hooks**: beforeChange, afterChange, beforeValidate, field hooks
22+
- **Access Control**: Collection, field, and global access patterns including RBAC and multi-tenant
23+
- **Queries**: Local API, REST, and GraphQL with complex operators
24+
- **Database Adapters**: MongoDB, Postgres, SQLite configurations and transactions
25+
- **Advanced Features**: Jobs queue, custom endpoints, localization, plugins
26+
27+
## Usage
28+
29+
Once installed, Claude will automatically invoke the skill when you're working on Payload CMS projects. The skill activates when you:
30+
31+
- Edit `payload.config.ts` files
32+
- Work with collection or global configurations
33+
- Ask about Payload-specific patterns
34+
- Need guidance on fields, hooks, or access control
35+
36+
You can also explicitly invoke it:
37+
38+
```
39+
@payload how do I implement row-level access control?
40+
```
41+
42+
## Documentation Structure
43+
44+
```
45+
skills/payload/
46+
├── SKILL.md # Main skill file with quick reference
47+
└── reference/
48+
├── FIELDS.md # All field types and configurations
49+
├── COLLECTIONS.md # Collection patterns
50+
├── HOOKS.md # Hook patterns and examples
51+
├── ACCESS-CONTROL.md # Basic access control
52+
├── ACCESS-CONTROL-ADVANCED.md # Advanced access patterns
53+
├── QUERIES.md # Query patterns and APIs
54+
├── ADAPTERS.md # Database and storage adapters
55+
└── ADVANCED.md # Jobs, endpoints, localization
56+
```
57+
58+
## Resources
59+
60+
- [Payload Documentation](https://payloadcms.com/docs)
61+
- [GitHub Repository](https://github.com/payloadcms/payload)
62+
- [Examples](https://github.com/payloadcms/payload/tree/main/examples)
63+
- [Templates](https://github.com/payloadcms/payload/tree/main/templates)
64+
65+
## License
66+
67+
MIT

.claude/skills/payload-cms/SKILL.md renamed to .claude-plugin/commands/payload/SKILL.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: payload-cms
2+
name: payload
33
description: Use when working with Payload CMS projects, payload.config.ts, collections, fields, hooks, access control, or Payload API. Provides TypeScript patterns and examples for Payload 3.x development.
44
---
55

@@ -27,6 +27,10 @@ Payload 3.x is a Next.js native CMS with TypeScript-first architecture, providin
2727
| Custom API routes | Collection/root endpoints | [ADVANCED.md#custom-endpoints](reference/ADVANCED.md#custom-endpoints) |
2828
| Cloud storage | Storage adapter plugins | [ADAPTERS.md#storage-adapters](reference/ADAPTERS.md#storage-adapters) |
2929
| Multi-language | `localization` config + `localized: true` | [ADVANCED.md#localization](reference/ADVANCED.md#localization) |
30+
| Create plugin | `(options) => (config) => Config` | [PLUGIN-DEVELOPMENT.md#plugin-architecture](reference/PLUGIN-DEVELOPMENT.md#plugin-architecture) |
31+
| Plugin package setup | Package structure with SWC | [PLUGIN-DEVELOPMENT.md#plugin-package-structure](reference/PLUGIN-DEVELOPMENT.md#plugin-package-structure) |
32+
| Add fields to collection | Map collections, spread fields | [PLUGIN-DEVELOPMENT.md#adding-fields-to-collections](reference/PLUGIN-DEVELOPMENT.md#adding-fields-to-collections) |
33+
| Plugin hooks | Preserve existing hooks in array | [PLUGIN-DEVELOPMENT.md#adding-hooks](reference/PLUGIN-DEVELOPMENT.md#adding-hooks) |
3034

3135
## Quick Start
3236

@@ -199,6 +203,7 @@ import type { Post, User } from '@/payload-types'
199203
- **[QUERIES.md](reference/QUERIES.md)** - Query operators, Local/REST/GraphQL APIs
200204
- **[ADAPTERS.md](reference/ADAPTERS.md)** - Database, storage, email adapters, transactions
201205
- **[ADVANCED.md](reference/ADVANCED.md)** - Authentication, jobs, endpoints, components, plugins, localization
206+
- **[PLUGIN-DEVELOPMENT.md](reference/PLUGIN-DEVELOPMENT.md)** - Plugin architecture, monorepo structure, patterns, best practices
202207

203208
## Resources
204209

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)