Skip to content

[FEATURE] LLM Code Review Assistant — AI-powered code review and suggestions #478

Description

@gelluisaac

Description

Implement an LLM-powered code review system that automatically reviews pull
requests, suggests improvements, and catches potential issues.

Scope

Build intelligent code review assistant.

Files to Touch/Create

  • astroml/llm/code_review/__init__.py
  • astroml/llm/code_review/reviewer.py — Code review logic
  • astroml/llm/code_review/analyzers/ — Language-specific analyzers
  • astroml/llm/code_review/checks/ — Review check implementations
  • astroml/llm/code_review/suggestions.py — Improvement suggestions
  • .github/workflows/llm-code-review.yml — PR review workflow

Review Capabilities

  1. Security: SQL injection, XSS, auth issues
  2. Performance: Inefficient algorithms, memory leaks
  3. Style: PEP8, best practices
  4. Correctness: Logic errors, edge cases
  5. Testing: Missing tests, weak assertions
  6. Documentation: Missing docstrings
  7. Complexity: Overly complex functions

Implementation Details

  • Analyze diffs, not entire files
  • Context-aware: understand surrounding code
  • Categorize issues by severity
  • Suggest specific fixes with code snippets
  • Learn from human reviewer decisions
  • Integrate with GitHub PR comments

Acceptance Criteria

  • Catches >70% of issues human reviewers find
  • False positive rate <20%
  • Review completes within 2min of PR creation
  • Suggestions are actionable
  • Learns from accepted/rejected suggestions
  • Supports Python, SQL, YAML

Review Format

## Security
- **[HIGH]** SQL injection risk in `query.py:45`
  - Use parameterized query instead of f-string

## Performance
- **[MEDIUM]** N+1 query in `accounts.py:123`
  - Consider using `joinedload`

## Style
- **[LOW]** Consider extracting magic number to constant

Labels

enhancement, llm, code-review, developer-tools

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions