creating-a-plugin
БесплатноБез исполняемых скриптовНе проверенUse when creating a new Claude Code plugin or setting up plugin structure - provides complete file organization, manifest format, and component definitions…
от ed3dai★ 253 звезды на GitHubОб этом скилле
Creating a Plugin
Overview
A Claude Code plugin packages reusable components (commands, agents, skills, hooks, MCP servers) for distribution. Create a plugin when you have components that work across multiple projects.
Don't create a plugin for:
- Project-specific configurations (use
.claude/in project root) - One-off scripts or commands
- Experimental features still in development
Plugin storage locations:
- Development: Anywhere during development, installed via
file:///path - User-level:
~/.claude/plugins/(after installation) - Project-level:
.claude/plugins/(project-specific installations)
Quick Start Checklist
Minimal viable plugin:
- Create directory:
my-plugin/ - Create
.claude-plugin/plugin.jsonwith at minimum:{ "name": "my-plugin" } - Add components (commands, agents, skills, hooks, or MCP servers)
- Test locally:
/plugin install file:///absolute/path/to/my-plugin - Reload:
/plugin reload
Directory Structure
my-plugin/
.claude-plugin/
plugin.json # Required: plugin manifest
commands/ # Optional: slash commands
my-command.md
agents/ # Optional: specialized subagents
my-agent.md
skills/ # Optional: reusable techniques
my-skill/
SKILL.md
hooks/ # Optional: event handlers
hooks.json
.mcp.json # Optional: MCP server configs
README.md # Recommended: documentation
Critical: The .claude-plugin/ directory with plugin.json inside must exist at plugin root.
Component Reference
| Component | Location | File Format | When to Use |
|---|---|---|---|
| Commands | commands/*.md |
Markdown + YAML frontmatter | Custom slash commands for repetitive tasks |
| Agents | agents/*.md |
Markdown + YAML frontmatter | Specialized subagents for complex workflows |
| Skills | skills/*/SKILL.md |
Markdown + YAML frontmatter | Reusable techniques and patterns |
| Hooks | hooks/hooks.json |
JSON | Event handlers (format code, validate, etc.) |
| MCP Servers | .mcp.json |
JSON | External tool integrations |
plugin.json Format
Minimal valid manifest:
{
"name": "my-plugin"
}
Complete annotated manifest:
{
"name": "my-plugin", // Required: kebab-case identifier
"version": "1.0.0", // Recommended: semantic versioning
"description": "What this plugin does", // Recommended: brief description
"author": { // Optional but recommended
"name": "Your Name",
"email": "[email protected]",
"url": "https://github.com/yourname"
},
"homepage": "https://github.com/yourname/my-plugin",
"repository": "https://github.com/yourname/my-plugin",
"license": "MIT",
"keywords": ["productivity", "automation"],
"commands": [ // Optional: explicit command paths
"./commands/cmd1.md",
"./commands/cmd2.md"
],
"agents": [ // Optional: explicit agent paths
"./agents/agent1.md"
],
"hooks": [ // Optional: inline hooks
{
"event": "PostToolUse",
"matcher": "Edit|Write",
"command": "npx prettier --write \"$CLAUDE_FILE_PATHS\""
}
],
"mcpServers": { // Optional: inline MCP configs
"my-server": {
"command": "${CLAUDE_PLUGIN_ROOT}/servers/my-server",
"args": ["--port", "8080"],
"env": {
"API_KEY": "${API_KEY}"
}
}
}
}
Key points:
nameis required, everything else is optional- Use
${CLAUDE_PLUGIN_ROOT}to reference plugin directory - Commands/agents auto-discovered from
commands/andagents/directories if not listed explicitly - Skills auto-discovered from
skills/*/SKILL.mdpattern
Creating Commands
File location: commands/my-command.md creates /my-command slash command
Nested commands: commands/feature/sub-command.md creates /plugin-name:feature:sub-command
Template:
---
description: Brief description of what this command does
allowed-tools: Read, Grep, Glob, Bash
model: sonnet
argument-hint: "[file-path]"
---
# Command Name
Your command prompt goes here.
You can use:
- $1, $2, etc. for positional arguments
- $ARGUMENTS for all arguments as single string
- @filename to include file contents
- !bash command to execute shell commands
Example implementation instructions...
Frontmatter fields:
description- Brief description shown in/helpallowed-tools- Comma-separated list:Read, Grep, Glob, Bash, Edit, Write, TodoWrite, Taskmodel- Optional:haiku,sonnet, oropus(defaults to user's setting)argument-hint- Optional: shown in help textdisable-model-invocation- Optional: `true
Установить creating-a-plugin в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл creating-a-plugin?
Use when creating a new Claude Code plugin or setting up plugin structure - provides complete file organization, manifest format, and component definitions for commands, agents, skills, hooks, and MCP servers
Как установить скилл creating-a-plugin?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл creating-a-plugin запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic