summaryrefslogtreecommitdiff
path: root/plugins/example-plugin
diff options
context:
space:
mode:
authorTobin South <tobin.south@gmail.com>2026-03-17 22:45:25 +0000
committerGitHub <noreply@github.com>2026-03-17 22:45:25 +0000
commit6b70f99f769f58b9b642dc8a271936b17862cf8c (patch)
treec327f1df824680f08763ec0ad8041f9b1f7781bd /plugins/example-plugin
parent78497c524da3762865d47377357c30af5b50d522 (diff)
docs(plugin-dev): deprecate commands/ in favor of skills/<name>/SKILL.md (#717)
P0 follow-up for EA-471. Updates plugin-dev teaching materials to stop recommending the commands/ directory layout for new plugins: - command-development/SKILL.md: add legacy banner at top pointing to skills/ format - create-plugin.md: update scaffolding to create skills/<name>/SKILL.md instead of commands/; mark commands/ as acceptable legacy alternative; update all examples, tables, and testing instructions - example-plugin: migrate example-command to skills/example-command/SKILL.md; keep commands/example-command.md with a legacy-format note; update README to reflect new preferred structure Both formats remain loaded identically — this is a documentation change only. Refs: anthropics/apps#26827 Co-authored-by: Henry Shi <henrys@anthropic.com>
Diffstat (limited to 'plugins/example-plugin')
-rw-r--r--plugins/example-plugin/README.md41
-rw-r--r--plugins/example-plugin/commands/example-command.md6
-rw-r--r--plugins/example-plugin/skills/example-command/SKILL.md39
3 files changed, 67 insertions, 19 deletions
diff --git a/plugins/example-plugin/README.md b/plugins/example-plugin/README.md
index 34d9c2a0..6f9f16b9 100644
--- a/plugins/example-plugin/README.md
+++ b/plugins/example-plugin/README.md
@@ -7,41 +7,48 @@ A comprehensive example plugin demonstrating Claude Code extension options.
```
example-plugin/
├── .claude-plugin/
-│ └── plugin.json # Plugin metadata
-├── .mcp.json # MCP server configuration
-├── commands/
-│ └── example-command.md # Slash command definition
-└── skills/
- └── example-skill/
- └── SKILL.md # Skill definition
+│ └── 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)
```
## Extension Options
-### Commands (`commands/`)
+### Skills (`skills/`)
+
+Skills are the preferred format for both model-invoked capabilities and user-invoked slash commands. Create a `SKILL.md` in a subdirectory:
-Slash commands are user-invoked via `/command-name`. Define them as markdown files with frontmatter:
+**Model-invoked skill** (activated by task context):
```yaml
---
-description: Short description for /help
-argument-hint: <arg1> [optional-arg]
-allowed-tools: [Read, Glob, Grep]
+name: skill-name
+description: Trigger conditions for this skill
+version: 1.0.0
---
```
-### Skills (`skills/`)
-
-Skills are model-invoked capabilities. Create a `SKILL.md` in a subdirectory:
+**User-invoked skill** (slash command — `/skill-name`):
```yaml
---
name: skill-name
-description: Trigger conditions for this skill
-version: 1.0.0
+description: Short description for /help
+argument-hint: <arg1> [optional-arg]
+allowed-tools: [Read, Glob, Grep]
---
```
+### 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.
+
### MCP Servers (`.mcp.json`)
Configure external tool integration via Model Context Protocol:
diff --git a/plugins/example-plugin/commands/example-command.md b/plugins/example-plugin/commands/example-command.md
index 103b7ee3..5cf32af0 100644
--- a/plugins/example-plugin/commands/example-command.md
+++ b/plugins/example-plugin/commands/example-command.md
@@ -1,10 +1,12 @@
---
-description: An example slash command that demonstrates command frontmatter options
+description: An example slash command that demonstrates command frontmatter options (legacy format)
argument-hint: <required-arg> [optional-arg]
allowed-tools: [Read, Glob, Grep, Bash]
---
-# Example Command
+# Example Command (Legacy `commands/` Format)
+
+> **Note:** This demonstrates the legacy `commands/*.md` layout. For new plugins, prefer the `skills/<name>/SKILL.md` directory format (see `skills/example-command/SKILL.md` in this plugin). Both are loaded identically — the only difference is file layout.
This command demonstrates slash command structure and frontmatter options.
diff --git a/plugins/example-plugin/skills/example-command/SKILL.md b/plugins/example-plugin/skills/example-command/SKILL.md
new file mode 100644
index 00000000..a1793378
--- /dev/null
+++ b/plugins/example-plugin/skills/example-command/SKILL.md
@@ -0,0 +1,39 @@
+---
+name: example-command
+description: An example user-invoked skill that demonstrates frontmatter options and the skills/<name>/SKILL.md layout
+argument-hint: <required-arg> [optional-arg]
+allowed-tools: [Read, Glob, Grep, Bash]
+---
+
+# Example Command (Skill Format)
+
+This demonstrates the `skills/<name>/SKILL.md` layout for user-invoked slash commands. It is functionally identical to the legacy `commands/example-command.md` format — both are loaded the same way; only the file layout differs.
+
+## Arguments
+
+The user invoked this with: $ARGUMENTS
+
+## Instructions
+
+When this skill is invoked:
+
+1. Parse the arguments provided by the user
+2. Perform the requested action using allowed tools
+3. Report results back to the user
+
+## Frontmatter Options Reference
+
+Skills in this layout support these frontmatter fields:
+
+- **name**: Skill identifier (matches directory name)
+- **description**: Short description shown in /help
+- **argument-hint**: Hints for command arguments shown to user
+- **allowed-tools**: Pre-approved tools for this skill (reduces permission prompts)
+- **model**: Override the model (e.g., "haiku", "sonnet", "opus")
+
+## Example Usage
+
+```
+/example-command my-argument
+/example-command arg1 arg2
+```