How do you implement LLM-based code review and development assistance?
LLM-powered code review augments human reviewers with automated analysis. Capabilities: bug detection (identify logical errors, null pointer risks, race conditions, security vulnerabilities), style enforcement (detect deviations from coding standards, naming conventions, and patterns), performance analysis (identify N+1 queries, unnecessary allocations, missed caching opportunities), and security review (detect injection vulnerabilities, hardcoded secrets, insecure configurations). Implementation: integrate into PR workflow (GitHub Actions, GitLab CI), extract diff context (changed files with surrounding code for context), send to LLM with review instructions specific to the project's standards, parse review output into inline PR comments, and filter low-confidence suggestions to reduce noise. Prompt design: include project-specific coding standards, common pitfall patterns, and examples of good vs bad code for the specific codebase. Provide the reviewer role and specific focus areas (security, performance, maintainability). Advanced features: architectural review (assess whether changes follow established patterns), documentation verification (ensure public APIs have adequate docs), test coverage suggestions (identify untested code paths), and dependency analysis (flag new dependencies for security review). Integration with existing tools: complement static analysis (ESLint, SonarQube catch syntactic issues; LLM catches semantic and logical issues), use tool outputs as context for LLM review, and coordinate with type checkers and linters for comprehensive coverage. Quality control: track suggestion acceptance rate by category, maintain false positive rate below 20%, implement feedback mechanisms (thumbs up/down on suggestions), and tune prompts based on feedback data. Limitations: LLM reviews should augment, not replace, human reviews for critical codebases; the LLM may miss context from broader system architecture; and review quality depends on context window size and prompt design.