agentleFS
ChrisamansoodChrisamansood/chris-ai-productivity/skills/cache-aware-prompting/SKILL.md

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".

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
  1. Distinctive:

    Put static content first. Put changing content last.

    line 12
  2. Distinctive:

    Use references/cache-patterns.md for cache breakers, stable/volatile layouts, split-section examples, repeated agent calls, and review …

    line 29
  3. Distinctive:

    If a section mixes static and volatile content, split it.

    line 57
  4. Distinctive:

    Keep the longer stable block before shorter stable blocks when possible.

    line 58

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.