spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / plugins / plugin-dev / skills / plugin-structure / examples / minimal-plugin.md
83 lines · 1.7 KBPreviewCodeRaw
1# Minimal Plugin Example
2
3A bare-bones plugin with a single command.
4
5## Directory Structure
6
7```
8hello-world/
9├── .claude-plugin/
10│ └── plugin.json
11└── commands/
12 └── hello.md
13```
14
15## File Contents
16
17### .claude-plugin/plugin.json
18
19```json
20{
21 "name": "hello-world"
22}
23```
24
25### commands/hello.md
26
27```markdown
28---
29name: hello
30description: Prints a friendly greeting message
31---
32
33# Hello Command
34
35Print a friendly greeting to the user.
36
37## Implementation
38
39Output the following message to the user:
40
41> Hello! This is a simple command from the hello-world plugin.
42>
43> Use this as a starting point for building more complex plugins.
44
45Include the current timestamp in the greeting to show the command executed successfully.
46```
47
48## Usage
49
50After installing the plugin:
51
52```
53$ claude
54> /hello
55Hello! This is a simple command from the hello-world plugin.
56
57Use this as a starting point for building more complex plugins.
58
59Executed at: 2025-01-15 14:30:22 UTC
60```
61
62## Key Points
63
641. **Minimal manifest**: Only the required `name` field
652. **Single command**: One markdown file in `commands/` directory
663. **Auto-discovery**: Claude Code finds the command automatically
674. **No dependencies**: No scripts, hooks, or external resources
68
69## When to Use This Pattern
70
71- Quick prototypes
72- Single-purpose utilities
73- Learning plugin development
74- Internal team tools with one specific function
75
76## Extending This Plugin
77
78To add more functionality:
79
801. **Add commands**: Create more `.md` files in `commands/`
812. **Add metadata**: Update `plugin.json` with version, description, author
823. **Add agents**: Create `agents/` directory with agent definitions
834. **Add hooks**: Create `hooks/hooks.json` for event handling