Skip to content

fix: preserve plugin skills when refreshSkills is triggered by file watcher#1222

Merged
lewis617 merged 1 commit into
mainfrom
fix/plugin-skills-lost-on-refresh
Jun 11, 2026
Merged

fix: preserve plugin skills when refreshSkills is triggered by file watcher#1222
lewis617 merged 1 commit into
mainfrom
fix/plugin-skills-lost-on-refresh

Conversation

@lewis617

Copy link
Copy Markdown
Collaborator

Problem

When a SKILL.md file change triggers refreshSkills() via the file watcher, all skills including plugin skills were cleared and lost. Since discoverSkills() only rediscovers builtin/personal/project skills, plugin skill slash commands (e.g. /commit-skills:commit-push-mr) became unregistered.

Root Cause

SkillManager.refreshSkills() calls skillMetadata.clear() + skillContent.clear() which removes ALL skills. Plugin skills registered via registerPluginSkills() are stored in the same maps but not re-discovered by discoverSkills().

Fix

Store plugin skills in separate pluginSkillMetadata/pluginSkillContent maps. After refreshSkills() clears and re-discovers disk-based skills, plugin skills are restored from the plugin-specific maps.

Test

Added test verifying plugin skills and their slash commands survive a file watcher triggered refresh.

…atcher

SkillManager.refreshSkills() cleared all skills including plugin skills,
then discoverSkills() only re-discovered builtin/personal/project skills.
This caused plugin skill slash commands (e.g. /commit-skills:commit-push-mr)
to become unregistered after any SKILL.md file change triggered a refresh.

Fix: store plugin skills in separate pluginSkillMetadata/pluginSkillContent
maps so they survive the clear-rediscover cycle in refreshSkills().
@lewis617 lewis617 merged commit 84673b2 into main Jun 11, 2026
1 check passed
@lewis617 lewis617 deleted the fix/plugin-skills-lost-on-refresh branch June 11, 2026 13:35
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