Next.js 15 & LangGraph Multi-Agent Cursor Rules
Full-stack AI agent .cursorrules combining Next.js 15 streaming UI with LangGraph stateful multi-agent workflows and vector search.
Framework: NEXTJS
Database/ORM: SUPABASE
Security: MTLS, DOCKER
AI SDK: LANGCHAIN
Audience: AI engineers building autonomous SaaS agents
Production .cursorrules Blueprint
---
description: Full-stack AI agent .cursorrules combining Next.js 15 streaming UI with LangGraph stateful multi-agent workflows and vector search.
globs: ["src/**/*", "app/**/*", "services/**/*"]
alwaysApply: true
---
# ====================================================================
# Warplogic AI Production Stack Rules: Next.js 15 & LangGraph Multi-Agent 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=supabase&sec=mtls,docker&ai=langchain
# ====================================================================
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: Supabase Postgres with Row Level Security (RLS) ALWAYS ENABLED.
- Every table MUST have explicit SELECT, INSERT, UPDATE, DELETE policies bound to auth.uid().
- Access data using the official @supabase/ssr or supabase-py client with service_role keys restricted to secure backends.
## 3. Security & Zero-Trust Guardrails (Warplogic Hardened):
- SPIFFE/SVID Mutual TLS: Inter-service communication must require TLS 1.3 with client certificate SAN URI validation.
- Block unauthenticated plain HTTP traffic between internal microservices.
- 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.
## 4. AI & Agent Integration:
- Use LCEL (pipe syntax) for deterministic chains and LangGraph StateGraph for multi-agent loops.
- Decorate tools with @tool and explicit Pydantic schemas.
Related Architecture & Compliance Blueprints (Canva-Style Grid)
- Next.js 15 App Router & Supabase RLS Cursor Rules — Production-ready .cursorrules for Next.js 15 Server Components with Supabase Row Level Security and Zero-Trust mTLS.
- Next.js 15 & Prisma PostgreSQL Production Cursor Rules — Battle-tested .cursorrules for Next.js 15 Server Actions, Prisma interactive transactions, and Docker container hardening.
- Next.js 15 & Drizzle ORM Type-Safe Cursor Rules — Zero-overhead .cursorrules for Next.js 15 with Drizzle ORM schema validation, PgBouncer pooling, and clean architecture.
- FastAPI Python 3.12 & PostgreSQL Async Cursor Rules — Production-grade Python 3.12 FastAPI .cursorrules with Pydantic v2 validation, SQLAlchemy 2.0 async sessions, and Docker non-root users.
- FastAPI & Supabase JWT Auth Zero-Trust Cursor Rules — Secure FastAPI microservice .cursorrules with Supabase asymmetric JWT verification, Zero-Trust mTLS headers, and OpenAI SDK v4.
- FastAPI & LangChain RAG Vector Pipeline Cursor Rules — High-performance AI backend .cursorrules for FastAPI LCEL chains, pgvector similarity search, and asynchronous streaming endpoints.