prompt-cache-discipline
Installation
SKILL.md
Prompt Cache Discipline
Keep the stable prefix stable. Prompt caching pays when large reusable instructions and references remain byte/order-stable across requests.
Contract
- Put durable instructions, schemas, and reusable reference context before volatile turn data.
- Do not rewrite, reorder, timestamp, or reserialize a warm prefix without a correctness reason.
- Keep session-scoped state small and append volatile facts after the reusable prefix.
- Batch related reads/reasoning so repeated calls do not resend slightly different giant contexts.
- Measure
cached_tokens, uncached input, output, latency, and total cost when telemetry exists. - If compaction is required, preserve durable constraints and avoid repeated micro-compactions that churn the cache.
Cache hits never outrank correctness. Invalidate a stale prefix deliberately when facts or governing instructions change.