cache-aware-prompting
Skill2 starsChanged 3 months agoMITView on GitHub
Use when the user is building repeated API prompts, high-volume agent calls, or multi-section prompts and wants better prompt-cache hits, lower input cost, or a cache-friendly prompt structure. Trigger on "optimize for caching", "cache this prompt", "cache-aware", "reorder for cache", "prompt cache", or "same system prompt many times".
In this repository9 other files it gives its agents.
- ask-meSkill
- be-brutally-honestSkill
- build-me-a-pptSkill
- handoff-nowSkill
- humanizeSkill
- save-tokens-save-waterSkill
- tell-me-about-thisSkill
- tool-result-compressionSkill
- write-me-a-skillSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Put static content first. Put changing content last.
- Distinctive: line 29
Use references/cache-patterns.md for cache breakers, stable/volatile layouts, split-section examples, repeated agent calls, and review …
- Distinctive: line 57
If a section mixes static and volatile content, split it.
- Distinctive: line 58
Keep the longer stable block before shorter stable blocks when possible.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Cache-Aware Prompting
Structure repeated prompts so stable content can be cached and volatile content stops breaking the cache.
Core Rule
Put static content first. Put changing content last.
Static content includes:
- System instructions
- Stable examples
- Reference docs that rarely change
- Tool schemas that do not change per request
Volatile content includes:
- Current user query
- Today's date
- Session IDs
- User-specific values
- Fresh retrieval results
Use references/cache-patterns.md for cache breakers, stable/volatile layouts, split-section examples, repeated agent calls, and review checks.
Output Format
CACHE-READY STRUCTURE:
[STATIC - cache this]
1. <section>
2. <section>
[VOLATILE - changes per call]
3. <section>
4. <section>
WHY:
- <what moved and why>
CACHE NOTE:
<what becomes cache-eligible, approximate if needed>
HEADS UP:
<semantic risk, only if present>Rules
- Reorder or split content; do not silently delete it.
- If a section mixes static and volatile content, split it.
- Keep the longer stable block before shorter stable blocks when possible.
- Mark cache savings as approximate unless the provider and prices were freshly verified.
Common Mistakes
- Putting dates or session IDs at the top.
- Mixing retrieval results with system instructions.
- Placing examples after the current question.
- Rewriting the whole prompt when a structure map is enough.
- Claiming exact cache savings without current provider-specific verification.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

