fix(skills): support skills belonging to multiple groups#64
Merged
Conversation
Replace the single Skill.GroupID string field with GroupIDs []string so a skill that appears in more than one group's relations is no longer silently dropped to a single group (last-write-wins). - ParseFetchedSkills: accumulates all group IDs per skill instead of overwriting; skillGroupMap is now map[string][]string - FilterSkills: anyGroupSelected() checks membership across all GroupIDs - writeSkillsToTargets: writes SKILL.md under every group directory the skill belongs to; reconciliation map covers all (groupID, skillID) pairs - isSkillSelected / AvailableUngroupedSkillsToAdd: updated for []string - port skills list: skill is bucketed into every group it belongs to, so it appears under each group in the CLI output - Tests: all GroupID → GroupIDs, plus new TestWriteSkills_MultiGroupSkill and TestParseFetchedSkills_MultiGroupSkill covering the bug scenario Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
relations.skills, the CLI stored only the last group encountered (last-write-wins onmap[string]string), soport skills listshowed the skill under only a single group.Skill.GroupID stringwithSkill.GroupIDs []stringand propagate the change through parsing, filtering, writing, selection logic, and display.Changes
SkillstructGroupID string→GroupIDs []stringParseFetchedSkillsskillGroupMapis nowmap[string][]string; each group ID is appended instead of overwritingFilterSkillsanyGroupSelected()helper checks membership across all of a skill's groupswriteSkillsToTargets(groupID, skillID)pairsisSkillSelectedGroupIDswhen matching against selected groupsAvailableUngroupedSkillsToAddlen(s.GroupIDs) > 0guardport skills listGroupID→GroupIDs; newTestWriteSkills_MultiGroupSkillWrittenToAllGroupsandTestParseFetchedSkills_MultiGroupSkilldirectly cover the bug scenarioTest plan
go test ./internal/modules/skills/... ./internal/commands/...passesgo build ./...compiles cleanlyport skills listwith a skill belonging to two groups shows it under both group headingsport skills syncwith a multi-group skill writes SKILL.md under each group directoryMade with Cursor