spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / plugins / plugin-dev / skills / plugin-structure / README.md
109 lines · 3.1 KBPreviewCodeRaw
1# Plugin Structure Skill
2
3Comprehensive guidance on Claude Code plugin architecture, directory layout, and best practices.
4
5## Overview
6
7This skill provides detailed knowledge about:
8- Plugin directory structure and organization
9- `plugin.json` manifest configuration
10- Component organization (commands, agents, skills, hooks)
11- Auto-discovery mechanisms
12- Portable path references with `${CLAUDE_PLUGIN_ROOT}`
13- File naming conventions
14
15## Skill Structure
16
17### SKILL.md (1,619 words)
18
19Core skill content covering:
20- Directory structure overview
21- Plugin manifest (plugin.json) fields
22- Component organization patterns
23- ${CLAUDE_PLUGIN_ROOT} usage
24- File naming conventions
25- Auto-discovery mechanism
26- Best practices
27- Common patterns
28- Troubleshooting
29
30### References
31
32Detailed documentation for deep dives:
33
34- **manifest-reference.md**: Complete `plugin.json` field reference
35 - All field descriptions and examples
36 - Path resolution rules
37 - Validation guidelines
38 - Minimal vs. complete manifest examples
39
40- **component-patterns.md**: Advanced organization patterns
41 - Component lifecycle (discovery, activation)
42 - Command organization patterns
43 - Agent organization patterns
44 - Skill organization patterns
45 - Hook organization patterns
46 - Script organization patterns
47 - Cross-component patterns
48 - Best practices for scalability
49
50### Examples
51
52Three complete plugin examples:
53
54- **minimal-plugin.md**: Simplest possible plugin
55 - Single command
56 - Minimal manifest
57 - When to use this pattern
58
59- **standard-plugin.md**: Well-structured production plugin
60 - Multiple components (commands, agents, skills, hooks)
61 - Complete manifest with metadata
62 - Rich skill structure
63 - Integration between components
64
65- **advanced-plugin.md**: Enterprise-grade plugin
66 - Multi-level organization
67 - MCP server integration
68 - Shared libraries
69 - Configuration management
70 - Security automation
71 - Monitoring integration
72
73## When This Skill Triggers
74
75Claude Code activates this skill when users:
76- Ask to "create a plugin" or "scaffold a plugin"
77- Need to "understand plugin structure"
78- Want to "organize plugin components"
79- Need to "set up plugin.json"
80- Ask about "${CLAUDE_PLUGIN_ROOT}" usage
81- Want to "add commands/agents/skills/hooks"
82- Need "configure auto-discovery" help
83- Ask about plugin architecture or best practices
84
85## Progressive Disclosure
86
87The skill uses progressive disclosure to manage context:
88
891. **SKILL.md** (~1600 words): Core concepts and workflows
902. **References** (~6000 words): Detailed field references and patterns
913. **Examples** (~8000 words): Complete working examples
92
93Claude loads references and examples only as needed based on the task.
94
95## Related Skills
96
97This skill works well with:
98- **hook-development**: For creating plugin hooks
99- **mcp-integration**: For integrating MCP servers (when available)
100- **marketplace-publishing**: For publishing plugins (when available)
101
102## Maintenance
103
104To update this skill:
1051. Keep SKILL.md lean and focused on core concepts
1062. Move detailed information to references/
1073. Add new examples/ for common patterns
1084. Update version in SKILL.md frontmatter
1095. Ensure all documentation uses imperative/infinitive form