// Comprehensive code analysis, quality assessment, and issue diagnosis. Use when analyzing code quality, security vulnerabilities, performance bottlenecks, architecture reviews, or troubleshooting bugs and build failures.
| name | sc-analyze |
| description | Comprehensive code analysis, quality assessment, and issue diagnosis. Use when analyzing code quality, security vulnerabilities, performance bottlenecks, architecture reviews, or troubleshooting bugs and build failures. |
Multi-domain code analysis with issue diagnosis and resolution capabilities.
# Quality analysis
/sc:analyze [target] --focus quality|security|performance|architecture
# Troubleshooting mode
/sc:analyze [issue] --troubleshoot --focus bug|build|performance|deployment
# With auto-fix
/sc:analyze "TypeScript errors" --troubleshoot --focus build --fix
| Flag | Type | Default | Description |
|---|---|---|---|
--focus | string | quality | quality, security, performance, architecture, bug, build, deployment |
--troubleshoot | bool | false | Enable issue diagnosis mode |
--trace | bool | false | Detailed trace analysis for debugging |
--fix | bool | false | Auto-apply safe fixes |
--depth | string | standard | quick, standard, deep |
--format | string | text | text, json, report |
When --troubleshoot is enabled:
| Focus | Behavior |
|---|---|
| bug | Error analysis, stack traces, code inspection |
| build | Build logs, dependencies, config validation |
| performance | Metrics analysis, bottleneck identification |
| deployment | Environment analysis, service validation |
/sc:analyze src/auth --focus security --depth deep
/sc:analyze "compilation errors" --troubleshoot --focus build --fix
/sc:analyze "slow API response" --troubleshoot --focus performance --trace