@kood/claude-code 0.5.1 → 0.5.4

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 (88) hide show
  1. package/dist/index.js +604 -261
  2. package/package.json +1 -1
  3. package/templates/.claude/agents/analyst.md +6 -14
  4. package/templates/.claude/agents/architect.md +6 -14
  5. package/templates/.claude/agents/code-reviewer.md +8 -14
  6. package/templates/.claude/agents/dependency-manager.md +8 -14
  7. package/templates/.claude/agents/deployment-validator.md +8 -14
  8. package/templates/.claude/agents/designer.md +8 -0
  9. package/templates/.claude/agents/document-writer.md +75 -316
  10. package/templates/.claude/agents/explore.md +8 -3
  11. package/templates/.claude/agents/git-operator.md +63 -17
  12. package/templates/.claude/agents/implementation-executor.md +14 -37
  13. package/templates/.claude/agents/ko-to-en-translator.md +8 -13
  14. package/templates/.claude/agents/lint-fixer.md +8 -172
  15. package/templates/.claude/agents/planner.md +6 -14
  16. package/templates/.claude/agents/refactor-advisor.md +8 -14
  17. package/templates/.claude/commands/git-all.md +3 -167
  18. package/templates/.claude/commands/git-session.md +3 -71
  19. package/templates/.claude/commands/lint-fix.md +119 -82
  20. package/templates/.claude/commands/lint-init.md +2 -54
  21. package/templates/.claude/commands/pre-deploy.md +143 -82
  22. package/templates/.claude/commands/version-update.md +171 -66
  23. package/templates/.claude/instructions/agent-patterns/agent-coordination.md +208 -0
  24. package/templates/.claude/instructions/agent-patterns/index.md +264 -0
  25. package/templates/.claude/instructions/agent-patterns/model-routing.md +167 -0
  26. package/templates/.claude/instructions/agent-patterns/parallel-execution.md +91 -0
  27. package/templates/.claude/instructions/agent-patterns/read-parallelization.md +106 -0
  28. package/templates/.claude/instructions/document-templates/ralph-templates.md +71 -0
  29. package/templates/.claude/instructions/index.md +350 -0
  30. package/templates/.claude/instructions/multi-agent/agent-roster.md +811 -0
  31. package/templates/.claude/{PARALLEL_AGENTS.md → instructions/multi-agent/coordination-guide.md} +27 -336
  32. package/templates/.claude/instructions/{parallel-agent-execution.md → multi-agent/execution-patterns.md} +127 -438
  33. package/templates/.claude/instructions/multi-agent/index.md +282 -0
  34. package/templates/.claude/instructions/multi-agent/performance-optimization.md +456 -0
  35. package/templates/.claude/instructions/tech-stack/design-standards.md +282 -0
  36. package/templates/.claude/instructions/tech-stack/index.md +70 -0
  37. package/templates/.claude/instructions/tech-stack/prisma-patterns.md +352 -0
  38. package/templates/.claude/instructions/tech-stack/tanstack-patterns.md +275 -0
  39. package/templates/.claude/instructions/validation/forbidden-patterns.md +281 -0
  40. package/templates/.claude/instructions/validation/index.md +32 -0
  41. package/templates/.claude/instructions/validation/required-behaviors.md +331 -0
  42. package/templates/.claude/instructions/validation/verification-checklist.md +318 -0
  43. package/templates/.claude/instructions/workflow-patterns/index.md +18 -0
  44. package/templates/.claude/instructions/workflow-patterns/phase-based-workflow.md +250 -0
  45. package/templates/.claude/instructions/workflow-patterns/sequential-thinking.md +217 -0
  46. package/templates/.claude/instructions/workflow-patterns/todowrite-pattern.md +215 -0
  47. package/templates/.claude/skills/bug-fix/SKILL.md +972 -0
  48. package/templates/.claude/skills/docs-creator/AGENTS.md +54 -173
  49. package/templates/.claude/skills/docs-creator/SKILL.md +146 -254
  50. package/templates/.claude/skills/docs-refactor/AGENTS.md +61 -187
  51. package/templates/.claude/skills/docs-refactor/SKILL.md +84 -315
  52. package/templates/.claude/skills/execute/SKILL.md +454 -154
  53. package/templates/.claude/skills/figma-to-code/AGENTS.md +4 -1
  54. package/templates/.claude/skills/figma-to-code/SKILL.md +306 -0
  55. package/templates/.claude/skills/global-uiux-design/AGENTS.md +4 -1
  56. package/templates/.claude/skills/global-uiux-design/SKILL.md +455 -125
  57. package/templates/.claude/skills/korea-uiux-design/AGENTS.md +4 -1
  58. package/templates/.claude/skills/korea-uiux-design/SKILL.md +461 -116
  59. package/templates/.claude/skills/nextjs-react-best-practices/SKILL.md +177 -0
  60. package/templates/.claude/skills/plan/SKILL.md +1157 -87
  61. package/templates/.claude/skills/prd/SKILL.md +367 -66
  62. package/templates/.claude/skills/ralph/AGENTS.md +4 -1
  63. package/templates/.claude/skills/ralph/SKILL.md +100 -14
  64. package/templates/.claude/skills/refactor/AGENTS.md +269 -0
  65. package/templates/.claude/skills/refactor/SKILL.md +1572 -0
  66. package/templates/.claude/skills/stitch-design/README.md +34 -0
  67. package/templates/.claude/skills/stitch-design/SKILL.md +213 -0
  68. package/templates/.claude/skills/stitch-design/examples/DESIGN.md +154 -0
  69. package/templates/.claude/skills/stitch-loop/README.md +54 -0
  70. package/templates/.claude/skills/stitch-loop/SKILL.md +316 -0
  71. package/templates/.claude/skills/stitch-loop/examples/SITE.md +73 -0
  72. package/templates/.claude/skills/stitch-loop/examples/next-prompt.md +25 -0
  73. package/templates/.claude/skills/stitch-loop/resources/baton-schema.md +61 -0
  74. package/templates/.claude/skills/stitch-loop/resources/site-template.md +104 -0
  75. package/templates/.claude/skills/stitch-react/README.md +36 -0
  76. package/templates/.claude/skills/stitch-react/SKILL.md +323 -0
  77. package/templates/.claude/skills/stitch-react/examples/gold-standard-card.tsx +88 -0
  78. package/templates/.claude/skills/stitch-react/package-lock.json +231 -0
  79. package/templates/.claude/skills/stitch-react/package.json +16 -0
  80. package/templates/.claude/skills/stitch-react/resources/architecture-checklist.md +15 -0
  81. package/templates/.claude/skills/stitch-react/resources/component-template.tsx +37 -0
  82. package/templates/.claude/skills/stitch-react/resources/stitch-api-reference.md +14 -0
  83. package/templates/.claude/skills/stitch-react/resources/style-guide.json +24 -0
  84. package/templates/.claude/skills/stitch-react/scripts/fetch-stitch.sh +30 -0
  85. package/templates/.claude/skills/stitch-react/scripts/validate.js +77 -0
  86. package/templates/.claude/skills/tanstack-start-react-best-practices/SKILL.md +149 -0
  87. package/templates/.claude/commands/bug-fix.md +0 -510
  88. package/templates/.claude/commands/refactor.md +0 -788
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Copyright 2026 Google LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import React from 'react';
18
+
19
+ // Use a valid identifier like 'StitchComponent' as the placeholder
20
+ interface StitchComponentProps {
21
+ readonly children?: React.ReactNode;
22
+ readonly className?: string;
23
+ }
24
+
25
+ export const StitchComponent: React.FC<StitchComponentProps> = ({
26
+ children,
27
+ className = '',
28
+ ...props
29
+ }) => {
30
+ return (
31
+ <div className={`relative ${className}`} {...props}>
32
+ {children}
33
+ </div>
34
+ );
35
+ };
36
+
37
+ export default StitchComponent;
@@ -0,0 +1,14 @@
1
+ # Stitch API reference
2
+
3
+ This document describes the data structures returned by the Stitch MCP server to ensure accurate component mapping.
4
+
5
+ ### Metadata schema
6
+ When calling `get_screen`, the server returns a JSON object with these key properties:
7
+ * **htmlCode**: Contains a `downloadUrl`. This is a signed URL that requires a system-level fetch (curl) to handle redirects and security handshakes.
8
+ * **screenshot**: Includes a `downloadUrl` for the visual design. Use this to verify layout intent that might not be obvious in the raw HTML.
9
+ * **deviceType**: Usually set to `DESKTOP`. All generated components should prioritize the corresponding viewport (2560px width) as the base layout.
10
+
11
+ ### Technical mapping rules
12
+ 1. **Element tracking**: Preserve `data-stitch-id` attributes as comments in the TSX to allow for future design synchronization.
13
+ 2. **Asset handling**: Treat background images in the HTML as dynamic data. Extract the URLs into `mockData.ts` rather than hardcoding them into the component styles.
14
+ 3. **Style extraction**: The HTML `<head>` contains a localized `tailwind.config`. This config must be merged with the local project theme to ensure colors like `primary` and `background-dark` render correctly.
@@ -0,0 +1,24 @@
1
+ {
2
+ "theme": {
3
+ "colors": {
4
+ "primary": "#19e66f",
5
+ "background": {
6
+ "light": "#f6f8f7",
7
+ "dark": "#112118",
8
+ "elevated": "#1A1A1A"
9
+ },
10
+ "accent": {
11
+ "purple": "#8A2BE2",
12
+ "lavender": "#D0A9F5"
13
+ }
14
+ },
15
+ "typography": {
16
+ "display": ["Space Grotesk", "sans-serif"],
17
+ "icons": "Material Symbols Outlined"
18
+ },
19
+ "spacing": {
20
+ "header-h": "72px",
21
+ "container-max": "960px"
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,30 @@
1
+ #!/bin/bash
2
+ # Copyright 2026 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ URL=$1
17
+ OUTPUT=$2
18
+ if [ -z "$URL" ] || [ -z "$OUTPUT" ]; then
19
+ echo "Usage: $0 <url> <output_path>"
20
+ exit 1
21
+ fi
22
+ echo "Initiating high-reliability fetch for Stitch HTML..."
23
+ curl -L -f -sS --connect-timeout 10 --compressed "$URL" -o "$OUTPUT"
24
+ if [ $? -eq 0 ]; then
25
+ echo "✅ Successfully retrieved HTML at: $OUTPUT"
26
+ exit 0
27
+ else
28
+ echo "❌ Error: Failed to retrieve content. Check TLS/SNI or URL expiration."
29
+ exit 1
30
+ fi
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Copyright 2026 Google LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import swc from '@swc/core';
18
+ import fs from 'node:fs';
19
+ import path from 'node:path';
20
+
21
+ async function validateComponent(filePath) {
22
+ const code = fs.readFileSync(filePath, 'utf-8');
23
+ const filename = path.basename(filePath);
24
+ try {
25
+ const ast = await swc.parse(code, { syntax: 'typescript', tsx: true });
26
+ let hasInterface = false;
27
+ let tailwindIssues = [];
28
+
29
+ console.log('🔍 Scanning AST...');
30
+
31
+ const walk = (node) => {
32
+ if (!node) return;
33
+ if (
34
+ node.type === 'TsInterfaceDeclaration' &&
35
+ node.id.value.endsWith('Props')
36
+ )
37
+ hasInterface = true;
38
+ if (node.type === 'JSXAttribute' && node.name.name === 'className') {
39
+ if (node.value?.value && /#[0-9A-Fa-f]{6}/.test(node.value.value))
40
+ tailwindIssues.push(node.value.value);
41
+ }
42
+ for (const key in node) {
43
+ if (node[key] && typeof node[key] === 'object') walk(node[key]);
44
+ }
45
+ };
46
+ walk(ast);
47
+
48
+ console.log(`--- Validation for: ${filename} ---`);
49
+ if (hasInterface) {
50
+ console.log('✅ Props declaration found.');
51
+ } else {
52
+ console.error("❌ MISSING: Props interface (must end in 'Props').");
53
+ }
54
+
55
+ if (tailwindIssues.length === 0) {
56
+ console.log('✅ No hardcoded hex values found.');
57
+ } else {
58
+ console.error(
59
+ `❌ STYLE: Found ${tailwindIssues.length} hardcoded hex codes.`,
60
+ );
61
+ tailwindIssues.forEach((hex) => console.error(` - ${hex}`));
62
+ }
63
+
64
+ if (hasInterface && tailwindIssues.length === 0) {
65
+ console.log('\n✨ COMPONENT VALID.');
66
+ process.exit(0);
67
+ } else {
68
+ console.error('\n🚫 VALIDATION FAILED.');
69
+ process.exit(1);
70
+ }
71
+ } catch (err) {
72
+ console.error('❌ PARSE ERROR:', err.message);
73
+ process.exit(1);
74
+ }
75
+ }
76
+
77
+ validateComponent(process.argv[2]);
@@ -8,6 +8,12 @@ metadata:
8
8
  adapted_for: tanstack-start
9
9
  ---
10
10
 
11
+ @../../instructions/agent-patterns/read-parallelization.md
12
+ @../../instructions/validation/forbidden-patterns.md
13
+ @../../instructions/validation/required-behaviors.md
14
+ @../../instructions/multi-agent/coordination-guide.md
15
+ @../../instructions/multi-agent/execution-patterns.md
16
+
11
17
  # TanStack Start React 베스트 프랙티스
12
18
 
13
19
  React와 TanStack Start 애플리케이션 성능 최적화 가이드. 7개 카테고리, 38개 규칙 포함. 영향도별 우선순위로 자동 리팩토링과 코드 생성 가이드 제공.
@@ -30,6 +36,149 @@ React와 TanStack Start 애플리케이션 성능 최적화 가이드. 7개 카
30
36
 
31
37
  ---
32
38
 
39
+ <parallel_agent_execution>
40
+
41
+ ## 병렬 에이전트 실행
42
+
43
+ **ULTRAWORK MODE:** TanStack Start 최적화 작업 시 여러 규칙을 동시에 적용하여 5-15배 성능 향상.
44
+
45
+ ### 기본 원칙
46
+
47
+ | 원칙 | 실행 방법 | 효과 |
48
+ |------|----------|------|
49
+ | **PARALLEL** | 독립 작업을 단일 메시지에서 동시 실행 | 5-15배 속도 향상 |
50
+ | **DELEGATE** | 전문 에이전트에게 즉시 위임 | 품질 향상, 컨텍스트 격리 |
51
+ | **SMART MODEL** | 복잡도별 모델 선택 (haiku/sonnet/opus) | 비용 최적화 |
52
+
53
+ ### Phase별 에이전트 활용
54
+
55
+ | Phase | 작업 | 에이전트 | 병렬 실행 |
56
+ |-------|------|---------|----------|
57
+ | **1. 코드베이스 분석** | 라우트 구조, Server Functions, 컴포넌트 파악 | explore (haiku) | ✅ 여러 도메인 동시 탐색 |
58
+ | **2. 규칙 적용** | waterfall 제거, 번들 최적화, re-render 최적화 | implementation-executor (sonnet) | ✅ 독립 라우트/컴포넌트 동시 수정 |
59
+ | **3. 검증** | typecheck/lint/build, 성능/보안 리뷰 | lint-fixer (sonnet), code-reviewer (opus) | ❌ lint-fixer 순차, code-reviewer 병렬 |
60
+ | **4. 완료** | git commit | git-operator (sonnet) | ❌ 순차 |
61
+
62
+ ### 에이전트별 역할
63
+
64
+ | 에이전트 | 모델 | TanStack Start 작업 | 병렬 실행 |
65
+ |---------|------|---------------------|----------|
66
+ | **explore** | haiku | 라우트/Server Functions/컴포넌트 구조 분석 | ✅ |
67
+ | **implementation-executor** | sonnet | 규칙 적용 (async-parallel, bundle-lazy-routes 등) | ✅ |
68
+ | **code-reviewer** | opus | 성능/보안 검토 (server-cache-lru, client-tanstack-query) | ✅ |
69
+ | **lint-fixer** | sonnet | tsc/eslint 에러 자동 수정 | ❌ (순차) |
70
+
71
+ ### 실전 패턴
72
+
73
+ #### 패턴 1: 독립 라우트 병렬 최적화
74
+
75
+ ```typescript
76
+ // 시나리오: 여러 라우트에 async-parallel, bundle-lazy-routes 적용
77
+
78
+ // ❌ 순차 실행 (느림)
79
+ Task(subagent_type="implementation-executor", model="sonnet",
80
+ prompt="/posts 라우트 최적화: async-parallel, bundle-lazy-routes")
81
+ // 60초 대기
82
+ Task(subagent_type="implementation-executor", model="sonnet",
83
+ prompt="/users 라우트 최적화: async-parallel, bundle-lazy-routes")
84
+ // 총 120초
85
+
86
+ // ✅ 병렬 실행 (빠름)
87
+ Task(subagent_type="implementation-executor", model="sonnet",
88
+ prompt=`/posts 라우트 최적화:
89
+ - async-parallel: loader에서 Promise.all()
90
+ - bundle-lazy-routes: 무거운 컴포넌트 lazy()`)
91
+
92
+ Task(subagent_type="implementation-executor", model="sonnet",
93
+ prompt=`/users 라우트 최적화:
94
+ - async-parallel: loader에서 Promise.all()
95
+ - bundle-lazy-routes: 무거운 컴포넌트 lazy()`)
96
+ // 총 60초 (가장 긴 작업 기준)
97
+ ```
98
+
99
+ #### 패턴 2: Server Function + UI 동시 구현
100
+
101
+ ```typescript
102
+ // 시나리오: 새 기능 추가 (API + UI + 테스트)
103
+
104
+ // ✅ Fan-Out: 병렬 실행
105
+ Task(subagent_type="implementation-executor", model="sonnet",
106
+ prompt=`createServerFn으로 Comment API 구현:
107
+ - getComments (GET)
108
+ - createComment (POST + inputValidator)
109
+ - server-parallel-fetching 적용`)
110
+
111
+ Task(subagent_type="designer", model="sonnet",
112
+ prompt=`Comment UI 구현:
113
+ - client-tanstack-query 사용
114
+ - rerender-memo로 최적화
115
+ - bundle-barrel-imports 준수 (직접 import)`)
116
+
117
+ Task(subagent_type="implementation-executor", model="sonnet",
118
+ prompt=`Comment 통합 테스트:
119
+ - API 테스트
120
+ - UI 테스트`)
121
+
122
+ // Fan-In: 결과 수집 후 통합
123
+ Read("functions/comments.ts")
124
+ Read("components/Comments.tsx")
125
+ Read("tests/comments.test.ts")
126
+ ```
127
+
128
+ #### 패턴 3: 대규모 리팩토링 (배치 처리)
129
+
130
+ ```typescript
131
+ // 시나리오: 10개 컴포넌트에 rerender-memo, rerender-dependencies 적용
132
+
133
+ // ✅ 배치 처리 (토큰 70-90% 절감)
134
+ Task(subagent_type="implementation-executor", model="sonnet",
135
+ prompt=`다음 컴포넌트들에 re-render 최적화 적용:
136
+
137
+ 파일 목록:
138
+ - components/UserList.tsx
139
+ - components/PostList.tsx
140
+ - ... (10개)
141
+
142
+ 공통 규칙:
143
+ 1. rerender-memo: 비싼 작업 → React.memo() 추출
144
+ 2. rerender-dependencies: effect 의존성 → 원시값 사용
145
+ 3. rerender-functional-setstate: setState → 함수형 업데이트
146
+
147
+ 패턴:
148
+ ❌ setItems([...items, newItem])
149
+ ✅ setItems(curr => [...curr, newItem])`)
150
+ ```
151
+
152
+ ### Model Routing
153
+
154
+ **원칙:** 작업 복잡도에 따라 모델 선택.
155
+
156
+ | 복잡도 | 모델 | TanStack Start 작업 예시 | 비용 | 속도 |
157
+ |--------|------|------------------------|------|------|
158
+ | **LOW** | haiku | 라우트 구조 파악, Server Functions 위치 확인 | 💰 | ⚡⚡⚡ |
159
+ | **MEDIUM** | sonnet | async-parallel 적용, bundle-lazy-routes 구현 | 💰💰 | ⚡⚡ |
160
+ | **HIGH** | opus | 아키텍처 설계, server-cache-lru 전략, 보안 검토 | 💰💰💰 | ⚡ |
161
+
162
+ ### 체크리스트
163
+
164
+ **실행 전 확인:**
165
+
166
+ - [ ] 독립 작업 파악 → 병렬 실행 (여러 라우트, 컴포넌트)
167
+ - [ ] 10개 이상 유사 작업 → 배치 처리 (동일 규칙 적용)
168
+ - [ ] 복잡도별 모델 선택 (탐색=haiku, 구현=sonnet, 리뷰=opus)
169
+ - [ ] Phase별 실행 (분석 → 구현 → 검증 → 완료)
170
+ - [ ] 의존성 확인 (Server Function 완료 후 UI 통합)
171
+
172
+ **효율 목표:**
173
+
174
+ - 순차 실행 대비 5-15배 속도 향상
175
+ - 토큰 사용 70-90% 절감 (배치 처리)
176
+ - 병렬도 3-10개 (과도한 병렬 방지)
177
+
178
+ </parallel_agent_execution>
179
+
180
+ ---
181
+
33
182
  <categories>
34
183
 
35
184
  ## 카테고리별 우선순위