sonar-quality-gate
SonarQube — Quality gate
Report only the quality gate evaluation for a SonarQube project: overall status, every condition returned by the API, and worst-offender breakdowns for failing conditions. Do not pull a broad measures dashboard here — for numeric metrics beyond the gate (coverage %, issue counts, ratings as measures, and so on), use mcp__sonarqube__get_component_measures afterward with the metricKeys you care about.
Usage
sonar-quality-gate # quality gate for the current project
sonar-quality-gate my-project # quality gate for a specific project key
sonar-quality-gate my-project --branch release/2.0
sonar-quality-gate my-project --pr 42
Prerequisites
This skill uses the sonarqube-cli command sonar quality-gate status (alias sonar qg status) as the primary path — don't invent other ones (e.g. sonar mcp call does not exist). Prefer it over the MCP tool: the CLI returns worst-offender breakdowns per failing condition in the same call — see Step 5 — while the MCP tool needs separate follow-up calls (measures, issues) for that detail.
Before proceeding, verify sonar is available on your PATH and authenticated. If it is not installed or not authenticated, the MCP fallback cannot help either — the SonarQube MCP Server is itself started via sonar run mcp and shares the CLI's stored credentials (true whenever it was set up through the sonar-integrate skill; doesn't apply if the sonarqube MCP server was configured independently, e.g. via a standalone Docker container with its own token) — so skip straight to the message below and recommend the sonar-integrate skill. Only when sonar works but quality-gate status itself is unavailable (unknown subcommand on an older CLI, or the command errors for another reason) fall back to the MCP tool mcp__sonarqube__get_project_quality_gate_status in Step 3.