Loading...
Loading...
Use when working on TanStack Start projects - enforces architecture rules (layers, routes, hooks, server functions, conventions) with mandatory validation before any code change. Triggers on file creation, route work, server function writing, hook patterns, or any structural change in a TanStack Start codebase.
npx skill4agent add alpoxdev/hypercore tanstack-start-architecture/oh-my-claudecode:ralph# Check for TanStack Start indicators (ANY of these)
ls app.config.ts 2>/dev/null # TanStack Start config
grep -r "@tanstack/react-start" package.json 2>/dev/null
grep -r "@tanstack/react-router" package.json 2>/dev/null
ls src/routes/__root.tsx 2>/dev/nullarchitecture-rules.mdrules/conventions.mdrules/routes.mdrules/services.mdrules/hooks.mdRoutes -> Server Functions -> Features -> Database| Check | Rule |
|---|---|
| Route accessing DB directly? | BLOCKED. Must go through Server Functions -> Features |
| Route calling Prisma? | BLOCKED. Use Server Functions |
| Server Function skipping Features? | ALLOWED only for simple CRUD |
| Client calling Server Function directly? | BLOCKED. Use TanStack Query (exception: |
| Check | Rule |
|---|---|
Flat file route? ( | BLOCKED. Use folder ( |
Missing | BLOCKED. Every page needs it |
Missing | BLOCKED. Every page needs it |
Missing | BLOCKED. Every page needs it |
| BLOCKED. Must be |
| Logic in page component? | BLOCKED. Extract to |
Layout route missing | BLOCKED. Routes needing beforeLoad/loader must have |
Route with search params but no | BLOCKED. Must use |
Route without | WARNING. Recommended for all routes with loaders |
| Check | Rule |
|---|---|
POST/PUT/PATCH without | BLOCKED |
Auth-required without | BLOCKED |
Using | BLOCKED. |
| handler not last in chain? | BLOCKED. handler must ALWAYS be last (middleware/inputValidator order is flexible) |
Missing | BLOCKED. Use |
| Direct server function call in component? | BLOCKED. Use |
| BLOCKED. Tree shaking failure |
| Check | Rule |
|---|---|
| Hook inside page component? | BLOCKED. Must be in |
| Wrong hook order? | BLOCKED. State -> Global -> Server Fns -> Query -> Handlers -> Memo -> Effect |
| Missing return type interface? | BLOCKED |
| camelCase hook filename? | BLOCKED. Use |
| Check | Rule |
|---|---|
| camelCase filename? | BLOCKED. Use kebab-case |
| BLOCKED. Use const arrow function |
| BLOCKED. Use |
| Missing explicit return type? | BLOCKED |
| Wrong import order? | BLOCKED. External -> @/ -> Relative -> Type |
| Missing Korean block comments? | BLOCKED for code groups |
Using | BLOCKED. Use Zod 4.x |
- [ ] Layer architecture respected (no layer skipping)
- [ ] Route uses folder structure with -components/, -hooks/, -functions/
- [ ] export const Route = createFileRoute(...) used
- [ ] Server Functions use correct chaining (handler always last, middleware/inputValidator flexible)
- [ ] Search params use zodValidator from @tanstack/zod-adapter
- [ ] Custom Hooks in -hooks/ with correct internal order
- [ ] All filenames kebab-case
- [ ] Korean block comments present
- [ ] const arrow functions with explicit return typesls-components/-hooks/-functions/export const Routefunctionsrc/
├── routes/ # File-based routing
│ └── <page>/
│ ├── index.tsx # Page (UI only)
│ ├── route.tsx # Layout (beforeLoad, loader)
│ ├── -components/ # REQUIRED: page components
│ ├── -hooks/ # REQUIRED: page hooks (ALL logic here)
│ ├── -functions/ # REQUIRED: page server functions
│ └── -sections/ # Optional: 200+ line pages
├── features/<domain>/ # Internal domain (Prisma queries)
│ ├── schemas.ts
│ ├── queries.ts
│ └── mutations.ts
├── services/<provider>/ # External SDK wrappers
├── functions/ # Global server functions (NO index.ts!)
│ └── middlewares/
├── database/ # Prisma client singleton
├── stores/ # Zustand stores
├── hooks/ # Global hooks
├── components/ # Shared UI
│ ├── ui/ # shadcn/ui
│ ├── layout/ # Header, Sidebar, Footer
│ └── shared/ # Common components
├── types/ # Global types
├── env/ # t3-env validation
├── config/ # auth, query-client, sentry
└── lib/ # Utilities
├── utils/
├── constants/
└── validators/| Mistake | Fix |
|---|---|
| |
| |
| |
| Logic in page component | Extract to |
| Use |
| Import directly from individual files |
| Hook with mixed order | Follow: State -> Global -> Server Fns -> Query -> Handlers -> Memo -> Effect |
| |
| |
Direct Zod schema in | Use |
Server function call without | Use |
| Use |
Missing | Add |
@/database/prismaexportconst RouteuseStateuseQuery.validator().inputValidator()any/api-hooks/validateSearchuseServerFncreateMiddleware(){ type: 'function' }