agentleFS
kvdm-co-pilotkvdm-co-pilot/create-cmp/.claude/skills/plugin-refresh/SKILL.md

plugin-refresh

Skill0 starsChanged 47 days agoMITView on GitHub

Refresh the installed Claude Code plugin from its marketplace and PROVE the result by content — and answer the question a version number cannot: which running sessions have actually loaded which bytes. Use this when a skill behaves like an older version, after publishing a release, when the SessionStart line says the plugin is STALE, or when someone asks "is my plugin up to date", "reload the plugin", "why is my skill out of date", "refresh the marketplace", "did the reload work". This is create-cmp's own maintainer-only release-loop skill, local to this repository and not shipped in the plugin. The work is a program — `node scripts/plugin-refresh.mjs`, which exists only here — because every hand-run step has a silent failure that reports success; this skill says when to run it, how to read what it says, and what it deliberately will not do.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every step of this has a failure mode that reports success.

    line 39
  2. Very specific:

    When only .claude-plugin/*.json differs, skills and agents are byte-identical.

    line 89

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

plugin-refresh — refresh the plugin, and prove it by content

node scripts/plugin-refresh.mjs is the whole procedure. This file is not a copy of it.

node scripts/plugin-refresh.mjs --check     # is it stale? changes nothing
node scripts/plugin-refresh.mjs             # refresh, then prove it
node scripts/plugin-refresh.mjs --dry-run   # print the plan, write nothing

--check also runs at SessionStart, as one line under the proof schedule. If that line says current, there is nothing to do here — and it says current only when the bytes at every scope's installPath (from installed_plugins.json) match the marketplace clone at HEAD, in both directions. A matching version number or a sha that exists is not enough.

A refresh takes the documented path first — claude plugin marketplace update, then claude plugin update for each scope — and reads the result back from installed_plugins.json (version, installPath) and the bytes. Only if that leaves it stale (the update refuses a version number that did not move) does it rebuild the cache directory itself. /reload-plugins is then yours to type in each session it names.

Why a program and not a checklist

Every step of this has a failure mode that reports success. Measured on this machine over two days, all four at once:

  • /reload-plugins re-reads disk. It never refetches from GitHub, and will happily rebuild a cache directory out of a clone 56 commits stale.
  • The cache is keyed by version. If a stale snapshot already declares the new number, the reinstall records the new sha and reuses the directory holding the old bytes.
  • installed_plugins.json holds one entry per scope. Updating the one you thought about leaves the other behind — and the one that serves is not necessarily the one you expect. A local entry was found pinned to a version whose sha no longer existed, rebased away.
  • The version number, the plugin count, and the reload's own "N skills" line are all blind to every one of the above.

So the program refuses to call a refresh done unless the installed tree is byte-identical to the source it claims to come from — and --check asks the same question, so it cannot say current over older bytes under the right number (it did, until FIX-PLAN slice 13).

Reading what it prints

The scope lines are what is on disk. The leases block is what running sessions have actually loaded — <cache>/<version>/.in_use/ is a directory of leases, one entry per Claude process id, and ~/.claude/sessions/<pid>.json names each one.

  loaded by running sessions (.in_use leases — the bytes a session HAS, not what disk says):
    0.24.0   create-cmp-a0 (this repo)
    0.25.0   create-cmp-a0 (this repo)

A session under both an old and a new generation has reloaded — the old lease is simply not released until it exits. A session under only an older generation has not reloaded yet, and the program says so by name. This is the one signal that still discriminates when two versions ship identical skills, because it does not care what the bytes are, only who loaded them.

That .in_use is a directory and not a marker file is worth knowing: [ -f .in_use ] reports it absent, which produced two confident wrong conclusions in one day before the program existed.

What it will not do

  • It will not reload a running session. What a session has loaded is fixed until it reloads; the program reports who needs to and prints /reload-plugins. Only a human runs that.
  • It will not remove a version directory a running session holds. The rebuild replaces cache/<version>/ from scratch, but if that directory's .in_use/ names a live process, it refuses, lists the holders, and touches nothing: their hooks and MCP server run from those bytes, and removing the directory would also remove the leases that say who is on it. Bump .claude-plugin/plugin.json's version so the update lands in a new directory, or end those sessions and re-run.
  • It will not refresh at SessionStart. The hook calls --check only. A session start that silently mutates an install is a session start nobody can trust.
  • It will not tell you two identical generations apart by their content, because nothing can. When only .claude-plugin/*.json differs, skills and agents are byte-identical; sentence greps, skill counts and the reload's own summary are all blind to it. The leases are the answer.

When the proof fails

The program exits non-zero and says, per scope, how many files differ, are missing or are extra. Its closing lines print only what it read back from disk: each scope's recorded version and installPath, whether those bytes match the clone, and which sessions hold only an older lease.

A mismatch after the rebuild means the cache and the clone disagree over bytes it just copied, which should be impossible — treat it as a real defect. Do not re-run it hoping for a different answer, and do not hand-copy the files into the cache.

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.