This skill should be used when creating, configuring, or working with Claude Code slash commands...
Guide Claude through creating and configuring custom slash commands for Claude Code.
Slash commands let users define frequently-used prompts as Markdown files that Claude can execute on demand. This skill helps create well-structured slash commands with proper frontmatter, arguments, bash execution, and other advanced features.
Use this skill when:
.claude/commands/(project) in /help~/.claude/commands/(user) in /helpcommands/ in plugin root(plugin:plugin-name) in /help/plugin-name:command-name or just /command-nameUse the bundled creation script for fast, templated command setup:
# Create project command with basic template
scripts/create_slash_command.sh my-command --project
# Create personal command with advanced template
scripts/create_slash_command.sh my-command --user --template advanced
# Create plugin command (auto-detects plugin from current directory)
scripts/create_slash_command.sh my-command --plugin
# Create plugin command for specific plugin
scripts/create_slash_command.sh my-command --plugin my-plugin-name
# Available templates: basic, arguments, bash, advanced
The script is located at: scripts/create_slash_command.sh
Plugin command creation:
--plugin to create commands in a plugin's commands/ directory--plugin my-plugin-namemarketplace.jsonWhen creating commands manually, follow this structure:
Choose scope - Decide between:
.claude/commands/~/.claude/commands/plugins/<plugin-name>/commands/Create directory - Ensure the target directory exists:
mkdir -p .claude/commands # Project
mkdir -p ~/.claude/commands # Personal
mkdir -p plugins/my-plugin/commands # Plugin
Create file - Named command-name.md (the filename becomes the command)
Add frontmatter - Include at minimum a description field
Write instructions - Clear, actionable prompts for Claude
Register plugin commands - If creating a plugin command:
.claude-plugin/marketplace.jsonplugins array"./commands/command-name.md" to the plugin's commands arrayFour templates are provided in assets/ for common use cases:
template-basic.md)Minimal slash command with just description and instructions.
Use when: Creating simple, straightforward prompts.
template-with-arguments.md)Shows how to use $ARGUMENTS, $1, $2, etc. for parameterized commands.
Use when: Commands need user-provided input or parameters.
template-with-bash.md)Demonstrates bash command execution with the `!` prefix for gathering context.
Use when: Commands need git status, file listings, or other system context.
template-advanced.md)Full-featured template with all frontmatter options, bash execution, arguments, and file references.
Use when: Building complex workflows or need multiple features.
All available frontmatter fields:
---
description: Brief description shown in /help
argument-hint: [arg1] [arg2]
allowed-tools: Bash(git:*), Read, Write, Edit
model: claude-sonnet-4-5-20250929
disable-model-invocation: false
---
Two ways to handle arguments:
1. Capture all as string:
Fix issue #$ARGUMENTS following our coding standards
Usage: /fix-issue 123 high-priority → $ARGUMENTS = "123 high-priority"
2. Individual positional arguments:
Review PR #$1 with priority $2 and assign to $3
Usage: /review-pr 456 high alice → $1="456", $2="high", $3="alice"
Execute bash commands inline to gather context:
---
allowed-tools: Bash(git status:*), Bash(git diff:*)
---
## Context
- Current status: \`!\` `git status`
- Current diff: \`!\` `git diff HEAD`
Important: Commands prefixed with `!` run before the slash command is processed. Results are injected into the prompt.
Reference files using `@` prefix:
Review the implementation in \@src/utils/helpers.js
Compare \@old-file.js with \@new-file.js
Trigger extended thinking by including keywords:
When creating a new slash command:
Understand requirements - Ask user about:
Choose template - Select the most appropriate template:
Use creation script or manual approach:
scripts/create_slash_command.sh <name> --project --template <type>scripts/create_slash_command.sh <name> --user --template <type>scripts/create_slash_command.sh <name> --plugin [plugin-name] --template <type>Customize content:
Register plugin commands (plugin scope only):
.claude-plugin/marketplace.json"./commands/<command-name>.md" to the commands arrayTest and iterate:
/command-name/plugin-name:command-nameFor detailed information about slash commands, refer to references/slash-commands-reference.md, which contains:
Load this reference when users need detailed technical information beyond the workflow guidance in this skill.
Help users choose between creating a skill or a slash command:
Use Slash Commands when:
Use Skills when:
Both can coexist; recommend the approach that best fits the use case.