Deep code understanding using LLMs to detect patterns static analysis canβt catch
AI-powered analysis uses Large Language Models to understand your codeβs intent and context, detecting issues that require semantic understanding beyond pattern matching.
Vibrant uses carefully crafted prompts to guide AI analysis:
// From apps/cli/src/ai/prompts.tsexport const SYSTEM_PROMPT = `You are Vibrant, a security-focused code reviewer specializing in detecting "vibecoding" (AI-generated code that wasn't properly reviewed).CRITICAL: Extract EXACT line numbers from "L123|code" format (123 = line number).CRITICAL: Always respond with valid JSON only - no markdown, no explanations.IMPORTANT DISTINCTIONS:- console.log in CLI tools, scripts, or test files is CORRECT- Regex patterns inside strings are NOT issues- Focus on REAL problems that cause bugs or security issues- Be selective - not every minor issue deserves reporting`;
// From apps/cli/src/commands/lint.tsconst result = await analyze(config, filesToAnalyze, options);// result.summary - Overall code health// result.highlights - Most important issues// result.recommendations - Actionable next steps
π Issues Found β src/api.ts:24:5 ββ hardcoded-credentials API key hardcoded in source code 24|const API_KEY = "sk-abc123"; β Use environment variables insteadπ Diagnosis The codebase shows several security concerns. Hardcoded credentials and unhandled errors could lead to data exposure and silent failures.β‘ Key Findings β’ Hardcoded API key in src/api.ts could expose credentials β’ 3 empty catch blocks swallow errors without logging β’ Multiple console.log statements in production codeπ‘ Recommendations β Move all credentials to environment variables β Add proper error handling with logging β Replace console.log with structured logger
# Basic AI analysisvibrant . --ai# With specific providervibrant . --ai --provider openrouter# With caching enabledvibrant . --ai --cache# Single file deep analysisvibrant src/api.ts --ai