codecontext review

Review code changes against project patterns before PR

The review command analyzes your code changes and checks them against your project's established patterns and conventions. With Real-Time Documentation Intelligence™, it also validates against the latest security standards and best practices from official sources.

Pattern Matching

Ensures consistency with your project's established patterns

Pre-PR Check

Catch issues before they reach code review

CI/CD Ready

Use --strict flag for automated pipeline checks

$ codecontext review

Interactive Demo

Terminal

Options

--branch, -b

Compare against a specific branch (default: main)

$ codecontext review --branch develop

--staged, -s

Only review staged changes

$ codecontext review --staged

--strict

Exit with error code if issues found (for CI/CD)

$ codecontext review --strict

What It Checks

Code Patterns

  • • Naming conventions (variables, functions, files)
  • • Import patterns and paths
  • • Error handling consistency
  • • API endpoint conventions
  • • Component structure

Best Practices

  • • Security patterns
  • • Performance optimizations
  • • Code duplication
  • • Documentation presence
  • • Test coverage

Project Consistency

  • • File organization
  • • Module boundaries
  • • Configuration patterns
  • • Dependency usage
  • • Type definitions

Framework Specific

  • • React component patterns
  • • Express route structure
  • • Next.js conventions
  • • Database query patterns
  • • State management

Severity Levels

Error

Critical issues that must be fixed: security vulnerabilities, breaking changes, or severe anti-patterns.

Warning

Pattern violations that should be addressed: inconsistent naming, import patterns, or project conventions.

Info

Suggestions for improvement: optimization opportunities, better patterns, or alternative approaches.

CI/CD Integration

GitHub Actions Example

name: Code Review
on: [pull_request]

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install CodeContext
        run: npm install -g codecontext
      - name: Review Changes
        run: codecontext review --strict --branch main

The --strict flag ensures the job fails if any issues are found.

Pro Features

Advanced Pattern Analysis

Pro users get deeper analysis with:

  • • Team-wide pattern learning
  • • Cross-repository consistency checks
  • • Custom rule configuration
  • • Historical pattern evolution
  • • Integration with popular linters

See Also

);