This skill should be used when creating slash commands, writing command files, or when "/command", ".claude/commands", "$ARGUMENTS", or "create command" are mentioned.
Create custom slash commands that extend Claude Code with reusable prompts and workflows.
Critical distinction:
| Aspect | Commands (This Skill) | Skills |
| -------------- | --------------------------------------- | -------------------------------------- |
| Purpose | Reusable prompts invoked by users | Capability packages auto-triggered |
| Invocation | Explicit: /command-name args | Automatic (model-triggered by context) |
| Location | commands/ directory | skills/ directory with SKILL.md |
| Structure | Single .md file | Directory with resources |
| Arguments | $1, $2, $ARGUMENTS | No argument system |
Commands are user-initiated. Skills are model-initiated.
Create .claude/commands/review.md:
---
description: Review code for best practices and issues
---
Review the following code for:
- Code quality and readability
- Potential bugs or edge cases
- Performance considerations
- Security concerns
Use with: /review
Create .claude/commands/fix-issue.md:
---
description: Fix a specific GitHub issue
argument-hint: <issue-number>
---
Fix issue #$1 following our coding standards.
Review the issue, implement a fix, add tests, and create a commit.
Use with: /fix-issue 123
Create .claude/commands/commit.md:
---
description: Create git commit from staged changes
allowed-tools: Bash(git *)
---
## Context
<!-- NOTE: Place "!" before the opening backtick for preprocessing to work -->
Current branch: `git branch --show-current`
Staged changes: `git diff --staged`
Recent commits: `git log --oneline -5`
## Task
Create a commit with a clear message based on the staged changes.
Use with: /commit
Before writing code, clarify:
Key questions:
| Scope | Location | Visibility | Use Case |
|-------|----------|------------|----------|
| Project | .claude/commands/ | Team via git | Shared workflows |
| Personal | ~/.claude/commands/ | You only | Individual preferences |
| Plugin | <plugin>/commands/ | Plugin users | Distributed via marketplace |
Project commands show "(project)" in /help. Personal show "(user)".
| Feature | Syntax | Purpose |
|---------|--------|---------|
| Arguments | $1, $2, $ARGUMENTS | Dynamic input from user |
| Bash execution | !backtickcommandbacktick | Include shell output in context |
| File references | @path/to/file | Include file contents |
| Tool restrictions | allowed-tools: | Limit Claude's capabilities |
---
description: Brief description for /help # Required for discovery
argument-hint: <required> [optional] # Shown in autocomplete
allowed-tools: Read, Grep, Bash(git *) # Restrict tool access
model: claude-3-5-haiku-20241022 # Override model
disable-model-invocation: true # Prevent SlashCommand tool
---
See frontmatter.md for complete schema.
---
description: Deploy to environment with validation
argument-hint: <environment> [--skip-tests]
allowed-tools: Bash(*), Read
---
# Deployment
Target: $1
Options: $2
## Pre-flight Checks
<!-- NOTE: Place "!" before the opening backtick for preprocessing to work -->
Environment: `echo "$1" | grep -E "^(staging|production)$" || echo "Invalid"`
Tests: `[[ "$2" == *"--skip-tests"* ]] && echo "Skipped" || bun test`
## Task
Based on validation above, proceed with deployment or explain issues.
Positional arguments ($1, $2, $3):
Compare file $1 with file $2 and summarize differences.
Usage: /compare old.ts new.ts
All arguments ($ARGUMENTS):
Fix the following issues: $ARGUMENTS
Usage: /fix memory leak in auth slow query in search
Combined with file references:
Analyze this file: @$1
Usage: /analyze src/main.ts
See arguments.md for advanced patterns.
Execute commands and include output. The ! must precede the opening backtick for preprocessing to work:
## Git Context
<!-- NOTE: Place "!" before the opening backtick for preprocessing to work -->
Branch: `git branch --show-current`
Status: `git status --short`
Diff: `git diff --stat`
Based on the above, suggest next steps.
Important: Output is truncated at 15,000 characters by default. Use SLASH_COMMAND_TOOL_CHAR_BUDGET to adjust.
See bash-execution.md for patterns.
Include file contents directly:
Review this configuration:
- Package: @package.json
- TypeScript: @tsconfig.json
- User input: @$1
See file-references.md for details.
Restrict what Claude can do:
# Read-only analysis
allowed-tools: Read, Grep, Glob
# Git operations only
allowed-tools: Bash(git *), Read
# Full bash with restrictions
allowed-tools: Bash(bun *), Bash(npm *), Read, Write, Edit
See permissions.md for patterns.
After creating a command, validate against these checklists.
--- on line 1, closes with ---description present and action-orientedargument-hint uses <required> and [optional] syntaxallowed-tools uses correct names (case-sensitive)my-command.mdGood: review-pr.md, deploy-staging.md, fix-issue.md
Bad: my command.md, DoStuff.md, helper.md
/help discoveryGood: "Deploy to staging with health checks and Slack notification" Bad: "Deploy stuff" or "Helps with deployment"
# Command Validation: [command-name]
## Summary
- **Status**: PASS | FAIL | WARNINGS
- **Location**: [path]
- **Issues**: [count]
## Critical Issues (must fix)
1. [Issue with fix]
## Warnings (should fix)
1. [Issue with fix]
## Strengths
- [What's done well]
Organize commands in subdirectories:
.claude/commands/
+-- frontend/
| +-- component.md # /component (project:frontend)
| +-- styling.md # /styling (project:frontend)
+-- backend/
| +-- migration.md # /migration (project:backend)
+-- review.md # /review (project)
The namespace appears in /help but commands are invoked without prefix: /component or /frontend/component.
See namespacing.md for organization patterns.
/help - should see your command listed/your-command/your-command arg1 arg2allowed-toolsclaude --debug
Shows command loading and execution details.
.claude/commands/name.md.md extension, no spaces/clear$1, $2 not {1}, {2}$ARGUMENTS for all arguments/cmd "arg with spaces"! before backticks: !`command`allowed-tools includes BashRead not readBash(git *)| Reference | Content | |-----------|---------| | frontmatter.md | Complete frontmatter schema and fields | | arguments.md | Argument handling and patterns | | bash-execution.md | Shell command execution | | file-references.md | File inclusion syntax | | permissions.md | Tool restriction patterns | | namespacing.md | Directory organization | | sdk-integration.md | Agent SDK usage | | community.md | Community examples and resources |
See EXAMPLES.md for complete real-world examples.
See scripts/ for scaffolding and validation utilities.
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer