Files
Bifrost/.claude/skills/sonarqube-plugin-development/SKILL.md
T

3.2 KiB

name, description
name description
sonarqube-plugin-development Use when adding or changing Java plugin entry points, extension registration, properties, web services, manifest metadata, or packaging compatibility for SonarQube Community Build 25.9.0.112764.

SonarQube plugin development

  • Target SonarQube Community Build 25.9.0.112764; use Java 17 bytecode and the matching public plugin API (13.0.0.3026, confirmed from the target server dependency metadata).
  • Declare all server extensions through Plugin.Context.addExtensions; keep constructors free of service work.
  • Use only org.sonar.api.* public API. Never import org.sonar.server.*, DAO classes, or implementation packages.
  • Define settings through PropertyDefinition; secured values must use a .secured key and PASSWORD type.
  • Add web services using WebService and @ServerSide; authorize each action explicitly.
  • Inspect the pinned API JAR before importing any auth type. org.sonar.api.user.UserSession and org.sonar.api.permissions.GlobalPermission are absent from API 13.0.0.3026. The current implementation reads current-user permissions through the public Request.localConnector() interface and must be checked against the target server's response.
  • Set key, display name, version and minimum plugin API version in packaging metadata. The manifest Sonar-Version is an API version, not a SonarQube product release. Keep the minimum tested server release separately.
  • Use SLF4J supplied by the host; never package logging implementations or log credentials.
  • Verify extension APIs against the exact API artifact/Javadoc when changing the target release.
  • For project creation, prefer the browser's same-origin public SonarQube REST call when the logged-in user's session must be preserved; do not invoke internal project creation services from a plugin endpoint.

Checklist

  • Entry point and only public API types.
  • Extensions registered and server side scoped correctly.
  • Secure configuration and explicit authorization.
  • Manifest key/name/version/minimum version inspected in final JAR.
  • mvnw verify succeeds.

Sources

Not verified

  • Full target-tag SonarQube source checkout was not available; API pin follows target dependency metadata and the published 25.8/25.10 compatibility table.
  • The target server's api/users/current permissions response and local connector caller context were not tested live.