@kood/claude-code 0.1.10 → 0.1.12

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.
Files changed (56) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
  3. package/templates/hono/docs/commands/docs-creator.md +239 -0
  4. package/templates/hono/docs/commands/docs-refactor.md +168 -0
  5. package/templates/hono/docs/commands/git-all.md +83 -0
  6. package/templates/hono/docs/commands/git-session.md +91 -0
  7. package/templates/hono/docs/commands/git.md +86 -0
  8. package/templates/hono/docs/commands/lint-fix.md +170 -0
  9. package/templates/hono/docs/commands/lint-init.md +300 -0
  10. package/templates/hono/docs/commands/ts-fix.md +176 -0
  11. package/templates/hono/docs/skills/command-creator/LICENSE.txt +202 -0
  12. package/templates/hono/docs/skills/command-creator/SKILL.md +245 -0
  13. package/templates/hono/docs/skills/command-creator/scripts/init_command.py +244 -0
  14. package/templates/hono/docs/skills/command-creator/scripts/package_command.py +125 -0
  15. package/templates/hono/docs/skills/command-creator/scripts/quick_validate.py +143 -0
  16. package/templates/hono/docs/skills/skill-creator/LICENSE.txt +202 -0
  17. package/templates/hono/docs/skills/skill-creator/SKILL.md +184 -0
  18. package/templates/hono/docs/skills/skill-creator/scripts/init_skill.py +303 -0
  19. package/templates/hono/docs/skills/skill-creator/scripts/package_skill.py +110 -0
  20. package/templates/hono/docs/skills/skill-creator/scripts/quick_validate.py +65 -0
  21. package/templates/npx/docs/commands/docs-creator.md +239 -0
  22. package/templates/npx/docs/commands/docs-refactor.md +168 -0
  23. package/templates/npx/docs/commands/git-all.md +83 -0
  24. package/templates/npx/docs/commands/git-session.md +91 -0
  25. package/templates/npx/docs/commands/git.md +86 -0
  26. package/templates/npx/docs/commands/lint-fix.md +170 -0
  27. package/templates/npx/docs/commands/lint-init.md +300 -0
  28. package/templates/npx/docs/commands/ts-fix.md +176 -0
  29. package/templates/npx/docs/skills/command-creator/LICENSE.txt +202 -0
  30. package/templates/npx/docs/skills/command-creator/SKILL.md +245 -0
  31. package/templates/npx/docs/skills/command-creator/scripts/init_command.py +244 -0
  32. package/templates/npx/docs/skills/command-creator/scripts/package_command.py +125 -0
  33. package/templates/npx/docs/skills/command-creator/scripts/quick_validate.py +143 -0
  34. package/templates/npx/docs/skills/skill-creator/LICENSE.txt +202 -0
  35. package/templates/npx/docs/skills/skill-creator/SKILL.md +184 -0
  36. package/templates/npx/docs/skills/skill-creator/scripts/init_skill.py +303 -0
  37. package/templates/npx/docs/skills/skill-creator/scripts/package_skill.py +110 -0
  38. package/templates/npx/docs/skills/skill-creator/scripts/quick_validate.py +65 -0
  39. package/templates/tanstack-start/docs/commands/docs-creator.md +239 -0
  40. package/templates/tanstack-start/docs/commands/docs-refactor.md +168 -0
  41. package/templates/tanstack-start/docs/commands/git-all.md +83 -0
  42. package/templates/tanstack-start/docs/commands/git-session.md +91 -0
  43. package/templates/tanstack-start/docs/commands/git.md +86 -0
  44. package/templates/tanstack-start/docs/commands/lint-fix.md +170 -0
  45. package/templates/tanstack-start/docs/commands/lint-init.md +300 -0
  46. package/templates/tanstack-start/docs/commands/ts-fix.md +176 -0
  47. package/templates/tanstack-start/docs/skills/command-creator/LICENSE.txt +202 -0
  48. package/templates/tanstack-start/docs/skills/command-creator/SKILL.md +245 -0
  49. package/templates/tanstack-start/docs/skills/command-creator/scripts/init_command.py +244 -0
  50. package/templates/tanstack-start/docs/skills/command-creator/scripts/package_command.py +125 -0
  51. package/templates/tanstack-start/docs/skills/command-creator/scripts/quick_validate.py +143 -0
  52. package/templates/tanstack-start/docs/skills/skill-creator/LICENSE.txt +202 -0
  53. package/templates/tanstack-start/docs/skills/skill-creator/SKILL.md +184 -0
  54. package/templates/tanstack-start/docs/skills/skill-creator/scripts/init_skill.py +303 -0
  55. package/templates/tanstack-start/docs/skills/skill-creator/scripts/package_skill.py +110 -0
  56. package/templates/tanstack-start/docs/skills/skill-creator/scripts/quick_validate.py +65 -0
@@ -0,0 +1,170 @@
1
+ ---
2
+ description: tsc/eslint 오류 검사 및 하나씩 꼼꼼히 수정. ultrathink + sequential thinking 필수 사용.
3
+ allowed-tools: Bash(tsc:*, npx:*, yarn:*, npm:*, pnpm:*), Read, Edit, mcp__sequential-thinking__sequentialthinking
4
+ argument-hint: [파일/디렉토리 경로...]
5
+ ---
6
+
7
+ # Lint Fix Command
8
+
9
+ tsc와 eslint 오류를 검사하고 하나씩 꼼꼼히 수정하는 커맨드.
10
+
11
+ ## CRITICAL: 필수 요구사항
12
+
13
+ | 요구사항 | 설명 |
14
+ |----------|------|
15
+ | **Ultrathink** | 깊은 사고로 오류 분석. 급하게 수정하지 않음 |
16
+ | **Sequential Thinking** | `mcp__sequential-thinking__sequentialthinking` 도구 필수 사용 |
17
+ | **하나씩 수정** | 한 번에 하나의 오류만 집중. 여러 오류 동시 수정 금지 |
18
+
19
+ ## 실행 흐름
20
+
21
+ ```
22
+ 1. tsc --noEmit 실행 → 타입 오류 수집
23
+ 2. eslint 실행 → 린트 오류 수집
24
+ 3. 오류 목록 정리 → TodoWrite로 추적
25
+ 4. 각 오류마다:
26
+ a. Sequential Thinking으로 원인 분석 (최소 3단계)
27
+ b. 오류의 근본 원인 파악
28
+ c. 안전한 수정 방안 도출
29
+ d. 수정 적용
30
+ e. 수정 후 해당 파일 재검사
31
+ 5. 모든 오류 수정 완료 후 전체 재검사
32
+ ```
33
+
34
+ ## Sequential Thinking 사용법
35
+
36
+ **각 오류마다 반드시 Sequential Thinking 실행:**
37
+
38
+ ```
39
+ 오류 분석 시:
40
+ - thoughtNumber: 1 → 오류 메시지 분석 및 이해
41
+ - thoughtNumber: 2 → 관련 코드 컨텍스트 파악
42
+ - thoughtNumber: 3 → 근본 원인 식별
43
+ - thoughtNumber: 4 → 수정 방안 검토 (여러 옵션 고려)
44
+ - thoughtNumber: 5 → 최적 수정 방안 선택 및 적용
45
+ ```
46
+
47
+ **Sequential Thinking 파라미터:**
48
+
49
+ | 파라미터 | 설명 |
50
+ |----------|------|
51
+ | `thought` | 현재 사고 내용 |
52
+ | `nextThoughtNeeded` | 추가 분석 필요 여부 |
53
+ | `thoughtNumber` | 현재 단계 번호 |
54
+ | `totalThoughts` | 예상 총 단계 (동적 조정 가능) |
55
+
56
+ ## 오류 검사 명령어
57
+
58
+ **타입 검사 (tsc):**
59
+ ```bash
60
+ # npm/yarn/pnpm 프로젝트
61
+ npx tsc --noEmit
62
+
63
+ # 특정 파일만
64
+ npx tsc --noEmit $ARGUMENTS
65
+ ```
66
+
67
+ **린트 검사 (eslint):**
68
+ ```bash
69
+ # 전체 프로젝트
70
+ npx eslint .
71
+
72
+ # 특정 파일/디렉토리
73
+ npx eslint $ARGUMENTS
74
+ ```
75
+
76
+ ## 수정 원칙
77
+
78
+ ### DO
79
+
80
+ - 오류 메시지를 정확히 이해
81
+ - 관련 코드 전체를 파악
82
+ - 타입 정의, 인터페이스 확인
83
+ - 수정 전후 비교 분석
84
+ - 수정이 다른 곳에 영향 주는지 확인
85
+
86
+ ### DON'T
87
+
88
+ - 오류 메시지만 보고 급하게 수정
89
+ - `any` 타입으로 회피
90
+ - `// @ts-ignore` 추가
91
+ - `eslint-disable` 남용
92
+ - 여러 오류 한 번에 수정
93
+
94
+ ## 오류 우선순위
95
+
96
+ | 우선순위 | 유형 |
97
+ |----------|------|
98
+ | 1 | 타입 오류 (컴파일 차단) |
99
+ | 2 | 린트 오류 (error 레벨) |
100
+ | 3 | 린트 경고 (warning 레벨) |
101
+
102
+ ## 예시 워크플로우
103
+
104
+ ```
105
+ 1. "npx tsc --noEmit" 실행
106
+ → TS2322: Type 'string' is not assignable to type 'number'
107
+
108
+ 2. Sequential Thinking 시작:
109
+ thought 1: "TS2322 오류. string을 number에 할당 시도"
110
+ thought 2: "해당 파일의 변수 타입과 값 확인 필요"
111
+ thought 3: "함수 반환 타입이 number인데 string 반환 중"
112
+ thought 4: "수정 옵션: 1) 반환값 수정 2) 타입 수정"
113
+ thought 5: "반환값을 올바른 number로 수정하는 것이 적절"
114
+
115
+ 3. Edit으로 수정 적용
116
+
117
+ 4. 해당 파일 재검사
118
+ → 오류 해결 확인
119
+
120
+ 5. 다음 오류로 이동
121
+ ```
122
+
123
+ ## 병렬 처리 전략
124
+
125
+ **다수 오류 발견 시 Task 도구로 병렬 분석:**
126
+
127
+ ```
128
+ 오류가 5개 이상일 때:
129
+ 1. 오류 목록 수집 후 독립적인 오류 그룹 식별
130
+ 2. Task 도구로 각 파일/오류 그룹을 병렬 분석
131
+ 3. 분석 결과 취합 후 순차적으로 수정 적용
132
+ ```
133
+
134
+ **Task 도구 활용 예시:**
135
+
136
+ ```
137
+ # 독립적인 파일들의 오류를 병렬로 분석
138
+ Task 1: "src/utils/api.ts의 TS2322 오류 분석 - 타입 불일치 원인과 수정 방안 제시"
139
+ Task 2: "src/components/Form.tsx의 ESLint no-unused-vars 분석 - 사용되지 않는 변수 식별"
140
+ Task 3: "src/hooks/useAuth.ts의 TS2532 오류 분석 - undefined 체크 필요 위치 파악"
141
+
142
+ → 3개 Task 병렬 실행 (단일 메시지에 다중 Task 호출)
143
+ → 결과 취합 후 Sequential Thinking으로 수정 순서 결정
144
+ → 순차적으로 수정 적용
145
+ ```
146
+
147
+ **병렬 처리 규칙:**
148
+
149
+ | 규칙 | 설명 |
150
+ |------|------|
151
+ | 독립성 확인 | 같은 파일/연관 타입의 오류는 순차 처리 |
152
+ | 분석만 병렬 | 수정 적용은 항상 순차적으로 |
153
+ | 결과 검증 | 병렬 분석 결과 충돌 시 Sequential Thinking으로 해결 |
154
+
155
+ **subagent_type 선택:**
156
+
157
+ | 유형 | 용도 |
158
+ |------|------|
159
+ | `Explore` | 오류 관련 코드 컨텍스트 탐색 |
160
+ | `general-purpose` | 복잡한 타입 오류 심층 분석 |
161
+
162
+ ## 인수 처리
163
+
164
+ | 인수 | 동작 |
165
+ |------|------|
166
+ | 없음 | 전체 프로젝트 검사 |
167
+ | 파일 경로 | 해당 파일만 검사 |
168
+ | 디렉토리 | 해당 디렉토리만 검사 |
169
+
170
+ **인수**: $ARGUMENTS
@@ -0,0 +1,300 @@
1
+ ---
2
+ description: 프로젝트 분석 후 ESLint flat config 설정. Sequential Thinking 필수.
3
+ allowed-tools: Read, Write, Edit, Glob, Bash(npm:*, yarn:*, pnpm:*, npx:*, node:*), mcp__sequential-thinking__sequentialthinking
4
+ ---
5
+
6
+ # Lint Init Command
7
+
8
+ 프로젝트 구조를 분석하고 ESLint flat config를 설정하는 커맨드.
9
+
10
+ ## CRITICAL: 필수 요구사항
11
+
12
+ | 요구사항 | 설명 |
13
+ |----------|------|
14
+ | **Sequential Thinking** | `mcp__sequential-thinking__sequentialthinking` 도구로 프로젝트 분석 |
15
+ | **Flat Config** | ESLint v9+ flat config (`eslint.config.js`) 사용 |
16
+ | **기존 설정 확인** | 기존 ESLint 설정 존재 시 사용자 확인 |
17
+
18
+ ## 실행 흐름
19
+
20
+ ```
21
+ 1. Sequential Thinking으로 프로젝트 분석 시작 (최소 5단계)
22
+ 2. 핵심 파일 수집:
23
+ - package.json (의존성, 스크립트)
24
+ - tsconfig.json (TypeScript 설정)
25
+ - 기존 ESLint 설정 (.eslintrc.*, eslint.config.*)
26
+ 3. 프로젝트 특성 파악:
27
+ - 언어: TypeScript / JavaScript
28
+ - 런타임: Node.js / Browser / 둘 다
29
+ - 프레임워크: React, Vue, Next.js, Express 등
30
+ 4. 적절한 ESLint 설정 생성
31
+ 5. 필요 패키지 목록 제공
32
+ 6. 설치 명령어 안내
33
+ ```
34
+
35
+ ## Sequential Thinking 단계
36
+
37
+ ```
38
+ thought 1: package.json 분석 - 의존성에서 프레임워크/라이브러리 파악
39
+ thought 2: tsconfig.json 분석 - TypeScript 설정 확인
40
+ thought 3: 디렉토리 구조 분석 - src/, app/, pages/ 등 패턴 파악
41
+ thought 4: 기존 ESLint 설정 확인 - 마이그레이션 필요 여부 판단
42
+ thought 5: 최적 ESLint 설정 결정 - 감지된 특성에 맞는 규칙 선택
43
+ ```
44
+
45
+ ## 프로젝트 특성 감지
46
+
47
+ ### 언어 감지
48
+
49
+ | 파일/설정 | 판단 |
50
+ |-----------|------|
51
+ | `tsconfig.json` 존재 | TypeScript |
52
+ | `devDependencies.typescript` | TypeScript |
53
+ | `*.ts`, `*.tsx` 파일 | TypeScript |
54
+ | 그 외 | JavaScript |
55
+
56
+ ### 프레임워크 감지
57
+
58
+ | 의존성 | 프레임워크 |
59
+ |--------|-----------|
60
+ | `react`, `react-dom` | React |
61
+ | `next` | Next.js |
62
+ | `vue` | Vue |
63
+ | `@angular/core` | Angular |
64
+ | `express` | Express |
65
+ | `hono` | Hono |
66
+ | `fastify` | Fastify |
67
+
68
+ ### 런타임 감지
69
+
70
+ | 조건 | 런타임 |
71
+ |------|--------|
72
+ | `express`, `fastify`, `hono` | Node.js |
73
+ | `react`, `vue`, `angular` | Browser |
74
+ | `next`, `nuxt` | 둘 다 |
75
+ | `package.json` type: "module" | ESM |
76
+
77
+ ## ESLint Flat Config 템플릿
78
+
79
+ ### TypeScript + Node.js
80
+
81
+ ```javascript
82
+ import eslint from '@eslint/js';
83
+ import tseslint from '@typescript-eslint/eslint-plugin';
84
+ import tsparser from '@typescript-eslint/parser';
85
+ import globals from 'globals';
86
+
87
+ export default [
88
+ {
89
+ ignores: ['dist/**', 'node_modules/**'],
90
+ },
91
+ eslint.configs.recommended,
92
+ {
93
+ files: ['src/**/*.ts'],
94
+ languageOptions: {
95
+ parser: tsparser,
96
+ parserOptions: {
97
+ ecmaVersion: 'latest',
98
+ sourceType: 'module',
99
+ project: './tsconfig.json',
100
+ },
101
+ globals: {
102
+ ...globals.node,
103
+ },
104
+ },
105
+ plugins: {
106
+ '@typescript-eslint': tseslint,
107
+ },
108
+ rules: {
109
+ ...tseslint.configs.recommended.rules,
110
+ '@typescript-eslint/explicit-function-return-type': 'warn',
111
+ '@typescript-eslint/no-unused-vars': [
112
+ 'error',
113
+ { argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
114
+ ],
115
+ '@typescript-eslint/no-explicit-any': 'error',
116
+ '@typescript-eslint/consistent-type-imports': [
117
+ 'error',
118
+ { prefer: 'type-imports' },
119
+ ],
120
+ 'no-unused-vars': 'off',
121
+ 'no-undef': 'off',
122
+ 'prefer-const': 'error',
123
+ 'no-var': 'error',
124
+ eqeqeq: ['error', 'always'],
125
+ },
126
+ },
127
+ ];
128
+ ```
129
+
130
+ ### TypeScript + React
131
+
132
+ ```javascript
133
+ import eslint from '@eslint/js';
134
+ import tseslint from '@typescript-eslint/eslint-plugin';
135
+ import tsparser from '@typescript-eslint/parser';
136
+ import reactPlugin from 'eslint-plugin-react';
137
+ import reactHooksPlugin from 'eslint-plugin-react-hooks';
138
+ import globals from 'globals';
139
+
140
+ export default [
141
+ {
142
+ ignores: ['dist/**', 'node_modules/**', 'build/**'],
143
+ },
144
+ eslint.configs.recommended,
145
+ {
146
+ files: ['src/**/*.{ts,tsx}'],
147
+ languageOptions: {
148
+ parser: tsparser,
149
+ parserOptions: {
150
+ ecmaVersion: 'latest',
151
+ sourceType: 'module',
152
+ project: './tsconfig.json',
153
+ ecmaFeatures: {
154
+ jsx: true,
155
+ },
156
+ },
157
+ globals: {
158
+ ...globals.browser,
159
+ },
160
+ },
161
+ plugins: {
162
+ '@typescript-eslint': tseslint,
163
+ 'react': reactPlugin,
164
+ 'react-hooks': reactHooksPlugin,
165
+ },
166
+ settings: {
167
+ react: {
168
+ version: 'detect',
169
+ },
170
+ },
171
+ rules: {
172
+ ...tseslint.configs.recommended.rules,
173
+ ...reactPlugin.configs.recommended.rules,
174
+ ...reactHooksPlugin.configs.recommended.rules,
175
+ '@typescript-eslint/no-unused-vars': [
176
+ 'error',
177
+ { argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
178
+ ],
179
+ '@typescript-eslint/no-explicit-any': 'error',
180
+ 'react/react-in-jsx-scope': 'off',
181
+ 'react/prop-types': 'off',
182
+ 'no-unused-vars': 'off',
183
+ 'no-undef': 'off',
184
+ },
185
+ },
186
+ ];
187
+ ```
188
+
189
+ ### JavaScript + Node.js
190
+
191
+ ```javascript
192
+ import eslint from '@eslint/js';
193
+ import globals from 'globals';
194
+
195
+ export default [
196
+ {
197
+ ignores: ['dist/**', 'node_modules/**'],
198
+ },
199
+ eslint.configs.recommended,
200
+ {
201
+ files: ['src/**/*.js'],
202
+ languageOptions: {
203
+ ecmaVersion: 'latest',
204
+ sourceType: 'module',
205
+ globals: {
206
+ ...globals.node,
207
+ },
208
+ },
209
+ rules: {
210
+ 'no-unused-vars': [
211
+ 'error',
212
+ { argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
213
+ ],
214
+ 'prefer-const': 'error',
215
+ 'no-var': 'error',
216
+ eqeqeq: ['error', 'always'],
217
+ },
218
+ },
219
+ ];
220
+ ```
221
+
222
+ ## 필요 패키지
223
+
224
+ ### 기본 (모든 프로젝트)
225
+
226
+ ```bash
227
+ npm install -D eslint @eslint/js globals
228
+ ```
229
+
230
+ ### TypeScript 추가
231
+
232
+ ```bash
233
+ npm install -D @typescript-eslint/parser @typescript-eslint/eslint-plugin
234
+ ```
235
+
236
+ ### React 추가
237
+
238
+ ```bash
239
+ npm install -D eslint-plugin-react eslint-plugin-react-hooks
240
+ ```
241
+
242
+ ### Vue 추가
243
+
244
+ ```bash
245
+ npm install -D eslint-plugin-vue vue-eslint-parser
246
+ ```
247
+
248
+ ## 기존 설정 처리
249
+
250
+ ### .eslintrc.* 마이그레이션
251
+
252
+ 기존 `.eslintrc.json`, `.eslintrc.js` 등 발견 시:
253
+ 1. 사용자에게 마이그레이션 제안
254
+ 2. 기존 규칙을 flat config 형식으로 변환
255
+ 3. 기존 파일 백업 후 삭제
256
+
257
+ ### package.json eslintConfig
258
+
259
+ `package.json` 내 `eslintConfig` 발견 시:
260
+ 1. 해당 설정을 flat config로 변환
261
+ 2. `package.json`에서 `eslintConfig` 제거
262
+
263
+ ## package.json 스크립트
264
+
265
+ 설정 완료 후 추가할 스크립트:
266
+
267
+ ```json
268
+ {
269
+ "scripts": {
270
+ "lint": "eslint .",
271
+ "lint:fix": "eslint . --fix"
272
+ }
273
+ }
274
+ ```
275
+
276
+ ## 체크리스트
277
+
278
+ ### 분석 단계
279
+
280
+ - [ ] package.json 읽기
281
+ - [ ] tsconfig.json 확인
282
+ - [ ] 기존 ESLint 설정 확인
283
+ - [ ] 디렉토리 구조 파악
284
+ - [ ] 소스 파일 패턴 확인
285
+
286
+ ### 설정 단계
287
+
288
+ - [ ] 적절한 템플릿 선택
289
+ - [ ] ignores 패턴 설정
290
+ - [ ] 파일 패턴 (files) 설정
291
+ - [ ] globals 설정
292
+ - [ ] 규칙 커스터마이징
293
+
294
+ ### 완료 단계
295
+
296
+ - [ ] eslint.config.js 생성
297
+ - [ ] 필요 패키지 목록 제공
298
+ - [ ] 설치 명령어 안내
299
+ - [ ] package.json 스크립트 추가 제안
300
+ - [ ] 테스트 실행 안내
@@ -0,0 +1,176 @@
1
+ ---
2
+ description: tsc 타입 오류 검사 및 하나씩 꼼꼼히 수정. ultrathink + sequential thinking 필수 사용.
3
+ allowed-tools: Bash(tsc:*, npx:*, yarn:*, npm:*, pnpm:*), Read, Edit, mcp__sequential-thinking__sequentialthinking
4
+ argument-hint: [파일/디렉토리 경로...]
5
+ ---
6
+
7
+ # TypeScript Fix Command
8
+
9
+ tsc 타입 오류만 검사하고 하나씩 꼼꼼히 수정하는 커맨드.
10
+
11
+ ## CRITICAL: 필수 요구사항
12
+
13
+ | 요구사항 | 설명 |
14
+ |----------|------|
15
+ | **Ultrathink** | 깊은 사고로 오류 분석. 급하게 수정하지 않음 |
16
+ | **Sequential Thinking** | `mcp__sequential-thinking__sequentialthinking` 도구 필수 사용 |
17
+ | **하나씩 수정** | 한 번에 하나의 오류만 집중. 여러 오류 동시 수정 금지 |
18
+
19
+ ## 실행 흐름
20
+
21
+ ```
22
+ 1. tsc --noEmit 실행 → 타입 오류 수집
23
+ 2. 오류 목록 정리 → TodoWrite로 추적
24
+ 3. 각 오류마다:
25
+ a. Sequential Thinking으로 원인 분석 (최소 3단계)
26
+ b. 오류의 근본 원인 파악
27
+ c. 안전한 수정 방안 도출
28
+ d. 수정 적용
29
+ e. 수정 후 해당 파일 재검사
30
+ 4. 모든 오류 수정 완료 후 전체 재검사
31
+ ```
32
+
33
+ ## Sequential Thinking 사용법
34
+
35
+ **각 오류마다 반드시 Sequential Thinking 실행:**
36
+
37
+ ```
38
+ 오류 분석 시:
39
+ - thoughtNumber: 1 → 오류 메시지 분석 및 이해
40
+ - thoughtNumber: 2 → 관련 코드 컨텍스트 파악
41
+ - thoughtNumber: 3 → 근본 원인 식별
42
+ - thoughtNumber: 4 → 수정 방안 검토 (여러 옵션 고려)
43
+ - thoughtNumber: 5 → 최적 수정 방안 선택 및 적용
44
+ ```
45
+
46
+ **Sequential Thinking 파라미터:**
47
+
48
+ | 파라미터 | 설명 |
49
+ |----------|------|
50
+ | `thought` | 현재 사고 내용 |
51
+ | `nextThoughtNeeded` | 추가 분석 필요 여부 |
52
+ | `thoughtNumber` | 현재 단계 번호 |
53
+ | `totalThoughts` | 예상 총 단계 (동적 조정 가능) |
54
+
55
+ ## 오류 검사 명령어
56
+
57
+ ```bash
58
+ # npm/yarn/pnpm 프로젝트
59
+ npx tsc --noEmit
60
+
61
+ # 특정 파일만
62
+ npx tsc --noEmit $ARGUMENTS
63
+ ```
64
+
65
+ ## 수정 원칙
66
+
67
+ ### DO
68
+
69
+ - 오류 메시지를 정확히 이해
70
+ - 관련 코드 전체를 파악
71
+ - 타입 정의, 인터페이스 확인
72
+ - 제네릭 타입 파라미터 추적
73
+ - import된 타입 출처 확인
74
+ - 수정 전후 비교 분석
75
+ - 수정이 다른 곳에 영향 주는지 확인
76
+
77
+ ### DON'T
78
+
79
+ - 오류 메시지만 보고 급하게 수정
80
+ - `any` 타입으로 회피
81
+ - `// @ts-ignore` 추가
82
+ - `// @ts-expect-error` 남용
83
+ - `as unknown as T` 강제 캐스팅
84
+ - 여러 오류 한 번에 수정
85
+
86
+ ## 주요 타입 오류 유형
87
+
88
+ | 코드 | 설명 | 일반적 원인 |
89
+ |------|------|-------------|
90
+ | TS2322 | 할당 불가 | 타입 불일치 |
91
+ | TS2345 | 인수 타입 오류 | 함수 호출 시 타입 불일치 |
92
+ | TS2339 | 속성 없음 | 객체에 해당 속성 미존재 |
93
+ | TS2304 | 이름 찾을 수 없음 | import 누락 또는 오타 |
94
+ | TS2769 | 오버로드 매칭 실패 | 함수 시그니처 불일치 |
95
+ | TS2741 | 필수 속성 누락 | 객체 리터럴에 속성 누락 |
96
+ | TS2532 | undefined 가능성 | null/undefined 체크 필요 |
97
+
98
+ ## 예시 워크플로우
99
+
100
+ ```
101
+ 1. "npx tsc --noEmit" 실행
102
+ → TS2322: Type 'string' is not assignable to type 'number'
103
+
104
+ 2. Sequential Thinking 시작:
105
+ thought 1: "TS2322 오류. string을 number에 할당 시도"
106
+ thought 2: "해당 파일의 변수 타입과 값 확인 필요"
107
+ thought 3: "함수 반환 타입이 number인데 string 반환 중"
108
+ thought 4: "수정 옵션: 1) 반환값 수정 2) 타입 수정"
109
+ thought 5: "반환값을 올바른 number로 수정하는 것이 적절"
110
+
111
+ 3. Edit으로 수정 적용
112
+
113
+ 4. 해당 파일 재검사
114
+ → 오류 해결 확인
115
+
116
+ 5. 다음 오류로 이동
117
+ ```
118
+
119
+ ## 병렬 처리 전략
120
+
121
+ **다수 타입 오류 발견 시 Task 도구로 병렬 분석:**
122
+
123
+ ```
124
+ 오류가 5개 이상일 때:
125
+ 1. 오류 목록 수집 후 독립적인 오류 그룹 식별
126
+ 2. Task 도구로 각 파일/오류 그룹을 병렬 분석
127
+ 3. 분석 결과 취합 후 순차적으로 수정 적용
128
+ ```
129
+
130
+ **Task 도구 활용 예시:**
131
+
132
+ ```
133
+ # 독립적인 파일들의 타입 오류를 병렬로 분석
134
+ Task 1: "src/types/user.ts의 TS2322 분석 - 인터페이스 정의와 실제 사용 비교"
135
+ Task 2: "src/api/client.ts의 TS2345 분석 - 함수 시그니처와 호출부 타입 확인"
136
+ Task 3: "src/utils/format.ts의 TS2339 분석 - 객체 속성 존재 여부 및 타입 확인"
137
+
138
+ → 3개 Task 병렬 실행 (단일 메시지에 다중 Task 호출)
139
+ → 결과 취합 후 Sequential Thinking으로 수정 순서 결정
140
+ → 순차적으로 수정 적용
141
+ ```
142
+
143
+ **병렬 처리 규칙:**
144
+
145
+ | 규칙 | 설명 |
146
+ |------|------|
147
+ | 독립성 확인 | 같은 타입/인터페이스 참조 오류는 순차 처리 |
148
+ | 분석만 병렬 | 수정 적용은 항상 순차적으로 |
149
+ | 타입 전파 주의 | 한 타입 수정이 다른 오류에 영향 줄 수 있음 |
150
+ | 결과 검증 | 병렬 분석 결과 충돌 시 Sequential Thinking으로 해결 |
151
+
152
+ **subagent_type 선택:**
153
+
154
+ | 유형 | 용도 |
155
+ |------|------|
156
+ | `Explore` | 타입 정의 및 사용처 탐색 |
157
+ | `general-purpose` | 복잡한 제네릭/조건부 타입 분석 |
158
+
159
+ **타입 의존성 그래프 고려:**
160
+
161
+ ```
162
+ 예시: UserDTO → UserService → UserController
163
+
164
+ 하위 타입 오류가 상위에 영향 → 하위부터 수정
165
+ → 병렬 분석 시에도 의존 관계 파악 필수
166
+ ```
167
+
168
+ ## 인수 처리
169
+
170
+ | 인수 | 동작 |
171
+ |------|------|
172
+ | 없음 | 전체 프로젝트 검사 |
173
+ | 파일 경로 | 해당 파일만 검사 |
174
+ | 디렉토리 | 해당 디렉토리만 검사 |
175
+
176
+ **인수**: $ARGUMENTS