From AI Writer
Create new Claude Code plugins from scratch with proper directory structure (.claude-plugin/plugin.json, skills/, agents/), or add existing plugins to marketplace.json. Use when creating a plugin, setting up plugin metadata, configuring MCP servers, or adding plugins to a marketplace.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ai-writer:plugin-writerThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Create well-structured Claude Code plugins with proper metadata, directory structure, and marketplace integration.
Create well-structured Claude Code plugins with proper metadata, directory structure, and marketplace integration.
Use this Skill when:
Create a new plugin:
# 1. Create plugin directory structure
mkdir -p my-plugin/.claude-plugin
mkdir -p my-plugin/{skills,agents,hooks,scripts}
# 2. Create plugin.json
# 3. Create marketplace.json (if building a marketplace)
# 4. Add skills and agents
# 5. Configure MCP servers (optional)
Add existing plugin to marketplace:
# Edit .claude-plugin/marketplace.json
# Add plugin entry with source URL
Single plugin (standalone):
my-plugin/
├── .claude-plugin/ # Plugin metadata (required)
│ └── plugin.json # Plugin configuration
├── skills/ # User-invocable skills
│ └── */SKILL.md # Skill definitions
├── agents/ # Specialized AI agents
│ └── *.md # Agent definitions
├── hooks/ # Lifecycle hooks (optional)
│ └── *.json # Hook configuration
├── scripts/ # Setup scripts (optional)
│ └── *.sh # Setup scripts
├── settings.json # MCP server config (optional)
└── pyproject.toml # Package metadata (optional)
Multi-plugin marketplace:
marketplace-repo/
├── .claude-plugin/
│ └── marketplace.json # Marketplace catalog ONLY
├── plugin-one/ # First plugin subdirectory
│ ├── .claude-plugin/
│ │ └── plugin.json
│ ├── skills/
│ ├── agents/
│ └── settings.json
├── plugin-two/ # Second plugin subdirectory
│ ├── .claude-plugin/
│ │ └── plugin.json
│ ├── skills/
│ └── agents/
└── pyproject.toml # Optional repo-level metadata
Ask the user for:
torch-compile, data-tools)"PyTorch AI Marketplace")"1.0.0")"./skills/")["./agents/expert.md"])mkdir -p <plugin-name>/.claude-plugin
mkdir -p <plugin-name>/skills
mkdir -p <plugin-name>/agents
mkdir -p <plugin-name>/hooks
mkdir -p <plugin-name>/scripts
Create .claude-plugin/plugin.json with this structure:
{
"name": "plugin-name",
"displayName": "Plugin Display Name",
"version": "1.0.0",
"description": "Plugin description",
"skills": "./skills/",
"agents": [
"./agents/agent-name.md"
],
"author": {
"name": "Author Name"
},
"homepage": "https://github.com/username/repo",
"license": "BSD-3-Clause",
"keywords": [
"keyword1",
"keyword2"
],
"mcpServers": {
"server-name": {
"command": "command-name",
"args": [],
"env": {}
}
}
}
Field requirements:
name: Lowercase, hyphens only, must be uniquedisplayName: Human-readable plugin nameversion: Semantic version (e.g., "1.0.0")description: Brief description (< 1024 chars)skills: Path to skills directory (auto-discovery)agents: Array of agent file paths (explicit paths)author.name: Plugin authormcpServers: Optional MCP server configurationsSkills discovery:
skills: "./skills/" is set, all skills in that directory are auto-discoveredSKILL.md files with proper frontmatterAgents:
name fieldMCP Servers:
command, optional args, optional envcommand should be the executable name or pathIf the plugin uses MCP servers, create settings.json:
{
"mcpServers": {
"server-name": {
"command": "command-name",
"env": {
"ENV_VAR": "value"
}
}
}
}
When to create settings.json:
Difference from plugin.json mcpServers:
plugin.json mcpServers: Declares what MCP servers the plugin provides/requiressettings.json mcpServers: Provides default configuration for those serversSkills:
skills/ folderSKILL.md with frontmatterAgents:
.md files to agents/ folderplugin.json agents arrayVerification:
# Check skills have SKILL.md
ls skills/*/SKILL.md
# Check agents exist
ls agents/*.md
# Verify frontmatter in skills
head -10 skills/*/SKILL.md
# Verify frontmatter in agents
head -10 agents/*.md
If the plugin is a Python package:
[project]
name = "plugin-name"
version = "1.0.0"
description = "Plugin description"
authors = [{name = "Author Name"}]
license = {text = "BSD-3-Clause"}
requires-python = ">=3.10"
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
If building a marketplace of plugins, create marketplace.json.
Create .claude-plugin/marketplace.json:
{
"name": "marketplace-name",
"displayName": "Marketplace Display Name",
"description": "Marketplace description",
"owner": {
"name": "Owner Name",
"email": "[email protected]"
},
"plugins": [
{
"name": "plugin-name",
"description": "Plugin description",
"category": "development",
"source": {
"source": "url",
"url": "https://github.com/username/repo.git",
"ref": "main"
}
}
]
}
Field requirements:
name: Marketplace identifier (lowercase, hyphens)displayName: Human-readable marketplace namedescription: Brief marketplace descriptionowner.name: Marketplace ownerowner.email: Contact emailplugins: Array of plugin entriesPlugin entry fields:
name: Plugin name (must match plugin's plugin.json name)description: Brief plugin descriptioncategory: Plugin category (e.g., "development", "productivity")source: Can be a string (relative path) or an object (git URL)Source types:
Relative path (for plugins in same repository):
"source": "./plugin-name"
Git URL (for external plugins):
"source": {
"source": "url",
"url": "https://github.com/username/repo.git",
"ref": "main"
}
Git subdirectory (for plugin in subdirectory of external repo):
"source": {
"source": "git-subdir",
"url": "https://github.com/username/repo.git",
"path": "plugins/plugin-name",
"ref": "main"
}
To add a new plugin to an existing marketplace.json:
Local plugin (in same repository):
{
"plugins": [
{
"name": "new-plugin-name",
"description": "What this plugin does",
"category": "development",
"source": "./new-plugin-name"
}
]
}
External plugin (separate repository):
{
"plugins": [
{
"name": "external-plugin",
"description": "What this plugin does",
"category": "development",
"source": {
"source": "url",
"url": "https://github.com/username/plugin-repo.git",
"ref": "main"
}
}
]
}
Categories:
"development": Development tools and workflows"productivity": Productivity and automation"debugging": Debugging and diagnostics"testing": Testing and validation"documentation": Documentation generationUser request: "Create a plugin called 'data-tools' with skills for CSV and JSON processing"
Steps:
mkdir -p data-tools/.claude-plugin
mkdir -p data-tools/{skills,agents,hooks,scripts}
data-tools/.claude-plugin/plugin.json:{
"name": "data-tools",
"displayName": "Data Processing Tools",
"version": "1.0.0",
"description": "Tools for CSV, JSON, and data file processing",
"skills": "./skills/",
"agents": [],
"author": {
"name": "Your Name"
},
"license": "MIT",
"keywords": ["data", "csv", "json", "processing"]
}
data-tools/skills/User request: "Create a plugin with an MCP server for API documentation lookup"
Create plugin structure (same as above)
Create plugin.json with mcpServers:
{
"name": "api-docs",
"displayName": "API Documentation",
"version": "1.0.0",
"description": "Semantic API documentation search",
"skills": "./skills/",
"agents": ["./agents/api-expert.md"],
"author": {
"name": "Your Name"
},
"mcpServers": {
"api-lookup": {
"command": "api-lookup-mcp",
"args": [],
"env": {}
}
}
}
settings.json:{
"mcpServers": {
"api-lookup": {
"command": "api-lookup-mcp",
"env": {
"API_INDEX_PATH": "~/.api-docs/index"
}
}
}
}
User request: "Create a marketplace with two local plugins and one external plugin"
mkdir -p marketplace/.claude-plugin
mkdir -p marketplace/plugin-one/{.claude-plugin,skills,agents}
mkdir -p marketplace/plugin-two/{.claude-plugin,skills,agents}
marketplace/.claude-plugin/marketplace.json:{
"name": "my-marketplace",
"displayName": "My Plugin Marketplace",
"description": "Collection of development tools",
"owner": {
"name": "Your Name",
"email": "[email protected]"
},
"plugins": [
{
"name": "plugin-one",
"description": "First local plugin",
"category": "development",
"source": "./plugin-one"
},
{
"name": "plugin-two",
"description": "Second local plugin",
"category": "development",
"source": "./plugin-two"
},
{
"name": "external-plugin",
"description": "External plugin from another repo",
"category": "development",
"source": {
"source": "url",
"url": "https://github.com/username/external-plugin.git",
"ref": "main"
}
}
]
}
marketplace/plugin-one/.claude-plugin/plugin.json and marketplace/plugin-two/.claude-plugin/plugin.json with their respective configurations.Plugin naming:
Skills organization:
./skills/ for auto-discoveryAgent organization:
agents/ directoryMCP servers:
Marketplace structure:
Marketplace entries:
main for production)"source": "./plugin-name"Version management:
1.0.0Before finalizing a plugin:
.claude-plugin/, skills/, agents/)plugin.json has all required fieldsplugin.json name is lowercase, hyphens onlysettings.json created (if using MCP servers)Skills not discovered:
skills: "./skills/" is set in plugin.jsonAgents not found:
name fieldMCP server not connecting:
Plugin not in marketplace:
"./plugin-name")Marketplace clones entire repo multiple times:
"source": "./plugin-name" instead of git URL.claude-plugin/Plugin.json and marketplace.json in same directory:
When creating a plugin, I will:
The result will be a complete, working Claude Code plugin following best practices.
npx claudepluginhub torchedhat/ai-marketplace --plugin ai-writerGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.