Create Plugin
Slash command to convert a project into a properly structured Claude Code plugin with marketplace configuration
- š” Use Case:
- Use when packaging Claude Code components (commands, agents, skills, hooks) for distribution and sharing
Prompt Content
description: Convert a project into a Claude Code plugin argument-hint: [project-path]
/create-plugin
Purpose
Guide users through converting an existing project into a properly structured Claude Code plugin, following official documentation standards.
Contract
Inputs: [project-path] ā Optional path to project directory (defaults to current directory)
Outputs: STATUS=<OK|FAIL> PLUGIN_PATH=<path>
Instructions
-
Analyze the project structure:
- Identify existing components that could become plugin features
- Check for slash commands, agents, skills, hooks, or MCP integrations
- Review documentation files
-
Create plugin and marketplace structure:
- Create
.claude-plugin/directory at project root - Generate
plugin.jsonmanifest with proper metadata:- name (lowercase, kebab-case)
- description
- version (semantic versioning)
- author information (object with name and optional url)
- repository (string URL, not object)
- license (optional)
- Generate
marketplace.jsonin the same directory with:- marketplace name
- owner information
- plugins array with source reference
"./"(self-reference)
- Create
-
Organize plugin components:
commands/- Slash command markdown filesagents/- Agent definition markdown filesskills/- Agent Skills with SKILL.md fileshooks/- hooks.json for event handlers.mcp.json- MCP server configurations (if applicable)
-
Generate documentation:
- Create/update README.md with:
- Installation instructions
- Usage examples
- Component descriptions
- Testing guidance
- Create/update README.md with:
-
Provide testing workflow:
- Local marketplace setup commands
- Installation verification steps
- Iteration and debugging guidance
Reference Documentation
Follow the official Claude Code plugin and marketplace structure:
my-plugin/
āāā .claude-plugin/
ā āāā marketplace.json # Marketplace manifest
ā āāā plugin.json # Plugin metadata
āāā commands/ # Custom slash commands (optional)
ā āāā command-name.md
āāā agents/ # Custom agents (optional)
ā āāā agent-name.md
āāā skills/ # Agent Skills (optional)
ā āāā skill-name/
ā āāā SKILL.md
āāā hooks/ # Event handlers (optional)
ā āāā hooks.json
āāā .mcp.json # MCP servers (optional)
āāā README.md # Documentation
Plugin Manifest Template
The plugin.json file MUST be created at <plugin-dir>/.claude-plugin/plugin.json:
{
"name": "plugin-name",
"version": "1.0.0",
"description": "Plugin description",
"author": {
"name": "Author Name",
"url": "https://github.com/username"
},
"repository": "https://github.com/username/plugin-name",
"license": "MIT"
}
Important: The repository field must be a string URL, not an object. Using an object format like {"type": "git", "url": "..."} will cause validation errors.
Marketplace Manifest Template
The marketplace.json file MUST be created at <plugin-dir>/.claude-plugin/marketplace.json alongside plugin.json:
{
"name": "marketplace-name",
"owner": {
"name": "Owner Name"
},
"plugins": [
{
"name": "plugin-name",
"source": "./",
"description": "Plugin description"
}
]
}
Key Guidelines
- Plugin manifest: Use semantic versioning, clear descriptions
- Marketplace manifest: MUST create marketplace.json in the same .claude-plugin/ directory alongside plugin.json
- Commands: Markdown files with frontmatter (description, argument-hint)
- Skills: Create subdirectories with SKILL.md files
- Testing: Use local marketplace for iterative development
- Documentation: Include installation, usage, and examples
Constraints
- Must create valid plugin.json schema in .claude-plugin/ directory
- Must create valid marketplace.json schema in the same .claude-plugin/ directory
- The repository field in plugin.json MUST be a string URL, not an object
- Follow kebab-case naming conventions
- Include proper frontmatter in all markdown files
- Marketplace source must reference ā./ā to point to the plugin directory itself
- Output final STATUS line with plugin path
Example Output
Created plugin structure at: ./my-plugin
Generated components:
- .claude-plugin/plugin.json
- .claude-plugin/marketplace.json
- commands/helper.md
- README.md
Next steps:
1. cd my-plugin && claude
2. /plugin marketplace add .
3. /plugin install my-plugin@my-plugin-dev
Or for GitHub-based installation:
1. Push to GitHub repository
2. /plugin marketplace add username/my-plugin
3. /plugin install my-plugin@my-plugin-dev
STATUS=OK PLUGIN_PATH=./my-plugin