/sonarqube:analyze [file paths...] | [natural-language description of files to include]from sonarqube
Use when the user asks to "run sonar", "run SonarQube", "run SonarLint", "scan for secrets", "check this for Sonar issues", or wants SonarQube analysis over code this session never touched. Runs SonarQube for IDE's engine locally, adds what SonarQube Server or Cloud recorded for the same files, and works through the findings.
Ships in sonarqube. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Run SonarQube analysis. Arguments given: $ARGUMENTS
This skill is the explicit opt-in for analysing pre-existing code — files this session didn't create or edit. The plugin's hooks only ever analyse files touched during the current session; use this skill whenever the user wants existing code scanned too.
It runs SonarQube for IDE's own analyzers locally (SLOOP) through the
plugin's CLI and, when the project is bound to SonarQube Server or Cloud,
also reads the server's open issues for the same files. sonarlint below
means:
node "${CLAUDE_PLUGIN_ROOT}/cli/sonarlint.js" --data-dir "${CLAUDE_PLUGIN_DATA}"
If it exits 2 saying SLOOP is not installed, the engine's automatic
install at session start hasn't finished yet or has failed. Run sonarlint doctor and tell the user what it says. Don't run the installer without
asking. The server check in step 3 doesn't need the engine, so still run it.
git status / git diff and directory listings — to a concrete set of
paths before continuing.If the match is ambiguous, do NOT guess. List the candidates with a one-line reason each and ask for confirmation before analysing anything.
Use git as the source of truth, the way SonarQube for IDE does: analyse
tracked files only. git ls-files over the resolved target gives
exactly that, and because it already honours .gitignore, vendored
dependencies and generated output fall away on their own — with nobody
maintaining a list of directory names that goes stale. git check-ignore
settles an individual path.
Outside a git repository, apply the same judgment by hand. Don't reach for a fixed list of folder names; ask what the file is, and skip anything that isn't source this project wrote and maintains:
Analyse a file the user explicitly names even if it would normally be skipped — but say that you're including it, and why.
Pass the files (or directories) in one call. A directory expands to what git considers part of the project.
sonarlint files <paths...> --format json --min-severity INFO
Secrets are part of the same pass: the secrets analyzer is local and
content-based, so it covers .env, config, and IaC files too.
Read the exit code — it is the result, not the output:
--min-severity. Triage and fix (step 4).sonarlint doctor.Exit 2 is not a clean result. Never report "no issues found" for it.
The first analysis in a project takes ~20-30s while the engine starts; later ones take about a second.
Local analysis alone is not the full answer. The server runs newer
analyzers, your organization's quality profile, and rules the local
engine never runs (security hotspots, taint analysis). Some files only
the server can check. For example, the pinned engine accepts GitHub
Actions workflows but has no githubactions:* rules, so it reports them
clean whatever they contain.
So whenever any target file sits under a .sonarlint/connectedMode.json
binding, also ask the server about the same paths:
sonarlint server <paths...> --format json --min-severity INFO
It finds the nearest binding for each file, calls sonar api with the
project key (and Cloud organization), and returns the open issues in the
same shape as files, plus each issue's server key and status. It
also returns a projects list giving the revision the server last
analyzed, whether that revision is HEAD, and which of the files changed
since then. Add --branch <name> or --pull-request <key> when the user
cares about something other than the main branch.
files.sonar CLI is missing or not
logged in (see sonarqube-web-api), the call failed, no file is
bound, or the server has no analysis of that project key, branch or
pull request (it answers those with an empty issue list, so an empty
list alone proves nothing). Say the server was not checked and
why. Local results still stand.With no binding at all, skip this step and say only local analysis ran.
Don't create a binding unprompted (see sonarqube-connected-mode).
Treat findings with the same rule, file and line as one finding. For the rest:
sonarlint rules --key <rule>
fails, or the rule's language isn't local at all. Fix it like any
other finding.Work through the findings using the sonarqube-issue-triage skill's
severity ordering and false-positive rules. In short:
NOSONAR comments to make findings disappear.sonarqube-web-api skill.Re-run the local analysis after fixing. Stop after two fix-and-recheck
rounds, or sooner if something needs a human judgment call. Re-running
sonarlint server doesn't show your fix: the server only sees it after
its next analysis. Say which fixes can only be confirmed by that
analysis.
A short summary: what was scanned, what was found by severity and where it came from (local, server, or both), what was fixed, and anything left unresolved and why. Call out explicitly any file that was skipped, any analyzer that could not load, and whether the server was checked (and of which revision), so "clean" is never confused with "not checked". A file is clean only if the local run passed and the server either reports nothing for it or was checked and is up to date. Never call a file clean on the local result alone when only the server has rules for it.
What SKILL.md sets; muted values are Claude Code's defaults
6 skills in this plugin
/fixUse when the user asks to fix SonarQube or SonarLint issues, a specific Sonar rule key (like python:S5754 or githubactions:S8541), or "the Sonar findings" in some files, including issues SonarQube Server or Cloud reported. Gathers findings locally and from the server, explains each rule, and fixes the issues minimally./sonarlint-analysisUse after creating or editing source code (JS/TS, Python, Java, Go, PHP, HTML, CSS, XML, Terraform, Docker, Kubernetes, CloudFormation, or any file that could hold a credential) and before declaring a coding task done, or when asked to check code quality or security locally. Runs SonarQube for IDE's own analyzers on the working tree through the plugin's `sonarlint` CLI and explains how to read and act on the result./npx claudepluginhub leonardo-marziali/agentic-development-kit --plugin sonarqube