All skills
anthropics avatar

/plugin-structure

@387dc35
by Anthropicanthropics/claude-code149k stars
25,117

This skill should be used when the user asks to "create a plugin", "scaffold a plugin", "understand plugin structure", "organize plugin components", "set up plugin.json", "use ${CLAUDE_PLUGIN_ROOT}", "add commands/agents/skills/hooks", "configure auto-discovery", or needs guidance on plugin directory layout, manifest configuration, component organization, file naming conventions, or Claude Code plugin architecture best practices.

Use this Skill: https://skilld.dev/gh/anthropics/claude-code/plugin-structure

This session only. Nothing lands on disk.

examplesminimal-plugin.md

≈433 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Minimal Plugin Example

A bare-bones plugin with a single command.

Directory Structure

hello-world/
├── .claude-plugin/
│   └── plugin.json
└── commands/
    └── hello.md

File Contents

.claude-plugin/plugin.json

{
  "name": "hello-world"
}

commands/hello.md

---
name: hello
description: Prints a friendly greeting message
---

# Hello Command

Print a friendly greeting to the user.

## Implementation

Output the following message to the user:

> Hello! This is a simple command from the hello-world plugin.
>
> Use this as a starting point for building more complex plugins.

Include the current timestamp in the greeting to show the command executed successfully.

Usage

After installing the plugin:

$ claude
> /hello
Hello! This is a simple command from the hello-world plugin.

Use this as a starting point for building more complex plugins.

Executed at: 2025-01-15 14:30:22 UTC

Key Points

  1. Minimal manifest: Only the required name field
  2. Single command: One markdown file in commands/ directory
  3. Auto-discovery: Claude Code finds the command automatically
  4. No dependencies: No scripts, hooks, or external resources

When to Use This Pattern

  • Quick prototypes
  • Single-purpose utilities
  • Learning plugin development
  • Internal team tools with one specific function

Extending This Plugin

To add more functionality:

  1. Add commands: Create more .md files in commands/
  2. Add metadata: Update plugin.json with version, description, author
  3. Add agents: Create agents/ directory with agent definitions
  4. Add hooks: Create hooks/hooks.json for event handling

Source: SKILL.md on GitHub

1 warning5mo5 checks · Risk SAFE
  • Gen Agent Trust Hub7mo

    The analyzed files consist entirely of documentation and structural examples for creating Claude Code plugins. No executable code, network requests, or sensitive data access patterns were detected.

  • Socket6mo

    No alerts

  • Snyk7mo

    Risk: LOW · No issues

  • Runlayer7mo

    1/7 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 387dc35. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 11 months ago
version
0.1.0

README badge

README badge for anthropics/claude-code/plugin-structure