From code-quality
Use when the user wants to fix a SonarQube issue, resolve a code smell, or address a flagged violation. Also use when the user says "fix this issue", "resolve the ternary", or "clean up sonar findings". Triggers: "fix sonar", "fix issue", "resolve code smell", "fix violation", "sonar fix", "clean up issue", "address finding". Not for: triaging false positives (use sonar-triage), browsing issues without fixing (use sonar-issues).
How this skill is triggered — by the user, by Claude, or both
Slash command
/code-quality:sonar-fixThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Guided workflow to fix a SonarQube issue — understand the rule, see the code, edit, verify locally.
Guided workflow to fix a SonarQube issue — understand the rule, see the code, edit, verify locally.
Announce at start: "Starting SonarQube fix workflow."
Get the issue from context:
sonar-issues output (has rule, file, line, message)search_sonar_issues_in_projectsAlso check whether analyze_file_list is available (IDE-connected mode).
If not, inform the user upfront: "Fixes will be applied but can only be verified after pushing — local verification requires IDE-connected mode."
Call show_rule to get the full explanation with compliant/noncompliant examples:
show_rule { key: "<rule-key>" }
Present the key insight: what's wrong and what compliant code looks like. This step is essential — never fix blindly without understanding the rule.
Read the flagged file at the issue's line range.
Convert the component field to a relative path:
component.split(':')[1] → relative path
Show the relevant code context (±10 lines around the flagged line).
Edit the code following the compliant pattern from the rule. Keep changes minimal — fix only what the rule requires. Do not refactor surrounding code or make unrelated improvements.
If IDE-connected mode is available (analyze_file_list):
analyze_file_list { file_absolute_paths: ["/absolute/path/to/fixed-file.ts"] }
Check two things:
If IDE mode is unavailable, skip verification and tell the user: "Fix applied. Push to trigger server-side validation."
Show what changed:
If the user is fixing multiple issues in a batch, suggest running sonar-verify afterwards for a comprehensive RED/GREEN cross-reference.
analyze_file_list returns only 4 fields (no rule key).
Match by file + line(±5) + message text.references/sonarqube-mcp-tools.md for the full matching algorithm.| Don't | Do |
|---|---|
| Fix without understanding the rule first | Call show_rule before editing — understand the compliant pattern |
| Make unnecessary changes beyond the flagged issue | Keep edits minimal — fix only what the rule requires |
Assume analyze_file_list returns rule keys | Match by file + line(±5) + message text |
| Skip verification when IDE mode is available | Always verify locally if analyze_file_list is available |
| Fix and forget | Report verification results — confirmed resolved or pending server check |
npx claudepluginhub denniscalazans/denniscalazans-plugins --plugin code-qualityFixes a specific SonarQube code quality or security issue by rule key and file location. Reads rule guidance, applies minimal code change, and explains the remediation.
Integrates SonarQube/SonarCloud via MCP server for quality gate checks, issue discovery/triaging, pre-push code analysis, and rule explanations in agent workflows. Use for gate status, finding issues, snippet analysis before commits, or rule details.