prompt-caching-strategy
Skill by affaan-m
Optimizes LLM prompt caching hit rate to reduce API costs and latency. It helps teams with repeated API requests that share instructions, tools or reference material across OpenAI, Claude and Gemini.
Install prompt-caching-strategy
Built from the published package, never by AI.
git clone --depth 1 https://github.com/affaan-m/ECC /tmp/ECC && mkdir -p ~/.claude/skills && cp -r /tmp/ECC/skills/prompt-caching-strategy ~/.claude/skills/prompt-caching-strategyRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install prompt-caching-strategy in Claude Code
git clone --depth 1 https://github.com/affaan-m/ECC /tmp/ECC && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/ECC/skills/prompt-caching-strategy ~/.gemini/antigravity-cli/skills/prompt-caching-strategyAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install prompt-caching-strategy in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill helps an assistant arrange reusable prompt content so providers can reuse cached input. It recommends keeping instructions, tool schemas and examples in a stable prefix, and placing changing questions, timestamps and retrieved results after that prefix. It also covers user and workspace boundaries, so cache handles and accounting keys stay scoped to approved content.
The skill includes a provider reference table for OpenAI, Claude and Gemini usage counters, and a cost comparison calculator that normalizes token categories into baseline and actual cost. It also gives a verification workflow for measuring cache hit rates from real traffic when that is authorized. The source says its worked examples use hypothetical prices. It is aimed at developers and teams who make repeated LLM API calls and want to lower input cost or latency.
Written from the project's SKILL.md and checked against it.
What it can do
- Stable prefix designArranges reusable instructions, tool schemas and examples ahead of changing content to improve cache reuse.
- Provider usage mappingLists the usage counters to record for OpenAI, Claude and Gemini caching.
- Cache cost calculatorCompares baseline and cached cost from normalized token counts and per-million-token rates.
- Access boundary guidanceScopes cache handles and accounting keys to approved users, workspaces and content revisions.
- Measurement workflowSteps for measuring token hit rate, request hit rate and realized savings from matched requests.
What you need
- Node.js to run the offline calculator test
- The ECC repository to run the test file
- Provider API access, only if measuring real traffic
Try asking
- Restructure my prompt so the tool definitions and instructions can be cached.
- Calculate my expected cache savings from these token counts and rates.
- Review my Claude API requests and suggest a prefix layout for better cache reuse.
Good to know
- Runtime cache hits and savings are unmeasured unless real provider traffic is measured.
- Example prices and counts are hypothetical, not provider quotes.
- Caching does not reduce context-window use.
- A cache key is not an authorization gate or sandbox.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/prompt-caching-strategy/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md10 KB
Alternatives to prompt-caching-strategy
All alternatives →Aligns a Qwen Code feature with a Codex or Claude Code reference agent. It runs both under the same scenario, captures HTTP and terminal traces, and compares them until behavior matches.
Searches, views, creates, updates, and deletes the user's Google Contacts from an AI assistant. It is for people who want to manage their address book through conversation. A one-time Google connect is required before it returns data.
Guides an AI assistant on error handling choices. It covers when to use Result, Option, ? propagation, unwrap, expect and panic, plus anyhow and thiserror.
Caveman is an agent skill that makes an AI assistant reply in a terse style. It cuts filler and keeps technical facts, code, commands and errors exact. It is built for users who want shorter, cheaper replies.
docs-sync audits or updates English SDK documentation against the requested implementation scope. It is for maintainers who want docs to match main branch features, configuration options, and defaults.
Guides an AI assistant through setting up and running monorepos with pnpm workspaces, Turborepo and Nx. Aimed at developers who need faster builds, shared code and managed dependencies across multiple packages.
Compare with agent-reproduce-align, google_contacts or m06-error-handling
prompt-caching-strategy: common questions
Does this skill guarantee lower API costs?
No. The source says savings depend on the model, platform, cache eligibility, writes, retention, reuse and output volume. Runtime hits and savings are unmeasured in the examples.
Which providers does it cover?
The source covers OpenAI, Claude and Gemini, and says to check each provider's current documentation for requirements and rates.
When should I not use this skill?
The source says not to use it to optimize a single prompt's quality, which is the job of prompt-optimizer, or for general caching infrastructure.
How do I install prompt-caching-strategy?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is prompt-caching-strategy free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is prompt-caching-strategy safe to use?
It scores 91 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to prompt-caching-strategy?
Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.
