Skip to content
Back to skills

Sonar Status

ASecurity

Use when checking code quality health, quality gate status, or dashboard metrics for a project or PR. Also use when the user asks "did my PR pass?", "how's code quality?", or wants a quick health check. Triggers: "quality gate", "sonar status", "code quality", "dashboard metrics", "did my PR pass", "quality check", "sonar health".

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 26, 2026
developmentrailssecurity

Works with

  • mcp

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add denniscalazans/denniscalazans-plugins --skill sonar-status --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Sonar Status?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Sonar Status
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/denniscalazans-sonar-status/badge)](https://www.skillsdirectory.com/skills/denniscalazans-sonar-status)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: sonar-status
description: >
  Use when checking code quality health, quality gate status, or dashboard metrics for a project or PR.
  Also use when the user asks "did my PR pass?", "how's code quality?", or wants a quick health check.
  Triggers: "quality gate", "sonar status", "code quality", "dashboard metrics", "did my PR pass", "quality check", "sonar health".
---

# Sonar Status

Check quality gate and key metrics without opening the web UI.

**Announce at start:** "Checking code quality status."

## Process

### Step 1: Identify target

Determine the project key, branch, or PR number.
If the project key is not in context (e.g., from a `sonar-project.properties` file or previous conversation), ask the user.

Use `branch` for feature branches, `pullRequest` for PR numbers.
If neither is specified, default to the main branch.

### Step 2: Check quality gate

Call `get_project_quality_gate_status` with the appropriate target:

```
get_project_quality_gate_status { projectKey: "<your-project>", branch: "main" }
```

Or for a PR:

```
get_project_quality_gate_status { projectKey: "<your-project>", pullRequest: "123" }
```

The response includes `status` (OK or ERROR) and an array of `conditions` with their thresholds and actual values.

### Step 3: Fetch metrics

Call `get_component_measures` for the dashboard numbers:

```
get_component_measures {
  component: "<your-project>",
  metricKeys: ["coverage", "bugs", "vulnerabilities", "code_smells", "duplicated_lines_density", "ncloc", "security_hotspots"],
  branch: "main"
}
```

Pass `pullRequest` instead of `branch` for PR-specific metrics.

### Step 4: Present summary

Format the results as a readable table matching the web UI layout:

```
Quality Gate: ✅ OK (or ❌ FAILED)

| Metric              | Value  |
|---------------------|--------|
| Coverage            | 62.7%  |
| Bugs                | 0      |
| Vulnerabilities     | 0      |
| Code Smells         | 238    |
| Duplications        | 2.0%   |
| Security Hotspots   | 0      |
| Lines of Code       | 17,482 |
```

If any quality gate condition failed, highlight it and show the threshold vs actual value.

## Bug Guardrails

- **Use `get_component_measures` for accurate counts** — `search_sonar_issues_in_projects` severity counts may not match the dashboard due to Clean Code taxonomy double-counting.
  See `references/sonarqube-mcp-guide.md` for taxonomy details if the user asks about number discrepancies.

## Common Mistakes

| Don't | Do |
|-------|-----|
| Use `search_sonar_issues_in_projects` for issue counts | Use `get_component_measures` — always matches the web UI |
| Forget the `branch` or `pullRequest` param | Always specify the target — omitting it queries the default branch |
| Show raw JSON to the user | Format as a readable table matching the web UI layout |

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.