Skip to content
Back to skills

Cache Correctness

ASecurity

Add or repair caching with explicit key scope, staleness bounds, invalidation races, and safe failure behavior.

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 13, 2026
ai-agentsgit

Security analysis

A100/100

Scanned October 13, 2026

npx -y skills add sujith011/agentic-pro-skills --skill cache-correctness --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cache Correctness?

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

Security grade badge for Cache Correctness
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/sujith011-cache-correctness/badge)](https://www.skillsdirectory.com/skills/sujith011-cache-correctness)

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: cache-correctness
description: "Add or repair caching with explicit key scope, staleness bounds, invalidation races, and safe failure behavior."
---

# Cache Correctness

## Process
1. Establish the authoritative source, cacheable data, tolerated staleness, and reason for caching. Decide what happens on a miss, outage, and corrupt entry.
2. Include every result-affecting dimension in the key: tenant, user/permission scope when relevant, parameters, locale, and schema version. Do not cache private data under a shared public key.
3. Define TTL, size/eviction policy, invalidation trigger, and negative-cache behavior. Bound cached absence so newly created resources can become visible.
4. Trace read/write interleavings. A reader may load old data before a write and repopulate the cache after invalidation. Use version checks, appropriate serialization, or an explicitly accepted staleness window.
5. Bound stampede protection and fallback load. A distributed lock needs ownership-safe release and expiry semantics; it is not a substitute for a durable business constraint.
6. Test cold/warm reads, updates, permission changes, parallel misses, and cache unavailability.

## Example
A tenant invoice summary uses a tenant-scoped key and a bounded TTL. A revoked user cannot retrieve a cached authorized response; authorization is checked before serving it.

## Stop conditions
Do not cache to hide an unexplained query bottleneck. Do not expose a cache service or clear unrelated production keys during a local implementation task.

## Evidence
- Key shape and staleness/invalidation contract.
- Race, isolation, and outage checks.
- Hit rate, latency, and fallback load under the tested workload.

## Reference
Workflow independently written after reviewing [redis](https://github.com/sickn33/agentic-awesome-skills/blob/cb30121a2dfd007531bd2fbefb56f68de927da6a/skills/redis/SKILL.md).

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.

Comments

Loading comments…

Newsletter

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