Skip to content

feat(cli): update skills safely - #450

Draft
christso wants to merge 10 commits into
mainfrom
feat/skills-update
Draft

feat(cli): update skills safely#450
christso wants to merge 10 commits into
mainfrom
feat/skills-update

Conversation

@christso

@christso christso commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds allagents skill update [skills...], with safe handling for skills that disappeared upstream. The command preflights updates in disposable checkouts, warns before removing managed local copies, updates surviving skills, and reconciles project/user configuration without silently crossing ownership boundaries.

The design was based on vercel-labs/skills PR #1218 and commit 6b29809, then adapted for AllAgents marketplace graphs, shared caches, scope isolation, and offline sync.

User behavior

  • allagents skill update supports project, user, or all scopes and optional case-insensitive skill filters.
  • Deleted-upstream skills are grouped by the physical checkout graph that owns them and presented before any persistent mutation.
  • Yes atomically removes confirmed selectors/config entries, advances the exact inspected revisions, and syncs changed scopes once offline.
  • No keeps the local copies and skips every update from that shared source so sync cannot remove them indirectly.
  • Cancel leaves every config, checkout, and synced artifact unchanged.
  • --yes, JSON, CI, and other non-interactive runs never authorize deletion; affected sources are retained and skipped.
  • Direct GitHub sources, inline refs, object pins, embedded marketplaces, external marketplace plugins, qualified nested skills, and shared project/user caches are supported.
  • Local-path sources are reported as skipped because there is no remote revision to inspect.

Safety and implementation notes

  • Temporary clones are inspected before persistent caches move; fetch/parse/discovery failures are never classified as deletions.
  • Connected marketplace and external-plugin checkouts form one transaction boundary across selected and unselected scopes.
  • Cache paths, plugin subpaths, symlinks, and configured origins are validated before checkout changes.
  • Config reconciliation is staged and atomically replaced. Checkout/config rollback failures are surfaced in the command result.
  • Accepted checkouts move to immutable inspected SHAs, then each affected scope syncs once with offline: true.
  • Terminal-controlled upstream names/errors are sanitized before interactive rendering.
  • Transactional git operations use the native git process so repository-wide simple-git test mocks cannot alter real update behavior.

The reviewed design is in docs/plans/2026-08-10-001-feat-skill-update-deletion-handling-plan.md.

Automated verification

  • bun test1,416 passed, 5 skipped, 0 failed across 133 files.
  • bun run test:e2e130 passed, 4 skipped, 0 failed across 12 files.
  • bun test tests/e2e/skill-update.test.ts7 passed, 63 assertions using the built dist/index.js CLI and disposable project/home/remotes.
  • bun run typecheck — passed.
  • bun run lint — passed.
  • bun run build — passed.
  • bun run docs:build — passed.
  • git diff --check — passed.

The dedicated E2E run initially exposed an unrelated existing test at the default 5-second limit. Its five real CLI subprocesses took 5.77 seconds on this host, so that one test now has an explicit 10-second timeout; the final prescribed E2E run is green.

Isolated dogfood / UAT

The manual pass used only a disposable project, fake home, local bare Git remote, and local Git config. It did not read or mutate the real AllAgents home or this repository's workspace configuration.

Setup and command sequence:

bun run build

uat_root=$(mktemp -d /tmp/allagents-skill-update-uat.XXXXXX)
uat_home="$uat_root/home"
uat_project="$uat_root/workspace"
uat_gitconfig="$uat_root/gitconfig"

# The fixture created a local uat/skill-update-manual remote at v1 with
# skills/keep and skills/gone, cloned it into the fake AllAgents cache,
# configured only the project allowlist [keep, gone], then synced v1.
ALLAGENTS_TEST_HOME="$uat_home" HOME="$uat_home" \
  GIT_CONFIG_GLOBAL="$uat_gitconfig" GIT_TERMINAL_PROMPT=0 \
  ./dist/index.js update --offline

# The local upstream was then committed at v2 with keep updated and gone deleted.
agent-tui daemon start
agent-tui run -d "$uat_project" --cols 140 --rows 40 -- \
  env ALLAGENTS_TEST_HOME="$uat_home" HOME="$uat_home" \
  USERPROFILE="$uat_home" XDG_CONFIG_HOME="$uat_home/.config" \
  GIT_CONFIG_GLOBAL="$uat_gitconfig" GIT_TERMINAL_PROMPT=0 NO_COLOR=1 \
  "$PWD/dist/index.js" skill update --scope project
agent-tui wait 'deleted upstream' --timeout 30000
agent-tui screenshot
agent-tui press ArrowLeft Enter
agent-tui wait 'Updated 1 skill' --timeout 30000
agent-tui screenshot

Observed interaction:

Checking for skill updates…
│
▲  The following skills from uat/skill-update-manual appear to have been deleted upstream:
│    • uat-skill-update-manual:gone (project)
│
◇  Remove 1 local skill copy and update the surviving skills? No keeps them and skips every update from this source.
│  Yes
✓ Removed deleted skills and updated uat/skill-update-manual
Done: 1 updated, 1 removed, 0 retained, 0 skipped.

Assertions and results:

  • Cache started at a1135e09b113d48afcde597f2d6d0725cdb2d396 and finished at inspected v2 SHA 3673a8986c17bf21b8f747b3a086758349ec693b.
  • Project workspace.yaml changed only from skills: [keep, gone] to skills: [keep].
  • .claude/skills/gone/SKILL.md was removed.
  • .claude/skills/keep/SKILL.md and the cached copy both contained # keep v2.
  • The disposable fixture was removed with find "$uat_root" -depth -delete after verification.

The reproducible automated fixture, including Yes, No, cancel, shared-scope, marketplace, non-interactive, and partial-failure branches, is in tests/e2e/skill-update.test.ts.

Post-deploy validation

This is a local CLI feature with no server-side rollout. After release, maintainers should watch the Publish/CI workflows and reports containing skill update, deleted upstream, Refusing to update, or Offline ... sync failed. Any report that No/cancel/non-interactive mode changed a cache, config, or managed artifact is a rollback-level safety issue; otherwise failures remain isolated and actionable in the CLI result.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 10, 2026

Copy link
Copy Markdown

Deploying allagents with  Cloudflare Pages  Cloudflare Pages

Latest commit: c9c7db1
Status: ✅  Deploy successful!
Preview URL: https://c02a7850.allagents.pages.dev
Branch Preview URL: https://feat-skills-update.allagents.pages.dev

View logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant