用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Dev-Toolbelt/dev-team-agents --skill sonarqube命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | sonarqube |
| description | SonarQube/SonarCloud — quality gates, SAST, CI/CD integration. |
Load this skill when any of the following are present:
| Signal | Location |
|---|---|
sonar-project.properties | project root |
.sonarcloud.properties | project root |
SONAR_TOKEN or SONAR_HOST_URL | .env, .env.example, CI/CD config |
sonar-scanner, mvn sonar:sonar, ./gradlew sonar | CI/CD pipeline files |
sonarqube service | docker-compose.yml |
sonarqube-scanner or sonar-scanner | package.json, pom.xml, build.gradle |
| SonarCloud | Self-Hosted | |
|---|---|---|
| Hosting | Managed SaaS (sonarcloud.io) | Your infrastructure |
| Config file | .sonarcloud.properties | sonar-project.properties |
| Auth | SONAR_TOKEN → sonarcloud.io | SONAR_TOKEN + SONAR_HOST_URL |
sonar.organization | Required | Not used |
| Pricing | Free for public repos; paid for private | Free Community Edition |
The default Sonar Way gate checks New Code only:
| Metric | Condition |
|---|---|
| Coverage | ≥ 80% |
| Duplicated Lines | < 3% |
| Maintainability / Reliability / Security Rating | A |
| Security Hotspots Reviewed | 100% |
Block CI on gate failure: -Dsonar.qualitygate.wait=true
Load references/quality-gates.md for: full conditions, issue taxonomy (Bug/Vulnerability/Hotspot/Smell), SAST hotspot workflow, the per-language coverage matrix (test runner command → output artifact → sonar.*.reportPaths key), coverage quality rules, and troubleshooting.
Apply to any changeset delivered in a project where SonarQube is detected:
| Issue type | Rule |
|---|---|
| Bug | Do not introduce new ones — treat as a defect, not an optional fix |
| Vulnerability | Do not introduce new ones — blocking, same as a Bug |
| Security Hotspot | If the change touches a hotspot area (cryptography, SQL construction, command execution, path handling), document why it is safe so the reviewer can mark it Safe |
| Code Smell | Fix Blocker and Critical; Major and below may be deferred but must not accumulate as a pattern |
| Coverage | New code must meet the gate threshold (default ≥ 80%); if it does not, flag the gap to the test specialist rather than merging silently |
Generate coverage before the scan — see the coverage matrix in references/quality-gates.md for the exact command per language.
| Scan method | Command |
|---|---|
| CLI | SONAR_TOKEN=xxx sonar-scanner |
| Maven | mvn sonar:sonar -Dsonar.token=$SONAR_TOKEN |
| Gradle | ./gradlew sonar -Dsonar.token=$SONAR_TOKEN |
| Node.js | npx sonarqube-scanner |
Always run tests before the scan so coverage data is available. Use fetch-depth: 0 in CI checkouts.
Load references/configuration.md for: full sonar-project.properties template, GitHub Actions / GitLab CI / Bitbucket Pipelines examples, self-hosted Docker Compose setup, Nginx reverse proxy, plugin installation, and backup/upgrade procedures.
SONAR_TOKEN stored in secret manager — not committed to sourcefetch-depth: 0 in CI checkout stepvm.max_map_count=262144 set on host; backup procedure in place