# Agent Guidelines for Documenso ## Build/Test/Lint Commands - `pnpm run build` - Build all packages - `pnpm run lint` - Lint all packages - `pnpm run lint:fix` - Auto-fix linting issues - `pnpm run test:e2e` - Run E2E tests with Playwright - `pnpm run test:dev -w @documenso/app-tests` - Run single E2E test in dev mode - `pnpm run test-ui:dev -w @documenso/app-tests` - Run E2E tests with UI - `pnpm run format` - Format code with Prettier - `pnpm run dev` - Start development server for Remix app **Important:** Do not run `pnpm run build` to verify changes unless explicitly asked. Builds take a long time (~2 minutes). Use `pnpm exec tsc --noEmit` for type checking specific packages if needed. ## Code Style Guidelines - Use TypeScript for all code; prefer `type` over `interface` - Use functional components with `const Component = () => {}` - Never use classes; prefer functional/declarative patterns - Use descriptive variable names with auxiliary verbs (isLoading, hasError) - Directory names: lowercase with dashes (auth-wizard) - Use named exports for components - Never use 'use client' directive - Never use 1-line if statements - Structure files: exported component, subcomponents, helpers, static content, types ## Error Handling & Validation - Use custom AppError class when throwing errors - When catching errors on the frontend use `const error = AppError.parse(error)` to get the error code - Use early returns and guard clauses - Use Zod for form validation and react-hook-form for forms - Use error boundaries for unexpected errors ## UI & Styling - Use Shadcn UI, Radix, and Tailwind CSS with mobile-first approach - Use `