For the complete documentation index, see llms.txt. This page is also available as Markdown.
Developer

Sonar Vortex context

Sonar Vortex injects repository-aware context into your AI agent, guiding code changes with architectural awareness and project-specific guidelines.

Overview

Sonar Vortex guides your agent inside the agentic loop of the Agent Centric Development Cycle. It connects to SonarQube Cloud and provides deep, project-specific context to AI agents before they write or edit code. Agents can access these capabilities through the SonarQube CLI-installed skill, or through a locally running SonarQube MCP Server that connects to SonarQube Cloud.

This ensures that the resulting code isn't generic and adheres to your repository's unique standards.

Core capabilities

  • Architectural awareness: Helps agents navigate complex class hierarchies, trace upstream/downstream call flows, and understand execution paths.

  • Intelligent guidelines: Automatically injects relevant coding rules, quality standards, and security requirements based on your project's history and the current task.

  • Semantic navigation: Moves beyond simple text matching to retrieve code based on its actual meaning and structure using Abstract Syntax Trees (AST), semantics, and control flow information.

  • Third-party dependency guidance: Helps agents assess the health and safety of third-party dependencies before they're introduced or updated.

Tool categories

Sonar Vortex provides four context augmentation capability categories. For supported agents, the recommended setups are the SonarQube agent plugin and the SonarQube CLI, which install an agent skill that uses the local Context Augmentation tool. You can also expose the same capabilities as MCP tools by configuring a locally running SonarQube MCP Server that connects to SonarQube Cloud. Each category currently supports a specific set of languages, and we're actively expanding language coverage and adding more categories.

Category
Description
Supported languages

Coding Guidelines

Recommends Sonar rules to follow, based on the project's historical SonarQube issues filtered by what the agent is about to do (prompt nature and categories).

Third-party dependency health and safety

Assesses whether a third-party dependency is healthy and safe to use before it is introduced or updated. Currently covers known security vulnerabilities, supply-chain malware, and license compliance, with more checks in progress. Available only with the SCA feature.

Architecture

Exposes the current architecture graph and user-defined architectural constraints, so the agent understands the current architecture and stays aligned with the intended design.

Semantic navigation

Helps the agent understand the meaning of the code rather than relying on text-based grep, by exposing call stacks, class hierarchies, references, and exact source locations. This lets the agent navigate the codebase and modify the right places effectively.

Java, C#, JavaScript, TypeScript, Python, and Rust

The full list of tools exposed by Sonar Vortex for context augmentation, with their input parameters, is defined on the SonarQube MCP Server Tools page.

Context augmentation for coding guidelines

The Sonar Vortex tool for guidelines injects relevant Sonar rules into the LLM context:

  • Based on your prompt: for example, if your prompt involves access to DB, include all guidelines about DB.

  • Based on the SonarQube issues found in files modified or related to the LLM task: for example, if the LLM plans to modify DBStorage.java, include guidelines from past issues in DBStorage.java.

Diagram showing how Sonar Vortex Tools for Guidelines combine prompt classification from Sonar Rules with historically relevant issues from past analysis to augment the LLM context.

Context augmentation for architecture

The Sonar Vortex tools for architecture give the LLM understanding of both the current architecture and the user-defined intended constraints, powered by semantic data from SonarQube Cloud's Architecture feature. These tools enable the LLM to:

  • Build "the right thing", better aligning with user goals, avoiding mistakes and rework.

  • Build "the thing right", provide an output that is in line with architecture expectations.

Diagram showing Sonar Vortex Tools for Architecture exposes context to the LLM based on SonarQube Architecture analysis configuration and results.

Context augmentation for semantic navigation

The Sonar Vortex tools for semantic navigation give the agent an understanding of the code's meaning, helping it find the right locations to modify based on meaning rather than text. With this context, the agent can:

  • Reach the correct solution faster by jumping straight to the right symbols, references, types, call flows, class hierarchies, etc.

  • Reduce token usage and cost, by avoiding blind reads of entire files.

  • Produce safer, less buggy changes, by surfacing every relevant location that needs updating so nothing is missed.

Diagram showing Sonar Vortex Tools for semantic navigation expose context to the LLM based on the universal dependency graph built from the local workspace.

Setup

For step-by-step setup instructions, see Installing Vortex.

Last updated

Was this helpful?