agentleFS
sunholo-datasunholo-data/ailang/.agents/skills/sonarcloud-triage/SKILL.md

sonarcloud-triage

Skill38 starsChanged 8 days agoApache-2.0View on GitHub

Triage SonarCloud issues and hotspots via the SonarCloud Web API — check gate status, list open BLOCKER/CRITICAL bugs + vulns, group hotspots by rule, bulk-mark hotspots Safe per rule, transition issues to False Positive, and change the New Code period. Use whenever the user mentions SonarCloud, Sonar, quality gate red/failing, code smells to triage, marking hotspots safe, marking issues as false positive, setting new code period, or asks "why is the Sonar gate red" — even if they only reference a specific rule like go:S2245 without naming SonarCloud.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read resources/known_fp_rules.md before step 3 — each entry has the rule key, verdict, and the exact comment to paste.

    line 34
  2. Very specific:

    All scripts live in scripts/ and source _lib.sh for shared config.

    line 41
  3. Very specific:

    Always loaded: this SKILL.md

    line 77
  4. Very specific:

    Run on demand: scripts in scripts/

    line 81

≈ “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

SonarCloud Triage

Repeatable triage of SonarCloud findings for sunholo-data_ailang via the Web API. Everything the web UI does for triage is available through the API, and most of it is faster from the shell.

Prerequisites

  • SONAR_PAT — personal admin token, exported in ~/.zshenv. Get one at https://sonarcloud.io/account/security. Read-only scripts (gate_status, fetch_*) don't need it; mutating scripts (mark_*, set_new_code) do.
  • Optional overrides: SONAR_PROJECT (default sunholo-data_ailang), SONAR_ORG (default sunholo-data), SONAR_HOST (default https://sonarcloud.io).

Standard triage workflow

1. scripts/gate_status.sh           → see which conditions fail and on what metric
2. scripts/fetch_hotspots.sh        → group TO_REVIEW hotspots by rule + directory
3. For each rule listed in resources/known_fp_rules.md:
     scripts/mark_safe.sh RULE_KEY "<comment from known_fp_rules.md>"
4. scripts/fetch_issues.sh          → list remaining BLOCKER/CRITICAL bugs + vulns
5. For each issue that matches a known-FP row:
     scripts/mark_fp.sh ISSUE_KEY "<comment from known_fp_rules.md>"
6. scripts/set_new_code.sh 30       → rolling 30-day New Code window (if not already)
7. scripts/gate_status.sh           → confirm conditions moved

Read resources/known_fp_rules.md before step 3 — each entry has the rule key, verdict, and the exact comment to paste. resources/triage_playbook.md has the "when you see X in Y, do Z" reference.

Scripts

All scripts live in scripts/ and source _lib.sh for shared config.

ScriptAuthWhat it does
gate_status.shnoneSummarize assigned gate, new-code period, condition pass/fail, top-level counts
fetch_issues.sh [SEVERITIES]noneList open BUG + VULNERABILITY at given severities (default BLOCKER,CRITICAL)
fetch_hotspots.sh [STATUS]noneGroup hotspots by category/rule/directory (default TO_REVIEW)
mark_safe.sh RULE_KEY "comment"$SONAR_PATBulk mark all TO_REVIEW hotspots with that rule as REVIEWED+SAFE
mark_fp.sh ISSUE_KEY "comment"$SONAR_PATTransition one issue to False Positive with audit-trail comment
set_new_code.sh VALUE$SONAR_PATSet sonar.leak.period (number-of-days / date:YYYY-MM-DD / previous_version / version tag)

When to use this skill

Invoke whenever the user:

  • Asks about the SonarCloud quality gate status or why it's failing
  • Wants to triage, clean up, or mark safe/false positive SonarCloud findings
  • Mentions a specific rule key (e.g. go:S2245, javascript:S5852) in context of Sonar
  • Wants to change the New Code period (rolling days, since-date, previous version)
  • Asks for a summary of open bugs/vulns/hotspots without opening the web UI
  • Says something like "our Sonar is noisy" or "make the gate useful"

Guardrails

  • Do not bulk-mark a rule as Safe without consulting known_fp_rules.md first. That file is the source of truth for our standing decisions. If the rule isn't listed there, add it (with a Review required verdict) before acting.
  • SQL-injection hotspots (go:S2077) require a spot check of 2–3 files before bulk-marking — we use dynamic table/column names with whitelisted values; we want to be sure format-string inputs never reach user content.
  • mark_safe.sh only scans the first page (500 hotspots). If the rule has more, rerun until the count drops to zero.
  • mark_fp.sh is per-issue; for bulk issue triage use the SonarCloud UI or loop in bash: for k in K1 K2 K3; do mark_fp.sh $k "..."; done.

Progressive disclosure

  • Always loaded: this SKILL.md
  • Read on demand:
    • resources/known_fp_rules.md — standing per-rule decisions + exact triage comments
    • resources/triage_playbook.md — "when you see X in Y, do Z"
  • Run on demand: scripts in scripts/

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.