sonar-dependency-risks
БесплатноБез исполняемых скриптовНе проверенSearch for software composition analysis (SCA) dependency risks in a SonarQube project (project key optional when MCP integration already defines the default…
от SonarSource★ 118 звёзд на GitHubОб этом скилле
SonarQube — Dependency Risks
Search for dependency risks (software composition analysis issues) in a SonarQube project, paired with the releases that appear in the analysed project, application, or portfolio.
Usage
sonar-dependency-risks # risks in the current project
sonar-dependency-risks my-project # risks in a specific project
sonar-dependency-risks my-project --branch feature/auth
sonar-dependency-risks my-project --pr 42
Prerequisites
This skill requires SonarQube Advanced Security (available on SonarQube Cloud Enterprise plan, or SonarQube Server 2025.4 Enterprise edition or higher), the SonarQube MCP Server to be configured, and the tool mcp__sonarqube__search_dependency_risks to be available in your session.
Before proceeding, verify the tool is accessible. If it is not, try the CLI fallback in Step 3 before giving up — don't invent other CLI commands (e.g. sonar mcp call or sonar dependency-risks do not exist).
If the CLI fallback also fails or doesn't apply, narrow down the cause — check whether the sonarqube MCP server is enabled in this agent's configuration. (This only explains missing tools, not the Advanced Security entitlement — see the first cause below.)
- Not enabled / not registered → recommend running the sonar-integrate skill.
- Enabled but its tools are still unavailable → configuration is correct but the server failed to start. The most common cause is that the container runtime is not running — the MCP server launches inside Docker/Podman/Nerdctl via
sonar run mcp, so a correctly configured server still produces no tools if the daemon is stopped. Rundocker psyourself (falling back topodman ps/nerdctl ps) to confirm which cause applies: if it errors, the runtime is down; after the user starts it, confirm the same command succeeds before asking them to restart the agent session.
Either way, show the user:
Unable to fetch dependency risks.
Possible causes:
- This feature requires SonarQube Advanced Security — available on SonarQube Cloud Enterprise edition, or SonarQube Server 2025.4 Enterprise or higher
- MCP server not registered — invoke the sonar-integrate skill to configure the SonarQube MCP Server, then restart the agent session
- Container runtime not running — the SonarQube MCP Server runs inside a container (Docker, Podman, or Nerdctl); start your container runtime, then restart the agent session
- Credentials not configured — invoke the sonar-integrate skill
- Project key is wrong or no default project in MCP config — pass an explicit key, or verify
sonar-project.properties/ re-run the sonar-integrate skill for this project
Then ask the user (yes/no) whether to run the sonar-integrate skill now. Briefly explain what it does: it checks the SonarQube setup on their machine — installing or updating sonarqube-cli and verifying authentication — and re-configures the integration for this agent, including the SonarQube MCP server and secrets-scanning hooks. If they confirm, invoke the sonar-integrate skill yourself and follow it end-to-end in this session, then ask the user to ensure a container runtime (Docker, Podman, or Nerdctl) is running and to restart the agent session so the new MCP tools become available; if they decline, stop.
Instructions
Step 1: Resolve the project key (only when needed)
MCP tools sometimes do not require projectKey after the sonar-integrate skill has stored the default project for this workspace. Resolve a key only when you must pass it (tool schema requires it, or the user targets another project):
- If the user provided a project key, use it.
- Otherwise look for
sonar.projectKeyinsonar-project.propertiesat the repo root. - If still not found, omit
projectKeyin MCP calls and rely on the integration default.
Step 2: Parse optional flags from the user-provided arguments
| Flag | Maps to parameter |
|---|---|
--branch <name> |
branch |
--pr <id> |
pullRequest |
--branch and --pr are mutually exclusive — if the user passes both, stop and ask which one they mean. Omit both to use the default branch.
Step 3: Call mcp__sonarqube__search_dependency_risks
Include projectKey only if you resolved one in Step 1 and the tool requires it; otherwise omit it.
{
"projectKey": "<only-if-required>",
"branch": "<name>", // if --branch was given
"pageIndex": 1,
"pageSize": 50
}
For --pr, replace branch with pullRequest and use the SonarQube pull request key as its value. Omit projectKey from the payload when the integration default applies. Include at most one of branch and pullRequest, and omit unused optional fields.
If a page returns 50 results, request the next page with pageIndex incremented. Stop when a page contains fewer than 50 results, and combine all pages in the order th
Установить sonar-dependency-risks в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadGrepBash(docker ps:*)Bash(podman ps:*)Bash(nerdctl ps:*)Bash(sonar:*)FAQ
Что делает скилл sonar-dependency-risks?
Search for software composition analysis (SCA) dependency risks in a SonarQube project (project key optional when MCP integration already defines the default project)
Как установить скилл sonar-dependency-risks?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл sonar-dependency-risks запускает скрипты?
Нет, скилл состоит только из инструкций (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