How this command is triggered — by the user, by Claude, or both
Slash command
/code-standards:check [file-or-directory]This command is limited to the following tools:
The summary Claude sees in its command listing — used to decide when to auto-load this command
# Code Standards Check Analyze $ARGUMENTS against code standards thresholds. If no argument provided, analyze the current directory. ## Analysis Process ### Step 1: Load Settings Read `.claude/code-standards.local.md` if it exists to get configured thresholds. If not found, use default thresholds: - File LOC: 400 (warning), 800 (critical) - Function LOC: 50 (warning), 80 (critical) - Complexity: 15 (warning), 20 (critical) ### Step 2: Validate Target Path If $ARGUMENTS is provided, verify the path exists: **If path does not exist:** **If path exists but no source files found in di...
Analyze $ARGUMENTS against code standards thresholds.
If no argument provided, analyze the current directory.
Read .claude/code-standards.local.md if it exists to get configured thresholds.
If not found, use default thresholds:
If $ARGUMENTS is provided, verify the path exists:
If path does not exist:
Error: Path not found: `[path]`
Please verify the path exists. Use `/code-standards:check .` to analyze current directory.
If path exists but no source files found in directory:
No analyzable source files found in `[path]`
Supported: *.ts, *.tsx, *.js, *.jsx, *.py, *.go, *.java, *.rb
Excluded: node_modules, vendor, .git, dist, build
If $ARGUMENTS is a single file, analyze that file. If $ARGUMENTS is a directory, find all source files:
*.ts, *.tsx, *.js, *.jsx*.py*.go*.java*.rb*.rs*.php*.swift*.kt*.csExclude common directories: node_modules, vendor, .git, dist, build, __pycache__
For each file:
if, else, elif, else if statementsfor, while, loop iterationscase, when, switch branches&&, || logical operatorscatch, except, rescue exception handlers? :Output a structured markdown table:
## Code Standards Report
**Target:** $ARGUMENTS
**Files analyzed:** [count]
**Violations found:** [count]
### Violations
| File | Issue | Severity | Line | Suggestion |
|------|-------|----------|------|------------|
| `src/service.ts` | File exceeds 600 LOC (742) | Warning | - | Split by domain responsibility |
| `src/service.ts:45` | Function `processOrder` exceeds 80 LOC (112) | Critical | 45-157 | Extract helper functions |
| `src/utils.ts:89` | Complexity >15 in `handleRequest` (18) | Warning | 89 | Simplify conditionals or extract |
### Summary
- **Critical:** [count] issues (must fix)
- **Warning:** [count] issues (should address)
- **Info:** [count] notes (consider)
### Recommendations
[Based on violations, provide 2-3 specific refactoring suggestions]
Critical (must fix):
Warning (should address):
Info (consider):
## Code Standards Report
**Target:** src/
**Files analyzed:** 12
**Violations found:** 5
### Violations
| File | Issue | Severity | Line | Suggestion |
|------|-------|----------|------|------------|
| `src/api/users.ts` | File exceeds 400 LOC (523) | Warning | - | Split user CRUD from user validation |
| `src/api/users.ts:156` | `createUser` exceeds 50 LOC (78) | Warning | 156-234 | Extract validation and notification logic |
| `src/services/order.ts` | File exceeds 800 LOC (912) | Critical | - | Split by order lifecycle stages |
| `src/services/order.ts:234` | `processPayment` complexity 22 | Critical | 234 | Use strategy pattern for payment methods |
| `src/utils/helpers.ts:45` | `formatData` exceeds 50 LOC (62) | Warning | 45-107 | Split by data type |
### Summary
- **Critical:** 2 issues (must fix)
- **Warning:** 3 issues (should address)
- **Info:** 0 notes
### Recommendations
1. **Split `order.ts`** into `order-creation.ts`, `order-processing.ts`, and `order-fulfillment.ts`
2. **Refactor `processPayment`** using strategy pattern - each payment method as separate handler
3. **Extract validation** from `createUser` into `user-validation.ts`
npx claudepluginhub hculap/better-code --plugin code-standards/analyze-complexityCalculates cyclomatic and cognitive complexity across source files, ranks top complex functions and files, benchmarks against standards, and suggests refactoring strategies.
/code_analysisAnalyzes code in specified file or directory for complexity, code smells, security, performance issues, and best practices; generates report with health score, prioritized fixes, and todos.
/complexityAnalyzes code complexity using cyclomatic, cognitive, and maintainability metrics. Identifies functions/classes needing refactoring and generates a summary report.
/analyzeAnalyzes project code across quality, security, performance, and architecture domains, producing severity-rated findings, actionable recommendations, metrics, and reports.
/staticRuns 40+ linters across detected languages in target path or current directory with intelligent deduplication and unified reporting. Supports --quick and --security options.
/checkRuns project validation checks like lint/test across JavaScript/TypeScript, Python, Go, Rust, Ruby and auto-fixes errors without committing changes.