/agentic-repos:ar-sonar-sweepfrom agentic-repos
Drive a project's whole SonarQube backlog toward zero open issues, in bounded reviewable batches. Fetches every open issue on a branch (not just the current PR's new code), groups them by file, fixes each batch in severity order following the project's installed rules, verifies with build/tests/lint, and commits per batch onto its own branch/PR so review stays tractable. Explicitly invoked for backlog cleanup; the per-PR flow (ar-taskflow-fix-comments, scope=changed) already handles issues in files a feature PR touches. Say "ar-sonar-sweep" or "sonar sweep".
Ships in agentic-repos. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Cleans a project's whole-project SonarQube backlog down toward 0 open issues. This is the "clean slate" job: it looks at issues across the entire branch, not only the new code on one PR. Because a backlog can be large, it works in bounded, reviewable batches (one file, or a small group, per commit, prioritized by severity), so a human reviewer is never handed a thousand-line diff.
When NOT to use this: for issues on a PR you are actively working, the per-PR flow already covers them. ar-taskflow-fix-comments fetches SONAR_SCOPE=changed, which fixes every issue in the files that PR touched. Use this sweep only for the standing backlog in files no current PR touches.
MANDATORY: every code change here must follow the project's installed rules at {standards_location} (from config_hints.json): the stack's coding-conventions rule, its SonarQube/lint-compliance rule (assertion idioms, dead code, matcher rules), its unit-testing rule (when a fix needs a test), and its module-boundary rule. A "fix" that violates an installed rule is a bug.
~/.claude/scripts/ar-sonarqube/fetch-issues.sh installed (via ar-install-tools / ar-upgrade), and SONARQUBE_URL + SONARQUBE_TOKEN exported in this shell. If either is missing, stop and guide setup; do not silently report a clean backlog.main/master.Ask for the scope if it is not clear:
SONAR_BRANCH.SONAR_SCOPE=all ~/.claude/scripts/ar-sonarqube/fetch-issues.sh 2>&1
# Optional: SONAR_BRANCH=<branch> to sweep a non-default branch.
This returns every open (OPEN/CONFIRMED/REOPENED) issue on the branch, paginated. Report the total and the breakdown by severity and by type (bug / vulnerability / code smell / security hotspot).
For each file batch, on its own branch (use a_g_worktree_* for isolation):
Read the file in full to understand control flow. The goal is a correct fix, not a silenced rule.
For each issue, apply the fix that follows the installed rules. Common code-smell categories and the safe action:
| Category | Action |
|---|---|
| Unused imports / variables / fields / parameters | Remove |
| Empty blocks (catch, if, …) | Remove or add a documented no-op |
| Missing / weak test assertions | Add a meaningful assertion (follow the unit-testing rule) |
| Naming / formatting / style | Fix to convention |
| Redundant / dead code | Remove |
| Cognitive complexity | Refactor only if behavior-preserving and covered by tests; otherwise flag for manual review |
| Behavior-changing rules | Flag for manual review; do not guess |
Do not change observable behavior. If a "fix" would, flag it instead of applying it.
Run the project's build, the affected tests, and the lint/format check (commands from config_hints.json / installed rules). A batch does not ship until all three are green. If a fix breaks something, revert that fix and flag the issue for manual review rather than leaving the batch red.
Per run, output: starting backlog count (by severity), issues fixed, issues flagged for manual review (with reasons and locations), batches committed / PRs opened, and the remaining backlog count so progress toward 0 is visible across runs. If nothing remains in scope, say so plainly.
What SKILL.md sets; muted values are Claude Code's defaults
20 skills in this plugin
/ar-agent-readyAssess how agent-ready a repository is and raise it. Reads the actual codebase, extracts its real conventions into rule files, wires the config seam, and reports a readiness scorecard. Say "ar-agent-ready", "make this repo agent-ready", or "extract the rules for this project"./ar-api-dd-compareAudit what the code ASSUMES against what production ACTUALLY does, using Datadog traces, and turn mismatches into fix tickets. Say "ar-api-dd-compare" or "trace audit". On-demand only (Datadog MCP is interactively authenticated)./ar-dd-api-performanceScan a window of Datadog traffic (default last day, production), sample traces for APIs over the latency/error thresholds, cross-reference this repo's code, and maintain per-API optimization report files under the workspace Performance_Findings directory, then commit them. On-demand only. Say "ar-dd-api-performance", "api performance scan", "which APIs are slow", or "update the performance reports"./ar-global-pr-reviewerReview any GitHub PR from anywhere on the machine, no project checkout needed. Clones the repo, sets up a review worktree, does a best-effort test run, reviews changed code for logical bugs and missing-test gaps against the project's rules, dedups against existing comments, and posts an inline review with fixes. Say "ar-global-pr-reviewer", "review pr globally", or "global review <PR-URL>"./ar-init-mcpsInitialize issue-tracker integration for Claude Code. For GitHub Issues (the default) this verifies the gh CLI is authenticated, no MCP needed. For Jira (Atlassian) or Linear it sets up the Model Context Protocol (MCP) server. Say "ar-init-mcps" or "setup mcps"./ar-init-skillsInitialize skills configuration for this project. Use when setting up for first time or when skill.config is missing. Say "ar-init-skills" or "setup skills".npx claudepluginhub mahsanamin/agentic-repos --plugin agentic-reposOther plugins' skills for the same job