sonar-integrate
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.
What this skill does
# Integrate SonarQube Guide the user through installing **sonarqube-cli** (if needed), **updating it to the latest version** when already installed, authenticating, and completing agent-specific integration. Assume SonarQube itself is already set up; this skill only wires the assistant. ## Instructions Interaction rule: for every finite decision, always present predefined selector options (single-choice or multi-choice as appropriate) instead of asking for free-form text. If the user gives an invalid answer, re-show the same selector. ### Step 1 — Check for sonarqube-cli and update it Check if `sonar` is available on the PATH by running `which sonar` (macOS/Linux) or `Get-Command sonar` (Windows) yourself. **If found:** 1. Run **`sonar self-update`** yourself and wait for it to finish. - **If it succeeds:** briefly tell the user the CLI is up to date (or was upgraded), then go to Step 2. - **If it fails:** show the relevant output, suggest they run `sonar self-update` manually (e.g. offline or network issues), then **still continue** to Step 2 if `sonar` remains usable — do not block the rest of the flow unless the binary is missing or broken. **If not found:** pick the platform-appropriate install command from the table below, show it to the user, and ask for explicit confirmation **before running it**. Do **not** execute the command until the user confirms. | Platform | Install command | | ------------- | ------------------------------------------------------------------------------------------------------------------------ | | macOS / Linux | `curl -o- https://raw.githubusercontent.com/SonarSource/sonarqube-cli/refs/heads/master/user-scripts/install.sh \| bash` | | Windows (PS) | `irm https://raw.githubusercontent.com/SonarSource/sonarqube-cli/refs/heads/master/user-scripts/install.ps1 \| iex` | **If the user confirms:** run the command yourself using a shell command. After it finishes, re-run the PATH check (`which sonar` or `Get-Command sonar`) yourself to verify before continuing. **If the user declines:** stop the skill and ask the user to install `sonarqube-cli` manually and then re-invoke the sonar-integrate skill. --- ### Step 2 — Check authentication status Run `sonar auth status` yourself using a shell command. **If already authenticated:** note the connected server and organisation from the output, then skip directly to Step 4. **If not authenticated:** proceed to Step 3. --- ### Step 3 — Authenticate (`sonar auth login`) This step requires user interaction — do **not** run it yourself. First determine the connection type using a single-choice selector with these options: 1. SonarQube Cloud - EU (default) 2. SonarQube Cloud - US 3. Self-hosted SonarQube Server Do not ask an open-ended text question for this decision. Collect: | Scenario | Information needed | | ------------------------------ | ------------------------------------------------------------- | | SonarQube Cloud — EU (default) | organization key (e.g. `my-org`) | | SonarQube Cloud — US | organization key + confirm US region (`https://sonarqube.us`) | | SonarQube Server | server URL (e.g. `https://sonarqube.yourcompany.com`) | Build the login command and show it to the user: | Scenario | Command | | -------------------- | ------------------------------------------------------- | | SonarQube Cloud — EU | `sonar auth login -o <org-key>` | | SonarQube Cloud — US | `sonar auth login -o <org-key> -s https://sonarqube.us` | | SonarQube Server | `sonar auth login -s <server-url>` | Tell the user: > "Run the command below — it will open your browser to log in. The token is stored > securely in your system keychain and never appears in this chat." Wait for the user to confirm they logged in, then run `sonar auth status` yourself to verify before continuing. --- ### Step 4 — Agent-specific integration Pick exactly one branch below based on which agent you are. Do not run the other branches. - Claude Code -> **4.a** - Copilot CLI -> **4.b** - Cursor, Gemini CLI, or Codex -> **4.c** #### 4.a — Claude Code (`sonar integrate claude`) Run **`sonar integrate claude`**, which configures the **SonarQube MCP Server**, **secrets-scanning hooks**, and any other supported integration the CLI applies. It wires **MCP** (for skills like sonar-quality-gate, sonar-analyze, sonar-coverage, sonar-duplication, sonar-dependency-risks) and **secrets-scanning hooks** into the user’s Claude Code config. When available, SonarQube Agentic Analysis hooks are also installed. Ask the user using a single-choice selector with these options: 1. Current project only (default) 2. Global (all projects) Do not ask an open-ended text question for this decision. Then run the appropriate command yourself using a shell command, and adding `--non-interactive`: | Scenario | Command | | ------------ | --------------------------------------------------- | | Project-only | `sonar integrate claude --non-interactive` | | Global | `sonar integrate claude --global --non-interactive` | #### 4.b — Copilot CLI (`sonar integrate copilot`) Run **`sonar integrate copilot`**, which configures the **SonarQube MCP Server**, **secrets-scanning hooks**, and any other supported integration the CLI applies. It wires **MCP** (for skills like sonar-quality-gate, sonar-analyze, sonar-coverage, sonar-duplication, sonar-dependency-risks) and **secrets-scanning hooks** into the user’s Copilot CLI config. Ask the user using a single-choice selector with these options: 1. Current project only (default) 2. Global (all projects) Do not ask an open-ended text question for this decision. Then run the appropriate command yourself using a shell command, and adding `--non-interactive`: | Scenario | Command | | ------------ | --------------------------------------------------- | | Project-only | `sonar integrate copilot --non-interactive` | | Global | `sonar integrate copilot --global --non-interactive` | #### 4.c — Cursor, Gemini CLI, and Codex These agents start the SonarQube MCP Server via `sonar run mcp`, which handles container runtime detection (Docker, Podman, Nerdctl) and authentication automatically. Authentication was handled in Steps 2–3. Confirm that integration is ready — the MCP server will start automatically when the agent reads its config (`mcp.json` for Cursor, and Codex; `gemini-extension.json` for Gemini CLI). --- ### Summary message After all steps complete, print a summary: ``` ✅ SonarQube integration is ready. sonarqube-cli: updated via sonar self-update Authentication: token stored in system keychain MCP Server: configured (restart the agent session if tools do not appear) You can verify at any time with: sonar auth status To refresh CLI + wiring later: invoke the sonar-integrate skill again ``` If path **4.a** (Claude Code) was taken, add this line to the summary: ``` Secrets scanning: hooks registered via sonar integrate claude ``` If path **4.b** (Copilot CLI) was taken, add this line to the summary: ``` Secrets scanning: hooks registered via sonar integrate copilot ``` If **sonarqube-cli was freshly installed** in Step 1, replace the `sonarqube-cli` summary line with `sonarqube-cli: installed`. If **`sonar self-update`** failed in Step 1, adjust the summary: omit the `sonarqube-cli` line or state that the CLI was not updated and suggest `sonar self-update` in a terminal. If any other step failed, note it clearly and suggest the corrective action.
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.