Examples

Examples

Two ready-to-use configuration examples — a minimal setup to get started quickly, and a full setup that enables every feature.

Minimal configuration

The smallest possible setup: OpenAI, all defaults, English output. No config file needed beyond the workflow.

.github/workflows/ai-review.yml

name: AI Code Review
 
on:
  pull_request:
    types: [opened, synchronize, reopened, ready_for_review]
 
jobs:
  ai-review:
    if: github.event.pull_request.draft == false
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
      contents: read
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - run: git fetch origin ${{ github.base_ref }}
      - uses: actions/setup-node@v4
        with:
          node-version: "20"
      - run: npx -y @giolabsuy/ai-code-reviewer@latest review-pr
        env:
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

No .ai-review.yml needed — all defaults apply:

  • Provider: OpenAI gpt-4o-mini
  • Language: English
  • Inline comments on the diff
  • Minimum severity: minor
  • Tech stack: auto-detected

Full configuration

Enables every feature: incremental re-review, @botai inline feedback, auto-approve, self-critique, project grounding, custom rules, Anthropic provider, dependency graph, plus CI-saving concurrency and paths-ignore.

.github/workflows/ai-review.yml

name: AI Code Review
 
on:
  pull_request:
    types: [opened, synchronize, reopened, ready_for_review]
    # Skip reviews on non-code changes to save runner minutes
    paths-ignore:
      - "**/*.md"
      - "**/*.lock"
      - "package-lock.json"
      - "docs/**"
  pull_request_review_comment:
    types: [created]
 
# Only run the latest push per PR; cancel superseded runs
concurrency:
  group: ai-review-${{ github.event.pull_request.number }}
  cancel-in-progress: true
 
jobs:
  ai-review:
    if: github.event_name == 'pull_request' && github.event.pull_request.draft == false
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
      contents: read
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - run: git fetch origin ${{ github.base_ref }}
      - uses: actions/setup-node@v4
        with:
          node-version: "20"
      - run: npx -y @giolabsuy/ai-code-reviewer@latest review-pr
        env:
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 
  handle-feedback:
    if: github.event_name == 'pull_request_review_comment'
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
      contents: read
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: "20"
      - run: npx -y @giolabsuy/ai-code-reviewer@latest handle-feedback
        env:
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          GITHUB_EVENT_PATH: ${{ github.event_path }}
          GITHUB_REPOSITORY: ${{ github.repository }}
          GITHUB_ACTOR: ${{ github.actor }}

.ai-review.yml

# LLM provider
provider: anthropic
model: claude-opus-4-8
 
# Output language
language: en
 
# Tech stack (omit to auto-detect)
# tech: nextjs
 
# Custom rules file (Markdown, appended to system prompt)
rules: ./code-review-rules.md
 
# Files to exclude from review
ignore:
  - node_modules/**
  - dist/**
  - "*.lock"
  - "*.min.js"
  - "**/__snapshots__/**"
  - "**/*.generated.ts"
 
# Minimum severity to report
minSeverity: minor
 
# Maximum patch size per file (bytes)
maxFileSize: 150000
 
# Which check categories to run
checks:
  security: true
  performance: true
  maintainability: true
  testing: true
  documentation: false
  style: false
  bug-risk: true
  architecture: true
 
# Inline comment settings
inlineComments: true
summaryComment: true
maxInlineComments: 25
 
# Additional instructions appended verbatim to the system prompt
# These override everything else — use sparingly
customInstructions: |
  This project follows Clean Architecture (domain / application / infrastructure layers).
  Any import from infrastructure into domain is a critical finding.
  Treat missing OpenTelemetry spans on public service methods as a minor finding.
 
# @botai inline feedback commands (requires handle-feedback job above)
# Threads accept: @botai resolved | dismiss | explain, and @botai approved on a general comment
feedback:
  enabled: true
 
# Auto-approve when the model is confident and there are no blocking findings
autoApprove:
  enabled: true
  minScore: 8
 
# Adversarial self-critique: refutes weak findings and drops low-confidence,
# low-severity ones before posting (reduces false positives). On by default.
selfCritique:
  enabled: true
  confidenceThreshold: 0.6
 
# Project grounding: read CLAUDE.md + docs/ as authority above the generic rules
projectContext:
  claudeMd: true
  docsGlobs:
    - "CLAUDE.md"
    - "docs/**/architecture*.md"
    - "docs/**/adr/**/*.md"
    - "docs/**/*-rules*.md"
    - "docs/**/conventions*.md"
    - "docs/**/domain*.md"
  maxChars: 8000
 
# Official stack docs grounding (opt-in, fail-open). Requires CONTEXT7_API_KEY.
officialDocs:
  enabled: false
  provider: none   # set to 'context7' to enable

Replace ANTHROPIC_API_KEY with OPENAI_API_KEY (and set provider: openai) or GEMINI_API_KEY (and provider: gemini) if you use a different provider. See Providers for model names.

What each feature does in the full config

FeatureConfig keyDocs
Anthropic Claude as the LLMprovider: anthropic + modelProviders
Custom review rulesrules: ./code-review-rules.mdCustom Rules
@botai inline commandsfeedback.enabled: true + handle-feedback jobInline Feedback
Auto-approve clean PRsautoApprove.enabled: true + minScoreAuto-Approve
Self-critique (fewer false positives)selfCritique.enabled: trueReviewer Maturity
Project grounding (CLAUDE.md + docs/)projectContext.claudeMd: trueReviewer Maturity
Official stack docsofficialDocs.provider: context7Reviewer Maturity
CI cost (concurrency + paths-ignore)in the workflow on: blockReviewer Maturity
Incremental re-reviewautomatic on synchronize eventsQuick Start
Dependency graphautomatic on JS/TS stacksDesign Decisions