How to Verify AI-Generated Code with AI Coding Agents
summary
Sonar integrates with MCP-enabled AI agents (Claude demoed) to run run advanced code analysis on code diffs, returning deep static-analysis results in 1–3 seconds. The agent sends file contents and branch context to SonarQube, Sonar checks rules (quality gate enforces 80% coverage), reports a found async issue—synchronous file I/O in an async function—applies a memory-CSV fix, updates imports and toml, reruns tests (all pass) and logs the issue; beta available.
AI-written summary · about
chapters (24)
- 0:00Introduction
- 0:22AI Writes Code Fast, But Is It Correct?
- 0:50New Beta: Static Analysis Built for AI Coding Agents
- 1:07Fast Code Analysis Results in 1–3 Seconds
- 1:56Exploring SonarQube MCP Tools for Agent Workflows
- 2:44MCP Demo: Listing SonarQube Projects
- 3:38Task Setup on the Insider Project
- 4:49Planning First, Then Writing Tests (TDD Workflow)
- 5:19Claude.md Rules Enforcing Test Coverage and TDD
- 5:53Workflow Rule: Always Run Static Code Analysis
- 6:50Writing Tests First and Intentionally Failing Them
- 7:23The Analyze Skill and Required Permissions
- 8:01Sending Code Diffs and Branch Context to Sonar
- 8:36Fixing Issues by Referencing Sonar Static Analysis Rules
- 9:16Logging Issues to Prevent Repeating Bugs Later
- 9:42Implementation Complete and Ready for Analysis
- 10:23Fast Analysis Execution with Preparation Steps
- 11:32Detecting a Deep Issue in Asynchronous Code
- 12:12Using Rule Details to Guide the Fix
- 13:27Reanalyzing Code After the Fix and Rerunning Tests
- 14:18Updating Claude Guidance to Prevent Future Issues
- 14:50Clean Analysis Results and Ready for Pull Request
- 15:15Why Agent-Side Static Analysis Accelerates Development
- 15:31Beta Availability and Closing Invitation
related talks
25mFrom AI Chaos to Production Ready: Using AI Agents to Improve Your Code Quality
49mFrom autocomplete to agents: AI coding assistance state of play
49mClean Code in the AI era
46mCode Quality in the AI era, needed more than ever
50mPanel: Beyond The Vibe: Code Quality First
26mAI Agents as Your Co-Developer
34mAI and Code Quality: Building a Synergy with Human Intelligence
19mWith great power comes great responsibility in code quality
