Skip to content

Commands Reference

Complete reference for all Claude Code Tresor commands.

Overview

Commands are workflow automation tools that orchestrate multi-step processes, coordinate agents, and streamline common development tasks.

Key Characteristics: - ✅ Manual invocation - Use /command-name syntax - ✅ Multi-step workflows - Coordinate multiple operations - ✅ Agent orchestration - Invoke multiple agents - ✅ Parameter support - Flexible options and flags


Command Configuration Specification

command.json Schema

{
  "name": "command-name",
  "description": "Command purpose",
  "category": "workflow",
  "usage": "/command-name --param1 <value>",
  "parameters": {
    "param1": {
      "type": "string",
      "description": "Parameter description",
      "required": true
    }
  },
  "agents": ["@agent1", "@agent2"],
  "enabled": true,
  "timeout": 300
}

Field Reference

name (required)

Type: String Format: lowercase-with-dashes Example: "review"

Command name used with /command-name invocation.


description (required)

Type: String Example: "Automated code review with quality checks"

Human-readable command purpose.


category (required)

Type: String Allowed values: - "development" - Development workflows - "workflow" - General workflows - "testing" - Testing workflows - "documentation" - Documentation workflows


usage (required)

Type: String Example: "/review --scope <files> --checks <types>"

Command usage syntax shown in help.


parameters (optional)

Type: Object Structure:

"parameters": {
  "param_name": {
    "type": "string|array|boolean|number",
    "description": "Parameter description",
    "required": true|false,
    "default": "default_value"
  }
}


agents (optional)

Type: Array of strings Example: ["@config-safety-reviewer", "@security-auditor"]

Agents invoked by this command.


enabled (optional)

Type: Boolean Default: true


timeout (optional)

Type: Number (seconds) Default: 300 (5 minutes)

Maximum execution time before timeout.


Development Commands

/scaffold

Purpose: Project and component scaffolding

Category: development

Usage:

/scaffold <type> <name> [options]

Parameters:

Parameter Type Required Description
type string Yes Component type (react-component, express-api, etc.)
name string Yes Component name
--typescript boolean No Use TypeScript (default: true)
--tests boolean No Generate tests (default: true)
--storybook boolean No Generate Storybook story (default: false)
--path string No Custom output path

Examples:

React Component:

/scaffold react-component UserProfile --typescript --tests --storybook

Creates: - src/components/UserProfile.tsx - src/components/UserProfile.test.tsx - src/components/UserProfile.stories.tsx

Express API:

/scaffold express-api user-service --auth --database postgres --tests

Creates: - src/api/users.controller.ts - src/api/users.service.ts - src/api/users.routes.ts - tests/api/users.test.ts

Vue Component:

/scaffold vue-component ProductCard --composition-api --tests

Microservice:

/scaffold microservice payment-service --language typescript --database mongodb

Supported Types: - react-component - React component with hooks - vue-component - Vue 3 component - angular-component - Angular component - express-api - Express REST API - nestjs-api - NestJS REST API - graphql-api - GraphQL API - microservice - Complete microservice - lambda-function - AWS Lambda function - database-model - Database model/schema

Configuration:

{
  "name": "scaffold",
  "description": "Project and component scaffolding",
  "category": "development",
  "usage": "/scaffold <type> <name> [options]",
  "parameters": {
    "type": {
      "type": "string",
      "required": true,
      "description": "Component type"
    },
    "name": {
      "type": "string",
      "required": true,
      "description": "Component name"
    },
    "typescript": {
      "type": "boolean",
      "required": false,
      "default": true
    },
    "tests": {
      "type": "boolean",
      "required": false,
      "default": true
    }
  },
  "enabled": true
}

Full Documentation →


Workflow Commands

/review

Purpose: Automated code review with multi-dimensional quality checks

Category: workflow

Usage:

/review [options]

Parameters:

Parameter Type Required Description
--scope string No Files to review (staged, all, or path) (default: staged)
--checks array No Check types (security, performance, quality, configuration, all)
--format string No Output format (markdown, json, html) (default: markdown)
--output string No Output file path
--fix boolean No Auto-fix issues (default: false)
--pre-commit boolean No Run as pre-commit hook

Examples:

Basic Review (Staged Files):

/review

Comprehensive Review:

/review --scope all --checks all

Security Focus:

/review --scope src/api/ --checks security,configuration

Pre-Commit Hook:

/review --pre-commit --checks security,quality

Auto-Fix Issues:

/review --scope staged --fix

Generate Report:

/review --scope all --format html --output ./reports/review.html

Workflow:

  1. Scope Analysis
  2. Identify files to review
  3. Filter by patterns
  4. Prioritize critical files

  5. Quality Checks

  6. Code Quality: @config-safety-reviewer analyzes structure, patterns, maintainability
  7. Security: @security-auditor scans for OWASP Top 10
  8. Performance: @performance-tuner identifies bottlenecks
  9. Configuration: Validates environment configs, checks risky changes

  10. Issue Aggregation

  11. Categorize issues by severity
  12. Deduplicate findings
  13. Prioritize action items

  14. Report Generation

  15. Summary with metrics
  16. Detailed findings
  17. Fix recommendations
  18. Code examples

Output Example:

Code Review Report
==================

Scope: 12 files (staged)
Duration: 45 seconds

Summary:
✅ Code Quality: PASS (2 warnings)
🔴 Security: FAIL (1 critical issue)
⚠️ Performance: WARNING (3 issues)
✅ Configuration: PASS

Critical Issues:
1. SQL Injection Vulnerability
   File: src/api/users.controller.ts:45
   Severity: Critical
   Description: User input not sanitized in raw SQL query
   Fix: Use parameterized queries

[Detailed report continues...]

Agents Used: - @config-safety-reviewer - Code quality analysis - @security-auditor - Security vulnerability scanning - @performance-tuner - Performance analysis

Configuration:

{
  "name": "review",
  "description": "Automated code review with quality checks",
  "category": "workflow",
  "usage": "/review [options]",
  "parameters": {
    "scope": {
      "type": "string",
      "required": false,
      "default": "staged",
      "description": "Files to review"
    },
    "checks": {
      "type": "array",
      "required": false,
      "default": ["all"],
      "description": "Check types"
    },
    "fix": {
      "type": "boolean",
      "required": false,
      "default": false
    }
  },
  "agents": [
    "@config-safety-reviewer",
    "@security-auditor",
    "@performance-tuner"
  ],
  "enabled": true,
  "timeout": 600
}

Full Documentation →


Testing Commands

/test-gen

Purpose: Intelligent test generation with multiple frameworks

Category: testing

Usage:

/test-gen [options]

Parameters:

Parameter Type Required Description
--file string Yes File to generate tests for
--framework string No Test framework (jest, vitest, mocha, pytest)
--coverage number No Target coverage percentage (default: 80)
--type string No Test type (unit, integration, e2e, all)
--mocks boolean No Generate mocks (default: true)
--run boolean No Run tests after generation (default: false)

Examples:

Basic Test Generation:

/test-gen --file src/utils/validation.ts

High Coverage:

/test-gen --file src/services/payment.service.ts --coverage 95 --mocks

Integration Tests:

/test-gen --file src/api/users.controller.ts --type integration --framework jest

E2E Tests:

/test-gen --file src/pages/Login.tsx --type e2e --framework playwright

Python Tests:

/test-gen --file src/models/user.py --framework pytest --coverage 90

Workflow:

  1. File Analysis
  2. Parse source code
  3. Identify functions/methods
  4. Detect dependencies
  5. Analyze complexity

  6. Test Strategy

  7. Determine test cases
  8. Identify edge cases
  9. Plan mocking strategy
  10. Calculate coverage approach

  11. Test Generation

  12. Generate test structure
  13. Create test cases
  14. Generate mocks/fixtures
  15. Add assertions

  16. Validation

  17. Syntax check
  18. Run tests (if --run)
  19. Calculate coverage
  20. Report results

Output Example:

Test Generation: src/services/auth.service.ts
=============================================

Generated: src/services/auth.service.test.ts

Test Cases: 15
- 8 happy path tests
- 5 error condition tests
- 2 edge case tests

Coverage: 92% (target: 80%)

Tests Generated:
✅ login() with valid credentials
✅ login() with invalid credentials
✅ login() with missing parameters
✅ register() with unique email
✅ register() with duplicate email
✅ validateToken() with valid token
✅ validateToken() with expired token
[...]

Run tests: npm test auth.service.test.ts

Supported Frameworks: - JavaScript/TypeScript: Jest, Vitest, Mocha, Jasmine - Python: pytest, unittest - Java: JUnit, TestNG - E2E: Playwright, Cypress, Selenium

Agents Used: - @test-engineer - Test strategy and generation

Configuration:

{
  "name": "test-gen",
  "description": "Intelligent test generation",
  "category": "testing",
  "usage": "/test-gen --file <file> [options]",
  "parameters": {
    "file": {
      "type": "string",
      "required": true,
      "description": "File to generate tests for"
    },
    "framework": {
      "type": "string",
      "required": false,
      "description": "Test framework"
    },
    "coverage": {
      "type": "number",
      "required": false,
      "default": 80
    }
  },
  "agents": ["@test-engineer"],
  "enabled": true,
  "timeout": 300
}

Full Documentation →


Documentation Commands

/docs-gen

Purpose: Automated documentation generation

Category: documentation

Usage:

/docs-gen <type> [options]

Parameters:

Parameter Type Required Description
type string Yes Doc type (api, architecture, user-guide, readme)
--format string No Output format (markdown, openapi, html)
--path string No Source code path (default: src/)
--output string No Output path (default: docs/)
--include-examples boolean No Include code examples (default: true)
--include-diagrams boolean No Generate diagrams (default: true)

Examples:

API Documentation:

/docs-gen api --format openapi --include-examples

Generates OpenAPI 3.0 specification with: - Endpoint documentation - Request/response schemas - Authentication details - Code examples

Architecture Documentation:

/docs-gen architecture --include-diagrams

Generates: - System architecture overview - Component diagrams - Data flow diagrams - Deployment topology

User Guide:

/docs-gen user-guide --format html --output ./docs/user-guide.html

README:

/docs-gen readme --include-examples

Updates README.md with: - Project overview - Installation instructions - Usage examples - API reference - Contributing guide

Workflow:

  1. Source Analysis
  2. Parse source code
  3. Extract API endpoints
  4. Identify components
  5. Map dependencies

  6. Documentation Generation

  7. Generate documentation structure
  8. Create content sections
  9. Add code examples
  10. Generate diagrams (Mermaid)

  11. Output Formatting

  12. Format as specified (markdown, HTML, OpenAPI)
  13. Add navigation
  14. Include assets
  15. Validate links

  16. Validation

  17. Check completeness
  18. Verify examples
  19. Test links
  20. Generate report

Agents Used: - @docs-writer - Documentation generation - @systems-architect - Architecture diagrams (if needed)

Configuration:

{
  "name": "docs-gen",
  "description": "Automated documentation generation",
  "category": "documentation",
  "usage": "/docs-gen <type> [options]",
  "parameters": {
    "type": {
      "type": "string",
      "required": true,
      "description": "Documentation type"
    },
    "format": {
      "type": "string",
      "required": false,
      "description": "Output format"
    },
    "include-examples": {
      "type": "boolean",
      "required": false,
      "default": true
    }
  },
  "agents": ["@docs-writer", "@systems-architect"],
  "enabled": true,
  "timeout": 300
}

Full Documentation →


Best Practices

1. Use Help Flag

Check command syntax and options:

/scaffold --help
/review --help
/test-gen --help


2. Start with Defaults

Commands have sensible defaults:

# Default review (staged files, all checks)
/review

# Explicit (same result)
/review --scope staged --checks all


3. Combine with Agents

Commands orchestrate, agents analyze:

# Command for workflow
/review --scope src/api/

# Then agent for deep dive
@security-auditor detailed analysis of src/api/auth.controller.ts


4. Use Scoped Reviews

Review specific areas instead of entire codebase:

# Fast, focused
/review --scope src/api/payment.controller.ts --checks security

# Slow, comprehensive
/review --scope all --checks all


Troubleshooting

Command Not Found

# Check command exists
ls ~/.claude/commands/review/

# Verify configuration
cat ~/.claude/commands/review/command.json

# Try full path
/workflow/review

Complete troubleshooting →


Custom Command Development

Contributing Guide →


See Also


Last Updated: November 7, 2025 | Version: 2.0.0