with one click
code-analyzer
Analyzes code for quality and best practices
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Analyzes code for quality and best practices
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
| name | code-analyzer |
| version | 1.0.0 |
| description | Analyzes code for quality and best practices |
| author | Claude Team |
| tags | ["code","analysis","quality"] |
A comprehensive skill for analyzing code quality, detecting issues, and suggesting improvements.
This skill provides tools to analyze code files for:
When using this skill to analyze code:
Analyzes a single code file for quality and best practices.
async function analyze(
filePath: string,
language: string,
config?: AnalysisConfig
): Promise<AnalysisReport>
Parameters:
filePath: Path to the file to analyzelanguage: Programming language (javascript, typescript, python, java, etc.)config: Optional configuration for analysis rulesReturns:
AnalysisReport: Detailed analysis results with issues and suggestionsScans a directory for code files to analyze.
async function scan(
directory: string,
options?: ScanOptions
): Promise<string[]>
Parameters:
directory: Directory to scanoptions: Optional scan configuration (recursive, file patterns, etc.)Returns:
Generates a formatted report from analysis results.
async function report(
results: AnalysisReport[],
format: 'text' | 'json' | 'html'
): Promise<string>
Parameters:
results: Array of analysis reportsformat: Output format (text, json, or html)Returns:
The skill can be configured with custom rules and settings:
name: code-analyzer
config:
severity: warning # Minimum severity to report (info, warning, error)
rules:
no-console: warning
no-eval: error
no-var: warning
max-complexity: 10
max-lines: 500
excludePatterns:
- '**/*.test.ts'
- '**/*.spec.ts'
- '**/node_modules/**'
const result = await analyze('./src/main.ts', 'typescript');
console.log(await report([result], 'text'));
const files = await scan('./src', { recursive: true });
const results = await Promise.all(
files.map(file => analyze(file, detectLanguage(file)))
);
console.log(await report(results, 'html'));
const config = {
severity: 'error',
rules: {
maxComplexity: 5,
maxLines: 200,
},
};
const result = await analyze('./src/main.ts', 'typescript', config);
When using this skill:
Original skill from Claude Skills Library.