Build custom slash commands in Claude Code with YAML frontmatter, permissions, and best practices. Use when creating automation workflows, project-specific commands, or standardizing repetitive tasks.
This skill inherits all available tools. When active, it can use any tool Claude has access to.
Slash commands automate workflows by encapsulating multi-step processes into reusable commands. They support YAML frontmatter for permissions, can integrate with CLI tools, and enable sophisticated decision logic.
.claude/commands/[name].md/<command-name> [args]# .claude/commands/my-command.md
---
allowed-tools: Bash(git:*),Read,Edit
description: Brief description of what this command does
---
Command instructions here. Use $ARGUMENTS to reference user input.
Steps:
1. First action
2. Second action
3. Final action
allowed-tools: Restrict which tools the command can use
Bash(gh:*), Bash(git:*), Read, Edit, WriteBash(pytest:*) allows any pytest commanddescription: One-line summary shown in command list# Specific command only
allowed-tools: Bash(gh issue view:*)
# Multiple related commands
allowed-tools: Bash(gh issue view:*),Bash(gh issue comment:*)
# Tool categories
allowed-tools: Read,Edit,Grep,Glob
# Combined patterns
allowed-tools: Bash(git:*),Bash(gh:*),Read,Write
This project's /plan-issue demonstrates sophisticated automation:
# .claude/commands/plan-issue.md
---
allowed-tools: Bash(gh issue view:*),Bash(gh issue comment:*)
description: Respond to a github issue with a plan of action
---
You are an expert software developer and project manager. Respond to GitHub issue $ARGUMENTS with a detailed plan. Steps:
1. Fetch issue: `gh issue view <issue-number>`
2. Analyze description and comments
3. Comment you're working on a plan: `gh issue comment <issue-number> --body "<your-comment>"`
4. Review codebase for context
5. Assess clarity: Need more info?
- Yes: Comment clarifying questions, stop and wait
- No: Proceed to step 6
6. Break down into smaller tasks
7. Comment detailed plan: `gh issue comment <issue-number> --body "<your-plan>"` with:
- Issue summary
- Resolution steps
- Dependencies and considerations
Key strengths:
Bash(git:*))Reference skill files in commands:
---
description: Review code using TDD skill
---
1. Read skill: .claude/skills/testing/test-driven-development.md
2. Apply skill to files: $ARGUMENTS
3. Report findings
---
allowed-tools: Bash(gh:*)
---
1. Fetch PR: `gh pr view $ARGUMENTS`
2. Get diff: `gh pr diff $ARGUMENTS`
3. Review and comment
---
allowed-tools: Bash(git:*)
---
1. Check status: `git status`
2. Stage changes: `git add $ARGUMENTS`
3. Commit with message
❌ Don't: Create commands for single-step tasks
❌ Don't: Grant unlimited tool access
❌ Don't: Skip context gathering
❌ Don't: Write commands without decision logic
❌ Don't: Ignore error scenarios