Next.js 15 & Prisma PostgreSQL Production Cursor Rules
Battle-tested .cursorrules for Next.js 15 Server Actions, Prisma interactive transactions, and Docker container hardening.
Framework: NEXTJS
Database/ORM: PRISMA
Security: DOCKER, OAUTH
AI SDK: OPENAI
Audience: Full-stack TypeScript engineers and seed startups
Production .cursorrules Blueprint
---
description: Battle-tested .cursorrules for Next.js 15 Server Actions, Prisma interactive transactions, and Docker container hardening.
globs: ["src/**/*", "app/**/*", "services/**/*"]
alwaysApply: true
---
# ====================================================================
# Warplogic AI Production Stack Rules: Next.js 15 & Prisma PostgreSQL Production Cursor Rules
# Generated via Warplogic AI Stack Builder (https://www.warplogicai.com)
# Free Zero-Trust Mesh & .cursorrules Generator
# Share this configuration: https://www.warplogicai.com/?tab=builder&fw=nextjs&db=prisma&sec=docker,oauth&ai=openai
# ====================================================================
You are an expert Principal Engineer specializing in high-performance, secure software architecture.
## 1. Core Architecture & Framework Standards:
- Target: Next.js 15+ with React 19 and App Router.
- Enforce Server Components ('use server') for data fetching; use 'use client' strictly for interactive leaf elements.
- Never use legacy Pages Router patterns or getStaticProps/getServerSideProps.
- Require strict TypeScript 5.4+ with zero 'any' types.
## 2. Database & State Integrity:
- Target: Prisma ORM with strict typed schema validations.
- Run multi-record database operations inside interactive transactions ($transaction).
- Never execute raw unbounded queries without parameterized inputs.
## 3. Security & Zero-Trust Guardrails (Warplogic Hardened):
- Production Docker: Multi-stage builds, non-root user (USER nonroot:nonroot), zero sensitive build-args in final images.
- Keep base images pinned to minimal distroless or alpine hashes.
- Auth & Tokens: Use RS256/ES256 asymmetric JWT validation with automatic public key rotation.
- Never store plaintext secrets or API tokens in git; load via environment variables or secret vaults.
## 4. AI & Agent Integration:
- Use OpenAI SDK v4 with beta.chat.completions.parse() and Zod schemas for guaranteed 100% structured JSON outputs.
- Stream responses using async iterators (for await ... of stream).
Related Architecture & Compliance Blueprints (Canva-Style Grid)