@kood/claude-code 0.3.6 → 0.3.8

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 (120) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
  3. package/templates/.claude/agents/code-reviewer.md +124 -124
  4. package/templates/.claude/agents/dependency-manager.md +85 -85
  5. package/templates/.claude/agents/deployment-validator.md +56 -56
  6. package/templates/.claude/agents/git-operator.md +64 -64
  7. package/templates/.claude/agents/implementation-executor.md +95 -95
  8. package/templates/.claude/agents/ko-to-en-translator.md +74 -0
  9. package/templates/.claude/agents/lint-fixer.md +78 -78
  10. package/templates/.claude/agents/refactor-advisor.md +122 -122
  11. package/templates/.claude/commands/agent-creator.md +185 -185
  12. package/templates/.claude/commands/bug-fix.md +193 -193
  13. package/templates/.claude/commands/command-creator.md +54 -54
  14. package/templates/.claude/commands/docs-creator.md +57 -57
  15. package/templates/.claude/commands/docs-refactor.md +26 -26
  16. package/templates/.claude/commands/execute.md +12 -12
  17. package/templates/.claude/commands/git-all.md +32 -32
  18. package/templates/.claude/commands/git-session.md +42 -42
  19. package/templates/.claude/commands/git.md +34 -34
  20. package/templates/.claude/commands/lint-fix.md +138 -138
  21. package/templates/.claude/commands/lint-init.md +61 -61
  22. package/templates/.claude/commands/plan.md +260 -260
  23. package/templates/.claude/commands/prd.md +24 -24
  24. package/templates/.claude/commands/pre-deploy.md +109 -109
  25. package/templates/.claude/commands/refactor.md +147 -147
  26. package/templates/.claude/commands/version-update.md +17 -17
  27. package/templates/hono/CLAUDE.md +27 -27
  28. package/templates/hono/docs/architecture.md +24 -24
  29. package/templates/hono/docs/deployment/cloudflare.md +18 -18
  30. package/templates/hono/docs/deployment/docker.md +13 -13
  31. package/templates/hono/docs/deployment/index.md +19 -19
  32. package/templates/hono/docs/deployment/railway.md +32 -32
  33. package/templates/hono/docs/deployment/vercel.md +29 -29
  34. package/templates/hono/docs/guides/conventions.md +57 -57
  35. package/templates/hono/docs/guides/env-setup.md +47 -47
  36. package/templates/hono/docs/guides/getting-started.md +27 -27
  37. package/templates/hono/docs/library/hono/error-handling.md +11 -11
  38. package/templates/hono/docs/library/hono/index.md +4 -4
  39. package/templates/hono/docs/library/hono/middleware.md +18 -18
  40. package/templates/hono/docs/library/hono/rpc.md +7 -7
  41. package/templates/hono/docs/library/hono/validation.md +6 -6
  42. package/templates/hono/docs/library/prisma/cloudflare-d1.md +29 -29
  43. package/templates/hono/docs/library/prisma/config.md +16 -16
  44. package/templates/hono/docs/library/prisma/index.md +32 -32
  45. package/templates/hono/docs/library/t3-env/index.md +22 -22
  46. package/templates/hono/docs/library/zod/index.md +31 -31
  47. package/templates/nextjs/CLAUDE.md +228 -0
  48. package/templates/nextjs/docs/design.md +558 -0
  49. package/templates/nextjs/docs/guides/conventions.md +343 -0
  50. package/templates/nextjs/docs/guides/getting-started.md +367 -0
  51. package/templates/nextjs/docs/guides/routes.md +342 -0
  52. package/templates/nextjs/docs/library/better-auth/index.md +541 -0
  53. package/templates/nextjs/docs/library/nextjs/app-router.md +269 -0
  54. package/templates/nextjs/docs/library/nextjs/caching.md +351 -0
  55. package/templates/nextjs/docs/library/nextjs/index.md +291 -0
  56. package/templates/nextjs/docs/library/nextjs/middleware.md +391 -0
  57. package/templates/nextjs/docs/library/nextjs/route-handlers.md +382 -0
  58. package/templates/nextjs/docs/library/nextjs/server-actions.md +366 -0
  59. package/templates/nextjs/docs/library/prisma/cloudflare-d1.md +76 -0
  60. package/templates/nextjs/docs/library/prisma/config.md +77 -0
  61. package/templates/nextjs/docs/library/prisma/crud.md +90 -0
  62. package/templates/nextjs/docs/library/prisma/index.md +73 -0
  63. package/templates/nextjs/docs/library/prisma/relations.md +69 -0
  64. package/templates/nextjs/docs/library/prisma/schema.md +98 -0
  65. package/templates/nextjs/docs/library/prisma/setup.md +49 -0
  66. package/templates/nextjs/docs/library/prisma/transactions.md +50 -0
  67. package/templates/nextjs/docs/library/tanstack-query/index.md +66 -0
  68. package/templates/nextjs/docs/library/tanstack-query/invalidation.md +54 -0
  69. package/templates/nextjs/docs/library/tanstack-query/optimistic-updates.md +77 -0
  70. package/templates/nextjs/docs/library/tanstack-query/use-mutation.md +63 -0
  71. package/templates/nextjs/docs/library/tanstack-query/use-query.md +70 -0
  72. package/templates/nextjs/docs/library/zod/complex-types.md +61 -0
  73. package/templates/nextjs/docs/library/zod/index.md +56 -0
  74. package/templates/nextjs/docs/library/zod/transforms.md +51 -0
  75. package/templates/nextjs/docs/library/zod/validation.md +70 -0
  76. package/templates/npx/CLAUDE.md +37 -37
  77. package/templates/npx/docs/library/commander/index.md +12 -12
  78. package/templates/npx/docs/library/fs-extra/index.md +9 -9
  79. package/templates/npx/docs/library/prompts/index.md +3 -3
  80. package/templates/npx/docs/references/patterns.md +12 -12
  81. package/templates/tanstack-start/CLAUDE.md +53 -49
  82. package/templates/tanstack-start/docs/architecture.md +128 -128
  83. package/templates/tanstack-start/docs/design.md +169 -169
  84. package/templates/tanstack-start/docs/guides/conventions.md +43 -43
  85. package/templates/tanstack-start/docs/guides/env-setup.md +35 -35
  86. package/templates/tanstack-start/docs/guides/getting-started.md +19 -19
  87. package/templates/tanstack-start/docs/guides/hooks.md +63 -35
  88. package/templates/tanstack-start/docs/guides/routes.md +61 -42
  89. package/templates/tanstack-start/docs/guides/services.md +45 -45
  90. package/templates/tanstack-start/docs/library/better-auth/index.md +68 -68
  91. package/templates/tanstack-start/docs/library/prisma/cloudflare-d1.md +19 -19
  92. package/templates/tanstack-start/docs/library/prisma/config.md +16 -16
  93. package/templates/tanstack-start/docs/library/prisma/crud.md +17 -17
  94. package/templates/tanstack-start/docs/library/prisma/index.md +17 -17
  95. package/templates/tanstack-start/docs/library/prisma/relations.md +16 -16
  96. package/templates/tanstack-start/docs/library/prisma/schema.md +23 -23
  97. package/templates/tanstack-start/docs/library/prisma/setup.md +6 -6
  98. package/templates/tanstack-start/docs/library/prisma/transactions.md +10 -10
  99. package/templates/tanstack-start/docs/library/t3-env/index.md +21 -160
  100. package/templates/tanstack-start/docs/library/tanstack-query/index.md +6 -6
  101. package/templates/tanstack-start/docs/library/tanstack-query/invalidation.md +19 -19
  102. package/templates/tanstack-start/docs/library/tanstack-query/optimistic-updates.md +4 -4
  103. package/templates/tanstack-start/docs/library/tanstack-query/use-mutation.md +14 -14
  104. package/templates/tanstack-start/docs/library/tanstack-query/use-query.md +21 -21
  105. package/templates/tanstack-start/docs/library/tanstack-router/error-handling.md +9 -9
  106. package/templates/tanstack-start/docs/library/tanstack-router/hooks.md +11 -11
  107. package/templates/tanstack-start/docs/library/tanstack-router/index.md +18 -18
  108. package/templates/tanstack-start/docs/library/tanstack-router/navigation.md +17 -17
  109. package/templates/tanstack-start/docs/library/tanstack-router/route-context.md +5 -5
  110. package/templates/tanstack-start/docs/library/tanstack-router/search-params.md +10 -10
  111. package/templates/tanstack-start/docs/library/tanstack-start/auth-patterns.md +8 -8
  112. package/templates/tanstack-start/docs/library/tanstack-start/index.md +15 -15
  113. package/templates/tanstack-start/docs/library/tanstack-start/middleware.md +9 -9
  114. package/templates/tanstack-start/docs/library/tanstack-start/routing.md +6 -6
  115. package/templates/tanstack-start/docs/library/tanstack-start/server-functions.md +18 -18
  116. package/templates/tanstack-start/docs/library/tanstack-start/setup.md +4 -4
  117. package/templates/tanstack-start/docs/library/zod/complex-types.md +11 -11
  118. package/templates/tanstack-start/docs/library/zod/index.md +8 -8
  119. package/templates/tanstack-start/docs/library/zod/transforms.md +11 -11
  120. package/templates/tanstack-start/docs/library/zod/validation.md +9 -9
@@ -1,16 +1,16 @@
1
1
  # t3-env - Type-Safe Environment Variables
2
2
 
3
- > Zod 기반 타입 안전 환경 변수 관리
3
+ > Zod-based type-safe environment variable management
4
4
 
5
5
  <context>
6
6
 
7
- **용도:** 서버 환경 변수 검증, 런타임 타입 안전성
7
+ **Purpose:** Server environment variable validation, runtime type safety
8
8
 
9
- **특징:**
10
- - Zod 스키마로 검증 + 타입 추론
11
- - Transform & Default 지원
12
- - 런타임 검증
13
- - 프레임워크 무관
9
+ **Features:**
10
+ - Validation + type inference with Zod schemas
11
+ - Transform & default value support
12
+ - Runtime validation
13
+ - Framework agnostic
14
14
 
15
15
  </context>
16
16
 
@@ -18,11 +18,11 @@
18
18
 
19
19
  <forbidden>
20
20
 
21
- | 분류 | 금지 |
22
- |------|------|
23
- | **직접 접근** | `process.env` 직접 사용 (env 객체 필수) |
24
- | **타입** | any 타입으로 env 변수 접근 |
25
- | **검증 우회** | 스키마 정의 없이 환경 변수 사용 |
21
+ | Category | Prohibited |
22
+ |----------|------------|
23
+ | **Direct Access** | Using `process.env` directly (env object required) |
24
+ | **Types** | Accessing env variables with any type |
25
+ | **Bypass Validation** | Using environment variables without schema definition |
26
26
 
27
27
  </forbidden>
28
28
 
@@ -30,10 +30,10 @@
30
30
 
31
31
  <required>
32
32
 
33
- | 분류 | 필수 |
34
- |------|------|
35
- | **설치** | `@t3-oss/env-core zod` |
36
- | **구조** | `src/env.ts` 파일 생성 |
33
+ | Category | Required |
34
+ |----------|----------|
35
+ | **Installation** | `@t3-oss/env-core zod` |
36
+ | **Structure** | Create `src/env.ts` file |
37
37
  | **Import** | `import { env } from '@/env'` |
38
38
 
39
39
  </required>
@@ -114,7 +114,7 @@ import { env } from '@/env'
114
114
 
115
115
  export const prisma = new PrismaClient({
116
116
  datasourceUrl: env.DATABASE_URL,
117
- // ^? string (타입 안전)
117
+ // ^? string (type-safe)
118
118
  })
119
119
  ```
120
120
 
@@ -329,7 +329,7 @@ import { createMiddleware } from 'hono/factory'
329
329
  import { env } from '@/env'
330
330
 
331
331
  export const envMiddleware = createMiddleware(async (c, next) => {
332
- // env 객체가 초기화되었는지 확인
332
+ // Check if env object is initialized
333
333
  if (!env.DATABASE_URL) {
334
334
  return c.json({ error: 'Server misconfigured' }, 500)
335
335
  }
@@ -363,10 +363,10 @@ app.use(
363
363
 
364
364
  ## Tips
365
365
 
366
- | 상황 | 방법 |
367
- |------|------|
368
- | **Cloudflare** | `createWorkerEnv(env)` 패턴 사용 |
369
- | **Monorepo** | 패키지마다 별도 `env.ts` |
366
+ | Scenario | Method |
367
+ |----------|--------|
368
+ | **Cloudflare** | Use `createWorkerEnv(env)` pattern |
369
+ | **Monorepo** | Separate `env.ts` per package |
370
370
  | **Testing** | `.env.test` + `NODE_ENV=test` |
371
371
  | **Docker** | `docker run -e DATABASE_URL=...` |
372
372
  | **CI/CD** | GitHub Secrets → Environment Variables |
@@ -1,25 +1,25 @@
1
1
  # Zod v4 - Schema Validation
2
2
 
3
- > TypeScript-first 스키마 검증
3
+ > TypeScript-first schema validation
4
4
 
5
5
  ---
6
6
 
7
- ## 버전 주의
7
+ ## Version Notice
8
8
 
9
9
  ```typescript
10
- // ✅ v4 문법
10
+ // ✅ v4 syntax
11
11
  z.email()
12
12
  z.url()
13
13
  z.uuid()
14
14
 
15
- // ❌ v3 문법 (사용 금지)
15
+ // ❌ v3 syntax (prohibited)
16
16
  z.string().email()
17
17
  z.string().url()
18
18
  ```
19
19
 
20
20
  ---
21
21
 
22
- ## 설치
22
+ ## Installation
23
23
 
24
24
  ```bash
25
25
  npm install zod
@@ -27,7 +27,7 @@ npm install zod
27
27
 
28
28
  ---
29
29
 
30
- ## 기본 타입
30
+ ## Basic Types
31
31
 
32
32
  ```typescript
33
33
  import { z } from 'zod'
@@ -40,28 +40,28 @@ z.undefined()
40
40
  z.null()
41
41
  ```
42
42
 
43
- ### 문자열 (v4)
43
+ ### Strings (v4)
44
44
 
45
45
  ```typescript
46
- z.email() // 이메일
46
+ z.email() // Email
47
47
  z.url() // URL
48
48
  z.uuid() // UUID
49
- z.string().min(1).max(100) // 길이
50
- z.string().trim() // 공백 제거
51
- z.string().regex(/^[a-z]+$/) // 정규식
49
+ z.string().min(1).max(100) // Length
50
+ z.string().trim() // Trim whitespace
51
+ z.string().regex(/^[a-z]+$/) // Regex
52
52
  ```
53
53
 
54
- ### 숫자
54
+ ### Numbers
55
55
 
56
56
  ```typescript
57
- z.number().int() // 정수
58
- z.number().positive() // 양수
57
+ z.number().int() // Integer
58
+ z.number().positive() // Positive
59
59
  z.number().min(1).max(100)
60
60
  ```
61
61
 
62
62
  ---
63
63
 
64
- ## 객체
64
+ ## Objects
65
65
 
66
66
  ```typescript
67
67
  const userSchema = z.object({
@@ -82,7 +82,7 @@ z.string().nullable() // string | null
82
82
  z.string().nullish() // string | null | undefined
83
83
  ```
84
84
 
85
- ### 기본값
85
+ ### Defaults
86
86
 
87
87
  ```typescript
88
88
  z.string().default('Anonymous')
@@ -92,8 +92,8 @@ z.enum(['user', 'admin']).default('user')
92
92
  ### Partial / Pick / Omit
93
93
 
94
94
  ```typescript
95
- userSchema.partial() // 모든 필드 optional
96
- userSchema.partial({ email: true }) // 특정 필드만
95
+ userSchema.partial() // All fields optional
96
+ userSchema.partial({ email: true }) // Specific fields only
97
97
  userSchema.pick({ id: true, name: true })
98
98
  userSchema.omit({ password: true })
99
99
  ```
@@ -118,7 +118,7 @@ z.discriminatedUnion('type', [
118
118
 
119
119
  ---
120
120
 
121
- ## Coerce (타입 변환)
121
+ ## Coerce (Type Conversion)
122
122
 
123
123
  ```typescript
124
124
  z.coerce.number() // string → number
@@ -137,27 +137,27 @@ z.string().transform((s) => s.split(','))
137
137
 
138
138
  ---
139
139
 
140
- ## Refine (커스텀 검증)
140
+ ## Refine (Custom Validation)
141
141
 
142
142
  ```typescript
143
- // 단일 필드
143
+ // Single field
144
144
  z.string().refine((val) => val.length >= 8, {
145
- message: '8 이상 필요',
145
+ message: 'Must be at least 8 characters',
146
146
  })
147
147
 
148
- // 객체 전체
148
+ // Entire object
149
149
  z.object({
150
150
  password: z.string().min(8),
151
151
  confirmPassword: z.string(),
152
152
  }).refine((data) => data.password === data.confirmPassword, {
153
- message: '비밀번호 불일치',
153
+ message: 'Passwords do not match',
154
154
  path: ['confirmPassword'],
155
155
  })
156
156
  ```
157
157
 
158
158
  ---
159
159
 
160
- ## 에러 처리
160
+ ## Error Handling
161
161
 
162
162
  ```typescript
163
163
  const result = schema.safeParse(input)
@@ -170,16 +170,16 @@ if (result.success) {
170
170
  }
171
171
  ```
172
172
 
173
- ### 커스텀 에러
173
+ ### Custom Errors
174
174
 
175
175
  ```typescript
176
- z.email({ message: '올바른 이메일 입력' })
177
- z.string().min(1, { message: '필수 입력' })
176
+ z.email({ message: 'Please enter a valid email' })
177
+ z.string().min(1, { message: 'Required field' })
178
178
  ```
179
179
 
180
180
  ---
181
181
 
182
- ## Hono와 함께
182
+ ## Usage with Hono
183
183
 
184
184
  ```typescript
185
185
  import { zValidator } from '@hono/zod-validator'
@@ -204,6 +204,6 @@ app.post('/users',
204
204
 
205
205
  ---
206
206
 
207
- ## 관련 문서
207
+ ## Related Documentation
208
208
 
209
- - [Hono 검증](../hono/validation.md)
209
+ - [Hono Validation](../hono/validation.md)
@@ -0,0 +1,228 @@
1
+ # CLAUDE.md - Next.js
2
+
3
+ > React Full-stack Framework
4
+
5
+ <context>
6
+
7
+ **Purpose:** Next.js App Router-based web application development guidelines
8
+
9
+ **Scope:** Full-stack React application implementation
10
+
11
+ **Key Features:**
12
+ - App Router (file-based routing)
13
+ - Server Actions (type-safe API)
14
+ - Server/Client Components
15
+ - Route Handlers (REST API)
16
+ - Middleware
17
+ - Built-in Optimization (images, fonts, scripts)
18
+ - Deployment (Vercel, Docker, Node.js)
19
+
20
+ </context>
21
+
22
+ ---
23
+
24
+ <instructions>
25
+ @../../commands/git.md
26
+ @docs/library/nextjs/index.md
27
+ @docs/library/tanstack-query/index.md
28
+ @docs/library/prisma/index.md
29
+ @docs/library/next-auth/index.md
30
+ @docs/library/zod/index.md
31
+ @docs/design.md
32
+ </instructions>
33
+
34
+ ---
35
+
36
+ <forbidden>
37
+
38
+ | Category | Forbidden Actions |
39
+ |----------|-------------------|
40
+ | **Git Commits** | AI markers (`Generated with Claude Code`, `🤖`, `Co-Authored-By:`), multi-line messages, emojis |
41
+ | **Prisma** | Auto-running `db push/migrate/generate`, unauthorized `schema.prisma` modifications |
42
+ | **Server Actions** | Direct definition in client components, usage without try-catch, missing Zod validation (POST/PUT/PATCH) |
43
+ | **Route Handlers** | Creation outside `/app/api/`, creation when Server Actions are suitable |
44
+ | **Client** | Direct Server Action calls (use TanStack Query), missing `"use client"` |
45
+ | **Code Search** | Bash grep/rg/find commands (use ast-grep or dedicated tools) |
46
+
47
+ </forbidden>
48
+
49
+ ---
50
+
51
+ <required>
52
+
53
+ | Task | Required Actions |
54
+ |------|------------------|
55
+ | **Before Starting** | Read relevant docs (UI → design, API → nextjs, DB → prisma, auth → next-auth) |
56
+ | **Code Search** | Use ast-grep (function/component/pattern search) |
57
+ | **Complex Tasks** | Sequential Thinking MCP (5+ step tasks) |
58
+ | **Large Changes** | gemini-review (3+ file changes, architectural decisions) |
59
+ | **Server Actions** | `"use server"` declaration, Zod validation (POST/PUT/PATCH), try-catch + revalidatePath/redirect |
60
+ | **Client API** | Call Server Actions via TanStack Query (`useQuery`/`useMutation`) |
61
+ | **Custom Hook Order** | State → Global Hooks (useParams, useRouter, useSearchParams) → React Query → Handlers → Memo → Effect |
62
+ | **Code Writing** | UTF-8 encoding, comments per code block, const function declarations |
63
+ | **Prisma** | Multi-File structure (`prisma/schema/`), all elements require comments |
64
+
65
+ </required>
66
+
67
+ ---
68
+
69
+ <tech_stack>
70
+
71
+ | Technology | Version | Note |
72
+ |------------|---------|------|
73
+ | Next.js | **15.x** | App Router only |
74
+ | React | **19.x** | Server Components |
75
+ | TypeScript | 5.x | strict |
76
+ | Tailwind CSS | 4.x | @theme |
77
+ | Prisma | **7.x** | `prisma-client`, output required |
78
+ | Zod | **4.x** | `z.email()`, `z.url()` |
79
+ | NextAuth.js | **5.x** (Auth.js) | App Router support |
80
+ | TanStack Query | 5.x | - |
81
+
82
+ </tech_stack>
83
+
84
+ ---
85
+
86
+ <structure>
87
+ ```
88
+ src/
89
+ ├── app/
90
+ │ ├── layout.tsx # Root layout (required)
91
+ │ ├── page.tsx # Home page
92
+ │ ├── [slug]/
93
+ │ │ ├── page.tsx # Dynamic route
94
+ │ │ └── -components/ # Page-specific Client Components
95
+ │ ├── api/
96
+ │ │ └── [endpoint]/
97
+ │ │ └── route.ts # Route Handler (REST API)
98
+ │ └── _components/ # Shared Client Components
99
+ ├── actions/ # Server Actions (shared)
100
+ ├── components/ui/ # UI components (Server Components)
101
+ ├── middleware.ts # Middleware
102
+ ├── database/prisma.ts
103
+ └── lib/
104
+ ```
105
+
106
+ **Required Rules:**
107
+ - Recommended `-components/` folder per page (page-specific Client Components)
108
+ - Server Components by default → use `"use client"` only when necessary
109
+ - Server Actions in `actions/` folder or at file top (`"use server"`)
110
+ - Route Handlers only in `/app/api/` path
111
+ </structure>
112
+
113
+ ---
114
+
115
+ <conventions>
116
+
117
+ File names: kebab-case, Routes: `page.tsx`, `layout.tsx`, `[slug]/page.tsx`
118
+ TypeScript: const declarations, explicit return types, interface (objects)/type (unions), any→unknown
119
+ Import order: external → @/ → relative → type
120
+
121
+ Prisma Multi-File:
122
+ ```
123
+ prisma/schema/
124
+ ├── +base.prisma # datasource, generator
125
+ ├── +enum.prisma # enum
126
+ └── [model].prisma # per model (with comments!)
127
+ ```
128
+
129
+ </conventions>
130
+
131
+ ---
132
+
133
+ <quick_patterns>
134
+
135
+ ```typescript
136
+ // Server Action (file top)
137
+ "use server"
138
+
139
+ export async function createPost(formData: FormData) {
140
+ const parsed = createPostSchema.parse({
141
+ title: formData.get("title"),
142
+ content: formData.get("content"),
143
+ })
144
+
145
+ const post = await prisma.post.create({ data: parsed })
146
+ revalidatePath("/posts")
147
+ return post
148
+ }
149
+
150
+ // Server Action (with auth)
151
+ "use server"
152
+
153
+ import { auth } from "@/lib/auth"
154
+
155
+ export async function deletePost(id: string) {
156
+ const session = await auth()
157
+ if (!session?.user) throw new Error("Unauthorized")
158
+
159
+ await prisma.post.delete({ where: { id } })
160
+ revalidatePath("/posts")
161
+ }
162
+
163
+ // Route Handler (GET)
164
+ export async function GET(request: Request) {
165
+ const { searchParams } = new URL(request.url)
166
+ const id = searchParams.get("id")
167
+
168
+ const posts = await prisma.post.findMany({ where: { id } })
169
+ return Response.json(posts)
170
+ }
171
+
172
+ // Client Component with TanStack Query
173
+ "use client"
174
+
175
+ import { useMutation, useQueryClient } from "@tanstack/react-query"
176
+ import { createPost } from "@/actions/posts"
177
+
178
+ export function CreatePostForm() {
179
+ const queryClient = useQueryClient()
180
+
181
+ const mutation = useMutation({
182
+ mutationFn: createPost,
183
+ onSuccess: () => queryClient.invalidateQueries({ queryKey: ["posts"] }),
184
+ })
185
+
186
+ return <form action={mutation.mutate}>...</form>
187
+ }
188
+
189
+ // Zod v4
190
+ const schema = z.object({
191
+ email: z.email(),
192
+ name: z.string().min(1).trim(),
193
+ website: z.url().optional(),
194
+ })
195
+
196
+ // Page with Server Component
197
+ export default async function PostsPage() {
198
+ const posts = await prisma.post.findMany()
199
+ return <PostsList posts={posts} />
200
+ }
201
+ ```
202
+
203
+ </quick_patterns>
204
+
205
+ ---
206
+
207
+ <ui_ux>
208
+
209
+ | Principle | Value |
210
+ |-----------|-------|
211
+ | Color | 60-30-10 (background-secondary-accent) |
212
+ | Spacing | 8px grid |
213
+ | Accessibility | WCAG AA (contrast 4.5:1+) |
214
+ | Fonts | 2-3 types |
215
+ | Safe Area | tailwindcss-safe-area |
216
+
217
+ </ui_ux>
218
+
219
+ ---
220
+
221
+ <docs_structure>
222
+ ```
223
+ docs/
224
+ ├── guides/ # Getting started, conventions, patterns
225
+ ├── library/ # nextjs, prisma, next-auth, tanstack-query, zod
226
+ └── design.md # UI/UX guide
227
+ ```
228
+ </docs_structure>