sonar-change-risk
Skill2 starsChanged 4 months agoMITView on GitHub
Estimates how risky it is to modify a specific class or file by combining local Sonar evidence with git churn, test evidence, ownership/criticality, story scope, and architecture guards. Use before changing a class, during dev-assist, or in review when a modified file looks fragile.
In this repository67 other files it gives its agents.
- acceptance-criteria-testabilitySkill
- api-test-validationSkill
- architecture-decision-recordSkill
- architecture-drift-detectionSkill
- architecture-guard-detectorSkill
- architecture-riskSkill
- business-continuity-checkSkill
- changed-files-risk-classifierSkill
- change-impact-previewSkill
- concurrency-riskSkill
- contributor-pattern-analysisSkill
- cross-service-contractSkill
- database-driftSkill
- database-read-verificationSkill
- delivery-risk-radarSkill
- dependency-security-evidenceSkill
- developer-decision-reviewSkill
- developer-handoffSkill
- developer-readiness-checkSkill
- development-summarySkill
- epic-goal-extractionSkill
- epic-implementation-graphSkill
- epic-story-partitioningSkill
- epic-structure-analysisSkill
- flaky-failure-classificationSkill
- green-border-planSkill
- gui-testbook-authoringSkill
- gui-testbook-learningSkill
- gui-test-context-discoverySkill
- gui-test-executionSkill
- incident-risk-forecastSkill
- java-performance-smellSkill
- java-targeted-build-verificationSkill
- jira-acceptance-criteria-normalizerSkill
- jira-release-state-evidenceSkill
- knowledge-transfer-briefSkill
- known-pitfalls-extractionSkill
- legacy-characterizationSkill
- liquibase-production-riskSkill
- liquibase-syntaxSkill
- mana-governance-regression-verificationSkill
- mana-usage-helpSkill
- non-functional-requirements-reviewSkill
- null-safety-riskSkill
- post-merge-incident-learningSkill
- pre-review-defectSkill
- production-premortemSkill
- profile-selectorSkill
- regression-selectionSkill
- release-impact-summarySkill
- review-load-balancingSkill
- rollback-safetySkill
- rule-update-suggestionSkill
- service-boundary-fitSkill
- service-knowledge-captureSkill
- shell-syntax-verificationSkill
- sonar-evidence-triageSkill
- source-impact-mapSkill
- story-effort-estimationSkill
- story-qualitySkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 8 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 48
Before modifying a class, service, mapper, controller, repository, job, or integration client.
- Distinctive: line 50
When a branch or PR touches a file that appears fragile, complex, untested, or production-critical.
- Very specific: line 52
When Sonar evidence exists under .mana//evidence/sonar/.
- Distinctive: line 53
When a developer asks "quanto e' rischioso toccare questa classe?" or wants a safe strategy before editing.
- Distinctive: line 57
Do not run it as a generic full-repository quality review.
- Distinctive: line 58
Do not treat Sonar issues outside the target file/change scope as blockers.
- Distinctive: line 59
Do not recommend broad refactoring unless the story explicitly allows it.
- Distinctive: line 60
Do not use this skill to justify bypassing tests, review, or owner approval.
- Distinctive: line 134
Use a concise report:
- Very specific: line 157
Follow docs/standards/agent-skill-output-standard.md (Agent And Skill Output Standard).
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Sonar Change Risk
Purpose
Estimate how risky it is to modify a specific class or file, then recommend a safe change strategy before implementation or review.
Sonar is one signal, not the decision engine. Combine static quality evidence with repository context, tests, story scope, ownership, and engineering guards.
When To Use It
- Before modifying a class, service, mapper, controller, repository, job, or integration client.
- When a branch or PR touches a file that appears fragile, complex, untested, or production-critical.
- When Sonar evidence exists under
.mana/**/evidence/sonar/. - When a developer asks "quanto e' rischioso toccare questa classe?" or wants a safe strategy before editing.
When Not To Use It
- Do not run it as a generic full-repository quality review.
- Do not treat Sonar issues outside the target file/change scope as blockers.
- Do not recommend broad refactoring unless the story explicitly allows it.
- Do not use this skill to justify bypassing tests, review, or owner approval.
Inputs
- target_class_or_file
- sonar_evidence
- git_history
- test_evidence
- story_context
- engineering_guards
Outputs
- change_risk_report
- safe_change_strategy
- characterization_test_recommendations
Execution Logic
- Resolve the exact target file/class. If ambiguous, ask which class/file to assess.
- Load existing Sonar evidence if present:
.mana/**/evidence/sonar/sonar-summary.md, scanner logs, and any exported issue/metric summaries. Do not runsonar-scannerunless the human asks for fresh evidence. - Gather local risk signals:
- file size and main responsibilities;
- cognitive/cyclomatic complexity when available from Sonar;
- bugs, vulnerabilities, security hotspots, smells, duplication, and coverage signals tied to the target file;
- git churn, recent edits, conflicting ownership, and recent bug-fix commits;
- direct tests, characterization tests, integration tests, and regression evidence;
- production path, database, external contract, async/concurrency, auth, or payment-critical involvement;
- engineering guard or protected-area rules.
- Separate existing debt from change-specific risk. Existing debt matters when it makes the intended change harder, less testable, or more likely to break production behavior.
- Classify risk:
low: simple file, low complexity, good tests, narrow story scope, no critical path.medium: some complexity/churn/test gaps, but change can be contained with focused tests.high: high complexity, low coverage, critical path, unclear behavior, strong churn, or multiple risk domains.blocker: protected area, missing owner approval, untestable critical behavior, or change would mix refactor and behavior in unsafe scope.
- Recommend a safe strategy: smallest viable change, characterization tests first, split refactor from behavior, add guard tests, ask owner approval, or defer risky cleanup.
Decision Rules
blocker: target is protected by engineering guards, no safe test boundary exists for critical behavior, Sonar/test evidence shows uncontained risk on a production path, or story scope does not justify touching the file.warning: target has high complexity, low coverage, repeated churn, old debt, weak ownership, or missing characterization tests.info: useful local guidance, candidate tests, or refactoring note that does not change the start decision.
Required Evidence
Report which evidence was available and which was missing:
Sonar evidence: present/missing/stale
Git churn: checked/not checked
Direct tests: present/missing
Story scope: present/missing
Engineering guards: present/missingMissing Sonar evidence must not block the skill. Continue with git/test/source
signals and recommend ./mana sonar --analyze only when it would materially
improve the decision.
Output Shape
Use a concise report:
skill: sonar-change-risk
target: "src/main/java/.../RefundReconciliationService.java"
status: warning
change_risk: high
top_risk_factors:
- "High complexity and low direct test evidence."
- "Recent churn in settlement matching behavior."
safe_change_strategy:
- "Add characterization tests around current matching behavior first."
- "Change one branch only; avoid cleanup/refactor in the same PR."
- "Run ./mana sonar --analyze after build and attach evidence."
human_review_required: trueHuman Approval
Developer owns the local strategy. Team Leader owns high-risk start/continue decisions. Architect, DBA, Security, or service owner approval remains required when the target file touches their guarded area.
Output Standard
Follow docs/standards/agent-skill-output-standard.md (Agent And Skill Output
Standard). Use templates/standard-agent-skill-report.template.md when no more
specific template exists.
Internal reasoning must use compact caveman mode: terse fragments, evidence-first notes, no long narrative, and no private chain-of-thought in final artifacts. Maintain a context budget: keep a short working summary with target file, intended change, Sonar evidence path, git/test checks, risk signals, discarded risks, and next checks.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

