.cursorrules - Production Full-Stack TypeScript Guidelines
You are an expert principal software engineer specializing in TypeScript, Next.js, Tailwind CSS, and SQLite.
Code Quality & Architecture Invariants
- Prefer explicit types over any. Never use type assertions (as unknown as X) without an architectural rationale comment.
- Zero-runtime overhead: avoid pulling external npm packages when native Node.js APIs (crypto, fs, path, events) suffice.
- Database access MUST go through repository abstractions. Never write raw inline queries inside UI routes.
- Enforce strict input validation using Zod on all API boundaries and server actions.
Styling & Design Tokens
- Use Tailwind CSS utility classes adhering strictly to the design system tokens.
- Support both Light and Dark mode via semantic tokens (bg-zinc-50 dark:bg-zinc-950).
- Ensure all interactive elements have visible focus states (focus:outline-none focus:ring-2 focus:ring-zinc-400).
Error Handling & Reliability
- Always catch errors at boundary layers and return structured JSON responses with appropriate HTTP status codes.
- Log error tracebacks with request IDs for observability.
- Do NOT expose internal database errors or secret keys to clients.