| name | sonar |
| description | Use this skill when the user mentions "sonar", "sonarqube", "code quality", "code smell", "quality gate", "new code issues", "fetch issues", "security hotspots", or wants to analyze code quality. |
SonarQube Integration
Fetch and manage SonarQube issues, quality gates, and metrics using bash scripts.
How to Use
Call bash scripts directly. No MCP server required.
Scripts location: ~/.agents/skills/sonar/scripts/
IMPORTANT: Environment variables must be set. Check with:
echo $SONAR_HOST_URL $SONAR_TOKEN $SONAR_PROJECT_KEY
If empty, add them to your shell profile (~/.bashrc or ~/.zshrc):
export SONAR_HOST_URL="https://sonarqube.example.com"
export SONAR_TOKEN="sqa_xxxxxxxxxxxx"
export SONAR_PROJECT_KEY="my-project-key"
Available Commands
Set SKILL_DIR=~/.agents/skills/sonar
Fetch Issues
bash $SKILL_DIR/scripts/fetch-issues.sh --severity HIGH,MEDIUM
bash $SKILL_DIR/scripts/fetch-issues.sh --severity HIGH
bash /scripts/fetch-issues.sh --severity HIGH --new-code
bash /scripts/fetch-issues.sh --file src/main/java/MyClass.java