Arguments
[command purpose and requirements]
Create a Custom Claude Code Command
Create a new slash command in .claude/commands/ for the requested task.
Goal
#$ARGUMENTS
Key Capabilities to Leverage
File Operations:
- Read, Edit, Write - modify files precisely
- Glob, Grep - search codebase
- MultiEdit - atomic multi-part changes
Development:
- Bash - run commands (git, tests, linters)
- Task - launch specialized agents for complex tasks
- TodoWrite - track progress with todo lists
Web & APIs:
- WebFetch, WebSearch - research documentation
- GitHub (gh cli) - PRs, issues, reviews
- Playwright - browser automation, screenshots
Integrations:
- AppSignal - logs and monitoring
- Context7 - framework docs
- Stripe, Todoist, Featurebase (if relevant)
Best Practices
- Be specific and clear - detailed instructions yield better results
- Break down complex tasks - use step-by-step plans
- Use examples - reference existing code patterns
- Include success criteria - tests pass, linting clean, etc.
- Think first - use "think hard" or "plan" keywords for complex problems
- Iterate - guide the process step by step
Required: YAML Frontmatter
EVERY command MUST start with YAML frontmatter:
---
name: command-name
description: Brief description of what this command does (max 100 chars)
argument-hint: "[what arguments the command accepts]"
---
Fields:
name: Lowercase command identifier (used internally)
description: Clear, concise summary of command purpose
argument-hint: Shows user what arguments are expected (e.g., [file path], [PR number], [optional: format])
Structure Your Command
# [Command Name]
[Brief description of what this command does]
## Steps
1. [First step with specific details]
- Include file paths, patterns, or constraints
- Reference existing code if applicable
2. [Second step]
- Use parallel tool calls when possible
- Check/verify results
3. [Final steps]
- Run tests
- Lint code
- Commit changes (if appropriate)
## Success Criteria
- [ ] Tests pass
- [ ] Code follows style guide
- [ ] Documentation updated (if needed)
Tips for Effective Commands
- Use $ARGUMENTS placeholder for dynamic inputs
- Reference CLAUDE.md patterns and conventions
- Include verification steps - tests, linting, visual checks
- Be explicit about constraints - don't modify X, use pattern Y
- Use XML tags for structured prompts:
<task>, <requirements>, <constraints>
Example Pattern
Implement #$ARGUMENTS following these steps:
1. Research existing patterns
- Search for similar code using Grep
- Read relevant files to understand approach
2. Plan the implementation
- Think through edge cases and requirements
- Consider test cases needed
3. Implement
- Follow existing code patterns (reference specific files)
- Write tests first if doing TDD
- Ensure code follows CLAUDE.md conventions
4. Verify
- Run tests: `bin/rails test`
- Run linter: `bundle exec standardrb`
- Check changes with git diff
5. Commit (optional)
- Stage changes
- Write clear commit message
Creating the Command File
- Create the file at
.claude/commands/[name].md (subdirectories like workflows/ supported)
- Start with YAML frontmatter (see section above)
- Structure the command using the template above
- Test the command by using it with appropriate arguments
Command File Template
---
name: command-name
description: What this command does
argument-hint: "[expected arguments]"
---
# Command Title
Brief introduction of what the command does and when to use it.
## Workflow
### Step 1: [First Major Step]
Details about what to do.
### Step 2: [Second Major Step]
Details about what to do.
## Success Criteria
- [ ] Expected outcome 1
- [ ] Expected outcome 2
1---2name: generate-command3description: Create a new custom slash command following conventions and best practices4metadata:5 source: https://skillmd.com/skills/levalencia/generate-command6---78## Arguments9[command purpose and requirements]1011# Create a Custom Claude Code Command1213Create a new slash command in `.claude/commands/` for the requested task.1415## Goal1617#$ARGUMENTS1819## Key Capabilities to Leverage2021**File Operations:**22- Read, Edit, Write - modify files precisely23- Glob, Grep - search codebase24- MultiEdit - atomic multi-part changes2526**Development:**27- Bash - run commands (git, tests, linters)28- Task - launch specialized agents for complex tasks29- TodoWrite - track progress with todo lists3031**Web & APIs:**32- WebFetch, WebSearch - research documentation33- GitHub (gh cli) - PRs, issues, reviews34- Playwright - browser automation, screenshots3536**Integrations:**37- AppSignal - logs and monitoring38- Context7 - framework docs39- Stripe, Todoist, Featurebase (if relevant)4041## Best Practices42431. **Be specific and clear** - detailed instructions yield better results442. **Break down complex tasks** - use step-by-step plans453. **Use examples** - reference existing code patterns464. **Include success criteria** - tests pass, linting clean, etc.475. **Think first** - use "think hard" or "plan" keywords for complex problems486. **Iterate** - guide the process step by step4950## Required: YAML Frontmatter5152**EVERY command MUST start with YAML frontmatter:**5354```yaml55---56name: command-name57description: Brief description of what this command does (max 100 chars)58argument-hint: "[what arguments the command accepts]"59---60```6162**Fields:**63- `name`: Lowercase command identifier (used internally)64- `description`: Clear, concise summary of command purpose65- `argument-hint`: Shows user what arguments are expected (e.g., `[file path]`, `[PR number]`, `[optional: format]`)6667## Structure Your Command6869```markdown70# [Command Name]7172[Brief description of what this command does]7374## Steps75761. [First step with specific details]77 - Include file paths, patterns, or constraints78 - Reference existing code if applicable79802. [Second step]81 - Use parallel tool calls when possible82 - Check/verify results83843. [Final steps]85 - Run tests86 - Lint code87 - Commit changes (if appropriate)8889## Success Criteria9091- [ ] Tests pass92- [ ] Code follows style guide93- [ ] Documentation updated (if needed)94```9596## Tips for Effective Commands9798- **Use $ARGUMENTS** placeholder for dynamic inputs99- **Reference CLAUDE.md** patterns and conventions100- **Include verification steps** - tests, linting, visual checks101- **Be explicit about constraints** - don't modify X, use pattern Y102- **Use XML tags** for structured prompts: `<task>`, `<requirements>`, `<constraints>`103104## Example Pattern105106```markdown107Implement #$ARGUMENTS following these steps:1081091. Research existing patterns110 - Search for similar code using Grep111 - Read relevant files to understand approach1121132. Plan the implementation114 - Think through edge cases and requirements115 - Consider test cases needed1161173. Implement118 - Follow existing code patterns (reference specific files)119 - Write tests first if doing TDD120 - Ensure code follows CLAUDE.md conventions1211224. Verify123 - Run tests: `bin/rails test`124 - Run linter: `bundle exec standardrb`125 - Check changes with git diff1261275. Commit (optional)128 - Stage changes129 - Write clear commit message130```131132## Creating the Command File1331341. **Create the file** at `.claude/commands/[name].md` (subdirectories like `workflows/` supported)1352. **Start with YAML frontmatter** (see section above)1363. **Structure the command** using the template above1374. **Test the command** by using it with appropriate arguments138139## Command File Template140141```markdown142---143name: command-name144description: What this command does145argument-hint: "[expected arguments]"146---147148# Command Title149150Brief introduction of what the command does and when to use it.151152## Workflow153154### Step 1: [First Major Step]155156Details about what to do.157158### Step 2: [Second Major Step]159160Details about what to do.161162## Success Criteria163164- [ ] Expected outcome 1165- [ ] Expected outcome 2166```