# sonar-fix-issue

> Claude/Codex skill by [@sonarsource](https://omgskills.com/library/sonarsource/index.md) · 113 stars · Updated 2026-10-22

Fix a specific SonarQube issue in code by rule key and location

Tags: agent, ai, sonarqube

## Install

```sh
git clone https://github.com/SonarSource/sonarqube-agent-plugins /tmp/sonarqube-agent-plugins && ln -s /tmp/sonarqube-agent-plugins/skills/sonar-fix-issue ~/.claude/skills/sonar-fix-issue
```

## From README

SonarQube — Fix Issue Fix a code quality or security issue identified by SonarQube. Instructions Step 1: Identify the issue Parse the user-provided arguments for: A rule key (e.g. java:S1481, python:S2077) A file path and optional line number (e.g. src/auth/login.py:34) Or a plain-language description if no rule key is given If neither a rule key nor a file path can be determined, ask: "Which rule and file should I fix?" Step 2: Look up the rule (if a key was given) Call mcpsonarqubeshowrule with the rule key to retrieve the full rule description, rationale, and remediation guidance before touching any code. Do not add extra parameters (such as projectKey) unless the tool schema requires them — after integration, rule lookup usually needs only the rule key. If the MCP tool is unavailable, fall back to sonar api get "/api/rules/show?key= ". If sonar is also unavailable or unauthenticated, rely on built-in knowledge of SonarQube rules. Step 3: Read the file Read the full file content.

## Links

- HTML page: https://omgskills.com/library/sonarsource/sonarqube-agent-plugins/skills/sonar-fix-issue/
- GitHub: https://github.com/SonarSource/sonarqube-agent-plugins
- Author: [@sonarsource](https://omgskills.com/library/sonarsource/index.md)

## More from this repo

- [sonar-analyze](https://omgskills.com/library/sonarsource/sonarqube-agent-plugins/skills/sonar-analyze/index.md) — Used to analyze a file for quality and security issues using SonarQube
   - [@sonarsource](https://omgskills.com/library/sonarsource/index.md) · 113 stars
- [sonar-coverage](https://omgskills.com/library/sonarsource/sonarqube-agent-plugins/skills/sonar-coverage/index.md) — Used to find files with low test coverage and inspect uncovered lines in a SonarQube project (project key optional when...
   - [@sonarsource](https://omgskills.com/library/sonarsource/index.md) · 113 stars
- [sonar-dependency-risks](https://omgskills.com/library/sonarsource/sonarqube-agent-plugins/skills/sonar-dependency-risks/index.md) — Used to search for software composition analysis (SCA) dependency risks in a SonarQube project (project key optional...
   - [@sonarsource](https://omgskills.com/library/sonarsource/index.md) · 113 stars
