@su-record/vibe 2.0.0 → 2.0.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/agents/explorer.md +48 -48
- package/.claude/agents/implementer.md +53 -53
- package/.claude/agents/searcher.md +54 -54
- package/.claude/agents/simplifier.md +119 -119
- package/.claude/agents/tester.md +49 -49
- package/.claude/commands/vibe.analyze.md +239 -239
- package/.claude/commands/vibe.continue.md +88 -88
- package/.claude/commands/vibe.diagram.md +178 -178
- package/.claude/commands/vibe.reason.md +306 -306
- package/.claude/commands/vibe.run.md +760 -760
- package/.claude/commands/vibe.spec.md +339 -339
- package/.claude/commands/vibe.tool.md +153 -153
- package/.claude/commands/vibe.ui.md +137 -137
- package/.claude/commands/vibe.verify.md +238 -238
- package/.claude/settings.json +152 -152
- package/.claude/settings.local.json +4 -57
- package/.vibe/config.json +9 -0
- package/.vibe/constitution.md +184 -184
- package/.vibe/rules/core/communication-guide.md +104 -104
- package/.vibe/rules/core/development-philosophy.md +52 -52
- package/.vibe/rules/core/quick-start.md +120 -120
- package/.vibe/rules/quality/bdd-contract-testing.md +388 -388
- package/.vibe/rules/quality/checklist.md +276 -276
- package/.vibe/rules/quality/testing-strategy.md +437 -437
- package/.vibe/rules/standards/anti-patterns.md +369 -369
- package/.vibe/rules/standards/code-structure.md +291 -291
- package/.vibe/rules/standards/complexity-metrics.md +312 -312
- package/.vibe/rules/standards/naming-conventions.md +198 -198
- package/.vibe/rules/tools/mcp-hi-ai-guide.md +665 -665
- package/.vibe/rules/tools/mcp-workflow.md +51 -51
- package/.vibe/setup.sh +31 -31
- package/CLAUDE.md +122 -122
- package/LICENSE +21 -21
- package/README.md +568 -568
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +391 -406
- 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/package.json +67 -67
- package/templates/constitution-template.md +184 -184
- package/templates/contract-backend-template.md +517 -517
- package/templates/contract-frontend-template.md +594 -594
- package/templates/feature-template.md +96 -96
- package/templates/hooks-template.json +103 -103
- package/templates/spec-template.md +199 -199
- package/dist/lib/vibe-mcp.d.ts.map +0 -1
- package/dist/lib/vibe-mcp.js.map +0 -1
|
@@ -1,276 +1,276 @@
|
|
|
1
|
-
# ✅ 최종 검증 체크리스트
|
|
2
|
-
|
|
3
|
-
## 5.1 향상된 코드 품질 체크
|
|
4
|
-
|
|
5
|
-
### 최우선 순위
|
|
6
|
-
|
|
7
|
-
```typescript
|
|
8
|
-
const topPriority = {
|
|
9
|
-
obeysTheGoldenRule: true, // ✅ 요청 범위만 수정
|
|
10
|
-
preservesWorkingCode: true, // ✅ 기존 코드 보존
|
|
11
|
-
respectsExistingStyle: true, // ✅ 기존 스타일 유지
|
|
12
|
-
};
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
### 타입 안전성
|
|
16
|
-
|
|
17
|
-
```typescript
|
|
18
|
-
const typeSafety = {
|
|
19
|
-
noAnyType: true, // ✅ any 타입 사용 금지
|
|
20
|
-
strictNullCheck: true, // ✅ null/undefined 체크
|
|
21
|
-
properTypeGuards: true, // ✅ 타입 가드 사용
|
|
22
|
-
genericTypesWhenNeeded: true, // ✅ 제네릭 타입 활용
|
|
23
|
-
};
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
### 코드 구조 & 복잡도
|
|
27
|
-
|
|
28
|
-
```typescript
|
|
29
|
-
const codeStructure = {
|
|
30
|
-
singleResponsibility: true, // ✅ 단일 책임 원칙
|
|
31
|
-
functionUnder20Lines: true, // ✅ 함수 20줄 이하
|
|
32
|
-
maxNesting3Levels: true, // ✅ 최대 중첩 3단계
|
|
33
|
-
cyclomaticComplexity: 10, // ✅ 순환 복잡도 ≤ 10
|
|
34
|
-
cognitiveComplexity: 15, // ✅ 인지 복잡도 ≤ 15
|
|
35
|
-
maxParameters: 5, // ✅ 매개변수 최대 5개
|
|
36
|
-
componentUnder50Lines: true, // ✅ 컴포넌트 JSX 50줄 이하
|
|
37
|
-
};
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### Halstead 메트릭
|
|
41
|
-
|
|
42
|
-
```typescript
|
|
43
|
-
const halsteadMetrics = {
|
|
44
|
-
vocabulary: true, // ✅ 연산자/피연산자 다양성
|
|
45
|
-
difficulty: true, // ✅ 코드 이해 난이도
|
|
46
|
-
effort: true, // ✅ 정신적 노력
|
|
47
|
-
lowComplexity: true, // ✅ 낮은 복잡도 유지
|
|
48
|
-
};
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### 결합도 & 응집도
|
|
52
|
-
|
|
53
|
-
```typescript
|
|
54
|
-
const couplingCohesion = {
|
|
55
|
-
looseCoupling: true, // ✅ 느슨한 결합 (≤ 7 dependencies)
|
|
56
|
-
highCohesion: true, // ✅ 높은 응집도 (관련 기능만 모음)
|
|
57
|
-
noCircularDeps: true, // ✅ 순환 의존성 없음
|
|
58
|
-
dependencyInjection: true, // ✅ 의존성 주입 패턴
|
|
59
|
-
};
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
### 에러 처리
|
|
63
|
-
|
|
64
|
-
```typescript
|
|
65
|
-
const errorHandling = {
|
|
66
|
-
hasErrorHandling: true, // ✅ try-catch/error state
|
|
67
|
-
hasLoadingState: true, // ✅ 로딩 상태
|
|
68
|
-
hasFallbackUI: true, // ✅ 폴백 UI
|
|
69
|
-
properErrorMessages: true, // ✅ 명확한 에러 메시지
|
|
70
|
-
errorBoundaries: true, // ✅ Error Boundary 사용
|
|
71
|
-
};
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
### 접근성 (Accessibility)
|
|
75
|
-
|
|
76
|
-
```typescript
|
|
77
|
-
const accessibility = {
|
|
78
|
-
hasAriaLabels: true, // ✅ ARIA 레이블
|
|
79
|
-
keyboardAccessible: true, // ✅ 키보드 접근성
|
|
80
|
-
semanticHTML: true, // ✅ 시맨틱 HTML
|
|
81
|
-
focusManagement: true, // ✅ 포커스 관리
|
|
82
|
-
screenReaderFriendly: true, // ✅ 스크린 리더 지원
|
|
83
|
-
};
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
### 성능
|
|
87
|
-
|
|
88
|
-
```typescript
|
|
89
|
-
const performance = {
|
|
90
|
-
noUnnecessaryRenders: true, // ✅ 불필요한 리렌더 방지
|
|
91
|
-
memoizedExpensive: true, // ✅ 무거운 연산 메모이제이션
|
|
92
|
-
lazyLoading: true, // ✅ 지연 로딩
|
|
93
|
-
batchOperations: true, // ✅ API 호출 배치 처리
|
|
94
|
-
optimizedImages: true, // ✅ 이미지 최적화
|
|
95
|
-
codesplitting: true, // ✅ 코드 스플리팅
|
|
96
|
-
};
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
### 유지보수성
|
|
100
|
-
|
|
101
|
-
```typescript
|
|
102
|
-
const maintainability = {
|
|
103
|
-
hasJSDoc: true, // ✅ 주요 함수 문서화
|
|
104
|
-
noMagicNumbers: true, // ✅ 매직 넘버 없음
|
|
105
|
-
consistentNaming: true, // ✅ 일관된 네이밍
|
|
106
|
-
properComments: true, // ✅ 적절한 주석
|
|
107
|
-
testable: true, // ✅ 테스트 가능한 구조
|
|
108
|
-
};
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
### 보안
|
|
112
|
-
|
|
113
|
-
```typescript
|
|
114
|
-
const security = {
|
|
115
|
-
noHardcodedSecrets: true, // ✅ 비밀 정보 하드코딩 금지
|
|
116
|
-
inputValidation: true, // ✅ 입력값 검증
|
|
117
|
-
xssPrevention: true, // ✅ XSS 방지
|
|
118
|
-
csrfProtection: true, // ✅ CSRF 보호
|
|
119
|
-
sqlInjectionPrevention: true, // ✅ SQL Injection 방지
|
|
120
|
-
};
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
## 5.2 프로젝트 체크
|
|
124
|
-
|
|
125
|
-
### 의존성 관리
|
|
126
|
-
|
|
127
|
-
```typescript
|
|
128
|
-
const dependencies = {
|
|
129
|
-
noUnusedDeps: true, // ✅ 미사용 패키지 없음
|
|
130
|
-
noDuplicateDeps: true, // ✅ 중복 기능 패키지 없음
|
|
131
|
-
upToDateDeps: true, // ✅ 최신 버전 유지
|
|
132
|
-
securePackages: true, // ✅ 보안 취약점 없음
|
|
133
|
-
};
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
### 파일 구조
|
|
137
|
-
|
|
138
|
-
```typescript
|
|
139
|
-
const fileStructure = {
|
|
140
|
-
consistentStructure: true, // ✅ 일관된 폴더 구조
|
|
141
|
-
noCircularDeps: true, // ✅ 순환 참조 없음
|
|
142
|
-
logicalGrouping: true, // ✅ 논리적 그룹핑
|
|
143
|
-
clearNaming: true, // ✅ 명확한 파일명
|
|
144
|
-
};
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
### 번들 최적화
|
|
148
|
-
|
|
149
|
-
```typescript
|
|
150
|
-
const bundleOptimization = {
|
|
151
|
-
treeShaking: true, // ✅ Tree shaking
|
|
152
|
-
codeSplitting: true, // ✅ Code splitting
|
|
153
|
-
lazyLoading: true, // ✅ Lazy loading
|
|
154
|
-
minification: true, // ✅ 최소화
|
|
155
|
-
compression: true, // ✅ 압축 (gzip/brotli)
|
|
156
|
-
};
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
## 체크리스트 사용법
|
|
160
|
-
|
|
161
|
-
### 코드 작성 전
|
|
162
|
-
|
|
163
|
-
```
|
|
164
|
-
[ ] 요구사항 명확히 이해
|
|
165
|
-
[ ] 기존 코드 패턴 파악
|
|
166
|
-
[ ] 영향 범위 확인
|
|
167
|
-
[ ] 테스트 계획 수립
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
### 코드 작성 중
|
|
171
|
-
|
|
172
|
-
```
|
|
173
|
-
[ ] 단일 책임 원칙 준수
|
|
174
|
-
[ ] 함수 길이 20줄 이하 유지
|
|
175
|
-
[ ] 중첩 깊이 3단계 이하
|
|
176
|
-
[ ] 매직 넘버 상수화
|
|
177
|
-
[ ] 타입 안전성 확보
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
### 코드 작성 후
|
|
181
|
-
|
|
182
|
-
```
|
|
183
|
-
[ ] 타입 체크 통과
|
|
184
|
-
[ ] 린터 경고 없음
|
|
185
|
-
[ ] 테스트 작성 및 통과
|
|
186
|
-
[ ] 문서화 완료
|
|
187
|
-
[ ] 코드 리뷰 준비
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
### 커밋 전
|
|
191
|
-
|
|
192
|
-
```
|
|
193
|
-
[ ] 불필요한 코드 제거
|
|
194
|
-
[ ] 콘솔 로그 제거
|
|
195
|
-
[ ] 주석 정리
|
|
196
|
-
[ ] 포맷팅 적용
|
|
197
|
-
[ ] 의미 있는 커밋 메시지 작성
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
## 자동 검증 도구
|
|
201
|
-
|
|
202
|
-
### ESLint 설정
|
|
203
|
-
|
|
204
|
-
```javascript
|
|
205
|
-
// .eslintrc.js
|
|
206
|
-
module.exports = {
|
|
207
|
-
rules: {
|
|
208
|
-
'complexity': ['error', 10],
|
|
209
|
-
'max-depth': ['error', 3],
|
|
210
|
-
'max-lines-per-function': ['error', 20],
|
|
211
|
-
'max-params': ['error', 5],
|
|
212
|
-
'no-magic-numbers': ['warn', { ignore: [0, 1, -1] }],
|
|
213
|
-
'@typescript-eslint/no-explicit-any': 'error',
|
|
214
|
-
},
|
|
215
|
-
};
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
### TypeScript 설정
|
|
219
|
-
|
|
220
|
-
```json
|
|
221
|
-
// tsconfig.json
|
|
222
|
-
{
|
|
223
|
-
"compilerOptions": {
|
|
224
|
-
"strict": true,
|
|
225
|
-
"noImplicitAny": true,
|
|
226
|
-
"strictNullChecks": true,
|
|
227
|
-
"noUnusedLocals": true,
|
|
228
|
-
"noUnusedParameters": true,
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
### Git Hooks (pre-commit)
|
|
234
|
-
|
|
235
|
-
```bash
|
|
236
|
-
#!/bin/sh
|
|
237
|
-
# .husky/pre-commit
|
|
238
|
-
|
|
239
|
-
# 타입 체크
|
|
240
|
-
npm run type-check
|
|
241
|
-
|
|
242
|
-
# 린팅
|
|
243
|
-
npm run lint
|
|
244
|
-
|
|
245
|
-
# 테스트
|
|
246
|
-
npm run test
|
|
247
|
-
|
|
248
|
-
# 포맷팅 확인
|
|
249
|
-
npm run format:check
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
## 등급 기준
|
|
253
|
-
|
|
254
|
-
| 등급 | 점수 | 설명 |
|
|
255
|
-
|------|------|------|
|
|
256
|
-
| A+ | 95-100 | 완벽한 코드 품질 |
|
|
257
|
-
| A | 90-94 | 우수한 품질 |
|
|
258
|
-
| B+ | 85-89 | 양호한 품질 |
|
|
259
|
-
| B | 80-84 | 개선 권장 |
|
|
260
|
-
| C+ | 75-79 | 개선 필요 |
|
|
261
|
-
| C | 70-74 | 즉시 개선 필요 |
|
|
262
|
-
| F | < 70 | 리팩토링 필요 |
|
|
263
|
-
|
|
264
|
-
## 빠른 체크 (1분)
|
|
265
|
-
|
|
266
|
-
```
|
|
267
|
-
✅ 요청 범위만 수정했는가?
|
|
268
|
-
✅ any 타입이 없는가?
|
|
269
|
-
✅ 함수가 20줄 이하인가?
|
|
270
|
-
✅ 중첩이 3단계 이하인가?
|
|
271
|
-
✅ 에러 처리를 했는가?
|
|
272
|
-
✅ 매직 넘버를 상수화했는가?
|
|
273
|
-
✅ 테스트를 작성했는가?
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
7개 모두 Yes → 배포 가능 ✅
|
|
1
|
+
# ✅ 최종 검증 체크리스트
|
|
2
|
+
|
|
3
|
+
## 5.1 향상된 코드 품질 체크
|
|
4
|
+
|
|
5
|
+
### 최우선 순위
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
const topPriority = {
|
|
9
|
+
obeysTheGoldenRule: true, // ✅ 요청 범위만 수정
|
|
10
|
+
preservesWorkingCode: true, // ✅ 기존 코드 보존
|
|
11
|
+
respectsExistingStyle: true, // ✅ 기존 스타일 유지
|
|
12
|
+
};
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### 타입 안전성
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
const typeSafety = {
|
|
19
|
+
noAnyType: true, // ✅ any 타입 사용 금지
|
|
20
|
+
strictNullCheck: true, // ✅ null/undefined 체크
|
|
21
|
+
properTypeGuards: true, // ✅ 타입 가드 사용
|
|
22
|
+
genericTypesWhenNeeded: true, // ✅ 제네릭 타입 활용
|
|
23
|
+
};
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### 코드 구조 & 복잡도
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
const codeStructure = {
|
|
30
|
+
singleResponsibility: true, // ✅ 단일 책임 원칙
|
|
31
|
+
functionUnder20Lines: true, // ✅ 함수 20줄 이하
|
|
32
|
+
maxNesting3Levels: true, // ✅ 최대 중첩 3단계
|
|
33
|
+
cyclomaticComplexity: 10, // ✅ 순환 복잡도 ≤ 10
|
|
34
|
+
cognitiveComplexity: 15, // ✅ 인지 복잡도 ≤ 15
|
|
35
|
+
maxParameters: 5, // ✅ 매개변수 최대 5개
|
|
36
|
+
componentUnder50Lines: true, // ✅ 컴포넌트 JSX 50줄 이하
|
|
37
|
+
};
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Halstead 메트릭
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
const halsteadMetrics = {
|
|
44
|
+
vocabulary: true, // ✅ 연산자/피연산자 다양성
|
|
45
|
+
difficulty: true, // ✅ 코드 이해 난이도
|
|
46
|
+
effort: true, // ✅ 정신적 노력
|
|
47
|
+
lowComplexity: true, // ✅ 낮은 복잡도 유지
|
|
48
|
+
};
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### 결합도 & 응집도
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
const couplingCohesion = {
|
|
55
|
+
looseCoupling: true, // ✅ 느슨한 결합 (≤ 7 dependencies)
|
|
56
|
+
highCohesion: true, // ✅ 높은 응집도 (관련 기능만 모음)
|
|
57
|
+
noCircularDeps: true, // ✅ 순환 의존성 없음
|
|
58
|
+
dependencyInjection: true, // ✅ 의존성 주입 패턴
|
|
59
|
+
};
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 에러 처리
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
const errorHandling = {
|
|
66
|
+
hasErrorHandling: true, // ✅ try-catch/error state
|
|
67
|
+
hasLoadingState: true, // ✅ 로딩 상태
|
|
68
|
+
hasFallbackUI: true, // ✅ 폴백 UI
|
|
69
|
+
properErrorMessages: true, // ✅ 명확한 에러 메시지
|
|
70
|
+
errorBoundaries: true, // ✅ Error Boundary 사용
|
|
71
|
+
};
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### 접근성 (Accessibility)
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
const accessibility = {
|
|
78
|
+
hasAriaLabels: true, // ✅ ARIA 레이블
|
|
79
|
+
keyboardAccessible: true, // ✅ 키보드 접근성
|
|
80
|
+
semanticHTML: true, // ✅ 시맨틱 HTML
|
|
81
|
+
focusManagement: true, // ✅ 포커스 관리
|
|
82
|
+
screenReaderFriendly: true, // ✅ 스크린 리더 지원
|
|
83
|
+
};
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### 성능
|
|
87
|
+
|
|
88
|
+
```typescript
|
|
89
|
+
const performance = {
|
|
90
|
+
noUnnecessaryRenders: true, // ✅ 불필요한 리렌더 방지
|
|
91
|
+
memoizedExpensive: true, // ✅ 무거운 연산 메모이제이션
|
|
92
|
+
lazyLoading: true, // ✅ 지연 로딩
|
|
93
|
+
batchOperations: true, // ✅ API 호출 배치 처리
|
|
94
|
+
optimizedImages: true, // ✅ 이미지 최적화
|
|
95
|
+
codesplitting: true, // ✅ 코드 스플리팅
|
|
96
|
+
};
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### 유지보수성
|
|
100
|
+
|
|
101
|
+
```typescript
|
|
102
|
+
const maintainability = {
|
|
103
|
+
hasJSDoc: true, // ✅ 주요 함수 문서화
|
|
104
|
+
noMagicNumbers: true, // ✅ 매직 넘버 없음
|
|
105
|
+
consistentNaming: true, // ✅ 일관된 네이밍
|
|
106
|
+
properComments: true, // ✅ 적절한 주석
|
|
107
|
+
testable: true, // ✅ 테스트 가능한 구조
|
|
108
|
+
};
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### 보안
|
|
112
|
+
|
|
113
|
+
```typescript
|
|
114
|
+
const security = {
|
|
115
|
+
noHardcodedSecrets: true, // ✅ 비밀 정보 하드코딩 금지
|
|
116
|
+
inputValidation: true, // ✅ 입력값 검증
|
|
117
|
+
xssPrevention: true, // ✅ XSS 방지
|
|
118
|
+
csrfProtection: true, // ✅ CSRF 보호
|
|
119
|
+
sqlInjectionPrevention: true, // ✅ SQL Injection 방지
|
|
120
|
+
};
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## 5.2 프로젝트 체크
|
|
124
|
+
|
|
125
|
+
### 의존성 관리
|
|
126
|
+
|
|
127
|
+
```typescript
|
|
128
|
+
const dependencies = {
|
|
129
|
+
noUnusedDeps: true, // ✅ 미사용 패키지 없음
|
|
130
|
+
noDuplicateDeps: true, // ✅ 중복 기능 패키지 없음
|
|
131
|
+
upToDateDeps: true, // ✅ 최신 버전 유지
|
|
132
|
+
securePackages: true, // ✅ 보안 취약점 없음
|
|
133
|
+
};
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### 파일 구조
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
const fileStructure = {
|
|
140
|
+
consistentStructure: true, // ✅ 일관된 폴더 구조
|
|
141
|
+
noCircularDeps: true, // ✅ 순환 참조 없음
|
|
142
|
+
logicalGrouping: true, // ✅ 논리적 그룹핑
|
|
143
|
+
clearNaming: true, // ✅ 명확한 파일명
|
|
144
|
+
};
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### 번들 최적화
|
|
148
|
+
|
|
149
|
+
```typescript
|
|
150
|
+
const bundleOptimization = {
|
|
151
|
+
treeShaking: true, // ✅ Tree shaking
|
|
152
|
+
codeSplitting: true, // ✅ Code splitting
|
|
153
|
+
lazyLoading: true, // ✅ Lazy loading
|
|
154
|
+
minification: true, // ✅ 최소화
|
|
155
|
+
compression: true, // ✅ 압축 (gzip/brotli)
|
|
156
|
+
};
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## 체크리스트 사용법
|
|
160
|
+
|
|
161
|
+
### 코드 작성 전
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
[ ] 요구사항 명확히 이해
|
|
165
|
+
[ ] 기존 코드 패턴 파악
|
|
166
|
+
[ ] 영향 범위 확인
|
|
167
|
+
[ ] 테스트 계획 수립
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### 코드 작성 중
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
[ ] 단일 책임 원칙 준수
|
|
174
|
+
[ ] 함수 길이 20줄 이하 유지
|
|
175
|
+
[ ] 중첩 깊이 3단계 이하
|
|
176
|
+
[ ] 매직 넘버 상수화
|
|
177
|
+
[ ] 타입 안전성 확보
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### 코드 작성 후
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
[ ] 타입 체크 통과
|
|
184
|
+
[ ] 린터 경고 없음
|
|
185
|
+
[ ] 테스트 작성 및 통과
|
|
186
|
+
[ ] 문서화 완료
|
|
187
|
+
[ ] 코드 리뷰 준비
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### 커밋 전
|
|
191
|
+
|
|
192
|
+
```
|
|
193
|
+
[ ] 불필요한 코드 제거
|
|
194
|
+
[ ] 콘솔 로그 제거
|
|
195
|
+
[ ] 주석 정리
|
|
196
|
+
[ ] 포맷팅 적용
|
|
197
|
+
[ ] 의미 있는 커밋 메시지 작성
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## 자동 검증 도구
|
|
201
|
+
|
|
202
|
+
### ESLint 설정
|
|
203
|
+
|
|
204
|
+
```javascript
|
|
205
|
+
// .eslintrc.js
|
|
206
|
+
module.exports = {
|
|
207
|
+
rules: {
|
|
208
|
+
'complexity': ['error', 10],
|
|
209
|
+
'max-depth': ['error', 3],
|
|
210
|
+
'max-lines-per-function': ['error', 20],
|
|
211
|
+
'max-params': ['error', 5],
|
|
212
|
+
'no-magic-numbers': ['warn', { ignore: [0, 1, -1] }],
|
|
213
|
+
'@typescript-eslint/no-explicit-any': 'error',
|
|
214
|
+
},
|
|
215
|
+
};
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### TypeScript 설정
|
|
219
|
+
|
|
220
|
+
```json
|
|
221
|
+
// tsconfig.json
|
|
222
|
+
{
|
|
223
|
+
"compilerOptions": {
|
|
224
|
+
"strict": true,
|
|
225
|
+
"noImplicitAny": true,
|
|
226
|
+
"strictNullChecks": true,
|
|
227
|
+
"noUnusedLocals": true,
|
|
228
|
+
"noUnusedParameters": true,
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Git Hooks (pre-commit)
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
#!/bin/sh
|
|
237
|
+
# .husky/pre-commit
|
|
238
|
+
|
|
239
|
+
# 타입 체크
|
|
240
|
+
npm run type-check
|
|
241
|
+
|
|
242
|
+
# 린팅
|
|
243
|
+
npm run lint
|
|
244
|
+
|
|
245
|
+
# 테스트
|
|
246
|
+
npm run test
|
|
247
|
+
|
|
248
|
+
# 포맷팅 확인
|
|
249
|
+
npm run format:check
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
## 등급 기준
|
|
253
|
+
|
|
254
|
+
| 등급 | 점수 | 설명 |
|
|
255
|
+
|------|------|------|
|
|
256
|
+
| A+ | 95-100 | 완벽한 코드 품질 |
|
|
257
|
+
| A | 90-94 | 우수한 품질 |
|
|
258
|
+
| B+ | 85-89 | 양호한 품질 |
|
|
259
|
+
| B | 80-84 | 개선 권장 |
|
|
260
|
+
| C+ | 75-79 | 개선 필요 |
|
|
261
|
+
| C | 70-74 | 즉시 개선 필요 |
|
|
262
|
+
| F | < 70 | 리팩토링 필요 |
|
|
263
|
+
|
|
264
|
+
## 빠른 체크 (1분)
|
|
265
|
+
|
|
266
|
+
```
|
|
267
|
+
✅ 요청 범위만 수정했는가?
|
|
268
|
+
✅ any 타입이 없는가?
|
|
269
|
+
✅ 함수가 20줄 이하인가?
|
|
270
|
+
✅ 중첩이 3단계 이하인가?
|
|
271
|
+
✅ 에러 처리를 했는가?
|
|
272
|
+
✅ 매직 넘버를 상수화했는가?
|
|
273
|
+
✅ 테스트를 작성했는가?
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
7개 모두 Yes → 배포 가능 ✅
|