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…
от crewforth★ 26 звёзд на GitHub
Установить sonarqube-check в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
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
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/local-engines.md
- references/ratchet.md
- references/stand-up-server.md
- scripts/freshness.sh
- scripts/record.sh
- scripts/tree.sh
FAQ
Что делает скилл 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 not the gate.
Как установить скилл sonarqube-check?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл sonarqube-check запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…