Generate slash commands for Claude Code plugins
Generates slash commands for Claude Code plugins. Use this to scaffold new plugin commands with proper structure, arguments, and metadata. It walks you through naming, configuration, and file creation interactively.
/plugin marketplace add oskar-dragon/claude-code/plugin install obsidian-location-notes@claude-code[command-purpose] [--namespace <name of namespace e.g. utils>] [--name <plugin-name e.g. create-plugin>]You are a slash command generator for Claude Code plugins. Your task is to create well-structured, properly formatted slash command files based on user requirements.
STEP 1: Verify User Input
STEP 2: Gather Command Requirements
Analyse the command purpose provided by the user and infer the arguments that will be required for the command, description of the command.
Then, use AskUserQuestion tool to collect (ask ALL questions in a single call):
Command Name (header: "Command Name")
Accepts Arguments (header: "Arguments")
STEP 3: Analyse and iterate
Analyse provided information by the user. If there is any inambiguity, ask the user for more details about the the detail that it is missing. If there is no ambiguity, proceed to the next step.
STEP 4: Validate Target Location
Calculate target path:
plugins/{namespace}/commands/{command-name}.mdCheck if plugin directory exists:
ls -la plugins/{namespace}/commands 2>/dev/null || echo "NOT_FOUND"Check if command file already exists:
test -f plugins/{namespace}/commands/{command-name}.md && echo "EXISTS" || echo "NEW"STEP 5: Generate Command Content
Based on gathered requirements, generate the slash command markdown with this structure:
---
name: [command-name]
description: "[user-provided description]"
argument-hint: "[generated based on user's argument requirements]"
version: v1.0.0
author: Oskar Dragon
---
## Context
[Context required]
## Your Task
### STEP 1: [Step 1 Title]
[Step 1 instruction]
### STEP 2: [Step 2 Title]
[Step 2 instruction]
### STEP 3: [Step 3 Title]
[Step 3 instruction]
[More Steps]
## Requirements
- [Requirement 1]
- [Requirement 2]
- [Requirement 3]
STEP 6: Write Command File
Use Write tool to create the file:
plugins/{namespace}/commands/{command-name}.mdSTEP 6: Provide Usage Instructions
Display to user:
✅ Slash command created successfully!
Location: plugins/{namespace}/commands/{command-name}.md
Command: /{namespace}:{command-name}
Arguments: {argument-hint or "none"}
Usage:
/{namespace}:{command-name} {show example with arguments}
Next steps:
1. Review the generated command file
2. Test the command: /{namespace}:{command-name}
/utils:slash-command utils hello
Creates a command that prints a greeting, no arguments needed.
/utils:slash-command utils --namespace git --namequick-commit
Creates a command that accepts a commit message and creates a git commit.
/utils:slash-command documentation create-readme
Creates a command that generates README.md files based on project analysis.
/utils:slash-command epcc my-agent workflow-plugin
Creates: plugins/epcc/commands/my-agent.md Available as: /epcc:my-agent
Frontmatter Generation Rules: [target] [--level basic|intermediate|advanced] [--format text|examples|interactive] [--context domain]
description: Brief description (1-2 sentences max)argument-hint:
"[arg]""[--flag1 <options>]""[required-arg] [--flags <options>]""[--flag1 <free text>]" or options e.g "[--flag1 option1|option2]".