Package skills, agents, commands, and hooks as Claude Code plugins...
Package your skills, agents, commands, and hooks as distributable plugins.
CRITICAL RULE: Only plugin.json goes inside .claude-plugin/. All components go at the plugin ROOT:
my-plugin/ <- Plugin name = neutral noun
āāā .claude-plugin/
ā āāā plugin.json # ONLY this file here!
āāā commands/ # Slash commands (*.md) - imperative verbs
āāā agents/ # Agent definitions (*.md) - role nouns
āāā skills/ # Skills (*/SKILL.md) - ending in -ing
āāā hooks/ # Event handlers (hooks.json)
āāā .mcp.json # MCP servers (optional)
āāā .lsp.json # LSP servers (optional)
āāā README.md
# ā WRONG - components inside .claude-plugin/
.claude-plugin/
āāā plugin.json
āāā commands/ ā NO!
āāā skills/ ā NO!
# ā
CORRECT - components at plugin root
.claude-plugin/
āāā plugin.json
commands/ ā YES!
skills/ ā YES!
Required fields:
{
"name": "my-plugin",
"version": "1.0.0",
"description": "What this plugin does"
}
With recommended metadata:
{
"name": "my-plugin",
"version": "1.0.0",
"description": "What this plugin does",
"author": {
"name": "Your Name",
"email": "you@example.com"
},
"license": "MIT",
"keywords": ["keyword1", "keyword2"],
"repository": "https://github.com/user/repo",
"homepage": "https://github.com/user/repo#readme"
}
See references/plugin-json-schema.md for the complete field reference.
See /metaskill-naming for the full naming convention.
Quick reference:
| Component | Form | Example |
|---|---|---|
| Plugin name | Neutral noun | metaskill, codeforge, datakit |
| Skills | -ing (gerund) | metaskill-authoring, metaskill-triggering |
| Agents | Role noun | metaskill-trigger-tester, metaskill-analyzer |
| Commands | Imperative verb | /metaskill-create, /quick-start |
Plugin name = Common prefix of all atoms
# ā
GOOD - neutral noun prefix, correct suffixes
metaskill/
āāā skills/
ā āāā metaskill-authoring/ # -ing
ā āāā metaskill-triggering/ # -ing
āāā agents/
ā āāā metaskill-trigger-tester.md # role noun
āāā commands/
āāā quick-start.md # imperative
# ā BAD - verb-form prefix
skill-authoring/
āāā skills/
ā āāā skill-authoring-trigger/ # prefix already -ing!
No type postfixes:
# ā BAD - redundant type postfix
skills/code-review-skill/
agents/tester-agent.md
commands/lint-command.md
# ā
GOOD - no type postfix
skills/code-reviewing/
agents/tester.md
commands/lint.md
claude --plugin-dir ./my-plugin
# Add your repo as a local marketplace (once)
/plugin marketplace add /path/to/your/repo
# Install the plugin
/plugin install your-repo@my-plugin
# After changes, reinstall to test
/plugin uninstall your-repo@my-plugin
/plugin install your-repo@my-plugin
For a repo that IS the plugin:
my-plugin-repo/
āāā .claude-plugin/
ā āāā plugin.json
āāā skills/
ā āāā my-plugin-authoring/
āāā agents/
āāā README.md
For internal tooling within a larger project:
my-project/
āāā src/
āāā tests/
āāā .claude/ # Project's Claude config
ā āāā settings.json
āāā plugins/
āāā my-internal-plugin/
āāā .claude-plugin/
ā āāā plugin.json
āāā skills/
Load with: claude --plugin-dir ./plugins/my-internal-plugin
Use marketplace.json to reference multiple plugins:
my-repo/
āāā .claude-plugin/
ā āāā marketplace.json # References plugins below
āāā plugins/
ā āāā plugin-a/
ā ā āāā .claude-plugin/
ā ā ā āāā plugin.json
ā ā āāā skills/
ā āāā plugin-b/
ā āāā .claude-plugin/
ā ā āāā plugin.json
ā āāā agents/
āāā README.md
marketplace.json (required fields):
{
"name": "my-marketplace",
"owner": {
"name": "Your Name"
},
"plugins": [
{ "name": "plugin-a", "source": "./plugins/plugin-a" },
{ "name": "plugin-b", "source": "./plugins/plugin-b" }
]
}
With full metadata:
{
"name": "my-marketplace",
"owner": {
"name": "Your Name",
"email": "you@example.com"
},
"metadata": {
"description": "Description of your marketplace",
"version": "1.0.0"
},
"plugins": [
{
"name": "plugin-a",
"source": "./plugins/plugin-a",
"description": "What plugin-a does",
"version": "1.0.0",
"author": { "name": "Your Name", "email": "you@example.com" },
"license": "MIT",
"keywords": ["keyword1", "keyword2"],
"category": "development"
}
]
}
See references/marketplace-json-schema.md for the complete field reference.
Users can then:
/plugin marketplace add /path/to/my-repo
/plugin install my-marketplace@plugin-a
Place in a plugins/ or tools/ directory:
my-project/
āāā plugins/
ā āāā internal-tooling/ # For this project only
ā āāā .claude-plugin/
ā ā āāā plugin.json
ā āāā skills/
--plugin-dirOption A: Dedicated plugin repo
my-plugin/ # Repo IS the plugin
āāā .claude-plugin/
ā āāā plugin.json
āāā skills/
Option B: Plugin marketplace repo
my-plugins/ # Repo contains multiple plugins
āāā .claude-plugin/
ā āāā marketplace.json
āāā plugins/
āāā plugin-a/
āāā plugin-b/
| Directory | Contents | Naming Pattern |
|---|---|---|
.claude-plugin/ |
plugin.json only |
N/A |
skills/ |
*/SKILL.md |
prefix-action-ing |
agents/ |
*.md |
prefix-role-noun |
commands/ |
*.md |
imperative-verb |
hooks/ |
hooks.json |
N/A |
.mcp.json |
MCP servers | N/A |
.lsp.json |
LSP servers | N/A |
# ā WRONG
.claude-plugin/
āāā plugin.json
āāā skills/ # NO! Skills outside .claude-plugin/
# ā
CORRECT
.claude-plugin/
āāā plugin.json
skills/ # YES! At plugin root
# ā WRONG - no manifest
my-plugin/
āāā skills/
# ā
CORRECT - has manifest
my-plugin/
āāā .claude-plugin/
ā āāā plugin.json
āāā skills/
# ā WRONG - prefix is already -ing
skill-authoring/
āāā skills/
ā āāā skill-authoring-triggering/ # Double verb!
# ā
CORRECT - neutral noun prefix
metaskill/
āāā skills/
ā āāā metaskill-triggering/ # Noun + -ing
/metaskill-naming/metaskill-authoring/metaskill-grouping/metaskill-triggeringmetaskill-trigger-tester agent