All skills
anthropics avatar

/plugin-structure

@2438937

This skill should be used when the user asks to "create a plugin", "scaffold a plugin", "understand plugin structure", "organize plugin components", "set up plugin.json", "use ${CLAUDE_PLUGIN_ROOT}", "add commands/agents/skills/hooks", "configure auto-discovery", or needs guidance on plugin directory layout, manifest configuration, component organization, file naming conventions, or Claude Code plugin architecture best practices.

Use this Skill: https://skilld.dev/gh/anthropics/claude-plugins-official/plugin-structure

This session only. Nothing lands on disk.

README.md

≈803 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Plugin Structure Skill

Comprehensive guidance on Claude Code plugin architecture, directory layout, and best practices.

Overview

This skill provides detailed knowledge about:

  • Plugin directory structure and organization
  • plugin.json manifest configuration
  • Component organization (commands, agents, skills, hooks)
  • Auto-discovery mechanisms
  • Portable path references with ${CLAUDE_PLUGIN_ROOT}
  • File naming conventions

Skill Structure

SKILL.md (1,619 words)

Core skill content covering:

  • Directory structure overview
  • Plugin manifest (plugin.json) fields
  • Component organization patterns
  • ${CLAUDE_PLUGIN_ROOT} usage
  • File naming conventions
  • Auto-discovery mechanism
  • Best practices
  • Common patterns
  • Troubleshooting

References

Detailed documentation for deep dives:

  • manifest-reference.md: Complete plugin.json field reference

    • All field descriptions and examples
    • Path resolution rules
    • Validation guidelines
    • Minimal vs. complete manifest examples
  • component-patterns.md: Advanced organization patterns

    • Component lifecycle (discovery, activation)
    • Command organization patterns
    • Agent organization patterns
    • Skill organization patterns
    • Hook organization patterns
    • Script organization patterns
    • Cross-component patterns
    • Best practices for scalability

Examples

Three complete plugin examples:

  • minimal-plugin.md: Simplest possible plugin

    • Single command
    • Minimal manifest
    • When to use this pattern
  • standard-plugin.md: Well-structured production plugin

    • Multiple components (commands, agents, skills, hooks)
    • Complete manifest with metadata
    • Rich skill structure
    • Integration between components
  • advanced-plugin.md: Enterprise-grade plugin

    • Multi-level organization
    • MCP server integration
    • Shared libraries
    • Configuration management
    • Security automation
    • Monitoring integration

When This Skill Triggers

Claude Code activates this skill when users:

  • Ask to "create a plugin" or "scaffold a plugin"
  • Need to "understand plugin structure"
  • Want to "organize plugin components"
  • Need to "set up plugin.json"
  • Ask about "${CLAUDE_PLUGIN_ROOT}" usage
  • Want to "add commands/agents/skills/hooks"
  • Need "configure auto-discovery" help
  • Ask about plugin architecture or best practices

Progressive Disclosure

The skill uses progressive disclosure to manage context:

  1. SKILL.md (~1600 words): Core concepts and workflows
  2. References (~6000 words): Detailed field references and patterns
  3. Examples (~8000 words): Complete working examples

Claude loads references and examples only as needed based on the task.

Related Skills

This skill works well with:

  • hook-development: For creating plugin hooks
  • mcp-integration: For integrating MCP servers (when available)
  • marketplace-publishing: For publishing plugins (when available)

Maintenance

To update this skill:

  1. Keep SKILL.md lean and focused on core concepts
  2. Move detailed information to references/
  3. Add new examples/ for common patterns
  4. Update version in SKILL.md frontmatter
  5. Ensure all documentation uses imperative/infinitive form

Source: SKILL.md on GitHub

2 warnings16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    This skill provides comprehensive documentation and examples for developing Claude Code plugins. It covers directory structure, manifest configuration, and component organization. Security considerations such as script execution and dynamic module loading are documented as core features of the plugin architecture, with examples following best practices for secret management and portability.

  • Socket16d

    1 alert: gptAnomaly

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    7/7 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 2438937. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 8 months ago
version
0.1.0
  • plugin
  • claude-code
  • architecture
  • manifest
  • auto-discovery
  • component-organization
  • directory-structure
  • kebab-case
  • plugin-json

README badge

README badge for anthropics/claude-plugins-official/plugin-structure

This skill teaches the standardized directory structure, manifest configuration, and component organization for Claude Code plugins, covering commands, agents, skills, hooks, and MCP servers. Use it when scaffolding a new plugin, organizing existing components, configuring auto-discovery, or understanding the plugin.json manifest format and `${CLAUDE_PLUGIN_ROOT}` path references.

Generated from the current SKILL.md.

What's the difference between commands, agents, and skills in a Claude Code plugin?
Commands are user-invoked slash commands that appear in Claude Code. Agents are specialized subagents users can invoke manually or that Claude Code selects automatically. Skills are auto-activating capabilities that Claude Code loads based on task context matching the skill description.
Do I need to list all my components in plugin.json, or do they auto-discover?
Components auto-discover—Claude Code scans the default directories (commands/, agents/, skills/) and loads all matching files automatically. You only need to add paths to plugin.json if using custom locations.
Can I use absolute paths or relative paths in plugin.json?
No. All paths in plugin.json must be relative to the plugin root and start with ./. Use ${CLAUDE_PLUGIN_ROOT} in hook commands and scripts to ensure portability across installation methods and operating systems.
Where should the plugin.json manifest go?
The manifest must be located in the .claude-plugin/ directory at the plugin root, as .claude-plugin/plugin.json. Component directories (commands, agents, skills, hooks) must be at the plugin root level, not nested inside .claude-plugin/.
Can a skill include supporting files like scripts or templates?
Yes. Each skill lives in its own subdirectory under skills/ and can include SKILL.md plus any supporting files like scripts, references, examples, or assets in subdirectories.

Generated from the current SKILL.md. These answers refresh after source changes.