project/.claude/skills/code-quality/SKILL.md
Run comprehensive code quality analysis: cyclomatic complexity, code smells, SOLID principle violations, dead code detection, duplication analysis, and maintainability scoring. Use when reviewing code quality, conducting code audits, checking technical debt, analyzing complexity metrics, or evaluating any file or directory for quality issues.
npx skillsauth add kcenon/claude-config code-qualityInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Analyze code quality and provide improvement suggestions.
/code-quality [FILE_PATH or DIRECTORY]
FILE_PATH or DIRECTORY: Target to analyze (required)
| Option | Default | Description | |--------|---------|-------------| | --depth | unlimited | Max directory depth for recursive analysis | | --format | markdown | Output format (markdown, json) | | --verbose | false | Include detailed metrics |
Perform comprehensive code quality analysis:
| Metric | OK | Warning | Critical | |--------|-----|---------|----------| | Cyclomatic Complexity | ≤10 | 11-20 | >20 | | Cognitive Complexity | ≤15 | 16-30 | >30 | | Function Length | ≤50 lines | 51-100 | >100 | | Nesting Depth | ≤4 | 5-6 | >6 | | File Length | ≤500 lines | 501-1000 | >1000 | | Test Coverage | ≥80% | 60-79% | <60% |
| Language | Complexity | Linting | Type Check | |----------|------------|---------|------------| | TypeScript | ts-complexity | ESLint | tsc --noEmit | | Python | radon cc | ruff, pylint | mypy | | C/C++ | lizard | clang-tidy | - | | Go | gocyclo | golangci-lint | go vet | | Rust | - | clippy | cargo check |
Score = 10 - (Critical x 2) - (Warning x 0.5)
Minimum score: 0
| Score Range | Rating | Interpretation | |-------------|--------|----------------| | 9-10 | Excellent | Production-ready, minimal issues | | 7-8 | Good | Minor improvements recommended | | 5-6 | Fair | Several issues need attention | | 3-4 | Poor | Significant refactoring required | | 0-2 | Critical | Major quality concerns |
| Level | Criteria | Examples | Required Action | |-------|----------|----------|-----------------| | Critical | Security risk, data loss, crashes | SQL injection, null pointer, auth bypass | Must fix before merge | | Major | Bugs, significant performance issues | Logic errors, N+1 queries, memory leaks | Should fix | | Minor | Style, minor optimization | Naming convention, redundant code | Nice to have | | Info | Suggestions, observations | Alternative approaches, documentation | Optional |
## Code Quality Report
### File: [FILE_PATH]
#### Metrics
| Metric | Value | Status |
|--------|-------|--------|
| Complexity | X | OK/HIGH |
| Lines of Code | X | OK/HIGH |
| Test Coverage | X% | OK/LOW |
#### Issues Found
1. [Issue description] - [Severity: Critical/Major/Minor/Info]
- Location: line X
- Suggestion: [How to fix]
#### Recommendations
- [Prioritized list of improvements]
#### Score: X/10
| Requirement | Error Message | Resolution | |-------------|---------------|------------| | File exists | "File not found: [path]" | Verify path and file existence | | Readable file | "Permission denied: [path]" | Check file permissions | | Supported file type | "Unsupported file type: [ext]" | Use supported extensions (.ts, .py, .kt, .cpp, etc.) |
| Error Condition | Behavior | User Action | |-----------------|----------|-------------| | Empty file | Report "No code to analyze" and skip | Add code to file or remove from analysis | | Binary file | Report "Cannot analyze binary file" and skip | Exclude binary files from target | | Encoding error | Report "Unable to read file encoding" | Convert file to UTF-8 | | Directory not found | Report error with suggested similar paths | Verify directory path | | Unsupported language | Report "Language not supported: [lang]" and list similar files | Target supported file types | | Analysis timeout | Report partial results with warning | Reduce scope or split analysis |
testing
Comprehensive security audit covering OWASP Top 10, input validation, authentication, authorization, secret management, dependency vulnerabilities, and injection attack prevention. Use when reviewing security posture, implementing auth flows, handling user input, auditing dependencies, conducting penetration test prep, or before production deployment.
development
Provides workflow guidelines for problem-solving, git commits, GitHub issues, PRs, build management, and testing. Use when planning tasks, creating issues, submitting PRs, managing builds, or writing tests.
development
Review pull requests with comprehensive analysis covering code quality, security vulnerabilities, performance implications, test coverage, documentation completeness, and architectural impact. Use when reviewing PRs, conducting code reviews, evaluating merge readiness, or assessing change impact across the codebase.
development
Performance optimization analysis: CPU/memory profiling, caching strategies, database query optimization, connection pooling, concurrency patterns, memory leak detection, and throughput improvement. Use when code is slow, memory usage is high, latency needs reduction, or conducting performance reviews before release.