Sonarqube logo

Sonarqube

Community
686f6c61
sonarqube

Levantar SonarQube con Docker, analizar el código y proponer mejoras. También: análisis estático, deuda técnica, code smells, cobertura, calidad automatizada.

Overview

Publisher686f6c61
Repositoryalfred-dev
Skill namesonarqube
Stars
115
Forks
7
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by 686f6c61 on GitHub. Read the source before you install it.

Installation

Install the Sonarqube AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/686f6c61/alfred-dev.git /tmp/alfred-dev
mkdir -p .claude/skills
cp -r /tmp/alfred-dev/skills/sonarqube .claude/skills/sonarqube
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Sonarqube in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Sonarqube on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Sonarqube is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Análisis de calidad con SonarQube

Resumen

Este skill levanta una instancia de SonarQube con Docker, ejecuta un análisis del código del proyecto y traduce los resultados en propuestas de mejora accionables. SonarQube detecta bugs, vulnerabilidades, code smells y problemas de cobertura que las herramientas de linting no cubren.

No sustituye al qa-engineer ni al security-officer: complementa su trabajo con una segunda opinión automatizada basada en reglas estáticas probadas en millones de proyectos.

Proceso

Paso 1: preflight de Docker y permisos

Comprobar si Docker está disponible y si el daemon responde:

bash
docker --version
docker info

Interpreta el resultado con estas reglas:

  • Si docker --version falla: Docker no está instalado. Explica al usuario que SonarQube lo necesita y que la instalación puede requerir permisos de administrador.
  • Si docker --version funciona pero docker info falla: Docker está instalado, pero el daemon no está disponible. Explica al usuario que hay que arrancar Docker Desktop o el servicio del sistema antes de continuar.

No instales Docker, no abras Docker Desktop y no arranques el daemon sin aprobación explícita del usuario. Si la orden viene desde /alfred audit, respeta la decisión tomada en su preflight. Si no existe una autorización previa, pídela ahora y espera respuesta.

Si el usuario autoriza la instalación, instala la última versión estable según la plataforma:

macOS:

bash
brew install --cask docker
open -a Docker

Linux (Ubuntu/Debian):

bash
curl -fsSL https://get.docker.com | sh
sudo systemctl start docker
sudo usermod -aG docker $USER

Windows (PowerShell como administrador):

powershell
winget install Docker.DockerDesktop

Si el usuario autoriza arrancar Docker cuando está instalado pero el daemon no responde, usa la estrategia mínima necesaria para la plataforma:

macOS:

bash
open -a Docker

Linux (systemd):

bash
sudo systemctl start docker

Windows (PowerShell):

powershell
Start-Process "C:\Program Files\Docker\Docker\Docker Desktop.exe"

Después de instalar o arrancar Docker, verifica otra vez con docker info.

  • Si docker info responde correctamente, continúa.
  • Si el usuario rechaza la instalación o el arranque, o si el daemon sigue sin responder, detén aquí la rama de SonarQube y devuelve un resultado explícito: "SonarQube omitido por decisión del usuario o por falta de permisos". No intentes forzarlo por otras vías.

Paso 2: levantar SonarQube

Antes de levantar el contenedor:

  • Comprueba si ya existe sonarqube-alfred. Si existe de una ejecución anterior, elimínalo primero para evitar conflictos:
bash
docker rm -f sonarqube-alfred 2>/dev/null || true
  • Comprueba si el puerto 9000 ya está en uso. Si lo está, detén la ejecución y pregunta al usuario si quiere liberar ese puerto o continuar sin SonarQube. No mates procesos por tu cuenta.
bash
docker run -d --name sonarqube-alfred -p 9000:9000 sonarqube:community

Esperar a que SonarQube esté listo (puede tardar 1-2 minutos):

Usa este bucle exacto o uno equivalente. No uses la variable status en scripts de shell: en zsh es de solo lectura y romperá la espera. Si necesitas guardar el estado en una variable, usa sonar_status.

bash
until curl -s http://localhost:9000/api/system/status | grep -q '"status":"UP"'; do sleep 5; done

Credenciales por defecto: admin/admin. Cambiar la contraseña en el primer acceso.

Paso 3: configurar el proyecto

  • Crear un proyecto en SonarQube (vía API o interfaz web).
  • Generar un token de autenticación para el análisis.
  • Crear o verificar el fichero sonar-project.properties en la raíz del proyecto:
properties
sonar.projectKey=nombre-del-proyecto
sonar.sources=src
sonar.tests=tests
sonar.language=ts
sonar.sourceEncoding=UTF-8

Adaptar según el stack del proyecto (lenguaje, directorios de código y tests).

Paso 4: ejecutar el análisis

Para proyectos Node/TypeScript:

bash
npx sonarqube-scanner

Para proyectos Python:

bash
pip install pysonar-scanner && pysonar-scanner

Alternativa universal con Docker:

bash
docker run --rm -v "$(pwd):/usr/src" sonarsource/sonar-scanner-cli

Paso 5: interpretar resultados

Acceder a http://localhost:9000 y revisar el dashboard del proyecto. Clasificar los hallazgos por:

  • Bugs: errores que pueden causar comportamiento incorrecto. Prioridad alta.
  • Vulnerabilidades: problemas de seguridad detectados por reglas OWASP/CWE. Notificar al security-officer.
  • Code smells: problemas de mantenibilidad. Priorizar los de mayor impacto.
  • Cobertura: porcentaje de código cubierto por tests. Identificar zonas sin cobertura críticas.

Paso 6: generar informe de mejoras

Crear un informe con:

  • Resumen ejecutivo: métricas principales (bugs, vulnerabilidades, cobertura, deuda técnica).
  • Top 10 hallazgos por impacto con la corrección propuesta.
  • Zonas de código con mayor densidad de problemas.
  • Comparación con el análisis anterior si existe.

Paso 7: limpiar

Cuando el análisis esté completo y los resultados revisados:

bash
docker stop sonarqube-alfred && docker rm sonarqube-alfred

Si el análisis falla a mitad del proceso, intenta igualmente la limpieza final del contenedor temporal antes de salir.

Qué NO hacer

  • No dejar SonarQube corriendo indefinidamente. Es una herramienta de análisis puntual, no un servicio permanente.
  • No instalar Docker, arrancar el daemon ni abrir Docker Desktop sin permiso explícito del usuario.
  • No tratar todos los hallazgos como iguales. Priorizar por impacto real, no por cantidad.
  • No corregir hallazgos sin entender por qué SonarQube los marca. A veces los falsos positivos existen.
  • No sustituir los code reviews humanos por SonarQube. Son complementarios.

Referencia al stack

Consultar el stack detectado en la configuración de Alfred para seleccionar el scanner adecuado (Node.js, Python, etc.) y configurar automáticamente el fichero sonar-project.properties con el lenguaje y los directorios correctos.

Frequently asked questions

What does the Sonarqube AI skill do?

Levantar SonarQube con Docker, analizar el código y proponer mejoras. También: análisis estático, deuda técnica, code smells, cobertura, calidad automatizada.

Why use Sonarqube on TypingMind?

Because you install it once and use it with any model. Sonarqube is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Sonarqube in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/686f6c61/alfred-dev/tree/main/skills/sonarqube. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Sonarqube?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Sonarqube?

As many as you like. As long as a model supports skills, you can use Sonarqube with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Sonarqube AI skill free?

Yes. It is published on GitHub by 686f6c61 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇