sonar-analyze
Skill by SonarSource
Analyzes a single file for quality and security issues using the SonarQube MCP Server and lists results by line number. Built for developers who want SonarQube checks inside their AI assistant session.
Install sonar-analyze
Built from the published package, never by AI.
git clone --depth 1 https://github.com/SonarSource/sonarqube-agent-plugins /tmp/sonarqube-agent-plugins && mkdir -p ~/.claude/skills && cp -r /tmp/sonarqube-agent-plugins/skills/sonar-analyze ~/.claude/skills/sonar-analyzeRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/SonarSource/sonarqube-agent-plugins /tmp/sonarqube-agent-plugins && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/sonarqube-agent-plugins/skills/sonar-analyze ~/.gemini/antigravity-cli/skills/sonar-analyzeAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
sonar-analyze is an agent skill from SonarSource that analyzes one file for quality and security issues using SonarQube. It takes a file path, or uses the file currently in context, reads the file, and works out whether it is test or main code. It then calls a SonarQube MCP Server analysis tool and reports the findings.
Results appear as a table sorted by line number, with severity, rule, and message. If issues are found, the skill suggests running the sonar-fix-issue skill on a specific rule and location. The skill needs the SonarQube MCP Server to be configured, and it points users to the sonar-integrate skill if the server is missing. It is aimed at developers who want SonarQube checks inside their AI assistant session.
Written from the project's SKILL.md and checked against it.
What it can do
- mcp__sonarqube__run_advanced_code_analysisRuns advanced analysis first when available, for entitled Cloud organizations.
- mcp__sonarqube__analyze_file_listAnalyzes a file through a running SonarQube for IDE instance bridged to the session.
- mcp__sonarqube__analyze_code_snippetAnalyzes file content when the other analysis tools are not available.
- Single file analysisAnalyzes one file at a time and asks for a file if none is clear.
- Results tableShows issues by line, severity, rule, and message, or reports that no issues were found.
- Next step suggestionsSuggests running sonar-fix-issue for a specific rule and file location.
What you need
- SonarQube MCP Server configured for the agent
- Container runtime: Docker, Podman, or Nerdctl
- sonar CLI installed and authenticated for the CLI fallback
- Vortex entitlement for the selected organization for advanced analysis
Try asking
- Analyze src/auth/login.py for quality and security issues.
- Run sonar-analyze on the file I have open in the editor.
- Check src/payments/charge.py with SonarQube and list issues by line.
Good to know
- Analyzes one file at a time and does not accept directories.
- Advanced analysis depends on Vortex entitlement for the selected organization.
- Needs a running container runtime for the SonarQube MCP Server.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/sonar-analyze/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
Allowed tools: ReadGlobBash(git branch:*)Bash(docker ps:*)Bash(podman ps:*)Bash(nerdctl ps:*)Bash(sonar:*)
Alternatives to sonar-analyze
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
sonar-analyze: common questions
Can sonar-analyze scan a whole folder?
No. The skill analyzes one file at a time and asks the user to specify a single file if a directory is given.
What happens if Vortex is not enabled for my organization?
The skill continues with local analysis fallbacks. The source says the MCP server can be restarted with SONARQUBE_FORCE_LOCAL_ANALYSIS=true and the analysis toolset enabled.
Why are the SonarQube analysis tools not available?
The source gives several causes, including the MCP server not being registered, the container runtime not running, or credentials not being configured.
How do I install sonar-analyze?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is sonar-analyze free?
The code is published under the NOASSERTION licence. The service it connects to may have its own pricing.
Is sonar-analyze safe to use?
It scores 65 of 100. Grades: maintenance A, licence F, quality B. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to sonar-analyze?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
