← ClaudeAtlas

nts-add-cachelisted

Retrofit Redis caching into an existing project scaffolded with nextjs-trpc-prisma-starter. Use this when the user wants to add Redis, add a cache layer, speed up frequent reads, share cache across processes, or any 'add caching to this project' request. Adds ioredis, a docker-compose redis service, a typed cache helper at src/server/lib/cache.ts, REDIS_URL env, and updates CLAUDE.md to reflect the new dependency. Refuses to run on projects that don't have the scaffolded structure.
juncoding/nextjs-trpc-prisma-starter · ★ 0 · API & Backend · score 70
Install: claude install-skill juncoding/nextjs-trpc-prisma-starter
# Add Redis cache to an existing project For projects scaffolded with `nextjs-trpc-prisma-starter` that didn't enable cache at scaffold time and now want it. ## Use when - User says "add Redis" / "add caching" / "speed up this query" with the implication that in-process cache isn't enough. - A specific service method needs cross-process cache (multiple app containers / horizontal scaling). - User invokes `/nts-add-cache`. Do NOT use when: - The project isn't scaffolded by this plugin — the file layout assumptions won't hold. Refuse gracefully and explain. - The user wants Next.js's built-in `unstable_cache` / `cacheTag` — this plugin uses SPA mode, so those aren't relevant. ## What this skill does Modifies the existing project in place. After running: 1. `ioredis` added to `package.json` dependencies. 2. `redis` service added to `docker-compose.yml`. 3. `REDIS_URL` added to `.env.example` and `src/env.ts`. 4. New file `src/server/lib/cache.ts` with a typed `cache.get<T>()` / `cache.set()` / `cache.invalidate()` helper. 5. `CLAUDE.md` updated to mention the new cache layer. 6. Optional: a sample service method wrapped in the cache helper, so the user has a worked example. ## Confirmation flow Before writing anything, confirm: 1. Project root path (default: cwd). 2. Verify `package.json`, `CLAUDE.md`, and `docker-compose.yml` exist — refuse if they don't. 3. Show the user the list of files that will change. 4. Confirm. ## File changes ### `package.json` Add to `de