@su-record/vibe 2.2.5 → 2.3.1
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/settings.json +35 -152
- package/.claude/settings.local.json +24 -24
- package/.claude/vibe/constitution.md +184 -184
- package/{rules → .claude/vibe/rules}/core/communication-guide.md +104 -104
- package/{rules → .claude/vibe/rules}/core/development-philosophy.md +52 -52
- package/{rules → .claude/vibe/rules}/core/quick-start.md +120 -120
- package/.claude/vibe/rules/languages/dart-flutter.md +509 -0
- package/.claude/vibe/rules/languages/go.md +396 -0
- package/.claude/vibe/rules/languages/java-spring.md +586 -0
- package/.claude/vibe/rules/languages/kotlin-android.md +491 -0
- package/.claude/vibe/rules/languages/python-django.md +371 -0
- package/.claude/vibe/rules/languages/python-fastapi.md +386 -0
- package/.claude/vibe/rules/languages/rust.md +425 -0
- package/.claude/vibe/rules/languages/swift-ios.md +516 -0
- package/.claude/vibe/rules/languages/typescript-nextjs.md +441 -0
- package/.claude/vibe/rules/languages/typescript-node.md +375 -0
- package/.claude/vibe/rules/languages/typescript-nuxt.md +521 -0
- package/.claude/vibe/rules/languages/typescript-react-native.md +446 -0
- package/.claude/vibe/rules/languages/typescript-react.md +525 -0
- package/.claude/vibe/rules/languages/typescript-vue.md +353 -0
- package/{rules → .claude/vibe/rules}/quality/bdd-contract-testing.md +388 -388
- package/{rules → .claude/vibe/rules}/quality/checklist.md +276 -276
- package/{rules → .claude/vibe/rules}/quality/testing-strategy.md +437 -437
- package/{rules → .claude/vibe/rules}/standards/anti-patterns.md +369 -369
- package/{rules → .claude/vibe/rules}/standards/code-structure.md +291 -291
- package/{rules → .claude/vibe/rules}/standards/complexity-metrics.md +312 -312
- package/{rules → .claude/vibe/rules}/standards/naming-conventions.md +198 -198
- package/.claude/vibe/setup.sh +31 -31
- package/{templates → .claude/vibe/templates}/constitution-template.md +184 -184
- package/{templates → .claude/vibe/templates}/contract-backend-template.md +517 -517
- package/{templates → .claude/vibe/templates}/contract-frontend-template.md +594 -594
- package/{templates → .claude/vibe/templates}/feature-template.md +96 -96
- package/{templates → .claude/vibe/templates}/spec-template.md +199 -199
- package/CLAUDE.md +345 -323
- package/LICENSE +21 -21
- package/README.md +744 -724
- package/{commands/vibe.compound.md → agents/compounder.md} +261 -261
- package/{commands/vibe.diagram.md → agents/diagrammer.md} +178 -178
- package/{commands/vibe.e2e.md → agents/e2e-tester.md} +266 -266
- package/agents/explorer.md +48 -48
- package/agents/implementer.md +53 -53
- package/agents/research/best-practices-agent.md +139 -139
- package/agents/research/codebase-patterns-agent.md +147 -147
- package/agents/research/framework-docs-agent.md +181 -181
- package/agents/research/security-advisory-agent.md +167 -167
- package/agents/review/architecture-reviewer.md +107 -107
- package/agents/review/complexity-reviewer.md +116 -116
- package/agents/review/data-integrity-reviewer.md +88 -88
- package/agents/review/git-history-reviewer.md +103 -103
- package/agents/review/performance-reviewer.md +86 -86
- package/agents/review/python-reviewer.md +152 -152
- package/agents/review/rails-reviewer.md +139 -139
- package/agents/review/react-reviewer.md +144 -144
- package/agents/review/security-reviewer.md +80 -80
- package/agents/review/simplicity-reviewer.md +140 -140
- package/agents/review/test-coverage-reviewer.md +116 -116
- package/agents/review/typescript-reviewer.md +127 -127
- package/agents/searcher.md +54 -54
- package/agents/simplifier.md +119 -119
- package/agents/tester.md +49 -49
- package/{commands/vibe.ui.md → agents/ui-previewer.md} +137 -137
- package/commands/vibe.analyze.md +199 -239
- package/commands/vibe.reason.md +183 -306
- package/commands/vibe.review.md +160 -324
- package/commands/vibe.run.md +836 -836
- package/commands/vibe.spec.md +383 -383
- package/commands/vibe.utils.md +101 -0
- package/commands/vibe.verify.md +241 -238
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +428 -398
- package/dist/cli/index.js.map +1 -1
- package/dist/lib/MemoryManager.js +92 -92
- package/dist/lib/PythonParser.js +108 -108
- package/dist/lib/gemini-mcp.js +15 -15
- package/dist/lib/gemini-oauth.js +35 -35
- package/dist/lib/gpt-mcp.js +17 -17
- package/dist/lib/gpt-oauth.js +44 -44
- package/dist/tools/analytics/getUsageAnalytics.js +12 -12
- package/dist/tools/memory/createMemoryTimeline.js +10 -10
- package/dist/tools/memory/getMemoryGraph.js +12 -12
- package/dist/tools/memory/getSessionContext.js +9 -9
- package/dist/tools/memory/linkMemories.js +14 -14
- package/dist/tools/memory/listMemories.js +4 -4
- package/dist/tools/memory/recallMemory.js +4 -4
- package/dist/tools/memory/saveMemory.js +4 -4
- package/dist/tools/memory/searchMemoriesAdvanced.js +22 -22
- package/dist/tools/planning/generatePrd.js +46 -46
- package/dist/tools/prompt/enhancePromptGemini.js +160 -160
- package/dist/tools/reasoning/applyReasoningFramework.js +56 -56
- package/dist/tools/semantic/analyzeDependencyGraph.js +12 -12
- package/{templates/hooks-template.json → hooks/hooks.json} +103 -103
- package/package.json +69 -70
- package/skills/git-worktree.md +178 -178
- package/skills/priority-todos.md +236 -236
- package/commands/vibe.continue.md +0 -88
- package/commands/vibe.setup.md +0 -97
|
@@ -1,107 +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
|
-
```
|
|
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
|
+
```
|
|
@@ -1,116 +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
|
-
```
|
|
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
|
+
```
|
|
@@ -1,88 +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
|
-
```
|
|
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
|
+
```
|