HomeClientsWindsurf
.windsurfrules & Cascade Standard2791 Tailored RulesTarget: .windsurfrules

260 Verified Fullstack Standards for Windsurf & Cascade AI (.windsurfrules)

Complete architectural standards and anti-hallucination specifications for Codeium Windsurf and Cascade AI agent. Eliminate cross-file drift, synchronize dependencies, and enforce high-performance Fullstack TypeScript, Python, and Go workflows.

Flow State Protection

Keeps AI edits focused on immediate files without disrupting other modules.

Cross-File Cohesion

Guarantees shared types and exports stay synchronized across packages.

Zero Dependency Drift

Enforces consistent library choices and rejects redundant packages.

npx agentrules-cli export --client windsurf
View Config Spec
Domain Focus:Cascade Multi-File Systems & Fullstack Architecture
Showing 24 of 2791 native tailored rules for WindsurfTAILORED ALLOCATION
fastify-5-schema-compilers-encapsulation-production-standard
backendcritical

Fastify 5 Schema Compilers & Encapsulation Production Standard

Fastify relies on lexical encapsulation contexts to sandbox decorators, hooks, and compiled validation/serialization schemas without memory leaks or cross-tenant bleed. In Fastify 5, misuse of global compilers or failing to encapsulate plugin boundaries causes compiled `fast-json-stringify` serializers and Ajv validators to either crash on duplicate IDs, leak private data across sibling scopes, or bypass JIT compilation optimizations. Production services must enforce strict encapsulation hierarchies and type-safe schema compilation across every routing subtree.

Blocks:Mutating global AJV/fast-json-stringify compilers or exposing route-level decorators and hooks across sibling plugin contexts without encapsulation boundaries.
Targets:Cursor•Claude•Windsurf•Codex
solidstart-1-0-server-functions-async-boundaries-production-standard
frontendcritical

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.

Blocks:Closing over reactive client signals inside server$ RPCs or calling unvalidated server functions directly in reactive effects.
Targets:Cursor•Claude•Windsurf•Codex
astro-5-actions-content-layer-production-standard
frontendcritical

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.

Blocks:Writing legacy Astro v4 content collection configurations and unvalidated server actions that throw generic Errors instead of ActionError.
Targets:Cursor•Claude•Windsurf•Codex
nuxt-4-nitro-server-engine-shared-directory-production-standard
frontendcritical

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.

Blocks:Placing mutable module-level state in Nitro event handlers and importing server-only dependencies into client or shared directories.
Targets:Cursor•Claude•Windsurf•Codex
svelte-5-runes-reactivity
frontendcritical

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.

Blocks:AI writes deprecated $: reactive declarations or let count = 0 inside Svelte 5 components, failing to trigger the new signals-based reactivity engine.
Targets:Cursor•Claude•Windsurf•Codex
bun-sqlite-wal-concurrency
backendcritical

Bun Embedded SQLite WAL Mode & Transaction Synchronization Standard

Production database standard for bun:sqlite. Mandates enabling Write-Ahead Logging (PRAGMA journal_mode = WAL), busy timeouts, and using db.transaction() for atomic operations without lock starvation.

Blocks:AI opens bun:sqlite with default rollback journals and un-isolated batch inserts, triggering SQLITE_BUSY crashes under concurrent requests.
Targets:Cursor•Claude•Windsurf•Codex
drizzle-orm-batch-transactions
backendcritical

Drizzle ORM Batch API & Interactive Transaction Isolation Standard

Production database standard for Drizzle ORM (PostgreSQL & MySQL). Mandates using db.batch() over HTTP drivers to prevent round-trip waterfalls, explicit db.transaction() with serializable/read-committed isolation, and strictly avoids unawaited query promises.

Blocks:AI loops single insert queries over serverless HTTP DB drivers (Neon / PlanetScale), creating 20x network latency waterfalls and partial failure states.
Targets:Cursor•Claude•Windsurf•Codex
temporal-io-deterministic-workflow
backendcritical

Temporal.io Workflow Code Determinism & Side Effect Isolation Standard

Production standard for Temporal.io distributed orchestrations. Mandates strict determinism inside workflow functions, strictly prohibiting Math.random(), Date.now(), mutable global variables, or direct network/database calls outside Temporal Activities.

Blocks:AI calls Date.now() or fetch() directly inside a Temporal workflow function, causing non-deterministic replay crashes during worker upgrades.
Targets:Cursor•Claude•Windsurf•Codex
tanstack-start-router-ssr-production-standard
frontendcritical

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.

Blocks:Blocking SSR on non-critical queries and relying on untyped search params without loaderDeps
Targets:Cursor•Claude•Windsurf•Codex
react-19-action-hooks-useactionstate-production-standard
frontendcritical

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.

Blocks:Wrapping async form handlers in manual useState loading and error states instead of leveraging native React 19 Actions.
Targets:Cursor•Claude•Windsurf•Codex
next-js-15-server-actions-boundary-csrf-production-standard
frontendcritical

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.

Blocks:Treating Server Actions as private client-only functions while omitting boundary session checks and reverse-proxy origin configurations.
Targets:Cursor•Claude•Windsurf•Codex
valkey-8-0-threaded-io-cluster-failover-production-standard
backendcritical

Valkey 8.0 Threaded I/O & Cluster Failover Production Standard & Concurrency Guardrail

Valkey 8.0 introduces dual-channel multi-threaded I/O to scale network throughput while preserving single-threaded execution atomicity. Clustered deployments must strictly handle MOVED/ASK redirects and slot hashing constraints during node failovers and shard migration. Failure to enforce slot co-locality via hash tags in multi-key operations and Lua scripts causes CROSSSLOT errors and catastrophic transactional rollback failures during cluster rebalancing.

Blocks:Executing un-hashed multi-key commands and Lua scripts across disparate nodes while failing to handle cluster redirects and transient failover states.
Targets:Cursor•Claude•Windsurf•Codex
qwik-city-resumability-containerization-production-standard
frontendcritical

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.

Blocks:Capturing non-serializable runtime instances inside '$' closures or eagerly importing heavy client modules without QRL boundaries.
Targets:Cursor•Claude•Windsurf•Codex
vite-6-environment-api-multi-runtimes-production-standard
frontendcritical

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.

Blocks:Defaulting to legacy `ssrLoadModule` and accessing shared server transform caches across multi-runtime targets instead of scoped `DevEnvironment` instances.
Targets:Cursor•Claude•Windsurf•Codex
tanstack-start-router-ssr-streaming-standard
frontendcritical

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.

Blocks:Unvalidated search params with blocking SSR loaders that serialize entire component trees before initial stream flush.
Targets:Cursor•Claude•Windsurf•Codex
surrealdb-2-0-live-queries-record-links-production-standard
backendcritical

SurrealDB 2.0 Live Queries & Record Links Production Standard

SurrealDB 2.0 introduces strict RecordId types, an overhauled Rust engine, and push-based LIVE QUERY streaming over WebSockets. In production, unmanaged live queries cause persistent socket leaks and cluster memory exhaustion, while handling record links as arbitrary strings breaks transactional graph traversal and schema validation.

Blocks:Treating record IDs as raw interpolated strings and abandoning live query UUID subscriptions without deterministic teardown.
Targets:Cursor•Claude•Windsurf•Codex
duckdb-node-js-zero-copy-apache-arrow-ingest-production-standard
backendcritical

DuckDB Node.js Zero-Copy Apache Arrow Ingest & Concurrency Standard

DuckDB in Node.js requires strict adherence to zero-copy memory boundaries when streaming Arrow IPC records and executing parallel analytical queries across connection pools. Naive JSON serialization, raw ArrayBuffer copies, or concurrent queries sharing a single un-pooled Connection instance trigger V8 heap exhaustion, memory leaks, or native segfaults. Production architectures must enforce worker-safe connection pooling, explicit Arrow RecordBatch streaming via C++ IPC bindings, and strictly bounded memory limits.

Blocks:Deserializing analytical query results into native V8 JavaScript objects or executing concurrent queries on a single un-pooled DuckDB Connection handle.
Targets:Cursor•Claude•Windsurf•Codex
valkey-8-0-threaded-io-cluster-failover-guardrails
backendcritical

Valkey 8.0 Threaded I/O & Cluster Failover Production Standards

Valkey 8.0 leverages asynchronous multi-threaded I/O for socket read/write operations while preserving single-threaded execution for command mutations. In distributed cluster deployments, unhandled MOVED and ASK redirections during automatic master failovers cause cascading connection pool exhaustion and silent command drops. Furthermore, multi-key operations and Lua scripts execute atomically only when all involved keys map to the identical cluster hash slot via explicit hash tags.

Blocks:Executing cross-slot multi-key commands without hash tags while ignoring cluster failover redirects and socket pool saturation.
Targets:Cursor•Claude•Windsurf•Codex
langgraph-2026-stateful-checkpointers-human-in-the-loop-production-standard
backendcritical

LangGraph Stateful Checkpointers & Resilient Human-in-the-Loop Concurrency Guardrail

LangGraph production systems require durable checkpointers, deterministic thread scoping, and atomic human-in-the-loop (HITL) interrupt semantics to preserve workflow states across restarts and horizontal scaling. Relying on transient in-memory checkpointers or blocking asynchronous loops destroys state continuity and causes workflow deadlocks during deployments. Teams must mandate transactional state backends, native interrupt triggers, and schema-validated resumes within immutable channel reducers.

Blocks:Deploying ephemeral in-memory checkpointers in distributed environments and hijacking graph control with unpersisted manual prompts instead of native interrupt primitives.
Targets:Cursor•Claude•Windsurf•Codex
litellm-proxy-load-balancing-fallback-routing-production-standard
backendcritical

LiteLLM Proxy Load Balancing & Fallback Routing Production Standard

Production LiteLLM proxy deployments must maintain deterministic fallback topologies, bounded semantic cache lifecycles, and tenant-isolated token quota budgets across heterogeneous model providers. Without explicit circuit breaking and tier-aware load balancing, transient provider rate limits escalate into catastrophic cascading failures across upstream microservices. Reliable gateway architectures decouple client call-sites from provider-specific error formats by enforcing uniform retry budgets and distributed cache invalidation.

Blocks:Naive direct model invocations lacking circuit breakers, fallback groups, and budget bounds that crash downstream services on provider HTTP 429 bursts.
Targets:Cursor•Claude•Windsurf•Codex
tanstack-start-ssr-streaming-search-params
frontendcritical

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.

Blocks:Awaiting slow secondary data in SSR loaders and accessing raw, unvalidated search parameters.
Targets:Cursor•Claude•Windsurf•Codex
tailwind-v4-css-first-theme-directives
frontendcritical

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.

Blocks:Persisting legacy tailwind.config.js architecture and RGB-tuple opacity hacks in Tailwind CSS v4 environments
Targets:Cursor•Claude•Windsurf•Codex
hono-jsx-edge-streaming-pipeline-standard
frontendcritical

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.

Blocks:Buffering Monolithic JSX Strings into Edge Memory and Attempting Post-Flush Response Header Mutation
Targets:Cursor•Claude•Windsurf•Codex
angular-19-signals-defer-views-standard
frontendcritical

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

Blocks:Mutating internal signal state via ngOnChanges/effects and unconstrained @defer block usage causing layout shift
Targets:Cursor•Claude•Windsurf•Codex

Windsurf Native Configuration Format

Target location: ./.windsurfrules

# File: .windsurfrules
# AgentRules: Windsurf Cascade Agent Specification
 
 ## Architectural Principles
 - Maintain strict separation between presentation, domain, and data layers.
 - When editing multiple files simultaneously, preserve cross-module contracts.
 - Run workspace linter checks after each structural refactoring pass.
 
 ## Prohibited Patterns
 - Do NOT install multiple HTTP client libraries (choose Fetch or Axios consistently).
 - Forbid synchronous file I/O operations in high-throughput request paths.

Top AI Hallucination Traps Solved for Windsurf

Without deterministic negative constraints, AI coding models frequently fall into common architectural failure modes:

1Cascade agent making sweeping cross-file refactors without respecting domain module boundaries
2Injecting mismatched package versions or incompatible dependency pairs in package manifests
3Violating strict type checking invariants when generating complex TypeScript generics
4Leaving zombie background processes and unclosed connections during local server verification
5Regressing existing unit test suites when appending new features without regression checks

Frequently Asked Questions: Codeium Windsurf (.windsurfrules)

Common questions about configuring rules, optimizing context token usage, and enforcing architectural invariants in Windsurf.

Targeted Architecture Patterns & Long-Tail Scopes for Windsurf

windsurf cascade multi-file edit safety ruleshow to configure .windsurfrules for enterprise projectswindsurf vs cursor ide rule compatibility guidewindsurf typescript strict mode compiler guardrailswindsurf python async and connection pool rulescascade ai flow state architectural preservationwindsurf docker container and microservice directivescodeium windsurf clean architecture template 2026