SolidStart 1.0 Server Functions & Async Boundaries Production Standard
SolidStart 1.0 relies on the Vinxi bundler to split `server$` closures into independent HTTP POST RPC endpoints. Direct lexical closure over client signals within `server$` scopes or failure to demarcate async boundaries with `<Suspense>` causes silent serialization failures, client-bundle secret leaks, and SSR hydration mismatches. Enforcing strict parameter passing, runtime input validation, and Solid async primitives maintains security and fine-grained reactivity across network boundaries.
Astro 5 Actions & Content Layer Production Standard
Enforces strict type safety and architectural correctness for Astro 5 Server Actions and the zero-waterfall Content Layer API. Prevents runtime contract mismatches, hydration mismatches, and unhandled mutation exceptions across dynamic and prerendered boundaries. Failure to follow these patterns leads to silent data fetching waterfalls, build-time cache corruptions, and unhandled server action exceptions.
Nuxt 4 Nitro Server Engine & Shared Directory Production Standard
Nuxt 4 enforces strict boundary segregation between client UI in the app/ directory, backend endpoints in server/, and universal contracts in shared/. Violating cross-boundary isolation or maintaining module-scoped state in Nitro server handlers causes catastrophic cross-request data corruption and hydration mismatches under concurrent production traffic. Architects must enforce request-isolated H3 event contexts, universal serialization schemas, and strict path-alias boundaries.
Svelte 5 Runes ($state, $derived, $effect) & Legacy Reactivity Elimination
Production standard for Svelte 5. Mandates using modern Runes ($state, $derived, $effect) and strictly eliminates deprecated Svelte 3/4 reactive declarations ($: variable = ...) and mutable let bindings.
TanStack Start SSR: Type-Safe Search Validation, Granular Loader Dependencies, and Deferred Data Streaming
Enforces strict type safety for URL search parameters via schema validators, prevents SSR render blocking through deferred streaming promises, and ensures loaders trigger re-executions only when declared dependencies mutate. Failing to adhere leads to TTFB degradation, hydration mismatch exceptions, and silent cache invalidation bugs in fullstack TanStack applications.
React 19 Action Hooks & useActionState Production Standard & Concurrency Guardrail
React 19 introduces native async Action transitions that manage pending states, concurrent updates, and optimistic rollbacks natively within the framework lifecycle. Reverting to legacy manual useState booleans for submission states introduces race conditions, breaks concurrent rendering boundaries, and bypasses automatic error boundaries. Modern production frontends must leverage useActionState, useOptimistic, and useFormStatus to ensure resilient, race-condition-free form lifecycles.
Next.js 15 Server Actions Boundary CSRF & Origin Validation Standard
Next.js 15 Server Actions enforce built-in origin checks against the Host header, but multi-domain setups, reverse proxy misconfigurations, or unauthenticated action endpoints create severe CSRF and unauthorized state mutation vectors. Production actions must assert authenticated session identity, validate strict schemas, and configure experimental.serverActions.allowedOrigins to protect critical boundaries.
Qwik City Resumability & Containerization Production Standard
Enforces Qwik's zero-hydration resumability model by strictly isolating lexical boundaries across Optimizer-split chunk closures. Prevents accidental closure captures, serialization bottlenecks, and eager code evaluation that degrade instant-on performance. Failure to maintain clean serializable boundaries introduces runtime de-opt failures, memory leaks, and massive client bundle bloat.
Vite 6 Environment API & Multi-Runtimes Architecture Standard
Vite 6 deprecates monolithic SSR transforms in favor of the Environment API, isolating module graphs and module runners across distinct runtimes (Node.js, Edge, workerd, and Client). Conflating environment module graphs or invoking deprecated APIs like `ssrLoadModule` causes cross-runtime state leakage, broken HMR transport boundaries, and unhandled execution crashes. Strict boundary isolation across `server.environments` MUST be enforced to guarantee deterministic compilation and Hot Module Replacement.
TanStack Start & Router SSR: Type-Safe Search Validation, Loaders, and Deferred Streaming
Enforces strict type safety and streaming invariants in TanStack Start and TanStack Router SSR applications. Mandates route-level search param schema validation via Zod/Valibot, prevents waterfall SSR blocking by requiring deferred streaming for non-critical dependencies, and enforces execution-boundary safety between loaders and server functions.
Tauri 2.0 Mobile IPC & Capabilities Permissions Matrix Standard
Tauri v2 introduces a capability-driven permissions system replacing legacy v1 allowlists across iOS and Android runtimes. Failure to constrain IPC command handlers with typed schemas and explicit mobile capability definitions exposes native mobile OS surfaces to arbitrary code execution, permission leakage, and silent serialization failures. Production mobile deployments require strictly typed IPC boundary validation, granular capability scopes, and graceful permission degradation.
Capacitor 7 Native Bridge, Biometric Auth & Android 15 Lifecycle Production Standard
Capacitor 7 enforces strict bridge lifecycle contracts, asynchronous native plugin interop, and mandatory Android 15 edge-to-edge window inset handling. Storing sensitive authentication tokens in unencrypted web storage or failing to bind biometric authentication directly to hardware-backed Keystore or Secure Enclave mechanisms compromises app integrity and causes fatal crash or viewport occlusion issues on modern mobile operating systems.
TanStack Start SSR Loader Invariants: Type-Safe Search Params & Deferred Streaming
Enforces type-safe search parameter validation via explicit schemas, prevents SSR TTFB stalls by delegating non-critical data to deferred streaming promises, and guarantees server-only boundaries using TanStack Start server functions.
Tailwind CSS v4 CSS-First Theme Directives and Dynamic Interpolation Guardrail
Enforces modern Tailwind CSS v4 CSS-first configuration via pure @theme and @theme inline blocks, deprecating legacy tailwind.config.js/ts abstractions. Mandates native CSS custom properties with color-mix() runtime opacity interpolation instead of legacy RGB channel workarounds. Ensures token declarations follow v4 standard namespace conventions and CSS variable resolution across the build pipeline.
Hono JSX Edge Streaming Pipelines and Non-Blocking Chunk Composition
Enforces non-blocking chunk composition and zero-buffer streaming pipelines for Hono JSX on Cloudflare Workers and Deno edge runtimes. Prohibits full-document string serialization and post-flush HTTP header mutation while guaranteeing correct Suspense boundaries and stream-safe middleware chaining.
Angular 19 Standalone Signals, LinkedSignals, and Defer Block Invariants
Enforces Modern Angular 19 architectural standards by mandating signal inputs and linkedSignal for reactive derived mutable state, eliminating decorator-based inputs and manual synchronization side-effects in ngOnChanges or effects. Enforces strictly structured @defer blocks with minimum placeholder constraints to guarantee performance chunking and prevent cumulative layout shifts (CLS).
React Router 7 Framework Mode Hydration, Typegen, and Single-Fetch Boundaries
Enforces deterministic SSR-to-client hydration invariants in React Router 7 Framework Mode. Mandates strict adherence to Single Fetch promise streaming, generated route module typings, and explicit clientLoader execution policies to prevent rendering waterfalls and hydration drift.
TanStack Virtual 3.0 Dynamic Measurement, Scroll Containment, and DOM Saturation Guardrail
Enforces strict industrial standards for TanStack Virtual 3.0 in massive datasets and dynamic tables. Mandates native ref-based element measurement via measureElement, strict containment of scroll margins to prevent viewport jitter, and hard limits on overscan to avoid catastrophic DOM node saturation.
Lexical Headless Node Mutation, Selection Reconciliation, and Markdown Engine Guardrails
Enforces architectural invariants within Meta Lexical headless document workflows and client-side editors. Prevents dirty node write corruptions, selection collapse regressions, and out-of-order transform loop recursion during headless Markdown and AST operations. Guarantees predictable reconciliation and clone-on-write integrity across server-side rendering and client editor states.
TanStack Start SSR Loaders, Streaming Deferred Data, and Validated Search Params
Enforces strict type-safety, streaming efficiency, and boundary isolation in TanStack Start and Fullstack TanStack Router. Requires declarative validation of search parameters via schema parsers, non-blocking SSR TTFB via explicit promise deferral with Suspense boundaries, and strict server/client boundary isolation using server functions.
Tailwind CSS v4 CSS-First Declarative Theme and Color Architecture Guardrails
Tailwind CSS v4 replaces JavaScript-based configurations with native CSS-first declarations via `@theme` directives and standard CSS custom properties. Enforcing this invariant prevents silent build regressions, eliminates obsolete CSS opacity-channel string hacks, and unlocks native CSS color gamut interpolation (OKLCH) via dynamic `color-mix()`. Projects migrating to or initialized with v4 must strictly maintain styling configuration inside CSS boundary layers.
Angular 19 Signal Primitives, linkedSignal Derivations, and Deferred Viewport Chunking
Enforces modern Angular 19 standalone architecture using signal inputs, signal-based outputs, linkedSignal for resettable/derived state, and production-hardened @defer blocks. Prevents architectural anti-patterns such as writing to signals inside effects, using legacy decorator inputs, and defer blocks lacking layout stability constraints.
React Router 7 Framework Mode Hydration & Single-Fetch Architecture
Enforces strict adherence to React Router 7 framework mode hydration contracts, single-fetch streaming semantics, and route module typegen. Prevents hydration mismatches, duplicate network waterfalls, and broken serialized state caused by legacy Remix primitives (such as json() or defer()) and misconfigured clientLoader boundaries.
TanStack Virtual 3.0: Dynamic Measurement and DOM Containment Invariants
Enforces deterministic virtualization mechanics in TanStack Virtual 3.0, mandating stable dynamic element measurement callbacks, strict CSS containment, and bounded overscan budgets. Prevents layout thrashing, scroll-drift jitter, and DOM node saturation in massive data grids.
Cursor Native Configuration Format
Target location: .cursor/rules/
---
description: Next.js 15 App Router & React 19 Architectural Invariants
globs: "app/**/*.{ts,tsx}", "src/app/**/*.{ts,tsx}"
alwaysApply: false
---
# Next.js 15 App Router & Async Request Invariants
- NEVER scaffold or reference legacy `pages/` directory structure.
- ALWAYS await asynchronous request headers (`await cookies()`, `await headers()`).
- Forbid manual `useMemo` and `useCallback` boilerplate in React 19 compiler environments.
- Enforce server actions boundary protection with explicit input validation schemas.Top AI Hallucination Traps Solved for Cursor
Without deterministic negative constraints, AI coding models frequently fall into common architectural failure modes:
Frequently Asked Questions: Cursor AI Agent (.mdc, .cursorrules)
Common questions about configuring rules, optimizing context token usage, and enforcing architectural invariants in Cursor.