Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add vinilana/dotcontext --skill govern-cache-retentiongit clone --depth 1 https://github.com/vinilana/dotcontextWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/vinilana/dotcontext/govern-cache-retention)<a href="https://agentmods.dev/skills/vinilana/dotcontext/govern-cache-retention"><img src="https://agentmods.dev/badge/skills/vinilana/dotcontext/govern-cache-retention.svg" alt="Measured on agentmods" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00068 | $0.00477 |
| Opus 5 | $0.00034 | $0.00238 |
| Sonnet 5 | $0.00014 | $0.00095 |
| Haiku 4.5 | $0.00007 | $0.00048 |
Grade A, and why
govern-cache-retention scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 62 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Govern Cache Retention
Require every cache and persistent index to declare how it stops growing and becomes fresh again.
Workflow
- Inventory keys, values, entry count, estimated bytes, and ownership lifetime.
- Define maximum entries, maximum estimated bytes, TTL, and single-entry behavior.
- Choose a freshness signal tied to the source, not only elapsed time.
- Use LRU within TTL and evict proactively on set and lifecycle cleanup.
- Make timers unref, bounded, and disposable.
- Clear process-local caches on server stop.
- Add lazy, dual-read migration for persistent shape changes.
- Protect active sessions and preserve rollback readability.
Required cache contract
Document:
- normalized key;
- entry and byte limits;
- TTL;
- freshness signal;
- eviction order;
- sweep trigger;
- dispose behavior;
- metrics;
- behavior when one entry exceeds budget.
Reject a cache implementation that omits any item.
Persistent indexes
Avoid one ever-growing JSON document on a hot path. Partition bindings or records when lookup and rewrite cost scale with total history. Keep summaries in session.json and move growing checkpoint payloads to append-only or individual records.
Required invariants
- Never expire only when the exact stale key is read again.
- Never leave a referenced interval after stop.
- Never retain stale semantic context after source identity changes.
- Never ignore cacheEnabled.
- Never prune active workflow state.
- Never require destructive migration to roll back.
- Clamp unsafe configuration values.
Dotcontext routing
- Put generic LRU/retention rules in harness domain/application.
- Keep MCP and integration caches owned and disposed by their surfaces.
- Coordinate repository pruning with runtime history.
- Follow F-07.
Review gate
Test entry eviction, byte eviction, TTL sweep, freshness invalidation, stop cleanup, stale binding removal, checkpoint migration, unsafe config clamps, and legacy reads.
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 8d ago First seen · 62 lines · 68 tokens per session scan A 2a28308d6b43
govern-cache-retention is a skill published in the GitHub repository vinilana/dotcontext (565 stars, last pushed 1mo ago), licensed MIT. It adds 68 tokens to every session and 477 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
pinecone
Managed vector DB for production RAG and search.
redis-js
Work with the Upstash Redis JavaScript/TypeScript SDK for serverless Redis operations. Use for caching, session storage, rate limiting, leaderboards, full-text search (querying, filtering, aggregating with @upstash/redis search extension), and all Redis data structures. Supports automatic serialization/deserialization…
byted-milvus
Manages Milvus on Volcano Engine (Volcengine): provision/inspect/scale/delete clusters and run collection + CRUD/search operations via bundled CLIs. Use when the user mentions Milvus + Volcengine/Volcano Engine or asks to operate Milvus there.
vector-db
Vector database expert for embeddings, similarity search, RAG patterns, and indexing strategies.
redis-best-practices
Redis development best practices for caching, data structures, and high-performance key-value operations.
caching-strategies
CDN, Redis, in-memory cache, cache invalidation, and distributed caching patterns.