Plugin Structure

Guides creation of Claude Code plugins with manifests, components, and directory conventions.

1|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/Clay-HHK/claude-skills --skill plugin-structure-clay-hhk
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: Plugin Structure
Source: https://github.com/Clay-HHK/claude-skills/tree/main/command-name
Command: npx skills add https://github.com/Clay-HHK/claude-skills --skill plugin-structure-clay-hhk

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, plugin.json manifest fields, component auto-discovery rules, and portable path conventions, and getting any of these wrong causes components to silently fail to load. ## Core Features & Use Cases - Manifest Configuration: Explains every plugin.json field including name, version, author, keywords, and custom component paths with validation rules. - Component Organization: Covers how to structure commands, agents, skills, hooks, and MCP servers so Claude Code auto-discovers them correctly. - Portable Paths: Shows how to use ${CLAUDE_PLUGIN_ROOT} so plugins work regardless of install location or operating system. - Use Case: When scaffolding a new plugin with slash commands, a subagent, and a validation hook, use this Skill to generate the correct directory tree, a valid plugin.json, and hook scripts that reference portable paths. ## Quick Start Ask Claude to scaffold a new Claude Code plugin with a command, an agent, and a hook using the correct 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, then add component directories like commands/, agents/, or skills/ at the plugin root. Claude Code auto-discovers markdown files in these directories when the plugin is enabled.

What fields are required in plugin.json?▼

Only the name field is required, in kebab-case format. Recommended fields include version, description, author, homepage, repository, license, and keywords for better discovery and distribution.

Why is my Claude Code plugin command not loading?▼

Verify the file is a .md file inside the commands/ directory at plugin root, not inside .claude-plugin/. Check that the YAML frontmatter is valid and restart Claude Code to reload the plugin configuration.

How do I reference plugin files without hardcoding paths?▼

Use the ${CLAUDE_PLUGIN_ROOT} environment variable for all intra-plugin paths in hooks, MCP server configs, and scripts. Never use absolute paths, home directory shortcuts, or working-directory-relative paths.

Can a plugin use custom directories for commands and agents?▼

Yes, set the commands or agents fields in plugin.json to relative paths starting with ./. Custom paths supplement the default directories rather than replacing them, so components in both locations load.