sonar
Skill367 starsChanged 58 days agoMITView on GitHub
Check the SonarCloud quality gate for a PR (or the current branch) and drive it to zero. Reports GREEN, or the exact PR-scoped new issues/hotspots/coverage gaps to fix.
- Reads credentials
3 other projects use a version of this.
Adopted by
Most recently taken up by
- avantmedialtd/skillstheir own version, first seen Oct 9, 2026
- trysonar/skillstheir own version, first seen Oct 1, 2026
- koderover/devops-skillstheir own version, first seen Mar 4, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- koderover/devops-skills★ 7same name
- avantmedialtd/skills★ 1same name
- trysonar/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository21 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- llms.txtllms.txt
- changelogSkill
- checkSkill
- doc-reviewSkill
- gflow-cliSkill
- issue-assessmentSkill
- issue-resolveSkill
- known-issuesSkill
- live-verifySkill
- llm-councilSkill
- planSkill
- pr-council-reviewSkill
- predictSkill
- releaseSkill
- scenarioSkill
- spikeSkill
- statusSkill
- video-productionSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 59
NEVER widen sonar.coverage.exclusions to dodge it.
- Distinctive: line 70
Never mark a real hotspot SAFE.
- Distinctive: line 78
After any fix: re-confirm via step 1 — green check = gate passed.
≈ “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.
Files
/gflow:sonar [PR#] — SonarCloud quality gate
The reusable Sonar primitive. /gflow:check is local and cannot see Sonar (it
is server-side, post-push); /gflow:pr-council-review is an LLM diff review, not the
gate verdict. This command answers one question: is the SonarCloud gate green
(zero new issues) for this PR, and if not, exactly what must be fixed?
$ARGUMENTS is the PR number. If empty, resolve it from the current branch
(gh pr view --json number -q .number).
Project: key ffroliva_gflow-cli, org ffroliva-github (see sonar-project.properties).
The CI scan sets sonar.qualitygate.wait=true, so a green SonarCloud analysis
check means the gate genuinely passed — but the gate API is stale until that
check finishes, so always check the GitHub check FIRST.
Steps
1. Check the GitHub check first (never trust the gate API while it's pending).
gh pr checks <N> --json name,state,bucket | \
jq -r '.[] | select(.name=="SonarCloud analysis") | "\(.bucket) \(.state)"'pass→ gate is GREEN / zero new issues. Done. Report GREEN and stop.pending→ the SonarCloud job (~50s) runs after the ~3.5min test matrix; wait (gh pr checks <N> --watch) before reading the API, or the API returns the previous commit's verdict.fail→ continue to step 2 to enumerate the exact failing conditions.
2. Enumerate the failing conditions (PR-scoped — this is the #1 gotcha).
New-code issues live on the PR branch, NOT main. Scope every call with
&pullRequest=<N> or the API reports 0 and you chase phantoms. Token is in
.env.local as SONAR_TOKEN — read it inside a sandbox so it never lands in chat.
curl may be blocked by the context-mode hook → use ctx_execute (javascript
fetch with Authorization: Basic base64(token+":")).
# Which gate conditions are ERROR:
GET /api/qualitygates/project_status?projectKey=ffroliva_gflow-cli&pullRequest=<N>
# New issues (bugs/smells) with file:line + rule + creationDate:
GET /api/issues/search?componentKeys=ffroliva_gflow-cli&pullRequest=<N>&resolved=false
# Unreviewed security hotspots:
GET /api/hotspots/search?projectKey=ffroliva_gflow-cli&pullRequest=<N>&status=TO_REVIEW3. Fix by condition — no gaming.
new_coverage < 80%→ add real unit tests for the uncovered new lines (usually a new orchestration/_run_*/helper). There is NO mark-safe shortcut and NEVER widensonar.coverage.exclusionsto dodge it.new_code_smells/new_maintainability_rating(e.g. S1192 duplicated literal, S3776 cognitive complexity) → fix at source. For a duplicated literal your diff merely touched, collapse it to one module-scope alias so it falls under the threshold (pyright/tests prove it's safe). For S7497, re-raise swallowedasyncio.CancelledError.new_security_hotspots_reviewed < 100%→ only for a genuine false positive:POST /api/hotspots/change_statusform bodyhotspot=<key>&status=REVIEWED&resolution=SAFE&comment=<justification>(204 = ok), then re-run the SonarCloud job so it reposts the GitHub status (gh run rerun <run-id> --job <sonar-job-id>— the coverage artifact is reused). Never mark a real hotspot SAFE.
4. Push fixes, then re-verify from step 1 (the check must read pass).
Output
- Verdict: GREEN (gate passed, zero new issues) or RED with the exact failing
conditions and a fix list (
file:line · rule · what to do). - After any fix: re-confirm via step 1 — green check = gate passed.
Pipeline Continuation (Next Step Handoff)
Upon completing SonarCloud Quality Gate:
- Gate 🟢 GREEN: Proactively announce: "SonarCloud quality gate passed (zero new issues). Next step: Phase 10 Release Pipeline (
/gflow:release) or merge PR." - Gate 🔴 RED: Fix identified code smells/coverage gaps, push, and re-run
/gflow:sonar <PR#>.
See also
docs/GITHUB.md§ SonarCloud Quality Gate — full policy + coverage-exclusion rationale./gflow:check— the local pre-commit gates (coverage floor pre-emptsnew_coverage).- Memory: [[sonarcloud-pr-issues-scope-s7497]], [[sonarcloud-new-code-gotchas]], [[sonarcloud-hotspot-review-workflow]], [[sonarcloud-setup]].
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
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.

