| name | metaskill-packaging |
| description | Package skills, agents, commands, and hooks as Claude Code plugins. Use when creating plugins, packaging skills for distribution, setting up plugin structure, dogfooding plugins, or when user mentions "plugin structure", "plugin.json", "package plugin", "distribute plugin", "marketplace", "dogfood", "install plugin", "plugin placement", "--plugin-dir". |
Plugin Building and Packaging
Package your skills, agents, commands, and hooks as distributable plugins.
Plugin Structure
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!
plugin.json Manifest
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.
Naming Conventions
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
Dogfooding Approaches
Quick Iteration (Active Development)
claude --plugin-dir ./my-plugin
- Loads plugin immediately
- Restart Claude Code to pick up changes
- Best for rapid iteration
Marketplace Testing (Pre-Release)
/plugin marketplace add /path/to/your/repo
/plugin install your-repo@my-plugin
/plugin uninstall your-repo@my-plugin
/plugin install your-repo@my-plugin
- Tests the full installation flow
- Verifies the user experience
- Use before releasing
Plugin Placement in Repos
Single Plugin at Repo Root
For a repo that IS the plugin:
my-plugin-repo/
โโโ .claude-plugin/
โ โโโ plugin.json
โโโ skills/
โ โโโ my-plugin-authoring/
โโโ agents/
โโโ README.md
Plugin Inside a Project (Dogfooding)
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
Multiple Plugins in One Repo
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
Internal vs External Plugins
Internal (Dogfooding within Repo)
Place in a plugins/ or tools/ directory:
my-project/
โโโ plugins/
โ โโโ internal-tooling/ # For this project only
โ โโโ .claude-plugin/
โ โ โโโ plugin.json
โ โโโ skills/
- Not meant for distribution
- Project-specific utilities
- Load with
--plugin-dir
External (Open Source / Distribution)
Option 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/
Plugin Components Reference
| 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 |
Common Mistakes
Components in Wrong Location
# โ WRONG
.claude-plugin/
โโโ plugin.json
โโโ skills/ # NO! Skills outside .claude-plugin/
# โ
CORRECT
.claude-plugin/
โโโ plugin.json
skills/ # YES! At plugin root
Missing plugin.json
# โ WRONG - no manifest
my-plugin/
โโโ skills/
# โ
CORRECT - has manifest
my-plugin/
โโโ .claude-plugin/
โ โโโ plugin.json
โโโ skills/
Verb-Form Prefix
# โ WRONG - prefix is already -ing
skill-authoring/
โโโ skills/
โ โโโ skill-authoring-triggering/ # Double verb!
# โ
CORRECT - neutral noun prefix
metaskill/
โโโ skills/
โ โโโ metaskill-triggering/ # Noun + -ing
Related Skills
- For naming conventions, see
/metaskill-naming
- For skill structure and writing, see
/metaskill-authoring
- For skill group patterns, see
/metaskill-grouping
- For trigger optimization, see
/metaskill-triggering
- To test if triggers work, use the
metaskill-trigger-tester agent