Skip to content
Back to skills

Add Caching

ASecurity

Adds caching to a hot read path with clear keys, an expiry and invalidation on writes, after proving the path is hot.

  • 3 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added November 15, 2026
ai-agents

Security analysis

A100/100

Scanned November 15, 2026

npx -y skills add workspace-templates/ai-agent-templates --skill add-caching --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Add Caching?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Add Caching
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/workspace-templates-add-caching-ai-agent-templates/badge)](https://www.skillsdirectory.com/skills/workspace-templates-add-caching-ai-agent-templates)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: add-caching
description: Adds caching to a hot read path with clear keys, an expiry and invalidation on writes, after proving the path is hot.
disable-model-invocation: true
---

Add caching to: $ARGUMENTS

1. Read the code and its callers. Confirm it is worth caching: estimate how often it is read versus written, and how costly each call is. If it is cheap or write-heavy, say so and stop.
2. Use the cache already in the project. Do not add Redis or a new package without asking.
3. Build the key from every input that changes the result (ids, locale, filters, tenant, user role). Prefix it with a version string so a format change can invalidate everything.
4. Pick a TTL from how stale the data may be, and add jitter so many keys do not expire at once. Protect against a stampede with a lock or request coalescing when the miss is expensive.
5. Invalidate on every write path that changes the source data. List those paths explicitly.
6. Never cache errors or empty results from failures.
7. Add tests for hit, miss, expiry and invalidation, then run them.

Report the key format, TTL, invalidation points and the risk of stale reads.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.