Skip to content

Latest commit

 

History

History
147 lines (131 loc) · 6.06 KB

File metadata and controls

147 lines (131 loc) · 6.06 KB

CLAUDE.md

Valkey GLIDE is an official open-source client library for Valkey and Redis OSS. It uses a core driver written in Rust with language-specific wrappers for Python, Java, Node.js, and Go, and other languages in seperate repositories.

Hard Constraints (non-negotiable)

  • NO task completion without tests covering it and passing
  • NO PR creation without all subagent feedback addressed
  • NEVER assume - always verify with tests and benchmarks
  • NEVER ignore bugs, even out of scope - open an issue

Rules

Always

  • Direct and concise, no compliments or apologies
  • Ask if unsure, stop and reassess if looping
  • Fetch web resources fresh, don't rely on cached data
  • If asked to do X a certain way, do it that way. Disagree? Raise it, but don't change without approval

When Writing

  • Commit frequently with meaningful messages - git is our diary
  • Focus on one language + its core bindings. Core changes = consider all bindings
  • AI agent files: context-efficient, use XML for structured data in Markdown
  • Keep PRs small and focused, split if too large

Before Task Completion

  • Tests cover it and pass
  • Linter/formatter ran for changed languages

Before Push

  • git pull --rebase upstream main, resolve conflicts
  • Exception: if on a feature branch rebasing onto another feature branch, rebase onto that branch instead
  • Run tests for relevant scope

Before PR Creation/Update

  • Run subagents in parallel, address all feedback:
    • performance analysis
    • code quality, style, best practices
    • test coverage
    • documentation clarity
    • security vulnerabilities and edge cases

What the user cares about (all equally important):

  • Performance - low latency, high throughput
  • Reliability - robust error handling, edge cases
  • Usability - clear APIs, good documentation, best DX
  • Maintainability - clean code, modular design, tests, simplicity
  • Correctness - verify with tests and benchmarks, not assumptions

Project Structure

glide-core/     # Rust core driver - handles connection, protocol, clustering
python/         # Python client wrapper
java/           # Java client wrapper
node/           # Node.js client wrapper
go/             # Go client wrapper
ffi/            # Foreign function interface for language bindings
logger_core/    # Rust logging infrastructure
utils/          # Test utilities and cluster management scripts
benchmarks/     # Performance benchmarks
examples/       # Usage examples for each language
docs/           # Documentation

Architecture: Language Bindings to Core

Language Mechanism Native Library Communication
Python Async PyO3 valkey-glide (python/glide-async/) Unix socket IPC
Python Sync CFFI glide-ffi (ffi/) FFI calls
Java JNI glide-rs (java/) JNI calls
Go CGO glide-ffi (ffi/) FFI calls
Node.js NAPI v2 rust-client (node/rust-client/) Unix socket IPC

Socket IPC wrappers → socket_listenerglide-core → Valkey/Redis FFI wrappers → glide-core → Valkey/Redis

Context Retrieval

python async, PyO3, glide-async, socket IPC python python/glide-async/src/lib.rs core python/glide-async/Cargo.toml python/glide-async/src/lib.rs python/glide-async/python/glide/glide_client.py python/glide-shared/glide_shared/commands/ python/tests/ python sync, CFFI, glide-sync, synchronous python python/glide-sync/glide_sync/_glide_ffi.py ffi python/glide-sync/setup.py python/glide-sync/glide_sync/_glide_ffi.py python/glide-sync/glide_sync/glide_client.py python/glide-sync/glide_sync/sync_commands/ python/tests/ java, JNI, glide-rs, Java client java/src/lib.rs core java/Cargo.toml java/src/lib.rs java/client/src/main/java/glide/api/ java/client/src/main/java/glide/api/commands/ java/client/src/test/java/glide/ node, nodejs, NAPI, typescript, rust-client node node/rust-client/src/lib.rs core node/rust-client/Cargo.toml node/rust-client/src/lib.rs node/src/BaseClient.ts node/src/Commands.ts node/tests/ go, golang, CGO, go client go/base_client.go ffi go/Makefile go/callbacks.go go/base_client.go go/internal/interfaces/ go/integTest/ glide-core, rust core, socket listener, protocol, clustering glide-core/src/client/mod.rs glide-core/Cargo.toml glide-core/src/client/mod.rs glide-core/src/socket_listener.rs glide-core/src/protobuf/ glide-core/tests/ ffi, foreign function interface, C bindings, libglide ffi/src/lib.rs ffi/Cargo.toml ffi/src/lib.rs