Files
2nd/10_Wiki/Topics/Domain_Programming/DevOps_and_Security/자동화된 코드 리뷰.md
T
Antigravity Agent c24165b8bc refactor(topics): 멀티 에이전트용 지식 재편 — _Common(공통 기본기) + Domain_* 구조
에이전트 8종(대화형/프로그래머 C·S/디자이너/설계자/기획자/QA/PD/PM)에게
[공통 기본 능력 + 롤별 Specialty] 2층으로 지식을 주입하기 위한 재분류.
문서 내용·포맷은 무수정, 폴더 이동만 (6,372개 문서 수 보존 확인).

- Topic_Programming → Domain_Programming (내부 구조 보존)
- Topic_Graphic → Domain_Design
- Topic_Business → Domain_Product
- Topic_General → Domain_General
- _Common 신설: Math(구 Topic_Math_Specialty), Reasoning(구 General/From_Thinking & Reasoning),
  Reasoning_Creativity(구 General/From_창의성), Communication(Poetic_Blog_Writing + From_writing)
- 타 도메인의 From_* 폴더는 유지 (출처 표기일 뿐, 이미 도메인에 맞게 분류된 문서)
- 빈 폴더 정리 (memory/procedures)
- 에이전트→폴더 매핑은 workspace의 .astra/agent-knowledge-map.json (9개 에이전트)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-11 11:05:56 +09:00

5.3 KiB

id, title, category, status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, verification_status, tags, raw_sources, last_reinforced, github_commit, tech_stack
id title category status canonical_id aliases duplicate_of source_trust_level confidence_score verification_status tags raw_sources last_reinforced github_commit tech_stack
wiki-2026-0508-자동화된-코드-리뷰 자동화된 코드 리뷰 10_Wiki/Topics verified self
Automated Code Review
AI Code Review
LLM Code Review
none A 0.9 applied
code-review
automation
llm
devops
ci-cd
2026-05-10 pending
language framework
typescript github-actions

자동화된 코드 리뷰

매 한 줄

"매 PR 의 first reviewer 의 의 robot". 매 lint / type / security / style / LLM-based 의 layer 의 PR 의 자동 의 review. 매 2026 — 매 Claude Opus 4.7, GPT-5, CodeRabbit, Greptile 의 PR 의 sub-second 의 inline comment.

매 핵심

매 5 layers

  1. Formatting — Prettier, Black, gofmt. 매 zero-arg.
  2. Linting — ESLint, Ruff, golangci-lint. 매 rule-based.
  3. Type checking — TypeScript, mypy, Pyright.
  4. Security — SAST (Semgrep, CodeQL), secret scanning (Gitleaks).
  5. LLM review — Claude / GPT-5 의 의 architectural / logic / 의도 의 comment.

매 2026 의 LLM review 의 capability

  • 매 inline 의 line-level comment.
  • 매 cross-file 의 understanding (1M context).
  • 매 codebase 의 convention 의 learning (RAG).
  • 매 false positive < 10% — 매 production-ready.

매 CI integration

  • 매 PR open / push 시 trigger.
  • 매 GitHub Actions / GitLab CI / Buildkite.
  • 매 results 의 PR 의 inline 의 post.

매 한계

  • 매 LLM 의 hallucination — 매 "이 함수 의 의 안전 X" 의 의 false alarm.
  • 매 large diff (>1000 lines) 의 의 quality 의 drop.
  • 매 domain knowledge 의 부족 — 매 business rule 의 catch X.
  • 매 human review 의 replacement 의 의 X — 매 augmentation.

💻 패턴

매 Pre-commit (local)

# .pre-commit-config.yaml
repos:
  - repo: https://github.com/astral-sh/ruff-pre-commit
    rev: v0.7.0
    hooks: [{id: ruff}, {id: ruff-format}]
  - repo: https://github.com/pre-commit/mirrors-mypy
    rev: v1.13.0
    hooks: [{id: mypy}]
  - repo: https://github.com/gitleaks/gitleaks
    rev: v8.20.0
    hooks: [{id: gitleaks}]

매 GitHub Actions — full pipeline

name: Code Review
on: [pull_request]
jobs:
  static:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm ci && npm run lint && npm run typecheck
      - uses: returntocorp/semgrep-action@v1
      - uses: github/codeql-action/analyze@v3

  llm-review:
    runs-on: ubuntu-latest
    steps:
      - uses: anthropics/claude-code-action@v1
        with:
          model: claude-opus-4-7
          api-key: ${{ secrets.ANTHROPIC_API_KEY }}

매 Claude API 의 PR review (custom)

import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic();

async function review(diff: string, context: string) {
  const res = await client.messages.create({
    model: "claude-opus-4-7",
    max_tokens: 4096,
    system: [
      { type: "text", text: REVIEW_GUIDE,
        cache_control: { type: "ephemeral" } },
      { type: "text", text: context,
        cache_control: { type: "ephemeral" } },
    ],
    messages: [{
      role: "user",
      content: `Review this PR diff:\n\n${diff}`,
    }],
  });
  return res.content;
}

매 Inline comment 의 posting

import { Octokit } from "@octokit/rest";

await octokit.pulls.createReviewComment({
  owner, repo, pull_number,
  body: comment.body,
  commit_id,
  path: comment.file,
  line: comment.line,
  side: "RIGHT",
});

매 Semgrep 의 custom rule

rules:
  - id: no-eval
    pattern: eval(...)
    message: 매 eval 의 의 unsafe
    languages: [python, javascript]
    severity: ERROR

매 Gitleaks (secret detection)

gitleaks detect --source . --report-format json --report-path leaks.json
# 매 CI 의 의 fail 의 의 if leaks.json non-empty

매 결정 기준

상황 Approach
매 small team, 매 simple lang 매 lint + type + format only
매 enterprise / regulated 매 + SAST + DAST + LLM
매 OSS project 매 CodeRabbit / Greptile (free tier)
매 high-velocity 매 Claude inline review (sub-second)
매 critical infra 매 LLM review + 매 mandatory human

기본값: 매 lint + type + format + Semgrep + Claude review 의 standard stack.

🔗 Graph

🤖 LLM 활용

언제: 매 PR 의 first-pass review. 매 stylistic / obvious bug catch. 매 onboarding의 reviewer 의 augmentation. 언제 X: 매 architectural 의 fundamental 의 decision — 매 senior human reviewer 의 필요.

안티패턴

  • LLM-only review: 매 human 의 skip — 매 hallucination 의 trust.
  • Comment spam: 매 매 nit 의 의 inline — 매 review fatigue.
  • No baseline: 매 SAST 의 thousands of legacy issues — 매 noise.
  • Bypass 의 routine: 매 --no-verify 의 의 habitual.

🧪 검증 / 중복

  • Verified — GitHub Actions docs (2026); Anthropic Claude Code Action; Semgrep / Gitleaks docs.
  • 신뢰도 A.

🕓 Changelog

날짜 변경
2026-05-08 Phase 1
2026-05-10 Manual cleanup — 5-layer review pipeline + Claude integration