local-sonarqube-setup

local-sonarqube-setup is a skill for Codex from mushroomTW/MushroomTW-Skills. It costs 83 tokens per session (1,792 once invoked), scanned A, original, MIT.

A setup workflow for connecting a code project to SonarQube, a tool that scans source code for quality and security issues, running the scan locally, and checking its quality result.

In plain words
What is it for?
Use it to set up a local Docker SonarQube instance, analyze Java, .NET, JavaScript, Python, or other supported projects, and investigate a failed quality check.
Why use it?
It removes guesswork around choosing the scanner, configuring credentials, and verifying whether the scan passes the project's quality rules.

Skill for Codex

Written for Codex: agents/openai.yaml present. Also seen: mentions AGENTS.md.

Good fit Use it to set up a local Docker SonarQube instance, analyze Java, .NET, JavaScript, Python, or other supported projects, and investigate a failed quality check.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mushroomtw/mushroomtw-skills/local-sonarqube-setup
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add mushroomTW/MushroomTW-Skills --skill local-sonarqube-setup
Clone the repo
git clone --depth 1 https://github.com/mushroomTW/MushroomTW-Skills

Made for: Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for local-sonarqube-setup

README.md
[![agentmods](https://agentmods.dev/badge/skills/mushroomtw/mushroomtw-skills/local-sonarqube-setup/github.svg)](https://agentmods.dev/skills/mushroomtw/mushroomtw-skills/local-sonarqube-setup)
Your own site
<a href="https://agentmods.dev/skills/mushroomtw/mushroomtw-skills/local-sonarqube-setup"><img src="https://agentmods.dev/badge/skills/mushroomtw/mushroomtw-skills/local-sonarqube-setup/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for local-sonarqube-setup

Your own site · 80×15
<a href="https://agentmods.dev/skills/mushroomtw/mushroomtw-skills/local-sonarqube-setup"><img src="https://agentmods.dev/badge/skills/mushroomtw/mushroomtw-skills/local-sonarqube-setup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 83 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,792 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00083 $0.01792
Opus 5 $0.00042 $0.00896
Sonnet 5 $0.00017 $0.00358
Haiku 4.5 $0.00008 $0.00179

Measured 11d ago against content hash bf981ec8e926, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

local-sonarqube-setup scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

local-sonarqube-setup/SKILL.md · 73 lines

How it starts

The opening of the file, as written. The whole thing — 73 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Local SonarQube Setup

Local Docker at 127.0.0.1:9000 · PowerShell on Windows · SONAR_TOKEN env only · no scanner install.

TL;DR routing

pom.xml / build.gradle[.kts] exists? → use mvn/gradle plugin, not CLI
*.csproj / .sln? → .NET scanner required; SONAR_TOKEN env unsupported → credential STOP
NPM / Python / Other? → sonar-scanner CLI (or Docker fallback)
shallow clone? → git fetch --unshallow before scan
Java <21 and auto-provisioning OFF? → upgrade or enable auto

Invariants

  1. Token only in process memory — never in args/URL/log/file; describe only as set/not set; if leaked → tell user to revoke; read once and do all steps in same process, no setx, clear only after verify.
  2. Never fake Gate with Accepted/False positive/disabling rules/server-side threshold edits; never change production code/build semantics to pass.
  3. Do not add services, modify CI/compose, commit or push unless explicitly asked; preserve uncommitted changes; do not overwrite unrelated files.
  4. Output only non-sensitive summaries (status, key, CE, Gate, URL), never full logs; query issues/measures only on failure or request.
  5. Discover language/build/coverage from repo, not defaults; Community Build loads only supported languages.

Workflow — 4 phases, 7 steps

Phase Step Action Output 🛑 Checkpoint
A · Preflight 1 Discovery Read AGENTS.md/README/build docs/sonar config; git status --short; derive language/sources/tests/reports. Shallow=truegit fetch --unshallow. Not git→note no rollback. Evidence table (path→source)
2 Service+Scanner+Java GET /api/system/status=UP; sonar-scanner --version; java -version 21+ (or 11+ if auto-provisioning ON — CLI 6.0+ default). Scanner per table: Maven mvn verify sonar:sonar · Gradle gradle sonar · .NET requires dotnet sonarscanner, but current scanner does not support env-only token transport · Other CLI. Docker CLI permission fail ≠ blocker. UP + version + chosen scanner 🔴 Scanner+Java if mixed toolchain; 🔴 .NET credential STOP
B · Setup 3 Project Key order: sonar.projectKey.sonarlint/connectedMode.json → git remote → dir name; sanitize [A-Za-z0-9-_.:] not all digits; monorepo ambiguity→ask. Query mcp__sonarqube__search_my_sonarqube_projects; host mismatch→stop. Reuse or POST /api/projects/create. key / name / dashboard URL 🔴 Key/name before create (cannot delete)
4 Config Minimal merge into sonar-project.properties (create only if none). Exclude only confirmed artifacts, never whole src/tests. Hierarchy Global < Project < file < CLI (file/CLI not persisted; Global Exclusions cannot override). sonar.projectBaseDir/project.settings in reference/commands.md §5. Diff shown 🔴 Diff before write
C · Execute 5 Reports Run repo checks/tests first (report failures). Then native coverage before scanner; format per reference/coverage.md (JaCoCo jacoco.xmlsonar.coverage.jacoco.xmlReportPaths, JS lcov.infosonar.javascript.lcov.reportPaths, Python coverage.xmlsonar.python.coverage.reportPaths, .NET Coverlet/dotCover→sonar.cs.*, Generic→sonar.coverageReportPaths). Verify non-empty. None→state none. path (bytes, format) list
6 Scan Same process: SONAR_HOST_URL + SONAR_TOKEN → run chosen scanner. Need EXECUTION SUCCESS + exit 0 + key/URL match. Docker fallback: sonar-scanner-cli with -v cache:/opt/sonar-scanner/.sonar/cache (user 1000 RW, Windows→host.docker.internal). OOM→SONAR_SCANNER_JAVA_OPTS="-Xmx512m" (pre-6.0 SONAR_SCANNER_OPTS). 3-line summary
D · Verify 7 CE+Gate+Wrap CE: parse .scannerwork/report-task.txt → poll GET /api/ce/task?id= to SUCCESS/FAILED (5m; timeout→report taskId+status). Gate: mcp__sonarqube__get_project_quality_gate_status; ERROR→list name: actual vs threshold, hand back. Wrap: add .scannerwork//coverage to ignore, git diff --check+git status --short, report key/Gate/imported types/URL. Debug: sonar.scanner.internal.dumpToFile or Background Tasks > Show SonarScanner Context. CE / Gate / URL

Read the full file on GitHub · 73 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 73 lines · 83 tokens per session scan A bf981ec8e926

Subscribe to this mod's changes

local-sonarqube-setup is a skill published in the GitHub repository mushroomTW/MushroomTW-Skills (0 stars, last pushed yesterday), licensed MIT. It adds 83 tokens to every session and 1,792 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

ai-development-guide

Applies language-agnostic and backend technical decision criteria, anti-pattern detection, debugging, and quality gates. Use when reviewing general/backend implementation choices, code smells, failures, or implementation completeness.

shinpr/claude-code-workflows · 43 tokens

dorodango

Polishes working code through successive quality passes in fresh subagents. Use after tests pass when code needs multi-dimension refinement before release.

athola/claude-night-market · 31 tokens

ring:searching-code

Forensic code search and analysis with optional Chain of Draft (CoD) ultra-concise mode. Five-phase methodology (clarification, planning, execution, analysis, synthesis) with severity assessment. Use for targeted investigation of specific patterns, bugs, or vulnerabilities. Skip for broad architecture mapping (use…

LerianStudio/ring · 74 tokens

ring:test-driven-development

Enforcing the RED-GREEN-REFACTOR loop: write one failing test and watch it fail, write minimal code to pass, then refactor green. Use when starting implementation of a new feature or bugfix, or writing any new production code. Requires pasted failure output as proof of RED; code written before its test must be…

LerianStudio/ring · 89 tokens

argot-refresh

Refresh Argot's committed fit snapshot safely — first diagnose why maintenance is recommended, re-audit corpus scope and structural path changes, review stale mutes and policy entries with the user, then fit locally, verify, and prepare the reviewed .argot/ update. Use when argot status, argot check, MCP, or CI…

get-tmonier/argot · 136 tokens

code-confidence-map

Assesses code comprehensibility and maintainability risk. Use when the user asks about code confidence, risk, maintainability, tech debt, code health, or whether code is safe to change. Also use when the user asks to analyze code quality, scan for risks, check if code is messy or complex, audit code, do a code…

kanyun-inc/reskill · 104 tokens