docs(10_Wiki): 위키 전체 재구성 — Topic_* 폴더를 4개 카테고리로 통합 + 대규모 중복 제거
Topic_Agent/Topic_Blog/Topics/Topics_Biz/Topics_Meeting/Topics_Rag의 마크다운 지식 문서를 Topic_General/Topic_Programming/Topic_Graphic/Topic_Business 4개 카테고리로 재분류. - 중복 제거: frontmatter의 status:duplicate/merged + duplicate_of/redirect_to 필드로 자기 자신을 중복으로 선언한 리다이렉트 stub 1032개 제거, 완전 동일 내용 파일 472개 제거, 동일 파일명·다른 내용 충돌 시 더 큰(완전한) 버전만 유지(162개 제거) — 총 1639개 중복 제거. - 분류: 폴더 단위로 명확한 항목(AI_and_ML/Coding/Architecture 등 → Programming, Comfyui/Visual_Effects → Graphic, Topics_Biz/Topics_Meeting/사업 등 → Business, Poetic_Blog_Writing/창의성/Game_Design 등 → General)은 폴더 우선순위로, 나머지 혼재 폴더(Topic_Agent/Topic_Blog/Topics 루트/Thinking & Reasoning/Other/UI_UX_Assets)는 title/tags 키워드 스코어링으로 파일 단위 분류(불명확한 경우 General로 폴백). 원본 폴더명은 "From_*" 서브폴더로 보존해 추적 가능성 유지. - 최종 배치: Programming 2784 / General 1608 / Graphic 285 / Business 249 = 4926개 문서. - 에이전트 운영 상태(.astra/.agent/.obsidian/sessions/memory/_company/docs/lessons/_shared/src)는 지식 콘텐츠가 아니므로 재분류 대상에서 제외하고 원위치 유지. - Topics/Topic_email(상위 보호 폴더 Topic_email과 파일명 100% 중복) 삭제 — 보호 폴더 자체는 미변경. - 완전히 비게 된 Topic_Agent/Topic_Blog/Topics_Biz/Topics_Rag 폴더 제거.
This commit is contained in:
@@ -0,0 +1,179 @@
|
||||
---
|
||||
id: wiki-2026-0508-자동화된-코드-리뷰
|
||||
title: 자동화된 코드 리뷰
|
||||
category: 10_Wiki/Topics
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: [Automated Code Review, AI Code Review, LLM Code Review]
|
||||
duplicate_of: none
|
||||
source_trust_level: A
|
||||
confidence_score: 0.9
|
||||
verification_status: applied
|
||||
tags: [code-review, automation, llm, devops, ci-cd]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: pending
|
||||
tech_stack:
|
||||
language: typescript
|
||||
framework: 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)
|
||||
```yaml
|
||||
# .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
|
||||
```yaml
|
||||
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)
|
||||
```typescript
|
||||
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
|
||||
```typescript
|
||||
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
|
||||
```yaml
|
||||
rules:
|
||||
- id: no-eval
|
||||
pattern: eval(...)
|
||||
message: 매 eval 의 의 unsafe
|
||||
languages: [python, javascript]
|
||||
severity: ERROR
|
||||
```
|
||||
|
||||
### 매 Gitleaks (secret detection)
|
||||
```bash
|
||||
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
|
||||
- 응용: [[GitHub Actions]] · [[153_pre-commit과_품질_게이트|Pre-commit Hooks]] · [[CodeRabbit]]
|
||||
- Adjacent: [[SAST]]
|
||||
|
||||
## 🤖 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 |
|
||||
Reference in New Issue
Block a user