home / skills / codyswanngt / lisa / sonarqube-check

sonarqube-check skill

/.claude/skills/sonarqube-check

This skill analyzes the last PR against SonarQube quality gates and reports all failure details from the MCP server.

npx playbooks add skill codyswanngt/lisa --skill sonarqube-check

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
446 B
---
name: sonarqube-check
description: This skill should be used when checking why the last pull request failed SonarQube/SonarCloud quality gates. It uses the SonarQube MCP server to retrieve failure details and report the reasons.
allowed-tools: ["mcp__sonarqube__*"]
---

# SonarQube Check

Use the SonarQube MCP server to get the reason the last PR failed checks.

Retrieve the quality gate status and report all failures with their details.

Overview

This skill checks why the last pull request failed SonarQube or SonarCloud quality gates by querying the SonarQube MCP server and summarizing the failure reasons. It focuses on retrieving the quality gate status and enumerating every failing condition with details. Use it to quickly surface the exact rule violations or metric regressions that caused the gate to fail.

How this skill works

The skill authenticates to the SonarQube MCP server and retrieves the quality gate result for the target pull request analysis. It inspects the overall gate status and then collects each failing condition, including the metric key, expected threshold, actual value, and any related rule or message. The output is a concise report listing all failures so engineers can prioritize fixes or open follow-up issues.

When to use it

  • A pull request CI pipeline shows a SonarQube or SonarCloud quality gate failure and you need the root causes.
  • You want a compact, machine-readable summary of which quality gate conditions failed.
  • Triage session where developers need exact metric deltas or rule violations to guide fixes.
  • Automated bots or workflows that need to annotate PRs with SonarQube failure details.

Best practices

  • Provide the PR analysis ID or branch parameters so the skill targets the correct SonarQube report.
  • Ensure the MCP server credentials are scoped to read analysis and quality gate results only.
  • Run the skill after the Sonar scanner job completes but before stale reports are rotated.
  • Use the skill output to create actionable checklist items: metric, observed value, required threshold.

Example use cases

  • CI step that calls the skill to produce a comment on the PR summarizing Sonar failures.
  • Developer debugging why coverage dropped below the project threshold after a refactor.
  • Release readiness check that gates merging until all Sonar quality gate issues are resolved.
  • Automation that files tracking tickets for each unique failing Sonar rule detected.

FAQ

Which Sonar instances does this support?

It queries the SonarQube MCP server and works with SonarQube or SonarCloud endpoints exposed via that server.

What details does the report include?

The report includes overall gate status, each failing metric or rule, expected thresholds, actual values, and any associated messages.