sonarqube
БесплатноБез исполняемых скриптовНе проверенOperate SonarQube-enabled repositories through the SonarQube CLI (`sonar`): verify authentication, discover project keys, inspect project metadata, issues…
от DougTrajano★ 382 звезды на GitHubОб этом скилле
SonarQube CLI
Use the installed sonar CLI as the source of truth for a SonarQube-enabled project. Prefer structured, read-only inspection before analysis or mutation, and make the final response state the project, branch or pull request, command scope, and result.
Start with a preflight
Run these checks from the repository or worktree the user placed in scope:
command -v sonar
sonar --version
sonar auth status
If the task involves installation state, integrations, or a confusing auth error, also run sonar system status --json.
Treat sonar auth status as the authoritative credential check. Do not infer authentication merely from a saved config file. In a sandbox, container, SSH session, or background agent, OS Keychain access may fail even though authentication works in the user's interactive terminal. Explain that distinction and use the environment-variable route in authentication.md when the user has made credentials available; never retrieve, print, or persist a token yourself.
The CLI is evolving. If the installed version differs from the reference snapshot or a command rejects an option, run sonar --help and sonar <command> --help, then follow the installed help. Read commands.md when selecting flags or when the user asks what the CLI supports.
Resolve the project before querying it
Use the exact project key, not the display name. Resolve it in this order:
- Use a project key explicitly supplied by the user.
- Inspect
sonar.projectKeyinsonar-project.propertiesat the repository root. - Inspect SonarQube for IDE connected-mode binding under
.sonarlint/, such as.sonarlint/connectedMode.json. - Let the CLI auto-detect when the command supports it.
- Search accessible projects with
sonar list projects -q <name-or-key>and disambiguate multiple matches before continuing.
Do not silently choose among multiple project matches. Read workflows.md for project-detail, issue, quality-gate, and API recipes.
Choose the correct analysis
| Intent | Command | Important behavior |
|---|---|---|
| Analyze one or more changed source files | sonar analyze --file <path> |
One file defaults to STANDARD; multiple files default to DEEP. --file is repeatable. |
| Analyze uncommitted Git changes | sonar analyze |
Requires a Git repository and may run server-side analysis. |
| Analyze staged files | sonar analyze --staged |
Uses git diff --cached. |
| Compare with a base ref | sonar analyze --base <ref> |
Analyze the change set relative to the named ref. |
| Request explicit cross-file analysis | sonar analyze --depth DEEP |
More context and potentially more time/data transfer. |
| Invoke the explicit Vortex route | sonar analyze agentic ... |
Server-side analysis; limitations and entitlements apply. |
| Scan files for hardcoded secrets | sonar analyze secrets <paths...> |
Scans paths or --stdin; treat a findings exit code as a finding, not an infrastructure failure. |
| Analyze dependency manifests | sonar analyze dependency-risks |
Uploads manifests for security/license analysis; product entitlement may be required. |
| Run a traditional full-project CI scan | Project's existing scanner/build command | sonar analyze is not a replacement for every SonarScanner, Maven, Gradle, or .NET full-project pipeline. Inspect repository config and use the existing workflow only when requested. |
Before server-side analysis, inspect the selected files or Git change set so the scope is known. Avoid --force unless the user has explicitly accepted bypassing the large-change-set confirmation. Prefer --format json for deterministic parsing and retain the command exit status.
After fixing findings, rerun the same analysis scope. Do not expand from a file scan to the entire change set without saying so.
If the selected Git scope is empty, report that no files were analyzed. An empty change set is not evidence that the repository is clean.
Prefer dedicated read commands
Use the narrowest command that answers the question:
sonar list projects -q <query>
sonar list issues --project <key> --format json
sonar quality-gate status --project <key> --format json --all
Add exactly one of --branch <name> or --pull-request <id> when needed. They are mutually exclusive for quality-gate status. Paginate project and issue results rather than assuming the first page is complete.
For an agent-facing issue summary, --format toon is compact. Use JSON when filtering, joining, or producing exact counts; use table or CSV only when that presentation is requested.
Use sonar api get ... when dedicated commands do not expose enough detail. Start with read-only GET requests and consult the connected instance's API description when endpoint support is uncertain:
sonar api get "/api/webservices/list"
API v1/v2 availability differs by Cloud region a
Установить sonarqube в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл sonarqube?
Operate SonarQube-enabled repositories through the SonarQube CLI (`sonar`): verify authentication, discover project keys, inspect project metadata, issues, measures, and quality gates, analyze changed code, scan secrets and dependency risks, call authenticated APIs, trigger remediation, configure integrations, and troubleshoot the CLI. Use whenever the user mentions SonarQube, SonarQube Cloud/SonarCloud, Sonar project details, quality gates, Sonar issues, `sonar` commands, agentic analysis, dependency risks, secrets scanning, or Sonar integrations, even if they do not explicitly name this skill. Do not use for generic static analysis unrelated to SonarQube.
Как установить скилл sonarqube?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл sonarqube запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic