
Plugin Structure
Scaffold and organize a Claude Code plugin with manifest, commands, agents, skills, and hooks using official layout and path conventions.
Overview
Plugin Structure is an agent skill most often used in Build (also Validate, Operate) that scaffolds Claude Code plugins with manifest-driven layout, component folders, and `${CLAUDE_PLUGIN_ROOT}` path conventions.
Install
npx skills add https://github.com/anthropics/claude-code --skill plugin-structureWhat is this skill?
- Standard plugin tree with required `.claude-plugin/plugin.json` manifest
- Auto-discovery vs explicit loading for commands, agents, skills, and hooks
- Portable `${CLAUDE_PLUGIN_ROOT}` references for cross-machine plugin paths
- Component folders: `commands/`, `agents/`, `skills/`, hooks configuration
- Naming and layout conventions aligned with Claude Code plugin architecture
Adoption & trust: 8.9k installs on skills.sh; 131k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You want a Claude Code plugin but do not know where plugin.json, commands, agents, skills, and hooks should live or how auto-discovery finds them.
Who is it for?
Indie builders packaging reusable agent workflows as a distributable Claude Code plugin for themselves or a small team.
Skip if: Teams only editing application code inside a single repo with no custom plugin bundle or manifest.
When should I use this skill?
User asks to create or scaffold a plugin, understand plugin structure, set up plugin.json, use ${CLAUDE_PLUGIN_ROOT}, add commands/agents/skills/hooks, or configure auto-discovery.
What do I get? / Deliverables
You get a well-organized plugin skeleton with a valid manifest and component placement so slash commands, subagents, and skills load reliably in Claude Code.
- Plugin directory tree matching Claude Code conventions
- Configured `.claude-plugin/plugin.json` manifest
- Placed command, agent, skill, and hook component files
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Packaging agent capabilities as installable plugins is core product work for anyone extending Claude Code beyond a single repo. Agent-tooling is the canonical shelf for skills that define how commands, subagents, skills, and hooks are discovered and wired—not one-off app features.
Where it fits
Spike a minimal plugin with one command and one skill before committing to a full marketplace listing.
Scaffold `.claude-plugin/plugin.json` and standard folders when starting a team-shared Claude Code extension.
Verify component paths and naming match conventions before publishing or sharing the plugin archive.
Reorganize hooks or skills after a refactor when auto-discovery stops finding `.md` components.
How it compares
Use for Claude Code plugin packaging architecture, not for authoring individual SKILL.md content inside an already-scaffolded plugin.
Common Questions / FAQ
Who is plugin structure for?
Solo and indie developers who extend Claude Code with installable plugins containing commands, agents, skills, and hooks.
When should I use plugin structure?
During Validate when you prototype an agent bundle; during Build when you scaffold or reorganize a plugin; during Operate when you fix discovery or manifest paths after installs or refactors.
Is plugin structure safe to install?
It is documentation-style guidance for layout and configuration—review the Security Audits panel on this Prism page before trusting any third-party plugin repo you scaffold with it.
SKILL.md
READMESKILL.md - Plugin Structure
# Plugin Structure for Claude Code ## Overview Claude Code plugins follow a standardized directory structure with automatic component discovery. Understanding this structure enables creating well-organized, maintainable plugins that integrate seamlessly with Claude Code. **Key concepts:** - Conventional directory layout for automatic discovery - Manifest-driven configuration in `.claude-plugin/plugin.json` - Component-based organization (commands, agents, skills, hooks) - Portable path references using `${CLAUDE_PLUGIN_ROOT}` - Explicit vs. auto-discovered component loading ## Directory Structure Every Claude Code plugin follows this organizational pattern: ``` plugin-name/ ├── .claude-plugin/ │ └── plugin.json # Required: Plugin manifest ├── commands/ # Slash commands (.md files) ├── agents/ # Subagent definitions (.md files) ├── skills/ # Agent skills (subdirectories) │ └── skill-name/ │ └── SKILL.md # Required for each skill ├── hooks/ │ └── hooks.json # Event handler configuration ├── .mcp.json # MCP server definitions └── scripts/ # Helper scripts and utilities ``` **Critical rules:** 1. **Manifest location**: The `plugin.json` manifest MUST be in `.claude-plugin/` directory 2. **Component locations**: All component directories (commands, agents, skills, hooks) MUST be at plugin root level, NOT nested inside `.claude-plugin/` 3. **Optional components**: Only create directories for components the plugin actually uses 4. **Naming convention**: Use kebab-case for all directory and file names ## Plugin Manifest (plugin.json) The manifest defines plugin metadata and configuration. Located at `.claude-plugin/plugin.json`: ### Required Fields ```json { "name": "plugin-name" } ``` **Name requirements:** - Use kebab-case format (lowercase with hyphens) - Must be unique across installed plugins - No spaces or special characters - Example: `code-review-assistant`, `test-runner`, `api-docs` ### Recommended Metadata ```json { "name": "plugin-name", "version": "1.0.0", "description": "Brief explanation of plugin purpose", "author": { "name": "Author Name", "email": "author@example.com", "url": "https://example.com" }, "homepage": "https://docs.example.com", "repository": "https://github.com/user/plugin-name", "license": "MIT", "keywords": ["testing", "automation", "ci-cd"] } ``` **Version format**: Follow semantic versioning (MAJOR.MINOR.PATCH) **Keywords**: Use for plugin discovery and categorization ### Component Path Configuration Specify custom paths for components (supplements default directories): ```json { "name": "plugin-name", "commands": "./custom-commands", "agents": ["./agents", "./specialized-agents"], "hooks": "./config/hooks.json", "mcpServers": "./.mcp.json" } ``` **Important**: Custom paths supplement defaults—they don't replace them. Components in both default directories and custom paths will load. **Path rules:** - Must be relative to plugin root - Must start with `./` - Cannot use absolute paths - Support arrays for multiple locations ## Component Organization ### Commands **Location**: `commands/` directory **Format**: Markdown files with YAML frontmatter **Auto-discovery**: All `.md` files in `commands/` load automatically **Example structure**: ``` commands/ ├── review.md # /review command ├── test.md # /test command └── deplo