feat: add AGENTS.md for all packages and apps (9 files)

This commit is contained in:
2026-04-06 15:04:15 +02:00
parent 95a46fe7f4
commit 2c110b33e9
9 changed files with 255 additions and 0 deletions

17
packages/api/AGENTS.md Normal file
View 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`