agentleFS
patrickbdevaneypatrickbdevaney/hermes-max/skills/workflow-cache-discipline/SKILL.md

workflow-cache-discipline

Skill1 starsChanged 6 months agoMITView on GitHub

Keep the prompt PREFIX stable and put dynamic content LAST so the serving layer's prefix cache stays warm across turns. Emit the stable parts (system prompt, skill metadata, tool schemas) first and unchanged; never interleave per-turn content (tool results, retrieved chunks) into the stable prefix. Trigger when assembling context for a multi-turn session and before any action that would rewrite early context.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    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:

    Never interleave per-turn content (a retrieved chunk, a tool result) *into* the stable prefix — append it to the suffix.

    line 30
  2. Distinctive:

    Avoid edits that rewrite early context mid-session.

    line 32
  3. Distinctive:

    Prefer [[workflow-filesystem-offload]] (keep a short stable reference, read the detail back on demand) over pasting large dynamic blobs …

    line 35

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

workflow-cache-discipline

<!-- TRIGGERS WHEN: multi-turn session; before any action that rewrites early context -->

The serving layer (vLLM) caches the longest unchanged prefix of the prompt across turns — a cache hit skips re-prefilling those tokens. The orchestration side maximizes that hit rate for free, with no serving-layer change, by keeping the prefix STABLE.

The boundary (stable prefix → dynamic suffix)

Emit in this order, and never reorder:

  1. Stable prefix (identical every turn): system prompt → skill metadata → tool schemas. These must be byte-identical across turns.
  2. Dynamic suffix (changes every turn): conversation history → retrieved chunks → tool results → the current user turn.

Rules:

  • Never interleave per-turn content (a retrieved chunk, a tool result) into the stable prefix — append it to the suffix.
  • Avoid edits that rewrite early context mid-session. In particular, the [[workflow-context-condenser]] rewrites the prefix and so busts the cache — which is exactly why it's gated to "only near the limit, not routinely."
  • Prefer [[workflow-filesystem-offload]] (keep a short stable reference, read the detail back on demand) over pasting large dynamic blobs that push the prefix around.

Verify it's working

The prefix cache is observable: vLLM exposes vllm:prefix_cache_hits_total / vllm:prefix_cache_queries_total (see $VLLM_BASE_URL/../metrics, surfaced by hm observe). In a healthy multi-turn session the hit ratio should RISE across turns; a sudden drop means something rewrote the prefix (a condense, a reordered system block, a tool-schema change) — investigate before continuing.

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.

Reviews can't be read right now.

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.