Agent skill

Spring Data Redis

by rrezartprebreza in rrezartprebreza/spring-boot-skills

A skill your agent uses when implementing caching, session storage, rate limiting, or any Redis integration.

MITAuto-check passedBackend & APIs

Install Spring Data Redis

skills CLI
$ npx skills add rrezartprebreza/spring-boot-skills --skill spring-data-redis -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install rrezartprebreza/spring-boot-skills spring-data-redis --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/rrezartprebreza/spring-boot-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/spring-boot-3/spring-data-redis .claude/skills/spring-data-redis && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
spring-data-redis
GitHub stars
298
Token cost
~1.6k tokens
SKILL.md length
185 words
Files
5
Skills in repo
51
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when implementing caching, session storage, rate limiting, or any Redis integration.

  • Implementing caching
  • SKILL.md covers Dependencies, Configuration, Key Naming Convention and @Cacheable — Declarative Caching, plus 5 more sections
  • Runs Java scripts from its folder; needs REDIS_PASSWORD
  • Session storage

What it does

Spring Data Redis is an agent skill from rrezartprebreza/spring-boot-skills. Use when implementing caching, session storage, rate limiting, or any Redis integration. Covers cache-aside pattern, key naming, TTL strategy, and serialization config.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files (for example `agents/openai.yaml`).

It sits in Backend & APIs, covering Rate limiting, Caching and Backend development. It works with Redis and Spring Boot. The repository describes itself as: Production-grade Claude Code and Codex skills for Spring Boot developers. The licence is MIT.

When your agent uses it

  • Implementing caching
  • Session storage
  • Any Redis integration

Example prompts

  • “/spring-data-redis”

What it can do on your machine

Read from SKILL.md and the folder at commit f0c06a0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Java), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • REDIS_PASSWORD

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Spring Data Redis loads about 1.6k tokens when it runs. Until then it costs about 47 tokens; SKILL.md has 185 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~47
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from rrezartprebreza/spring-boot-skills at commit f0c06a0, republished under its MIT licence (© rrezartprebreza). 185 words, ~1,572 tokens.

Download SKILL.mdSave it as .claude/skills/spring-data-redis/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
spring-data-redis
description
Use when implementing caching, session storage, rate limiting, or any Redis integration. Covers cache-aside pattern, key naming, TTL strategy, and serialization config.

Spring Data Redis

Dependencies

xml
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-cache</artifactId>
</dependency>

Configuration

java
@Configuration
@EnableCaching
public class RedisConfig {

    @Bean
    public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory factory) {
        RedisTemplate<String, Object> template = new RedisTemplate<>();
        template.setConnectionFactory(factory);
        template.setKeySerializer(new StringRedisSerializer());
        template.setValueSerializer(new GenericJackson2JsonRedisSerializer()); // JSON, not Java serialize
        template.setHashKeySerializer(new StringRedisSerializer());
        template.setHashValueSerializer(new GenericJackson2JsonRedisSerializer());
        return template;
    }

    @Bean
    public RedisCacheManager cacheManager(RedisConnectionFactory factory) {
        RedisCacheConfiguration config = RedisCacheConfiguration.defaultCacheConfig()
            .entryTtl(Duration.ofMinutes(10))
            .serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(new StringRedisSerializer()))
            .serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(new GenericJackson2JsonRedisSerializer()))
            .disableCachingNullValues();

        return RedisCacheManager.builder(factory)
            .cacheDefaults(config)
            .withCacheConfiguration("orders", config.entryTtl(Duration.ofMinutes(5)))
            .withCacheConfiguration("products", config.entryTtl(Duration.ofHours(1)))
            .build();
    }
}

Key Naming Convention

{app}:{domain}:{id}          → orders:order:uuid-here
{app}:{domain}:list:{filter} → orders:order:list:status:PENDING
{app}:session:{userId}       → orders:session:uuid-here
{app}:ratelimit:{ip}         → orders:ratelimit:192.168.1.1

@Cacheable — Declarative Caching

java
@Service
@RequiredArgsConstructor
public class ProductService {

    @Cacheable(value = "products", key = "#id")
    public ProductResponse findById(UUID id) {
        return productRepository.findById(id)
            .map(ProductResponse::from)
            .orElseThrow(() -> new EntityNotFoundException("Product not found: " + id));
    }

    @CachePut(value = "products", key = "#result.id")  // update cache after write
    @Transactional
    public ProductResponse update(UUID id, UpdateProductRequest request) {
        Product product = productRepository.findById(id).orElseThrow();
        product.update(request);
        return ProductResponse.from(productRepository.save(product));
    }

    @CacheEvict(value = "products", key = "#id")  // invalidate on delete
    @Transactional
    public void delete(UUID id) {
        productRepository.deleteById(id);
    }

    @CacheEvict(value = "products", allEntries = true)  // clear all
    public void clearCache() {}
}

Manual Cache-Aside Pattern

java
@Service
@RequiredArgsConstructor
public class OrderCacheService {

    private final RedisTemplate<String, Object> redisTemplate;
    private final ObjectMapper objectMapper;
    private static final Duration TTL = Duration.ofMinutes(5);

    public Optional<OrderResponse> get(UUID orderId) {
        String key = "orders:order:" + orderId;
        Object cached = redisTemplate.opsForValue().get(key);
        if (cached == null) return Optional.empty();
        return Optional.of(objectMapper.convertValue(cached, OrderResponse.class));
    }

    public void put(OrderResponse order) {
        String key = "orders:order:" + order.id();
        redisTemplate.opsForValue().set(key, order, TTL);
    }

    public void evict(UUID orderId) {
        redisTemplate.delete("orders:order:" + orderId);
    }
}

Rate Limiting with Redis

java
@Component
@RequiredArgsConstructor
public class RateLimiter {

    private final RedisTemplate<String, String> redisTemplate;

    public boolean isAllowed(String identifier, int maxRequests, Duration window) {
        String key = "ratelimit:" + identifier;
        Long count = redisTemplate.opsForValue().increment(key);
        if (count == 1) {
            redisTemplate.expire(key, window);
        }
        return count <= maxRequests;
    }
}

application.yml

yaml
spring:
  data:
    redis:
      host: ${REDIS_HOST:localhost}
      port: ${REDIS_PORT:6379}
      password: ${REDIS_PASSWORD:}
      timeout: 2000ms
      lettuce:
        pool:
          max-active: 10
          max-idle: 5
          min-idle: 2
  cache:
    type: redis

Cache Stampede

When a hot key expires, every concurrent request misses at once and they all hammer the DB to recompute the same value (the "thundering herd"). For expensive, high-traffic loads, let one caller compute while the rest wait:

java
// sync = true — only one thread computes the value; others block on it
@Cacheable(value = "products", key = "#id", sync = true)
public ProductResponse findById(UUID id) { ... }

sync = true serializes recomputation per key within a single instance. For a fleet-wide guarantee, add a short Redis lock (SETNX with a TTL) around the recompute. Pair with jittered TTLs so a batch of keys written together doesn't all expire on the same second.

Gotchas

  • Agent uses Java serialization for values — always use JSON (GenericJackson2JsonRedisSerializer)
  • Agent caches entities with JPA lazy fields — cache DTOs/response objects, not entities
  • Agent uses no TTL — always set expiry, memory is not infinite
  • Agent forgets @EnableCaching — @Cacheable silently does nothing without it
  • Agent caches null values — use .disableCachingNullValues() to avoid storing misses
  • Agent leaves hot keys unprotected — use @Cacheable(sync = true) to prevent stampede on expiry
  • Agent gives every entry the same TTL — add jitter so keys don't expire in a synchronized wave

© rrezartprebreza, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files in skills/spring-boot-3/spring-data-redis of rrezartprebreza/spring-boot-skills.

  • SKILL.md
  • agents/openai.yaml
  • examples/bad-cache-service.java
  • examples/good-cache-service.java
  • templates/RedisConfig.java

Open the folder on GitHubat commit f0c06a0

Compare with similar skills

Spring Data Redis next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Spring Data Redis compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Spring Data Redis this skillrrezartprebreza/spring-boot-skills298—~1.6kAutomated safety check: PassMIT
Spring Boot Cachegiuseppe-trisciuoglio/developer-kit356—~1.4kAutomated safety check: NotesMIT
FastAPI-Redis SDK Developmentredis/fastapi-redis-sdk404—~2.5kAutomated safety check: NotesMIT
Redis Patternsaffaan-m/ECC276k1 repos~3kAutomated safety check: PassMIT
Amazon Elasticacheaws/agent-toolkit-for-aws2.8k—~4.5kAutomated safety check: PassApache-2.0
Redis Cachingcohen-liel/hivemind110—~873Automated safety check: PassApache-2.0

Similar skills

  • Spring Boot Cache

    giuseppe-trisciuoglio/developer-kit

    Provides patterns for implementing Spring Boot caching: configures Redis/Caffeine/EhCache providers with TTL and eviction policies, applies @Cacheable/@CacheEvict/@CachePut annotations, validates…

    356 GitHub stars~1.4k tokensUpdated 29 days ago
    Backend & APIsAuto-check: notes
  • FastAPI-Redis SDK Development

    redis/fastapi-redis-sdk

    Official

    Guides development on the fastapi-redis-sdk library itself - its connection lifecycle, dependency-injected caching, and async/sync bridging.

    404 GitHub stars~2.5k tokensUpdated 8 days ago
    Backend & APIsAuto-check: notes
  • Redis Patterns

    affaan-m/ECC

    Redis data structure patterns, caching strategies, distributed locks, rate limiting, pub/sub, and connection management for production applications.

    276k GitHub starsUsed in 1 repo~3k tokens
    Backend & APIsAuto-check passed
  • Amazon Elasticache

    aws/agent-toolkit-for-aws

    Official

    Activate when developers have latent caching needs: slow API responses, database read bottlenecks, DynamoDB throttling or cost, RDS/Aurora scaling pressure, Bedrock latency or cost, or adding a…

    2.8k GitHub stars~4.5k tokensUpdated today
    Backend & APIsAuto-check passed
  • Redis Caching

    cohen-liel/hivemind

    Redis caching and queue patterns. An agent skill from cohen-liel/hivemind.

    110 GitHub stars~873 tokensUpdated 5 mo ago
    Backend & APIsAuto-check passed
  • Redis

    kid-sid/claude-spellbook

    A skill your agent uses when choosing a Redis data structure for a use case, implementing caching or rate limiting, building pub/sub or Streams-based real-time messaging, or writing atomic…

    190 GitHub stars~4.4k tokensUpdated 2 mo ago
    Backend & APIsAuto-check passed

More from rrezartprebreza/spring-boot-skills

All 51 skills in this repo
  • AI Observability

    rrezartprebreza/spring-boot-skills

    A skill your agent uses when adding Spring AI-specific model observations, token usage, latency, externally configured cost attribution, advisor telemetry, or protected prompt and completion logging.

    298 GitHub stars~1.6k tokensUpdated 18 days ago
    Auto-check passed
  • API Versioning

    rrezartprebreza/spring-boot-skills

    A skill your agent uses when versioning Spring MVC or WebFlux APIs in Spring Boot 3 / Spring Framework 6.

    298 GitHub stars~516 tokensUpdated 18 days ago
    Auto-check passed
  • API Versioning

    rrezartprebreza/spring-boot-skills

    A skill your agent uses when versioning Spring MVC or WebFlux APIs in Spring Boot 4 / Spring Framework 7.

    298 GitHub stars~643 tokensUpdated 18 days ago
    Auto-check passed
  • Container Native Deployment

    rrezartprebreza/spring-boot-skills

    A skill your agent uses when packaging a Spring Boot 3 application as an OCI image or GraalVM native executable.

    298 GitHub stars~781 tokensUpdated 18 days ago
    Auto-check passed
  • Container Native Deployment

    rrezartprebreza/spring-boot-skills

    A skill your agent uses when packaging Spring Boot 4 as an OCI image, JVM container, AOT application, or GraalVM native executable.

    298 GitHub stars~706 tokensUpdated 18 days ago
    Auto-check passed
  • Domain Driven Design

    rrezartprebreza/spring-boot-skills

    A skill your agent uses when evolving aggregate invariants, value objects or domain events in an existing DDD-style Spring Boot 3 application, or when DDD is explicitly requested.

    298 GitHub stars~2.1k tokensUpdated 18 days ago
    Auto-check passed

Questions about Spring Data Redis

What does Spring Data Redis do?

A skill your agent uses when implementing caching, session storage, rate limiting, or any Redis integration. Spring Data Redis is an agent skill from rrezartprebreza/spring-boot-skills. Use when implementing caching, session storage, rate limiting, or any Redis integration.

When should I use Spring Data Redis?

Spring Data Redis fits situations like: implementing caching; session storage; any Redis integration.

How do I install Spring Data Redis in Claude Code?

Run `npx skills add rrezartprebreza/spring-boot-skills --skill spring-data-redis -a claude-code`. Or copy the skill folder (skills/spring-boot-3/spring-data-redis in rrezartprebreza/spring-boot-skills) into .claude/skills/spring-data-redis in your project. Claude Code loads it when a task matches its description.

How do I install Spring Data Redis in Codex?

Run `npx skills add rrezartprebreza/spring-boot-skills --skill spring-data-redis -a codex`. Or copy the skill folder (skills/spring-boot-3/spring-data-redis in rrezartprebreza/spring-boot-skills) into .agents/skills/spring-data-redis in your project. Codex loads it when a task matches its description.

Can I use Spring Data Redis in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add rrezartprebreza/spring-boot-skills --skill spring-data-redis -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/spring-data-redis, .gemini/skills/spring-data-redis, .github/skills/spring-data-redis and .opencode/skills/spring-data-redis in your project.

What does Spring Data Redis need to run?

Going by SKILL.md and its folder, Spring Data Redis needs Java for the scripts in its folder and credentials named REDIS_PASSWORD.

Does Spring Data Redis access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Spring Data Redis safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Spring Data Redis use?

Spring Data Redis is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Spring Data Redis use?

About 1.6k tokens (SKILL.md is roughly 6.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Spring Data Redis?

Skills that share tags, products or a category with Spring Data Redis: Spring Boot Cache (giuseppe-trisciuoglio/developer-kit, 356 stars), FastAPI-Redis SDK Development (redis/fastapi-redis-sdk, 404 stars), Redis Patterns (affaan-m/ECC, 276k stars) and Amazon Elasticache (aws/agent-toolkit-for-aws, 2.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Spring Data Redis?

rrezartprebreza (a GitHub user) maintains it in rrezartprebreza/spring-boot-skills, which has 298 GitHub stars. The repository holds 51 skills in this directory. The repository was last updated on September 21, 2026.

Source: rrezartprebreza/spring-boot-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.