S
Supanote
Sign in Sign up

Production .cursorrules Specification for Full-Stack TypeScript

markdown 12 hours ago · 20 lines · 12 views

.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.

No replies yet

Every reply is a note. Start a discussion, ask a question, or attach a code snippet.

Share Note

Download SVG
Social Card Preview
Open on mobile
Point your phone camera to open this note directly

Report this note

Notification