Plugin Structure

Guides creation of Claude Code plugins with manifest configuration and component organization.

Updated Mar 22, 2026
One-click install
npx skills add https://github.com/ace8991/agentos --skill plugin-structure-ace8991
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Plugin Structure
Source: https://github.com/ace8991/agentos/tree/main/.tmp_claude_code/claude-code-main/plugins/plugin-dev/skills/plugin-structure
Command: npx skills add https://github.com/ace8991/agentos --skill plugin-structure-ace8991

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 - Plugin Scaffolding Guidance: Explains the required directory structure, the .claude-plugin/plugin.json manifest, and kebab-case naming conventions for commands, agents, skills, and hooks. - Manifest Configuration Reference: Documents every plugin.json field including custom component paths, hooks, and MCP server definitions with validation rules. - Portable Path Handling: Shows how to use ${CLAUDE_PLUGIN_ROOT} so plugins work regardless of install location. - Use Case: You want to ship a plugin with slash commands, a subagent, and a PreToolUse hook. This skill walks you through the folder layout, manifest fields, and hook JSON so everything auto-discovers correctly on first install. ## Quick Start Ask Claude to scaffold a new Claude Code plugin with a command, an agent, and a hook, 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 with a `.claude-plugin/plugin.json` manifest containing at least a kebab-case `name` field, then add component folders 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 manifest must be at `.claude-plugin/plugin.json` inside the plugin root. Component directories like commands and agents must sit at the plugin root level, not nested inside `.claude-plugin/`.

What is ${CLAUDE_PLUGIN_ROOT} used for in plugins?

It is an environment variable resolving to the plugin's install location, used for hook commands, MCP server arguments, and script references. Using it avoids hardcoded absolute paths that break across different installation methods and operating systems.

Why is my Claude Code plugin command not loading?

Common causes are wrong directory placement, missing or malformed YAML frontmatter, or a skill lacking a `SKILL.md` file. Verify the file sits in the correct root-level directory, uses kebab-case naming, and that the plugin is enabled.

Can a plugin define custom paths for commands and agents?

Yes, the `commands` and `agents` fields in plugin.json accept a path string or array of paths. These custom paths supplement the default directories rather than replacing them, and each path must be relative and start with `./`.