plugin-dev

Comprehensive toolkit for developing Claude Code plugins. Includes 7 expert skills covering hooks, MCP integration, commands, agents, and best practices. AI-assisted plugin creation and validation.

View on GitHub
Author Anthropic
Namespace @anthropics/claude-plugins-official
Category development
Version 1.0.0
Stars 5,333
Downloads 11
self.md verified
Table of content

Comprehensive toolkit for developing Claude Code plugins. Includes 7 expert skills covering hooks, MCP integration, commands, agents, and best practices. AI-assisted plugin creation and validation.

Installation

npx claude-plugins install @anthropics/claude-plugins-official/plugin-dev

Contents

Folders: agents, commands, skills

Files: README.md

Documentation

A comprehensive toolkit for developing Claude Code plugins with expert guidance on hooks, MCP integration, plugin structure, and marketplace publishing.

Overview

The plugin-dev toolkit provides seven specialized skills to help you build high-quality Claude Code plugins:

  1. Hook Development - Advanced hooks API and event-driven automation
  2. MCP Integration - Model Context Protocol server integration
  3. Plugin Structure - Plugin organization and manifest configuration
  4. Plugin Settings - Configuration patterns using .claude/plugin-name.local.md files
  5. Command Development - Creating slash commands with frontmatter and arguments
  6. Agent Development - Creating autonomous agents with AI-assisted generation
  7. Skill Development - Creating skills with progressive disclosure and strong triggers

Each skill follows best practices with progressive disclosure: lean core documentation, detailed references, working examples, and utility scripts.

Guided Workflow Command

/plugin-dev:create-plugin

A comprehensive, end-to-end workflow command for creating plugins from scratch, similar to the feature-dev workflow.

8-Phase Process:

  1. Discovery - Understand plugin purpose and requirements
  2. Component Planning - Determine needed skills, commands, agents, hooks, MCP
  3. Detailed Design - Specify each component and resolve ambiguities
  4. Structure Creation - Set up directories and manifest
  5. Component Implementation - Create each component using AI-assisted agents
  6. Validation - Run plugin-validator and component-specific checks
  7. Testing - Verify plugin works in Claude Code
  8. Documentation - Finalize README and prepare for distribution

Features:

Usage:

/plugin-dev:create-plugin [optional description]

# Examples:
/plugin-dev:create-plugin
/plugin-dev:create-plugin A plugin for managing database migrations

Use this workflow for structured, high-quality plugin development from concept to completion.

Skills

1. Hook Development

Trigger phrases: “create a hook”, “add a PreToolUse hook”, “validate tool use”, “implement prompt-based hooks”, “${CLAUDE_PLUGIN_ROOT}”, “block dangerous commands”

What it covers:

Resources:

Use when: Creating event-driven automation, validating operations, or enforcing policies in your plugin.

2. MCP Integration

Trigger phrases: “add MCP server”, “integrate MCP”, “configure .mcp.json”, “Model Context Protocol”, “stdio/SSE/HTTP server”, “connect external service”

What it covers:

Resources:

Use when: Integrating external services, APIs, databases, or tools into your plugin.

3. Plugin Structure

Trigger phrases: “plugin structure”, “plugin.json manifest”, “auto-discovery”, “component organization”, “plugin directory layout”

What it covers:

Resources:

Use when: Starting a new plugin, organizing components, or configuring the plugin manifest.

4. Plugin Settings

Trigger phrases: “plugin settings”, “store plugin configuration”, “.local.md files”, “plugin state files”, “read YAML fron

…(truncated)

Included Skills

This plugin includes 5 skill definitions:

agent-development

This skill should be used when the user asks to “create an agent”, “add an agent”, “write a subagent”, “agent frontmatter”, “when to use description”, “agent examples”, “agent tools”, “agent colors”, “autonomous agent”, or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.

View skill definition

Agent Development for Claude Code Plugins

Overview

Agents are autonomous subprocesses that handle complex, multi-step tasks independently. Understanding agent structure, triggering conditions, and system prompt design enables creating powerful autonomous capabilities.

Key concepts:

Agent File Structure

Complete Format

---
name: agent-identifier
description: Use this agent when [triggering conditions]. Examples:

<example>
Context: [Situation description]
user: "[User request]"
assistant: "[How assistant should respond and use this agent]"
<commentary>
[Why this agent should be triggered]
</commentary>
</example>

<example>
[Additional example...]
</example>

model: inherit
color: blue
tools: ["Read", "Write", "Grep"]
---

You are [agent role description]...

**Your Core Responsibilities:**
1. [Responsibility 1]
2. [Responsibility 2]

**Analysis Process:**
[Step-by-step workflow]

**Output Format:**
[What to return]

Frontmatter Fields

name (required)

Agent identifier used for namespacing and invocation.

Format: lowercase, numbers, hyphens only Length: 3-50 characters Pattern: Must start and end with alphanumeric

Good examples:

…(truncated)

command-development

This skill should be used when the user asks to “create a slash command”, “add a command”, “write a custom command”, “define command arguments”, “use command frontmatter”, “organize commands”, “create command with file references”, “interactive command”, “use AskUserQuestion in command”, or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.

View skill definition

Command Development for Claude Code

Overview

Slash commands are frequently-used prompts defined as Markdown files that Claude executes during interactive sessions. Understanding command structure, frontmatter options, and dynamic features enables creating powerful, reusable workflows.

Key concepts:

Command Basics

What is a Slash Command?

A slash command is a Markdown file containing a prompt that Claude executes when invoked. Commands provide:

Critical: Commands are Instructions FOR Claude

Commands are written for agent consumption, not human consumption.

When a user invokes /command-name, the command content becomes Claude’s instructions. Write commands as directives TO Claude about what to do, not as messages TO the user.

Correct approach (instructions for Claude):

Review this code for security vulnerabilities including:
- SQL injection
- XSS attacks
- Authentication issues

Provide specific line numbers and severity ratings.

Incorrect approach (messages to user):

This command will review your code for security issues.
You'll receive

...(truncated)

</details>

### hook-development

> This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.

<details>
<summary>View skill definition</summary>

# Hook Development for Claude Code Plugins

## Overview

Hooks are event-driven automation scripts that execute in response to Claude Code events. Use hooks to validate operations, enforce policies, add context, and integrate external tools into workflows.

**Key capabilities:**
- Validate tool calls before execution (PreToolUse)
- React to tool results (PostToolUse)
- Enforce completion standards (Stop, SubagentStop)
- Load project context (SessionStart)
- Automate workflows across the development lifecycle

## Hook Types

### Prompt-Based Hooks (Recommended)

Use LLM-driven decision making for context-aware validation:

```json
{
  "type": "prompt",
  "prompt": "Evaluate if this tool use is appropriate: $TOOL_INPUT",
  "timeout": 30
}

Supported events: Stop, SubagentStop, UserPromptSubmit, PreToolUse

Benefits:

Command Hooks

Execute bash commands for deterministic checks:

{
  "type": "command",
  "command": "bash ${CLAUDE_PLUGIN_ROOT}/scripts/validate.sh",
  "timeout": 60
}

Use for:

Hook Configuration Formats

Plugin hooks.json Format

For plugin hooks in hooks/hooks.json, use wrapper format:

{
  "description": "Brief explanation 

...(truncated)

</details>

### mcp-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 Protocol", "connect external service", mentions "${CLAUDE_PLUGIN_ROOT} with MCP", or discusses MCP server types (SSE, stdio, HTTP, WebSocket). Provides comprehensive guidance for integrating Model Context Protocol servers into Claude Code plugins for external tool and service integration.

<details>
<summary>View skill definition</summary>

# MCP Integration for Claude Code Plugins

## Overview

Model Context Protocol (MCP) enables Claude Code plugins to integrate with external services and APIs by providing structured tool access. Use MCP integration to expose external service capabilities as tools within Claude Code.

**Key capabilities:**
- Connect to external services (databases, APIs, file systems)
- Provide 10+ related tools from a single service
- Handle OAuth and complex authentication flows
- Bundle MCP servers with plugins for automatic setup

## MCP Server Configuration Methods

Plugins can bundle MCP servers in two ways:

### Method 1: Dedicated .mcp.json (Recommended)

Create `.mcp.json` at plugin root:

```json
{
  "database-tools": {
    "command": "${CLAUDE_PLUGIN_ROOT}/servers/db-server",
    "args": ["--config", "${CLAUDE_PLUGIN_ROOT}/config.json"],
    "env": {
      "DB_URL": "${DB_URL}"
    }
  }
}

Benefits:

Method 2: Inline in plugin.json

Add mcpServers field to plugin.json:

{
  "name": "my-plugin",
  "version": "1.0.0",
  "mcpServers": {
    "plugin-api": {
      "command": "${CLAUDE_PLUGIN_ROOT}/servers/api-server",
      "args": ["--port", "8080"]
    }
  }
}

Benefits:

MCP Server Types

stdio (Local Process)

Execute local MCP servers as child processes. Best for local tools and custom servers.

**

…(truncated)

plugin-settings

This skill should be used when the user asks about “plugin settings”, “store plugin configuration”, “user-configurable plugin”, “.local.md files”, “plugin state files”, “read YAML frontmatter”, “per-project plugin settings”, or wants to make plugin behavior configurable. Documents the .claude/plugin-name.local.md pattern for storing plugin-specific configuration with YAML frontmatter and markdown content.

View skill definition

Plugin Settings Pattern for Claude Code Plugins

Overview

Plugins can store user-configurable settings and state in .claude/plugin-name.local.md files within the project directory. This pattern uses YAML frontmatter for structured configuration and markdown content for prompts or additional context.

Key characteristics:

File Structure

Basic Template

---
enabled: true
setting1: value1
setting2: value2
numeric_setting: 42
list_setting: ["item1", "item2"]
---

# Additional Context

This markdown body can contain:
- Task descriptions
- Additional instructions
- Prompts to feed back to Claude
- Documentation or notes

Example: Plugin State File

.claude/my-plugin.local.md:

---
enabled: true
strict_mode: false
max_retries: 3
notification_level: info
coordinator_session: team-leader
---

# Plugin Configuration

This plugin is configured for standard validation mode.
Contact @team-lead with questions.

Reading Settings Files

From Hooks (Bash Scripts)

Pattern: Check existence and parse frontmatter

#!/bin/bash
set -euo pipefail

# Define state file path
STATE_FILE=".claude/my-plugin.local.md"

# Quick exit if file doesn't exist
if

...(truncated)

</details>

## Source

[View on GitHub](https://github.com/anthropics/claude-plugins-official)