Skip to content

Commit 59d0ee6

Browse files
Eric AndradeCopilot
andcommitted
fix: sync installer fixes from claude-superskills (v2.0.7-v2.0.8)
- path-resolver.js: Copilot path ~/.github/skills/ → ~/.copilot/skills/ (global + local) - copilot.js: add migrateLegacySkills() — auto-cleans old ~/.github/skills/ on install - cli.js nuclearUninstall: add ~/.copilot/skills/ entry + keep ~/.github/skills/ as legacy - cli.js + interactive.js: add promptAction() — Nuke option on main installer screen Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 2b78ba2 commit 59d0ee6

4 files changed

Lines changed: 58 additions & 6 deletions

File tree

cli-installer/bin/cli.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env node
22

33
const { detectTools, getInstallInstructions } = require('../lib/detector');
4-
const { promptPlatforms, promptScope, setupEscapeHandler } = require('../lib/interactive');
4+
const { promptPlatforms, promptScope, promptAction, setupEscapeHandler } = require('../lib/interactive');
55
const { setupCleanupHandler } = require('../lib/cleanup');
66
const { installCopilotSkills } = require('../lib/copilot');
77
const { installClaudeSkills } = require('../lib/claude');
@@ -324,7 +324,8 @@ async function nuclearUninstall(quiet) {
324324
const home = os.homedir();
325325
const localDirs = getLocalProjectSkillDirs(process.cwd());
326326
const allPlatformDirs = [
327-
{ name: 'GitHub Copilot', dir: path.join(home, '.github', 'skills') },
327+
{ name: 'GitHub Copilot', dir: path.join(home, '.copilot', 'skills') },
328+
{ name: 'GitHub Copilot (legacy)', dir: path.join(home, '.github', 'skills') },
328329
{ name: 'Claude Code', dir: path.join(home, '.claude', 'skills') },
329330
{ name: 'Codex', dir: path.join(home, '.codex', 'skills') },
330331
{ name: 'OpenCode', dir: path.join(home, '.agent', 'skills') },
@@ -372,7 +373,7 @@ async function runNuclearFlow(quiet) {
372373

373374
console.log('\n' + chalk.bgRed.white.bold(' ☢️ NUCLEAR UNINSTALL — THIS CANNOT BE UNDONE ') + '\n');
374375
console.log(chalk.red(' This will delete ALL skill folders from ALL AI platforms:\n'));
375-
console.log(chalk.dim(' ~/.github/skills/ (GitHub Copilot)'));
376+
console.log(chalk.dim(' ~/.copilot/skills/ (GitHub Copilot)'));
376377
console.log(chalk.dim(' ~/.claude/skills/ (Claude Code)'));
377378
console.log(chalk.dim(' ~/.codex/skills/ (OpenAI Codex)'));
378379
console.log(chalk.dim(' ~/.agent/skills/ (OpenCode)'));
@@ -894,6 +895,14 @@ async function main() {
894895
process.exit(1);
895896
}
896897

898+
if (!skipPrompt) {
899+
const action = await promptAction();
900+
if (action === 'nuke') {
901+
await runNuclearFlow(quiet);
902+
return;
903+
}
904+
}
905+
897906
let scope = scopeFlag;
898907
if (!scope && !skipPrompt) {
899908
scope = await promptScope();

cli-installer/lib/copilot.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
11
const fs = require('fs-extra');
22
const path = require('path');
3+
const os = require('os');
34
const chalk = require('chalk');
45
const { getUserSkillsPath, isValidSkillName, assertSafePath } = require('./utils/path-resolver');
56

7+
const LEGACY_COPILOT_SKILLS_DIR = path.join(os.homedir(), '.github', 'skills');
8+
9+
async function migrateLegacySkills(quiet) {
10+
if (!fs.existsSync(LEGACY_COPILOT_SKILLS_DIR)) return;
11+
const entries = (await fs.readdir(LEGACY_COPILOT_SKILLS_DIR)).filter(e =>
12+
fs.existsSync(path.join(LEGACY_COPILOT_SKILLS_DIR, e, 'SKILL.md'))
13+
);
14+
if (entries.length === 0) return;
15+
for (const entry of entries) {
16+
await fs.remove(path.join(LEGACY_COPILOT_SKILLS_DIR, entry));
17+
}
18+
if (!quiet) {
19+
console.log(chalk.dim(` ↩️ Cleaned ${entries.length} skill(s) from old location ~/.github/skills/ (now using ~/.copilot/skills/)`));
20+
}
21+
}
22+
623
/**
724
* Install skills for GitHub Copilot CLI.
825
* @param {string} cacheDir - Path to cached skills dir (~/.claude-superskills/cache/{v}/skills/)
@@ -13,6 +30,7 @@ const { getUserSkillsPath, isValidSkillName, assertSafePath } = require('./utils
1330
*/
1431
async function installCopilotSkills(cacheDir, skills = null, quiet = false, targetDirOverride = null, label = 'Copilot') {
1532
const targetDir = targetDirOverride || getUserSkillsPath('copilot');
33+
await migrateLegacySkills(quiet);
1634
await fs.ensureDir(targetDir);
1735

1836
const availableSkills = (await fs.readdir(cacheDir)).filter(f =>

cli-installer/lib/interactive.js

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,31 @@ async function confirmCancel() {
4848
}
4949
}
5050

51+
/**
52+
* Ask user to choose the main action: install skills or nuke.
53+
* @returns {Promise<'install'|'nuke'>}
54+
*/
55+
async function promptAction() {
56+
const { action } = await inquirer.prompt([{
57+
type: 'list',
58+
name: 'action',
59+
message: 'What would you like to do?',
60+
choices: [
61+
{
62+
name: 'Install / Update skills',
63+
value: 'install'
64+
},
65+
new inquirer.Separator(),
66+
{
67+
name: chalk.red('☢️ Nuke — Remove ALL skills from ALL platforms'),
68+
value: 'nuke'
69+
}
70+
],
71+
default: 'install'
72+
}]);
73+
return action;
74+
}
75+
5176
/**
5277
* Ask user to choose install scope: global (~/.<platform>/skills/) or local (./<platform>/skills/).
5378
* @returns {Promise<'global'|'local'>}
@@ -188,4 +213,4 @@ async function promptPlatforms(detected, options = {}) {
188213
return answers.platforms;
189214
}
190215

191-
module.exports = { promptPlatforms, promptScope, setupEscapeHandler, confirmCancel };
216+
module.exports = { promptPlatforms, promptScope, promptAction, setupEscapeHandler, confirmCancel };

cli-installer/lib/utils/path-resolver.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function getUserSkillsPath(platform) {
3939

4040
const platformDirs = {
4141
'codex': path.join(home, '.codex', 'skills'),
42-
'copilot': path.join(home, '.github', 'skills'),
42+
'copilot': path.join(home, '.copilot', 'skills'),
4343
'claude': path.join(home, '.claude', 'skills'),
4444
'opencode': path.join(home, '.agent', 'skills'),
4545
'gemini': path.join(home, '.gemini', 'skills'),
@@ -62,7 +62,7 @@ function getUserSkillsPath(platform) {
6262
function getLocalSkillsPath(platform, projectRoot = process.cwd()) {
6363
const platformDirs = {
6464
'codex': path.join(projectRoot, '.codex', 'skills'),
65-
'copilot': path.join(projectRoot, '.github', 'skills'),
65+
'copilot': path.join(projectRoot, '.copilot', 'skills'),
6666
'claude': path.join(projectRoot, '.claude', 'skills'),
6767
'opencode': path.join(projectRoot, '.agent', 'skills'),
6868
'gemini': path.join(projectRoot, '.gemini', 'skills'),

0 commit comments

Comments
 (0)