Create effective Claude Code slash commands with proper YAML frontmatter and argument handling. Use when writing new slash commands, improving existing commands, or learning command best practices.
/plugin marketplace add wayne930242/Reflexive-Claude-Code/plugin install ACE-core@Reflexive-Claude-CodeThis skill inherits all available tools. When active, it can use any tool Claude has access to.
scripts/init_command.pyCreate slash commands that users explicitly invoke with /command-name.
| Aspect | Slash Command | Skill |
|---|---|---|
| Activation | Manual /command | Automatic (context) |
| Location | .claude/commands/<name>.md | .claude/skills/<name>/SKILL.md |
| Best for | On-demand actions | Recurring workflows |
.claude/
└── commands/
├── my-command.md
└── subdir/
└── nested-command.md
Run the init script to create proper structure:
python3 scripts/init_command.py <command-name>
Options:
--path, -p: Output directory (default: .claude/commands)--no-args: Create without argument templateUpdate the generated file with your instructions.
Restart Claude Code, then run /<command-name>.
---
name: command-name
description: Brief description of what this command does
arguments:
- name: required_arg
description: Something required
required: true
- name: optional_arg
description: Something optional
required: false
---
# Command Title
[What this command does]
## Process
### 1. [Step Name]
[Instructions with code examples]
### 2. [Step Name]
[Instructions]
## Example Usage
/command-name value1 value2
| Field | Format |
|---|---|
name | lowercase, hyphens (must match filename) |
description | Brief action description |
| Field | Description |
|---|---|
arguments | Array of argument definitions |
allowed-tools | Pre-approved tools list |
Define arguments as array:
arguments:
- name: issue-id
description: GitHub issue number
required: true
- name: branch
description: Branch name (default: main)
required: false
| Syntax | Usage |
|---|---|
$ARGUMENTS | Entire input string |
$1, $2 | Positional parameters |
Example: /deploy app prod → $1=app, $2=prod
Do:
Don't:
!npm run build
!python scripts/process.py
Review this:
@src/index.ts