Skill

Automate Code Reviews with AI

AI-powered code review skill combining SonarQube/CodeQL/Semgrep static analysis with LLM review across security, performance, and architecture.

Works with githubsonarqubecodeqlsemgrepsnyk

78
Spark score
out of 100
Updated 27 days ago
Version 14.2.0
Models
gpt 4oclaude 3 5 sonnetgpt 4claude 4

Add to Favorites

Why it matters

Enhance code quality and security by leveraging AI-powered analysis and automated tools to identify bugs, vulnerabilities, and performance issues across multiple languages.

Outcomes

What it gets done

01

Perform comprehensive code reviews covering security, performance, and maintainability.

02

Integrate with CI/CD pipelines for instant feedback on pull requests.

03

Utilize a combination of static analysis tools and advanced AI models for deep code inspection.

04

Generate actionable recommendations and code examples for identified issues.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/ag-code-review-ai-ai-review | bash

Overview

AI-Powered Code Review Specialist

An AI-powered code review skill combining SonarQube/CodeQL/Semgrep static analysis with AI-driven security, performance, and architecture review, wired into CI/CD with quality gates. Use for comprehensive automated PR review spanning security, performance, architecture, and maintainability across a CI/CD pipeline.

What it does

AI-Powered Code Review Specialist combines automated static analysis, AI pattern recognition, and modern DevOps practices to review pull requests across 30+ languages. Initial triage parses the diff, matches file types to the right static analysis tool, scales analysis depth to PR size (superficial for >1000 lines, deep for <200), and classifies the change type. Multiple tools then run in parallel: CodeQL for deep vulnerability analysis, SonarQube for code smells/complexity/duplication, Semgrep for org-specific security rules, Snyk/Dependabot for supply-chain risk, and GitGuardian/TruffleHog for secret detection. Model selection follows PR shape: fast reviews under 200 lines route to GPT-4o-mini or Claude 4.5 Haiku, deep reasoning to Claude 4.5 Sonnet or GPT-5 with 200K+ token context, code generation to GitHub Copilot or Qodo, and multi-language reviews (30+ languages) to Qodo or CodeAnt AI.

When to use - and when NOT to

Use it for comprehensive PR review spanning security, performance, architecture, maintainability, and testing - not for tasks outside code review. A review-routing strategy picks the engine by risk: PRs over 50 files or 1000 lines changed require human review; security-sensitive or auth-touching changes route to a low-temperature Claude engine with a security-focused system prompt; large test-coverage gaps route to a test-generation engine (Qodo) targeting 80% coverage; everything else goes to a general-purpose model. Architecture analysis checks dependency direction, SOLID principles, and anti-patterns (singletons, God objects over 500 lines/20 methods, anemic models, shotgun surgery), plus microservices-specific checks for service cohesion, per-service data ownership, API versioning, and idempotent event handling.

Inputs and outputs

Security review layers SAST tools (CodeQL, Semgrep, Bandit/Brakeman/Gosec) with AI-driven threat modeling that returns a CWE identifier, CVSS score, exploit scenario, and remediation code, checked against the OWASP Top 10 (broken access control, cryptographic failures, injection, insecure design, misconfiguration, vulnerable components, auth failures, data integrity failures, logging failures, SSRF), plus an AI threat-modeling prompt specifically targeting authentication code for bypass/IDOR, JWT validation flaws, session fixation/timing attacks, missing rate limiting, and credential-stuffing gaps. Performance review benchmarks a PR branch against baseline and flags regressions past specific thresholds - 10% CPU, 15% memory, 20% latency - plus static detection of scalability red flags (N+1 queries, missing indexes, synchronous external calls, in-memory state, unbounded collections, missing pagination, no connection pooling, no rate limiting):

def detect_n_plus_1_queries(code_ast):
    issues = []
    for loop in find_loops(code_ast):
        db_calls = find_database_calls_in_scope(loop.body)
        if len(db_calls) > 0:
            issues.append({
                'severity': 'HIGH',
                'line': loop.line_number,
                'message': f'N+1 query: {len(db_calls)} DB calls in loop',
                'fix': 'Use eager loading (JOIN) or batch loading'
            })
    return issues

Every finding is structured as a review comment with file/line, severity (CRITICAL/HIGH/MEDIUM/LOW/INFO), category, a fix example, CWE/CVSS where applicable, and an effort estimate.

Integrations

Wires into CI/CD via GitHub Actions (or GitLab/Azure DevOps): running SonarQube, CodeQL, and Semgrep on each PR, invoking an AI review step (GPT-5/Claude-class models), posting structured comments back via the GitHub API, and enforcing a quality gate that fails the build on any CRITICAL finding. A full Python orchestration example wires static analysis results and the PR diff into an Anthropic API call, parses the returned JSON issue array, and posts a severity-summarized review that requests changes when critical issues exist.

Who it's for

Engineering teams building an automated PR review pipeline who want AI-assisted contextual review layered on proven static analysis tools, with human oversight reserved for large or architecturally significant changes, plus DORA-metric tracking and quality gates to keep low-quality code out.

FAQ

Common questions

Discussion

Questions & comments ยท 0

Sign In Sign in to leave a comment.