This skill guides you through creating well-structured Claude Code plugins with all necessary components, following best practices for discoverability, maintainability, and user experience.
Guides you through creating well-structured Claude Code plugins with proper metadata, skills, commands, and marketplace registration. Use when starting new plugins or adding components to existing ones.
/plugin marketplace add joel611/claude-plugins/plugin install plugin-builder@joel-pluginsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
resources/command-template.mdresources/marketplace-entry.jsonresources/plugin-template.jsonresources/skill-template.mdThis skill guides you through creating well-structured Claude Code plugins with all necessary components, following best practices for discoverability, maintainability, and user experience.
Use this skill when:
A Claude Code plugin follows this structure:
plugin-name/
├── .claude-plugin/
│ └── plugin.json # Required: Plugin metadata
├── skills/ # Optional: Agent Skills
│ └── skill-name/
│ ├── SKILL.md # Skill instructions
│ ├── scripts/ # Optional: Executable code
│ └── resources/ # Optional: Templates, data
├── commands/ # Optional: Custom slash commands
│ └── command-name.md
├── agents/ # Optional: Custom agent definitions
├── hooks/ # Optional: Event handlers
│ └── hooks.json
└── .mcp.json # Optional: MCP server configuration
Before creating files, clarify:
my-plugin-name)plugins/ directoryplugins/category/plugin-name/mkdir -p plugins/category/plugin-name/.claude-plugin
mkdir -p plugins/category/plugin-name/skills
mkdir -p plugins/category/plugin-name/commands # if needed
Create .claude-plugin/plugin.json with this structure:
{
"name": "plugin-name",
"description": "Clear, concise description of plugin functionality (1-2 sentences)",
"version": "1.0.0",
"author": {
"name": "Author Name",
"email": "author@example.com"
}
}
Required fields:
name: Plugin identifier (kebab-case, no spaces)description: User-facing description (be specific about what it does)version: Semantic version (major.minor.patch)author.name: Author's nameVersion Guidelines:
1.0.0 for initial releaseFor each skill in the plugin:
Create skill directory:
mkdir -p plugins/category/plugin-name/skills/skill-name
Create SKILL.md using progressive disclosure format:
# Skill Name
## Purpose
[1-2 sentences: What this skill does and its main value]
## When to Use
[Bullet list of specific scenarios where this skill applies]
- Creating X
- Automating Y
- Solving Z problem
## Prerequisites
[What's needed before using this skill]
- Required tools or libraries
- Necessary permissions or access
- Context or information needed
## Instructions
### Task 1: [First Major Step]
[Detailed step-by-step instructions]
1. Do this first
2. Then do this
3. Finally do this
### Task 2: [Second Major Step]
[More detailed instructions]
[Continue with all major tasks...]
## Examples
### Example 1: [Concrete Use Case]
[Show complete example with actual code/commands]
\`\`\`language
[actual code]
\`\`\`
### Example 2: [Another Use Case]
[Another complete example]
## Best Practices
- [Specific practice 1]
- [Specific practice 2]
- [Specific practice 3]
## Common Issues
- **Problem:** [Description]
**Solution:** [How to fix]
- **Problem:** [Description]
**Solution:** [How to fix]
mkdir -p plugins/category/plugin-name/skills/skill-name/resources
mkdir -p plugins/category/plugin-name/skills/skill-name/scripts
Skill Best Practices:
For custom slash commands:
Create command file:
touch plugins/category/plugin-name/commands/command-name.md
Write command markdown:
# Command Name
[Description of what this command does]
## Usage
/command-name [arguments]
## Examples
/command-name example-arg
## Parameters
- `arg1`: Description of first argument
- `arg2`: Description of second argument (optional)
## Instructions for Claude
[Detailed instructions for what Claude should do when this command is invoked]
1. Step 1
2. Step 2
3. Step 3
Open marketplace.json:
Located at .claude-plugin/marketplace.json in the repository root
Add plugin entry:
{
"name": "marketplace-name",
"plugins": [
{
"name": "plugin-name",
"source": "./plugins/category/plugin-name",
"description": "Plugin description"
}
]
}
Important: For local plugins, the source field must start with ./ to specify a relative path from the marketplace root.
Checklist:
Install the plugin locally:
/plugin install plugin-name@marketplace-nameTest skill invocation:
Test commands:
Iterate:
Scenario: Create a plugin that validates JSON schemas
Step-by-step:
Create structure:
mkdir -p plugins/data/json-validator/.claude-plugin
mkdir -p plugins/data/json-validator/skills/json-validator
Create plugin.json:
{
"name": "json-validator",
"description": "Validates JSON data against schemas with detailed error reporting",
"version": "1.0.0",
"author": {
"name": "Data Team"
}
}
Create SKILL.md:
# JSON Validator Skill
## Purpose
Validates JSON data against JSON Schema specifications and provides detailed error reports.
## When to Use
- Validating API request/response payloads
- Checking configuration files
- Ensuring data structure compliance
## Prerequisites
- JSON data to validate
- JSON Schema definition
- Understanding of JSON Schema syntax
## Instructions
### Validate JSON Data
1. Receive or locate the JSON data to validate
2. Receive or locate the JSON Schema
3. Parse both JSON data and schema
4. Validate data against schema
5. Report validation results with specific errors
6. Suggest fixes for validation errors
## Examples
### Example 1: Validate User Object
Schema:
\`\`\`json
{
"type": "object",
"properties": {
"name": {"type": "string"},
"age": {"type": "number"}
},
"required": ["name"]
}
\`\`\`
Valid data:
\`\`\`json
{"name": "Alice", "age": 30}
\`\`\`
Invalid data:
\`\`\`json
{"age": 30}
\`\`\`
Error: Missing required property 'name'
## Best Practices
- Always show the full error path for nested objects
- Suggest corrected JSON when possible
- Validate schema itself before using it
- Handle common schema mistakes gracefully
## Common Issues
- **Problem:** Schema reference ($ref) not resolved
**Solution:** Ensure all referenced schemas are accessible
- **Problem:** Type coercion confusion
**Solution:** Be explicit about type expectations
Update marketplace.json:
{
"plugins": [
{
"name": "json-validator",
"source": "./plugins/data/json-validator",
"description": "Validates JSON data against schemas"
}
]
}
Scenario: Add a new skill to the json-validator plugin
Create new skill directory:
mkdir -p plugins/data/json-validator/skills/schema-generator
Create SKILL.md:
# Schema Generator Skill
## Purpose
Generates JSON Schema definitions from example JSON data.
## When to Use
- Creating schemas from existing data
- Documenting API data structures
- Reverse engineering schemas
[... rest of SKILL.md ...]
Update plugin version:
Edit plugin.json:
{
"version": "1.1.0"
}
(Minor version increment for new feature)
Plugins:
my-plugin-namejson-validator, code-formatter, api-testerhelper, utils, my_pluginSkills:
json-validator, schema-generator, data-transformerskill1, helper, miscCommands:
validate-json, generate-schema, format-codedo-thing, run, helpProblem: Claude doesn't load the skill when relevant
Solutions:
SKILL.md (case-sensitive)plugins/category/plugin/skills/skill-name/SKILL.md/plugin listProblem: Plugin fails to install or load
Solutions:
plugin.jsonProblem: Slash command doesn't execute
Solutions:
commands/ directoryProblem: Plugin not showing in marketplace
Solutions:
.claude-plugin/ at repo rootProblem: Multiple versions causing issues
Solutions:
The plugin-builder includes templates in skills/plugin-builder/resources/:
plugin-template.json: Starter plugin.jsonskill-template.md: SKILL.md boilerplatecommand-template.md: Command file structuremarketplace-entry.json: Marketplace registration exampleFor plugin system documentation, see:
Use when working with Payload CMS projects (payload.config.ts, collections, fields, hooks, access control, Payload API). Use when debugging validation errors, security issues, relationship queries, transactions, or hook behavior.