Lesson 21Automation
Creating Plugins
Shareable extensions
What are Plugins
Plugins are a way to package and distribute a collection of commands, skills, agents, and rules for Claude Code.
What you can include:
- • Slash commands
- • Agent skills
- • Custom agents
- • Hooks
- • Modular rules
Use cases:
- • Team standards
- • CI/CD integrations
- • Specific workflows
- • Open source tools
Plugin Structure
.claude-plugin/
├── plugin.json # Manifest file
├── commands/ # Slash commands
│ ├── deploy.md
│ └── rollback.md
├── skills/ # Agent skills
│ ├── security-audit.md
│ └── performance-check.md
├── agents/ # Custom agents
│ └── reviewer.md
├── hooks/ # Hooks configuration
│ └── format.json
└── rules/ # Modular rules
└── typescript.mdplugin.json (Manifest)
The plugin.json file describes the plugin and its components:
{
"name": "my-team-tools",
"version": "1.0.0",
"description": "Team-specific Claude Code tools",
"author": "Your Team",
"components": {
"commands": ["commands/*.md"],
"skills": ["skills/*.md"],
"agents": ["agents/*.md"],
"hooks": ["hooks/*.json"],
"rules": ["rules/*.md"]
}
}Example Command in Plugin
commands/deploy.md:
---
name: deploy
description: Deploy to staging or production
arguments:
- name: environment
description: Target environment (staging/production)
required: true
---
Deploy the current branch to $1:
1. Run tests to ensure everything passes
2. Build the application
3. Deploy using our CI/CD pipeline
4. Verify deployment health
5. Report status with URLUsing Plugins
Plugins can be used in several ways:
Local Testing
claude --plugin-dir ./my-plugin
In Project
Place .claude-plugin/ at project root — plugin will load automatically
Globally
~/.claude/plugins/my-plugin/
Distributing Plugins
Plugins can be distributed via:
Git repository
Clone to ~/.claude/plugins/
npm package
Publish as npm package
Internal registry
For enterprise use
Direct copy
Copy plugin folder
Plugin Creation Tips
- 1.Document each command with usage examples
- 2.Version the plugin using semver
- 3.Test locally before distribution
- 4.Don't include secrets in plugins
This lesson is part of a structured LLM course.
My Learning Path