fix(sdk): merge skills from both .copilot/skills/ and .squad/skills/ (#77)#669
Closed
diberry wants to merge 1 commit intobradygaster:devfrom
Closed
fix(sdk): merge skills from both .copilot/skills/ and .squad/skills/ (#77)#669diberry wants to merge 1 commit intobradygaster:devfrom
diberry wants to merge 1 commit intobradygaster:devfrom
Conversation
Fixes #77 — skill discovery only read one directory, ignoring the other. Changes: - skill-source.ts: Replace skillsDir (either/or) with skillsDirs (array of both dirs). listSkills/getSkill/getContent now scan all dirs with .copilot/skills/ winning on name conflicts. - resolver.ts: Replace .find() in readSkills() with a loop that collects from all candidate dirs, dedup by name (first wins). - squad.agent.md: Fix SKILL EXTRACTION, plugin install, and MCP skill reference paths from .squad/skills/ to .copilot/skills/. - Tests: 8 new skill-source tests + 3 new upstream tests covering merge, dedup, priority, empty dir, backward/forward compat. Closes #77 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
6138b3b to
83496e3
Compare
22 tasks
Collaborator
Author
|
Closing -- will re-open via fork-first pipeline when fully polished. |
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.
Fix: Skills Discovery Bug (Customer-Reported)
Origin: Customer-reported bug, fully investigated with 11-scenario error matrix and PRD.
Problem
Skills in
.squad/skills/are invisible when.copilot/skills/exists (even if empty). This affects every repo wheresquad initruns, because init always creates.copilot/skills/.A customer reported that only
.copilot/skills/was being read and.squad/skills/was completely ignored. After investigation, we confirmed this is a code-level bug in the SDK, not a configuration issue.Root Cause
Two files use an either/or pattern instead of merging both directories:
skill-source.ts~line 41 --skillsDirgetter returned.copilot/OR.squad/, never bothresolver.ts~line 62 --.find()returned first existing dir onlyInvestigation
Full PRD with 11-scenario error matrix at diberry/squad#77. Scenarios include:
.squad/only (works pre-init, breaks after).squad/silently lost).copilot/skills/shadows populated.squad/skills/squad initimmediately breaks existing.squad/skills/Fix
Both files now merge both directories at read-time.
.copilot/skills/wins on name conflicts:skill-source.ts--skillsDir(single string) changed toskillsDirs(array). Returns both.copilot/skills/and.squad/skills/if they exist.listSkills(),getSkill(), andgetContent()loop all dirs with aseenMap for dedup.resolver.ts--.find()changed tofor...ofloop across all candidate dirs (.copilot/,.squad/,.ai-team/) withSet<string>dedup.squad.agent.md-- 4 path references updated from.squad/skills/to.copilot/skills/(canonical write target going forward).Files Changed (5 total)
packages/squad-sdk/src/skills/skill-source.tspackages/squad-sdk/src/upstream/resolver.ts.github/agents/squad.agent.mdtest/skill-source.test.tstest/upstream.test.tsTest Coverage
Related