一键导入
fix-sonar-issues
Run local static analysis and fix findings with conservative, behavior-preserving changes. User-invoked only (/fix-sonar-issues).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Run local static analysis and fix findings with conservative, behavior-preserving changes. User-invoked only (/fix-sonar-issues).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Automatically fix all failing Maven tests by iterating until they pass. User-invoked only (/fix-tests).
Raise JaCoCo instruction and branch coverage while ensuring tests assert results. User-invoked only (/increase-coverage).
Audit class responsibilities, package boundaries, duplication, and rule compliance across Issues. Read-only report. User-invoked only (/review-code-structure).
Walk every feature-catalog row against routes, roles, and happy paths; report compliance gaps and backlog suggestions. Read-only. User-invoked only (/review-feature-catalog).
Full-codebase security audit — authn/authz, injection, secrets, XSS; report findings and teach-fix tasks (no code changes). User-invoked only (/review-security).
Use Issues via MCP or REST with personal/service-account API tokens. Apply when coding agents need ticket context, updates, moves, or comments on the Issues tracker (get_ticket_context, PAT, iss_pat_, iss_sat_).
| name | fix-sonar-issues |
| description | Run local static analysis and fix findings with conservative, behavior-preserving changes. User-invoked only (/fix-sonar-issues). |
| disable-model-invocation | true |
You are an expert Java developer working on Issues. Fix all issues surfaced by local static analysis — the same class of problems SonarCloud flags, without calling SonarCloud or using any token.
Align with .cursor/rules/static-analysis.mdc: local checks only.
Follow this loop — do not ask for confirmation before editing.
mvn -B compile -Dmaven.compiler.showWarnings=true -Dmaven.compiler.showDeprecation=true
Scan IDE diagnostics: ReadLints on changed src/main/java and src/test/java.
Do not call SonarCloud API.
verifySystem.out, printStackTrace| Theme | Safe approach | Avoid |
|---|---|---|
| Unused imports / dead code | Remove after confirming zero references | Deleting public API |
| Exception handling | SLF4J + rethrow or IssuesException | Empty catch |
| Test smells | Fix assertion or setup | @Disabled, weakened assertions |
| HTTP contract | Use *Request/*Response records | VO/DTO suffix |
Never: weaken workflow validation; delete tests to green CI.
mvn formatter:format
mvn -B verify
Append to reports/sonar_fix_log-{sequential}-{dd-MM-yyyy-HH-mm-ss}.md.
mvn verify passesReadLints clean on touched filesPrint ✅ Local static analysis clean! and summarize.
Start the loop now.