Skip to main content

⚑ 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​

CommandDescriptionExample
/planCreate implementation plan/plan Add payment feature
/architectArchitecture design/architect Microservice split plan
/estimateEffort estimation/estimate Refactor auth module

πŸ§ͺ Development Commands​

CommandDescriptionExample
/tddTest-driven development/tdd --feature="login"
/build-and-fixFix build errors/build-and-fix
/debugDebug issues/debug TypeError: undefined

πŸ” Review Commands​

CommandDescriptionExample
/code-reviewCode review/code-review src/auth.ts
/securitySecurity audit/security
/perfPerformance analysis/perf --file=api.ts

🧹 Maintenance Commands​

CommandDescriptionExample
/refactorRefactor code/refactor Extract common logic
/cleanupClean up dead code/cleanup
/depsDependency management/deps update

πŸ“ Documentation Commands​

CommandDescriptionExample
/docGenerate documentation/doc src/utils.ts
/readmeUpdate README/readme
/changelogGenerate changelog/changelog

πŸ§ͺ Testing Commands​

CommandDescriptionExample
/e2eEnd-to-end testing/e2e Test the login flow
/testRun tests/test --coverage
/snapshotSnapshot testing/snapshot update

πŸ”§ Git Commands​

CommandDescriptionExample
/commitGenerate commit message/commit
/prCreate PR description/pr
/branchBranch 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!