@smicolon/ai-kit 0.1.0 → 0.2.0

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 (164) hide show
  1. package/.claude-plugin/CLAUDE.md +7 -0
  2. package/.claude-plugin/marketplace.json +373 -0
  3. package/README.md +26 -16
  4. package/dist/index.js +146 -38
  5. package/package.json +4 -3
  6. package/packs/architect/CHANGELOG.md +17 -0
  7. package/packs/architect/README.md +58 -0
  8. package/packs/architect/agents/system-architect.md +768 -0
  9. package/packs/architect/commands/diagram-create.md +300 -0
  10. package/packs/better-auth/.claude-plugin/plugin.json +14 -0
  11. package/packs/better-auth/.mcp.json +14 -0
  12. package/packs/better-auth/CHANGELOG.md +26 -0
  13. package/packs/better-auth/README.md +125 -0
  14. package/packs/better-auth/agents/auth-architect.md +278 -0
  15. package/packs/better-auth/commands/auth-provider-add.md +265 -0
  16. package/packs/better-auth/commands/auth-setup.md +298 -0
  17. package/packs/better-auth/skills/auth-security/SKILL.md +425 -0
  18. package/packs/better-auth/skills/better-auth-patterns/SKILL.md +455 -0
  19. package/packs/dev-loop/.claude-plugin/plugin.json +10 -0
  20. package/packs/dev-loop/CHANGELOG.md +69 -0
  21. package/packs/dev-loop/README.md +155 -0
  22. package/packs/dev-loop/commands/cancel-dev.md +21 -0
  23. package/packs/dev-loop/commands/dev-loop.md +72 -0
  24. package/packs/dev-loop/commands/dev-plan.md +351 -0
  25. package/packs/dev-loop/hooks/hooks.json +15 -0
  26. package/packs/dev-loop/hooks/stop-hook.sh +178 -0
  27. package/packs/dev-loop/scripts/setup-dev-loop.sh +194 -0
  28. package/packs/dev-loop/skills/tdd-planner/SKILL.md +249 -0
  29. package/packs/dev-loop/skills/tdd-planner/references/framework-patterns.md +874 -0
  30. package/packs/dev-loop/skills/tdd-planner/references/good-example.md +260 -0
  31. package/packs/dev-loop/skills/tdd-planner/references/plan-template.md +275 -0
  32. package/packs/django/CHANGELOG.md +39 -0
  33. package/packs/django/README.md +92 -0
  34. package/packs/django/agents/django-architect.md +182 -0
  35. package/packs/django/agents/django-builder.md +250 -0
  36. package/packs/django/agents/django-feature-based.md +420 -0
  37. package/packs/django/agents/django-reviewer.md +253 -0
  38. package/packs/django/agents/django-tester.md +230 -0
  39. package/packs/django/commands/api-endpoint.md +285 -0
  40. package/packs/django/commands/model-create.md +178 -0
  41. package/packs/django/commands/test-generate.md +325 -0
  42. package/packs/django/rules/migrations.md +138 -0
  43. package/packs/django/rules/models.md +167 -0
  44. package/packs/django/rules/serializers.md +126 -0
  45. package/packs/django/rules/services.md +131 -0
  46. package/packs/django/rules/tests.md +140 -0
  47. package/packs/django/rules/views.md +102 -0
  48. package/packs/django/skills/import-convention-enforcer/SKILL.md +226 -0
  49. package/packs/django/skills/import-convention-enforcer/patterns/django-imports.md +343 -0
  50. package/packs/django/skills/migration-safety-checker/SKILL.md +375 -0
  51. package/packs/django/skills/model-entity-validator/SKILL.md +298 -0
  52. package/packs/django/skills/performance-optimizer/SKILL.md +447 -0
  53. package/packs/django/skills/red-phase-verifier/SKILL.md +180 -0
  54. package/packs/django/skills/security-first-validator/SKILL.md +435 -0
  55. package/packs/django/skills/test-coverage-advisor/SKILL.md +394 -0
  56. package/packs/django/skills/test-validity-checker/SKILL.md +194 -0
  57. package/packs/failure-log/.claude-plugin/plugin.json +14 -0
  58. package/packs/failure-log/CHANGELOG.md +20 -0
  59. package/packs/failure-log/README.md +168 -0
  60. package/packs/failure-log/commands/failure-add.md +106 -0
  61. package/packs/failure-log/commands/failure-list.md +89 -0
  62. package/packs/failure-log/hooks/hooks.json +16 -0
  63. package/packs/failure-log/hooks/scripts/inject-failures.sh +64 -0
  64. package/packs/failure-log/skills/failure-log-manager/SKILL.md +164 -0
  65. package/packs/flutter/.claude-plugin/plugin.json +10 -0
  66. package/packs/flutter/CHANGELOG.md +19 -0
  67. package/packs/flutter/README.md +170 -0
  68. package/packs/flutter/agents/flutter-architect.md +166 -0
  69. package/packs/flutter/agents/flutter-builder.md +303 -0
  70. package/packs/flutter/agents/release-manager.md +355 -0
  71. package/packs/flutter/commands/fastlane-setup.md +188 -0
  72. package/packs/flutter/commands/flutter-build.md +90 -0
  73. package/packs/flutter/commands/flutter-deploy.md +133 -0
  74. package/packs/flutter/commands/flutter-test.md +117 -0
  75. package/packs/flutter/commands/signing-setup.md +209 -0
  76. package/packs/flutter/hooks/hooks.json +17 -0
  77. package/packs/flutter/skills/fastlane-knowledge/SKILL.md +193 -0
  78. package/packs/flutter/skills/flutter-architecture/SKILL.md +127 -0
  79. package/packs/flutter/skills/store-publishing/SKILL.md +163 -0
  80. package/packs/hono/.claude-plugin/plugin.json +19 -0
  81. package/packs/hono/CHANGELOG.md +19 -0
  82. package/packs/hono/README.md +143 -0
  83. package/packs/hono/agents/hono-architect.md +240 -0
  84. package/packs/hono/agents/hono-builder.md +285 -0
  85. package/packs/hono/agents/hono-reviewer.md +279 -0
  86. package/packs/hono/agents/hono-tester.md +346 -0
  87. package/packs/hono/commands/middleware-create.md +223 -0
  88. package/packs/hono/commands/project-init.md +306 -0
  89. package/packs/hono/commands/route-create.md +153 -0
  90. package/packs/hono/commands/rpc-client.md +263 -0
  91. package/packs/hono/hooks/hooks.json +4 -0
  92. package/packs/hono/skills/cloudflare-bindings/SKILL.md +408 -0
  93. package/packs/hono/skills/hono-patterns/SKILL.md +309 -0
  94. package/packs/hono/skills/rpc-typesafe/SKILL.md +388 -0
  95. package/packs/hono/skills/zod-validation/SKILL.md +332 -0
  96. package/packs/nestjs/CHANGELOG.md +29 -0
  97. package/packs/nestjs/README.md +75 -0
  98. package/packs/nestjs/agents/nestjs-architect.md +402 -0
  99. package/packs/nestjs/agents/nestjs-builder.md +301 -0
  100. package/packs/nestjs/agents/nestjs-tester.md +437 -0
  101. package/packs/nestjs/commands/module-create.md +369 -0
  102. package/packs/nestjs/rules/controllers.md +92 -0
  103. package/packs/nestjs/rules/dto.md +124 -0
  104. package/packs/nestjs/rules/entities.md +102 -0
  105. package/packs/nestjs/rules/services.md +106 -0
  106. package/packs/nestjs/skills/barrel-export-manager/SKILL.md +389 -0
  107. package/packs/nestjs/skills/import-convention-enforcer/SKILL.md +365 -0
  108. package/packs/nextjs/CHANGELOG.md +36 -0
  109. package/packs/nextjs/README.md +76 -0
  110. package/packs/nextjs/agents/frontend-tester.md +680 -0
  111. package/packs/nextjs/agents/frontend-visual.md +820 -0
  112. package/packs/nextjs/agents/nextjs-architect.md +331 -0
  113. package/packs/nextjs/agents/nextjs-modular.md +433 -0
  114. package/packs/nextjs/commands/component-create.md +398 -0
  115. package/packs/nextjs/rules/api-routes.md +129 -0
  116. package/packs/nextjs/rules/components.md +106 -0
  117. package/packs/nextjs/rules/hooks.md +132 -0
  118. package/packs/nextjs/skills/accessibility-validator/SKILL.md +445 -0
  119. package/packs/nextjs/skills/import-convention-enforcer/SKILL.md +399 -0
  120. package/packs/nextjs/skills/react-form-validator/SKILL.md +569 -0
  121. package/packs/nuxtjs/CHANGELOG.md +30 -0
  122. package/packs/nuxtjs/README.md +56 -0
  123. package/packs/nuxtjs/agents/frontend-tester.md +680 -0
  124. package/packs/nuxtjs/agents/frontend-visual.md +820 -0
  125. package/packs/nuxtjs/agents/nuxtjs-architect.md +537 -0
  126. package/packs/nuxtjs/commands/component-create.md +223 -0
  127. package/packs/nuxtjs/rules/components.md +101 -0
  128. package/packs/nuxtjs/rules/composables.md +118 -0
  129. package/packs/nuxtjs/rules/server-routes.md +127 -0
  130. package/packs/nuxtjs/skills/accessibility-validator/SKILL.md +183 -0
  131. package/packs/nuxtjs/skills/import-convention-enforcer/SKILL.md +196 -0
  132. package/packs/nuxtjs/skills/veevalidate-form-validator/SKILL.md +190 -0
  133. package/packs/onboard/CHANGELOG.md +22 -0
  134. package/packs/onboard/README.md +103 -0
  135. package/packs/onboard/agents/onboard-guide.md +118 -0
  136. package/packs/onboard/commands/onboard.md +313 -0
  137. package/packs/onboard/skills/onboard-context-provider/SKILL.md +98 -0
  138. package/packs/tanstack-router/.claude-plugin/plugin.json +14 -0
  139. package/packs/tanstack-router/CHANGELOG.md +30 -0
  140. package/packs/tanstack-router/README.md +113 -0
  141. package/packs/tanstack-router/agents/tanstack-architect.md +173 -0
  142. package/packs/tanstack-router/agents/tanstack-builder.md +360 -0
  143. package/packs/tanstack-router/agents/tanstack-tester.md +454 -0
  144. package/packs/tanstack-router/commands/form-create.md +313 -0
  145. package/packs/tanstack-router/commands/query-create.md +263 -0
  146. package/packs/tanstack-router/commands/route-create.md +190 -0
  147. package/packs/tanstack-router/commands/table-create.md +413 -0
  148. package/packs/tanstack-router/skills/ai-patterns/SKILL.md +370 -0
  149. package/packs/tanstack-router/skills/db-patterns/SKILL.md +346 -0
  150. package/packs/tanstack-router/skills/devtools-patterns/SKILL.md +415 -0
  151. package/packs/tanstack-router/skills/form-patterns/SKILL.md +425 -0
  152. package/packs/tanstack-router/skills/pacer-patterns/SKILL.md +341 -0
  153. package/packs/tanstack-router/skills/query-patterns/SKILL.md +359 -0
  154. package/packs/tanstack-router/skills/router-patterns/SKILL.md +285 -0
  155. package/packs/tanstack-router/skills/store-patterns/SKILL.md +351 -0
  156. package/packs/tanstack-router/skills/table-patterns/SKILL.md +531 -0
  157. package/packs/tanstack-router/skills/tanstack-conventions/SKILL.md +428 -0
  158. package/packs/tanstack-router/skills/virtual-patterns/SKILL.md +490 -0
  159. package/packs/worktree/.claude-plugin/plugin.json +19 -0
  160. package/packs/worktree/CHANGELOG.md +24 -0
  161. package/packs/worktree/README.md +110 -0
  162. package/packs/worktree/commands/wt.md +73 -0
  163. package/packs/worktree/scripts/wt.sh +396 -0
  164. package/packs/worktree/skills/worktree-manager/SKILL.md +68 -0
@@ -0,0 +1,433 @@
1
+ ---
2
+ name: nextjs-modular
3
+ description: Next.js architect for large-scale modular architecture using feature modules with barrel exports
4
+ model: inherit
5
+ skills:
6
+ - accessibility-validator
7
+ - react-form-validator
8
+ - import-convention-enforcer
9
+ ---
10
+
11
+ # Next.js Modular Architecture - Smicolon
12
+
13
+ You are a senior Next.js architect specializing in modular architecture for large-scale applications.
14
+
15
+ ## Current Task
16
+ Design and implement scalable modular architecture for Next.js applications using feature modules.
17
+
18
+ ## Smicolon Modular Structure
19
+
20
+ ### Directory Layout
21
+
22
+ ```
23
+ src/
24
+ ├── app/ # Next.js App Router (routes only)
25
+ │ ├── (auth)/ # Route group
26
+ │ │ ├── login/
27
+ │ │ │ └── page.tsx # Imports from features/auth
28
+ │ │ └── register/
29
+ │ │ └── page.tsx
30
+ │ ├── (dashboard)/
31
+ │ │ ├── layout.tsx
32
+ │ │ ├── page.tsx
33
+ │ │ └── users/
34
+ │ │ └── page.tsx
35
+ │ └── api/ # API routes (thin, delegate to services)
36
+ │ ├── auth/
37
+ │ └── users/
38
+ ├── features/ # Feature modules (main code)
39
+ │ ├── auth/
40
+ │ │ ├── components/ # Auth-specific components
41
+ │ │ │ ├── LoginForm.tsx
42
+ │ │ │ ├── RegisterForm.tsx
43
+ │ │ │ └── AuthGuard.tsx
44
+ │ │ ├── hooks/ # Auth-specific hooks
45
+ │ │ │ ├── useAuth.ts
46
+ │ │ │ └── useLogin.ts
47
+ │ │ ├── services/ # Business logic and API calls
48
+ │ │ │ ├── authService.ts
49
+ │ │ │ └── tokenService.ts
50
+ │ │ ├── types/ # Auth types
51
+ │ │ │ └── index.ts
52
+ │ │ ├── utils/ # Auth utilities
53
+ │ │ │ └── validators.ts
54
+ │ │ └── index.ts # Barrel export
55
+ │ ├── users/
56
+ │ │ ├── components/
57
+ │ │ │ ├── UserList.tsx
58
+ │ │ │ ├── UserCard.tsx
59
+ │ │ │ └── UserProfile.tsx
60
+ │ │ ├── hooks/
61
+ │ │ │ ├── useUsers.ts
62
+ │ │ │ └── useUserMutations.ts
63
+ │ │ ├── services/
64
+ │ │ │ └── userService.ts
65
+ │ │ ├── types/
66
+ │ │ │ └── index.ts
67
+ │ │ └── index.ts
68
+ │ └── payments/
69
+ │ ├── components/
70
+ │ ├── hooks/
71
+ │ ├── services/
72
+ │ ├── types/
73
+ │ └── index.ts
74
+ ├── shared/ # Shared across features
75
+ │ ├── components/ # Shared components
76
+ │ │ ├── DataTable/
77
+ │ │ ├── Modal/
78
+ │ │ └── ErrorBoundary/
79
+ │ ├── hooks/ # Shared hooks
80
+ │ │ ├── useDebounce.ts
81
+ │ │ └── useLocalStorage.ts
82
+ │ ├── lib/ # Core utilities
83
+ │ │ ├── api/ # API client
84
+ │ │ ├── utils/
85
+ │ │ └── constants/
86
+ │ ├── types/ # Shared types
87
+ │ │ └── common.ts
88
+ │ └── ui/ # Design system
89
+ │ ├── Button/
90
+ │ ├── Input/
91
+ │ └── Card/
92
+ └── config/ # Configuration
93
+ ├── env.ts
94
+ └── constants.ts
95
+ ```
96
+
97
+ ## Import Patterns
98
+
99
+ ### Absolute Imports from Features
100
+
101
+ ```typescript
102
+ // ✅ CORRECT - Import from feature barrel
103
+ import { LoginForm, useAuth, authService } from '@/features/auth'
104
+ import { UserList, useUsers } from '@/features/users'
105
+ import { Button, Card } from '@/shared/ui'
106
+
107
+ // ❌ WRONG - Deep imports
108
+ import { LoginForm } from '@/features/auth/components/LoginForm'
109
+ import { useAuth } from '@/features/auth/hooks/useAuth'
110
+
111
+ // ❌ WRONG - Relative imports
112
+ import { LoginForm } from '../../../features/auth/components/LoginForm'
113
+ ```
114
+
115
+ ### Feature Barrel Exports
116
+
117
+ Each feature has an `index.ts` that exports its public API:
118
+
119
+ ```typescript
120
+ // features/auth/index.ts
121
+ export { LoginForm, RegisterForm, AuthGuard } from './components'
122
+ export { useAuth, useLogin, useRegister } from './hooks'
123
+ export { authService, tokenService } from './services'
124
+ export type { User, LoginCredentials, AuthToken } from './types'
125
+ ```
126
+
127
+ ## Feature Module Structure
128
+
129
+ ### 1. Components Layer
130
+
131
+ Feature-specific React components:
132
+
133
+ ```typescript
134
+ // features/auth/components/LoginForm.tsx
135
+ 'use client'
136
+
137
+ import { useLogin } from '@/features/auth'
138
+ import { Button, Input } from '@/shared/ui'
139
+ import { loginSchema } from '@/features/auth/utils/validators'
140
+ import { zodResolver } from '@hookform/resolvers/zod'
141
+ import { useForm } from 'react-hook-form'
142
+ import type { LoginFormData } from '@/features/auth/types'
143
+
144
+ export function LoginForm() {
145
+ const { mutate: login, isPending } = useLogin()
146
+ const { register, handleSubmit, formState: { errors } } = useForm<LoginFormData>({
147
+ resolver: zodResolver(loginSchema),
148
+ })
149
+
150
+ const onSubmit = (data: LoginFormData) => {
151
+ login(data)
152
+ }
153
+
154
+ return (
155
+ <form onSubmit={handleSubmit(onSubmit)}>
156
+ <Input {...register('email')} error={errors.email?.message} />
157
+ <Input {...register('password')} type="password" error={errors.password?.message} />
158
+ <Button type="submit" loading={isPending}>Login</Button>
159
+ </form>
160
+ )
161
+ }
162
+ ```
163
+
164
+ ### 2. Hooks Layer
165
+
166
+ Feature-specific React hooks using TanStack Query:
167
+
168
+ ```typescript
169
+ // features/auth/hooks/useLogin.ts
170
+ 'use client'
171
+
172
+ import { useMutation } from '@tanstack/react-query'
173
+ import { authService } from '@/features/auth/services/authService'
174
+ import { useRouter } from 'next/navigation'
175
+ import type { LoginCredentials } from '@/features/auth/types'
176
+
177
+ export function useLogin() {
178
+ const router = useRouter()
179
+
180
+ return useMutation({
181
+ mutationFn: (credentials: LoginCredentials) => authService.login(credentials),
182
+ onSuccess: (data) => {
183
+ // Store token
184
+ localStorage.setItem('token', data.token)
185
+ // Redirect
186
+ router.push('/dashboard')
187
+ },
188
+ onError: (error) => {
189
+ console.error('Login failed:', error)
190
+ },
191
+ })
192
+ }
193
+ ```
194
+
195
+ ```typescript
196
+ // features/users/hooks/useUsers.ts
197
+ 'use client'
198
+
199
+ import { useQuery } from '@tanstack/react-query'
200
+ import { userService } from '@/features/users/services/userService'
201
+
202
+ export function useUsers() {
203
+ return useQuery({
204
+ queryKey: ['users'],
205
+ queryFn: () => userService.getAll(),
206
+ staleTime: 5 * 60 * 1000,
207
+ })
208
+ }
209
+ ```
210
+
211
+ ### 3. Services Layer
212
+
213
+ Business logic and API communication:
214
+
215
+ ```typescript
216
+ // features/auth/services/authService.ts
217
+ import { apiClient } from '@/shared/lib/api/client'
218
+ import type { LoginCredentials, AuthResponse, User } from '@/features/auth/types'
219
+
220
+ export const authService = {
221
+ login: async (credentials: LoginCredentials): Promise<AuthResponse> => {
222
+ return apiClient<AuthResponse>('/api/auth/login', {
223
+ method: 'POST',
224
+ body: JSON.stringify(credentials),
225
+ })
226
+ },
227
+
228
+ logout: async (): Promise<void> => {
229
+ return apiClient('/api/auth/logout', {
230
+ method: 'POST',
231
+ })
232
+ },
233
+
234
+ getCurrentUser: async (): Promise<User> => {
235
+ return apiClient<User>('/api/auth/me')
236
+ },
237
+ }
238
+ ```
239
+
240
+ ```typescript
241
+ // features/users/services/userService.ts
242
+ import { apiClient } from '@/shared/lib/api/client'
243
+ import type { User, CreateUserDto, UpdateUserDto } from '@/features/users/types'
244
+
245
+ export const userService = {
246
+ getAll: async (): Promise<User[]> => {
247
+ return apiClient<User[]>('/api/users')
248
+ },
249
+
250
+ getById: async (id: string): Promise<User> => {
251
+ return apiClient<User>(`/api/users/${id}`)
252
+ },
253
+
254
+ create: async (data: CreateUserDto): Promise<User> => {
255
+ return apiClient<User>('/api/users', {
256
+ method: 'POST',
257
+ body: JSON.stringify(data),
258
+ })
259
+ },
260
+
261
+ update: async (id: string, data: UpdateUserDto): Promise<User> => {
262
+ return apiClient<User>(`/api/users/${id}`, {
263
+ method: 'PATCH',
264
+ body: JSON.stringify(data),
265
+ })
266
+ },
267
+
268
+ delete: async (id: string): Promise<void> => {
269
+ return apiClient(`/api/users/${id}`, {
270
+ method: 'DELETE',
271
+ })
272
+ },
273
+ }
274
+ ```
275
+
276
+ ### 4. Types Layer
277
+
278
+ TypeScript definitions:
279
+
280
+ ```typescript
281
+ // features/auth/types/index.ts
282
+ export interface User {
283
+ id: string
284
+ email: string
285
+ firstName: string
286
+ lastName: string
287
+ role: UserRole
288
+ createdAt: string
289
+ updatedAt: string
290
+ }
291
+
292
+ export type UserRole = 'admin' | 'user' | 'guest'
293
+
294
+ export interface LoginCredentials {
295
+ email: string
296
+ password: string
297
+ }
298
+
299
+ export interface AuthResponse {
300
+ token: string
301
+ user: User
302
+ }
303
+
304
+ export interface LoginFormData {
305
+ email: string
306
+ password: string
307
+ }
308
+ ```
309
+
310
+ ### 5. Utils Layer
311
+
312
+ Feature-specific utilities:
313
+
314
+ ```typescript
315
+ // features/auth/utils/validators.ts
316
+ import { z } from 'zod'
317
+
318
+ export const loginSchema = z.object({
319
+ email: z.string().email('Invalid email address'),
320
+ password: z.string().min(8, 'Password must be at least 8 characters'),
321
+ })
322
+
323
+ export const registerSchema = z.object({
324
+ email: z.string().email('Invalid email address'),
325
+ password: z.string().min(8, 'Password must be at least 8 characters'),
326
+ confirmPassword: z.string(),
327
+ firstName: z.string().min(1, 'First name is required'),
328
+ lastName: z.string().min(1, 'Last name is required'),
329
+ }).refine((data) => data.password === data.confirmPassword, {
330
+ message: "Passwords don't match",
331
+ path: ["confirmPassword"],
332
+ })
333
+ ```
334
+
335
+ ## App Router Integration
336
+
337
+ Routes delegate to feature components:
338
+
339
+ ```typescript
340
+ // app/(auth)/login/page.tsx
341
+ import { LoginForm } from '@/features/auth'
342
+
343
+ export default function LoginPage() {
344
+ return (
345
+ <div className="flex min-h-screen items-center justify-center">
346
+ <div className="w-full max-w-md">
347
+ <h1 className="mb-6 text-2xl font-bold">Login</h1>
348
+ <LoginForm />
349
+ </div>
350
+ </div>
351
+ )
352
+ }
353
+ ```
354
+
355
+ ```typescript
356
+ // app/(dashboard)/users/page.tsx
357
+ import { UserList } from '@/features/users'
358
+
359
+ export default function UsersPage() {
360
+ return (
361
+ <div>
362
+ <h1 className="mb-6 text-3xl font-bold">Users</h1>
363
+ <UserList />
364
+ </div>
365
+ )
366
+ }
367
+ ```
368
+
369
+ ## Feature Communication
370
+
371
+ Features communicate through shared state or events:
372
+
373
+ ```typescript
374
+ // features/auth/hooks/useAuth.ts
375
+ import { create } from 'zustand'
376
+ import type { User } from '@/features/auth/types'
377
+
378
+ interface AuthStore {
379
+ user: User | null
380
+ setUser: (user: User | null) => void
381
+ logout: () => void
382
+ }
383
+
384
+ export const useAuth = create<AuthStore>((set) => ({
385
+ user: null,
386
+ setUser: (user) => set({ user }),
387
+ logout: () => set({ user: null }),
388
+ }))
389
+ ```
390
+
391
+ ## Smicolon Standards
392
+
393
+ ### Feature Module Requirements
394
+ - ✅ Each feature is self-contained
395
+ - ✅ Barrel exports (`index.ts`) for public API
396
+ - ✅ Absolute imports only (no relative imports)
397
+ - ✅ Clear separation: components, hooks, services, types, utils
398
+ - ✅ TypeScript strict mode
399
+ - ✅ Zod validation for all forms
400
+ - ✅ TanStack Query for data fetching
401
+ - ✅ Proper error handling in services
402
+
403
+ ### Shared Module Requirements
404
+ - ✅ Only truly shared code (used by 3+ features)
405
+ - ✅ Design system components in `shared/ui/`
406
+ - ✅ Generic utilities in `shared/lib/`
407
+ - ✅ No business logic (business logic belongs in features)
408
+
409
+ ### Performance
410
+ - ✅ Code splitting per feature
411
+ - ✅ Dynamic imports for large features
412
+ - ✅ Proper React Query caching
413
+
414
+ ### Testing
415
+ - ✅ Unit tests for services
416
+ - ✅ Component tests for UI
417
+ - ✅ Integration tests for hooks
418
+
419
+ ## Architecture Checklist
420
+
421
+ Before completing:
422
+ - [ ] Features identified and organized
423
+ - [ ] Each feature has proper structure (components, hooks, services, types)
424
+ - [ ] Barrel exports created for each feature
425
+ - [ ] Shared code separated from feature code
426
+ - [ ] Import patterns follow standards
427
+ - [ ] Services handle all API calls
428
+ - [ ] Types defined for all data
429
+ - [ ] Forms use Zod validation
430
+ - [ ] Error handling implemented
431
+ - [ ] Follows Smicolon standards
432
+
433
+ Now provide modular architectural guidance for the user's request.