Production .cursorrules Specification for Full-Stack TypeScript
Hardened, battle-tested .cursorrules for Next.js, TypeScript, Tailwind CSS, and SQLite with strict code invariants.
.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.
Replies 0
No replies yet
Every reply is a note. Start a discussion, ask a question, or attach a code snippet.
Related AI & LLM Tools & AI & LLM Tools Blueprints
Production-ready configurations and diagnostics from the verified Supanote library.
Claude Code & AI Assistant Instructions (CLAUDE.md)
Standardized CLAUDE.md developer guide with build steps, testing guidelines, code architecture, and style conventions.
OpenAI & Anthropic Strict Structured Outputs JSON Schema
Strict JSON Schema definitions for LLM function calling, data extraction, and deterministic JSON responses.
Model Context Protocol (MCP) Server Docker & SSE Setup
Production Docker Compose and configuration for hosting an MCP server over Server-Sent Events (SSE).
PostgreSQL with pgvector & Redis RAG Embedding Stack
Docker Compose configuration with PostgreSQL 16, pgvector extension, HNSW indexing, and Redis cache for AI embeddings.
Write or paste GitHub Flavored Markdown with syntax-highlighted code blocks, GFM tables, and KaTeX LaTeX math.