From 878277e0a2f8f02cd70231f86a02c4be60dc24bd Mon Sep 17 00:00:00 2001 From: bradygaster Date: Sun, 5 Apr 2026 02:12:14 -0700 Subject: [PATCH 1/2] fix: import skills to .copilot/skills/ instead of .ai-team/skills/ Skills canonical location is .copilot/skills/, not .ai-team/skills/. Import was writing to the wrong path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- index.cjs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.cjs b/index.cjs index 2a23b7ff0..47850d189 100644 --- a/index.cjs +++ b/index.cjs @@ -1180,11 +1180,12 @@ if (cmd === 'import') { fs.writeFileSync(path.join(agentDir, 'history.md'), historyContent); } - // Write skills + // Write skills to .copilot/skills/ (the canonical location) + const copilotSkillsImportDir = path.join(dest, '.copilot', 'skills'); for (const skillContent of manifest.skills) { const nameMatch = skillContent.match(/^name:\s*["']?(.+?)["']?\s*$/m); const skillName = nameMatch ? nameMatch[1].trim().toLowerCase().replace(/\s+/g, '-') : `skill-${manifest.skills.indexOf(skillContent)}`; - const skillDir = path.join(aiTeamDir, 'skills', skillName); + const skillDir = path.join(copilotSkillsImportDir, skillName); fs.mkdirSync(skillDir, { recursive: true }); fs.writeFileSync(path.join(skillDir, 'SKILL.md'), skillContent); } From 528edc7b3cf4c05ebc0147805debb4dff88a0082 Mon Sep 17 00:00:00 2001 From: Brady Gaster <41929050+bradygaster@users.noreply.github.com> Date: Fri, 10 Apr 2026 22:45:08 -0700 Subject: [PATCH 2/2] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- index.cjs | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/index.cjs b/index.cjs index 47850d189..fbdbafcb3 100644 --- a/index.cjs +++ b/index.cjs @@ -1182,9 +1182,32 @@ if (cmd === 'import') { // Write skills to .copilot/skills/ (the canonical location) const copilotSkillsImportDir = path.join(dest, '.copilot', 'skills'); - for (const skillContent of manifest.skills) { + const importedSkills = manifest.skills.map((skillContent, index) => { const nameMatch = skillContent.match(/^name:\s*["']?(.+?)["']?\s*$/m); - const skillName = nameMatch ? nameMatch[1].trim().toLowerCase().replace(/\s+/g, '-') : `skill-${manifest.skills.indexOf(skillContent)}`; + const skillName = nameMatch + ? nameMatch[1].trim().toLowerCase().replace(/\s+/g, '-') + : `skill-${index}`; + return { skillContent, skillName }; + }); + const hasForce = typeof force !== 'undefined' && force; + + if (fs.existsSync(copilotSkillsImportDir)) { + if (hasForce) { + const archivedSkillsDir = path.join(dest, '.copilot', `skills.backup.${Date.now()}`); + fs.renameSync(copilotSkillsImportDir, archivedSkillsDir); + } else { + const collidingSkills = importedSkills + .map(({ skillName }) => skillName) + .filter((skillName) => fs.existsSync(path.join(copilotSkillsImportDir, skillName))); + + if (collidingSkills.length > 0) { + fatal(`Import would overwrite existing Copilot skills: ${collidingSkills.join(', ')}. Re-run with --force to replace the existing .copilot/skills directory.`); + } + } + } + + fs.mkdirSync(copilotSkillsImportDir, { recursive: true }); + for (const { skillContent, skillName } of importedSkills) { const skillDir = path.join(copilotSkillsImportDir, skillName); fs.mkdirSync(skillDir, { recursive: true }); fs.writeFileSync(path.join(skillDir, 'SKILL.md'), skillContent);