Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

sonar-onboard

БесплатноБез исполняемых скриптовНе проверен

Connects the current repository to a SonarQube project through `sonar init`: logs in, selects the organization, links an existing project or creates one bound…

SonarSourceот SonarSource★ 118 звёзд на GitHub

Об этом скилле

SonarQube — Onboard a repository

Guide the user through sonar init, which logs in, selects the organization, links an existing SonarQube project or creates one bound to the repository, and saves the mapping in .sonar-config.json. sonar init owns the onboarding logic: run it, relay what it reports, and pass the user's decisions to it as flags. Do not recreate its steps with other commands (sonar import, sonar link, sonar api).

sonar init keeps everything it completed. Running it again resumes from what is already in place, so a rerun is always how an interrupted or failed onboarding continues.

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.

Usage

sonar-onboard                        # onboard the current directory
sonar-onboard --path services/api    # onboard another directory of the repository
sonar-onboard --monorepo             # onboard several project roots of a monorepo

Prerequisites

  1. Run sonar --version (macOS/Linux) or sonar.exe --version (Windows) yourself. If sonar is not found, invoke the sonar-install-cli skill, then come back here. If it reports not installed, stop.
  2. If sonar init rejects an option as unknown, the CLI is too old for this skill; it stops before doing anything. Invoke the sonar-install-cli skill to update it, then rerun the same command. Likewise, if sonar init rejects a run with --bind does not apply with --monorepo, the CLI predates monorepo binding: offer to update it the same way, or to map existing projects only (bare --link) instead.

Guardrails

  • Always pass --non-interactive: a prompt would wait for input you cannot type. When sonar init needs an answer, it stops and names the flags that would answer it.
  • Only two ways to onboard exist: link an existing project (--link) or bind, creating a SonarQube Cloud project imported from the repository (--bind). Never pass or suggest any other way.
  • Never create or link a project without the user confirming a --dry-run preview of that exact command.
  • Never run sonar auth login, organization creation or a browser authorization yourself, and never ask the user to paste a token into the chat.
  • Never suggest --bind for a repository that sonar init found an existing project for: it only offers --link then, and refuses to create a second project. If the user wants a separate project, tell them sonar init does not create one for a repository that already has a project.
  • Never delete or rewrite .sonar-config.json, projects or credentials to start over.
  • Never run sonar integrate or the sonar-integrate skill unless the user accepts it in Step 7. Every exit of this skill ends in Step 7, whether onboarding completed, was cancelled or failed, except when the user is not logged in.
  • Never treat the repository as a monorepo on your own: only when the user passed --monorepo, said it holds several projects, or chose it in Step 1.1 after detection found several build roots or unmapped ones.

Validate every value before interpolating it into a command. If a value fails, stop and tell the user what was rejected instead of running the command.

Value Allowed pattern
project key (--link, --root) ^[a-zA-Z0-9_\-\.:]+$, with at least one non-digit
--path, --root path relative path matching ^[a-zA-Z0-9_.][a-zA-Z0-9_\-./]*$, without ..
organization key (sonar auth org) ^[a-zA-Z0-9_\-]+$

Instructions

Step 1 — Inspect the current state

  1. Detect the build roots: follow references/detect-monorepo-projects.md on the repository root. It only reads files. Skip it only when the user named one directory with --path. A root counts as mapped when .sonar-config.json at the repository root maps it; without that file, nothing is mapped. Then:
    • .sonar-config.json already maps one or more roots, and some detected build roots are not mapped: list the mapped roots and the unmapped ones (path, build system, name), and ask with a selector: Onboard the remaining roots (Recommended) / Leave the setup as it is. Onboarding them takes the monorepo path in Step 4, with only the unmapped roots and --bind as the recommended way to create their projects. The mapped roots are left as they are. If a mapped root is the repository root itself and the unmapped roots sit inside it, say that its project may already analyze their f
Полный SKILL.md на GitHub

Установить sonar-onboard в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Glob
Bash(sonar:*)
Bash(which:*)
Bash(Get-Command:*)
Bash(curl:*)
Bash(irm:*)
Bash(iex:*)
Bash(brew:*)
Bash(mise:*)
Bash(find:*)

Вложенные файлы

references/detect-monorepo-projects.md

FAQ

Что делает скилл sonar-onboard?

Connects the current repository to a SonarQube project through `sonar init`: logs in, selects the organization, links an existing project or creates one bound to the repository, and reports its analysis results. Use when the user asks to set up SonarQube for this repository, onboard or connect it to SonarQube, find security vulnerabilities, or check this repo's code quality, when the repository is not linked to a SonarQube project yet, or to add the remaining project roots of a partly onboarded monorepo. It reuses a SonarQube project that already exists for the repository. To wire the agent itself (hooks, MCP Server), use sonar-integrate instead.

Как установить скилл sonar-onboard?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл sonar-onboard запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить sonar-onboard с