/sonarqube:sonarfrom sonarqube
Use this skill when the user mentions "sonar", "sonarqube", "code quality", "code smell", "quality gate", "new code issues", "fetch issues", "security hotspots", or wants to analyze code quality.
Ships in sonarqube. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Fetch and manage SonarQube issues, quality gates, and metrics using bash scripts.
Call bash scripts directly via the Bash tool. No MCP server required.
Scripts location: ~/.claude/plugins/cache/awesome-agent-toolkit/sonarqube/1.2.1/core/scripts/
IMPORTANT: Environment variables must be set. Check with:
echo $SONAR_HOST_URL $SONAR_TOKEN $SONAR_PROJECT_KEY
If empty, add them to ~/.claude/settings.json under env:
{
"env": {
"SONAR_HOST_URL": "https://sonarqube.example.com",
"SONAR_TOKEN": "sqa_xxxxxxxxxxxx",
"SONAR_PROJECT_KEY": "my-project-key"
}
}
Set PLUGIN_DIR=~/.claude/plugins/cache/awesome-agent-toolkit/sonarqube/1.2.1
# Fetch all open issues (HIGH, MEDIUM severity)
bash $PLUGIN_DIR/core/scripts/fetch-issues.sh --severity HIGH,MEDIUM
# Fetch only HIGH severity issues
bash $PLUGIN_DIR/core/scripts/fetch-issues.sh --severity HIGH
# Fetch issues from NEW CODE only (important for CI/CD)
bash $PLUGIN_DIR/core/scripts/fetch-issues.sh --severity HIGH --new-code
# Fetch issues for a specific file
bash $PLUGIN_DIR/core/scripts/fetch-issues.sh --file src/main/java/MyClass.java
bash $PLUGIN_DIR/core/scripts/quality-gate.sh
Returns: PASSED, FAILED, or ERROR with condition details.
bash $PLUGIN_DIR/core/scripts/metrics.sh
Returns: Coverage %, duplications, bugs, vulnerabilities, code smells count.
bash $PLUGIN_DIR/core/scripts/hotspots.sh
Returns: Security hotspots that need review.
bash $PLUGIN_DIR/core/scripts/rule-details.sh java:S2140
Explains what a specific rule means and how to fix it.
bash $PLUGIN_DIR/core/scripts/run-analysis.sh
Triggers a SonarQube scan on the current project.
When user asks about "new code issues" or "sonar issues from new code":
bash $PLUGIN_DIR/core/scripts/fetch-issues.sh --severity HIGH --new-codeWhen user asks about quality gate status:
bash $PLUGIN_DIR/core/scripts/quality-gate.shWhen user mentions security:
bash $PLUGIN_DIR/core/scripts/hotspots.shPresent issues as a table:
| # | File | Line | Rule | Message | Severity |
|---|---|---|---|---|---|
| 1 | File.java | 42 | java:S2140 | Use nextInt() | HIGH |
After listing, ask:
Ready to fix? Reply with task numbers (e.g., 1, 3, 5), all, or skip.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub covayurt/awesome-agent-toolkit --plugin sonarqubeOther plugins' skills for the same job