feat: add AGENTS.md for all packages and apps (9 files)
This commit is contained in:
17
packages/api/AGENTS.md
Normal file
17
packages/api/AGENTS.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# @repo/api — tRPC Router Definitions
|
||||
|
||||
tRPC routers that call controllers from `@repo/core`. Each procedure validates input and delegates to a controller.
|
||||
|
||||
## Rules
|
||||
|
||||
- NEVER put business logic in routers — delegate to controllers
|
||||
- Input validation uses Zod schemas
|
||||
- Each domain gets its own router file
|
||||
|
||||
## Adding a New tRPC Router
|
||||
|
||||
1. Create `src/router/{domain}.router.ts`
|
||||
2. Import `router` and `publicProcedure` from `../trpc.js`
|
||||
3. Define procedures (`.query()` for reads, `.mutation()` for writes)
|
||||
4. Each procedure calls a controller from `@repo/core`
|
||||
5. Add router to root `appRouter` in `src/router/index.ts`
|
||||
Reference in New Issue
Block a user