# Create Slash Commands

Expert guidance for creating Claude Code slash commands.

- Repository: https://github.com/glittercowboy/taches-cc-resources (1986 stars)
- Category: AI and agents
- License: MIT
- Last updated: 2026-04-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add glittercowboy/taches-cc-resources --skill create-slash-commands -g -a claude-code -y`
Codex: `npx skills add glittercowboy/taches-cc-resources --skill create-slash-commands -g -a codex -y`
Cursor: `npx skills add glittercowboy/taches-cc-resources --skill create-slash-commands -g -a cursor -y`
Gemini CLI: `npx skills add glittercowboy/taches-cc-resources --skill create-slash-commands -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add glittercowboy/taches-cc-resources`

## Description

Expert guidance for creating Claude Code slash commands. Use when working with slash commands, creating custom commands, understanding command structure, or learning YAML configuration.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

<objective>
Create effective slash commands for Claude Code that enable users to trigger reusable prompts with `/command-name` syntax. Slash commands expand as prompts in the current conversation, allowing teams to standardize workflows and operations. This skill teaches you to structure commands with XML tags, YAML frontmatter, dynamic context loading, and intelligent argument handling.
</objective>

<quick_start>

<workflow>
1. Create `.claude/commands/` directory (project) or use `~/.claude/commands/` (personal)
2. Create `command-name.md` file
3. Add YAML frontmatter (at minimum: `description`)
4. Write command prompt
5. Test with `/command-name [args]`
</workflow>

<example>
**File**: `.claude/commands/optimize.md`

```markdown
---
description: Analyze this code for performance issues and suggest optimizations
---

Analyze the performance of this code and suggest three specific optimizations:
```

**Usage**: `/optimize`

Claude receives the expanded prompt and analyzes the code in context.
</example>
</quick_start>

<xml_structure>
All generated slash commands should use XML tags in the body (after YAML frontmatter) for clarity and consistency.

<required_tags>

**`<objective>`** - What the command does and why it matters
```markdown
<objective>
What needs to happen and why this matters.
Context about who uses this and what it accomplishes.
</objective>
```

**`<process>` or `<steps>`** - How to execute the command
```markdown
<process>
Sequential steps to accomplish the objective:
1. First step
2. Second step
3. Final step
</process>
```

**`<success_criteria>`** - How to know the command succeeded
```markdown
<success_criteria>
Clear, measurable criteria for successful completion.
</success_criteria>
```
</required_tags>

<conditional_tags>

**`<context>`** - When loading dynamic state or files
```markdown
<context>
Current state: ! `git status`
Relevant files: @ package.json
</context>
```
(Note: Remove the space after @ in actual usage)

The rest: https://github.com/glittercowboy/taches-cc-resources/blob/HEAD/skills/create-slash-commands/SKILL.md
