Skip to content

bug: uninstall may delete skills that existed before allagents managed them #306

@christso

Description

@christso

Problem

When a plugin is uninstalled, the cleanup logic (computeDeletedArtifacts) removes skill directories that were previously synced. However, if a skill directory existed before allagents first synced to it (i.e., the user manually placed it there), uninstalling the plugin deletes the user's original content.

Overwriting during sync is acceptable — it's the expected behavior and avoids issues when sync state is lost (e.g., .allagents/ deleted and resync). The problem is only on the cleanup/uninstall path.

Contrast with MCP handling

The MCP server sync handles this correctly with the trackedServers concept (documented in CLAUDE.md):

We only track servers we added. If a server already exists in the user's mcp.json before a plugin is installed, we must NOT track it — otherwise uninstalling the plugin would delete the user's manually-configured server.

Skills lack this same protection on the uninstall path.

Expected Behavior

  • Overwriting during sync: keep as-is (correct behavior)
  • On uninstall/cleanup: if a skill directory existed before allagents first managed it, do not delete it — or warn the user

Investigation Needed

  • Determine if this is a real risk in practice or only theoretical
  • Consider whether sync-state.json should track "pre-existing" skills to avoid deleting them on uninstall
  • Review edge cases: what happens if a user creates a skill with the same name after a plugin is already installed?

Affected Code

  • src/core/sync.tscomputeDeletedArtifacts()
  • src/core/transform.tscopySkills()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions