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:
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:
Creates:
- src/components/UserProfile.tsx
- src/components/UserProfile.test.tsx
- src/components/UserProfile.stories.tsx
Express API:
Creates:
- src/api/users.controller.ts
- src/api/users.service.ts
- src/api/users.routes.ts
- tests/api/users.test.ts
Vue Component:
Microservice:
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
}
Workflow Commands¶
/review¶
Purpose: Automated code review with multi-dimensional quality checks
Category: workflow
Usage:
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):
Comprehensive Review:
Security Focus:
Pre-Commit Hook:
Auto-Fix Issues:
Generate Report:
Workflow:
- Scope Analysis
- Identify files to review
- Filter by patterns
-
Prioritize critical files
-
Quality Checks
- Code Quality: @config-safety-reviewer analyzes structure, patterns, maintainability
- Security: @security-auditor scans for OWASP Top 10
- Performance: @performance-tuner identifies bottlenecks
-
Configuration: Validates environment configs, checks risky changes
-
Issue Aggregation
- Categorize issues by severity
- Deduplicate findings
-
Prioritize action items
-
Report Generation
- Summary with metrics
- Detailed findings
- Fix recommendations
- 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
}
Testing Commands¶
/test-gen¶
Purpose: Intelligent test generation with multiple frameworks
Category: testing
Usage:
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:
High Coverage:
Integration Tests:
E2E Tests:
Python Tests:
Workflow:
- File Analysis
- Parse source code
- Identify functions/methods
- Detect dependencies
-
Analyze complexity
-
Test Strategy
- Determine test cases
- Identify edge cases
- Plan mocking strategy
-
Calculate coverage approach
-
Test Generation
- Generate test structure
- Create test cases
- Generate mocks/fixtures
-
Add assertions
-
Validation
- Syntax check
- Run tests (if --run)
- Calculate coverage
- 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
}
Documentation Commands¶
/docs-gen¶
Purpose: Automated documentation generation
Category: documentation
Usage:
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:
Generates OpenAPI 3.0 specification with: - Endpoint documentation - Request/response schemas - Authentication details - Code examples
Architecture Documentation:
Generates: - System architecture overview - Component diagrams - Data flow diagrams - Deployment topology
User Guide:
README:
Updates README.md with: - Project overview - Installation instructions - Usage examples - API reference - Contributing guide
Workflow:
- Source Analysis
- Parse source code
- Extract API endpoints
- Identify components
-
Map dependencies
-
Documentation Generation
- Generate documentation structure
- Create content sections
- Add code examples
-
Generate diagrams (Mermaid)
-
Output Formatting
- Format as specified (markdown, HTML, OpenAPI)
- Add navigation
- Include assets
-
Validate links
-
Validation
- Check completeness
- Verify examples
- Test links
- 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
}
Best Practices¶
1. Use Help Flag¶
Check command syntax and options:
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
Custom Command Development¶
See Also¶
- Getting Started → - Learn how commands work
- Configuration Guide → - Advanced configuration
- Skills Reference → - Automatic helpers
- Agents Reference → - Deep analysis agents
Last Updated: November 7, 2025 | Version: 2.0.0