diff --git a/AGENTS.md b/AGENTS.md index 7134c3dc9d81c2cf3938e6178ebbcb5e0aa9b45a..a4cf16d0a2803c1ecd22ad0cf3174c93b8f756ed 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -93,6 +93,9 @@ bun run build # Build all packages - ❌ **Do not assume Prisma**. Database layer is **Drizzle ORM**. - ❌ **Do not hardcode API keys** in source code. AI keys are user-managed via the Settings UI. - ❌ **Do not add global CSS** in `apps/web` without checking `packages/ui/src/styles/globals.css` for existing design tokens and CSS variables. +- ❌ **Do not skip heading levels**. After `

`, the next heading must be `

`, not `

` (or lower). Never have two `

` on one page. +- ❌ **Do not create custom modal/dialog components**. Use shadcn `` from `@labas/ui/components/dialog` — it provides built-in focus trap, escape key, scroll lock, and ARIA. +- ❌ **Do not use `any`** in frontend TypeScript. Enforced by eslint `@typescript-eslint/no-explicit-any: "error"` in `apps/web/eslint.config.mjs`. --- @@ -109,6 +112,25 @@ bun run build # Build all packages npx shadcn@latest add accordion dialog -c packages/ui ``` - App-specific blocks (non-shared) should be added directly in `apps/web/src/components/`. +- DevTools (TanStack Router, React Query) are **production-gated** via `import.meta.env.DEV` — do not remove the condition. +- App-level error boundary is in `__root.tsx` using `` — route-level error boundaries via `errorComponent` route option. +- Lazy-loaded route components use the `.lazy.tsx` pattern: route file is thin, heavy component lives in `components/routes/*Page.tsx` wrapped in `Suspense`. + +--- + +## 5b. Frontend Accessibility Conventions + +- **Skip link**: Root layout in `__root.tsx` has a hidden `` that appears on Tab press, linking to `#main-content` on the `
` element. +- **Icon-only buttons**: Every `