# Project: Code Review Automation

> Source: https://sukruyusufkaya.com/en/learn/claude-ustaligi/code-review-projesi
> Updated: 2026-05-11T13:48:36.690Z
> Category: Claude Ustalığı
> Module: 11. Real-World Projects
**TLDR:** PR review automation with GitHub Actions + Claude: diff parsing, rubric-based comments, severity labels.

# Pipeline

```
PR opened → Action triggers → Fetch diff → Claude review →
  ├─ post inline comments
  └─ post summary + severity (block / non-block)
```

Block severity = CI red, non-block = bilgilendirici.

```yaml
# .github/workflows/claude-review.yml
name: claude-review
on:
  pull_request:
    types: [opened, synchronize]

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with: { fetch-depth: 0 }
      - name: Get diff
        run: git diff origin/main..HEAD > /tmp/diff.txt
      - name: Run Claude review
        env:
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
        run: python scripts/claude_review.py /tmp/diff.txt
      - name: Post comments
        uses: actions/github-script@v7
        with:
          script: |
            const fs = require('fs');
            const review = JSON.parse(fs.readFileSync('/tmp/review.json', 'utf-8'));
            for (const c of review.blocking_issues) {
              await github.rest.pulls.createReviewComment({
                ...context.repo, pull_number: context.issue.number,
                body: c.comment, commit_id: process.env.GITHUB_SHA,
                path: c.file, line: c.line,
              });
            }
            if (review.blocking_issues.length > 0) {
              core.setFailed('Blocking issues found');
            }
```

### Rubric'e dikkat

Modül 4.2'deki review rubric'ini doğrudan kullan. Her dil / framework için farklı rubric tut.

### Maliyet kontrolü

Çok büyük diff'lerde token bombası olur. Diff'i 30K token üstündeyse parçala; her parça için ayrı review, sonunda Claude'a sentez yaptır.

### False positive yönetimi

Geliştirici 'bu yorum yanlış' tepkisini Claude'a geri besleyebilir. Bunu eval setine al; rubric'i iyileştir.

**Boşluk doldurma egzersizi (text):**
```text
PR review pipeline'ında diff _____ aşılırsa parçala. Yorumlar _____ severity ile etiketlenir. Yanlış pozitifler _____ setine eklenir.
```

> ✋ Kontrol noktası: `q-1103-mc1`