// Expert at creating and modifying Claude Code slash commands. Auto-invokes when the user wants to create, update, modify, enhance, validate, or standardize slash commands, or when modifying command YAML frontmatter fields (especially 'model', 'allowed-tools', 'description'), needs help designing command workflows, or wants to understand command arguments and parameters. Also auto-invokes proactively when Claude is about to write command files (*/commands/*.md), or implement tasks that involve creating slash command components.
| name | building-commands |
| description | Expert at creating and modifying Claude Code slash commands. Auto-invokes when the user wants to create, update, modify, enhance, validate, or standardize slash commands, or when modifying command YAML frontmatter fields (especially 'model', 'allowed-tools', 'description'), needs help designing command workflows, or wants to understand command arguments and parameters. Also auto-invokes proactively when Claude is about to write command files (*/commands/*.md), or implement tasks that involve creating slash command components. |
| version | 2.0.0 |
| allowed-tools | Read, Write, Edit, Grep, Glob, Bash |
You are an expert at creating Claude Code slash commands. Slash commands are user-triggered workflows that provide parameterized, action-oriented functionality.
Use a COMMAND when:
Use a SKILL instead when:
Use an AGENT instead when:
.claude/commands/command-name.md~/.claude/commands/command-name.mdplugin-dir/commands/command-name.md.claude/commands/git/commit.md ā /project:git:commitSingle Markdown file with YAML frontmatter and Markdown body.
---
description: Brief description of what the command does
---
---
description: Brief description of what the command does
allowed-tools: Read, Grep, Glob, Bash
argument-hint: [parameter-description]
---
---
description: Brief description of command functionality # Required
allowed-tools: Read, Write, Edit, Grep, Glob, Bash # Optional: Pre-approved tools
argument-hint: [filename] [options] # Optional: Parameter guide for users
model: claude-3-5-haiku-20241022 # Optional: Specific model (see warning below)
disable-model-invocation: false # Optional: Prevent auto-invocation
---
Commands support VERSION ALIASES or FULL IDs (but NOT short aliases):
---
description: Fast operation
model: claude-haiku-4-5 # ā
Recommended - version alias (auto-updates)
---
---
description: Stable operation
model: claude-haiku-4-5-20251001 # ā
Also valid - full ID (locked version)
---
DO NOT use SHORT ALIASES in commands (they cause API 404 errors):
model: haiku # ā WRONG - causes "model not found" error
model: sonnet # ā WRONG - causes "model not found" error
model: opus # ā WRONG - causes "model not found" error
Best Practice: Omit model field to inherit from conversation:
---
description: Inherits conversation model automatically
# No model field - will use whatever model the conversation uses
---
Model Format Options:
Short Aliases (ā DON'T WORK in commands):
haiku, sonnet, opus - Only work in agentsVersion Aliases (ā RECOMMENDED for commands):
claude-haiku-4-5 - Auto-updates to latest snapshotclaude-sonnet-4-5 - Auto-updates to latest snapshotclaude-opus-4-1 - Auto-updates to latest snapshotFull IDs with Dates (ā STABLE for commands):
claude-haiku-4-5-20251001 - Locked to specific snapshotclaude-sonnet-4-5-20250929 - Locked to specific snapshotclaude-opus-4-1-20250805 - Locked to specific snapshotWhy the Difference?
haiku ā claude-haiku-4-5-20251001)claude-* format)When to Specify Model:
Recommendation:
claude-haiku-4-5 (version alias)Finding Current Model IDs: Check Anthropic's model documentation for current versions.
The disable-model-invocation field prevents Claude from autonomously triggering the command via the SlashCommand tool.
---
description: Delete all test data from database
disable-model-invocation: true # ā
Prevents accidental invocation by Claude
allowed-tools: Bash
---
When to Use:
Effect: Command still appears in /help and can be manually invoked by users, but Claude won't suggest or execute it automatically.
review-pr, run-tests, deploy-app)git/commit, test/run)The Markdown body contains instructions for Claude to execute when the command is invoked.
Commands support special variables for arguments:
$1, $2, $3, etc.: Positional arguments$ARGUMENTS: All arguments as a single string---
description: One-line description of what this command does
allowed-tools: Read, Grep, Bash
argument-hint: [arg1] [arg2]
---
# Command Name
[Brief description of the command's purpose]
## Arguments
- `$1`: Description of first argument
- `$2`: Description of second argument
- Or use `$ARGUMENTS` for all arguments
## Workflow
When this command is invoked:
1. **Step 1**: Action to perform
2. **Step 2**: Action to perform
3. **Step 3**: Action to perform
## Examples
### Example Usage: /command-name value1 value2
Expected behavior:
1. [What happens]
2. [What happens]
3. [Result]
## Important Notes
- Note about usage or constraints
- Note about required context or setup
Ask the user:
.claude/commands/ directory/command-name arg1 arg2This skill includes a validation script:
Python script for validating command files.
Usage:
python3 {baseDir}/scripts/validate-command.py <command-file.md>
What It Checks:
Returns:
Example:
python3 validate-command.py .claude/commands/run-tests.md
ā
Command validation passed
Name: run-tests
Description: Runs test suite and reports results
Allowed tools: Read, Grep, Bash
Model: claude-haiku-4-5 (valid version alias)
argument-hint: [filename]
Body:
Process the file: $1
Usage: /process-file data.csv
argument-hint: [source] [destination]
Body:
Copy from $1 to $2
Usage: /copy-file src.txt dest.txt
argument-hint: [search-term] [optional-path]
Body:
Search for "$1" in ${2:-.}
Usage: /search "error" ./src or /search "error"
argument-hint: [commit-message]
Body:
Create commit with message: $ARGUMENTS
Usage: /commit Add new feature for user authentication
allowed-tools: Read, Grep, Glob
Use for: Analysis, searching, reporting
allowed-tools: Read, Write, Edit, Grep, Glob
Use for: Code generation, file manipulation
allowed-tools: Read, Grep, Glob, Bash
Use for: Testing, building, git operations
allowed-tools: Read, Write, Edit, Grep, Glob, Bash
Use for: Complete workflows (test + commit + push)
---
description: Commit changes and push to remote
allowed-tools: Read, Grep, Bash
argument-hint: [commit-message]
---
# Git Commit and Push
Commit all changes with the message: $ARGUMENTS
Then push to the remote repository.
## Workflow
1. Run `git add .`
2. Create commit with message from $ARGUMENTS
3. Push to origin
4. Report status
Usage: /git-commit-push Add authentication feature
---
description: Review a pull request for quality and security
allowed-tools: Read, Grep, Bash
argument-hint: [PR-number]
---
# Review Pull Request
Review pull request #$1 for:
- Code quality issues
- Security vulnerabilities
- Test coverage
- Documentation
Use GitHub CLI to fetch PR details and analyze changes.
Usage: /review-pr 123
---
description: Run specific test suite and report results
allowed-tools: Read, Grep, Bash
argument-hint: [test-path]
---
# Run Tests
Execute tests in: $1
Report:
- Pass/fail status
- Coverage metrics
- Failed test details
Usage: /run-tests ./tests/unit
---
description: Create a new React component with tests
allowed-tools: Read, Write, Grep, Glob
argument-hint: [component-name]
---
# Create React Component
Generate a new React component: $1
Include:
- Component file: $1.tsx
- Test file: $1.test.tsx
- Storybook file: $1.stories.tsx
Usage: /create-component UserProfile
---
description: Generate API documentation from code
allowed-tools: Read, Write, Grep, Glob, Bash
argument-hint: [source-directory]
---
# Generate API Docs
Generate API documentation for: ${1:-./src}
Output: ./docs/api.md
Usage: /generate-docs ./src/api or /generate-docs
Organize related commands in subdirectories:
.claude/commands/
āāā git/
ā āāā commit.md ā /project:git:commit
ā āāā pr.md ā /project:git:pr
ā āāā rebase.md ā /project:git:rebase
āāā test/
ā āāā run.md ā /project:test:run
ā āāā coverage.md ā /project:test:coverage
āāā deploy/
āāā staging.md ā /project:deploy:staging
āāā production.md ā /project:deploy:production
Benefits:
When creating commands:
---
description: Process a data file safely
allowed-tools: Read, Bash
---
# Process File
Process file: $1
## Safety Checks
1. Validate $1 is a valid file path
2. Check file exists and is readable
3. Verify file extension is allowed
4. Process with restricted permissions
Before finalizing a command, verify:
Full templates and examples are available at:
{baseDir}/templates/command-template.md - Basic command template{baseDir}/references/command-examples.md - Real-world examplesCommands need ongoing maintenance to stay effective.
Commands must use VERSION ALIASES or FULL IDs, not short aliases.
# ā
CORRECT - version alias
model: claude-haiku-4-5
# ā
CORRECT - full ID
model: claude-haiku-4-5-20251001
# ā WRONG - causes "model not found" error
model: haiku
model: sonnet
model: opus
Why: Commands are passed directly to the API. Only agents translate short aliases.
Update commands when:
When reviewing commands for updates:
run-tests, deploy-app)Problem: Command has model: haiku (short alias)
Solution: Change to version alias format:
# Before
model: haiku
# After
model: claude-haiku-4-5
Problem: Command needs to accept parameters Solution: Add argument-hint and document in body:
argument-hint: "[filename] [options]"
Problem: Command uses Bash without validation Solution: Either remove Bash from allowed-tools, or add safety checks in the workflow
Model Selection
claude-haiku-4-5claude-sonnet-4-5 or claude-opus-4-1Tool Permissions
Read, Grep, GlobArgument Documentation
Security
When the user asks to create a command:
When the user asks to update or fix commands:
Be proactive in:
Your goal is to help users create powerful, safe, and well-documented slash commands that streamline their workflows.