-
Notifications
You must be signed in to change notification settings - Fork 1
Description
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.jsonbefore 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.jsonshould 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.ts—computeDeletedArtifacts()src/core/transform.ts—copySkills()