agentsclimarketplace

Cache warm before cache only fanout

Skill ychampion/cskill-agents/agents/claude-code/skills/cache-warm-before-cache-only-fanout

Warm the authoritative cache path first, then fan out cache-only readers in parallel so derived loaders never race stale state.From its SKILL.md

Install
npx -y skills add ychampion/cskill-agents --skill cache-warm-before-cache-only-fanout

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

2.1 KB, 366 tokens by cl100k_base, as published. Nobody here has run it

SKILL: Cache Warm Before Cache-Only Fanout

Domain: extensions-mcp
Trigger: Apply when one authoritative load populates caches that several cheaper readers depend on, and parallel reads would race the warm path. Source Pattern: Distilled from reviewed extension lifecycle and source-reconciliation patterns.

Core Method

Run the expensive authoritative loader first, let it materialize and warm the shared caches, and only then fan out cache-only readers in parallel. This preserves a single source of truth for cache population while still recovering parallelism for the cheap derived reads. The result is deterministic: every downstream reader sees the same fresh state without each one redoing install or clone work.

Key Rules

  • Identify which loader actually populates the canonical cache and make it run before any cache-only consumers.
  • Keep derived readers cache-only; they should assume the warm path already handled the expensive side effects.
  • Use parallel fanout only after the warm step resolves successfully.
  • Document why the ordering matters so later refactors do not collapse everything back into a premature Promise.all.
  • Let the warm path own cache population and reuse; do not make each consumer silently fall back to heavyweight work.

Example Application

If an extension refresh must first scan and clone any missing plugins before separate readers build the command list and agent list, await the full plugin load once, then run command extraction and agent extraction in parallel against the warmed cache.

Anti-Patterns (What NOT to do)

  • Do not launch cache-only readers in parallel with the warm path if they can read stale manifests or miss newly materialized content.
  • Do not duplicate heavy install logic in each derived loader just to hide ordering bugs.
  • Do not remove the sequencing comment when the dependency is subtle; future maintainers will reintroduce the race.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.