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★ 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
- Run
sonar --version(macOS/Linux) orsonar.exe --version(Windows) yourself. Ifsonaris not found, invoke the sonar-install-cli skill, then come back here. If it reports not installed, stop. - If
sonar initrejects 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, ifsonar initrejects 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. Whensonar initneeds 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-runpreview 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
--bindfor a repository thatsonar initfound an existing project for: it only offers--linkthen, and refuses to create a second project. If the user wants a separate project, tell themsonar initdoes 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 integrateor 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
- 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.jsonat the repository root maps it; without that file, nothing is mapped. Then:.sonar-config.jsonalready 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--bindas 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
Установить sonar-onboard в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadGlobBash(sonar:*)Bash(which:*)Bash(Get-Command:*)Bash(curl:*)Bash(irm:*)Bash(iex:*)Bash(brew:*)Bash(mise:*)Bash(find:*)Вложенные файлы
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), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic