Skip to main content
← Back to list
01Issue
FeatureOpenSwamp CLI
AssigneesNone

Relationships

#852 Global skills should auto-sync when binary version advances

Opened by webframp · 6/27/2026

Problem

Global skills (the built-in swamp and swamp-getting-started skills at ~/.claude/skills/swamp/) are currently refreshed as a side effect of swamp repo upgrade. This creates a disconnect: the skills are global (they apply everywhere, not per-repo), but the only update path requires being inside an initialized swamp repository.

If a user has no initialized repos, or simply runs swamp from a directory that isn't a repo, their global skills rot. The skills can drift from the binary version indefinitely until someone happens to run repo upgrade somewhere.

Observed behavior

Running swamp repo upgrade in an initialized repo shows "skillsUpdated": ["swamp", "swamp-getting-started"] and writes to ~/.claude/skills/swamp/. But there's no way to trigger this without a repo context. Running swamp update upgrades the binary but does NOT refresh the global skills unless repo upgrade is subsequently run in some repo.

Proposed solution: auto-sync on first invocation + explicit sync during swamp update

Two mechanisms, complementary:

A. Auto-sync on first invocation of a new binary version

  1. The binary embeds skill content and a content hash.
  2. On any swamp invocation, compare the embedded hash against a marker file (e.g., ~/.swamp/global-skills-hash).
  3. If different, write the embedded skills to the global directory silently (or with a single log line like "Updated global skills to 20260626.x").
  4. If the write fails (permissions, disk full), log a warning and proceed — stale skills are better than a broken command.

B. swamp update explicitly triggers the sync as a post-step

Since swamp update already upgrades the binary, it should write the matching skill files immediately after. This covers:

  • The --setup-auto path (auto-update delivers new binary silently → skills follow automatically)
  • The manual swamp update path (single ceremony: "run swamp update, you're done")

Combined effect

  • Skills and binary are always in sync by construction.
  • No repo context required. No command to forget to run.
  • swamp repo upgrade continues to do it too (backward compat), but is no longer the only path.
  • Follows promise theory: the agent observes its own state and self-corrects without external direction.

Alternatives considered

Dedicated swamp skills sync subcommand — Adds surface area for something that should be invisible. Still requires the user to discover and remember to run it. Doesn't solve the "user never runs it" problem.

Skills served from binary with no filesystem persistence (local socket, MCP resource, virtual FS) — Eliminates the sync problem entirely but breaks the current contract where tools discover skills by scanning ~/.claude/skills/. Requires per-tool integration work. Probably too large an architectural change for this gap.

Why this matters

The global skills are the primary routing table and reference material for agents working with swamp. If they drift from the binary, the agent gives stale guidance (wrong command flags, missing new features, deprecated patterns). Since agents load skills on every conversation start, even a brief drift window means incorrect advice.

Environment

  • swamp version: 20260626.202321.0
  • Skills update observed via swamp repo upgrade --json showing skillsUpdated field
  • No swamp skill or swamp skills subcommand exists currently
02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED

Open

6/27/2026, 1:55:10 AM

No activity in this phase yet.

03Sludge Pulse
Editable. Press Enter to edit.

evrardjp commented 6/27/2026, 9:46:46 AM(edited)

I would prefer that a swamp update automatically does the upgrade of the skills unless explicitly mentioned e.g. with a --no-skill-update flag.

I can see why a check at runtime works, but it feels weird from the long term maintenance perspective -- run is run, upgrade is upgrade :) (However, I guess it's none of my concern, as I don't maintain this ><... it's just a force of habit)

I do agree with the hashes however, this is a good safety net.

I would have taken another approch than use a marker file on all swamp installations: No marker file. Just compute the hash of each of the skill contents upon upgrade of skills, compare this with known hashes. For that, each skill can hold metadata of its current version. This means upgrading a skill is basically reading a file, check its version, lookup its version in a map, find the hash, compare the hash, done. This way you can even track if the skill is outdated by checking the skill directly... It's a more granular view (which might not be required, to be evaluated by the swampers!)

Sign in to post a ripple.