home / skills / bitsoex / bitso-java / fix-sonarqube

fix-sonarqube skill

/.claude/skills/fix-sonarqube

This skill helps you identify, analyze, and fix SonarQube issues remotely via MCP, improving Java code quality and gate compliance.

npx playbooks add skill bitsoex/bitso-java --skill fix-sonarqube

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

Files (5)
SKILL.md
3.9 KB
---
name: fix-sonarqube
description: >
  SonarQube integration via MCP for Java projects. The MCP server runs remotely
  and requires no local setup. Use natural language to query issues, analyze code,
  and check quality gates.
compatibility: All Java projects with SonarQube analysis
metadata:
  version: "2.0.0"
  technology: java
  category: quality
  tags:
    - java
    - sonarqube
    - mcp
    - code-quality
---

# Fix SonarQube

SonarQube integration via MCP (Model Context Protocol) for Java code quality analysis.

## When to use this skill

- Finding and fixing SonarQube issues
- Checking quality gate status
- Analyzing code for quality issues
- Understanding SonarQube rules
- Prioritizing issue remediation
- When asked to "fix sonarqube issues" or "add sonarqube mcp"

## Skill Contents

### Sections

- [When to use this skill](#when-to-use-this-skill) (L23-L31)
- [Quick Start](#quick-start) (L55-L67)
- [MCP Tools Available](#mcp-tools-available) (L68-L78)
- [Common Workflows](#common-workflows) (L79-L102)
- [Supported IDEs](#supported-ides) (L103-L116)
- [References](#references) (L117-L123)
- [Related Rules](#related-rules) (L124-L129)
- [Related Skills](#related-skills) (L130-L135)

### Available Resources

**📚 references/** - Detailed documentation
- [common rules](references/common-rules.md)
- [copilot cli setup](references/copilot-cli-setup.md)
- [intellij setup](references/intellij-setup.md)
- [mcp tools](references/mcp-tools.md)

---

## Quick Start

The SonarQube MCP server runs remotely at `https://sonarqube-mcp.bitso.io/mcp` and is automatically configured in all supported IDEs.

**No setup required** - just use natural language:

```text
"Find HIGH severity issues in my-project"
"Show me details about rule java:S1128"
"What's the quality gate status for my-service?"
"Analyze this code for SonarQube issues"
```

## MCP Tools Available

| Tool | Purpose |
|------|---------|
| `list_projects` | List all SonarQube projects |
| `get_issues` | Get issues for a project |
| `get_issue_details` | Get details for a specific issue |
| `get_rule` | Get rule documentation |
| `get_quality_gate` | Check quality gate status |
| `analyze_code` | Analyze code snippet |

## Common Workflows

### 1. Fix Issues by Severity

```text
"Find all BLOCKER issues in payment-service"
"Get details for issue AYx123..."
"Show me the rule java:S2259"
```

### 2. Check Quality Gate

```text
"What's the quality gate status for my-service?"
"List all projects I have access to"
```

### 3. Understand Rules

```text
"Explain rule java:S1128 (unused imports)"
"What are the CRITICAL rules for Java?"
```

## Supported IDEs

The MCP is automatically available in:

| IDE | Configuration |
|-----|---------------|
| **Cursor** | `.cursor/mcp.json` |
| **VS Code + Copilot** | `.vscode/mcp.json` |
| **Claude Code** | `.mcp.json` |
| **IntelliJ IDEA** | See manual setup |
| **Copilot CLI** | See manual setup |

For IntelliJ and Copilot CLI, see: `java/commands/add-sonarqube-mcp-to-intellij-and-copilot-cli.md`

## References

| Reference | Description |
|-----------|-------------|
| [references/mcp-tools.md](references/mcp-tools.md) | Full MCP tool reference |
| [references/common-rules.md](references/common-rules.md) | Common Java rules |

## Related Rules

- [java-sonarqube-setup](.cursor/rules/java-sonarqube-setup/java-sonarqube-setup.mdc) - Setup guide
- [java-sonarqube-mcp](.cursor/rules/java-sonarqube-mcp/java-sonarqube-mcp.mdc) - MCP tool reference
- [fix-sonarqube-issues](.cursor/commands/fix-sonarqube-issues.md) - Fix command

## Related Skills

| Skill | Purpose |
|-------|---------|
| [java-coverage](.claude/skills/java-coverage/SKILL.md) | JaCoCo coverage for SonarQube |
| [gradle-standards](.claude/skills/gradle-standards/SKILL.md) | SonarQube Gradle plugin |
<!-- AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY -->
<!-- Source: bitsoex/ai-code-instructions → java/skills/fix-sonarqube/SKILL.md -->
<!-- To modify, edit the source file and run the distribution workflow -->

Overview

This skill integrates SonarQube via a remote MCP (Model Context Protocol) server to inspect and fix Java code quality issues. It requires no local setup—use natural language to query issues, analyze code snippets, and check quality gates. The MCP server is preconfigured for supported IDEs and exposes tools for common SonarQube workflows.

How this skill works

The skill queries a remote SonarQube MCP endpoint to list projects, fetch issues, retrieve rule documentation, and evaluate quality gates. You can send plain-language requests like finding high-severity issues, asking for rule explanations, or submitting code snippets for analysis. Results include issue lists, rule details, remediation guidance, and quality gate status.

When to use it

  • When you need to find and fix SonarQube issues in Java projects
  • To check quality gate status for a service or project
  • When prioritizing remediation by severity or rule
  • To get explanations for specific SonarQube rules
  • When you want to analyze code snippets for SonarQube violations

Best practices

  • Ask for issues scoped by project and severity (e.g., BLOCKER, CRITICAL) to focus remediation
  • Request rule details before changing code to ensure fixes align with rule intent
  • Use code snippet analysis for narrow, incremental fixes rather than whole-repo rewrites
  • Check quality gate status after fixes to validate improvements
  • Integrate queries into your IDE using the provided MCP configuration for faster feedback

Example use cases

  • Find all BLOCKER issues in payment-service and list remediation steps
  • Show rule java:S1128 (unused imports) and examples of compliant code
  • Check the quality gate status for my-service before a release
  • Analyze a code snippet and return SonarQube issues with suggested fixes
  • List projects I have access to and summarize open CRITICAL issues

FAQ

Do I need to install SonarQube locally to use this skill?

No. The MCP server runs remotely and is preconfigured for supported IDEs, so no local SonarQube setup is required.

Which IDEs are supported out of the box?

Cursor, VS Code with Copilot, and Claude Code have automatic MCP configs. IntelliJ and Copilot CLI require a one-time manual setup described by the skill.