ai-skills-conventions-prompt-caching
Structure prompts and skill bundles so the static prefix stays stable across invocations and Anthropic prompt-prefix caching can hit instead of rebuild.
Skill by fabian-barney
Chalk Labs
Need help deploying ai-skills-conventions-prompt-caching?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/fabian-barney-ai-skills-conventions-prompt-caching
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: agent-building
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/ai-skills-conventions-prompt-caching
What's inside
- Skill name
ai-skills-conventions-prompt-caching- Description
- Structure prompts and skill bundles so the static prefix stays stable across invocations and Anthropic prompt-prefix caching can hit instead of rebuild.
- License
- Apache-2.0
- Instructions
- 125 lines in SKILL.md · view on GitHub
Files (4)
- SKILL.md
- cache-control-correct.md · examples/
- cache-breakpoint-placement.md · references/
- skill-structure-for-caching.md · references/
SKILL.md (first lines)
<!-- markdownlint-disable MD025 --> # Purpose Apply the default prompt-prefix-caching conventions so that the static portion of a prompt or skill bundle stays byte-identical across invocations, the cache breakpoint is placed on the last stable block, and per-request variable content is appended last. The goal is to keep `cache_read_input_tokens` high and `cache_creation_input_tokens` near zero on repeated invocations. # When to Use - use when authoring or revising a skill bundle whose `SKILL.md` and any reference, example, or template files are intended to be reused across many invocations - use when structuring a prompt that will be replayed with only minor per-request variations (different user input, different target file, different chosen example) - use when reviewing an existing skill or prompt that exhibits low cache hit rates or high per-request token cost - use `references/cache-breakpoint-placement.md` for the decision framework on where the last cache breakpoint belongs - use `references/skill-structure-for-caching.md` for how the canonical SKILL.md section order keeps a long stable prefix - use `examples/cache-control-correct.md` when communicating the expected correct-vs-incorrect breakpoint placement # Inputs - the prompt or skill bundle whose prefix stability is in scope - the set of blocks the model will see in order: tools, system, references, prior turns, and the current variable input - which blocks change per invocation versus which stay byte-identical - the cache-hit and cache-creation token counts from recent runs when available, used to detect the antipattern of a breakpoint on changing content - the target Claude model and its minimum cacheable-prefix size, as published in Anthropic's current prompt-caching documentation; the cache will not be used when the prefix is below the published threshold even with a correct breakpoint - `references/cache-breakpoint-placement.md` - `references/skill-structure-for-caching.md` # Workflow 1. Order content static-first: tools, then system, then long-lived references and examples, then prior turns, then the current variable input last. Variable content at the front breaks the prefix for every invocation. 2. Identify the last byte-stable block in the ordered sequence. That is the block whose content is identical across the next batch of expected invocations. 3. Place a single `cache_control` breakpoint on that last stable block. Never place a breakpoint on a block whose content changes per request (timestamps, user input, chosen target file), because that forces a cache rewrite every call. 4. Keep the static prefix above any breakpoint within the 20-block lookback window the cache uses; if a new long-lived block has to be added past the breakpoint, move the breakpoint forward rather than appending past it. 5. For multi-turn conversations, rely on the automatic breakpoint that advances per request rather than hand-placing breakpoints on each turn. 6. When tools, system, long-lived references, and messages change at different cadences, use up to four explicit breakpoints — one at the trailing edge of each cadence band — but do not exceed four. 7. After a representative run, inspect the response usage: `cache_read_input_tokens` should grow as cached prefixes are reused; persistently high `cache_creation_input_tokens` on every call means a breakpoint sits on changing content and must be moved earlier. 8. Confirm the cacheable prefix meets the target model's minimum size as published in the current Anthropic prompt-caching documentation before relying on caching. Below the published threshold the cache will not be used even with a correct breakpoint. 9. For skill bundles, keep the SKILL.md section order from the catalog spec (Purpose → When to Use → Inputs → Workflow → Outputs → Guardrails → Exit Checks) and treat the bundle reference files as immutable between releases so they stay in the cached prefix across invocations. # Outputs - a prompt or skill bundle whose static blocks come first and whose variable per-request content comes last - a single trailing `cache_control` breakpoint on the last byte-stable block, or up to four breakpoints aligned to the cadence bands - a measurement note for any non-obvious decision, citing the `cache_read_input_tokens` and `cache_creation_input_tokens` values that justified the breakpoint placement - a review finding when a prompt or skill places variable content ahead of static content or puts a breakpoint on changing content # Guardrails - do not place `cache_control` on a block that changes per request, even when it appears late in the prompt; the breakpoint must sit on a block whose bytes are stable across the next batch of invocations - do not interleave per-request variable content with long-lived references; keep variable content trailing - do not exceed four cache breakpoints in a single prompt - do not assume caching is active when the cacheable prefix is below the target model's published minimum size threshold; verify by reading the response usage block - do not edit reference, example, or template files inside a skill bundle as part of normal per-request work; treat them as immutable between releases so the cached prefix stays valid - do not silently move a breakpoint forward without confirming the previous prefix was no longer being reused # Exit Checks - the static prefix (tools, system, long-lived references, examples) precedes any per-request variable content - the last `cache_control` breakpoint sits on a byte-stable block, not on changing content - the total number of breakpoints is at most four - the cacheable prefix meets the target model's published minimum token threshold - a representative invocation shows `cache_read_input_tokens` growing on
From fabian-barney/ai-skills, Apache-2.0.
Signals
- Stars
- 1
- Forks
- 0
- Open issues
- 2
- Last commit (this folder)
- May 19, 2026 (6 months ago)
- Last release
- Jun 2, 2026 (5 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- Repository
- github.com/fabian-barney/ai-skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get ai-skills-conventions-prompt-caching running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
ai-skills-conventions-prompt-caching. Agent Mart. https://agentmart.dev/skills/fabian-barney-ai-skills-conventions-prompt-caching (last updated 2026-10-24)