# Slash Command Examples

## Simple Commands

### Code Review Command
```markdown
---
description: Review code for bugs and improvements
---

Review this code for:
- Security vulnerabilities
- Performance issues
- Code style violations
- Potential bugs

$ARGUMENTS
```

### Explain Command
```markdown
---
description: Explain code in simple terms
---

Explain the following code in simple, easy-to-understand terms:

$ARGUMENTS
```

## Commands with Arguments

### Single Argument (`$ARGUMENTS`)
```markdown
---
description: Fix a GitHub issue
---

Fix issue #$ARGUMENTS following our coding standards.
```

### Positional Arguments (`$1`, `$2`, etc.)
```markdown
---
argument-hint: [pr-number] [priority] [assignee]
description: Review pull request
---

Review PR #$1 with priority $2 and assign to $3.
Focus on security, performance, and code style.
```

## Commands with Bash Execution

Use `!` prefix to execute bash commands and include output in context.

### Git Commit Command
```markdown
---
allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*)
description: Create a git commit
---

## Context

- Current git status: !`git status`
- Current git diff: !`git diff HEAD`
- Current branch: !`git branch --show-current`
- Recent commits: !`git log --oneline -10`

## Task

Based on the above changes, create a single git commit.
```

### Deploy Command
```markdown
---
allowed-tools: Bash(npm:*), Bash(docker:*)
argument-hint: [environment]
description: Deploy to specified environment
---

## Current State

- Branch: !`git branch --show-current`
- Last commit: !`git log -1 --oneline`

## Deploy to $1

Run the deployment process for the $1 environment.
```

## Commands with File References

Use `@` prefix to include file contents.

### Review Implementation
```markdown
---
description: Review implementation against spec
---

Review the implementation in @src/utils/helpers.js against the specification.
```

### Compare Files
```markdown
---
argument-hint: [old-file] [new-file]
description: Compare two files
---

Compare @$1 with @$2 and summarize the differences.
```

## Namespaced Commands

Commands in subdirectories appear with namespace in description.

### Frontend Component (`.claude/commands/frontend/component.md`)
```markdown
---
description: Generate a React component
---

Generate a React component with the following requirements:

$ARGUMENTS

Follow our frontend coding standards and use TypeScript.
```

### Backend API (`.claude/commands/backend/api.md`)
```markdown
---
description: Generate API endpoint
---

Generate a REST API endpoint for:

$ARGUMENTS

Include validation, error handling, and documentation.
```

## Extended Thinking Commands

Include thinking keywords to trigger extended thinking.

```markdown
---
description: Analyze architecture deeply
---

Think step by step about the architecture implications of:

$ARGUMENTS

Consider scalability, maintainability, and performance.
```
