birre: Command for GitHub Copilot

.github/prompts/fix-sonarqube-findings.prompt.md

fix-sonarqube-findings is a command for GitHub Copilot from boecht/birre. It costs 0 tokens per session (1,217 once invoked), scanned A, original, Unlicense.

A command that finds and fixes SonarQube code-quality and security findings, along with errors shown in the IDE Problems list. SonarQube is a tool that checks source code for possible bugs, security risks, and maintainability issues.

In plain words
What is it for?
Use it to review flagged files, apply small fixes, and recheck SonarQube and IDE diagnostics after each change.
Why use it?
It brings findings from multiple checks into one list and helps prevent fixes from introducing new problems. It aims to leave the targeted files with no actionable findings while preserving behavior and tests.

Command for GitHub Copilot

Written for GitHub Copilot: a Copilot chat mode or prompt. Also seen: model in frontmatter.

This is boecht/birre's own configuration. It tells GitHub Copilot how to work on birre itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything birre configures →

View source ↗ boecht/birre
Reuse

Borrowing it

Nothing to install: this file belongs to boecht/birre. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/boecht/birre/main/.github/prompts/fix-sonarqube-findings.prompt.md
Clone the repo
git clone --depth 1 https://github.com/boecht/birre

Made for: GitHub Copilot.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for fix-sonarqube-findings

README.md
[![agentmods](https://agentmods.dev/badge/commands/boecht/birre/fix-sonarqube-findings/github.svg)](https://agentmods.dev/commands/boecht/birre/fix-sonarqube-findings)
Your own site
<a href="https://agentmods.dev/commands/boecht/birre/fix-sonarqube-findings"><img src="https://agentmods.dev/badge/commands/boecht/birre/fix-sonarqube-findings/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for fix-sonarqube-findings

Your own site · 80×15
<a href="https://agentmods.dev/commands/boecht/birre/fix-sonarqube-findings"><img src="https://agentmods.dev/badge/commands/boecht/birre/fix-sonarqube-findings.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,217 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01217
Opus 5 $0.00000 $0.00609
Sonnet 5 $0.00000 $0.00243
Haiku 4.5 $0.00000 $0.00122

Measured 2d ago against content hash 969a314f5e49, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

fix-sonarqube-findings scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/prompts/fix-sonarqube-findings.prompt.md · 115 lines

How it starts

The opening of the file, as written. The whole thing — 115 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Objective

Drive the codebase to a state where SonarQube (security / code quality hotspots surfaced via list_potential_security_issues) AND the IDE Problems list report zero outstanding actionable findings for the targeted files. Maintain functional and test integrity while applying minimally invasive, high-quality fixes.

Scope

  1. Start with files currently showing findings.
  2. Enumerate ALL findings from BOTH sources:
    • Sonar (security & code quality): prefer sonarsource.sonarlint-vscode/sonarqube_getPotentialSecurityIssues plus sonarsource.sonarlint-vscode/sonarqube_analyzeFile for full file after every change. Fallback: sonarqube/analyze_code_snippet for targeted snippet validation; sonarqube/show_rule for rule metadata.
    • Problems: use problems (get_errors) per file.
  3. Treat both sources as complementary; merge/normalize into a unified issue list (deduplicate identical root causes).
  4. Expand scope if fixes introduce new findings elsewhere (iterate until stable zero state).

Issue Categories & Typical Fixes

Category Source(s) Fix Strategy
Insecure protocol (http→https) Sonar Replace with https if endpoint supports it (most public domains). Canonicalize duplicated literals simultaneously.
Duplicate string literals Problems Introduce a module-level constant (ALL_CAPS) or reuse existing constants; avoid over-abstraction.
Other (if discovered) Both Apply least intrusive change preserving semantics, with docstring/comment only when intent could be unclear.

Process

  1. Planning: Use todos to outline each issue (security > maintainability priority).
  2. Enumeration: For each candidate file, collect Sonar + Problems findings.
  3. Normalization: For each finding record: source(s), rule/message, line(s), proposed fix, risk level (security/maintainability).
  4. Fix Implementation Order: a. Security hotspots (Bugs, Vulnerabilities, other blocking and critical findings). b. Refactors reducing duplication or maintainability warnings.
  5. Apply edits in cohesive commits (the assistant session groups them; human will commit later). Keep changes minimal; do not introduce new deps.
  6. Re-run Problems + Sonar listing after each batch:
    • If residual issues remain, iterate.
  7. Run tests (runTests) focusing on affected unit tests or full suite if low cost.
  8. If a reported issue is a false positive or intentionally retained (rare):
    • Verify via rule description (sonarqube/show_rule).
    • Only if justified, consider marking accepted (sonarqube/change_sonar_issue_status), but PREFER code fix—document rationale inline in a concise comment.
  9. Finish when both sources return zero actionable findings and tests pass.

Read the full file on GitHub · 115 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 115 lines · 0 tokens per session scan A 969a314f5e49

Subscribe to this mod's changes

fix-sonarqube-findings is a command published in the GitHub repository boecht/birre (2 stars, last pushed today), licensed Unlicense. It costs nothing until one of its globs matches a file; then it loads 1,217 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-08.