← SonarQubeCONTENT HISTORY

Update to SonarQube

Snapshot Sep 30, 2026 · 23:13 UTC · version 2.6.0

Collection source: not recorded for this historical snapshot.

WHAT CHANGED · RULE-BASED ANALYSIS

First saved snapshot

No earlier snapshot is available to establish a change.

Compare saved observations

Download comparison JSON
Full technical diff · 0 changed fields
Full snapshot data
{
  "name": "sonar-fix-issue",
  "description": "Fix a specific SonarQube issue in code by rule key and location",
  "included_files": [],
  "skill_md_contents": "---\nname: sonar-fix-issue\ndescription: Fix a specific SonarQube issue in code by rule key and location\nargument-hint: \"[rule-key] [file-path:line]\"\nallowed-tools: Read, Edit, Bash(sonar:*)\n---\n\n# SonarQube — Fix Issue\n\nFix a code quality or security issue identified by SonarQube.\n\n## Usage\n\n```\nsonar-fix-issue java:S1481 src/main/java/MyClass.java:42\nsonar-fix-issue python:S2077 src/auth/login.py\nsonar-fix-issue Remove unused variable in MyClass.java\n```\n\n## Instructions\n\n### Step 1: Identify the issue\n\nParse the user-provided arguments for:\n- A rule key (e.g. `java:S1481`, `python:S2077`)\n- A file path and optional line number (e.g. `src/auth/login.py:34`)\n- Or a plain-language description if no rule key is given\n\nIf neither a rule key nor a file path can be determined, ask: *\"Which rule and file should I fix?\"*\n\n### Step 2: Look up the rule (if a key was given)\n\nCall `mcp__sonarqube__show_rule` with the rule key to retrieve the full rule description,\nrationale, 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.\n\nIf the MCP tool is unavailable, fall back to `sonar api get \"/api/rules/show?key=<rule-key>\"`. If `sonar` is also unavailable or unauthenticated, rely on built-in knowledge of SonarQube rules.\n\n### Step 3: Read the file\n\nRead the full file content. If a line number was given, focus analysis around that line\nbut read the whole file to understand context.\n\n### Step 4: Apply the fix\n\n- Make the **minimal change** that resolves the rule violation\n- Do not refactor surrounding code or fix unrelated issues\n- Preserve existing behaviour — the fix must not change what the code does\n\n### Step 5: Explain the change\n\nAfter editing, briefly explain:\n- What the violation was\n- Why the rule flags it\n- What was changed and why it resolves the issue\n\n### Step 6: Suggest next steps\n\n- *\"Invoke the sonar-analyze skill with `<file>` to confirm no new issues were introduced.\"*\n- *\"Invoke the sonar-list-issues skill with the project key (or `sonar.projectKey` in `sonar-project.properties`) — the CLI always uses `-p`.\"*\n"
}

SHA-256: 3df544c1bfc9e84b8d05f026e9e166a9478ec3403ef532d7f150410f59bb0968