基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/SonarSource/sonarqube-agent-plugins --skill sonar-list-projects命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | sonar-list-projects |
| description | List SonarQube projects accessible to the current user |
| argument-hint | [search-query] |
| allowed-tools | Bash(sonar:*) |
List SonarQube projects accessible to the authenticated user. Useful for discovering project keys before running other skills.
sonar-list-projects # list all accessible projects
sonar-list-projects my-project # search by name or key
This skill uses the sonarqube-cli command. The CLI must be installed and authenticated before proceeding.
Before proceeding, verify that sonar is available on your PATH and authenticated. If it is not, do not attempt to call any alternative commands or invent alternatives, and show the user:
Unable to list projects.
Possible causes:
sonarqube-clinot installed or not authenticated — invoke the sonar-integrate skill
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 re-check and continue; if they decline, stop.
--query.If a --query search term was provided, validate it matches ^[a-zA-Z0-9_\-\. ]+$. If it does not, stop and tell the user what was rejected — do not run the command.
sonar list projectsBuild and run the command using a shell command:
sonar list projects [--query <search-term>]
Only include --query if a search term was provided.
If projects are found:
## SonarQube Projects
Found **8 project(s)**:
| Project key | Name |
| ----------------- | --------------- |
| my-org_backend | Backend Service |
| my-org_frontend | Frontend App |
| my-org_shared-lib | Shared Library |
If no projects are found:
## SonarQube Projects
No projects found. If you expected results, check your authentication with `sonar auth status`.
If the result is paginated (500 projects returned), note: "Showing first 500 projects. Use a search term to narrow results."
sonar.projectKey is in sonar-project.properties — the CLI always requires -p."Show SonarQube quality gate status for a project — pass/fail and each condition (metric key, threshold, actual value), plus worst-offender breakdowns. Project key optional — resolved from `sonar-project.properties` or the MCP integration default.
Analyze a file for quality and security issues using SonarQube
Installs sonarqube-cli if not already installed, authenticates, and integrates SonarQube with the current agent (installs analysis hooks & SonarQube MCP Server). Use when the user wants to set up SonarQube integration or asks to configure SonarQube.