Command Palette

Search for a command to run...

Back to skills
skill № 40823

sonarqube-check

SonarQube quality gate, any language, run locally in Docker when there is no server: read the real gate and issues, fix by rule id, re-scan. A green linter is…

FreeRuns bundled scripts
crewforthby crewforth★ 26 GitHub stars

Install sonarqube-check in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

About this skill

SonarQube quality gate — produce the real report, locally

Trigger phrases: "sonarqube", "quality gate", "code smell", "sonar scan", "sonar rapor", "A rating"

Only a SonarQube analysis can say "rating A, 0 findings". A clean build says the compiler was happy — a different claim, about a different rule set. Passing one off as the other is how a team is told the code is clean and then opens a report full of findings.

You do not need a company server or someone else's token to get the real thing: SonarQube Community Build is free, needs no licence key, and runs in one Docker container on this machine. That is the default path here — the gate is produced locally, offline, and it is a genuine SonarQube verdict, not a proxy for one.

Language-agnostic on purpose: SonarQube covers 20+ languages plus IaC (Terraform, Kubernetes, Dockerfile). Detect what the project actually uses; never assume a stack.

Step 1 — get a real analysis (pick the first that applies)

a) The project already has a SonarQube → use it, and skip to step 2.

b) It does not → stand one up locally. Docker one-liner, the Docker-free server zip, the first login and the token: references/stand-up-server.md. No licence, no external account, nothing leaves the machine.

Restarting is not installing. Bringing an already-approved service back up on this machine — the same image, the same volumes — is resuming what the user already said yes to, and this skill's own advice to keep a named volume assumes exactly that. A NEW image, a new volume, or a tool this machine does not have is an install, and needs the answer below.

Nothing here is installed without the user saying so. Docker, Java, a scanner, a linter — each is a proposal with its cost stated, and the user picks. If they decline all of them, that is a valid answer: go to (c) and report "unverified" rather than installing anything to make a number appear.

Scan with whatever runner the project's stack uses — the scanner is the same product for every language: The token is read from the SONAR_TOKEN environment variable (set it in your shell or an untracked env file) — never pasted into chat, a command line literal, or a committed file.

Project Scan command
Any stack (generic) sonar-scanner -Dsonar.projectKey=app -Dsonar.sources=. -Dsonar.host.url=http://localhost:9000 -Dsonar.token=$SONAR_TOKEN
Maven / Gradle mvn sonar:sonar -Dsonar.host.url=… -Dsonar.token=$SONAR_TOKEN · gradle sonarqube …
.NET dotnet sonarscanner begin /k:app /d:sonar.host.url=… /d:sonar.token=$SONAR_TOKEN → dotnet build → dotnet sonarscanner end /d:sonar.token=$SONAR_TOKEN
JS/TS, Python, Go, PHP, Ruby the generic sonar-scanner above, with the coverage report below

Coverage first: SonarQube runs no tests, it reads a report. Produce one before the scan and pass its path, or the analysis counts every line uncovered and prints 0.0%:

Stack Produce Pass to the scanner
Python pytest --cov=<package> --cov-report=xml (needs pytest-cov) -Dsonar.python.coverage.reportPaths=coverage.xml
JS/TS vitest run --coverage --coverage.reporter=lcov · jest --coverage -Dsonar.javascript.lcov.reportPaths=coverage/lcov.info
.NET coverlet, OpenCover format /d:sonar.cs.opencover.reportsPaths=… (reports, with an s)
Java JaCoCo XML report -Dsonar.coverage.jacoco.xmlReportPaths=…
Go go test -coverprofile=coverage.out ./... -Dsonar.go.coverage.reportPaths=coverage.out

No report, no coverage figure. When none was produced (or lines_to_cover equals uncovered_lines), write "coverage: not measured — no report was passed to the analysis", never "0%": a 0 there says the tests were not read, not that there are none. Installing the coverage plugin is a proposal like any other tool.

c) No server is possible at all (no Docker, no Java, no permission to run one) → run the language's Sonar-rule engine locally as a pre-check (references/local-engines.md — which engine per language, and how close it is to Sonar's own rules) and say what that is worth, in these words rather than a rating: "the local rule engine reports N issues, none open; the SonarQube rating and the gate were not produced — no analysis ran." Then list what stays unverified: taint/injection, hotspot review state, coverage, duplication, files outside the compiled language, and the project's own quality profile. Offer branch (b) — a local server, with or without Docker — as the way to close it. Until one runs, a committed baseline keeps the numbers the project can measure from getting worse: references/ratchet.md.

Never invent the verdict. A rating exists only where an analysis produced one; without it the honest output is "unverified", and that is the sentence that saves the user from

Full SKILL.md on GitHub

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

Bundled files

  • references/local-engines.md
  • references/ratchet.md
  • references/stand-up-server.md
  • scripts/freshness.sh
  • scripts/record.sh
  • scripts/tree.sh

FAQ

What does the sonarqube-check skill do?

SonarQube quality gate, any language, run locally in Docker when there is no server: read the real gate and issues, fix by rule id, re-scan. A green linter is not the gate.

How do I install the sonarqube-check skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the sonarqube-check skill run scripts?

Yes, this skill bundles executable scripts. Review the source before installing.

Related skills

Compare sonarqube-check with