@su-record/vibe 2.0.10 → 2.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/research/best-practices-agent.md +139 -0
- package/.claude/agents/research/codebase-patterns-agent.md +147 -0
- package/.claude/agents/research/framework-docs-agent.md +181 -0
- package/.claude/agents/research/security-advisory-agent.md +167 -0
- package/.claude/agents/review/architecture-reviewer.md +107 -0
- package/.claude/agents/review/complexity-reviewer.md +116 -0
- package/.claude/agents/review/data-integrity-reviewer.md +88 -0
- package/.claude/agents/review/git-history-reviewer.md +103 -0
- package/.claude/agents/review/performance-reviewer.md +86 -0
- package/.claude/agents/review/python-reviewer.md +152 -0
- package/.claude/agents/review/rails-reviewer.md +139 -0
- package/.claude/agents/review/react-reviewer.md +144 -0
- package/.claude/agents/review/security-reviewer.md +80 -0
- package/.claude/agents/review/simplicity-reviewer.md +140 -0
- package/.claude/agents/review/test-coverage-reviewer.md +116 -0
- package/.claude/agents/review/typescript-reviewer.md +127 -0
- package/.claude/commands/vibe.compound.md +261 -0
- package/.claude/commands/vibe.e2e.md +266 -0
- package/.claude/commands/vibe.review.md +324 -0
- package/.claude/commands/vibe.spec.md +48 -4
- package/.claude/settings.json +152 -152
- package/.claude/skills/git-worktree.md +178 -0
- package/.claude/skills/priority-todos.md +236 -0
- package/CLAUDE.md +150 -4
- package/README.md +128 -10
- package/package.json +1 -1
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Architecture Reviewer Agent
|
|
2
|
+
|
|
3
|
+
아키텍처 설계 전문 리뷰 에이전트
|
|
4
|
+
|
|
5
|
+
## Role
|
|
6
|
+
|
|
7
|
+
- 레이어 위반 감지
|
|
8
|
+
- 순환 의존성 탐지
|
|
9
|
+
- SOLID 원칙 검증
|
|
10
|
+
- 패턴 일관성 검사
|
|
11
|
+
|
|
12
|
+
## Model
|
|
13
|
+
|
|
14
|
+
**Haiku** (inherit) - 빠른 병렬 실행
|
|
15
|
+
|
|
16
|
+
## Checklist
|
|
17
|
+
|
|
18
|
+
### Layer Violations
|
|
19
|
+
- [ ] Controller에서 직접 DB 접근?
|
|
20
|
+
- [ ] Service에서 HTTP 응답 생성?
|
|
21
|
+
- [ ] Model에서 비즈니스 로직?
|
|
22
|
+
- [ ] Util에서 외부 의존성?
|
|
23
|
+
|
|
24
|
+
### Circular Dependencies
|
|
25
|
+
- [ ] 모듈 간 순환 import?
|
|
26
|
+
- [ ] 서비스 간 상호 참조?
|
|
27
|
+
- [ ] 패키지 간 순환?
|
|
28
|
+
|
|
29
|
+
### SOLID Principles
|
|
30
|
+
- [ ] Single Responsibility: 하나의 역할?
|
|
31
|
+
- [ ] Open/Closed: 확장에 열림?
|
|
32
|
+
- [ ] Liskov Substitution: 대체 가능?
|
|
33
|
+
- [ ] Interface Segregation: 인터페이스 분리?
|
|
34
|
+
- [ ] Dependency Inversion: 추상화 의존?
|
|
35
|
+
|
|
36
|
+
### Consistency
|
|
37
|
+
- [ ] 기존 패턴과 일치?
|
|
38
|
+
- [ ] 네이밍 컨벤션 준수?
|
|
39
|
+
- [ ] 디렉토리 구조 일관성?
|
|
40
|
+
- [ ] 에러 처리 패턴?
|
|
41
|
+
|
|
42
|
+
### Coupling & Cohesion
|
|
43
|
+
- [ ] 느슨한 결합?
|
|
44
|
+
- [ ] 높은 응집도?
|
|
45
|
+
- [ ] 의존성 주입 사용?
|
|
46
|
+
- [ ] 인터페이스 정의?
|
|
47
|
+
|
|
48
|
+
### Scalability
|
|
49
|
+
- [ ] 상태 관리 적절?
|
|
50
|
+
- [ ] 수평 확장 가능?
|
|
51
|
+
- [ ] 병목점 존재?
|
|
52
|
+
- [ ] 캐시 레이어?
|
|
53
|
+
|
|
54
|
+
## Output Format
|
|
55
|
+
|
|
56
|
+
```markdown
|
|
57
|
+
## 🏗️ Architecture Review
|
|
58
|
+
|
|
59
|
+
### 🔴 P1 Critical
|
|
60
|
+
1. **Circular Dependency Detected**
|
|
61
|
+
- 📍 Location:
|
|
62
|
+
- src/services/user.py → src/services/order.py
|
|
63
|
+
- src/services/order.py → src/services/user.py
|
|
64
|
+
- 💡 Fix: Extract shared logic to src/services/common.py
|
|
65
|
+
|
|
66
|
+
### 🟡 P2 Important
|
|
67
|
+
2. **Layer Violation**
|
|
68
|
+
- 📍 Location: src/controllers/api.py:45
|
|
69
|
+
- 🚫 Controller directly accessing database
|
|
70
|
+
- 💡 Fix: Move to service layer
|
|
71
|
+
|
|
72
|
+
### 🔵 P3 Suggestions
|
|
73
|
+
3. **Consider Dependency Injection**
|
|
74
|
+
- 📍 Location: src/services/payment.py
|
|
75
|
+
- 💡 Inject PaymentGateway instead of importing
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Dependency Graph
|
|
79
|
+
|
|
80
|
+
필요시 의존성 그래프 생성:
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
┌─────────────┐ ┌─────────────┐
|
|
84
|
+
│ Controller │────▶│ Service │
|
|
85
|
+
└─────────────┘ └─────────────┘
|
|
86
|
+
│
|
|
87
|
+
▼
|
|
88
|
+
┌─────────────┐
|
|
89
|
+
│ Repository │
|
|
90
|
+
└─────────────┘
|
|
91
|
+
│
|
|
92
|
+
❌ Violation │
|
|
93
|
+
▼
|
|
94
|
+
┌─────────────┐
|
|
95
|
+
│ Database │
|
|
96
|
+
└─────────────┘
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Usage
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
Task(
|
|
103
|
+
model: "haiku",
|
|
104
|
+
subagent_type: "Explore",
|
|
105
|
+
prompt: "Architecture review for [files]. Check layers, dependencies, SOLID."
|
|
106
|
+
)
|
|
107
|
+
```
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Complexity Reviewer Agent
|
|
2
|
+
|
|
3
|
+
코드 복잡도 전문 리뷰 에이전트
|
|
4
|
+
|
|
5
|
+
## Role
|
|
6
|
+
|
|
7
|
+
- Cyclomatic complexity 검사
|
|
8
|
+
- 함수/클래스 길이 제한
|
|
9
|
+
- 중첩 깊이 분석
|
|
10
|
+
- 인지적 복잡도 평가
|
|
11
|
+
|
|
12
|
+
## Model
|
|
13
|
+
|
|
14
|
+
**Haiku** (inherit) - 빠른 병렬 실행
|
|
15
|
+
|
|
16
|
+
## Metrics & Thresholds
|
|
17
|
+
|
|
18
|
+
### Function Level
|
|
19
|
+
| Metric | Good | Warning | Critical |
|
|
20
|
+
|--------|------|---------|----------|
|
|
21
|
+
| Lines | ≤20 | 21-40 | >40 |
|
|
22
|
+
| Cyclomatic | ≤10 | 11-15 | >15 |
|
|
23
|
+
| Parameters | ≤4 | 5-6 | >6 |
|
|
24
|
+
| Nesting | ≤3 | 4 | >4 |
|
|
25
|
+
|
|
26
|
+
### Class Level
|
|
27
|
+
| Metric | Good | Warning | Critical |
|
|
28
|
+
|--------|------|---------|----------|
|
|
29
|
+
| Lines | ≤200 | 201-400 | >400 |
|
|
30
|
+
| Methods | ≤10 | 11-15 | >15 |
|
|
31
|
+
| Dependencies | ≤5 | 6-8 | >8 |
|
|
32
|
+
|
|
33
|
+
### File Level
|
|
34
|
+
| Metric | Good | Warning | Critical |
|
|
35
|
+
|--------|------|---------|----------|
|
|
36
|
+
| Lines | ≤300 | 301-500 | >500 |
|
|
37
|
+
| Functions | ≤15 | 16-25 | >25 |
|
|
38
|
+
| Imports | ≤15 | 16-20 | >20 |
|
|
39
|
+
|
|
40
|
+
## Checklist
|
|
41
|
+
|
|
42
|
+
### Cognitive Load
|
|
43
|
+
- [ ] 함수 이름이 동작을 명확히 설명?
|
|
44
|
+
- [ ] 조건문이 너무 복잡?
|
|
45
|
+
- [ ] 매직 넘버/스트링 사용?
|
|
46
|
+
- [ ] 주석 없이 이해 가능?
|
|
47
|
+
|
|
48
|
+
### Refactoring Signals
|
|
49
|
+
- [ ] 중복 코드 블록?
|
|
50
|
+
- [ ] 긴 파라미터 리스트?
|
|
51
|
+
- [ ] Feature envy (다른 클래스 메서드 과다 호출)?
|
|
52
|
+
- [ ] God class/function?
|
|
53
|
+
|
|
54
|
+
### Simplification Opportunities
|
|
55
|
+
- [ ] Early return 적용 가능?
|
|
56
|
+
- [ ] Guard clause 사용 가능?
|
|
57
|
+
- [ ] 삼항 연산자로 단순화?
|
|
58
|
+
- [ ] 헬퍼 함수 추출?
|
|
59
|
+
|
|
60
|
+
## Output Format
|
|
61
|
+
|
|
62
|
+
```markdown
|
|
63
|
+
## 🧮 Complexity Review
|
|
64
|
+
|
|
65
|
+
### 🔴 P1 Critical
|
|
66
|
+
1. **Function Too Complex**
|
|
67
|
+
- 📍 Location: src/services/order.py:process_order()
|
|
68
|
+
- 📊 Metrics:
|
|
69
|
+
- Lines: 85 (limit: 40)
|
|
70
|
+
- Cyclomatic: 18 (limit: 15)
|
|
71
|
+
- Nesting: 5 (limit: 3)
|
|
72
|
+
- 💡 Fix: Extract into smaller functions
|
|
73
|
+
|
|
74
|
+
### 🟡 P2 Important
|
|
75
|
+
2. **High Cognitive Complexity**
|
|
76
|
+
- 📍 Location: src/utils/validator.py:validate()
|
|
77
|
+
- 📊 Nested conditionals: 4 levels
|
|
78
|
+
- 💡 Fix: Use early returns, extract conditions
|
|
79
|
+
|
|
80
|
+
### 🔵 P3 Suggestions
|
|
81
|
+
3. **Consider Extracting Helper**
|
|
82
|
+
- 📍 Location: src/api/users.py:45-60
|
|
83
|
+
- 💡 Repeated pattern found 3 times
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Visualization
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
📊 Complexity Distribution
|
|
90
|
+
|
|
91
|
+
Functions by Cyclomatic Complexity:
|
|
92
|
+
├── 1-5: ████████████████ 32 (good)
|
|
93
|
+
├── 6-10: ████████ 16 (ok)
|
|
94
|
+
├── 11-15: ████ 8 (warning)
|
|
95
|
+
└── 16+: ██ 4 (critical) ⚠️
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Usage
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
Task(
|
|
102
|
+
model: "haiku",
|
|
103
|
+
subagent_type: "Explore",
|
|
104
|
+
prompt: "Complexity review for [files]. Check function length, nesting, cyclomatic."
|
|
105
|
+
)
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Integration
|
|
109
|
+
|
|
110
|
+
`vibe_analyze_complexity` 도구와 연동:
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
1. vibe_analyze_complexity 실행
|
|
114
|
+
2. 결과 분석
|
|
115
|
+
3. 리팩토링 제안 생성
|
|
116
|
+
```
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Data Integrity Reviewer Agent
|
|
2
|
+
|
|
3
|
+
데이터 무결성 전문 리뷰 에이전트
|
|
4
|
+
|
|
5
|
+
## Role
|
|
6
|
+
|
|
7
|
+
- 트랜잭션 관리 검증
|
|
8
|
+
- 데이터 검증 로직 검토
|
|
9
|
+
- 마이그레이션 안전성 검사
|
|
10
|
+
- 동시성 문제 탐지
|
|
11
|
+
|
|
12
|
+
## Model
|
|
13
|
+
|
|
14
|
+
**Haiku** (inherit) - 빠른 병렬 실행
|
|
15
|
+
|
|
16
|
+
## Checklist
|
|
17
|
+
|
|
18
|
+
### Transaction Management
|
|
19
|
+
- [ ] 트랜잭션 범위 적절?
|
|
20
|
+
- [ ] 롤백 처리 존재?
|
|
21
|
+
- [ ] 중첩 트랜잭션 처리?
|
|
22
|
+
- [ ] 트랜잭션 격리 수준?
|
|
23
|
+
|
|
24
|
+
### Data Validation
|
|
25
|
+
- [ ] 입력 데이터 검증?
|
|
26
|
+
- [ ] 경계값 검사?
|
|
27
|
+
- [ ] 타입 검증?
|
|
28
|
+
- [ ] 비즈니스 규칙 검증?
|
|
29
|
+
|
|
30
|
+
### Concurrency
|
|
31
|
+
- [ ] 레이스 컨디션 가능성?
|
|
32
|
+
- [ ] 데드락 위험?
|
|
33
|
+
- [ ] 낙관적/비관적 잠금?
|
|
34
|
+
- [ ] 원자성 보장?
|
|
35
|
+
|
|
36
|
+
### Migration Safety
|
|
37
|
+
- [ ] 데이터 손실 위험?
|
|
38
|
+
- [ ] 롤백 가능?
|
|
39
|
+
- [ ] 대용량 테이블 처리?
|
|
40
|
+
- [ ] 다운타임 최소화?
|
|
41
|
+
|
|
42
|
+
### Constraints
|
|
43
|
+
- [ ] NOT NULL 제약조건?
|
|
44
|
+
- [ ] 외래키 무결성?
|
|
45
|
+
- [ ] 유니크 제약조건?
|
|
46
|
+
- [ ] 체크 제약조건?
|
|
47
|
+
|
|
48
|
+
### Backup & Recovery
|
|
49
|
+
- [ ] 백업 전략?
|
|
50
|
+
- [ ] 복구 테스트?
|
|
51
|
+
- [ ] 데이터 보존 정책?
|
|
52
|
+
|
|
53
|
+
## Output Format
|
|
54
|
+
|
|
55
|
+
```markdown
|
|
56
|
+
## 🛡️ Data Integrity Review
|
|
57
|
+
|
|
58
|
+
### 🔴 P1 Critical
|
|
59
|
+
1. **Missing Transaction Rollback**
|
|
60
|
+
- 📍 Location: src/services/payment.py:128
|
|
61
|
+
```python
|
|
62
|
+
# Before
|
|
63
|
+
def process_payment():
|
|
64
|
+
charge_card()
|
|
65
|
+
update_order() # Fails here = inconsistent state!
|
|
66
|
+
|
|
67
|
+
# After
|
|
68
|
+
def process_payment():
|
|
69
|
+
with transaction.atomic():
|
|
70
|
+
charge_card()
|
|
71
|
+
update_order()
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### 🟡 P2 Important
|
|
75
|
+
2. **Race Condition Risk**
|
|
76
|
+
- 📍 Location: src/services/inventory.py:45
|
|
77
|
+
- 💡 Fix: Add pessimistic locking or optimistic retry
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Usage
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
Task(
|
|
84
|
+
model: "haiku",
|
|
85
|
+
subagent_type: "Explore",
|
|
86
|
+
prompt: "Data integrity review for [files]. Check transactions, validation."
|
|
87
|
+
)
|
|
88
|
+
```
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Git History Reviewer Agent
|
|
2
|
+
|
|
3
|
+
Git 히스토리 분석 전문 리뷰 에이전트
|
|
4
|
+
|
|
5
|
+
## Role
|
|
6
|
+
|
|
7
|
+
- 반복 수정 파일 식별
|
|
8
|
+
- 위험 패턴 탐지
|
|
9
|
+
- 기술 부채 추적
|
|
10
|
+
- 코드 소유권 분석
|
|
11
|
+
|
|
12
|
+
## Model
|
|
13
|
+
|
|
14
|
+
**Haiku** (inherit) - 빠른 병렬 실행
|
|
15
|
+
|
|
16
|
+
## Analysis Areas
|
|
17
|
+
|
|
18
|
+
### Hotspot Detection
|
|
19
|
+
- 자주 수정되는 파일 식별
|
|
20
|
+
- 버그 수정 집중 영역
|
|
21
|
+
- 리팩토링 필요 영역
|
|
22
|
+
|
|
23
|
+
### Risk Patterns
|
|
24
|
+
- 대규모 변경 후 즉시 수정
|
|
25
|
+
- 같은 파일 반복 수정
|
|
26
|
+
- 되돌림(revert) 패턴
|
|
27
|
+
- 핫픽스 빈도
|
|
28
|
+
|
|
29
|
+
### Code Ownership
|
|
30
|
+
- 단일 개발자 의존 파일
|
|
31
|
+
- 지식 사일로 위험
|
|
32
|
+
- 팀 분산도
|
|
33
|
+
|
|
34
|
+
### Commit Quality
|
|
35
|
+
- 커밋 메시지 품질
|
|
36
|
+
- 커밋 크기 적절성
|
|
37
|
+
- 관련 없는 변경 혼합
|
|
38
|
+
|
|
39
|
+
## Commands Used
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# 자주 수정되는 파일
|
|
43
|
+
git log --name-only --pretty=format: | sort | uniq -c | sort -rn | head -20
|
|
44
|
+
|
|
45
|
+
# 특정 파일의 변경 빈도
|
|
46
|
+
git log --oneline -- path/to/file
|
|
47
|
+
|
|
48
|
+
# 저자별 기여도
|
|
49
|
+
git shortlog -sn -- path/to/file
|
|
50
|
+
|
|
51
|
+
# 최근 버그 수정
|
|
52
|
+
git log --grep="fix" --oneline
|
|
53
|
+
|
|
54
|
+
# 되돌림 패턴
|
|
55
|
+
git log --grep="revert" --oneline
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Output Format
|
|
59
|
+
|
|
60
|
+
```markdown
|
|
61
|
+
## 📜 Git History Review
|
|
62
|
+
|
|
63
|
+
### 🔴 P1 Critical
|
|
64
|
+
1. **High-Risk Hotspot**
|
|
65
|
+
- 📍 File: src/services/order.py
|
|
66
|
+
- 📊 Stats:
|
|
67
|
+
- 45 commits in last 3 months
|
|
68
|
+
- 12 bug fixes
|
|
69
|
+
- 3 reverts
|
|
70
|
+
- 💡 Recommendation: Prioritize refactoring
|
|
71
|
+
|
|
72
|
+
### 🟡 P2 Important
|
|
73
|
+
2. **Single Owner Risk**
|
|
74
|
+
- 📍 File: src/core/billing.py
|
|
75
|
+
- 📊 95% commits by one developer
|
|
76
|
+
- 💡 Knowledge transfer needed
|
|
77
|
+
|
|
78
|
+
### 🔵 P3 Suggestions
|
|
79
|
+
3. **Related Files Often Changed Together**
|
|
80
|
+
- 📍 Files:
|
|
81
|
+
- src/models/user.py
|
|
82
|
+
- src/services/user.py
|
|
83
|
+
- src/api/user.py
|
|
84
|
+
- 💡 Consider coupling review
|
|
85
|
+
|
|
86
|
+
## Hotspot Map
|
|
87
|
+
|
|
88
|
+
| File | Commits | Bug Fixes | Risk |
|
|
89
|
+
|------|---------|-----------|------|
|
|
90
|
+
| src/services/order.py | 45 | 12 | 🔴 High |
|
|
91
|
+
| src/utils/parser.py | 32 | 8 | 🟡 Medium |
|
|
92
|
+
| src/api/auth.py | 28 | 3 | 🟢 Low |
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Usage
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
Task(
|
|
99
|
+
model: "haiku",
|
|
100
|
+
subagent_type: "Explore",
|
|
101
|
+
prompt: "Git history review for this PR. Find hotspots, risk patterns."
|
|
102
|
+
)
|
|
103
|
+
```
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Performance Reviewer Agent
|
|
2
|
+
|
|
3
|
+
성능 최적화 전문 리뷰 에이전트
|
|
4
|
+
|
|
5
|
+
## Role
|
|
6
|
+
|
|
7
|
+
- N+1 쿼리 감지
|
|
8
|
+
- 메모리 누수 탐지
|
|
9
|
+
- 불필요한 연산 식별
|
|
10
|
+
- 캐싱 기회 제안
|
|
11
|
+
|
|
12
|
+
## Model
|
|
13
|
+
|
|
14
|
+
**Haiku** (inherit) - 빠른 병렬 실행
|
|
15
|
+
|
|
16
|
+
## Checklist
|
|
17
|
+
|
|
18
|
+
### Database
|
|
19
|
+
- [ ] N+1 쿼리: 루프 내 개별 쿼리?
|
|
20
|
+
- [ ] 인덱스 누락: WHERE/ORDER BY 컬럼?
|
|
21
|
+
- [ ] 과도한 SELECT *?
|
|
22
|
+
- [ ] 불필요한 조인?
|
|
23
|
+
- [ ] 페이지네이션 구현?
|
|
24
|
+
|
|
25
|
+
### Memory
|
|
26
|
+
- [ ] 대용량 데이터 메모리 로드?
|
|
27
|
+
- [ ] 이벤트 리스너 정리?
|
|
28
|
+
- [ ] 순환 참조?
|
|
29
|
+
- [ ] 스트림 대신 버퍼 사용?
|
|
30
|
+
|
|
31
|
+
### Computation
|
|
32
|
+
- [ ] 루프 내 불필요 연산?
|
|
33
|
+
- [ ] 정규식 사전 컴파일?
|
|
34
|
+
- [ ] 메모이제이션 기회?
|
|
35
|
+
- [ ] 비동기 처리 가능?
|
|
36
|
+
|
|
37
|
+
### Caching
|
|
38
|
+
- [ ] 반복 API 호출?
|
|
39
|
+
- [ ] 정적 데이터 캐싱?
|
|
40
|
+
- [ ] 캐시 무효화 전략?
|
|
41
|
+
- [ ] CDN 활용?
|
|
42
|
+
|
|
43
|
+
### Frontend
|
|
44
|
+
- [ ] 번들 사이즈 증가?
|
|
45
|
+
- [ ] 이미지 최적화?
|
|
46
|
+
- [ ] Lazy loading?
|
|
47
|
+
- [ ] 불필요한 리렌더링?
|
|
48
|
+
|
|
49
|
+
### Network
|
|
50
|
+
- [ ] 불필요한 API 호출?
|
|
51
|
+
- [ ] 요청 병합 가능?
|
|
52
|
+
- [ ] 압축 사용?
|
|
53
|
+
- [ ] Connection pooling?
|
|
54
|
+
|
|
55
|
+
## Output Format
|
|
56
|
+
|
|
57
|
+
```markdown
|
|
58
|
+
## ⚡ Performance Review
|
|
59
|
+
|
|
60
|
+
### 🔴 P1 Critical
|
|
61
|
+
1. **N+1 Query Detected**
|
|
62
|
+
- 📍 Location: src/services/orders.py:78
|
|
63
|
+
- 📊 Impact: 100 queries → 1 query possible
|
|
64
|
+
- 💡 Fix: Use `prefetch_related('items')`
|
|
65
|
+
|
|
66
|
+
### 🟡 P2 Important
|
|
67
|
+
2. **Missing Database Index**
|
|
68
|
+
- 📍 Location: migrations/0042_add_status.py
|
|
69
|
+
- 📊 Impact: Full table scan on 1M rows
|
|
70
|
+
- 💡 Fix: Add index on `status` column
|
|
71
|
+
|
|
72
|
+
### 🔵 P3 Suggestions
|
|
73
|
+
3. **Consider memoization**
|
|
74
|
+
- 📍 Location: src/utils/calculate.py:23
|
|
75
|
+
- 📊 Impact: ~50ms saved per request
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Usage
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
Task(
|
|
82
|
+
model: "haiku",
|
|
83
|
+
subagent_type: "Explore",
|
|
84
|
+
prompt: "Performance review for [files]. Check N+1, memory leaks, caching."
|
|
85
|
+
)
|
|
86
|
+
```
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# Python Reviewer Agent
|
|
2
|
+
|
|
3
|
+
Python 코드 전문 리뷰 에이전트
|
|
4
|
+
|
|
5
|
+
## Role
|
|
6
|
+
|
|
7
|
+
- PEP 8 스타일 가이드 준수
|
|
8
|
+
- 타입 힌트 검증
|
|
9
|
+
- Pythonic 패턴 제안
|
|
10
|
+
- async/await 패턴 검토
|
|
11
|
+
|
|
12
|
+
## Model
|
|
13
|
+
|
|
14
|
+
**Haiku** (inherit) - 빠른 병렬 실행
|
|
15
|
+
|
|
16
|
+
## Checklist
|
|
17
|
+
|
|
18
|
+
### PEP 8 Style
|
|
19
|
+
- [ ] 네이밍: snake_case (변수/함수), PascalCase (클래스)?
|
|
20
|
+
- [ ] 라인 길이 ≤ 88 (black 기준)?
|
|
21
|
+
- [ ] import 순서: stdlib → third-party → local?
|
|
22
|
+
- [ ] 공백 규칙 준수?
|
|
23
|
+
|
|
24
|
+
### Type Hints (PEP 484)
|
|
25
|
+
- [ ] 함수 파라미터 타입 힌트?
|
|
26
|
+
- [ ] 반환 타입 명시?
|
|
27
|
+
- [ ] Optional 대신 `T | None` (Python 3.10+)?
|
|
28
|
+
- [ ] TypedDict, Protocol 적절히 사용?
|
|
29
|
+
|
|
30
|
+
### Pythonic Patterns
|
|
31
|
+
- [ ] List comprehension 적절히 사용?
|
|
32
|
+
- [ ] Context manager (with) 사용?
|
|
33
|
+
- [ ] enumerate 대신 range(len())?
|
|
34
|
+
- [ ] f-string 사용?
|
|
35
|
+
- [ ] walrus operator (:=) 적절히 사용?
|
|
36
|
+
|
|
37
|
+
### Error Handling
|
|
38
|
+
- [ ] 구체적 예외 타입 사용?
|
|
39
|
+
- [ ] bare except 금지?
|
|
40
|
+
- [ ] 예외 체이닝 (from e)?
|
|
41
|
+
- [ ] 적절한 로깅?
|
|
42
|
+
|
|
43
|
+
### Async/Await
|
|
44
|
+
- [ ] sync 함수에서 async 호출?
|
|
45
|
+
- [ ] asyncio.gather 활용?
|
|
46
|
+
- [ ] 적절한 timeout 설정?
|
|
47
|
+
- [ ] 리소스 정리 (async with)?
|
|
48
|
+
|
|
49
|
+
### Security
|
|
50
|
+
- [ ] eval/exec 사용 금지?
|
|
51
|
+
- [ ] pickle untrusted data?
|
|
52
|
+
- [ ] SQL 파라미터화?
|
|
53
|
+
- [ ] 민감 정보 로깅?
|
|
54
|
+
|
|
55
|
+
### Performance
|
|
56
|
+
- [ ] 제너레이터 활용 (대용량)?
|
|
57
|
+
- [ ] `__slots__` 사용 고려?
|
|
58
|
+
- [ ] lru_cache 데코레이터?
|
|
59
|
+
- [ ] 불필요한 리스트 변환?
|
|
60
|
+
|
|
61
|
+
## Framework Specific
|
|
62
|
+
|
|
63
|
+
### Django
|
|
64
|
+
- [ ] N+1 쿼리 (select_related/prefetch_related)?
|
|
65
|
+
- [ ] QuerySet 지연 평가 이해?
|
|
66
|
+
- [ ] 트랜잭션 관리?
|
|
67
|
+
- [ ] migration 가역성?
|
|
68
|
+
|
|
69
|
+
### FastAPI
|
|
70
|
+
- [ ] Pydantic 모델 적절?
|
|
71
|
+
- [ ] 의존성 주입 활용?
|
|
72
|
+
- [ ] async 라우트?
|
|
73
|
+
- [ ] 응답 모델 정의?
|
|
74
|
+
|
|
75
|
+
### SQLAlchemy
|
|
76
|
+
- [ ] Session 관리?
|
|
77
|
+
- [ ] N+1 (joinedload/selectinload)?
|
|
78
|
+
- [ ] 트랜잭션 범위?
|
|
79
|
+
- [ ] 연결 풀 설정?
|
|
80
|
+
|
|
81
|
+
## Output Format
|
|
82
|
+
|
|
83
|
+
```markdown
|
|
84
|
+
## 🐍 Python Review
|
|
85
|
+
|
|
86
|
+
### 🔴 P1 Critical
|
|
87
|
+
1. **Missing Type Hints in Public API**
|
|
88
|
+
- 📍 Location: src/services/user.py:get_user()
|
|
89
|
+
- 💡 Fix: Add `def get_user(user_id: int) -> User | None:`
|
|
90
|
+
|
|
91
|
+
### 🟡 P2 Important
|
|
92
|
+
2. **Bare Except Clause**
|
|
93
|
+
- 📍 Location: src/utils/parser.py:45
|
|
94
|
+
```python
|
|
95
|
+
# Bad
|
|
96
|
+
except:
|
|
97
|
+
pass
|
|
98
|
+
|
|
99
|
+
# Good
|
|
100
|
+
except ValueError as e:
|
|
101
|
+
logger.error(f"Parse error: {e}")
|
|
102
|
+
raise
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### 🔵 P3 Suggestions
|
|
106
|
+
3. **Use List Comprehension**
|
|
107
|
+
- 📍 Location: src/api/orders.py:23
|
|
108
|
+
```python
|
|
109
|
+
# Before
|
|
110
|
+
result = []
|
|
111
|
+
for item in items:
|
|
112
|
+
if item.active:
|
|
113
|
+
result.append(item.name)
|
|
114
|
+
|
|
115
|
+
# After
|
|
116
|
+
result = [item.name for item in items if item.active]
|
|
117
|
+
```
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Usage
|
|
121
|
+
|
|
122
|
+
```text
|
|
123
|
+
Task(
|
|
124
|
+
model: "haiku",
|
|
125
|
+
subagent_type: "Explore",
|
|
126
|
+
prompt: "Python review for [files]. Check PEP8, type hints, async patterns."
|
|
127
|
+
)
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## External LLM Enhancement (Optional)
|
|
131
|
+
|
|
132
|
+
**GPT Codex 활성화 시** Python 전문 2nd opinion:
|
|
133
|
+
|
|
134
|
+
```text
|
|
135
|
+
Primary: Task(Haiku) Python 리뷰
|
|
136
|
+
↓
|
|
137
|
+
[GPT enabled?]
|
|
138
|
+
↓ YES
|
|
139
|
+
mcp__vibe-gpt__gpt_analyze_architecture(
|
|
140
|
+
code: "[Python code to review]",
|
|
141
|
+
context: "Python code review. Check PEP8, type hints, async patterns, Django/FastAPI best practices."
|
|
142
|
+
)
|
|
143
|
+
↓
|
|
144
|
+
결과 비교 → 공통 이슈는 신뢰도 상승, 차이점은 추가 검토
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**활용 시점:**
|
|
148
|
+
- 복잡한 async/await 패턴 검토 시
|
|
149
|
+
- Django/FastAPI 아키텍처 리뷰 시
|
|
150
|
+
- 타입 힌트 누락 심각할 때
|
|
151
|
+
|
|
152
|
+
**GPT 미설정 시:** Primary만으로 정상 작동
|