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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Valkey 8.0 Multi-Threaded I/O, Cluster Slot Pinning, and Failover Resilience
Enforces deterministic cluster hash tagging for multi-key atomic operations and Lua scripts to prevent CROSSSLOT execution failures in Valkey 8.0. Mandates dynamic cluster topology discovery, backpressure-aware connection pooling for threaded I/O, and automated retry mechanisms for MOVED and ASK redirects during cluster failovers.
Bun 1.2 SQLite WAL Concurrency & Native S3 Streaming Invariant
Enforces strict concurrency and zero-copy data flow standards for Bun 1.2 applications using native bun:sqlite and Bun.s3. Forbids executing asynchronous network I/O or S3 streaming within synchronous SQLite WAL transaction boundaries, mandates optimal WAL pragmas, and enforces end-to-end memory-efficient streaming.
Axum 0.8 Type-Safe State Extractors & Tower Service Composition
Enforces strict type safety and architectural invariants for Axum 0.8 applications using Router::with_state, sub-state derivation via FromRef, and Tower middleware composition. Prohibits untyped Extension state sharing and unhandled extractor rejections that trigger server panics or unformatted 500 responses.
Valkey 8.0 Threaded I/O, Cluster Routing, and Script Atomicity Guardrails
Enforces strict cluster-topology handling, deterministic hash-tag slot affinity for transactional scripts, and resilient backoff redirection protocols for Valkey 8.0 multi-threaded deployments. Prevents CROSSSLOT evaluation exceptions, slot discovery thundering herds during failovers, and socket contention during threaded I/O execution.
Bun 1.2 Native SQLite WAL Concurrency & S3 Direct-Stream Pipeline Invariants
Enforces strict production invariants for Bun 1.2 embedded database and object storage operations. Mandates WAL-mode PRAGMA concurrency configuration, prepared statement lifecycle reuse in 'bun:sqlite', and zero-copy S3 streaming via 'Bun.s3' to prevent node heap buffer exhaustion.
Go Chi v5 Deterministic Middleware Hierarchy & Signal-Driven Graceful Shutdown
Enforces strict middleware sequencing, hierarchical sub-router boundary isolation, context-propagated timeout cancellation, and zero-downtime signal-driven HTTP server shutdown in Go Chi v5 services. Eliminates dropped in-flight requests during rolling deployments, unmanaged goroutine leaks, and middleware duplication across mounted subtrees.
Valkey 8.0 Multi-Threaded I/O, Cluster Slot Redirects, and Hash-Tag Script Atomicity
Enforces strict hash-tag slot pinning for atomic multi-key Lua/Functions and resilient MOVED/ASK cluster redirection handling in Valkey 8.0. Prevents CROSSSLOT runtime exceptions, connection thrashing during automated failovers, and false concurrency assumptions under multi-threaded I/O.
Bun 1.2 Embedded SQLite WAL & S3 Native Zero-Copy Streaming Invariants
Enforces deterministic concurrency control and high-throughput zero-copy streaming when combining Bun 1.2's native bun:sqlite engine with Bun.s3 storage. Mandates WAL journal mode with synchronous normal settings, prepared statement reuse, and direct stream piping between SQLite BLOB reads/writes and native S3 multipart operations without intermediate in-memory buffering. Eliminates event loop blocking, file lock deadlocks, and Node.js wrapper overhead.
Axum 0.8 Type-Safe State Composition and Tower Service Invariants
Enforces strict type safety and panic resilience across Axum 0.8 State extractors and Tower middleware stacks. Mandates compile-time substate extraction via FromRef, prevents router state decoupling panics, and guarantees zero unhandled rejection panics through CatchPanic layers and custom IntoResponse error boundaries.
Valkey 8.0 Cluster Hash Tagging, Redirection Handling, and Non-Blocking Scripting
Valkey 8.0 multi-threaded I/O parallelizes socket read/write processing across I/O threads but maintains single-threaded execution semantics for data mutability and cluster slot routing across nodes (slots 0-16383). Developers must enforce explicit hash tagging for multi-key atomicity, strictly declare all keys in Lua or Function execution to prevent cross-slot deadlocks, and implement resilient MOVED and ASK redirection handlers with slot cache invalidation during cluster failover.
Valkey 8.0 Threaded I/O Configuration, Cluster Failover, and Lua Slot Invariants
Enforces strict cluster routing, hash-tag slot alignment, and resilient connection pooling under Valkey 8.0 multi-threaded I/O architectures. Guarantees atomic Lua script execution across cluster shards while preventing unhandled MOVED/ASK redirect storms and failover split-brain writes.
Bun 1.2 Embedded SQLite WAL & S3 Native Zero-Copy Streaming Invariants
Enforces high-throughput architectural patterns using Bun 1.2 native bun:sqlite and Bun.s3. Mandates strict WAL mode configuration with synchronous NORMAL pragmas, zero-copy buffer queries, and streaming multipart uploads directly via Bun.s3 client to prevent event loop starvation and heap bloat.
Valkey 8.0 Cluster Hash Tagging, Redirection & Failover Invariants
Valkey 8.0 leverages multi-threaded I/O for socket processing while enforcing single-threaded command determinism across 16,384 cluster slots. Distributed systems targeting Valkey Cluster MUST enforce hash tagging for multi-key operations and Lua scripts to prevent CROSSSLOT errors, and MUST handle MOVED/ASK redirections with managed topology refreshes during master failover.
Axum 0.8 Type-Safe State Extractors & Tower Middleware Invariants
Enforces Axum 0.8 compile-time type-safe state access via FromRef sub-states rather than fallible dynamic Extension extractors. Mandates defensive Tower middleware ordering with CatchPanicLayer and structured custom rejection handlers to ensure zero unhandled panics or degraded error telemetry.
Claude Code Native Configuration Format
Target location: ./CLAUDE.md
# AgentRules: Industrial Architecture Guidelines for Claude Code ## Verification Commands - Build: `npm run build` or `pnpm build` - Test: `npm test -- --run` or `pytest tests/ -v` - AST Gate: `node scripts/pipeline/validate_and_compile.js` ## Core Engineering Invariants 1. Read existing repository patterns before proposing new abstractions. 2. Never revert uncommitted user modifications or wipe unrelated git state. 3. Always run automated verification commands before concluding any task turn. 4. Keep code changes tightly scoped to the specific user issue.
Top AI Hallucination Traps Solved for Claude Code
Without deterministic negative constraints, AI coding models frequently fall into common architectural failure modes:
Frequently Asked Questions: Claude Code CLI (CLAUDE.md)
Common questions about configuring rules, optimizing context token usage, and enforcing architectural invariants in Claude Code.