Skip to content
Back to skills

Cache Design

ASecurity

Use with analysis-agent, task-agent, or review-agent for cache scope, freshness, invalidation, and source-load risk. Do not use without a cache decision or as task owner.

  • 7 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 8, 2026
security

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 22, 2026

npx -y skills add machenjie/rd-skills --skill cache-design --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cache Design?

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

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

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-design
description: "Use with analysis-agent, task-agent, or review-agent for cache scope, freshness, invalidation, and source-load risk. Do not use without a cache decision or as task owner."
---

# cache-design

## Registry Trigger

**Use when**

- design cache keys TTL invalidation stampede protection and freshness policy
- Redis ElastiCache Cloud Memorystore Memcached Redis Cluster Redis Sentinel Redis ACL RDB AOF maxmemory eviction hot key pipeline cache stampede cache penetration cache avalanche

**Do not use when**

- no task-local cache design decision is required

## Skill Role

Protect cache correctness, scope isolation, freshness, failure behavior, and source capacity.

## High-Value Rules

- Name the source of truth, owner, acceptable staleness, value/key version, and tenant/user/permission scope before caching; cache loss must not silently change correctness or expose another scope.
- Model process/pod/region topology, key popularity, expiry distribution, cold start, miss rate, and origin capacity. Single-flight, leases, jitter, early refresh, stale serving, negative caching, warm-up, or origin limiting are candidates selected from that evidence.
- Define freshness-required invalidation at the actual write or commit boundary.
- Define cache-down, refresh-failure, stale-data, eviction, and source-overload behavior.
- Require explicit durability and recovery proof for write-behind.

## Anti-Patterns

- In-process request coalescing does not prevent a cross-pod stampede, and coordinated expiry can overload the source even with a high historical hit rate.
- Do not treat TTL as invalidation for permissions, prices, balances, inventory, or other correctness-sensitive values.
- Scope shared and edge cache keys to prevent personalized data from crossing user or tenant boundaries.

## Execution Checklist

1. Map source, writers, readers, least-tolerant consumer, key scope, value shape, invalidation events, and failure modes.
2. Estimate hot-key, miss-storm, coordinated-expiry, restart/failover, and stale-serve impact against measured topology and origin capacity, then select only justified controls.
3. Validate every remaining triggered cache risk.
4. Record unavailable checks and their proof limits.

## Stop Conditions

- Escalate permissions, financial state, pricing, inventory, compliance/audit data, multi-tenant edge caching, write-behind, cross-region caches, or origin-overload risk when stale tolerance, scope, durability, or recovery ownership is unclear.

## Output Contract

- cache strategy with keys freshness invalidation and fallback behavior

## Targeted References

| Path | Type | Load when | Do not load when | Required by | Required output |
|---|---|---|---|---|---|
| [benchmarks and patterns](references/benchmarks-and-patterns.md) | benchmark-pattern | Read/write pattern, invalidation, fallback, or load protection remains open | No cache topology or source-load decision changes | task-agent, review-agent, analysis-agent | option-comparison, selected-approach |
| [checklist](references/checklist.md) | decision-checklist | Cache behavior spans scope collisions, staleness, outages, or hot keys | The cache is absent from the affected correctness path | task-agent, review-agent, analysis-agent | checklist-result, residual-risk |
| [evidence patterns](references/evidence-patterns.md) | evidence-pattern | Cache safety claims need current topology and failure-path tests | No freshness, isolation, or source-load claim needs proof | task-agent, review-agent, analysis-agent | evidence-record, proof-limit, residual-risk |

Files in this skill

  • SKILL.md3.5 KB
  • examples/example-output.md530 B
  • references/benchmarks-and-patterns.md3.4 KB
  • references/checklist.md1.4 KB
  • references/evidence-patterns.md4.8 KB

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…