Adds caching at the right layer (in-process, distributed, two-level, or HTTP/output) with correct keys, expiration, stampede protection, and invalidation. Detects stack and existing cache usage across .NET, Node, Python, Java/Kotlin, and Go.
Ships in AI for Developers Toolkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Add caching at the right layer with the parts people forget: sane keys, expiration policy, stampede protection, and an invalidation plan.
Works on a target: a file, folder, project/repo, or GitHub URL. Find hot reads worth caching (repeated queries, expensive computations, slow downstream calls) and any existing cache usage. Report what you found before adding anything.
| Manifest | Look for | Grep |
|---|---|---|
*.csproj | Microsoft.Extensions.Caching.*, StackExchange.Redis, ZiggyCreatures.FusionCache | IMemoryCache|IDistributedCache|HybridCache|OutputCache |
package.json | lru-cache, keyv, cache-manager, ioredis, redis | new LRUCache|createClient|new Redis|cache.get |
pyproject.toml, requirements*.txt | cachetools, redis, aiocache, django | lru_cache|@cache|TTLCache|redis\.|cache\.get |
pom.xml, build.gradle(.kts) | spring-boot-starter-cache, caffeine, spring-boot-starter-data-redis | @Cacheable|@CacheEvict|Caffeine\.newBuilder |
go.mod | ristretto, groupcache, golang.org/x/sync/singleflight, go-redis | ristretto|singleflight|redis.NewClient |
Also establish: single instance or many (drives in-process vs distributed), how stale data may be, and what writes change the cached data.
Cache-Control + ETag. Often the biggest win for public GETs.v2:product:{id}:{culture}). Missing an input = serving the wrong data.serialization-optimizer).HybridCache (.NET 9+) - L1 memory + optional L2 IDistributedCache, built-in stampede protection, tag-based eviction (RemoveByTagAsync). Prefer it where available:builder.Services.AddHybridCache();
// optional L2: builder.Services.AddStackExchangeRedisCache(o => o.Configuration = redisConn);
public class ProductService(HybridCache cache, IProductRepo repo)
{
public ValueTask<Product> GetAsync(int id, CancellationToken ct) =>
cache.GetOrCreateAsync($"product:{id}",
factory: async c => await repo.GetAsync(id, c),
options: new() { Expiration = TimeSpan.FromMinutes(10), LocalCacheExpiration = TimeSpan.FromMinutes(2) },
tags: ["products"],
cancellationToken: ct);
public ValueTask InvalidateAsync(int id, CancellationToken ct) => cache.RemoveAsync($"product:{id}", ct);
}
IMemoryCache - single instance; GetOrCreateAsync does not prevent stampedes - add a per-key SemaphoreSlim or use LazyCache / FusionCache. Set SizeLimit + entry Size to bound memory.IDistributedCache (Redis) - shared, but byte-array API with no stampede protection; wrap it or use HybridCache on top.AddOutputCache() + .CacheOutput(...) on endpoints, with tags and EvictByTagAsync on writes.lru-cache with max and ttl (and fetchMethod for async loading with built-in in-flight dedup). Avoid an unbounded Map.ioredis or redis (node-redis); keyv or cache-manager for a store-agnostic API. Use SET key value EX ttl; batch with MGET/pipelines.Map<string, Promise<T>> of in-flight loads so concurrent misses await the same promise; delete it in finally.Cache-Control/ETag headers (Express/Fastify), or a CDN in front.functools.lru_cache / functools.cache - pure, sync functions only, unbounded with cache, no TTL; never decorate an async def (it caches the coroutine object, which can be awaited only once).cachetools.TTLCache(maxsize, ttl) with @cached(cache, lock=threading.Lock()) for TTL + bounds; cachetools has no async support - use aiocache or a small dict-of-futures for asyncio.redis-py (redis.asyncio for async) with set(key, value, ex=ttl).django.core.cache with Redis backend), cache.get_or_set, @cache_page for views; delete keys in post_save/post_delete handlers or after the write.@EnableCaching, @Cacheable("products"), @CachePut, @CacheEvict (on the write path), backed by Caffeine (in-process: maximumSize, expireAfterWrite, refreshAfterWrite) or Redis (RedisCacheManager with per-cache TTLs).cache.get(key, loader) computes once per key per node; @Cacheable(sync = true) gets the same behavior through the abstraction.@Cacheable on a method called from the same class bypasses the proxy and never caches.key = "#id + ':' + #locale") when the default key misses an input.ristretto (bounded by cost, high hit ratio, TTL via SetWithTTL); hashicorp/golang-lru for simple LRU.golang.org/x/sync/singleflight (group.Do(key, fn)) around the loader.go-redis with Set(ctx, key, val, ttl); groupcache for a peer-to-peer, fill-once cache (no TTL or explicit invalidation by design - fits immutable data).## Summary
<stack + current cache usage; what is worth caching and at which layer>
## Cache plan
| Data | Layer | Key | TTL | Invalidation | Stampede protection |
|---|---|---|---|---|---|
## Code
<setup + cached read path + invalidation on write, in the project's idiom>
## Verify on your side
- <hit-rate metric, memory bound, Redis-down behavior, staleness acceptance>
"Cache this expensive query", "add Redis caching to this Node service", "use HybridCache here", "add @Cacheable with Caffeine and evict on update", "I'm getting a cache stampede on expiry - fix it", "how do I invalidate this cache on update". Pairs with serialization-optimizer and orm-query-optimizer.
What SKILL.md sets; muted values are Claude Code's defaults
45 skills in this plugin
/api-endpoint-scaffolderScaffold HTTP API endpoints in any stack - ASP.NET Core Minimal APIs or controllers, Express, Fastify, NestJS, FastAPI, Django REST Framework, Spring Boot controllers, Go net/http, chi, Gin - one feature per endpoint (REPR style) with request validation, typed responses, route grouping, auth, and OpenAPI metadata. Use this skill whenever the user wants to add an endpoint or route, convert controllers to minimal APIs, structure routes or routers, set up endpoint groups, TypedResults, route handlers, request DTOs/schemas (zod, Pydantic, Bean Validation, binding tags), or asks "how do I add an endpoint / structure my API routes". Always use this skill for endpoint scaffolding; it generates a complete, validated endpoint that matches the project's conventions./architecture-test-generatorGenerate architecture tests / fitness functions that fail the build when architectural rules are violated - layer dependencies, module boundaries, cycles, naming, and visibility conventions - in any stack: NetArchTest or ArchUnitNET (.NET), ArchUnit or Konsist (Java/Kotlin), dependency-cruiser or eslint-plugin-boundaries (TypeScript/JavaScript), import-linter (Python), go-arch-lint or depguard (Go). Use this skill whenever the user wants architecture tests, to enforce layering or the dependency rule, dependency rules as tests, import rules, forbidden imports, no circular dependencies, naming conventions, fitness functions, or asks "how do I stop people breaking the architecture / enforce my layers / keep modules from importing each other". Always use this skill for architecture-test requests; it generates rules matching the project's real structure./async-await-auditorAudit async and concurrent code in any language for correctness and performance bugs - C#/.NET (async/await, Task), JavaScript/TypeScript (Promises, async/await), Python (asyncio), Java/Kotlin (CompletableFuture, virtual threads, coroutines), Go (goroutines, channels, context), Rust (tokio/async). Use this skill whenever the user shares async or concurrent code, or asks about deadlocks, hangs, blocking calls, .Result/.Wait(), async void, ConfigureAwait, floating or unhandled promises, await in a loop vs Promise.all, blocking the event loop, forgotten await, asyncio.gather/TaskGroup, CompletableFuture.join, virtual thread pinning, goroutine leaks, context cancellation, WaitGroup/errgroup, holding a lock across .await, fire-and-forget tasks, cancellation tokens, or "why does my async code hang". Always use this skill for async/concurrency reviews instead of answering from memory; it applies a fixed checklist and rewrites the code./authorization-setupDesign API authorization in any stack - policy-based, role-based, claims/permission-based, and resource-based (ownership) checks. Covers ASP.NET Core policies and AuthorizationHandler, NestJS guards, Express middleware and CASL, FastAPI dependencies/scopes, Django and DRF permission classes, Spring Security (@PreAuthorize, SecurityFilterChain), Go middleware, and Casbin/OPA. Use this skill whenever the user wants authorization policies, role/claim/permission checks, RBAC/ABAC, custom authorization rules, resource-based authorization, IDOR protection, "deny by default", or asks "how do I authorize this / policy vs role / restrict this endpoint to X / stop users seeing other users' data". Always use this skill for authorization requests; it generates policies, handlers, and endpoint wiring./benchmark-setupSet up correct micro-benchmarks in any stack and interpret the results - BenchmarkDotNet (.NET), JMH (Java/Kotlin), pytest-benchmark / pyperf (Python), Vitest bench / tinybench / mitata (JavaScript/TypeScript), Go testing.B + benchstat, Rust criterion. Use this skill whenever the user wants to benchmark code, measure performance, compare two implementations or functions, set up a benchmark harness, or asks "which is faster", "benchmark these two functions", "how do I benchmark this", "is this optimization worth it", or "interpret these benchmark results". Always use this skill for micro-benchmarking requests; it writes correct benchmarks, avoids the classic pitfalls, and explains the numbers./cicd-pipeline-generatorGenerate a CI/CD pipeline for an app in any stack - GitHub Actions (primary), Azure DevOps, or GitLab CI - with per-stack install/build/test/coverage, dependency caching, lint, vulnerability scan, container build and push, and environment-gated deploy. Covers .NET, Node/TypeScript (npm/pnpm/yarn), Python (pip/uv/poetry), Java/Kotlin (Maven/Gradle), Go, and monorepos with several stacks. Use this skill whenever the user wants a CI/CD pipeline, a GitHub Actions workflow, Azure DevOps YAML, .gitlab-ci.yml, build/test automation, a release or deploy pipeline, caching to speed up CI, or asks "how do I set up CI / pipeline for my app / automate build and deploy / why is my CI slow". Always use this skill for CI/CD requests; it generates a complete, sensible pipeline./ai-dev-toolkit:caching-strategy-setupfrom AI for Developers Toolkit
npx claudepluginhub stefanthecode/ai-for-developers --plugin ai-dev-toolkitOther plugins' skills for the same job