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 perniemann/pnCore --skill pn-cachinggit clone --depth 1 https://github.com/perniemann/pnCoreWrote 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/perniemann/pncore/pn-caching)<a href="https://agentmods.dev/skills/perniemann/pncore/pn-caching"><img src="https://agentmods.dev/badge/skills/perniemann/pncore/pn-caching/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/perniemann/pncore/pn-caching"><img src="https://agentmods.dev/badge/skills/perniemann/pncore/pn-caching.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.00058 | $0.01590 |
| Opus 5 | $0.00029 | $0.00795 |
| Sonnet 5 | $0.00012 | $0.00318 |
| Haiku 4.5 | $0.00006 | $0.00159 |
Grade A, and why
pn-caching scanned grade A with 1 finding 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 5d 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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
const fetcher = (url: string) => fetch(url).then((r) => r.json()); How it starts
The opening of the file, as written. The whole thing — 212 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Caching
When to use
- Reducing database query load or external API call volume
- Adding in-memory or Redis caching to a backend service
- Configuring HTTP cache headers and CDN behaviour
- Using Next.js server-side caching (
fetchoptions,unstable_cache, route segment config) - Adding SWR or React Query for client-side data fetching with stale-while-revalidate
Cache hierarchy
Browser Cache (memory / disk)
↓ miss
CDN / Edge Cache (Vercel Edge, Cloudflare)
↓ miss
Application Cache (Redis / in-memory)
↓ miss
Database / External API
Redis patterns
Read-through (most common)
import { Redis } from "ioredis";
const redis = new Redis(process.env.REDIS_URL!);
async function getProduct(id: string): Promise<Product> {
const cached = await redis.get(`product:${id}`);
if (cached) return JSON.parse(cached) as Product;
const product = await db.product.findUniqueOrThrow({ where: { id } });
await redis.setex(`product:${id}`, 300, JSON.stringify(product)); // TTL: 5 min
return product;
}
Write-through (keep cache consistent on writes)
async function updateProduct(id: string, data: Partial<Product>): Promise<Product> {
const product = await db.product.update({ where: { id }, data });
await redis.setex(`product:${id}`, 300, JSON.stringify(product));
return product;
}
Cache invalidation on write
async function deleteProduct(id: string): Promise<void> {
await db.product.delete({ where: { id } });
await redis.del(`product:${id}`);
await redis.del("products:list"); // invalidate list caches too
}
Stampede protection (dogpile prevention)
async function getWithLock<T>(key: string, ttl: number, fetcher: () => Promise<T>): Promise<T> {
const cached = await redis.get(key);
if (cached) return JSON.parse(cached) as T;
const lockKey = `lock:${key}`;
const acquired = await redis.set(lockKey, "1", "NX", "EX", 5); // 5s lock
if (!acquired) {
await new Promise((r) => setTimeout(r, 100));
return getWithLock(key, ttl, fetcher); // retry after brief wait
}
try {
const value = await fetcher();
await redis.setex(key, ttl, JSON.stringify(value));
return value;
} finally {
await redis.del(lockKey);
}
}
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.
- 5d ago First seen · 212 lines · 58 tokens per session scan A 56f7175d2149
pn-caching is a skill published in the GitHub repository perniemann/pnCore (0 stars, last pushed 2d ago), licensed MIT. It adds 58 tokens to every session and 1,590 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
pinecone
Managed vector DB for production RAG and search.
postgresql-table-design
Use this skill when designing or reviewing a PostgreSQL-specific schema. Covers best-practices, data types, indexing, constraints, performance patterns, and advanced features.
event-store-design
Design and implement event stores for event-sourced systems. Use when building event sourcing infrastructure, choosing event store technologies, or implementing event persistence patterns.
azure-resource-manager-redis-dotnet
Azure Resource Manager SDK for Redis in .NET. Use for MANAGEMENT PLANE operations: creating/managing Azure Cache for Redis instances, firewall rules, access keys, patch schedules, linked servers (geo-replication), and private endpoints via Azure Resource Manager. NOT for data plane operations (get/set keys, pub/sub) …
typescript
TypeScript coding conventions, best practices, and patterns for writing clean, maintainable code.
firebase-cloud-firestore
Use when setting up Firestore, designing schemas, doing CRUD, creating listeners, paginating queries, configuring indexes, enabling offline persistence, or writing security rules.