plugin-structure

Guides creation of Claude Code plugin directory structures, manifests, and component organization.

1|Updated Jul 6, 2015
One-click install
npx skills add https://github.com/ksolomon/dotfiles --skill plugin-structure-ksolomon
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: plugin-structure
Source: https://github.com/ksolomon/dotfiles/tree/main/AI/.claude/plugins/marketplaces/claude-plugins-official/plugins/plugin-dev/skills/plugin-structure
Command: npx skills add https://github.com/ksolomon/dotfiles --skill plugin-structure-ksolomon

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building a Claude Code plugin requires knowing the exact directory layout, manifest fields, and auto-discovery rules, and getting any of these wrong means components silently fail to load. ## Core Features & Use Cases - Directory Layout Guidance: Explains the standard plugin structure including .claude-plugin/plugin.json, commands/, agents/, skills/, hooks/, and .mcp.json placement rules. - Manifest Configuration: Documents every plugin.json field, path resolution rules, validation requirements, and minimal versus complete manifest examples. - Component Patterns: Covers organization patterns for commands, agents, skills, hooks, and scripts, plus portable path references using ${CLAUDE_PLUGIN_ROOT}. - Use Case: When scaffolding a new plugin with slash commands, a subagent, and a validation hook, use this Skill to generate the correct folder layout, a valid plugin.json manifest, and properly formatted component files that Claude Code auto-discovers. ## Quick Start Ask Claude to scaffold a new Claude Code plugin with a command, an agent, and a hooks.json file following the official plugin structure.

Frequently Asked Questions about plugin-structure

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Claude Code plugin?▼

Create a directory containing .claude-plugin/plugin.json with at least a name field in kebab-case, then add component directories like commands/, agents/, or skills/ at the plugin root. Claude Code auto-discovers all .md files in these directories when the plugin is enabled.

Where should plugin.json be located in a Claude Code plugin?▼

The plugin.json manifest must be placed in the .claude-plugin/ directory at the plugin root. Component directories such as commands/ and agents/ must sit at the plugin root level, not nested inside .claude-plugin/.

What is ${CLAUDE_PLUGIN_ROOT} used for in plugins?▼

${CLAUDE_PLUGIN_ROOT} is an environment variable that resolves to the plugin's install location, used for hook commands, MCP server arguments, and script references. It replaces hardcoded absolute paths so plugins work regardless of installation method or operating system.

Why is my Claude Code plugin command not loading?▼

Commands fail to load when files are in the wrong directory, lack valid YAML frontmatter, or when skills use README.md instead of SKILL.md. Verify the plugin is enabled, directories are at plugin root, and file names use kebab-case with correct extensions.

Can custom component paths replace default directories in plugin.json?▼

No, custom paths in the commands, agents, hooks, and mcpServers fields supplement the default directories rather than replacing them. Components in both default locations and custom paths will load, and all paths must be relative starting with ./.