Template for creating new Claude Code plugins
# From the marketplace repo
claude-plugin create my-awesome-plugin# Clone this template
git clone https://github.com/jeb-leanix/claude-plugin-template.git my-plugin
cd my-plugin
# Update plugin.json
vim plugin.json
# Create your skills
mkdir skills/my-skill
vim skills/my-skill/skill.jsonmy-plugin/
βββ plugin.json # Plugin metadata
βββ README.md # Plugin documentation
βββ CHANGELOG.md # Version history
βββ skills/ # Skills directory
βββ my-skill/
βββ skill.json # Skill configuration
βββ assets/ # Optional: skill assets (images, files)
βββ example.txt
The main plugin configuration file:
{
"name": "my-plugin",
"version": "1.0.0",
"description": "What this plugin does",
"author": "Your Name",
"homepage": "https://github.com/your-org/my-plugin",
"skills": [
"my-skill"
],
"settings": {
"api-key": {
"type": "string",
"description": "API key for external service",
"default": "",
"required": false
}
}
}- name: Plugin identifier (lowercase, hyphens)
- version: Semantic version (1.0.0)
- description: Short description of plugin functionality
- author: Your name or team name
- homepage: URL to plugin repository or documentation
- skills: Array of skill directory names
- settings: Optional plugin-level settings
Skills are the core functionality of your plugin. Each skill lives in skills/<skill-name>/.
{
"name": "my-skill",
"description": "Brief description of what this skill does",
"instructions": [
{
"type": "text",
"text": "Detailed instructions for Claude on when and how to use this skill.\n\n## When to Use\n\n- Condition 1\n- Condition 2\n\n## Examples\n\n```bash\n/my-skill do-something\n```\n\nARGUMENTS: {{args}}"
}
]
}- Be Specific: Clearly define when Claude should invoke the skill
- Provide Examples: Show concrete usage examples
- Use Templates:
{{args}}for dynamic arguments - Structure: Use headings for organization
- What problem does it solve?
- What skills does it need?
- What settings are required?
mkdir -p my-plugin/skills/skill1
cd my-pluginDefine metadata and list skills.
For each skill:
- Create
skills/<skill-name>/skill.json - Write clear instructions
- Add examples
# Link to Claude plugins directory
ln -s $(pwd) ~/.claude/plugins/local/my-plugin
# Test in Claude Code
# Use the skill and verify behavior- Update README.md with usage instructions
- Add examples
- Document settings
# Update version in plugin.json
# Commit changes
git add .
git commit -m "Release v1.0.0"
git tag v1.0.0
git push && git push --tags{
"name": "hello",
"description": "Says hello to the user",
"instructions": [
{
"type": "text",
"text": "When the user says 'hello' or greets you, use this skill to respond with a friendly greeting.\n\nARGUMENTS: (none)"
}
]
}{
"name": "process-data",
"description": "Processes data files",
"instructions": [
{
"type": "text",
"text": "Use this skill when the user wants to process a data file.\n\n## Usage\n\n```bash\n/process-data --file=data.csv --format=json\n```\n\n## Arguments\n\n- `--file`: Path to input file\n- `--format`: Output format (json, xml, yaml)\n\nARGUMENTS: {{args}}"
}
]
}Plugin settings allow configuration without code changes.
{
"settings": {
"api-url": {
"type": "string",
"description": "API endpoint URL",
"default": "https://api.example.com",
"required": true
},
"timeout": {
"type": "number",
"description": "Request timeout in seconds",
"default": 30
},
"debug": {
"type": "boolean",
"description": "Enable debug logging",
"default": false
}
}
}Settings are available to Claude during skill execution. Reference them in instructions:
This skill uses the API endpoint configured in settings.api-url
Create multiple related skills:
my-plugin/
βββ skills/
βββ deploy/
β βββ skill.json
βββ rollback/
β βββ skill.json
βββ status/
βββ skill.json
Include files, templates, or data:
skills/my-skill/
βββ skill.json
βββ assets/
βββ template.yaml
βββ config.json
Reference in instructions:
Use the template at skills/my-skill/assets/template.yaml
- Clear Naming: Use descriptive, lowercase-hyphenated names
- Single Responsibility: Each skill should do one thing well
- Good Documentation: Clear instructions for when to use the skill
- Examples: Always provide usage examples
- Version Properly: Follow semantic versioning
- Test Thoroughly: Test skills in real scenarios
- Keep It Simple: Start simple, add complexity as needed
- Created plugin.json with metadata
- Defined at least one skill
- Written clear instructions
- Added usage examples
- Tested locally
- Documented in README.md
- Added to marketplace registry
- Tagged release version
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License - See LICENSE file for details
Happy Plugin Building! π