2025-11-20 11:47:24 -08:00
# Example Plugin
A comprehensive example plugin demonstrating Claude Code extension options.
## Structure
```
example-plugin/
├── .claude-plugin/
2026-03-17 22:45:25 +00:00
│ └── plugin.json # Plugin metadata
├── .mcp.json # MCP server configuration
├── skills/
│ ├── example-skill/
│ │ └── SKILL.md # Model-invoked skill (contextual guidance)
│ └── example-command/
│ └── SKILL.md # User-invoked skill (slash command)
└── commands/
└── example-command.md # Legacy slash command format (see note below)
2025-11-20 11:47:24 -08:00
```
## Extension Options
2026-03-17 22:45:25 +00:00
### Skills (`skills/`)
Skills are the preferred format for both model-invoked capabilities and user-invoked slash commands. Create a `SKILL.md` in a subdirectory:
2025-11-20 11:47:24 -08:00
2026-03-17 22:45:25 +00:00
**Model-invoked skill** (activated by task context):
2025-11-20 11:47:24 -08:00
```yaml
---
2026-03-17 22:45:25 +00:00
name: skill-name
description: Trigger conditions for this skill
version: 1.0.0
2025-11-20 11:47:24 -08:00
---
2025-11-20 14:28:47 -08:00
```
2025-11-20 11:47:24 -08:00
2026-03-17 22:45:25 +00:00
**User-invoked skill** (slash command — `/skill-name` ):
2025-11-20 11:47:24 -08:00
```yaml
---
name: skill-name
2026-03-17 22:45:25 +00:00
description: Short description for /help
argument-hint: <arg1> [optional-arg]
allowed-tools: [Read, Glob, Grep]
2025-11-20 11:47:24 -08:00
---
```
2026-03-17 22:45:25 +00:00
### Commands (`commands/`) — legacy
> **Note:** The `commands/*.md` layout is a legacy format. It is loaded identically to `skills/<name>/SKILL.md` — the only difference is file layout. For new plugins, prefer the `skills/` directory format. This plugin keeps `commands/example-command.md` as a reference for the legacy layout.
2025-11-20 11:47:24 -08:00
### MCP Servers (`.mcp.json`)
Configure external tool integration via Model Context Protocol:
```json
{
"server-name": {
"type": "http",
"url": "https://mcp.example.com/api"
}
}
```
## Usage
- `/example-command [args]` - Run the example slash command
- The example skill activates based on task context
2025-11-20 14:26:30 -08:00
- The example MCP activates based on task context