unit-test-caching

unit-test-caching is a skill for Claude Code from giuseppe-trisciuoglio/developer-kit. It costs 88 tokens per session (2,791 once invoked), scanned A, original, MIT.

Testing guidance for Spring's caching annotations: @Cacheable, @CachePut, and @CacheEvict. It checks cache reads, updates, removals, keys, and conditional rules without requiring Redis or a full Spring application.

In plain words
What is it for?
Use it to test cached service methods, cache key expressions, eviction behavior, conditional caching, and repository call counts.
Why use it?
It helps catch incorrect cache hits, misses, invalidation, updates, and key generation before they cause stale data or unnecessary database calls.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the developer-kit-java plugin — 52 skills, 11 commands, 9 agents shipped together

Good fit Use it to test cached service methods, cache key expressions, eviction behavior, conditional caching, and repository call counts.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/giuseppe-trisciuoglio/developer-kit/unit-test-caching
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add giuseppe-trisciuoglio/developer-kit --skill unit-test-caching
Clone the repo
git clone --depth 1 https://github.com/giuseppe-trisciuoglio/developer-kit

Made for: Claude Code.

Or install developer-kit-java, the plugin that ships this one along with the rest of its 52 skills, 11 commands, 9 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for unit-test-caching

README.md
[![agentmods](https://agentmods.dev/badge/skills/giuseppe-trisciuoglio/developer-kit/unit-test-caching/github.svg)](https://agentmods.dev/skills/giuseppe-trisciuoglio/developer-kit/unit-test-caching)
Your own site
<a href="https://agentmods.dev/skills/giuseppe-trisciuoglio/developer-kit/unit-test-caching"><img src="https://agentmods.dev/badge/skills/giuseppe-trisciuoglio/developer-kit/unit-test-caching/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for unit-test-caching

Your own site · 80×15
<a href="https://agentmods.dev/skills/giuseppe-trisciuoglio/developer-kit/unit-test-caching"><img src="https://agentmods.dev/badge/skills/giuseppe-trisciuoglio/developer-kit/unit-test-caching.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 88 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,791 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 1 Apr 2026
  • Snyk pass 1 Apr 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00088 $0.02791
Opus 5 $0.00044 $0.01396
Sonnet 5 $0.00018 $0.00558
Haiku 4.5 $0.00009 $0.00279

Measured yesterday against content hash 33ca396c7031, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

unit-test-caching scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/developer-kit-java/skills/unit-test-caching/SKILL.md · 361 lines

How it starts

The opening of the file, as written. The whole thing — 361 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Unit Testing Spring Caching

Overview

This skill provides patterns for unit testing Spring caching annotations (@Cacheable, @CacheEvict, @CachePut) without full Spring context. It covers cache hits/misses, invalidation, key generation, and conditional caching using in-memory ConcurrentMapCacheManager.

When to Use

  • Writing unit tests for @Cacheable method behavior
  • Verifying @CacheEvict cache invalidation works correctly
  • Testing @CachePut cache updates
  • Validating cache key generation from SpEL expressions
  • Testing conditional caching with unless/condition parameters
  • Mocking cache managers in fast unit tests without Redis

Instructions

  1. Configure in-memory CacheManager: Use ConcurrentMapCacheManager for tests
  2. Set up test fixtures: Mock repository and create service instance in @BeforeEach
  3. Verify repository call counts: Use times(n) assertions to confirm cache behavior
  4. Test cache hit: Call method twice, verify repository called once
  5. Test cache miss: Verify repository called on each invocation
  6. Test eviction: After @CacheEvict, verify repository called again on next read
  7. Test key generation: Verify compound keys from SpEL expressions
  8. Validate conditional caching: Test unless (null results) and condition (parameter-based)

Validation checkpoints:

  • Run test → If cache not working: verify @EnableCaching annotation present
  • If proxy issues: ensure method calls go through Spring proxy (no direct this calls)
  • If key mismatches: log actual cache key and compare with @Cacheable(key="...") expression

Examples

Maven

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-test</artifactId>
  <scope>test</scope>
</dependency>

Gradle

dependencies {
  implementation("org.springframework.boot:spring-boot-starter-cache")
  testImplementation("org.springframework.boot:spring-boot-starter-test")
}

Read the full file on GitHub · 361 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 361 lines · 88 tokens per session scan A 33ca396c7031

Subscribe to this mod's changes

unit-test-caching is a skill published in the GitHub repository giuseppe-trisciuoglio/developer-kit (344 stars, last pushed yesterday), licensed MIT. It adds 88 tokens to every session and 2,791 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-10.

Related

Other skills, from other repositories

architecture-patterns

Architecture validation and patterns for clean architecture, backend structure enforcement, project structure validation, test standards, and context-aware sizing. Use when designing system boundaries, enforcing layered architecture, validating project structure, defining test standards, or choosing the right…

yonatangross/orchestkit · 56 tokens

rust-development

Idiomatisk Rust-utvikling med cargo, clippy, error handling, async/tokio, unsafe og testing.

navikt/copilot · 27 tokens

loom-test-strategy

Test strategy guidance covering pyramid design, coverage, test categorization, flaky tests, infrastructure, and risk-based prioritization.

cosmix/loom · 29 tokens

loom-testing

Test implementation across unit, integration, e2e, security, infrastructure, data pipeline, and ML domains.

cosmix/loom · 25 tokens

zunit

Generate and run zunit tests for java-cli-app projects. Use when asked to create tests, write tests, add tests, or generate test files for a java-cli-app project. Triggers on "zunit", "write tests", "create tests", "add tests", "test this", "generate tests", or requests to test a java-cli-app application. Also trigger…

AdamBien/airails · 111 tokens

continuous-testing

Continuous test-driven development loop — after every code change, builds the project, starts the server, and runs Unit Tests, Integration Tests, and System Tests. Applies on top of microprofile-server skill. Use during development when you want full verification after each change. Triggers on "continuous testing"…

AdamBien/airails · 84 tokens