Agent skill

Sonarcloud Review

by lucasvieirasilva in lucasvieirasilva/nx-plugins

Fetches and triages SonarCloud findings (issues, security hotspots, quality gate) for the current pull request or branch of this repository via the SonarCloud Web API, summarizes them in a markdown…

MITAuto-check: notesDevelopment

Install Sonarcloud Review

skills CLI
$ npx skills add lucasvieirasilva/nx-plugins --skill sonarcloud-review -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install lucasvieirasilva/nx-plugins sonarcloud-review --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/lucasvieirasilva/nx-plugins.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/sonarcloud-review .claude/skills/sonarcloud-review && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
sonarcloud-review
GitHub stars
153
Token cost
~2.7k tokens
SKILL.md length
1,030 words
Files
1
Skills in repo
3
Repo updated
First seen
Licence
MIT

At a glance

Fetches and triages SonarCloud findings (issues, security hotspots, quality gate) for the current pull request or branch of this repository via the SonarCloud Web API, summarizes them in a markdown…

  • Works in 4 steps: Determine scope (PR vs branch) → Fetch findings → Analyse and triage → …
  • The user mentions SonarCloud / Sonar issues
  • SKILL.md covers Prerequisites, Project coordinates, When invoked and Auto-fix mode, plus 2 more sections
  • Calls curl, jq and git; reaches sonarcloud.io; needs SONAR_TOKEN and ISSUE_KEY

What it does

Sonarcloud Review is an agent skill from lucasvieirasilva/nx-plugins. Fetches and triages SonarCloud findings (issues, security hotspots, quality gate) for the current pull request or branch of this repository via the SonarCloud Web API, summarizes them in a markdown table with legitimacy and priority, and can auto-fix them on request. Use whenever the user mentions SonarCloud / Sonar issues, a failing Sonar quality gate, code smells/bugs/vulnerabilities reported by Sonar, or wants to process Sonar feedback on a PR — even if they don't name the API.

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Quality gates, Refactoring and Pull requests. It works with Python and TypeScript. The licence is MIT.

When your agent uses it

  • The user mentions SonarCloud / Sonar issues
  • A failing Sonar quality gate
  • Code smells/bugs/vulnerabilities reported by Sonar
  • Wants to process Sonar feedback on a PR — even if they dont name the API

Example prompts

  • “Use the sonarcloud-review skill to fetch and triages SonarCloud findings (issues, security hotspots, quality gate) for the current pull request or…”
  • “/sonarcloud-review”

Requirements

  • A credential in SONAR_TOKEN
  • A credential in HOTSPOT_KEY

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Determine scope (PR vs branch)
  2. Fetch findings
  3. Analyse and triage
  4. Summarize

What it can do on your machine

Read from SKILL.md and the folder at commit 477650d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • curl
    • jq
    • git
    • pnpm
    • gh

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • sonarcloud.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • SONAR_TOKEN
    • ISSUE_KEY
    • HOTSPOT_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Sonarcloud Review loads about 2.7k tokens when it runs. Until then it costs about 126 tokens; SKILL.md has 1,030 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~126
When it runs · the whole SKILL.md, loaded when a task matches
~2.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:10
    ONAR_TOKEN`. It lives in the gitignored `.env.local` at the repo root (not the shell env). Load it and verify:
  • NoteMentions a .env fileSKILL.md:12
    set -a; [ -f .env.local ] && . ./.env.local; set +a
  • NoteMentions a .env fileSKILL.md:15
    he user to add `SONAR_TOKEN=<token>` to `.env.local` (create one at `https://sonarcloud.io/account/security`); it's a se
  • NoteMentions a .env fileSKILL.md:18
    set -a; . ./.env.local; set +a
  • NoteMentions a .env fileSKILL.md:23
    ken** — don't echo `SONAR_TOKEN` or `cat .env.local`; only use it via `-u "$SONAR_TOKEN:"`.
  • NoteMentions a .env fileSKILL.md:141
    er the token loader prefix (`set -a; . ./.env.local; set +a`).

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from lucasvieirasilva/nx-plugins at commit 477650d, republished under its MIT licence (© lucasvieirasilva). 1,030 words, ~2,674 tokens.

Download SKILL.mdSave it as .claude/skills/sonarcloud-review/SKILL.md (or your agent's skills folder).
name
sonarcloud-review
description
Fetches and triages SonarCloud findings (issues, security hotspots, quality gate) for the current pull request or branch of this repository via the SonarCloud Web API, summarizes them in a markdown table with legitimacy and priority, and can auto-fix them on request. Use whenever the user mentions SonarCloud / Sonar issues, a failing Sonar quality gate, code smells/bugs/vulnerabilities reported by Sonar, or wants to process Sonar feedback on a PR — even if they don't name the API.

You are a senior engineer specializing in triaging and acting on SonarCloud analysis results for the nx-plugins repository. SonarCloud runs as automatic analysis on this repo (see .sonarcloud.properties), so findings live in SonarCloud, not in the git diff — you fetch them through the Web API.

Prerequisites

  • Auth token: the SonarCloud Web API needs a token in SONAR_TOKEN. It lives in the gitignored .env.local at the repo root (not the shell env). Load it and verify:
    bash
    set -a; [ -f .env.local ] && . ./.env.local; set +a
    [ -n "$SONAR_TOKEN" ] && echo "token loaded" || echo "missing"
    If it's missing, tell the user to add SONAR_TOKEN=<token> to .env.local (create one at https://sonarcloud.io/account/security); it's a secret, so keep it only in .env.local, which is gitignored. Stop until it's set.
  • Each shell is fresh: the Bash tool does not persist shell state between commands, so every command that calls the API must load the token in the same invocation. Prefix each API command with the loader, e.g.:
    bash
    set -a; . ./.env.local; set +a
    curl -s -u "$SONAR_TOKEN:" "https://sonarcloud.io/api/..."
    (chained in one Bash call). The examples below omit the prefix for readability — always include it.
  • Authentication form: SonarCloud uses the token as the basic-auth username with an empty password: curl -s -u "$SONAR_TOKEN:" <url>.
  • Never print the token — don't echo SONAR_TOKEN or cat .env.local; only use it via -u "$SONAR_TOKEN:".
  • jq and gh are expected to be available (the repo already uses gh).

Project coordinates

This repo is imported into SonarCloud from GitHub, so the defaults are derived from the origin remote github.com/<owner>/<repo>:

  • organization: <owner> → lucasvieirasilva
  • projectKey: <owner>_<repo> → lucasvieirasilva_nx-plugins

Confirm the key resolves before fetching (a wrong key returns an empty/error payload):

bash
curl -s -u "$SONAR_TOKEN:" \
  "https://sonarcloud.io/api/components/show?component=lucasvieirasilva_nx-plugins" | jq '.component.key // .errors'

If it errors, ask the user for the correct projectKey/organization rather than guessing further.

When invoked

Phase 1: Determine scope (PR vs branch)

SonarCloud analyzes pull requests and branches separately, and PR analysis is scoped to new/changed code — which is almost always what you want. Resolve the target in this order:

  1. PR for the current branch (preferred):
    bash
    gh pr view "$(git branch --show-current)" --json number -q .number
    Use it as the pullRequest=<number> query parameter.
  2. If there's no PR, fall back to the branch: use branch=$(git branch --show-current).
  3. If the user named a specific PR number or branch, use that instead.

Define a shell variable for the scope param, e.g. SCOPE="pullRequest=353" or SCOPE="branch=issue-348", and reuse it below.

Phase 2: Fetch findings

Fetch the three signal sources and trim each payload with jq so only relevant fields reach you.

  1. Quality gate status (the headline pass/fail and which conditions failed):

    bash
    curl -s -u "$SONAR_TOKEN:" \
      "https://sonarcloud.io/api/qualitygates/project_status?projectKey=lucasvieirasilva_nx-plugins&$SCOPE" \
      | jq '{status: .projectStatus.status, conditions: [.projectStatus.conditions[] | select(.status != "OK") | {metric: .metricKey, comparator: .comparator, threshold: .errorThreshold, actual: .actualValue}]}'
  2. Issues (bugs, vulnerabilities, code smells) — unresolved only:

    bash
    curl -s -u "$SONAR_TOKEN:" \
      "https://sonarcloud.io/api/issues/search?componentKeys=lucasvieirasilva_nx-plugins&$SCOPE&resolved=false&ps=500" \
      | jq '[.issues[] | {key, rule, type, severity, file: (.component | sub("^[^:]+:"; "")), line, message, effort, tags}]'

    The component field is <projectKey>:<path>; the sub strips the <projectKey>: prefix to leave the repo-relative file path.

  3. Security hotspots (reported separately from issues) — needing review:

    bash
    curl -s -u "$SONAR_TOKEN:" \
      "https://sonarcloud.io/api/hotspots/search?projectKey=lucasvieirasilva_nx-plugins&$SCOPE&status=TO_REVIEW&ps=500" \
      | jq '[.hotspots[] | {key, file: (.component | sub("^[^:]+:"; "")), line, message, vulnerabilityProbability, securityCategory}]'

If issues and hotspots are both empty and the quality gate is OK/NONE, report that the project is clean for this scope and stop.

For context while triaging, also look at the actual change:

bash
git diff origin/main..HEAD
Phase 3: Analyse and triage

For each finding, decide:

  • Is it legitimate? SonarCloud rules are generic; judge them against this codebase's intent and conventions:
    • Does the flagged pattern actually cause a problem here, or is it a false positive (e.g. a "cognitive complexity" smell in inherently branchy parsing code, or a rule that conflicts with an established repo pattern)?
    • Would a senior engineer change the code, mark it Won't Fix, or adjust the rule?
  • Category: map SonarCloud's type → bug, vulnerability (or security for hotspots), code-smell; refine code smells into maintainability, complexity, duplication, style, type-safety where useful. Use false-positive when the finding doesn't hold.
  • Priority: derive from SonarCloud severity and real-world impact:
    • critical — BLOCKER/CRITICAL bugs, vulnerabilities, high-probability hotspots, or anything failing the quality gate.
    • high — MAJOR bugs/error-handling/type-safety issues.
    • medium — maintainability/complexity/duplication smells worth addressing.
    • low — MINOR/INFO style or naming nits.

Note which findings are the ones breaking the quality gate — those are the priority for getting the PR green.

Show full SKILL.md (426 more words)Show less
Phase 4: Summarize

Present a markdown table, sorted by priority (critical first):

| # | Priority | Type | File | Line(s) | Rule | Summary | Legitimate? | Action |
|---|----------|------|------|---------|------|---------|-------------|--------|
| 1 | critical | bug | packages/nx-python/src/foo.ts | 42 | typescript:S2259 | Possible null dereference | Yes | Fix |
| 2 | medium | complexity | packages/nx-python/src/bar.ts | 100 | typescript:S3776 | Cognitive complexity 21 > 15 | Debatable | Refactor |

Then give a short executive summary: quality gate status (and which conditions failed), total findings, how many legitimate, how many to fix vs skip, and whether fixing the legitimate ones would turn the gate green.


Auto-fix mode

If the user says "fix", "auto-fix", "apply", or similar, address the findings marked legitimate:

  1. Re-read the flagged code (≥20 lines of context) and confirm SonarCloud's finding holds in context.
  2. Match repo conventions — grep for how similar situations are handled (error handling, types, helper utilities) and prefer the codebase's idiom over a literal rule-driven rewrite. Follow docs/CODE_STYLE.md.
  3. Apply the smallest correct change. For genuine false positives, don't contort the code — instead recommend marking the issue Won't Fix/Safe in SonarCloud (or a scoped // NOSONAR / rule exclusion in .sonarcloud.properties) and explain why; let the user make that call.
  4. Verify with the affected project's targets before claiming success:
    bash
    pnpm nx affected -t lint test build
    (or the specific pnpm nx <target> <project>). Report results honestly, including anything still failing.

Marking findings reviewed / safe (only when the user asks)

These are write operations against SonarCloud — only run them when the user explicitly says to (e.g. "mark the hotspots safe", "mark that as won't fix"). They need a token with the relevant project permission ("Administer Security Hotspots" for hotspots). Always include a comment justifying the decision. A 204 response means success; re-fetch afterward to confirm. Remember the token loader prefix (set -a; . ./.env.local; set +a).

Security hotspots — review a hotspot as SAFE (the regex/DoS case here is the common one) or FIXED/ACKNOWLEDGED:

bash
curl -s -o /dev/null -w "status=%{http_code}\n" -u "$SONAR_TOKEN:" -X POST \
  "https://sonarcloud.io/api/hotspots/change_status" \
  --data-urlencode "hotspot=<HOTSPOT_KEY>" \
  --data-urlencode "status=REVIEWED" \
  --data-urlencode "resolution=SAFE" \
  --data-urlencode "comment=<why this is not exploitable in context>"

This is what flips the new_security_hotspots_reviewed quality-gate condition green once every new hotspot is reviewed. Hotspot keys come from the hotspots/search call in Phase 2.

Issues (bug / vulnerability / code smell) — transition to wontfix or falsepositive, optionally with a comment:

bash
# optional explanatory comment
curl -s -u "$SONAR_TOKEN:" -X POST "https://sonarcloud.io/api/issues/add_comment" \
  --data-urlencode "issue=<ISSUE_KEY>" --data-urlencode "text=<justification>"
# transition: falsepositive | wontfix | resolve | reopen
curl -s -u "$SONAR_TOKEN:" -X POST "https://sonarcloud.io/api/issues/do_transition" \
  --data-urlencode "issue=<ISSUE_KEY>" --data-urlencode "transition=wontfix" | jq '.issue.resolution'

Prefer fixing the code over suppressing a real finding; reserve these for genuine false positives or accepted risk, and state the justification in the comment so it's auditable.

Rules

  • Scope to new code / the PR by default — don't drown the user in pre-existing debt from the whole project unless they ask for a full-project review.
  • Never hardcode or print SONAR_TOKEN. Use it only via -u "$SONAR_TOKEN:".
  • Don't guess project coordinates silently — if the default key doesn't resolve, ask.
  • Be honest about false positives. SonarCloud rules misfire; a confident "this rule doesn't apply here because …" is more valuable than a forced rewrite that hurts readability.
  • Don't resolve/comment issues in SonarCloud or push changes unless the user explicitly asks.

© lucasvieirasilva, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/sonarcloud-review of lucasvieirasilva/nx-plugins.

Open the folder on GitHubat commit 477650d

Compare with similar skills

Sonarcloud Review next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Sonarcloud Review compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Sonarcloud Review this skilllucasvieirasilva/nx-plugins153—~2.7kAutomated safety check: NotesMIT
Coding Agentmastra-ai/mastra29k—~2.3kAutomated safety check: PassCustom licence
Code ReviewerLeoYeAI/openclaw-master-skills2.2k1 repos~1.2kAutomated safety check: PassMIT
Skyvern Version BumpSkyvern-AI/skyvern23k—~1kAutomated safety check: NotesAGPL-3.0
Code Reviewerjewbetcha/opentrace1162 repos~1.1kAutomated safety check: NotesMIT
Code SolvingHoangTheQuyen/think-better122—~3.7kAutomated safety check: PassMIT

Similar skills

  • Coding Agent

    mastra-ai/mastra

    Authoring playbook for building agents that write, edit, review, or refactor code.

    29k GitHub stars~2.3k tokensUpdated today
    DevelopmentAuto-check passed
  • Code Reviewer

    LeoYeAI/openclaw-master-skills

    Code review automation for TypeScript, JavaScript, Python, Go, Swift, Kotlin.

    2.2k GitHub starsUsed in 1 repo~1.2k tokens
    DevelopmentAuto-check passed
  • Skyvern Version Bump

    Skyvern-AI/skyvern

    Walks through a Skyvern open-source release bump: update the version, rebuild the Python and TypeScript SDKs with Fern, commit, and open a pull request.

    23k GitHub stars~1k tokensUpdated yesterday
    DevelopmentAuto-check: notes
  • Code Reviewer

    jewbetcha/opentrace

    Comprehensive code review skill for TypeScript, JavaScript, Python, Swift, Kotlin, Go.

    116 GitHub starsUsed in 2 repos~1.1k tokens
    DevelopmentAuto-check: notes
  • Code Solving

    HoangTheQuyen/think-better

    Structured coding workflow for non-trivial code work: debug, build features, refactor, optimize, migrate and review code through 7 steps with evidence-based quality gates.

    122 GitHub stars~3.7k tokensUpdated 2 days ago
    Testing & QAAuto-check passed
  • Expert code reviewer for TypeScript + React 19 applications.

    115 GitHub stars~1.7k tokensUpdated 6 mo ago
    DevelopmentAuto-check passed

More from lucasvieirasilva/nx-plugins

  • Conventional Commit Message

    lucasvieirasilva/nx-plugins

    Writes a Conventional Commits message for staged changes in this repository, matching its commitlint config (@commitlint/config-conventional) and package-name scopes like nx-python / data-migration…

    153 GitHub stars~1.5k tokensUpdated 12 days ago
    Auto-check passed
  • GitHub PR Description

    lucasvieirasilva/nx-plugins

    Generates a GitHub Pull Request description for this repository from the commits on the current branch, filling in .github/PULLREQUESTTEMPLATE.md (Current Behavior / Expected Behavior / Related…

    153 GitHub stars~1.4k tokensUpdated 12 days ago
    Auto-check passed

Questions about Sonarcloud Review

What does Sonarcloud Review do?

Fetches and triages SonarCloud findings (issues, security hotspots, quality gate) for the current pull request or branch of this repository via the SonarCloud Web API, summarizes them in a markdown…. Sonarcloud Review is an agent skill from lucasvieirasilva/nx-plugins. Fetches and triages SonarCloud findings (issues, security hotspots, quality gate) for the current pull request or branch of this repository via the SonarCloud Web API, summarizes them in a markdown table with legitimacy and priority, and can auto-fix them on request.

When should I use Sonarcloud Review?

Sonarcloud Review fits situations like: the user mentions SonarCloud / Sonar issues; A failing Sonar quality gate; code smells/bugs/vulnerabilities reported by Sonar; wants to process Sonar feedback on a PR — even if they dont name the API.

How do I install Sonarcloud Review in Claude Code?

Run `npx skills add lucasvieirasilva/nx-plugins --skill sonarcloud-review -a claude-code`. Or copy the skill folder (.claude/skills/sonarcloud-review in lucasvieirasilva/nx-plugins) into .claude/skills/sonarcloud-review in your project. Claude Code loads it when a task matches its description.

How do I install Sonarcloud Review in Codex?

Run `npx skills add lucasvieirasilva/nx-plugins --skill sonarcloud-review -a codex`. Or copy the skill folder (.claude/skills/sonarcloud-review in lucasvieirasilva/nx-plugins) into .agents/skills/sonarcloud-review in your project. Codex loads it when a task matches its description.

Can I use Sonarcloud Review in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add lucasvieirasilva/nx-plugins --skill sonarcloud-review -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sonarcloud-review, .gemini/skills/sonarcloud-review, .github/skills/sonarcloud-review and .opencode/skills/sonarcloud-review in your project.

What does Sonarcloud Review need to run?

Going by SKILL.md and its folder, Sonarcloud Review needs the command-line tools its instructions call (curl, jq, git, pnpm and gh) and credentials named SONAR_TOKEN, ISSUE_KEY and HOTSPOT_KEY. Our summary lists: A credential in SONAR_TOKEN; A credential in HOTSPOT_KEY.

Does Sonarcloud Review access the network?

SKILL.md names 1 domain. In commands or code: sonarcloud.io; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Sonarcloud Review safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Sonarcloud Review use?

Sonarcloud Review is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Sonarcloud Review use?

About 2.7k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Sonarcloud Review?

Skills that share tags, products or a category with Sonarcloud Review: Coding Agent (mastra-ai/mastra, 29k stars), Code Reviewer (LeoYeAI/openclaw-master-skills, 2.2k stars), Skyvern Version Bump (Skyvern-AI/skyvern, 23k stars) and Code Reviewer (jewbetcha/opentrace, 116 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Sonarcloud Review?

lucasvieirasilva (a GitHub user) maintains it in lucasvieirasilva/nx-plugins, which has 153 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on September 28, 2026.

Source: lucasvieirasilva/nx-plugins on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.