What problem does it solve? Repeated database reads and upstream API calls waste latency and quota, and ad-hoc caching code tends to throw exceptions, hide TTL behavior, and behave differently in tests than in production. This Skill documents a cache contract where every call answers with a Result instead of throwing, with adapters that behave identically across environments. ## Core Features & Use Cases - Unified Cache Contract: One interface covers read, write, fetch, and delete, each returning a Result carrying a typed CacheError instead of throwing. - Swappable Adapters: MemoryCache runs in-process for tests while WorkerKVCache binds to a Cloudflare KV namespace in production, both passing the same Vitest conformance suite. - TTL and Failure Semantics: TTLs accept duration strings like "5 minutes", and CacheError codes (unavailable, invalid_value, load_failed) let callers distinguish a miss from an unreachable store. - Use Case: Memoize a per-request database query behind cache.fetch(post:${id}, loader, { ttl: "5 minutes" }) in a Cloudflare Worker, then swap in MemoryCache with a fake clock to test expiry without a KV namespace. ## Quick Start Add @sdxc/cache as a workspace dependency and ask the agent to wrap a repeated database query in cache.fetch with a five-minute TTL using WorkerKVCache.