Code Analyzer
The Code Analyzer skill swiftly identifies potential bugs, vulnerabilities, and style issues in your code, boosting development efficiency and code quality.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add code-analyzer npx -- -y @trustedskills/code-analyzer
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"code-analyzer": {
"command": "npx",
"args": [
"-y",
"@trustedskills/code-analyzer"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
The Code Analyzer skill performs static code analysis and calculates various metrics to identify potential bugs, vulnerabilities, and style issues within your codebase. It leverages a tool called analyzer.mjs which runs automatically from the project root. The goal is to improve development efficiency and overall code quality by highlighting areas needing attention.
When to use it
- Before refactoring: Analyze code before making significant changes to understand its structure and potential impact.
- During code review: Identify complex or problematic sections for reviewers to focus on.
- As part of a CI/CD pipeline: Integrate the analyzer into your automated build process to catch issues early (using
project-analyzer/doctorfor health checks). - To track code quality trends: Monitor metrics over time to identify areas where code is degrading or improving.
Key capabilities
- Project-wide analysis: Analyzes the entire project codebase.
- File-specific analysis: Allows analyzing a single file.
- Complexity calculation: Calculates cyclomatic complexity, lines of code (LOC), maintainability index, and identifies duplicate blocks.
- Hotspot identification: Pinpoints areas with high complexity for focused review.
- Trend analysis: Tracks metric trends over time to monitor code quality changes.
- Integration with other agents: Works well with
code-reviewer,refactoring-specialist, andarchitectAI agent roles.
Example prompts
- "Analyze the entire project for complexity hotspots."
- "Can you summarize the analysis of this file?" (followed by providing a filename)
- "Show me the trends in cyclomatic complexity over the last week."
Tips & gotchas
- Node.js Requirement: Ensure Node.js version 18 or higher is installed before using the skill.
- Start Broad, Then Focus: Always run project-wide analysis before drilling down into individual files for best results.
- Prioritize Churn: When identifying hotspots, prioritize files with both high complexity and frequent changes (high churn).
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.