home / skills / codyswanngt / lisa / sonarqube-fix

sonarqube-fix skill

/.claude/skills/sonarqube-fix

This skill fixes SonarQube quality gate issues by running checks, applying fixes, and committing changes to git.

npx playbooks add skill codyswanngt/lisa --skill sonarqube-fix

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
362 B
---
name: sonarqube-fix
description: This skill should be used when fixing SonarQube quality gate failures. It runs the sonarqube:check skill to identify failures, fixes the identified issues, and then commits the changes using the git:commit skill.
---

1. Run /sonarqube-check
2. Fix the SonarQube quality gate failures identified in step 1
3. Run /git-commit

Overview

This skill automates the workflow for resolving SonarQube quality gate failures in a TypeScript codebase. It first runs an inspection to identify failing checks, applies fixes to address the issues, and then commits the changes to the repository. The goal is fast, repeatable remediation that keeps code quality gates green with minimal manual effort.

How this skill works

The skill executes a SonarQube check to collect the list of quality gate failures and relevant issue locations. It applies targeted fixes for the identified problems (linting, type issues, minor refactors, or configuration updates) and stages the modified files. Finally, it uses the git commit step to persist the fixes with a clear commit message describing the remediation.

When to use it

  • After a SonarQube scan reports a failed quality gate for the branch.
  • When automated fixes can resolve rule violations without large design changes.
  • Before opening or updating a pull request to ensure the branch meets quality standards.
  • As part of a CI job to automatically remediate simple SonarQube issues.
  • When you want a consistent, auditable fix-and-commit flow for code quality.

Best practices

  • Run this skill on a feature branch to keep master/main pristine until fixes are verified.
  • Limit automated fixes to safe, localizable changes (formatting, imports, simple refactors).
  • Review generated changes quickly to confirm no behavioral changes were introduced.
  • Use descriptive commit messages that reference the SonarQube rule or issue ID.
  • Combine with tests or a local build to validate changes before committing.

Example use cases

  • Automatically correct ESLint-style or formatting violations flagged by SonarQube.
  • Fix straightforward TypeScript type errors or unused-import issues found in a scan.
  • Apply configuration tweaks (sonar properties) to satisfy quality gate requirements.
  • Run during CI to auto-remediate trivial findings and reduce manual triage effort.
  • Enforce consistent, repeatable remediation steps across a team of contributors.

FAQ

Will this skill fix every SonarQube issue automatically?

No. It focuses on safe, automatable fixes. Complex design issues or defects requiring code changes beyond simple refactors should be handled manually.

What happens to the commit history?

The skill creates a commit with the applied fixes and a descriptive message. You can configure branching and review policies to control how that commit is merged.