Provides patterns for implementing Spring Boot caching: configures Redis/Caffeine/EhCache providers with TTL and eviction policies, applies @Cacheable/@CacheEvict/@CachePut annotations, validates cache hit/miss behavior, and exposes metrics via Actuator.
SkillScore100Maintained
Automatic
◆Coding pack
Last verified 8/21/2026
What it changes
Passed 25 of 25 test cases with the skill, and 24 of 25 without it.
Without skill96%
With skill100%
Checks it passed that the model alone missed
Specify using condition = "#price > 100".
1 fixed24 passed either way0 still failing0 broke
Pass-rate lift
+4 pp
Tokens
+84%
Agent turns
0%
Response time
-22%
Model gemini-3.6-flashMeasured 8/21/2026v125 of 25 cases passed with skill
Tokens, turns and time describe resource use, not a dollar price.
See it in action
A test case the skill fixed. Same model, same prompt, with and without the skill.
Prompt
You want to cache product lookups in `getProduct(Long id, BigDecimal price)` in a Spring Boot service, but only when the incoming `price` parameter is strictly greater than 100. Which attribute on the caching annotation (`condition` or `unless`) should be used to evaluate the input argument before method execution?
What was checked, without and with the skill
Checked
Without skill
With skill
Specify using condition = "#price > 100".
Missed
Passed
case-04 · gemini-3.6-flash · 8/21/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md132 lines5 files
Spring Boot Cache Abstraction
Overview
6-step workflow for enabling cache abstraction, configuring providers (Caffeine,
Redis, Ehcache), annotating service methods, and validating behavior in
Spring Boot 3.5+ applications. Apply @Cacheable for reads, @CachePut for
writes, @CacheEvict for deletions. Configure TTL/eviction policies and expose
metrics via Actuator.
When to Use
Add @Cacheable, @CachePut, or @CacheEvict to service methods.
Configure Caffeine, Redis, or Ehcache with TTL and capacity policies.
Implement eviction strategies for stale data.
Diagnose cache misses or invalidation issues.
Expose hit/miss metrics via Actuator or Micrometer.
Instructions
Add dependencies — spring-boot-starter-cache plus a provider:
Caffeine: caffeine starter
Redis: spring-boot-starter-data-redis
Ehcache: ehcache starter
Enable caching — annotate a @Configuration class with @EnableCaching
and define a CacheManager bean.
Annotate methods — @Cacheable for reads, @CachePut for writes,
@CacheEvict for deletions.
Configure TTL/eviction — set spring.cache.caffeine.spec,
spring.cache.redis.time-to-live, or spring.cache.ehcache.config.
Shape keys — use SpEL in key attributes; guard with
condition/unless for selective caching.
Validate setup — run integration test to confirm cache hit on second
call; check GET /actuator/caches to verify cache manager registration;
query GET /actuator/metrics/cache.gets for hit/miss ratios.