sonarcloud
Skill2 starsChanged 9 months agoApache-2.0View on GitHub
Unified SonarCloud integration skill for fetching, syncing, reporting, and resolving code quality issues. This skill should be used when working with SonarCloud data: syncing new issues to TDMS, generating reports with code snippets, marking resolved items, running cleanup sprints, or checking quality gate status. Consolidates sonarcloud-sprint and sync-sonarcloud-debt into a single entry point.
- Commits and pushes
1 other project uses a version of this.
Adopted by
Most recently taken up by
- harshanandak/forge-legacytheir own version, first seen Oct 17, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- harshanandak/forge-legacy★ 4same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository81 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- llms.txtllms.txt
- find-skillsSkill
- add-debtSkill
- alertsSkill
- analyzeSkill
- artifacts-builderSkill
- audit-agent-qualitySkill
- audit-aggregatorSkill
- audit-ai-optimizationSkill
- audit-codeSkill
- audit-comprehensiveSkill
- audit-documentationSkill
- audit-engineering-productivitySkill
- audit-enhancementsSkill
- audit-healthSkill
- audit-performanceSkill
- audit-processSkill
- audit-refactoringSkill
- audit-securitySkill
- brainstormSkill
- checkpointSkill
- code-reviewerSkill
- comprehensive-ecosystem-auditSkill
- content-research-writerSkill
- convergence-loopSkill
- create-auditSkill
- data-effectiveness-auditSkill
- debt-runnerSkill
- decrypt-secretsSkill
- deep-planSkill
- deep-researchSkill
- developer-growth-analysisSkill
- doc-ecosystem-auditSkill
- doc-optimizerSkill
- docs-maintainSkill
- document-analysisSkill
- ecosystem-healthSkill
- Excel AnalysisSkill
- find-skillsSkill
- frontend-designSkill
- gh-fix-ciSkill
- github-healthSkill
- health-ecosystem-auditSkill
- hook-ecosystem-auditSkill
- market-research-reportsSkill
- mcp-builderSkill
- media-analysisSkill
- multi-ai-auditSkill
- pre-commit-fixerSkill
- pr-ecosystem-auditSkill
- pr-retroSkill
- pr-reviewSkill
- quick-fixSkill
- recallSkill
- repo-analysisSkill
- repo-synthesisSkill
- script-ecosystem-auditSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
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 32
When the task doesn't match this skill's scope -- check related skills
- Distinctive: line 33
When a more specialized skill exists for the specific task
- Distinctive: line 55
sonar-project.properties: must exist with valid project key
- Very specific: line 56
MASTER_DEBT.jsonl: must exist at docs/technical-debt/MASTER_DEBT.jsonl
- Distinctive: line 177
All issues organized by file
- Distinctive: line 183
REQUIRED: after any sync or full mode that adds new items.
- Very specific: line 225
Use AskUserQuestion to offer:
- Distinctive: line 266
Use the SonarCloud MCP tools directly:
- Distinctive: line 289
Run sync to get latest state:
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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
<!-- prettier-ignore-start -->Document Version: 1.0 Last Updated: 2026-02-05 Status: ACTIVE
<!-- prettier-ignore-end -->SonarCloud Integration
Unified orchestrator for all SonarCloud operations against the TDMS (Technical Debt Management System).
When to Use
- Tasks related to sonarcloud
- User explicitly invokes
/sonarcloud
When NOT to Use
- When the task doesn't match this skill's scope -- check related skills
- When a more specialized skill exists for the specific task
Modes
| Mode | Flag | Purpose |
| sync | (default) | Fetch issues from API, diff against MASTER_DEBT.jsonl, add new items |
| resolve | --resolve | Detect items no longer in SonarCloud, mark as RESOLVED |
| full | --full | Sync new + resolve old in one pass |
| report | --report | Generate detailed markdown report with code snippets |
| status | --status | Quick quality gate check and issue count summary |
| sprint | --sprint | Full cleanup workflow: sync + report + create cleanup branch |
Prerequisites
- SONAR_TOKEN environment variable (decrypt if needed):
node scripts/secrets/decrypt-secrets.js - SONAR_ORG environment variable (default:
jasonmichaelbell78) - sonar-project.properties must exist with valid project key
- MASTER_DEBT.jsonl must exist at
docs/technical-debt/MASTER_DEBT.jsonl
To verify prerequisites:
cat sonar-project.properties | grep sonar.projectKey
echo "SONAR_TOKEN set: $([ -n "$SONAR_TOKEN" ] && echo YES || echo NO)"
echo "SONAR_ORG set: $([ -n "$SONAR_ORG" ] && echo YES || echo NO)"Mode: sync (default)
Fetch open issues from SonarCloud API, deduplicate against existing items, append new items to MASTER_DEBT.jsonl, and regenerate views.
Execution
# Preview what would be added (no changes written)
node scripts/debt/sync-sonarcloud.js --dry-run
# Sync all new issues (prompts for confirmation)
node scripts/debt/sync-sonarcloud.js
# Sync without confirmation prompt
node scripts/debt/sync-sonarcloud.js --force
# Filter by severity
node scripts/debt/sync-sonarcloud.js --severity BLOCKER,CRITICAL --forceWhat Happens
- Fetches open/confirmed/reopened issues from SonarCloud API (paginated, max 10,000)
- Loads existing MASTER_DEBT.jsonl
- Deduplicates by sonar_key and content_hash
- Assigns next DEBT-XXXX IDs to new items
- Appends to both
raw/deduped.jsonland MASTER_DEBT.jsonl - Logs to
docs/technical-debt/logs/intake-log.jsonl - Regenerates views via
generate-views.js - Placement phase (see Post-Sync: Placement below)
Output Fields (TDMS Schema)
Each synced item includes:
id:DEBT-XXXXsource_id:sonarcloud:{issue-key}source_file:sonarcloud-synccategory: code-quality | security | performance | documentationseverity: S0 (BLOCKER/CRITICAL) | S1 (MAJOR) | S2 (MINOR) | S3 (INFO)sonar_key: SonarCloud issue key for tracking
Mode: resolve
Detect SonarCloud-sourced items in MASTER_DEBT.jsonl whose sonar_key no longer appears in the SonarCloud API (issue was fixed externally). Mark those as RESOLVED.
Execution
# Preview resolutions (no changes)
node scripts/debt/sync-sonarcloud.js --resolve --dry-run
# Resolve missing items
node scripts/debt/sync-sonarcloud.js --resolve --force
# Full pass: sync new + resolve old
node scripts/debt/sync-sonarcloud.js --full --forceWhat Happens
- Fetches all open issues from SonarCloud API
- Builds set of active sonar_keys
- Scans MASTER_DEBT.jsonl for items with
source_file: "sonarcloud-sync"andstatus: "NEW" - Any item whose
sonar_keyis NOT in active set gets marked RESOLVED - Updates resolution fields:
status,resolution,resolved_date - Logs to
docs/technical-debt/logs/resolution-log.jsonl - Regenerates views
Mode: report
Generate a detailed markdown report with code snippets, severity breakdowns, and rule references. Requires fetching data from the SonarCloud API first.
Execution
# Step 1: Fetch data from SonarCloud API using the sync script
# (Avoids exposing SONAR_TOKEN on the command line)
node scripts/debt/sync-sonarcloud.js --dry-run
# Step 2: Generate detailed report with code snippets
node scripts/generate-detailed-sonar-report.jsSecurity Note: Never use inline
curl -u "$SONAR_TOKEN:"commands, as tokens may appear in shell history and process listings. The sync script reads the token from environment variables internally.
Output
Report written to: docs/audits/sonarcloud-issues-detailed.md
Contents include:
- Executive summary (severity/type distribution)
- Top 20 files with most issues
- Rule reference table
- BLOCKER/CRITICAL issues with code snippets
- Security hotspots with vulnerability probability
- All issues organized by file
Post-Sync: Placement
REQUIRED after any sync or full mode that adds new items. Present the user with a rich placement analysis before auto-assigning roadmap references.
Step 1: Run Assignment (Dry-Run)
node scripts/debt/assign-roadmap-refs.js --dry-run --reportStep 2: Present Severity-Weighted Placement Summary
Compute and display inline (severity weights: S0=10, S1=5, S2=2, S3=1):
| Track | Total | S0 | S1 | S2 | S3 | Weight |
|-----------------|-------|-----|-----|-----|-----|--------|
| Track-E | 870 | ... | ... | ... | ... | 2,965 |
| M2.1 | 663 | ... | ... | ... | ... | 1,589 |
| ... | | | | | | |
| TOTAL | 1,850 | 141 | 336 |1064 | 309 | 5,527 |Step 3: Must-Fix-Now Analysis
Highlight S0 vulnerabilities and bugs separately from S0 code-smells:
- S0 Vulnerabilities/Bugs: List each with ID, track, and title — these are genuine critical items
- S0 Code-Smells: Show count per track — these are complexity/style issues that may warrant severity downgrade
Step 4: Concentration Risk Analysis
For any track carrying >40% of total weight:
- Show file-pattern breakdown of S0/S1 items in that track
- Pros of keeping current assignment
- Cons of keeping current assignment
- Suggestion: Downgrade, split sub-track, or keep as-is
Step 5: Present Options to User
Use AskUserQuestion to offer:
- Approve as-is — accept auto-assignments
- Downgrade S0 code-smells — reclassify non-vulnerability S0s to S1 in heavy tracks (canonical rule: script cognitive-complexity S0 → S1)
- Custom adjustment — user specifies track reassignments
Step 6: Apply and Sync
After user approval:
node scripts/debt/assign-roadmap-refs.js --reportThen sync raw/deduped.jsonl from MASTER_DEBT.jsonl and regenerate:
cp docs/technical-debt/MASTER_DEBT.jsonl docs/technical-debt/raw/deduped.jsonl
node scripts/debt/generate-views.js
node scripts/debt/generate-metrics.jsCanonical Severity Rules
These severity adjustments are standing policy (apply automatically):
| Condition | Action | Rationale |
| Track-E + S0 + type=code-smell | Downgrade to S1 | Script complexity is not production-critical |
Additional rules may be added here as the team establishes more patterns.
Mode: status
Quick quality gate status and issue count check via the MCP server.
Execution
Use the SonarCloud MCP tools directly:
mcp__sonarcloud__get_quality_gate(projectKey: "jasonmichaelbell78_sonash-v0")
mcp__sonarcloud__get_issues(projectKey: "jasonmichaelbell78_sonash-v0", severities: "BLOCKER,CRITICAL")Or via curl:
curl -s -u "$SONAR_TOKEN:" \
"https://sonarcloud.io/api/qualitygates/project_status?projectKey=jasonmichaelbell78_sonash-v0" \
| jq '.projectStatus.status'Mode: sprint
Full cleanup workflow: sync + report + create cleanup branch + track fixes.
Execution
Run sync to get latest state:
node scripts/debt/sync-sonarcloud.js --forceGenerate detailed report:
# Fetch + generate (see report mode above)Create cleanup branch:
git checkout -b cleanup/sonarcloud-$(date +%Y%m%d)- Fix issues using the report as guide. Track progress with TodoWrite.
- Create PR:
gh pr create --title "fix: SonarCloud cleanup sprint $(date +%Y-%m-%d)" \ --body "Fixes SonarCloud issues identified in sonarcloud-issues-detailed.md"
5-PR Structure (for large cleanups)
| PR | Focus | Typical Count |
| 1 | Mechanical fixes (imports, require) | ~189 |
| 2 | Critical severity (BLOCKER/CRITICAL) | ~107 |
| 3 | Major code quality | ~220 |
| 4 | Medium/minor issues | ~1,095 |
| 5 | Security hotspots | ~97 |
Project Configuration
| Setting | Value |
| Project Key | jasonmichaelbell78_sonash-v0 |
| Organization | jasonmichaelbell78 |
| Config File | sonar-project.properties |
| CI Workflow | .github/workflows/sonarcloud.yml |
| MCP Server | scripts/mcp/sonarcloud-server.js |
API Endpoints Reference
| Endpoint | Purpose |
/api/issues/search | Fetch code issues (bugs, smells, vulnerabilities) |
/api/hotspots/search | Fetch security hotspots |
/api/qualitygates/project_status | Quality gate pass/fail |
/api/measures/component | Project metrics (coverage, duplication) |
Scripts Reference
| Script | Purpose | Status |
scripts/debt/sync-sonarcloud.js | Fetch + sync + resolve | ACTIVE |
scripts/generate-detailed-sonar-report.js | Detailed report with snippets | ACTIVE |
scripts/debt/verify-sonar-phase.js | REMOVED | |
scripts/mcp/sonarcloud-server.js | MCP server for direct LLM access | ACTIVE |
Related
add-debt- Add items to TDMS (manual or PR-deferred)- SONARCLOUD_CLEANUP_RUNBOOK.md - Operational runbook
- PROCEDURE.md - TDMS operating procedures
Version History
| Version | Date | Description |
| 1.0 | 2026-02-25 | Initial implementation |
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.

