๐Ÿฆด Slash Command

November 28, 2025 ยท View on GitHub

๐Ÿ  Home โ€บ ๐Ÿ”ง Implementation โ€บ ๐Ÿ“ฆ Components โ€บ ๐Ÿฆด Slash Command

โ† ๐Ÿฆ Subagent โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ—โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” ๐Ÿ“š Skill โ†’


๐Ÿฆด Slash Command

A Slash Command is a user-invokable workflow that starts with / and triggers predefined prompt sequences.


Key Characteristics

PropertyValue
Invocation๐Ÿ™‹โ€โ™€๏ธ User types /command-name
Location.claude/commands/*.md
Variables$ARGUMENTS for user input
ExecutionSynchronous, within main conversation

File Structure

# .claude/commands/generate.md

---
description: Generate localization files for specified locales
argument-hint: [locale]
---

Generate localization files for: $ARGUMENTS

1. First, identify if this is a single locale or language cluster
2. Check LOCALES-200.csv for valid locales
3. ...

Note: Command name comes from filename (generate.md โ†’ /generate).


Frontmatter Reference

FieldRequiredDescription
descriptionRecommendedBrief description (shown in /help)
argument-hintNoExpected arguments hint
allowed-toolsNoTools without permission prompts
modelNoSpecific model to use
disable-model-invocationNoPrevent programmatic invocation

Usage Examples

/generate fr-FR              # Single locale
/generate fr                 # Language cluster
/generate fr es de           # Multiple clusters

Mermaid Representation

%%{init: {'theme': 'base', 'themeVariables': {'lineColor': '#64748b'}}}%%
flowchart LR
    classDef user fill:#6366f1,stroke:#4f46e5,stroke-width:2px,color:#ffffff
    classDef main fill:#8b5cf6,stroke:#7c3aed,stroke-width:2px,color:#ffffff

    U["๐Ÿ™‹โ€โ™€๏ธ๐Ÿ“ฅ /generate fr-FR"]:::user --> CMD["๐Ÿฆด Slash Command"]:::user
    CMD --> MA["๐Ÿ”๐Ÿ’ญ Main Agent"]:::main
    MA --> W["Workflow Execution"]
    W --> R["๐Ÿ’โ€โ™€๏ธ๐Ÿ“ค Result"]

Advanced: Nested Commands

Commands can reference other files in the .claude/commands/ directory:

# .claude/commands/full-review.md

---
description: Run comprehensive review pipeline
---

Execute the following reviews in sequence:
1. First run /security-review on $ARGUMENTS
2. Then run /performance-review on the same files
3. Finally run /style-check

Tips

  • Keep commands focused on single concerns
  • Use argument-hint for better discoverability
  • Consider permission modes for destructive operations
  • Document expected inputs and outputs

โ† ๐Ÿฆ Subagent โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ—โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” ๐Ÿ“š Skill โ†’