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 roedyrustam/vibes-plug --skill kv-cache-prefix-optimizergit clone --depth 1 https://github.com/roedyrustam/vibes-plugWrote 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/roedyrustam/vibes-plug/kv-cache-prefix-optimizer)<a href="https://agentmods.dev/skills/roedyrustam/vibes-plug/kv-cache-prefix-optimizer"><img src="https://agentmods.dev/badge/skills/roedyrustam/vibes-plug/kv-cache-prefix-optimizer/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/roedyrustam/vibes-plug/kv-cache-prefix-optimizer"><img src="https://agentmods.dev/badge/skills/roedyrustam/vibes-plug/kv-cache-prefix-optimizer.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.00102 | $0.02535 |
| Opus 5.5 | $0.00041 | $0.01014 |
| Sonnet 5.5 | $0.00020 | $0.00507 |
| Haiku 4.5 | $0.00010 | $0.00253 |
Grade A, and why
kv-cache-prefix-optimizer 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 3d 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 — 199 lines — stays where its author put it; the contents beside it link to each section on GitHub.
kv-cache-prefix-optimizer — vibes-plug Skill
English
Orchestration & Integration
- Upstream & Orchestration:
zero-to-prod-orchestrator(Phase 4 AI agent integration),brainstorming,session-memory-manager. - Frontier LLM & Model Caching:
frontier-ai-models-expert(Gemini 4 Pro, Claude 5.5, GPT Astra 6 caching specs),gemini-agent-booster(Google 2M+ native context caching),vercel-ai-sdk-expert(provider cache controls). - FinOps & Adaptive Execution:
llm-finops-router(cost calculation & cache routing),adaptive-model-cascade(cascade tier prefixing),thinking-budget-orchestrator(prefix pinning with thinking tokens). - Prompt Engineering & Context Windows:
ai-prompt-engineering-expert(prompt canonicalization),context-window-engineer(large context sliding windows).
Description
Production guide for engineering deterministic prompt prefixes, stabilizing KV-cache boundaries, and optimizing context reuse across frontier models (Google Gemini 4 Pro / 3.x context caching, Anthropic Claude 5.5 prompt caching, and OpenAI prefix caching). Delivers architectures that guarantee 90%+ cache hit rates through canonical tool definition sorting, stable JSON serialization, and dynamic context partitioning.
Trigger Conditions
Activate this skill when:
- Operating large-context agents (>100k tokens) where recurring prompt costs dominate operational budgets.
- Experiencing high Time-to-First-Token (TTFT) latencies in interactive chat or agentic coding loops.
- Configuring model caching primitives (
cache_control: { type: 'ephemeral' }or Gemini explicit cache tokens). - Architecting system instructions, tool schemas, and workspace context maps for multi-turn sessions.
Core Concepts & Patterns
1. The Anatomy of a High-Cache Prompt
Modern frontier models utilize prefix-matching algorithms. Even a single changed byte (such as a timestamp, random ID, or altered tool order) invalidates all subsequent cached tokens:
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.
- 3d ago Changed · -22 lines 04499bff4d7a
- 4d ago Changed · +1 lines a2356cd4e359
- 7d ago Changed e707aa10a24f
- 16d ago Changed bd5ea1e30573
- 21d ago First seen · 220 lines · 102 tokens per session scan A 3cae90ad5691
kv-cache-prefix-optimizer is a skill published in the GitHub repository roedyrustam/vibes-plug (113 stars, last pushed today), licensed MIT. It adds 102 tokens to every session and 2,535 once invoked, about $0.0004 per session on Opus 5.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-10-04.
Other skills, from other repositories
ai-engineering-toolkit
Overview of six AI engineering workflows: prompt evaluation (8-dimension scoring), context budget planning, RAG pipeline design, agent security audit (65-point checklist), eval harness building, and product sense coaching.
ai-engineering-toolkit
6 production-ready AI engineering workflows: prompt evaluation (8-dimension scoring), context budget planning, RAG pipeline design, agent security audit (65-point checklist), eval harness building, and product sense coaching.
prompt-modeler
Generate structured strategic prompts with diagnostic and multiple options. Triggers on: /modelar-prompt.
few-shot-architect
Professional Few Shot Architect skill. Integrate LLM API workflows, safe system prompt guidelines, and agentic workflows.
llm-prompt-master
Professional LLM Prompt Master skill. Integrate LLM API workflows, safe system prompt guidelines, and agentic workflows.
responsible-ai
Professional Responsible Ai Expert skill. Integrate LLM API workflows, safe system prompt guidelines, and agentic workflows.