plugin-structure

Explain Claude Code plugin architecture, directory layout, and component organization.

Updated Sep 30, 2024
One-click install
npx skills add https://github.com/phillip-hirsch/dotfiles --skill plugin-structure-phillip-hirsch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: plugin-structure
Source: https://github.com/phillip-hirsch/dotfiles/tree/main/.claude/plugins/marketplaces/claude-plugins-official/plugins/plugin-dev/skills/plugin-structure
Command: npx skills add https://github.com/phillip-hirsch/dotfiles --skill plugin-structure-phillip-hirsch

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides in-depth knowledge about Claude Code plugin architecture, enabling users to create well-organized, maintainable plugins that integrate seamlessly with Claude Code.

Core Features & Use Cases

  • Directory Structure Overview: Learn about the conventional directory layout for Claude Code plugins and automatic component discovery.
  • Plugin Manifest Configuration: Understand how to define plugin metadata and configuration using plugin.json.
  • Component Organization: Discover patterns for organizing commands, agents, skills, and hooks within a plugin.
  • File Naming Conventions: Follow best practices for naming components, scripts, and documentation files.
  • Auto-Discovery Mechanism: Understand how Claude Code automatically discovers and loads components.
  • Best Practices: Learn about plugin organization, naming, portability, and maintenance.
  • Common Patterns: Explore patterns for minimal, full-featured, and skill-focused plugins.
  • Troubleshooting: Get solutions for common issues like component loading failures, path resolution errors, and auto-discovery problems.

Quick Start

Use the plugin-structure skill to learn about plugin directory structure and organization.

Frequently Asked Questions about plugin-structure

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

FAQPage Schema
What is the correct directory structure for a Claude Code plugin?

The Claude Code plugin directory structure uses a conventional layout that enables automatic component discovery. This structure organizes commands, agents, skills, hooks, and scripts into specific directories for seamless integration.

How do I configure plugin metadata using plugin.json?

You configure plugin metadata using the plugin.json manifest file. This manifest defines the plugin's configuration, metadata, and component organization, ensuring Claude Code correctly identifies and loads the plugin components.

How does auto-discovery work for Claude Code plugin components?

Auto-discovery for Claude Code plugin components works by automatically detecting and loading items placed in the conventional directory layout. The mechanism identifies commands, agents, skills, and hooks without requiring manual registration.

What are the best practices for naming files in a Claude Code plugin?

Best practices for naming Claude Code plugin files include following specific conventions for components, scripts, and documentation. Adhering to these naming rules ensures proper auto-discovery and prevents path resolution errors during component loading.

Why are my Claude Code plugin components failing to load?

Claude Code plugin components fail to load due to incorrect directory structure, naming convention violations, or path resolution errors. Troubleshooting involves verifying the plugin.json manifest and ensuring proper portable path references.

Can I organize a minimal Claude Code plugin with just skills and commands?

You can organize a minimal Claude Code plugin featuring just skills and commands. The architecture supports various common patterns, including full-featured, skill-focused, and minimal layouts, depending on your specific component requirements.