Skip to content

fix(sync): Prune stale managed skills during sync#87

Merged
gricha merged 2 commits intomainfrom
gricha/fix/sync-prune-stale-skills
Apr 17, 2026
Merged

fix(sync): Prune stale managed skills during sync#87
gricha merged 2 commits intomainfrom
gricha/fix/sync-prune-stale-skills

Conversation

@gricha
Copy link
Copy Markdown
Member

@gricha gricha commented Apr 17, 2026

Prune previously managed skills during dotagents sync instead of re-adopting them as local orphans.

The current sync path treats any undeclared directory under .agents/skills/ as an orphan to adopt. That breaks the collaborator flow from #86: one person removes a skill from agents.toml, another person pulls the change, still has the old skill on disk plus a stale local agents.lock, and sync adds the skill back instead of cleaning it up.

This change uses the local lockfile to distinguish truly local in-place skills from stale managed installs. It also applies the same logic to wildcard entries so skills newly covered by exclude get pruned during offline sync.

I considered leaving this to install only, but that does not help the users relying on sync for offline reconciliation after a pull. The new behavior keeps local custom skills adoptable while making team-managed removals converge correctly.

The test coverage includes direct sync regressions plus a collaborator-style clone/pull/sync flow in temp git repos, and the docs now describe that sync adopts local orphans while pruning stale managed skills.

Fixes #86

Use the local lockfile during sync to distinguish truly local orphaned skills from managed skills that were removed from agents.toml. This prevents collaborators from re-adopting stale installs after pulling config changes, and it respects wildcard exclude changes during offline sync.

Add regression coverage for the direct prune path, wildcard excludes, and a collaborator-style clone/pull/sync flow so the behavior is exercised closer to end to end.

Fixes #86

Co-Authored-By: Codex <noreply@openai.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dotagents Ready Ready Preview, Comment Apr 17, 2026 6:34pm

Request Review

@gricha gricha marked this pull request as ready for review April 17, 2026 18:21
Make the collaborator sync regression test clone the temp project remote with an explicit main branch. This avoids CI-only failures caused by relying on the bare remote HEAD when creating Alice and Bob clones.

Refs #86

Co-Authored-By: Codex <noreply@openai.com>
Comment thread src/cli/commands/sync.ts
@gricha gricha merged commit 54ea1d2 into main Apr 17, 2026
18 checks passed
@gricha gricha deleted the gricha/fix/sync-prune-stale-skills branch April 17, 2026 18:57
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.

Sync removal of skill across team

1 participant