sonarqube
Skill381 starsChanged 19 days agoMITView on GitHub
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.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- zhubby/skillstheir own version, first seen Nov 8, 2026
- rezkam/boring-but-goodtheir own version, first seen Nov 1, 2026
- Rahlir/clanker-stufftheir own version, first seen Nov 1, 2026
- G1Joshi/Agent-Skillstheir own version, first seen Oct 13, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- G1Joshi/Agent-Skills★ 15same name
- zhubby/skills★ 6same name
- Rahlir/clanker-stuff★ 2same name
- rezkam/boring-but-good★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repositoryOne other file it gives its agents.
- AGENTS.mdAGENTS.md
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. 0 are common, 9 are distinctive, and 9 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
9
Distinctive
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 17
Use the installed sonar CLI as the source of truth for a SonarQube-enabled project.
- Distinctive: line 21
Run these checks from the repository or worktree the user placed in scope:
- Very specific: line 29
If the task involves installation state, integrations, or a confusing auth error, also run sonar system status --json.
- Distinctive: line 37
Use the exact project key, not the display name.
- Distinctive: line 39
Use a project key explicitly supplied by the user.
- Very specific: line 43
Search accessible projects with sonar list projects -q <name-or-key> and disambiguate multiple matches before continuing.
- Distinctive: line 45
Do not silently choose among multiple project matches.
- Very specific: line 61
Before server-side analysis, inspect the selected files or Git change set so the scope is known.
- Distinctive: line 63
After fixing findings, rerun the same analysis scope.
- Distinctive: line 65
If the selected Git scope is empty, report that no files were analyzed.
- Distinctive: line 69
Use the narrowest command that answers the question:
- Very specific: line 77
Add exactly one of --branch <name> or --pull-request <id> when needed.
- Very specific: line 81
Use sonar api get ... when dedicated commands do not expose enough detail.
- Very specific: line 107
Treat sonar system reset --force as destructive: it removes tokens, managed binaries, integrations, and cached files.
- Distinctive: line 124
When a command fails:
- Very specific: line 126
Run its --help and compare flags with the installed version.
- Very specific: line 130
Use sonar api ... --verbose only when needed and redact sensitive request or response data before reporting it.
- Distinctive: line 132
Read authentication.md for credential and network guidance, workflows.md for complete operational recipes, and commands.md for the v1.7.0 …
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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 statusIf 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 --allAdd 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 and Server version. The CLI rewrites supported v2 paths between Cloud and Server, but the server remains the authority. URL-encode project keys and other user-controlled query values.
Handle state-changing commands deliberately
These commands can change local files, credentials, CLI state, code, or remote SonarQube state:
sonar remediatesonar api post|patch|put|delete ...sonar integrate ...sonar auth login|logoutsonar config telemetry ...sonar updatesonar system reset
Resolve exact targets and explain the effect before running them. Browser login must be performed manually by the user; agents cannot authenticate themselves. Never pass tokens in command arguments, logs, committed files, or chat output.
For sonar remediate, preview eligible issue keys with sonar list issues, limit the selection to the requested issues, and note that non-interactive use requires --issues with at most 20 comma-separated keys.
For sonar integrate, inspect existing hooks and agent configuration first because the command writes project or global configuration. Use --non-interactive only after all choices are known. Do not combine project selection with global mode where the installed help marks them mutually exclusive.
Treat sonar system reset --force as destructive: it removes tokens, managed binaries, integrations, and cached files. Run it only when the user explicitly asks for a reset. Likewise, run sonar auth logout, telemetry changes, or an update only on explicit request.
Report results clearly
For inspection tasks, report:
- CLI version and authenticated target without exposing credentials
- resolved project key and how it was resolved
- branch or pull request scope
- the requested result, including pagination or filters
- any product/edition limitation or incomplete API response
- a compact
Queries runlist naming the dedicated commands and GET endpoints used, so the result is auditable without exposing credentials
For analysis tasks, report files/change-set scope, depth, issue counts grouped usefully, exit status, and the next concrete remediation step. Never reproduce detected secret values; report only type and safe location metadata.
Troubleshoot methodically
When a command fails:
- Run its
--helpand compare flags with the installed version. - Recheck
sonar auth statusandsonar system status --json. - Confirm Cloud region or Server URL, organization, exact project key, branch/PR, and permissions.
- Distinguish authentication, entitlement/edition, network/proxy/TLS, Git-scope, and no-findings outcomes.
- Use
sonar api ... --verboseonly when needed and redact sensitive request or response data before reporting it.
Read authentication.md for credential and network guidance, workflows.md for complete operational recipes, and commands.md for the v1.7.0 command inventory.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

