docs: remove project-local skills

This commit is contained in:
arnaud.dartois committed 2026-11-16 21:01:47 +01:00
1 parent b643ffe51b
commit 890c939b80
13 files changed
+3 -391

No files matched your search

@@ -1,35 +0,0 @@
---
name: docker-test-environment
description: Use when changing Bifrost's local Docker build, disposable SonarQube/Gitea/PostgreSQL stack, or plugin mounting.
---
# Docker test environment
- Follow common `disposable-test-environment` and `devops-engineering` for isolation, synthetic data, secret handling, and exact cleanup verification. This skill defines Bifrost's service graph and plugin-specific acceptance recipe.
- Pin SonarQube Community Build to `25.9.0.112764-community`; pin PostgreSQL and Gitea image tags. Provide health checks, start dependencies before SonarQube, and persist database data in named volumes.
- Mount the built plugin JAR read-only into `/opt/sonarqube/extensions/plugins/` and restart SonarQube after packaging. Keep the Compose test stack isolated from production volumes and endpoints.
- Use test-only credentials from environment variables; never commit live tokens. Document Linux Docker host kernel prerequisites, including `vm.max_map_count` when required by the bundled search engine.
- Run full import tests under dedicated Compose project `bifrost-e2e` and its named volumes. A reset may remove only that project's volumes. On Windows use `./scripts/e2e.ps1`, which invokes the native Windows Docker CLI rather than WSL Docker.
- Pin the browser runner image and Playwright npm dependency to the same release; retain `package-lock.json` and install with `npm ci`.
- Bootstrap Gitea through its CLI and documented API; configure SonarQube through documented Web APIs, then run a real Chromium page test.
- The successful isolated stack is intentionally left available for inspection after a pass; document the exact dedicated-project command that removes it. On failure retain the stack and Playwright diagnostics as specified in `local-e2e-validation`.
## Checklist
- [ ] All service image tags pinned.
- [ ] Health checks and durable named DB volumes present.
- [ ] Test plugin mount path correct.
- [ ] Setup and credentials documented safely.
- [x] Zero-to-import runner resets only its isolated project, checks readiness, and asserts created projects and links.
- [ ] Browser version and npm package are pinned together with a lockfile.
## Sources
- SonarQube Docker setup: https://docs.sonarsource.com/sonarqube-community-build/server-update-and-maintenance/update/update (consulted 2026-10-28)
- SonarQube Docker image tags: https://hub.docker.com/_/sonarqube (consulted 2026-10-28)
- Docker Compose specification: https://docs.docker.com/compose/compose-file/ (consulted 2026-10-28)
- Playwright Docker: https://playwright.dev/docs/docker (consulted 2026-10-29)
- Gitea administration CLI: https://docs.gitea.com/administration/command-line/ (consulted 2026-10-29)
- Gitea 1.23 token creation: https://docs.gitea.com/api/1.23/operations/user-create-token/ (consulted 2026-10-29)
- Gitea 1.23 organization repository creation: https://docs.gitea.com/api/1.23/operations/create-org-repo/ (consulted 2026-10-29)
- SonarQube page extension: https://docs.sonarsource.com/sonarqube-community-build/extension-guide/developing-a-plugin/adding-pages-to-the-webapp (consulted 2026-10-29)
## Not verified
- Windows Docker image startup and local cross-container import passed via `./scripts/e2e.ps1` on 2026-10-29. Linux Docker execution of `scripts/e2e.sh` has not been run on this host.
-28
View File
@@ -1,28 +0,0 @@
---
name: gitea-actions-ci
description: Use when changing Bifrost's Gitea Actions workflow, Maven artifact upload, release commits, tags, or Gitea release publishing.
---
# Gitea Actions CI
- Follow common `devops-engineering` and `gitea-delivery-workflow` for general CI security, runner, permissions, PR validation, and delivery policy. This skill defines only Bifrost's workflow behavior and Maven graph.
- Store workflows in `.gitea/workflows/*.yml`; configure push, pull request, and manual dispatch as needed. The current build graph checks out complete history and tags before running `scripts/version.sh`, sets up Java 17, validates changelog formatting on pull requests, runs Maven verification, and uploads `sonar-bifrost-plugin-${revision}.jar`.
- Preserve Maven's version injection through `-Drevision` and its pinned wrapper/toolchain. Cache only Maven dependencies; never cache secrets or print tokens.
- The release job is restricted to a push to the configured main branch, a release-needed result from the version script, and a workflow-generated-commit guard. Do not rely only on `[skip ci]`.
- Release publication follows `release-versioning-changelog`: update changelog, commit, tag that commit, push commit/tag, and create a Gitea release from the exact changelog section. Use repository secrets only for authenticated push/release, and document the branch protection permissions required for that identity.
- Prevent release loops by checking the release actor/commit marker and tag state. Never force-move a published tag.
- Verify actual Gitea and act_runner versions, supported actions/images, mirrors, and branch protection before claiming workflow compatibility. Current action sources are GitHub-hosted (`actions/checkout`, `actions/setup-java`, `actions/upload-artifact`); an isolated runner may require mirrors or outbound GitHub access.
## Checklist
- [ ] Full history and tags available before version calculation.
- [ ] PR validates changelog without mutation and builds the Maven artifact.
- [ ] Release job guarded against loops and branch scope.
- [ ] Release secret is only used for authenticated publication.
- [ ] Actions are act_runner compatible or mirror requirements documented.
## Sources
- Gitea Actions documentation: https://docs.gitea.com/usage/actions/overview (consulted 2026-10-28)
- Gitea Actions migration guide: https://docs.gitea.com/usage/actions/comparison (consulted 2026-10-28)
- Gitea Actions API documentation: https://docs.gitea.com/api/ (consulted 2026-10-28)
## Not verified
- Runner version, main branch name, protected-branch policy, and release workflow against a live Gitea runner are not confirmed by repository configuration.
-28
View File
@@ -1,28 +0,0 @@
---
name: gitea-api-client
description: Use when implementing or modifying Gitea API requests, pagination, authentication, DTOs, errors, or HTTP retry behavior.
---
# Gitea API client
- Assume Gitea REST API v1 (OpenAPI documented by Gitea); use documented paths: `/user/orgs`, `/orgs/{org}/repos`, and `/user/repos` when personal repositories are enabled.
- Send the token only in the server-side `Authorization: token …` header; never echo it or include it in exceptions.
- Paginate with bounded `page` and `limit` parameters and stop only when a page is shorter than the requested limit.
- Use `java.net.http.HttpClient` with explicit connect and request timeouts.
- Do not automatically retry non-idempotent operations. If retries are added for GET, cap attempts and honor `Retry-After` when valid.
- Map 401 to invalid token, 403 to insufficient Gitea access, 404 to missing organization/resource, 429 to rate limit, and 5xx/network failures to temporary service errors.
- Parse only fields needed by the UI; handle absent optional branch fields safely.
- Validate configured base URL and disable redirects to prevent token forwarding to another host.
## Checklist
- [ ] Token remains server side and is redacted.
- [ ] Pagination bounded and tested.
- [ ] Timeouts and status mappings are explicit.
- [ ] Redirects disabled; base URL validated.
## Sources
- Gitea API documentation: https://docs.gitea.com/api/ (API 28.2.0 consulted 2026-10-28)
- Gitea user/org operations: https://docs.gitea.com/api/1.26/operations/tags/organization/ (consulted 2026-10-28)
- Java HttpClient: https://docs.oracle.com/en/java/javase/17/docs/api/java.net.http/java/net/http/HttpClient.html (consulted 2026-10-28)
## Not verified
- Deployment-specific Gitea version is unspecified; current endpoint compatibility across older Gitea versions must be checked against the test instance.
@@ -1,27 +0,0 @@
---
name: java-best-practices
description: Use when writing or reviewing Java production code in this plugin, especially HTTP, validation, lifecycle, concurrency, or error handling.
---
# Java best practices
- Compile with Java 17 (`maven.compiler.release=17`), the baseline supported by the target plugin API.
- Prefer immutable records for internal DTOs where compatible with JSON parsing; keep collections defensively copied.
- Validate null, length, and format at service boundaries. Use named constants for bounds and timeouts.
- Use try-with-resources for closeable resources; `java.net.http.HttpClient` is reusable and immutable.
- Do not create static mutable state, swallow exceptions, catch `Throwable`, or catch broad `Exception` without translating a known boundary failure.
- Keep errors actionable but never include authorization headers, tokens, or full secret-bearing URLs.
- Use SLF4J host-provided logging; log operation context without credentials.
- Keep packages under `cc.tordais.sonar.bifrost`; name types and methods in ASCII English.
## Checklist
- [ ] Java 17 compilation; immutable data and bounded inputs.
- [ ] Exceptions translated at boundaries, not hidden.
- [ ] No static mutable state or secret-bearing logs.
- [ ] Resources and HTTP timeouts handled.
## Sources
- SonarQube API JDK baseline: https://github.com/SonarSource/sonar-plugin-api (consulted 2026-10-28)
- Java 17 API documentation: https://docs.oracle.com/en/java/javase/17/docs/api/ (consulted 2026-10-28)
## Not verified
- No project-specific Sonar quality profile has been run yet.
-27
View File
@@ -1,27 +0,0 @@
---
name: java-testing
description: Use when adding or changing unit or integration tests for Java services, validation, project keys, or HTTP interactions.
---
# Java testing
- Use pinned JUnit Jupiter and AssertJ; use Mockito only for narrow collaborator seams.
- Mock HTTP at the transport boundary with a local in-process `HttpServer`; tests must not need a real Gitea instance or network.
- Test pagination, authentication failures, 404, 5xx, malformed payloads, timeout behavior, and secret redaction.
- Test project-key sanitization, invalid/empty inputs, and collisions across distinct source names.
- Test organization allowlist behavior in both fixed and all-accessible modes.
- Use deterministic fixtures, no sleeps, no dependence on wall-clock except injected clock behavior.
- Run `./mvnw test` (Windows: `mvnw.cmd test`) and report only results actually run.
## Checklist
- [ ] Gitea HTTP paths and failure mapping covered.
- [ ] Key and organization boundary cases covered.
- [ ] Tests are offline and deterministic.
- [ ] Test suite passes with Maven Wrapper.
## Sources
- JUnit 5 User Guide: https://junit.org/junit5/docs/current/user-guide/ (consulted 2026-10-28)
- AssertJ documentation: https://assertj.github.io/doc/ (consulted 2026-10-28)
- Java HttpServer API: https://docs.oracle.com/en/java/javase/17/docs/api/jdk.httpserver/com/sun/net/httpserver/HttpServer.html (consulted 2026-10-28)
## Not verified
- Plugin lifecycle integration tests against a running server are outside unit test scope.
@@ -1,50 +0,0 @@
---
name: local-e2e-validation
description: Use when building, changing, or running the reproducible Bifrost local stack validation that provisions Gitea fixtures and imports them through the SonarQube page.
---
# Local end-to-end validation
- Build the JAR from the repository tag-derived version before starting the stack; mount that exact file read-only into SonarQube.
- Use only Compose project `bifrost-e2e` for automated state. Reset its named volumes with `down --volumes --remove-orphans`; never delete the user's default `bifrost` project or other volumes.
- Wait for PostgreSQL, Gitea, and SonarQube health checks before provisioning. Require exact SonarQube version `25.9.0.112764` and verify plugin runtime before browser actions.
- Create a test-only Gitea administrator with the pinned Gitea CLI. Generate a disposable token through the documented Gitea API and keep credentials and tokens in process memory or test-only environment variables.
- Seed two organizations (`alpha-lab`, `beta-lab`) and two repositories in each (`api`, `web`) through the Gitea API. Repeated repository names across organizations are expected.
- Configure `sonar.bifrost.*` with SonarQube Web APIs. In the disposable 25.9 instance, accept `sonar.plugins.risk.consent` through the public settings API, then create a UI session through `api/authentication/login`.
- Dismiss SonarQube first-run welcome and Joyride overlays before checking controls. Wait for repository rows to reflect the selected organization before selecting all.
- Assert organization switching retains selection, all four projects are created with organization-prefixed keys, every project receives a Gitea link, imported rows are disabled, and the page emits no JavaScript errors. The fixture deliberately repeats `api` and `web` across the organizations.
- Keep the stack after a successful test for inspection. On failure retain the stack and Playwright trace/screenshots. Cleanup only with the dedicated project command.
- Do not report full validation unless the script exits successfully and the independent API assertions pass.
## Checklist
- [x] Exact plugin JAR version and manifest are used by Compose.
- [x] Fresh Gitea and SonarQube state is provisioned with test-only credentials.
- [x] Both organizations and all four repositories are verified in Gitea.
- [x] Chromium exercises the real plugin page and its selection/import controls.
- [x] SonarQube API confirms each project and its Gitea link.
- [x] Imported project state and browser errors are checked.
- [x] Only the `bifrost-e2e` project can be reset by the runner.
## Commands
```sh
./scripts/e2e.ps1
docker compose --project-name bifrost-e2e ps
docker compose --project-name bifrost-e2e down --volumes --remove-orphans
```
## Sources
- SonarQube page extensions: https://docs.sonarsource.com/sonarqube-community-build/extension-guide/developing-a-plugin/adding-pages-to-the-webapp (consulted 2026-10-29)
- SonarQube project creation API: https://docs.sonarsource.com/sonarqube-community-build/project-administration/creating-project/automating-creation (consulted 2026-10-29)
- SonarQube settings Web API: https://docs.sonarsource.com/sonarqube-community-build/extension-guide/web-api (consulted 2026-10-29)
- Gitea 1.23 token API: https://docs.gitea.com/api/1.23/operations/user-create-token/ (consulted 2026-10-29)
- Gitea 1.23 organization repository API: https://docs.gitea.com/api/1.23/operations/create-org-repo/ (consulted 2026-10-29)
- Gitea command line: https://docs.gitea.com/administration/command-line/ (consulted 2026-10-29)
- Playwright Docker: https://playwright.dev/docs/docker (consulted 2026-10-29)
- Playwright test configuration: https://playwright.dev/docs/test-configuration (consulted 2026-10-29)
- Docker Compose specification: https://docs.docker.com/compose/compose-file/ (consulted 2026-10-29)
## Not verified
- The full local flow passed on 2026-10-29 with SonarQube Community Build 25.9.0.112764, Gitea 1.23.8, PostgreSQL 17.2, and Playwright 1.64.1. External Gitea versions and Linux Docker hosts have not been exercised here.
@@ -1,32 +0,0 @@
---
name: maven-build-packaging
description: Use when changing Maven coordinates, compiler or plugin versions, wrapper, packaging, JavaScript resources, or Docker build integration.
---
# Maven build and packaging
- Use Maven and commit the Maven Wrapper; pin Maven distribution, compiler, Surefire, packaging, and flatten plugin versions.
- Inject `${revision}` through `-Drevision=...`; use `flatten-maven-plugin` so published metadata resolves the version.
- Set compiler release 17. Declare `org.sonarsource.api.plugin:sonar-plugin-api:13.0.0.3026` as `provided` for Community Build 25.9.
- Configure `sonar-packaging-maven-plugin` with plugin key `bifrost`, ASCII display fallback `Bifrost (Gitea Import)` until manifest UTF-8 is verified, and plugin API minimum `13.0.0.3026`.
- Do not confuse manifest `Sonar-Version` with a SonarQube product version: it records the minimum plugin API version. Track the minimum tested SonarQube release separately.
- Keep JavaScript dependency-free and package it as a static resource; no Node build step is needed.
- Produce `sonar-bifrost-plugin-${revision}.jar`; inspect manifest and contents after packaging.
- Build reproducibly where plugin versions permit; avoid timestamps and unpinned image tags.
- Docker build stages must use pinned JDK/Maven images and provide a clear host extraction command.
## Checklist
- [ ] Wrapper and all plugin versions pinned.
- [ ] Public API dependency provided, not packaged.
- [ ] JAR filename and manifest correct.
- [ ] Static page resource included.
- [ ] Container build can export the JAR.
## Sources
- SonarQube plugin packaging: https://docs.sonarsource.com/sonarqube-community-build/extension-guide/developing-a-plugin/plugin-basics (consulted 2026-10-28)
- Maven Wrapper: https://maven.apache.org/wrapper/ (consulted 2026-10-28)
- Maven CI-friendly versions: https://maven.apache.org/maven-ci-friendly.html (consulted 2026-10-28)
- SonarSource packaging plugin: https://github.com/SonarSource/sonar-packaging-maven-plugin (consulted 2026-10-28)
- Manifest metadata reference: https://docs.sonarsource.com/sonarqube-community-build/extension-guide/developing-a-plugin/plugin-basics (consulted 2026-10-28)
## Not verified
- Exact minimum-version manifest syntax must be checked against the pinned packaging plugin release during build implementation.
-27
View File
@@ -1,27 +0,0 @@
---
name: project-workflow
description: Use for every task in this repository to enforce Bifrost-specific implementation order, evidence, and definition of done.
---
# Project workflow
- Keep source, docs, UI, logs, comments, workflows, and commit messages in English. Use ASCII identifiers; display text may use `Bifrost` unless UTF-8 manifest encoding is verified.
- Before implementation, read repository instructions and applicable project and common skills. Verify version-sensitive SonarQube claims against the listed primary sources.
- For Gitea issue intake, Orca task coordination, PR lifecycle, release assessment, CI/DevOps, secret handling, disposable infrastructure, and worktree cleanup, follow the installed common skills `gitea-delivery-workflow`, `orca-parallel-work`, `pr-lifecycle`, `release-assessment`, `devops-engineering`, `gitea-auth`, `infisical-cli`, `disposable-test-environment`, and `worktree-cleanup`. This skill defines no alternate delivery lifecycle.
- Bifrost-specific implementation order: compatibility research, project-skill updates when needed, design, Java/JavaScript implementation, Maven verification, JAR packaging inspection, and SonarQube compatibility/security review. For skills-only or Markdown-only changes, perform relevant documentation checks; do not run product builds or application recipes unless the changed instructions require them.
- If actual behavior conflicts with a project skill, confirm against primary documentation or the pinned artifact, update the skill in the same change, and explain the correction.
- Keep security boundaries server-side; never trust UI visibility or client-provided organization names. Follow `secure-coding-plugin` for SonarQube authorization, Gitea credentials, outbound requests, and token handling.
- Do not claim build, runtime, browser, integration, CI, or independent review evidence unless actually observed. Keep local checks, CI, disposable recipe, and external deployment evidence distinct.
- When the user requests local integration proof, follow `local-e2e-validation`: isolated zero-to-import stack and browser-based end-to-end test, with exact cleanup/evidence rules.
## Checklist
- [ ] Relevant project and common skills loaded and followed.
- [ ] English-only content and ASCII identifiers.
- [ ] SonarQube/API compatibility checked where relevant.
- [ ] Verification evidence and limits accurately reported.
- [ ] Relevant skill checklists reviewed.
## Sources
- SonarQube Community Build plugin basics: https://docs.sonarsource.com/sonarqube-community-build/extension-guide/developing-a-plugin/plugin-basics (consulted 2026-10-28)
## Not verified
- SonarQube target compatibility and runtime evidence are recorded in the relevant SonarQube skills; they must be refreshed when the target changes.
@@ -1,27 +0,0 @@
---
name: release-versioning-changelog
description: Use when changing Bifrost version calculation, release automation, Conventional Commit parsing, or CHANGELOG.md generation and validation.
---
# Release versioning and changelog
- Follow the common `release-assessment` skill for PR impact and `gitea-delivery-workflow` for delivery. This skill records only Bifrost's version source and release format.
- Treat reachable Git tags `vMAJOR.MINOR.PATCH` as the sole release version source. Calculate from commits since the latest reachable version tag: breaking change or `!` bumps major; `feat` bumps minor; `fix`, `perf`, and `refactor` bump patch; other types do not request release.
- Use a version format accepted by the SonarQube plugin manifest; keep snapshot metadata out of release tags. The built JAR is `sonar-bifrost-plugin-${revision}.jar`.
- Keep `CHANGELOG.md` in Keep a Changelog 1.1.0 structure, newest first, using only Added, Changed, Deprecated, Removed, Fixed, and Security categories.
- Never invent a user-facing changelog detail from an unclear commit. Allow maintainers to edit generated entries before release.
- Validate headings, dates, allowed categories, order, and comparison links with the repository validator. Extract the release body directly from the matching version section in `CHANGELOG.md`.
- The Gitea release flow updates the changelog, commits it, tags that commit, pushes the commit and tag, then creates a Gitea release from that exact changelog section and attaches the versioned plugin JAR. Never force-update a published tag.
## Checklist
- [ ] Tag parsing is deterministic and handles no-tag repositories.
- [ ] Bump mapping matches repository policy.
- [ ] Changelog validator catches malformed sections and links.
- [ ] Release tag points to the changelog update commit and release asset matches the tag.
## Sources
- Keep a Changelog 1.1.0: https://keepachangelog.com/en/1.1.0/ (consulted 2026-10-28)
- Semantic Versioning 2.0.0: https://semver.org/spec/v2.0.0.html (consulted 2026-10-28)
- Conventional Commits 1.0.0: https://www.conventionalcommits.org/en/v1.0.0/ (consulted 2026-10-28)
## Not verified
- SonarQube's accepted plugin manifest version grammar must be confirmed against the pinned packaging plugin and target when changed.
@@ -1,30 +0,0 @@
---
name: secure-coding-plugin
description: Use when adding or reviewing configuration, web-service inputs, authorization, outbound HTTP, secrets, or dependencies in the plugin.
---
# Secure coding for this plugin
- Require authenticated SonarQube users and check `Create Projects` on every action that enumerates or imports repositories.
- Fail closed when the current-user permission response is absent or malformed. Verify local connector authorization behavior on the target instance before deployment.
- Treat all browser input as untrusted. Bound batch size and string lengths; validate organization and repository identifiers before API calls.
- Validate configured Gitea URL as absolute HTTP(S) with host and no userinfo, query, or fragment. The URL is trusted administrator configuration and may target a private Gitea host; never accept a request-specific outbound URL.
- Disable redirects to avoid forwarding the Gitea token; do not expose outbound arbitrary URL input.
- Store the token in a `.secured` PASSWORD property. Never return it from web services, JS, logs, errors, or generated files.
- Use same-origin authenticated SonarQube requests for mutations; do not build custom cookie bypasses. Preserve SonarQube's normal CSRF/session protections by sending `X-XSRF-TOKEN` from the `XSRF-TOKEN` cookie on POST requests.
- Reject duplicate or colliding project keys before making any project mutations.
- Pin dependencies, inspect transitive dependency changes, and keep the Sonar API provided.
## Checklist
- [ ] Every endpoint checks Create Projects.
- [ ] URL, identifiers, and batch sizes validated.
- [ ] Secret handling and redirects safe.
- [ ] Project-key collisions fail closed.
- [ ] Dependency versions pinned.
## Sources
- OWASP SSRF Prevention Cheat Sheet: https://cheatsheetseries.owasp.org/cheatsheets/Server_Side_Request_Forgery_Prevention_Cheat_Sheet.html (consulted 2026-10-28)
- SonarQube Community Build Web API security: https://docs.sonarsource.com/sonarqube-community-build/extension-guide/web-api (consulted 2026-10-28)
- SonarQube plugin configuration: https://docs.sonarsource.com/sonarqube-community-build/extension-guide/developing-a-plugin/plugin-basics (consulted 2026-10-28)
## Not verified
- Community Build 25.9.0.112764 returned HTTP 401 when the POST omitted `X-XSRF-TOKEN`; the local browser flow passed after including it. The external Gitea endpoint and token policy remain administrator-controlled and were not evaluated.
@@ -1,29 +0,0 @@
---
name: sonarqube-frontend-extension
description: Use when implementing or changing a SonarQube 25.9 page extension, its JavaScript bundle, navigation placement, API calls, or browser permissions.
---
# SonarQube frontend extension
- Register a global page with `PageDefinition`; its key is `bifrost/import`.
- Put the matching unbundled JavaScript at `src/main/resources/static/import.js`; call `window.registerExtension("bifrost/import", start)`.
- Use only `options.el` as the page mount point; return a cleanup callback.
- Do not assume global libraries except React. Plain browser JavaScript avoids an unnecessary build step.
- Use same-origin `fetch` for `api/bifrost/*`; rely on the active SonarQube session and never send the Gitea token to the browser. For non-GET requests, copy the readable `XSRF-TOKEN` cookie into the `X-XSRF-TOKEN` header; SonarQube 25.9 rejects cookie-authenticated POSTs without it.
- Render API errors as accessible text; use labels for controls, semantic table headers, keyboard-accessible controls, and text status in addition to color.
- Validate repository links as HTTP or HTTPS before assigning them to an anchor.
- Grey out imported rows and disable their checkboxes. Keep selection in page state across organization changes.
- Page visibility is not authorization. The server must enforce Create Projects permission on every endpoint.
- Do not embed inline scripts or use `eval`.
## Checklist
- [ ] `PageDefinition` key matches JS registration key and resource filename.
- [ ] Bundle packaged under `/static/bifrost/import.js`.
- [x] Accessible labels, feedback and keyboard controls.
- [ ] No token in browser or authorization based only on menu visibility.
## Sources
- Adding pages to the webapp: https://docs.sonarsource.com/sonarqube-community-build/extension-guide/developing-a-plugin/adding-pages-to-the-webapp (consulted 2026-10-28)
- SonarQube Web API: https://docs.sonarsource.com/sonarqube-community-build/extension-guide/web-api (consulted 2026-10-28)
## Not verified
- Live page routing, bundle loading, accessible controls, selection retention, and POST CSRF behavior were verified on Community Build 25.9.0.112764. Conditional menu hiding based on Create Projects permission is not supported by the selected public page API.
@@ -1,34 +0,0 @@
---
name: sonarqube-plugin-development
description: 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 plugin API `13.0.0.3026`, inferred from target server dependency metadata and confirmed by a successful plugin load on the exact target image.
- 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 within a web service, use `Request.localConnector()` to call public SonarQube Web APIs in the current request context; never invoke internal project creation services.
## 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
- SonarQube Community Build Plugin basics: https://docs.sonarsource.com/sonarqube-community-build/extension-guide/developing-a-plugin/plugin-basics (consulted 2026-10-28)
- SonarSource API compatibility matrix: https://github.com/SonarSource/sonar-plugin-api (consulted 2026-10-28)
- SonarQube target dependency metadata: https://central.sonatype.com/artifact/org.sonarsource.sonarqube/sonar-core/25.9.0.112764 (consulted 2026-10-28)
- Pinned API source artifact: https://repo.maven.apache.org/maven2/org/sonarsource/api/plugin/sonar-plugin-api/13.0.0.3026/sonar-plugin-api-13.0.0.3026-sources.jar (consulted 2026-10-28)
- SonarQube project creation REST API: https://docs.sonarsource.com/sonarqube-community-build/project-administration/creating-project/automating-creation (consulted 2026-10-28)
## Not verified
- Full target-tag SonarQube source checkout was not available; the plugin build and startup were verified against the exact target image.
- The target server's `api/users/current` permissions response and local connector caller context were not tested live.
+3 -17
View File
@@ -17,7 +17,6 @@ The Docker build completed with Java 17, all eight unit tests passed, and the ex
```text
.
├── .claude/skills/ # Twelve project skills
├── .gitea/workflows/build.yml # Gitea Actions CI and release pipeline
├── .mvn/wrapper/ # Maven distribution pin
├── scripts/ # Version, changelog, and release helpers
@@ -116,24 +115,11 @@ The Gitea Actions workflow checks out full history/tags, installs Java 17, calcu
Configure repository variable `GITEA_API_URL` (for example, `https://gitea.example/api/v1`), repository variable `GITEA_REPOSITORY_URL` (the repository web URL), and secret `RELEASE_TOKEN`. The token needs repository write access to push the changelog commit/tag and create a release with an asset. For protected branches, allow this token identity to push the release commit to `main`, or use a dedicated release branch and adjust `GITEA_MAIN_BRANCH`. Actions use GitHub-hosted action sources (`actions/checkout`, `actions/setup-java`, `actions/upload-artifact`); an isolated act_runner may need those repositories mirrored or outbound GitHub access.
## Skills
## Compatibility and validation notes
The `.claude/skills/<name>/SKILL.md` files are project instructions:
The implementation targets SonarQube Community Build `25.9.0.112764`, plugin API `13.0.0.3026`, and Java 17. When changing the SonarQube target, verify version-sensitive behavior against official SonarSource documentation and the target source or artifact metadata, then update the API/compiler/manifest pins and run the relevant build and runtime validation.
- `sonarqube-plugin-development`: entry point, extension lifecycle, manifest, and public API constraints.
- `sonarqube-frontend-extension`: page API, UI, bundle, and accessibility.
- `java-best-practices`: Java 17 boundaries, immutability, resource handling, and errors.
- `java-testing`: deterministic unit tests and HTTP mocking.
- `gitea-api-client`: Gitea paths, tokens, pagination, timeouts, and status mapping.
- `secure-coding-plugin`: URL/input validation, permissions, secrets, CSRF, and dependencies.
- `maven-build-packaging`: pinned Maven build and plugin JAR packaging.
- `release-versioning-changelog`: tag bumps, changelog structure, and release flow.
- `gitea-actions-ci`: act_runner constraints and release workflow.
- `docker-test-environment`: pinned SonarQube, PostgreSQL, Gitea, and plugin mount.
- `local-e2e-validation`: fresh-stack provisioning, browser import, project/link assertions, and safe cleanup.
- `project-workflow`: language, evidence, implementation order, and definition of done.
When the SonarQube target changes, update version-sensitive skill claims only after checking official SonarSource docs and target source/artifact metadata. Then update API/compiler/manifest pins, rebuild and inspect the JAR, and rerun each checklist. Skills are guidance, not a substitute for version-specific verification.
The local end-to-end acceptance scenario is documented under [Test scenario](#test-scenario), including its pinned service versions, fixture organizations and repositories, project/link assertions, and isolated cleanup command. Release and CI behavior is documented under [Versioning](#versioning), [Changelog](#changelog), and [CI and releases](#ci-and-releases). These sections are the product-specific source of truth.
## Troubleshooting