Sonarcloud triage

From sunholo-data/ailang · View interactive version

Sonarcloud triage is an AI agent skill from the GitHub repository sunholo-data/ailang. 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, Son

How to use this skill

Skill file

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

<https://sonarcloud.io/account/security>. Read-only scripts (gate_status,

fetch_*) don't need it; mutating scripts (mark_*, set_new_code) do.

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 CODE0 before step 3 —

each entry has the rule key, verdict, and the exact comment to paste.

CODE0 has the "when you

see X in Y, do Z" reference.

Scripts

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

| Script | Auth | What it does |

|--------|------|--------------|

| gate_status.sh | none | Summarize assigned gate, new-code period, condition pass/fail, top-level counts |

| fetch_issues.sh [SEVERITIES] | none | List open BUG + VULNERABILITY at given severities (default BLOCKER,CRITICAL) |

| fetch_hotspots.sh [STATUS] | none | Group hotspots by category/rule/directory (default TO_REVIEW) |

| mark_safe.sh RULE_KEY "comment" | $SONAR_PAT | Bulk mark all TO_REVIEW hotspots with that rule as REVIEWED+SAFE |

| mark_fp.sh ISSUE_KEY "comment" | $SONAR_PAT | Transition one issue to False Positive with audit-trail comment |

| set_new_code.sh VALUE | $SONAR_PAT | Set sonar.leak.period (number-of-days / date:YYYY-MM-DD / previous_version / version tag) |

When to use this skill

Invoke whenever the user:

Guardrails

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.

bulk-marking — we use dynamic table/column names with whitelisted values; we want

to be sure format-string inputs never reach user content.

rerun until the count drops to zero.

in bash: for k in K1 K2 K3; do mark_fp.sh $k "..."; done.

Progressive disclosure

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.