@kood/claude-code 0.7.1 → 0.7.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kood/claude-code",
3
- "version": "0.7.1",
3
+ "version": "0.7.3",
4
4
  "description": "Claude Code documentation installer for projects",
5
5
  "type": "module",
6
6
  "bin": "./dist/index.js",
@@ -4,6 +4,48 @@
4
4
 
5
5
  ---
6
6
 
7
+ <mandatory_rules>
8
+
9
+ ## ⚠️ 필수 사용 규칙
10
+
11
+ > **이 규칙은 선택이 아닌 필수입니다. 위반 시 workflow 실패로 간주합니다.**
12
+
13
+ | 조건 | 행동 | 위반 시 |
14
+ |------|------|--------|
15
+ | **3개+ 병렬 에이전트 필요** | Agent Teams **필수** 사용 | ❌ 스킬 실행 중단 |
16
+ | **팀원 간 소통/조율 필요** | Agent Teams **필수** 사용 | ❌ 스킬 실행 중단 |
17
+ | **Agent Teams 미가용** | Task 병렬 호출 (폴백) | ✅ 허용 |
18
+ | **단순 작업 (1-2 에이전트)** | Task 직접 호출 | ✅ 허용 |
19
+
20
+ ### 필수 패턴
21
+
22
+ ```typescript
23
+ // ✅ 3개+ 에이전트 → Agent Teams 필수
24
+ TeamCreate({ team_name: "skill-team", description: "..." })
25
+ Task({ subagent_type: "...", team_name: "skill-team", name: "worker-1", ... })
26
+ Task({ subagent_type: "...", team_name: "skill-team", name: "worker-2", ... })
27
+ Task({ subagent_type: "...", team_name: "skill-team", name: "worker-3", ... })
28
+
29
+ // ❌ 금지: 3개+ 에이전트를 Agent Teams 없이 호출
30
+ Task({ subagent_type: "...", ... })
31
+ Task({ subagent_type: "...", ... })
32
+ Task({ subagent_type: "...", ... }) // Agent Teams 미사용 → 위반
33
+ ```
34
+
35
+ ### 수명주기 필수 관리
36
+
37
+ | 단계 | 필수 행동 |
38
+ |------|----------|
39
+ | **시작** | `TeamCreate` → 팀원 spawn |
40
+ | **완료** | 팀원별 `shutdown_request` 전송 |
41
+ | **해산** | 모든 팀원 종료 확인 → `TeamDelete` |
42
+
43
+ **팀 정리 없이 스킬 종료 금지.**
44
+
45
+ </mandatory_rules>
46
+
47
+ ---
48
+
7
49
  <availability_check>
8
50
 
9
51
  ## 환경 확인
@@ -358,6 +358,8 @@ Task({ subagent_type: 'analyst', prompt: '비평가 관점: 약점과 리스크'
358
358
  ❌ 다음 단계 없이 종료
359
359
  ❌ 결과 저장 없이 종료
360
360
  ❌ 발행일 미확인 정보 기반 추천
361
+ ❌ 3개+ 에이전트 시 Agent Teams 미사용 (가용 환경)
362
+ ❌ 팀 정리(shutdown → TeamDelete) 없이 종료
361
363
  ```
362
364
 
363
365
  ## 병렬 실행 체크리스트
@@ -749,6 +749,8 @@ Skill({
749
749
  ❌ 장단점 없이 옵션만 나열
750
750
  ❌ 단일 파일로 문서 생성 (여러 파일로 분리 필수)
751
751
  ❌ 문서 생성 후 "구현을 시작할까요?" 물어보기 (즉시 진행)
752
+ ❌ 3개+ 에이전트 시 Agent Teams 미사용 (가용 환경)
753
+ ❌ 팀 정리(shutdown → TeamDelete) 없이 종료
752
754
  ```
753
755
 
754
756
  </validation>
@@ -78,6 +78,38 @@ Phase 0에서 자동 분류 → 채널 조합 결정:
78
78
 
79
79
  ---
80
80
 
81
+ <parallel_agent_execution>
82
+
83
+ ### ⚠️ Agent Teams 필수 원칙
84
+
85
+ > **3개+ 병렬 에이전트 사용 시 Agent Teams 필수** (가용 환경에서)
86
+ > - Agent Teams 가용 → `TeamCreate` → 팀원 spawn → 병렬 협업
87
+ > - Agent Teams 미가용 → Task 병렬 호출 (폴백)
88
+
89
+ **기본 실행 패턴 (standard/deep):**
90
+ ```typescript
91
+ // Phase 0: 팀 생성 (standard: 3-4명, deep: 4-6명)
92
+ TeamCreate({ team_name: "research-team", description: "자료 조사" })
93
+
94
+ // Phase 2: 팀원 스폰 (병렬)
95
+ Task({ subagent_type: "researcher", team_name: "research-team", name: "r1", prompt: "기술 A 조사..." })
96
+ Task({ subagent_type: "researcher", team_name: "research-team", name: "r2", prompt: "기술 B 조사..." })
97
+ Task({ subagent_type: "researcher", team_name: "research-team", name: "r3", prompt: "비교 분석..." })
98
+ Task({ subagent_type: "explore", team_name: "research-team", name: "explorer", model: "haiku", prompt: "gh search..." })
99
+ ```
100
+
101
+ **수명주기 관리 (필수):**
102
+ | 단계 | 행동 |
103
+ |------|------|
104
+ | 완료 | 팀원별 `shutdown_request` 전송 |
105
+ | 해산 | `TeamDelete`로 팀 정리 |
106
+
107
+ **quick 모드 예외:** 2명 이하 → Task 직접 호출 허용
108
+
109
+ </parallel_agent_execution>
110
+
111
+ ---
112
+
81
113
  <sourcing_strategy>
82
114
 
83
115
  @../../instructions/sourcing/reliable-search.md
@@ -253,6 +285,6 @@ gRPC가 처리량/레이턴시 우위(HTTP/2)이나 브라우저 미지원.
253
285
  | **리포트** | Exec Summary 250-400자, 출처, 비교 테이블, 권장사항, 참고자료, 메타데이터 |
254
286
  | **저장** | .claude/research/ 저장, 터미널 출력, 경로 안내 |
255
287
 
256
- **절대 금지:** 출처 없는 주장 / 단일 소스 리포트 / Exec Summary 누락 / 권장사항 누락 / 저장 안 함 / 라이브러리 주제 (→ docs-fetch) / **연도 없는 검색** / **출처 등급 미표기**
288
+ **절대 금지:** 출처 없는 주장 / 단일 소스 리포트 / Exec Summary 누락 / 권장사항 누락 / 저장 안 함 / 라이브러리 주제 (→ docs-fetch) / **연도 없는 검색** / **출처 등급 미표기** / **3개+ 에이전트 시 Agent Teams 미사용** (가용 환경) / **팀 정리 없이 종료**
257
289
 
258
290
  </validation>
@@ -21,6 +21,7 @@
21
21
  ---
22
22
 
23
23
  <instructions>
24
+ @docs/architecture.md
24
25
  @docs/library/tauri/index.md
25
26
  @docs/guides/getting-started.md
26
27
  @docs/guides/mobile.md
@@ -0,0 +1,300 @@
1
+ # Architecture
2
+
3
+ > Tauri v2 애플리케이션 아키텍처
4
+
5
+ <instructions>
6
+ @references/async-execution.md
7
+ @references/error-handling.md
8
+ @references/security-model.md
9
+ @references/state-management.md
10
+ @references/mobile-architecture.md
11
+ @references/data-flow.md
12
+ @references/tech-stack.md
13
+ @../guides/getting-started.md
14
+ @../guides/mobile.md
15
+ @../guides/distribution.md
16
+ @../library/tauri/index.md
17
+ </instructions>
18
+
19
+ ---
20
+
21
+ <forbidden>
22
+
23
+ | 분류 | 금지 |
24
+ |------|------|
25
+ | **IPC** | Rust 함수 직접 FFI 호출 (invoke 사용) |
26
+ | **IPC** | async command에 &str 인자 (String 변환 필수) |
27
+ | **보안** | Capabilities 없이 Command 노출 |
28
+ | **보안** | CSP 비활성화, `'unsafe-eval'` 무분별 사용 |
29
+ | **보안** | CDN에서 원격 스크립트 로드 |
30
+ | **상태** | State<T>에 Arc 래핑 (내부 처리) |
31
+ | **상태** | async에서 await 걸쳐 Mutex lock 유지 |
32
+ | **모바일** | iOS 개발을 macOS 외 플랫폼에서 시도 |
33
+ | **모바일** | Android 메인 스레드에서 블로킹 I/O |
34
+ | **v1 API** | allowlist 사용 (capabilities 사용) |
35
+ | **v1 API** | `@tauri-apps/api/tauri` import (core 사용) |
36
+ | **v1 API** | Window 타입 (WebviewWindow 사용) |
37
+
38
+ </forbidden>
39
+
40
+ ---
41
+
42
+ <required>
43
+
44
+ | 분류 | 필수 |
45
+ |------|------|
46
+ | **Command** | `#[tauri::command]` 어노테이션 |
47
+ | **Command** | `tauri::generate_handler![]` 등록 |
48
+ | **Command** | `Result<T, E>` 반환, E 직렬화 가능 |
49
+ | **Command** | `serde::Serialize/Deserialize` 인자/반환값 |
50
+ | **IPC** | `invoke()` from `@tauri-apps/api/core` |
51
+ | **IPC** | camelCase 인자 (Rust snake_case 자동 변환) |
52
+ | **보안** | Capabilities 파일 정의 (`src-tauri/capabilities/`) |
53
+ | **보안** | Plugin Permission 명시 |
54
+ | **보안** | CSP 설정 (`tauri.conf.json > app > security`) |
55
+ | **상태** | `app.manage()` + `State<'_, T>` 패턴 |
56
+ | **상태** | 가변 상태 → `Mutex<T>` |
57
+ | **모바일** | `lib.rs` 엔트리포인트 (라이브러리 로드) |
58
+ | **Config** | identifier 역도메인 형식 |
59
+
60
+ </required>
61
+
62
+ ---
63
+
64
+ <system_overview>
65
+
66
+ ## System Overview
67
+
68
+ ```
69
+ ┌─────────────────────────────────────────────────────────────────┐
70
+ │ Frontend (WebView) │
71
+ │ ┌────────────────┐ ┌────────────────┐ ┌───────────────┐ │
72
+ │ │ React/Vue │───▶│ @tauri-apps/ │───▶│ WebView │ │
73
+ │ │ Framework │◀───│ api/core │◀───│ Renderer │ │
74
+ │ └────────────────┘ └───────┬────────┘ └───────────────┘ │
75
+ │ │ invoke() / listen() │
76
+ └────────────────────────────────┼─────────────────────────────────┘
77
+
78
+ ┌─────────────────────────────────────────────────────────────────┐
79
+ │ IPC Bridge (Trust Boundary) │
80
+ │ ┌────────────────────────────────────────────────────────────┐ │
81
+ │ │ JSON-RPC Serialization | Capabilities Check | CSP Filter │ │
82
+ │ └────────────────────────────────────────────────────────────┘ │
83
+ └────────────────────────────────┼────────────────────────────────┘
84
+
85
+ ┌─────────────────────────────────────────────────────────────────┐
86
+ │ Tauri Core (Rust) │
87
+ │ ┌────────────────────────────────────────────────────────────┐ │
88
+ │ │ Commands | Events | Channels │ │
89
+ │ │ State<T> | Mutex<T> | app.manage() │ │
90
+ │ └────────────────────────────┬───────────────────────────────┘ │
91
+ │ ┌────────────────────────────▼───────────────────────────────┐ │
92
+ │ │ Plugins Layer │ │
93
+ │ │ shell | fs | dialog | http | store | notification │ │
94
+ │ └────────────────────────────┬───────────────────────────────┘ │
95
+ │ ┌────────────────────────────▼───────────────────────────────┐ │
96
+ │ │ tauri-runtime (TAO + WRY) │ │
97
+ │ │ Window Management (TAO) | WebView Rendering (WRY) │ │
98
+ │ └────────────────────────────┬───────────────────────────────┘ │
99
+ └───────────────────────────────┼──────────────────────────────────┘
100
+
101
+ ┌─────────────────────────────────────────────────────────────────┐
102
+ │ Operating System │
103
+ │ Windows (WebView2) | macOS (WKWebView) | Linux (webkitgtk) │
104
+ │ Android (WebView) | iOS (WKWebView) │
105
+ └─────────────────────────────────────────────────────────────────┘
106
+ ```
107
+
108
+ </system_overview>
109
+
110
+ ---
111
+
112
+ <folder_structure>
113
+
114
+ ## Folder Structure
115
+
116
+ ```
117
+ my-tauri-app/
118
+ ├── src/ # 프론트엔드 (React + TypeScript)
119
+ │ ├── main.tsx # React 엔트리
120
+ │ ├── App.tsx # 루트 컴포넌트
121
+ │ ├── components/ # UI 컴포넌트
122
+ │ ├── hooks/ # Custom Hooks
123
+ │ ├── stores/ # Zustand 스토어
124
+ │ └── lib/ # 유틸리티
125
+ ├── src-tauri/ # 백엔드 (Rust)
126
+ │ ├── src/
127
+ │ │ ├── main.rs # 데스크톱 엔트리
128
+ │ │ ├── lib.rs # 공유 로직 (모바일 지원)
129
+ │ │ ├── commands/ # Command 모듈
130
+ │ │ └── error.rs # 에러 타입 정의
131
+ │ ├── capabilities/ # 보안 Capabilities
132
+ │ ├── gen/ # 플랫폼 코드 (apple/, android/)
133
+ │ ├── Cargo.toml # Rust 의존성
134
+ │ ├── tauri.conf.json # Tauri 메인 설정
135
+ │ └── tauri.[platform].conf.json # 플랫폼별 설정
136
+ ├── package.json
137
+ └── vite.config.ts
138
+ ```
139
+
140
+ | 폴더 | 역할 |
141
+ |------|------|
142
+ | **src/** | 프론트엔드 UI |
143
+ | **src-tauri/src/commands/** | Rust Command 정의 |
144
+ | **src-tauri/capabilities/** | 보안 권한 설정 |
145
+ | **src-tauri/gen/** | 플랫폼별 생성 코드 |
146
+
147
+ </folder_structure>
148
+
149
+ ---
150
+
151
+ <process_model>
152
+
153
+ ## Process Model
154
+
155
+ > Tauri는 **Single-Process Multi-Thread Architecture** 사용 (Electron과 다름)
156
+
157
+ **Electron과의 차이:**
158
+ - Electron: Main Process + Renderer Process (별도 프로세스)
159
+ - Tauri: **단일 프로세스** 내에서 Rust Core와 WebView가 **별도 스레드**로 실행
160
+ - IPC는 프로세스 간 통신이 아닌 **스레드 간 통신** → 더 빠르고 메모리 효율적
161
+
162
+ ```
163
+ ┌─────────────────┐ ┌─────────────────┐
164
+ │ Main Thread │ │ WebView Thread │
165
+ │ (Full Trust) │◄───►│ (Sandboxed) │
166
+ │ │ IPC │ │
167
+ │ • System API │ │ • UI Only │
168
+ │ • File I/O │ │ • No Direct │
169
+ │ • Network │ │ System │
170
+ │ • State │ │ Access │
171
+ └─────────────────┘ └─────────────────┘
172
+ (Rust Core) (WebView)
173
+ ```
174
+
175
+ | 이점 | 설명 |
176
+ |------|------|
177
+ | **보안** | WebView Sandbox + CSP로 XSS → 시스템 접근 차단 |
178
+ | **성능** | 메모리 효율 (Electron 대비 1/10), 스레드 통신이 프로세스 통신보다 빠름 |
179
+ | **메모리** | 단일 프로세스로 중복 메모리 할당 없음 |
180
+
181
+ </process_model>
182
+
183
+ ---
184
+
185
+ <ipc_architecture>
186
+
187
+ ## IPC Architecture
188
+
189
+ | 원칙 | 설명 |
190
+ |------|------|
191
+ | **Asynchronous Message Passing** | 직접 함수 호출 대신 메시지 전달 |
192
+ | **JSON-RPC Serialization** | 모든 데이터 JSON 직렬화 |
193
+ | **Trust Boundary** | WebView → Core 요청은 Capabilities 검증 |
194
+
195
+ ### Commands (프론트엔드 → Rust)
196
+
197
+ ```
198
+ Frontend ──invoke()──▶ IPC Bridge ──handler──▶ Command ──▶ State/DB
199
+ ◀──Result<T>─────────────────────────────────────────────────┘
200
+ ```
201
+
202
+ ```typescript
203
+ const user = await invoke<User>('get_user', { id: 1 });
204
+ ```
205
+
206
+ ```rust
207
+ #[tauri::command]
208
+ async fn get_user(id: u32, state: State<'_, Db>) -> Result<User, AppError> {
209
+ state.find_user(id).await
210
+ }
211
+ ```
212
+
213
+ ### Events (양방향 통신)
214
+
215
+ - **Fire-and-forget**: 응답 없음, 단방향
216
+ - **Lifecycle/State 변경**: 진행률, 상태 업데이트
217
+ - **양방향**: Frontend ↔ Rust 모두 emit/listen 가능
218
+
219
+ ### Channels (고속 스트리밍)
220
+
221
+ - **대용량 데이터**: 파일 다운로드, 실시간 로그
222
+ - **단방향 스트림**: Rust → Frontend
223
+ - **고성능**: Events보다 빠름, 대량 메시지에 적합
224
+
225
+ **Details:** @references/async-execution.md, @references/error-handling.md
226
+
227
+ </ipc_architecture>
228
+
229
+ ---
230
+
231
+ <quick_patterns>
232
+
233
+ ## Quick Patterns
234
+
235
+ ```rust
236
+ // Command 정의
237
+ #[tauri::command]
238
+ async fn greet(name: String) -> Result<String, String> {
239
+ Ok(format!("Hello, {}!", name))
240
+ }
241
+
242
+ // State 사용
243
+ #[tauri::command]
244
+ async fn increment(state: State<'_, Mutex<AppState>>) -> Result<u32, String> {
245
+ let mut s = state.lock().unwrap();
246
+ s.counter += 1;
247
+ Ok(s.counter)
248
+ }
249
+
250
+ // main.rs
251
+ fn main() {
252
+ tauri::Builder::default()
253
+ .plugin(tauri_plugin_shell::init())
254
+ .setup(|app| {
255
+ app.manage(Mutex::new(AppState { counter: 0 }));
256
+ Ok(())
257
+ })
258
+ .invoke_handler(tauri::generate_handler![greet, increment])
259
+ .run(tauri::generate_context!())
260
+ .expect("error");
261
+ }
262
+ ```
263
+
264
+ ```typescript
265
+ // 프론트엔드
266
+ import { invoke } from '@tauri-apps/api/core';
267
+ const greeting = await invoke<string>('greet', { name: 'World' });
268
+
269
+ import { listen } from '@tauri-apps/api/event';
270
+ const unlisten = await listen<string>('download-progress', (e) => console.log(e.payload));
271
+ ```
272
+
273
+ ```json
274
+ // src-tauri/capabilities/default.json
275
+ {
276
+ "identifier": "default",
277
+ "windows": ["main"],
278
+ "permissions": ["core:default", "shell:allow-open"]
279
+ }
280
+ ```
281
+
282
+ </quick_patterns>
283
+
284
+ ---
285
+
286
+ <references_index>
287
+
288
+ ## References
289
+
290
+ | 문서 | 내용 |
291
+ |------|------|
292
+ | **@references/async-execution.md** | Tokio runtime, async vs sync command |
293
+ | **@references/error-handling.md** | 에러 타입, 전파 메커니즘 |
294
+ | **@references/security-model.md** | Trust Boundary, Capabilities, CSP |
295
+ | **@references/state-management.md** | Mutex 선택, await lock 패턴 |
296
+ | **@references/mobile-architecture.md** | 엔트리포인트, Plugin 구조 |
297
+ | **@references/data-flow.md** | Command/Event/Plugin 데이터 흐름 |
298
+ | **@references/tech-stack.md** | 기술 스택, WebView 엔진 |
299
+
300
+ </references_index>