@@ -857,7 +857,7 @@ func TestInstallRun(t *testing.T) {
857857 wantErr : "conflicting names" ,
858858 },
859859 {
860- name : "remote install all with namespaced skills avoids collisions" ,
860+ name : "remote install all with namespaced skills detects collisions" ,
861861 isTTY : true ,
862862 stubs : func (reg * httpmock.Registry ) {
863863 stubResolveVersion (reg , "monalisa" , "skills-repo" , "v1.0.0" , "abc123" )
@@ -868,7 +868,7 @@ func TestInstallRun(t *testing.T) {
868868 `{"path": "skills/bob/xlsx-pro", "type": "tree", "sha": "treeB"}, ` +
869869 `{"path": "skills/bob/xlsx-pro/SKILL.md", "type": "blob", "sha": "blobB"}`
870870 stubDiscoverTree (reg , "monalisa" , "skills-repo" , "abc123" , treeJSON )
871- // Extra blob stubs consumed by FetchDescriptionsConcurrent during interactive selection.
871+ // Blob stubs consumed by FetchDescriptionsConcurrent during interactive selection.
872872 contentA := base64 .StdEncoding .EncodeToString ([]byte ("---\n name: xlsx-pro\n description: Alice\n ---\n # A\n " ))
873873 contentB := base64 .StdEncoding .EncodeToString ([]byte ("---\n name: xlsx-pro\n description: Bob\n ---\n # B\n " ))
874874 reg .Register (
@@ -877,10 +877,6 @@ func TestInstallRun(t *testing.T) {
877877 reg .Register (
878878 httpmock .REST ("GET" , "repos/monalisa/skills-repo/git/blobs/blobB" ),
879879 httpmock .StringResponse (fmt .Sprintf (`{"sha": "blobB", "content": %q, "encoding": "base64"}` , contentB )))
880- stubInstallFiles (reg , "monalisa" , "skills-repo" , "treeA" , "blobA" ,
881- "---\n name: xlsx-pro\n description: Alice\n ---\n # A\n " )
882- stubInstallFiles (reg , "monalisa" , "skills-repo" , "treeB" , "blobB" ,
883- "---\n name: xlsx-pro\n description: Bob\n ---\n # B\n " )
884880 },
885881 opts : func (ios * iostreams.IOStreams , reg * httpmock.Registry ) * InstallOptions {
886882 t .Helper ()
@@ -901,7 +897,7 @@ func TestInstallRun(t *testing.T) {
901897 Dir : t .TempDir (),
902898 }
903899 },
904- wantStdout : "Installed " ,
900+ wantErr : "conflicting names " ,
905901 },
906902 {
907903 name : "remote install friendlyDir shows tilde for home paths" ,
@@ -1670,7 +1666,7 @@ func TestRunLocalInstall(t *testing.T) {
16701666 wantStdout : "Installed direct-skill" ,
16711667 },
16721668 {
1673- name : "namespaced skills install to separate directories " ,
1669+ name : "namespaced skills with same name collide in flat install " ,
16741670 isTTY : true ,
16751671 setup : func (t * testing.T , sourceDir , _ string ) {
16761672 t .Helper ()
@@ -1699,38 +1695,25 @@ func TestRunLocalInstall(t *testing.T) {
16991695 GitClient : & git.Client {RepoDir : t .TempDir ()},
17001696 }
17011697 },
1702- verify : func (t * testing.T , targetDir string ) {
1703- t .Helper ()
1704- _ , err := os .Stat (filepath .Join (targetDir , "alice" , "xlsx-pro" , "SKILL.md" ))
1705- assert .NoError (t , err , "alice/xlsx-pro should be installed" )
1706- _ , err = os .Stat (filepath .Join (targetDir , "bob" , "xlsx-pro" , "SKILL.md" ))
1707- assert .NoError (t , err , "bob/xlsx-pro should be installed" )
1708- },
1709- wantStdout : "Installed alice/xlsx-pro" ,
1698+ wantErr : "conflicting names" ,
17101699 },
17111700 {
1712- name : "local install with --force overwrites namespaced skill" ,
1701+ name : "local install with --force overwrites namespaced skill flat " ,
17131702 isTTY : true ,
17141703 setup : func (t * testing.T , sourceDir , targetDir string ) {
17151704 t .Helper ()
1716- for _ , ns := range []string {"alice" , "bob" } {
1717- writeLocalTestSkill (t , sourceDir , filepath .Join ("skills" , ns , "xlsx-pro" ),
1718- fmt .Sprintf ("---\n name: xlsx-pro\n description: %s xlsx-pro\n ---\n # Test\n " , ns ))
1719- }
1720- require .NoError (t , os .MkdirAll (filepath .Join (targetDir , "alice" , "xlsx-pro" ), 0o755 ))
1705+ writeLocalTestSkill (t , sourceDir , filepath .Join ("skills" , "alice" , "xlsx-pro" ),
1706+ "---\n name: xlsx-pro\n description: alice xlsx-pro\n ---\n # Test\n " )
1707+ require .NoError (t , os .MkdirAll (filepath .Join (targetDir , "xlsx-pro" ), 0o755 ))
1708+ require .NoError (t , os .WriteFile (filepath .Join (targetDir , "xlsx-pro" , "SKILL.md" ), []byte ("old" ), 0o644 ))
17211709 },
17221710 opts : func (ios * iostreams.IOStreams , sourceDir , targetDir string ) * InstallOptions {
17231711 t .Helper ()
1724- pm := & prompter.PrompterMock {
1725- MultiSelectWithSearchFunc : func (_ , _ string , _ , _ []string , _ func (string ) prompter.MultiSelectSearchResult ) ([]string , error ) {
1726- return []string {allSkillsKey }, nil
1727- },
1728- }
17291712 return & InstallOptions {
17301713 IO : ios ,
17311714 SkillSource : sourceDir ,
17321715 localPath : sourceDir ,
1733- Prompter : pm ,
1716+ SkillName : "xlsx-pro" ,
17341717 Force : true ,
17351718 Agent : "github-copilot" ,
17361719 Scope : "project" ,
@@ -1739,6 +1722,12 @@ func TestRunLocalInstall(t *testing.T) {
17391722 GitClient : & git.Client {RepoDir : t .TempDir ()},
17401723 }
17411724 },
1725+ verify : func (t * testing.T , targetDir string ) {
1726+ t .Helper ()
1727+ content , err := os .ReadFile (filepath .Join (targetDir , "xlsx-pro" , "SKILL.md" ))
1728+ require .NoError (t , err )
1729+ assert .Contains (t , string (content ), "alice xlsx-pro" )
1730+ },
17421731 wantStdout : "Installed" ,
17431732 },
17441733 {
0 commit comments