β‘ Slash Commands
Slash commands are shortcuts for triggering ECC features, as simple and intuitive as commands in Slack or Discord.
What Are Slash Commands?β
Slash commands start with /, followed by the command name and optional parameters:
/plan Implement a shopping cart feature
/tdd --feature="user-auth"
/e2e --url=http://localhost:3000
Command Categoriesβ
ποΈ Planning Commandsβ
| Command | Description | Example |
|---|---|---|
/plan | Create implementation plan | /plan Add payment feature |
/architect | Architecture design | /architect Microservice split plan |
/estimate | Effort estimation | /estimate Refactor auth module |
π§ͺ Development Commandsβ
| Command | Description | Example |
|---|---|---|
/tdd | Test-driven development | /tdd --feature="login" |
/build-and-fix | Fix build errors | /build-and-fix |
/debug | Debug issues | /debug TypeError: undefined |
π Review Commandsβ
| Command | Description | Example |
|---|---|---|
/code-review | Code review | /code-review src/auth.ts |
/security | Security audit | /security |
/perf | Performance analysis | /perf --file=api.ts |
π§Ή Maintenance Commandsβ
| Command | Description | Example |
|---|---|---|
/refactor | Refactor code | /refactor Extract common logic |
/cleanup | Clean up dead code | /cleanup |
/deps | Dependency management | /deps update |
π Documentation Commandsβ
| Command | Description | Example |
|---|---|---|
/doc | Generate documentation | /doc src/utils.ts |
/readme | Update README | /readme |
/changelog | Generate changelog | /changelog |
π§ͺ Testing Commandsβ
| Command | Description | Example |
|---|---|---|
/e2e | End-to-end testing | /e2e Test the login flow |
/test | Run tests | /test --coverage |
/snapshot | Snapshot testing | /snapshot update |
π§ Git Commandsβ
| Command | Description | Example |
|---|---|---|
/commit | Generate commit message | /commit |
/pr | Create PR description | /pr |
/branch | Branch management | /branch feature/auth |
Common Commands in Detailβ
/plan - Planning Commandβ
Best Practice: Always /plan before developing any complex feature
# Basic usage
/plan Add a user registration feature
# Specify tech stack
/plan Build an SSR blog system with Next.js
Output includes:
- β Requirements restatement
- β Risk assessment
- β Phased plan
- β Time estimates
/tdd - Test-Driven Developmentβ
TDD Cycle:
π΄ RED β Write a failing test
π’ GREEN β Write code to make it pass
π΅ REFACTOR β Refactor and optimize
# Start TDD
/tdd --feature="shopping-cart"
# Specify test framework
/tdd --framework=vitest
/e2e - End-to-End Testingβ
# Test a specific URL
/e2e --url=http://localhost:3000
# Test a specific flow
/e2e Test the shopping cart checkout flow
Combining Commandsβ
A typical development workflow:
# 1. Plan first
/plan Implement a comments feature
# 2. After confirmation, develop with TDD
/tdd --feature="comments"
# 3. Code review
/code-review
# 4. End-to-end testing
/e2e Test the comment posting flow
# 5. Commit code
/commit
Custom Commandsβ
You can create custom commands in the ~/.claude/commands/ directory:
---
description: My custom command
---
# My Custom Command
Define specific behavior here...
π‘ Tip: Type / and press Tab to see auto-completion for all available commands!