java-cachelisted
Install: claude install-skill limited-grisaille833/claude-java-plugins
# Spring Cache Skill
Detect the cache provider in use, then apply the correct patterns.
## Step 1 — Detect setup
Check `pom.xml` or `build.gradle`:
- `spring-boot-starter-data-redis` → Redis (Lettuce client by default)
- `spring-boot-starter-cache` + `caffeine` → Caffeine (in-process)
- `spring-boot-starter-cache` only → Simple (ConcurrentHashMap, dev only)
- None present → offer to add (recommend Caffeine for single-instance, Redis for multi-instance/distributed)
Check Spring Boot version:
- Boot 3.x → Lettuce 6.x, Caffeine 3.x
- Boot 2.x → Lettuce 5.x, Caffeine 2.x/3.x
---
## Mode: `review`
User asks to review existing cache configuration. Check for:
- [ ] `@EnableCaching` present on a `@Configuration` class — missing it silently disables all cache annotations
- [ ] Cache names declared in `application.yml` with explicit TTL — no unnamed or unbounded caches
- [ ] `@Cacheable` methods are on Spring-managed beans (not `private`, not called within the same class — proxy bypass)
- [ ] Cache keys are deterministic — `@Cacheable(key = "#id")` not `#root.methodName` unless intentional
- [ ] `@CacheEvict` present wherever data is mutated — missing eviction causes stale cache
- [ ] `@CachePut` used to update cache on write — not a `@CacheEvict` + re-fetch pattern
- [ ] Redis serialization configured — default JDK serialization is not readable/portable; use `GenericJackson2JsonRedisSerializer`
- [ ] Redis TTL set — without `time-to-live`, entries never expire
- [ ] Caffeine `