agentleFS
rmichakrmichak/claude-skills/sonarqube-triage/SKILL.md

sonarqube-triage

Skill1 starsChanged 11 days agoMITView on GitHub

Use when the user shares a SonarQube finding, screenshot, or asks to fix a SonarQube issue. Triggers on "SonarQube", "sonar", "code smell", "finding", "blocker", "vulnerability", or screenshots showing SonarQube UI. Evaluates findings before making changes.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do you agree this is a real issue?: Consider:

    line 44
  2. Distinctive:

    Always respond with a verdict before proposing changes:

    line 55
  3. Distinctive:

    If you catch yourself doing any of these, stop and recommend dismissing the finding instead.

    line 96

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

SonarQube Finding Triage

Overview

Evaluate every SonarQube finding critically before making changes. Not every finding warrants a code change — some are false positives, low-value noise, or would make the code worse if "fixed." Your job is to be a technical filter, not a compliance bot.

Core Rule

Never fix a SonarQube finding without first stating whether you agree with it and why.

Triage Flow

digraph triage {
    rankdir=TB;
    "Receive finding" [shape=doublecircle];
    "Read the flagged code\nin full context" [shape=box];
    "Is this a real problem?" [shape=diamond];
    "Would the fix improve\nthe code?" [shape=diamond];
    "Fix it" [shape=box];
    "Recommend: fix" [shape=box];
    "Recommend: dismiss\nwith justification" [shape=box];

    "Receive finding" -> "Read the flagged code\nin full context";
    "Read the flagged code\nin full context" -> "Is this a real problem?";
    "Is this a real problem?" -> "Would the fix improve\nthe code?" [label="yes"];
    "Is this a real problem?" -> "Recommend: dismiss\nwith justification" [label="no"];
    "Would the fix improve\nthe code?" -> "Recommend: fix" [label="yes"];
    "Would the fix improve\nthe code?" -> "Recommend: dismiss\nwith justification" [label="no"];
}

Before Touching Code

For every finding, answer these questions:

  1. What is SonarQube actually complaining about? (rule ID, severity, category)
  2. Read the flagged code and its surroundings. Understand the full context — callers, base classes, subclasses, how it's used.
  3. Do you agree this is a real issue? Consider:
    • Is this a false positive? (e.g., SonarQube doesn't understand the framework pattern)
    • Is the severity appropriate? (e.g., a "blocker" that has zero real-world impact)
    • Does the rule even apply to this codebase's context?
  4. Would the fix make the code better or worse?
    • Does it add unnecessary complexity?
    • Does it break the existing pattern for no real gain?
    • Is it purely cosmetic with no functional benefit?

Response Format

Always respond with a verdict before proposing changes:

If you agree:

Agree — [rule ID]: [1-sentence explanation of why this is a real issue]. Here's the fix: ...

If you disagree:

Disagree — [rule ID]: [Explanation of why this isn't a real issue in this context]. Recommend marking as "won't fix" because: ...

If it's borderline:

Borderline — [rule ID]: [Trade-off explanation]. Fixing would [benefit] but also [cost]. Your call — want me to fix it or dismiss it?

Common Dismiss Reasons

PatternExampleWhy Dismiss
Base class contractasync def without await in ABC defaultSubclasses are async; removing async breaks the interface contract
Framework conventionUnused parameter in handlerFramework requires the signature
Dead code by designFeature flag pathsIntentionally present for future use
Duplicate string in ORMRepeated table names in ForeignKeyConstants add indirection without improving safety
Test-only codeLess rigorous patterns in testsTest readability > production rigor

What to Always Fix

  • Security blockers: Hardcoded secrets, injection vulnerabilities, exposed credentials
  • Bugs: Actual logic errors, race conditions, null dereferences
  • Deprecated APIs: Using APIs that will break in future versions

What to Scrutinize

  • Code smells: Often subjective — evaluate case by case
  • Maintainability: "Define a constant" for 3 occurrences might not be worth it
  • Convention rules: May conflict with the project's established patterns
  • Complexity metrics: Sometimes complex code is the clearest way to express complex logic

Red Flags — You're Being a Compliance Bot

  • Adding asyncio.sleep(0) just to satisfy an async lint rule
  • Creating constants that are only meaningful as inline values (e.g., HTTP_STATUS_400 = 400)
  • Restructuring working code to satisfy a metric with no real-world benefit
  • Adding workarounds that make code harder to read

If you catch yourself doing any of these, stop and recommend dismissing the finding instead.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.