aweskill 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/lib/backup.ts","../src/lib/path.ts","../src/commands/backup.ts","../src/lib/bundles.ts","../src/lib/skills.ts","../src/lib/templates.ts","../src/commands/bundle.ts","../src/lib/import.ts","../src/lib/scanner.ts","../src/lib/agents.ts","../src/commands/import.ts","../src/lib/symlink.ts","../src/commands/check.ts","../src/commands/disable.ts","../src/commands/enable.ts","../src/commands/scan.ts","../src/commands/init.ts","../src/commands/list.ts","../src/commands/recover.ts","../src/lib/references.ts","../src/commands/remove.ts","../src/commands/restore.ts","../src/lib/rmdup.ts","../src/commands/rmdup.ts","../src/commands/sync.ts","../src/lib/runtime.ts","../src/lib/ui.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { Command } from \"commander\";\nimport { homedir } from \"node:os\";\n\nimport { runBackup } from \"./commands/backup.js\";\nimport {\n runBundleAddTemplate,\n runBundleAddSkill,\n runBundleCreate,\n runBundleDelete,\n runBundleRemoveSkill,\n runBundleShow,\n} from \"./commands/bundle.js\";\nimport { runImport } from \"./commands/import.js\";\nimport { runCheck } from \"./commands/check.js\";\nimport { runDisable } from \"./commands/disable.js\";\nimport { runEnable } from \"./commands/enable.js\";\nimport { runInit } from \"./commands/init.js\";\nimport { runListBundles, runListSkills, runListTemplateBundles } from \"./commands/list.js\";\nimport { runRecover } from \"./commands/recover.js\";\nimport { runRemove } from \"./commands/remove.js\";\nimport { runRestore } from \"./commands/restore.js\";\nimport { runRmdup } from \"./commands/rmdup.js\";\nimport { runScan } from \"./commands/scan.js\";\nimport { runSync } from \"./commands/sync.js\";\nimport { isDirectCliEntry } from \"./lib/runtime.js\";\nimport { introCommand, outroCommand, writeCliError, writeCliMessage } from \"./lib/ui.js\";\nimport type { ActivationType, ImportMode, RuntimeContext, Scope } from \"./types.js\";\n\nfunction createRuntimeContext(overrides: Partial<RuntimeContext> = {}): RuntimeContext {\n return {\n cwd: overrides.cwd ?? process.cwd(),\n homeDir: overrides.homeDir ?? process.env.AWESKILL_HOME ?? homedir(),\n write: overrides.write ?? writeCliMessage,\n error: overrides.error ?? writeCliError,\n };\n}\n\nasync function runFramedCommand<T>(title: string, action: () => Promise<T>): Promise<T> {\n introCommand(title);\n const result = await action();\n outroCommand();\n return result;\n}\n\nfunction collectAgents(value: string, previous?: string[]): string[] {\n return [...(previous ?? []), ...value.split(\",\").map((entry) => entry.trim()).filter(Boolean)];\n}\n\nfunction getMode(value: string): ImportMode {\n if (value === \"mv\" || value === \"cp\") {\n return value;\n }\n throw new Error(`Unsupported import mode: ${value}. Use \"cp\" or \"mv\".`);\n}\n\nfunction getActivationType(value: string): ActivationType {\n if (value === \"bundle\" || value === \"skill\") {\n return value;\n }\n throw new Error(`Unsupported activation type: ${value}`);\n}\n\nfunction formatCliErrorMessage(message: string): string {\n const match = message.match(/missing required argument '([^']+)'/i);\n if (!match) {\n const optionMatch = message.match(/option '([^']+)' argument missing/i);\n if (optionMatch?.[1] === \"--agent <agent>\") {\n return \"Option --agent <agent> argument missing. Use one or more supported agent ids, for example \\\"codex\\\" or \\\"codex,cursor\\\". Run \\\"aweskill agent supported\\\" to see the supported agent list.\";\n }\n const normalizedMessage = message.replace(/^error:\\s*/i, \"\");\n const bundleFileMatch = normalizedMessage.match(/ENOENT: no such file or directory, open '([^']+\\/bundles\\/([^/'\"]+)\\.ya?ml)'/i);\n if (bundleFileMatch) {\n const bundleName = bundleFileMatch[2]!;\n if (bundleFileMatch[1]?.includes(\"/template/bundles/\")) {\n return `Bundle template not found: ${bundleName}. Run \"aweskill bundle template list\" to see available bundle templates.`;\n }\n return `Bundle not found: ${bundleName}. Run \"aweskill bundle list\" to see available bundles.`;\n }\n const unknownSkillMatch = normalizedMessage.match(/^Unknown skill: (.+)$/);\n if (unknownSkillMatch) {\n return `Unknown skill: ${unknownSkillMatch[1]}. Run \"aweskill skill list\" to see available skills.`;\n }\n const bundleNotFoundMatch = normalizedMessage.match(/^Bundle not found: (.+)$/);\n if (bundleNotFoundMatch) {\n return `Bundle not found: ${bundleNotFoundMatch[1]}. Run \"aweskill bundle list\" to see available bundles.`;\n }\n return normalizedMessage;\n }\n\n const argName = match[1]!;\n const hints: Record<string, string> = {\n archive: 'Use a backup archive path, for example \"skills-2026-04-12T19-20-00Z.tar.gz\".',\n bundle: \"Use a bundle name.\",\n name: 'Use a bundle or skill name, for example \"my-bundle\", \"biopython\", or \"all\".',\n skill: \"Use a skill name.\",\n type: 'Use \"bundle\" or \"skill\".',\n };\n const hint = hints[argName];\n return `Missing required argument <${argName}>.${hint ? ` ${hint}` : \"\"}`;\n}\n\nfunction writeSupportedAgents(context: RuntimeContext): void {\n const lines = [\n \"Supported agents:\",\n \"amp (Amp)\",\n \"claude-code (Claude Code)\",\n \"cline (Cline)\",\n \"codex (Codex)\",\n \"cursor (Cursor)\",\n \"gemini-cli (Gemini CLI)\",\n \"goose (Goose)\",\n \"opencode (OpenCode)\",\n \"roo (Roo Code)\",\n \"windsurf (Windsurf)\",\n ];\n for (const line of lines) {\n context.write(line);\n }\n}\n\nfunction configureCommandTree(command: Command): void {\n command.showHelpAfterError();\n command.exitOverride((error) => {\n throw new Error(formatCliErrorMessage(error.message));\n });\n\n for (const child of command.commands) {\n configureCommandTree(child);\n }\n}\n\n\nexport function createProgram(overrides: Partial<RuntimeContext> = {}) {\n const context = createRuntimeContext(overrides);\n const program = new Command();\n\n program\n .name(\"aweskill\")\n .description(\"Local skill orchestration CLI for AI agents\")\n .version(\"0.1.5\")\n .helpOption(\"-h, --help\", \"Display help\");\n\n const skill = program.command(\"skill\").description(\"Manage skills in the central store\");\n skill\n .command(\"list\")\n .description(\"List skills in the central store\")\n .option(\"--verbose\", \"show all skills instead of a short preview\", false)\n .action(async (options) => {\n await runListSkills(context, { verbose: options.verbose });\n });\n skill\n .command(\"scan\")\n .description(\"Scan supported agent skill directories\")\n .option(\"--verbose\", \"show scanned skill details instead of per-agent totals\", false)\n .action(async (options) => {\n await runFramedCommand(\" aweskill skill scan \", async () =>\n runScan(context, {\n verbose: options.verbose,\n }),\n );\n });\n skill\n .command(\"import\")\n .argument(\"[path]\")\n .description(\"Import one skill or a skills root directory\")\n .option(\"--scan\", \"import scanned skills\", false)\n .option(\"--mode <mode>\", \"import mode: cp (default) or mv\", getMode, \"cp\")\n .option(\"--override\", \"overwrite existing files when importing\", false)\n .action(async (sourcePath, options) => {\n await runFramedCommand(\" aweskill skill import \", async () =>\n runImport(context, {\n sourcePath,\n scan: options.scan,\n mode: options.mode,\n override: options.override,\n }),\n );\n });\n skill\n .command(\"remove\")\n .argument(\"<skill>\")\n .description(\"Remove a skill from the central store\")\n .option(\"--force\", \"remove and clean references\", false)\n .option(\"--project <dir>\", \"project config to inspect\")\n .action(async (skillName, options) => {\n await runFramedCommand(\" aweskill skill remove \", async () =>\n runRemove(context, {\n skillName,\n force: options.force,\n projectDir: options.project,\n }),\n );\n });\n\n const bundle = program.command(\"bundle\").description(\"Manage skill bundles\");\n bundle\n .command(\"list\")\n .description(\"List bundles in the central store\")\n .option(\"--verbose\", \"show all bundles instead of a short preview\", false)\n .action(async (options) => {\n await runListBundles(context, { verbose: options.verbose });\n });\n bundle.command(\"create\").argument(\"<name>\").description(\"Create a bundle\").action(async (name) => {\n await runFramedCommand(\" aweskill bundle create \", async () => runBundleCreate(context, name));\n });\n bundle.command(\"show\").argument(\"<name>\").description(\"Show bundle contents\").action(async (name) => {\n await runBundleShow(context, name);\n });\n bundle\n .command(\"add\")\n .argument(\"<bundle>\")\n .argument(\"<skill>\")\n .description(\"Add skill entries to one or more bundles\")\n .action(async (bundleName, skillName) => {\n await runFramedCommand(\" aweskill bundle add \", async () => runBundleAddSkill(context, bundleName, skillName));\n });\n bundle\n .command(\"remove\")\n .argument(\"<bundle>\")\n .argument(\"<skill>\")\n .description(\"Remove skill entries from one or more bundles\")\n .action(async (bundleName, skillName) => {\n await runFramedCommand(\" aweskill bundle remove \", async () => runBundleRemoveSkill(context, bundleName, skillName));\n });\n bundle.command(\"delete\").argument(\"<name>\").description(\"Delete a bundle\").action(async (name) => {\n await runFramedCommand(\" aweskill bundle delete \", async () => runBundleDelete(context, name));\n });\n const bundleTemplate = bundle.command(\"template\").description(\"Manage built-in bundle templates\");\n bundleTemplate\n .command(\"list\")\n .description(\"List available built-in bundle templates\")\n .option(\"--verbose\", \"show all bundle templates instead of a short preview\", false)\n .action(async (options) => {\n await runListTemplateBundles(context, { verbose: options.verbose });\n });\n bundleTemplate.command(\"import\").argument(\"<name>\").description(\"Copy built-in templates into the central store\").action(async (name) => {\n await runFramedCommand(\" aweskill bundle template import \", async () => runBundleAddTemplate(context, name));\n });\n\n const agent = program.command(\"agent\").description(\"Manage skills used by agents\");\n agent.command(\"supported\").description(\"List supported agent ids and display names\").action(async () => {\n writeSupportedAgents(context);\n });\n agent\n .command(\"list\")\n .description(\"Inspect agent skill directories and optionally normalize them\")\n .option(\"--global\", \"check global scope (default when no scope flag given)\")\n .option(\"--project [dir]\", \"check project scope; uses cwd when dir is omitted\")\n .option(\"--agent <agent>\", 'repeat or use comma list; defaults to all; run \"aweskill agent supported\" to see supported ids', collectAgents)\n .option(\"--update\", \"import missing skills into the central store and relink duplicates/new skills\", false)\n .option(\"--verbose\", \"show all skills in each category instead of a short preview\", false)\n .action(async (options) => {\n const isProject = options.project !== undefined;\n const scope: Scope = isProject ? \"project\" : \"global\";\n const projectDir = isProject && typeof options.project === \"string\" ? options.project : undefined;\n await runFramedCommand(\" aweskill agent list \", async () =>\n runCheck(context, {\n scope,\n agents: options.agent ?? [],\n projectDir,\n update: options.update,\n verbose: options.verbose,\n }),\n );\n });\n agent\n .command(\"add\")\n .description(\"Create skill projections in agent directories\")\n .argument(\"<type>\", \"bundle or skill\", getActivationType)\n .argument(\"<name>\", 'bundle or skill name(s), comma-separated, or \"all\"')\n .option(\"--global\", \"apply to global scope (default when no scope flag given)\")\n .option(\"--project [dir]\", \"apply to project scope; uses cwd when dir is omitted\")\n .option(\"--agent <agent>\", 'repeat or use comma list; defaults to all; run \"aweskill agent supported\" to see supported ids', collectAgents)\n .action(async (type, targetName, options) => {\n const isProject = options.project !== undefined;\n const scope: Scope = isProject ? \"project\" : \"global\";\n const projectDir = isProject && typeof options.project === \"string\" ? options.project : undefined;\n await runFramedCommand(\" aweskill agent add \", async () =>\n runEnable(context, {\n type,\n name: targetName,\n scope,\n agents: options.agent ?? [],\n projectDir,\n }),\n );\n });\n agent\n .command(\"remove\")\n .description(\"Remove skill projections in agent directories\")\n .argument(\"<type>\", \"bundle or skill\", getActivationType)\n .argument(\"<name>\", 'bundle or skill name(s), comma-separated, or \"all\"')\n .option(\"--global\", \"apply to global scope (default when no scope flag given)\")\n .option(\"--project [dir]\", \"apply to project scope; uses cwd when dir is omitted\")\n .option(\"--agent <agent>\", 'repeat or use comma list; defaults to all; run \"aweskill agent supported\" to see supported ids', collectAgents)\n .option(\n \"--force\",\n \"with skill: remove projection even when this skill is in a bundle that still has other members enabled here\",\n false,\n )\n .action(async (type, targetName, options) => {\n const isProject = options.project !== undefined;\n const scope: Scope = isProject ? \"project\" : \"global\";\n const projectDir = isProject && typeof options.project === \"string\" ? options.project : undefined;\n await runFramedCommand(\" aweskill agent remove \", async () =>\n runDisable(context, {\n type,\n name: targetName,\n scope,\n agents: options.agent ?? [],\n projectDir,\n force: options.force,\n }),\n );\n });\n agent\n .command(\"sync\")\n .description(\"Remove stale managed projections whose source skill no longer exists\")\n .option(\"--project <dir>\", \"also check this project directory\")\n .action(async (options) => {\n await runFramedCommand(\" aweskill agent sync \", async () => runSync(context, { projectDir: options.project }));\n });\n agent\n .command(\"recover\")\n .description(\"Convert aweskill-managed symlink projections into full skill directories\")\n .option(\"--global\", \"recover global scope (default when no scope flag given)\")\n .option(\"--project [dir]\", \"recover project scope; uses cwd when dir is omitted\")\n .option(\"--agent <agent>\", 'repeat or use comma list; defaults to all; run \"aweskill agent supported\" to see supported ids', collectAgents)\n .action(async (options) => {\n const isProject = options.project !== undefined;\n const scope: Scope = isProject ? \"project\" : \"global\";\n const projectDir = isProject && typeof options.project === \"string\" ? options.project : undefined;\n await runFramedCommand(\" aweskill agent recover \", async () =>\n runRecover(context, {\n scope,\n agents: options.agent ?? [],\n projectDir,\n }),\n );\n });\n\n const store = program.command(\"store\").description(\"Manage the aweskill local store\");\n store\n .command(\"init\")\n .description(\"Create ~/.aweskill layout\")\n .option(\"--scan\", \"scan existing agent directories after init\", false)\n .option(\"--verbose\", \"show scanned skill details instead of per-agent totals\", false)\n .action(async (options) => {\n await runFramedCommand(\" aweskill store init \", async () => runInit(context, options));\n });\n store\n .command(\"backup\")\n .description(\"Create a timestamped archive of the central skills repository\")\n .action(async () => {\n await runFramedCommand(\" aweskill store backup \", async () => runBackup(context));\n });\n store\n .command(\"restore\")\n .argument(\"<archive>\")\n .description(\"Restore skills from a backup archive and auto-back up the current skills first\")\n .option(\"--override\", \"replace existing skills with the archive contents\", false)\n .action(async (archivePath, options) => {\n await runFramedCommand(\" aweskill store restore \", async () =>\n runRestore(context, {\n archivePath,\n override: options.override,\n }),\n );\n });\n\n const doctor = program.command(\"doctor\").description(\"Diagnose and repair repository issues\");\n doctor\n .command(\"dedupe\")\n .description(\"Find or remove duplicate central-store skills with numeric/version suffixes\")\n .option(\"--fix\", \"move duplicate skills into dup_skills (or delete them with --delete)\", false)\n .option(\"--delete\", \"when used with --fix, permanently delete duplicates instead of moving them\", false)\n .action(async (options) => {\n await runFramedCommand(\" aweskill doctor dedupe \", async () =>\n runRmdup(context, {\n remove: options.fix,\n delete: options.delete,\n }),\n );\n });\n\n configureCommandTree(program);\n return program;\n}\n\nexport async function main(argv = process.argv) {\n const program = createProgram();\n try {\n await program.parseAsync(argv);\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n if (message === \"(outputHelp)\" || message === \"outputHelp\") {\n return;\n }\n\n console.error(`Error: ${formatCliErrorMessage(message)}`);\n process.exitCode = 1;\n }\n}\n\nif (isDirectCliEntry(import.meta.url, process.argv[1])) {\n void main();\n}\n","import { access, mkdtemp, mkdir } from \"node:fs/promises\";\nimport { tmpdir } from \"node:os\";\nimport path from \"node:path\";\nimport { spawn } from \"node:child_process\";\n\nimport { getAweskillPaths } from \"./path.js\";\n\nfunction formatTimestamp(date: Date): string {\n return date.toISOString().replace(/:/g, \"-\").replace(/\\.\\d{3}Z$/, \"Z\");\n}\n\nasync function runTar(args: string[]): Promise<void> {\n await new Promise<void>((resolve, reject) => {\n const child = spawn(\"tar\", args, { stdio: \"ignore\" });\n child.on(\"error\", reject);\n child.on(\"exit\", (code) => {\n if (code === 0) {\n resolve();\n return;\n }\n reject(new Error(`tar exited with code ${code ?? \"unknown\"}`));\n });\n });\n}\n\nexport async function createSkillsBackupArchive(homeDir: string): Promise<string> {\n const { rootDir, skillsDir, backupDir } = getAweskillPaths(homeDir);\n await mkdir(backupDir, { recursive: true });\n\n const archivePath = await nextBackupArchivePath(backupDir);\n\n await runTar([\"-czf\", archivePath, \"-C\", rootDir, path.relative(rootDir, skillsDir)]);\n return archivePath;\n}\n\nexport async function extractSkillsArchive(archivePath: string): Promise<{ tempDir: string; extractedSkillsDir: string }> {\n const tempDir = await mkdtemp(path.join(tmpdir(), \"aweskill-restore-\"));\n await runTar([\"-xzf\", archivePath, \"-C\", tempDir]);\n return {\n tempDir,\n extractedSkillsDir: path.join(tempDir, \"skills\"),\n };\n}\n\nasync function nextBackupArchivePath(backupDir: string): Promise<string> {\n const base = `skills-${formatTimestamp(new Date())}`;\n const primary = path.join(backupDir, `${base}.tar.gz`);\n if (!(await pathExists(primary))) {\n return primary;\n }\n\n let index = 1;\n while (true) {\n const candidate = path.join(backupDir, `${base}-${index}.tar.gz`);\n if (!(await pathExists(candidate))) {\n return candidate;\n }\n index += 1;\n }\n}\n\nasync function pathExists(targetPath: string): Promise<boolean> {\n try {\n await access(targetPath);\n return true;\n } catch {\n return false;\n }\n}\n","import { homedir } from \"node:os\";\nimport path from \"node:path\";\n\nimport type { AweskillPaths } from \"../types.js\";\n\nexport function sanitizeName(input: string): string {\n return input\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9._-]+/g, \"-\")\n .replace(/^-+/, \"\")\n .replace(/-+$/, \"\")\n .slice(0, 80);\n}\n\nexport function expandHomePath(targetPath: string, homeDir = homedir()): string {\n if (targetPath === \"~\") {\n return homeDir;\n }\n\n if (targetPath.startsWith(\"~/\")) {\n return path.join(homeDir, targetPath.slice(2));\n }\n\n return targetPath;\n}\n\nexport function getAweskillPaths(homeDir: string): AweskillPaths {\n const rootDir = path.join(homeDir, \".aweskill\");\n return {\n homeDir,\n rootDir,\n skillsDir: path.join(rootDir, \"skills\"),\n dupSkillsDir: path.join(rootDir, \"dup_skills\"),\n backupDir: path.join(rootDir, \"backup\"),\n bundlesDir: path.join(rootDir, \"bundles\"),\n };\n}\n\nexport function getProjectConfigPath(projectDir: string): string {\n return path.join(projectDir, \".aweskill.yaml\");\n}\n\nexport function isPathSafe(baseDir: string, targetPath: string): boolean {\n const base = path.resolve(baseDir);\n const target = path.resolve(targetPath);\n\n if (base === target) {\n return true;\n }\n\n const relativePath = path.relative(base, target);\n return relativePath !== \"\" && !relativePath.startsWith(\"..\") && !path.isAbsolute(relativePath);\n}\n\nexport function assertPathSafe(baseDir: string, targetPath: string): void {\n if (!isPathSafe(baseDir, targetPath)) {\n throw new Error(`Path escapes base directory: ${targetPath}`);\n }\n}\n\nexport function uniqueSorted<T>(items: T[]): T[] {\n return [...new Set(items)].sort() as T[];\n}\n\nexport function splitCommaValues(input: string): string[] {\n return input\n .split(\",\")\n .map((value) => value.trim())\n .filter(Boolean);\n}\n","import { createSkillsBackupArchive } from \"../lib/backup.js\";\nimport type { RuntimeContext } from \"../types.js\";\n\nexport async function runBackup(context: RuntimeContext) {\n const archivePath = await createSkillsBackupArchive(context.homeDir);\n context.write(`Backed up skills to ${archivePath}`);\n return { archivePath };\n}\n","import { access, mkdir, readFile, readdir, rm, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\n\nimport { parse, stringify } from \"yaml\";\n\nimport type { BundleDefinition } from \"../types.js\";\nimport { getAweskillPaths, sanitizeName, uniqueSorted } from \"./path.js\";\nimport { skillExists } from \"./skills.js\";\n\nasync function pathExists(targetPath: string): Promise<boolean> {\n try {\n await access(targetPath);\n return true;\n } catch {\n return false;\n }\n}\n\nfunction bundleFilePath(homeDir: string, bundleName: string): string {\n return path.join(getAweskillPaths(homeDir).bundlesDir, `${sanitizeName(bundleName)}.yaml`);\n}\n\nfunction bundleFilePathInDirectory(bundlesDir: string, bundleName: string): string {\n return path.join(bundlesDir, `${sanitizeName(bundleName)}.yaml`);\n}\n\nfunction normalizeBundle(raw: unknown, fallbackName: string): BundleDefinition {\n const data = (raw ?? {}) as Partial<BundleDefinition>;\n return {\n name: sanitizeName(data.name ?? fallbackName),\n skills: uniqueSorted((data.skills ?? []).map((skill) => sanitizeName(String(skill))).filter(Boolean)),\n };\n}\n\nexport async function listBundles(homeDir: string): Promise<BundleDefinition[]> {\n const bundlesDir = getAweskillPaths(homeDir).bundlesDir;\n return listBundlesInDirectory(bundlesDir);\n}\n\nexport async function listBundlesInDirectory(bundlesDir: string): Promise<BundleDefinition[]> {\n await mkdir(bundlesDir, { recursive: true });\n const entries = await readdir(bundlesDir, { withFileTypes: true });\n\n const bundles = await Promise.all(\n entries\n .filter((entry) => entry.isFile() && entry.name.endsWith(\".yaml\"))\n .map(async (entry) => readBundleFromDirectory(bundlesDir, entry.name.replace(/\\.yaml$/, \"\"))),\n );\n\n return bundles.sort((left, right) => left.name.localeCompare(right.name));\n}\n\nexport async function readBundle(homeDir: string, bundleName: string): Promise<BundleDefinition> {\n const filePath = bundleFilePath(homeDir, bundleName);\n const content = await readFile(filePath, \"utf8\");\n return normalizeBundle(parse(content), bundleName);\n}\n\nexport async function readBundleFromDirectory(bundlesDir: string, bundleName: string): Promise<BundleDefinition> {\n const filePath = bundleFilePathInDirectory(bundlesDir, bundleName);\n const content = await readFile(filePath, \"utf8\");\n return normalizeBundle(parse(content), bundleName);\n}\n\nexport async function writeBundle(homeDir: string, bundle: BundleDefinition): Promise<BundleDefinition> {\n const normalized = normalizeBundle(bundle, bundle.name);\n const filePath = bundleFilePath(homeDir, normalized.name);\n await mkdir(path.dirname(filePath), { recursive: true });\n await writeFile(filePath, stringify(normalized), \"utf8\");\n return normalized;\n}\n\nexport async function createBundle(homeDir: string, bundleName: string): Promise<BundleDefinition> {\n const normalizedName = sanitizeName(bundleName);\n return writeBundle(homeDir, { name: normalizedName, skills: [] });\n}\n\nexport async function addSkillToBundle(homeDir: string, bundleName: string, skillName: string): Promise<BundleDefinition> {\n const normalizedSkill = sanitizeName(skillName);\n if (!(await skillExists(homeDir, normalizedSkill))) {\n throw new Error(`Unknown skill: ${normalizedSkill}`);\n }\n\n const bundle = await readBundle(homeDir, bundleName);\n bundle.skills = uniqueSorted([...bundle.skills, normalizedSkill].filter(Boolean));\n return writeBundle(homeDir, bundle);\n}\n\nexport async function removeSkillFromBundle(homeDir: string, bundleName: string, skillName: string): Promise<BundleDefinition> {\n const bundle = await readBundle(homeDir, bundleName);\n const normalizedSkill = sanitizeName(skillName);\n bundle.skills = bundle.skills.filter((skill) => skill !== normalizedSkill);\n return writeBundle(homeDir, bundle);\n}\n\nexport async function deleteBundle(homeDir: string, bundleName: string): Promise<boolean> {\n const filePath = bundleFilePath(homeDir, bundleName);\n if (!(await pathExists(filePath))) {\n return false;\n }\n\n await rm(filePath, { force: true });\n return true;\n}\n","import { access, mkdir, readdir } from \"node:fs/promises\";\nimport path from \"node:path\";\n\nimport type { SkillEntry } from \"../types.js\";\nimport { getAweskillPaths, sanitizeName } from \"./path.js\";\n\nasync function pathExists(targetPath: string): Promise<boolean> {\n try {\n await access(targetPath);\n return true;\n } catch {\n return false;\n }\n}\n\nexport async function ensureHomeLayout(homeDir: string): Promise<void> {\n const paths = getAweskillPaths(homeDir);\n await mkdir(paths.rootDir, { recursive: true });\n await mkdir(paths.skillsDir, { recursive: true });\n await mkdir(paths.dupSkillsDir, { recursive: true });\n await mkdir(paths.backupDir, { recursive: true });\n await mkdir(paths.bundlesDir, { recursive: true });\n}\n\nexport function getSkillPath(homeDir: string, skillName: string): string {\n return path.join(getAweskillPaths(homeDir).skillsDir, sanitizeName(skillName));\n}\n\nexport async function listSkills(homeDir: string): Promise<SkillEntry[]> {\n const skillsDir = getAweskillPaths(homeDir).skillsDir;\n return listSkillEntriesInDirectory(skillsDir);\n}\n\nexport async function listSkillEntriesInDirectory(skillsDir: string): Promise<SkillEntry[]> {\n if (!(await pathExists(skillsDir))) {\n return [];\n }\n\n const entries = await readdir(skillsDir, { withFileTypes: true });\n const skills = await Promise.all(\n entries\n .filter((entry) => entry.isDirectory() || entry.isSymbolicLink())\n .map(async (entry) => {\n const skillPath = path.join(skillsDir, entry.name);\n return {\n name: entry.name,\n path: skillPath,\n hasSKILLMd: await pathExists(path.join(skillPath, \"SKILL.md\")),\n } satisfies SkillEntry;\n }),\n );\n\n return skills.sort((left, right) => left.name.localeCompare(right.name));\n}\n\nexport async function assertSkillSource(sourcePath: string): Promise<void> {\n const skillReadme = path.join(sourcePath, \"SKILL.md\");\n if (!(await pathExists(skillReadme))) {\n throw new Error(`Skill source must contain SKILL.md: ${sourcePath}`);\n }\n}\n\nexport async function skillExists(homeDir: string, skillName: string): Promise<boolean> {\n return pathExists(getSkillPath(homeDir, skillName));\n}\n","import { access } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nasync function pathExists(targetPath: string): Promise<boolean> {\n try {\n await access(targetPath);\n return true;\n } catch {\n return false;\n }\n}\n\nexport async function getTemplateBundlesDir(): Promise<string> {\n const moduleDir = path.dirname(fileURLToPath(import.meta.url));\n const candidates = [\n path.resolve(moduleDir, \"..\", \"..\", \"template\", \"bundles\"),\n path.resolve(moduleDir, \"..\", \"template\", \"bundles\"),\n ];\n\n for (const candidate of candidates) {\n if (await pathExists(candidate)) {\n return candidate;\n }\n }\n\n throw new Error(`Template bundles directory not found. Checked: ${candidates.join(\", \")}`);\n}\n","import { addSkillToBundle, createBundle, deleteBundle, readBundle, readBundleFromDirectory, removeSkillFromBundle, writeBundle } from \"../lib/bundles.js\";\nimport { sanitizeName, splitCommaValues, uniqueSorted } from \"../lib/path.js\";\nimport { getTemplateBundlesDir } from \"../lib/templates.js\";\nimport type { RuntimeContext } from \"../types.js\";\n\nfunction parseNames(value: string): string[] {\n return uniqueSorted(splitCommaValues(value).map((entry) => sanitizeName(entry)));\n}\n\nexport async function runBundleCreate(context: RuntimeContext, bundleName: string) {\n const bundles = await Promise.all(parseNames(bundleName).map((name) => createBundle(context.homeDir, name)));\n context.write(bundles.map((bundle) => `Created bundle ${bundle.name}`).join(\"\\n\"));\n return bundles;\n}\n\nexport async function runBundleShow(context: RuntimeContext, bundleName: string) {\n const bundles = await Promise.all(parseNames(bundleName).map((name) => readBundle(context.homeDir, name)));\n context.write(bundles.map((bundle) => `${bundle.name}: ${bundle.skills.join(\", \") || \"(empty)\"}`).join(\"\\n\"));\n return bundles;\n}\n\nexport async function runBundleAddSkill(context: RuntimeContext, bundleName: string, skillName: string) {\n const bundleNames = parseNames(bundleName);\n const skillNames = parseNames(skillName);\n const bundles = [];\n for (const currentBundleName of bundleNames) {\n let bundle = await readBundle(context.homeDir, currentBundleName);\n for (const currentSkillName of skillNames) {\n bundle = await addSkillToBundle(context.homeDir, bundle.name, currentSkillName);\n }\n bundles.push(bundle);\n }\n context.write(bundles.map((bundle) => `Bundle ${bundle.name}: ${bundle.skills.join(\", \") || \"(empty)\"}`).join(\"\\n\"));\n return bundles;\n}\n\nexport async function runBundleRemoveSkill(context: RuntimeContext, bundleName: string, skillName: string) {\n const bundleNames = parseNames(bundleName);\n const skillNames = parseNames(skillName);\n const bundles = [];\n for (const currentBundleName of bundleNames) {\n let bundle = await readBundle(context.homeDir, currentBundleName);\n for (const currentSkillName of skillNames) {\n bundle = await removeSkillFromBundle(context.homeDir, bundle.name, currentSkillName);\n }\n bundles.push(bundle);\n }\n context.write(bundles.map((bundle) => `Bundle ${bundle.name}: ${bundle.skills.join(\", \") || \"(empty)\"}`).join(\"\\n\"));\n return bundles;\n}\n\nexport async function runBundleDelete(context: RuntimeContext, bundleName: string) {\n const deletedNames: string[] = [];\n for (const currentBundleName of parseNames(bundleName)) {\n const deleted = await deleteBundle(context.homeDir, currentBundleName);\n if (!deleted) {\n throw new Error(`Bundle not found: ${currentBundleName}`);\n }\n deletedNames.push(currentBundleName);\n }\n\n context.write(deletedNames.map((name) => `Deleted bundle ${name}`).join(\"\\n\"));\n return deletedNames;\n}\n\nexport async function runBundleAddTemplate(context: RuntimeContext, bundleName: string) {\n const templateBundlesDir = await getTemplateBundlesDir();\n const bundles = [];\n\n for (const currentBundleName of parseNames(bundleName)) {\n const templateBundle = await readBundleFromDirectory(templateBundlesDir, currentBundleName);\n\n try {\n await readBundle(context.homeDir, templateBundle.name);\n throw new Error(`Bundle already exists: ${templateBundle.name}`);\n } catch (error) {\n if (!(error instanceof Error) || !error.message.includes(\"ENOENT\")) {\n if (error instanceof Error && error.message.startsWith(\"Bundle already exists:\")) {\n throw error;\n }\n throw error;\n }\n }\n\n bundles.push(await writeBundle(context.homeDir, templateBundle));\n }\n\n context.write(bundles.map((bundle) => `Added bundle ${bundle.name} from template`).join(\"\\n\"));\n return bundles;\n}\n","import { access, cp, lstat, mkdir, readlink, readdir, rename, rm, stat } from \"node:fs/promises\";\nimport path from \"node:path\";\n\nimport type { ImportMode, ImportResult, ScanCandidate } from \"../types.js\";\nimport { sanitizeName } from \"./path.js\";\nimport { assertSkillSource, getSkillPath, skillExists } from \"./skills.js\";\n\nclass MissingSymlinkSourceError extends Error {\n sourcePath: string;\n resolvedSourcePath: string;\n\n constructor(sourcePath: string, resolvedSourcePath: string) {\n super(`Missing symlink source: ${resolvedSourcePath}`);\n this.name = \"MissingSymlinkSourceError\";\n this.sourcePath = sourcePath;\n this.resolvedSourcePath = resolvedSourcePath;\n }\n}\n\nasync function pathExists(targetPath: string): Promise<boolean> {\n try {\n await access(targetPath);\n return true;\n } catch {\n return false;\n }\n}\n\nasync function resolveImportSource(sourcePath: string): Promise<{\n effectiveSourcePath: string;\n isSymlinkSource: boolean;\n}> {\n const statResult = await lstat(sourcePath);\n if (!statResult.isSymbolicLink()) {\n return {\n effectiveSourcePath: sourcePath,\n isSymlinkSource: false,\n };\n }\n\n const linkTarget = await readlink(sourcePath);\n const resolvedSourcePath = path.resolve(path.dirname(sourcePath), linkTarget);\n if (!(await pathExists(resolvedSourcePath))) {\n throw new MissingSymlinkSourceError(sourcePath, resolvedSourcePath);\n }\n\n return {\n effectiveSourcePath: resolvedSourcePath,\n isSymlinkSource: true,\n };\n}\n\nasync function mergeMissingEntries(sourcePath: string, destinationPath: string): Promise<void> {\n const sourceStat = await stat(sourcePath);\n\n if (sourceStat.isDirectory()) {\n await mkdir(destinationPath, { recursive: true });\n const entries = await readdir(sourcePath, { withFileTypes: true });\n for (const entry of entries) {\n await mergeMissingEntries(path.join(sourcePath, entry.name), path.join(destinationPath, entry.name));\n }\n return;\n }\n\n if (await pathExists(destinationPath)) {\n return;\n }\n\n await mkdir(path.dirname(destinationPath), { recursive: true });\n await cp(sourcePath, destinationPath, { recursive: false, errorOnExist: true, force: false });\n}\n\nasync function copyIntoDestination(sourcePath: string, destination: string, override: boolean): Promise<void> {\n if (!override && (await pathExists(destination))) {\n await mergeMissingEntries(sourcePath, destination);\n return;\n }\n\n await cp(sourcePath, destination, { recursive: true, errorOnExist: false, force: override });\n}\n\nasync function moveIntoDestination(sourcePath: string, destination: string, override: boolean): Promise<void> {\n if (!(await pathExists(destination))) {\n await rename(sourcePath, destination);\n return;\n }\n\n if (override) {\n await cp(sourcePath, destination, { recursive: true, errorOnExist: false, force: true });\n await rm(sourcePath, { recursive: true, force: true });\n return;\n }\n\n await mergeMissingEntries(sourcePath, destination);\n}\n\ninterface BatchImportSource {\n name: string;\n path: string;\n}\n\nasync function importBatchSources(options: {\n homeDir: string;\n sources: BatchImportSource[];\n mode: ImportMode;\n override?: boolean;\n}): Promise<{ imported: string[]; skipped: string[]; overwritten: string[]; warnings: string[]; errors: string[]; missingSources: number }> {\n const seen = new Set<string>();\n const imported: string[] = [];\n const skipped: string[] = [];\n const overwritten: string[] = [];\n const warnings: string[] = [];\n const errors: string[] = [];\n let missingSources = 0;\n\n for (const source of options.sources) {\n if (seen.has(source.name)) {\n skipped.push(source.name);\n continue;\n }\n seen.add(source.name);\n\n const alreadyExists = await skillExists(options.homeDir, source.name);\n if (alreadyExists && !options.override) {\n skipped.push(source.name);\n continue;\n }\n\n try {\n const result = await importSkill({\n homeDir: options.homeDir,\n sourcePath: source.path,\n mode: options.mode,\n override: options.override,\n });\n warnings.push(...result.warnings);\n if (alreadyExists) {\n overwritten.push(source.name);\n } else {\n imported.push(source.name);\n }\n } catch (error) {\n if (error instanceof MissingSymlinkSourceError) {\n missingSources += 1;\n errors.push(`Broken symlink for ${source.name}: ${source.path}; source not found: ${error.resolvedSourcePath}`);\n continue;\n }\n\n if (error instanceof Error && error.message.startsWith(\"Skill source must contain SKILL.md:\")) {\n skipped.push(source.name);\n continue;\n }\n\n throw error;\n }\n }\n\n return { imported, skipped, overwritten, warnings, errors, missingSources };\n}\n\nasync function listImportableChildren(sourceRoot: string): Promise<BatchImportSource[]> {\n const entries = await readdir(sourceRoot, { withFileTypes: true });\n const sources: BatchImportSource[] = [];\n\n for (const entry of entries) {\n if (!(entry.isDirectory() || entry.isSymbolicLink())) {\n continue;\n }\n\n const childPath = path.join(sourceRoot, entry.name);\n if (await pathExists(path.join(childPath, \"SKILL.md\"))) {\n sources.push({\n name: sanitizeName(entry.name),\n path: childPath,\n });\n continue;\n }\n\n if (entry.isSymbolicLink()) {\n sources.push({\n name: sanitizeName(entry.name),\n path: childPath,\n });\n }\n }\n\n return sources.sort((left, right) => left.name.localeCompare(right.name));\n}\n\nexport async function importSkill(options: {\n homeDir: string;\n sourcePath: string;\n mode: ImportMode;\n override?: boolean;\n}): Promise<ImportResult> {\n const { effectiveSourcePath, isSymlinkSource } = await resolveImportSource(options.sourcePath);\n await assertSkillSource(effectiveSourcePath);\n\n const skillName = sanitizeName(path.basename(options.sourcePath));\n if (!skillName) {\n throw new Error(`Unable to infer skill name from path: ${options.sourcePath}`);\n }\n\n const destination = getSkillPath(options.homeDir, skillName);\n await mkdir(path.dirname(destination), { recursive: true });\n\n const warnings: string[] = [];\n if (isSymlinkSource) {\n warnings.push(`Source ${options.sourcePath} is a symlink; copied from ${effectiveSourcePath} to ${destination}`);\n }\n\n if (options.mode === \"mv\" && !isSymlinkSource) {\n await moveIntoDestination(effectiveSourcePath, destination, options.override ?? false);\n } else {\n await copyIntoDestination(effectiveSourcePath, destination, options.override ?? false);\n }\n\n return { name: skillName, destination, warnings };\n}\n\nexport async function importScannedSkills(options: {\n homeDir: string;\n candidates: ScanCandidate[];\n mode: ImportMode;\n override?: boolean;\n}): Promise<{ imported: string[]; skipped: string[]; overwritten: string[]; warnings: string[]; errors: string[]; missingSources: number }> {\n return importBatchSources({\n homeDir: options.homeDir,\n sources: options.candidates.map((candidate) => ({\n name: candidate.name,\n path: candidate.path,\n })),\n mode: options.mode,\n override: options.override,\n });\n}\n\nexport async function importPath(options: {\n homeDir: string;\n sourcePath: string;\n mode: ImportMode;\n override?: boolean;\n}): Promise<\n | ({ kind: \"single\"; alreadyExisted: boolean } & ImportResult)\n | {\n kind: \"batch\";\n imported: string[];\n skipped: string[];\n overwritten: string[];\n warnings: string[];\n errors: string[];\n missingSources: number;\n }\n> {\n if (await pathExists(path.join(options.sourcePath, \"SKILL.md\"))) {\n const skillName = sanitizeName(path.basename(options.sourcePath));\n const alreadyExisted = skillName ? await skillExists(options.homeDir, skillName) : false;\n\n if (alreadyExisted && !options.override) {\n return {\n kind: \"single\",\n alreadyExisted: true,\n name: skillName,\n destination: getSkillPath(options.homeDir, skillName),\n warnings: [],\n };\n }\n\n const result = await importSkill(options);\n return { kind: \"single\", alreadyExisted, ...result };\n }\n\n const sources = await listImportableChildren(options.sourcePath);\n if (sources.length === 0) {\n throw new Error(`Path is neither a skill directory nor a skills directory: ${options.sourcePath}`);\n }\n\n const batchResult = await importBatchSources({\n homeDir: options.homeDir,\n sources,\n mode: options.mode,\n override: options.override,\n });\n return { kind: \"batch\", ...batchResult };\n}\n","import { access, lstat, readdir, readlink } from \"node:fs/promises\";\nimport path from \"node:path\";\n\nimport type { ScanCandidate } from \"../types.js\";\nimport { listSupportedAgents } from \"./agents.js\";\nimport { sanitizeName } from \"./path.js\";\n\nasync function hasSkillReadme(skillDir: string): Promise<boolean> {\n try {\n await access(path.join(skillDir, \"SKILL.md\"));\n return true;\n } catch {\n return false;\n }\n}\n\nasync function isSymlinkPath(targetPath: string): Promise<boolean> {\n try {\n return (await lstat(targetPath)).isSymbolicLink();\n } catch {\n return false;\n }\n}\n\nasync function pathExists(targetPath: string): Promise<boolean> {\n try {\n await access(targetPath);\n return true;\n } catch {\n return false;\n }\n}\n\nasync function resolveSymlinkSource(targetPath: string): Promise<{ sourcePath?: string; isBroken: boolean }> {\n try {\n const linkTarget = await readlink(targetPath);\n const sourcePath = path.resolve(path.dirname(targetPath), linkTarget);\n return {\n sourcePath,\n isBroken: !(await pathExists(sourcePath)),\n };\n } catch {\n return {\n isBroken: true,\n };\n }\n}\n\nasync function scanDirectory(baseDir: string, agentId: ScanCandidate[\"agentId\"], scope: ScanCandidate[\"scope\"], projectDir?: string) {\n try {\n const entries = await readdir(baseDir, { withFileTypes: true });\n const candidates: ScanCandidate[] = [];\n for (const entry of entries) {\n if (!entry.isDirectory() && !entry.isSymbolicLink()) {\n continue;\n }\n const fullPath = path.join(baseDir, entry.name);\n const isSymlink = await isSymlinkPath(fullPath);\n const symlinkInfo = isSymlink ? await resolveSymlinkSource(fullPath) : { isBroken: false };\n\n if (!(await hasSkillReadme(fullPath)) && !symlinkInfo.isBroken) {\n continue;\n }\n candidates.push({\n agentId,\n name: sanitizeName(entry.name),\n path: fullPath,\n scope,\n projectDir,\n isSymlink,\n symlinkSourcePath: symlinkInfo.sourcePath,\n isBrokenSymlink: symlinkInfo.isBroken,\n });\n }\n return candidates;\n } catch {\n return [];\n }\n}\n\nexport async function scanSkills(options: {\n homeDir: string;\n projectDirs?: string[];\n}): Promise<ScanCandidate[]> {\n const results: ScanCandidate[] = [];\n\n for (const agent of listSupportedAgents()) {\n results.push(...(await scanDirectory(agent.globalSkillsDir(options.homeDir), agent.id, \"global\")));\n for (const projectDir of options.projectDirs ?? []) {\n results.push(...(await scanDirectory(agent.projectSkillsDir(projectDir), agent.id, \"project\", projectDir)));\n }\n }\n\n return results.sort((left, right) => left.path.localeCompare(right.path));\n}\n","import { access } from \"node:fs/promises\";\nimport path from \"node:path\";\n\nimport type { AgentDefinition, AgentId, ProjectionMode, Scope } from \"../types.js\";\n\nconst AGENTS: Record<AgentId, AgentDefinition> = {\n amp: {\n id: \"amp\",\n displayName: \"Amp\",\n defaultProjectionMode: \"symlink\",\n rootDir: (homeDir) => path.join(homeDir, \".amp\"),\n globalSkillsDir: (homeDir) => path.join(homeDir, \".amp\", \"skills\"),\n projectSkillsDir: (projectDir) => path.join(projectDir, \".amp\", \"skills\"),\n },\n \"claude-code\": {\n id: \"claude-code\",\n displayName: \"Claude Code\",\n defaultProjectionMode: \"symlink\",\n rootDir: (homeDir) => path.join(homeDir, \".claude\"),\n globalSkillsDir: (homeDir) => path.join(homeDir, \".claude\", \"skills\"),\n projectSkillsDir: (projectDir) => path.join(projectDir, \".claude\", \"skills\"),\n },\n cline: {\n id: \"cline\",\n displayName: \"Cline\",\n defaultProjectionMode: \"symlink\",\n rootDir: (homeDir) => path.join(homeDir, \".cline\"),\n globalSkillsDir: (homeDir) => path.join(homeDir, \".cline\", \"skills\"),\n projectSkillsDir: (projectDir) => path.join(projectDir, \".cline\", \"skills\"),\n },\n codex: {\n id: \"codex\",\n displayName: \"Codex\",\n defaultProjectionMode: \"symlink\",\n rootDir: (homeDir) => path.join(homeDir, \".codex\"),\n globalSkillsDir: (homeDir) => path.join(homeDir, \".codex\", \"skills\"),\n projectSkillsDir: (projectDir) => path.join(projectDir, \".codex\", \"skills\"),\n },\n cursor: {\n id: \"cursor\",\n displayName: \"Cursor\",\n defaultProjectionMode: \"copy\",\n rootDir: (homeDir) => path.join(homeDir, \".cursor\"),\n globalSkillsDir: (homeDir) => path.join(homeDir, \".cursor\", \"skills\"),\n projectSkillsDir: (projectDir) => path.join(projectDir, \".cursor\", \"skills\"),\n },\n \"gemini-cli\": {\n id: \"gemini-cli\",\n displayName: \"Gemini CLI\",\n defaultProjectionMode: \"symlink\",\n rootDir: (homeDir) => path.join(homeDir, \".gemini\"),\n globalSkillsDir: (homeDir) => path.join(homeDir, \".gemini\", \"skills\"),\n projectSkillsDir: (projectDir) => path.join(projectDir, \".gemini\", \"skills\"),\n },\n goose: {\n id: \"goose\",\n displayName: \"Goose\",\n defaultProjectionMode: \"symlink\",\n rootDir: (homeDir) => path.join(homeDir, \".goose\"),\n globalSkillsDir: (homeDir) => path.join(homeDir, \".goose\", \"skills\"),\n projectSkillsDir: (projectDir) => path.join(projectDir, \".goose\", \"skills\"),\n },\n opencode: {\n id: \"opencode\",\n displayName: \"OpenCode\",\n defaultProjectionMode: \"symlink\",\n rootDir: (homeDir) => path.join(homeDir, \".opencode\"),\n globalSkillsDir: (homeDir) => path.join(homeDir, \".opencode\", \"skills\"),\n projectSkillsDir: (projectDir) => path.join(projectDir, \".opencode\", \"skills\"),\n },\n roo: {\n id: \"roo\",\n displayName: \"Roo Code\",\n defaultProjectionMode: \"symlink\",\n rootDir: (homeDir) => path.join(homeDir, \".roo\"),\n globalSkillsDir: (homeDir) => path.join(homeDir, \".roo\", \"skills\"),\n projectSkillsDir: (projectDir) => path.join(projectDir, \".roo\", \"skills\"),\n },\n windsurf: {\n id: \"windsurf\",\n displayName: \"Windsurf\",\n defaultProjectionMode: \"symlink\",\n rootDir: (homeDir) => path.join(homeDir, \".windsurf\"),\n globalSkillsDir: (homeDir) => path.join(homeDir, \".windsurf\", \"skills\"),\n projectSkillsDir: (projectDir) => path.join(projectDir, \".windsurf\", \"skills\"),\n },\n};\n\nasync function pathExists(targetPath: string): Promise<boolean> {\n try {\n await access(targetPath);\n return true;\n } catch {\n return false;\n }\n}\n\nexport function listSupportedAgents(): AgentDefinition[] {\n return Object.values(AGENTS);\n}\n\nexport function listSupportedAgentIds(): AgentId[] {\n return listSupportedAgents().map((agent) => agent.id).sort();\n}\n\nexport function isAgentId(value: string): value is AgentId {\n return value in AGENTS;\n}\n\nexport function getAgentDefinition(agentId: AgentId): AgentDefinition {\n return AGENTS[agentId];\n}\n\nexport function resolveAgentSkillsDir(agentId: AgentId, scope: Scope, baseDir: string): string {\n const definition = getAgentDefinition(agentId);\n return scope === \"global\"\n ? definition.globalSkillsDir(baseDir)\n : definition.projectSkillsDir(baseDir);\n}\n\nexport function getProjectionMode(agentId: AgentId): ProjectionMode {\n return getAgentDefinition(agentId).defaultProjectionMode;\n}\n\nexport async function detectInstalledAgents(options: {\n homeDir: string;\n projectDir?: string;\n}): Promise<AgentId[]> {\n const installed: AgentId[] = [];\n\n for (const agent of listSupportedAgents()) {\n const globalRootPath = agent.rootDir(options.homeDir);\n const projectPath = options.projectDir ? agent.projectSkillsDir(options.projectDir) : null;\n\n if (await pathExists(globalRootPath)) {\n installed.push(agent.id);\n continue;\n }\n\n if (projectPath && (await pathExists(projectPath))) {\n installed.push(agent.id);\n }\n }\n\n return installed.sort();\n}\n","import { importPath, importScannedSkills } from \"../lib/import.js\";\nimport { scanSkills } from \"../lib/scanner.js\";\nimport type { ImportMode, RuntimeContext } from \"../types.js\";\n\nexport async function runImport(\n context: RuntimeContext,\n options: {\n sourcePath?: string;\n scan?: boolean;\n mode: ImportMode;\n override?: boolean;\n },\n) {\n if (options.scan) {\n const candidates = await scanSkills({\n homeDir: context.homeDir,\n projectDirs: [context.cwd],\n });\n const result = await importScannedSkills({\n homeDir: context.homeDir,\n candidates,\n mode: options.mode,\n override: options.override,\n });\n for (const warning of result.warnings) {\n context.write(`Warning: ${warning}`);\n }\n for (const error of result.errors) {\n context.error(`Error: ${error}`);\n }\n context.write(`Imported ${result.imported.length} skills`);\n if (result.overwritten.length > 0) {\n context.write(`Overwritten ${result.overwritten.length} existing skills: ${result.overwritten.join(\", \")}`);\n }\n if (result.skipped.length > 0) {\n context.write(`Skipped ${result.skipped.length} existing skills (use --override to overwrite): ${result.skipped.join(\", \")}`);\n }\n if (result.missingSources > 0) {\n context.write(`Missing source files: ${result.missingSources}`);\n }\n return result;\n }\n\n if (!options.sourcePath) {\n throw new Error('import requires a source path or --scan');\n }\n\n const result = await importPath({\n homeDir: context.homeDir,\n sourcePath: options.sourcePath,\n mode: options.mode,\n override: options.override,\n });\n\n if (result.kind === \"single\") {\n for (const warning of result.warnings) {\n context.write(`Warning: ${warning}`);\n }\n if (result.alreadyExisted && !options.override) {\n context.write(`Skipped ${result.name} (already exists; use --override to overwrite)`);\n } else if (result.alreadyExisted) {\n context.write(`Overwritten ${result.name}`);\n } else {\n context.write(`Imported ${result.name}`);\n }\n return result;\n }\n\n for (const warning of result.warnings) {\n context.write(`Warning: ${warning}`);\n }\n for (const error of result.errors) {\n context.error(`Error: ${error}`);\n }\n context.write(`Imported ${result.imported.length} skills`);\n if (result.overwritten.length > 0) {\n context.write(`Overwritten ${result.overwritten.length} existing skills: ${result.overwritten.join(\", \")}`);\n }\n if (result.skipped.length > 0) {\n context.write(`Skipped ${result.skipped.length} existing skills (use --override to overwrite): ${result.skipped.join(\", \")}`);\n }\n if (result.missingSources > 0) {\n context.write(`Missing source files: ${result.missingSources}`);\n }\n return result;\n}\n","import { cp, lstat, mkdir, readFile, readdir, readlink, rm, symlink, unlink, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\n\nconst COPY_MARKER = \".aweskill-projection.json\";\n\ninterface CopyMarker {\n managedBy: \"aweskill\";\n sourcePath: string;\n}\n\nasync function tryLstat(targetPath: string) {\n try {\n return await lstat(targetPath);\n } catch {\n return null;\n }\n}\n\nasync function readCopyMarker(targetPath: string): Promise<CopyMarker | null> {\n try {\n const content = await readFile(path.join(targetPath, COPY_MARKER), \"utf8\");\n const parsed = JSON.parse(content) as CopyMarker;\n return parsed.managedBy === \"aweskill\" ? parsed : null;\n } catch {\n return null;\n }\n}\n\nexport async function assertProjectionTargetSafe(\n mode: \"symlink\" | \"copy\",\n sourcePath: string,\n targetPath: string,\n options: { allowReplaceExisting?: boolean } = {},\n): Promise<void> {\n const existing = await tryLstat(targetPath);\n if (!existing) {\n return;\n }\n\n if (mode === \"symlink\") {\n if (!existing.isSymbolicLink()) {\n if (options.allowReplaceExisting) {\n return;\n }\n throw new Error(`Refusing to overwrite non-symlink target: ${targetPath}`);\n }\n\n const currentTarget = await readlink(targetPath);\n const resolvedCurrent = path.resolve(path.dirname(targetPath), currentTarget);\n if (resolvedCurrent === path.resolve(sourcePath)) {\n return;\n }\n return;\n }\n\n if (existing.isSymbolicLink()) {\n return;\n }\n\n const marker = await readCopyMarker(targetPath);\n if (!marker) {\n if (options.allowReplaceExisting) {\n return;\n }\n throw new Error(`Refusing to overwrite unmanaged directory: ${targetPath}`);\n }\n}\n\nexport async function createSkillSymlink(\n sourcePath: string,\n targetPath: string,\n options: { allowReplaceExisting?: boolean } = {},\n): Promise<\"created\" | \"skipped\"> {\n await mkdir(path.dirname(targetPath), { recursive: true });\n const existing = await tryLstat(targetPath);\n\n if (existing?.isSymbolicLink()) {\n const currentTarget = await readlink(targetPath);\n const resolvedCurrent = path.resolve(path.dirname(targetPath), currentTarget);\n if (resolvedCurrent === path.resolve(sourcePath)) {\n return \"skipped\";\n }\n await unlink(targetPath);\n } else if (existing) {\n if (options.allowReplaceExisting) {\n await rm(targetPath, { force: true, recursive: true });\n } else {\n throw new Error(`Refusing to overwrite non-symlink target: ${targetPath}`);\n }\n }\n\n const linkTarget = path.relative(path.dirname(targetPath), sourcePath) || \".\";\n await symlink(linkTarget, targetPath, \"dir\");\n return \"created\";\n}\n\nexport async function createSkillCopy(\n sourcePath: string,\n targetPath: string,\n options: { allowReplaceExisting?: boolean } = {},\n): Promise<\"created\" | \"skipped\"> {\n await mkdir(path.dirname(targetPath), { recursive: true });\n const existing = await tryLstat(targetPath);\n\n if (existing?.isSymbolicLink()) {\n await unlink(targetPath);\n } else if (existing) {\n const marker = await readCopyMarker(targetPath);\n if (!marker) {\n if (!options.allowReplaceExisting) {\n throw new Error(`Refusing to overwrite unmanaged directory: ${targetPath}`);\n }\n }\n await rm(targetPath, { force: true, recursive: true });\n }\n\n await cp(sourcePath, targetPath, { recursive: true });\n const marker: CopyMarker = { managedBy: \"aweskill\", sourcePath: path.resolve(sourcePath) };\n await writeFile(path.join(targetPath, COPY_MARKER), JSON.stringify(marker, null, 2), \"utf8\");\n return \"created\";\n}\n\nexport async function removeManagedProjection(targetPath: string): Promise<boolean> {\n const existing = await tryLstat(targetPath);\n if (!existing) {\n return false;\n }\n\n if (existing.isSymbolicLink()) {\n await unlink(targetPath);\n return true;\n }\n\n if (existing.isDirectory()) {\n const marker = await readCopyMarker(targetPath);\n if (marker) {\n await rm(targetPath, { force: true, recursive: true });\n return true;\n }\n }\n\n return false;\n}\n\nexport async function listManagedSkillNames(\n skillsDir: string,\n centralSkillsDir: string,\n): Promise<Map<string, \"symlink\" | \"copy\">> {\n const result = new Map<string, \"symlink\" | \"copy\">();\n\n try {\n const entries = await readdir(skillsDir, { withFileTypes: true });\n for (const entry of entries) {\n const targetPath = path.join(skillsDir, entry.name);\n if (entry.isSymbolicLink()) {\n try {\n const currentTarget = await readlink(targetPath);\n const resolvedCurrent = path.resolve(path.dirname(targetPath), currentTarget);\n if (resolvedCurrent.startsWith(path.resolve(centralSkillsDir))) {\n result.set(entry.name, \"symlink\");\n }\n } catch {\n result.set(entry.name, \"symlink\");\n }\n continue;\n }\n\n if (entry.isDirectory()) {\n const marker = await readCopyMarker(targetPath);\n if (marker) {\n result.set(entry.name, \"copy\");\n }\n }\n }\n } catch {\n return result;\n }\n\n return result;\n}\n","import { detectInstalledAgents, isAgentId, listSupportedAgentIds, resolveAgentSkillsDir } from \"../lib/agents.js\";\nimport { importSkill } from \"../lib/import.js\";\nimport { getAweskillPaths, uniqueSorted } from \"../lib/path.js\";\nimport { listSkillEntriesInDirectory, listSkills, getSkillPath } from \"../lib/skills.js\";\nimport { listManagedSkillNames, createSkillSymlink } from \"../lib/symlink.js\";\nimport type { AgentId, RuntimeContext, Scope } from \"../types.js\";\n\nconst DEFAULT_PREVIEW_COUNT = 5;\n\nfunction getProjectDir(context: RuntimeContext, explicitProjectDir?: string): string {\n return explicitProjectDir ?? context.cwd;\n}\n\nasync function resolveAgentsForScope(\n context: RuntimeContext,\n requestedAgents: string[],\n scope: Scope,\n projectDir?: string,\n): Promise<AgentId[]> {\n if (requestedAgents.length === 0 || requestedAgents.includes(\"all\")) {\n const detected = await detectInstalledAgents({\n homeDir: context.homeDir,\n projectDir: scope === \"project\" ? projectDir : undefined,\n });\n return detected.length > 0 ? detected : listSupportedAgentIds();\n }\n\n return uniqueSorted(\n requestedAgents.map((agent) => {\n if (!isAgentId(agent)) {\n throw new Error(`Unsupported agent: ${agent}`);\n }\n return agent;\n }),\n );\n}\n\ntype CheckCategory = \"linked\" | \"duplicate\" | \"new\";\n\ninterface CheckedSkill {\n name: string;\n path: string;\n category: CheckCategory;\n hasSKILLMd: boolean;\n}\n\nfunction formatSkillBlockWithSummary(title: string, skills: CheckedSkill[], verbose = false): string[] {\n if (skills.length === 0) {\n return [`No skills found for ${title.replace(/:$/, \"\").toLowerCase()}.`];\n }\n\n const lines = [title];\n const categories: Array<{ title: string; marker: string; key: CheckCategory }> = [\n { title: \" linked\", marker: \"✓\", key: \"linked\" },\n { title: \" duplicate\", marker: \"!\", key: \"duplicate\" },\n { title: \" new\", marker: \"+\", key: \"new\" },\n ];\n\n for (const category of categories) {\n const entries = skills.filter((skill) => skill.category === category.key);\n lines.push(`${category.title}: ${entries.length}`);\n const preview = verbose ? entries : entries.slice(0, DEFAULT_PREVIEW_COUNT);\n for (const skill of preview) {\n lines.push(` ${category.marker} ${skill.name} ${skill.path}`);\n }\n if (!verbose && entries.length > preview.length) {\n lines.push(` ... and ${entries.length - preview.length} more (use --verbose to show all)`);\n }\n }\n\n return lines;\n}\n\nexport async function runCheck(\n context: RuntimeContext,\n options: {\n scope: Scope;\n agents: string[];\n projectDir?: string;\n update?: boolean;\n verbose?: boolean;\n },\n) {\n const lines: string[] = [];\n const centralSkillEntries = await listSkills(context.homeDir);\n const centralSkills = new Set(centralSkillEntries.map((skill) => skill.name));\n\n const projectDir = options.scope === \"project\" ? getProjectDir(context, options.projectDir) : undefined;\n const agents = await resolveAgentsForScope(context, options.agents, options.scope, projectDir);\n const updated: string[] = [];\n const skipped: string[] = [];\n let importedCount = 0;\n\n for (const agentId of agents) {\n const baseDir = options.scope === \"global\" ? context.homeDir : projectDir!;\n const skillsDir = resolveAgentSkillsDir(agentId, options.scope, baseDir);\n const managed = await listManagedSkillNames(skillsDir, getAweskillPaths(context.homeDir).skillsDir);\n const skills = await listSkillEntriesInDirectory(skillsDir);\n const checked = skills.map((skill) => {\n let category: CheckCategory = \"new\";\n if (managed.has(skill.name)) {\n category = \"linked\";\n } else if (centralSkills.has(skill.name)) {\n category = \"duplicate\";\n }\n\n return {\n name: skill.name,\n path: skill.path,\n category,\n hasSKILLMd: skill.hasSKILLMd,\n } satisfies CheckedSkill;\n });\n\n if (options.update) {\n for (const skill of checked) {\n if (skill.category === \"linked\") {\n continue;\n }\n\n if (!skill.hasSKILLMd) {\n context.write(`Warning: Skipping ${agentId}:${skill.name}; missing SKILL.md in ${skill.path}`);\n skipped.push(`${agentId}:${skill.name}`);\n continue;\n }\n\n if (skill.category === \"new\") {\n await importSkill({\n homeDir: context.homeDir,\n sourcePath: skill.path,\n mode: \"mv\",\n });\n centralSkills.add(skill.name);\n importedCount += 1;\n }\n\n await createSkillSymlink(getSkillPath(context.homeDir, skill.name), skill.path, {\n allowReplaceExisting: true,\n });\n updated.push(`${agentId}:${skill.name}`);\n }\n }\n\n const title = options.scope === \"global\"\n ? `Global skills for ${agentId}:`\n : `Project skills for ${agentId} (${projectDir}):`;\n lines.push(\"\");\n lines.push(...formatSkillBlockWithSummary(title, checked, options.verbose));\n }\n\n if (options.update) {\n lines.push(\"\");\n lines.push(`Updated ${updated.length} skills`);\n if (importedCount > 0) {\n lines.push(`Imported ${importedCount} new skills into the central repo`);\n }\n if (skipped.length > 0) {\n lines.push(`Skipped ${skipped.length} entries: ${skipped.join(\", \")}`);\n }\n }\n\n context.write(lines.join(\"\\n\").trim());\n return { agents, updated, importedCount, skipped };\n}\n","import { detectInstalledAgents, isAgentId, listSupportedAgentIds, resolveAgentSkillsDir } from \"../lib/agents.js\";\nimport { listBundles, readBundle } from \"../lib/bundles.js\";\nimport { getAweskillPaths, sanitizeName, splitCommaValues, uniqueSorted } from \"../lib/path.js\";\nimport { skillExists } from \"../lib/skills.js\";\nimport { listManagedSkillNames, removeManagedProjection } from \"../lib/symlink.js\";\nimport type { ActivationType, AgentId, RuntimeContext, Scope } from \"../types.js\";\n\nfunction getProjectDir(context: RuntimeContext, explicitProjectDir?: string): string {\n return explicitProjectDir ?? context.cwd;\n}\n\nasync function resolveAgentsForScope(\n context: RuntimeContext,\n requestedAgents: string[],\n scope: Scope,\n projectDir?: string,\n): Promise<AgentId[]> {\n if (requestedAgents.length === 0 || requestedAgents.includes(\"all\")) {\n const detected = await detectInstalledAgents({\n homeDir: context.homeDir,\n projectDir: scope === \"project\" ? projectDir : undefined,\n });\n return detected.length > 0 ? detected : listSupportedAgentIds();\n }\n\n return uniqueSorted(\n requestedAgents.map((agent) => {\n if (!isAgentId(agent)) {\n throw new Error(`Unsupported agent: ${agent}`);\n }\n return agent;\n }),\n );\n}\n\nasync function resolveSkillNames(context: RuntimeContext, type: ActivationType, names: string): Promise<string[]> {\n const normalizedNames = uniqueSorted(splitCommaValues(names).map((name) => sanitizeName(name)));\n\n if (normalizedNames.includes(\"all\")) {\n if (type === \"bundle\") {\n const bundles = await listBundles(context.homeDir);\n return uniqueSorted(bundles.flatMap((bundle) => bundle.skills));\n }\n\n const { skillsDir: centralSkillsDir } = getAweskillPaths(context.homeDir);\n const detected = await detectInstalledAgents({\n homeDir: context.homeDir,\n });\n const globalManaged = await Promise.all(\n detected.map(async (agentId) => {\n const agentSkillsDir = resolveAgentSkillsDir(agentId, \"global\", context.homeDir);\n return listManagedSkillNames(agentSkillsDir, centralSkillsDir);\n }),\n );\n const managedSkillNames = uniqueSorted(\n globalManaged.flatMap((managed) => [...managed.keys()]),\n );\n\n return managedSkillNames;\n }\n\n if (type === \"bundle\") {\n const bundles = await Promise.all(normalizedNames.map((bundleName) => readBundle(context.homeDir, bundleName)));\n return uniqueSorted(bundles.flatMap((bundle) => bundle.skills));\n }\n\n // For disable we don't require the skill to still exist in central repo\n const resolvedNames: string[] = [];\n for (const normalizedName of normalizedNames) {\n if (!(await skillExists(context.homeDir, normalizedName))) {\n resolvedNames.push(normalizedName);\n continue;\n }\n resolvedNames.push(normalizedName);\n }\n return uniqueSorted(resolvedNames);\n}\n\n/**\n * True when `skillName` appears in a bundle and at least one other skill from that bundle\n * still has an aweskill-managed projection under the same scope/agents — typical after\n * `enable bundle` while the user tries `disable skill` for one member only.\n */\nasync function bundlesWithCoEnabledSiblings(options: {\n homeDir: string;\n skillName: string;\n agents: AgentId[];\n scope: Scope;\n baseDir: string;\n}): Promise<string[]> {\n const { skillsDir: centralSkillsDir } = getAweskillPaths(options.homeDir);\n const bundles = await listBundles(options.homeDir);\n const normalized = sanitizeName(options.skillName);\n const hit = new Set<string>();\n\n for (const bundle of bundles) {\n if (!bundle.skills.includes(normalized)) {\n continue;\n }\n const siblings = bundle.skills.filter((s) => s !== normalized);\n if (siblings.length === 0) {\n continue;\n }\n\n for (const agentId of options.agents) {\n const agentSkillsDir = resolveAgentSkillsDir(agentId, options.scope, options.baseDir);\n const managed = await listManagedSkillNames(agentSkillsDir, centralSkillsDir);\n if (siblings.some((s) => managed.has(s))) {\n hit.add(bundle.name);\n break;\n }\n }\n }\n\n return [...hit].sort();\n}\n\nexport async function runDisable(\n context: RuntimeContext,\n options: {\n type: ActivationType;\n name: string;\n scope: Scope;\n agents: string[];\n projectDir?: string;\n force?: boolean;\n },\n) {\n const projectDir = options.scope === \"project\" ? getProjectDir(context, options.projectDir) : undefined;\n const agents = await resolveAgentsForScope(context, options.agents, options.scope, projectDir);\n const baseDir = options.scope === \"global\" ? context.homeDir : (projectDir ?? context.cwd);\n const skillNames = await resolveSkillNames(context, options.type, options.name);\n\n if (splitCommaValues(options.name).map((name) => sanitizeName(name)).includes(\"all\") && options.type === \"skill\") {\n const { skillsDir: centralSkillsDir } = getAweskillPaths(context.homeDir);\n const scopedManaged = await Promise.all(\n agents.map(async (agentId) => {\n const agentSkillsDir = resolveAgentSkillsDir(agentId, options.scope, baseDir);\n return listManagedSkillNames(agentSkillsDir, centralSkillsDir);\n }),\n );\n const managedSkillNames = uniqueSorted(\n scopedManaged.flatMap((managed) => [...managed.keys()]),\n );\n skillNames.splice(0, skillNames.length, ...managedSkillNames);\n }\n\n if (options.type === \"skill\" && skillNames.length === 1 && !options.force) {\n const bundleNames = await bundlesWithCoEnabledSiblings({\n homeDir: context.homeDir,\n skillName: skillNames[0]!,\n agents,\n scope: options.scope,\n baseDir,\n });\n if (bundleNames.length > 0) {\n throw new Error(\n `Skill \"${skillNames[0]}\" is listed in bundle(s): ${bundleNames.join(\", \")}. ` +\n `Other skills from those bundle(s) are still enabled in this scope. ` +\n `Use --force to remove only this skill's projection, or run \"aweskill agent remove bundle <name>\" to drop the whole bundle.`,\n );\n }\n }\n\n const removed: string[] = [];\n for (const agentId of agents) {\n const skillsDir = resolveAgentSkillsDir(agentId, options.scope, baseDir);\n for (const skillName of skillNames) {\n const targetPath = `${skillsDir}/${skillName}`;\n const wasRemoved = await removeManagedProjection(targetPath);\n if (wasRemoved) {\n removed.push(`${agentId}:${skillName}`);\n }\n }\n }\n\n const scopeLabel = options.scope === \"global\" ? \"global scope\" : (projectDir ?? context.cwd);\n const targetLabel = uniqueSorted(splitCommaValues(options.name).map((name) => sanitizeName(name))).join(\", \");\n context.write(`Disabled ${options.type} ${targetLabel} for ${agents.join(\", \")} in ${scopeLabel}${removed.length > 0 ? ` (${removed.length} removed)` : \"\"}`);\n return { agents, skillNames, removed };\n}\n","import { mkdir } from \"node:fs/promises\";\n\nimport { detectInstalledAgents, getProjectionMode, isAgentId, listSupportedAgentIds, resolveAgentSkillsDir } from \"../lib/agents.js\";\nimport { listBundles, readBundle } from \"../lib/bundles.js\";\nimport { getSkillPath, listSkills, skillExists } from \"../lib/skills.js\";\nimport { assertProjectionTargetSafe, createSkillCopy, createSkillSymlink } from \"../lib/symlink.js\";\nimport { sanitizeName, splitCommaValues, uniqueSorted } from \"../lib/path.js\";\nimport type { ActivationType, AgentId, RuntimeContext, Scope } from \"../types.js\";\n\nfunction getProjectDir(context: RuntimeContext, explicitProjectDir?: string): string {\n return explicitProjectDir ?? context.cwd;\n}\n\nasync function resolveAgentsForScope(\n context: RuntimeContext,\n requestedAgents: string[],\n scope: Scope,\n projectDir?: string,\n): Promise<AgentId[]> {\n if (requestedAgents.length === 0 || requestedAgents.includes(\"all\")) {\n const detected = await detectInstalledAgents({\n homeDir: context.homeDir,\n projectDir: scope === \"project\" ? projectDir : undefined,\n });\n return detected.length > 0 ? detected : listSupportedAgentIds();\n }\n\n return uniqueSorted(\n requestedAgents.map((agent) => {\n if (!isAgentId(agent)) {\n throw new Error(`Unsupported agent: ${agent}`);\n }\n return agent;\n }),\n );\n}\n\nasync function resolveSkillNames(context: RuntimeContext, type: ActivationType, names: string): Promise<string[]> {\n const normalizedNames = uniqueSorted(splitCommaValues(names).map((name) => sanitizeName(name)));\n\n if (normalizedNames.includes(\"all\")) {\n if (type === \"bundle\") {\n const bundles = await listBundles(context.homeDir);\n const skillNames = uniqueSorted(bundles.flatMap((bundle) => bundle.skills));\n for (const skillName of skillNames) {\n if (!(await skillExists(context.homeDir, skillName))) {\n throw new Error(`A bundle in \"all\" references unknown skill: ${skillName}`);\n }\n }\n return skillNames;\n }\n\n const skills = await listSkills(context.homeDir);\n return skills.map((skill) => skill.name);\n }\n\n if (type === \"bundle\") {\n const bundles = await Promise.all(normalizedNames.map((bundleName) => readBundle(context.homeDir, bundleName)));\n const skillNames = uniqueSorted(bundles.flatMap((bundle) => bundle.skills));\n for (const skillName of skillNames) {\n if (!(await skillExists(context.homeDir, skillName))) {\n const bundle = bundles.find((candidate) => candidate.skills.includes(skillName));\n throw new Error(`Bundle ${bundle?.name ?? \"(unknown)\"} references unknown skill: ${skillName}`);\n }\n }\n return skillNames;\n }\n\n for (const normalizedName of normalizedNames) {\n if (!(await skillExists(context.homeDir, normalizedName))) {\n throw new Error(`Unknown skill: ${normalizedName}`);\n }\n }\n\n return normalizedNames;\n}\n\nexport async function runEnable(\n context: RuntimeContext,\n options: {\n type: ActivationType;\n name: string;\n scope: Scope;\n agents: string[];\n projectDir?: string;\n },\n) {\n const projectDir = options.scope === \"project\" ? getProjectDir(context, options.projectDir) : undefined;\n const agents = await resolveAgentsForScope(context, options.agents, options.scope, projectDir);\n const skillNames = await resolveSkillNames(context, options.type, options.name);\n const baseDir = options.scope === \"global\" ? context.homeDir : (projectDir ?? context.cwd);\n\n // Preflight: check all targets are safe before touching any\n for (const agentId of agents) {\n const skillsDir = resolveAgentSkillsDir(agentId, options.scope, baseDir);\n await mkdir(skillsDir, { recursive: true });\n for (const skillName of skillNames) {\n const sourcePath = getSkillPath(context.homeDir, skillName);\n const targetPath = `${skillsDir}/${skillName}`;\n await assertProjectionTargetSafe(getProjectionMode(agentId), sourcePath, targetPath);\n }\n }\n\n // Apply projections directly\n const created: string[] = [];\n for (const agentId of agents) {\n const skillsDir = resolveAgentSkillsDir(agentId, options.scope, baseDir);\n const mode = getProjectionMode(agentId);\n for (const skillName of skillNames) {\n const sourcePath = getSkillPath(context.homeDir, skillName);\n const targetPath = `${skillsDir}/${skillName}`;\n const result = mode === \"symlink\"\n ? await createSkillSymlink(sourcePath, targetPath)\n : await createSkillCopy(sourcePath, targetPath);\n if (result === \"created\") {\n created.push(`${agentId}:${skillName}`);\n }\n }\n }\n\n const scopeLabel = options.scope === \"global\" ? \"global scope\" : (projectDir ?? context.cwd);\n const targetLabel = uniqueSorted(splitCommaValues(options.name).map((name) => sanitizeName(name))).join(\", \");\n context.write(`Enabled ${options.type} ${targetLabel} for ${agents.join(\", \")} in ${scopeLabel}${created.length > 0 ? ` (${created.length} created)` : \"\"}`);\n return { agents, skillNames, created };\n}\n","import { importScannedSkills } from \"../lib/import.js\";\nimport { scanSkills } from \"../lib/scanner.js\";\nimport type { ImportMode, RuntimeContext, ScanCandidate } from \"../types.js\";\n\nfunction groupLabel(candidate: ScanCandidate): string {\n return candidate.scope === \"global\"\n ? `Global scanned skills for ${candidate.agentId}:`\n : `Project scanned skills for ${candidate.agentId} (${candidate.projectDir}):`;\n}\n\nexport function formatScanSummary(candidates: ScanCandidate[], verbose = false): string {\n if (candidates.length === 0) {\n return \"(no scanned skills)\";\n }\n\n const groups = new Map<string, ScanCandidate[]>();\n for (const candidate of candidates) {\n const key = `${candidate.scope}:${candidate.agentId}:${candidate.projectDir ?? \"\"}`;\n const bucket = groups.get(key) ?? [];\n bucket.push(candidate);\n groups.set(key, bucket);\n }\n\n const lines = [\"Scanned skills:\"];\n for (const [, groupedCandidates] of [...groups.entries()].sort((left, right) => left[0].localeCompare(right[0]))) {\n const sorted = [...groupedCandidates].sort((left, right) => left.name.localeCompare(right.name));\n lines.push(` ${groupLabel(sorted[0])} ${sorted.length}`);\n if (verbose) {\n for (const candidate of sorted) {\n lines.push(` ✓ ${candidate.name} ${candidate.path}`);\n }\n }\n }\n\n return lines.join(\"\\n\");\n}\n\nexport async function runScan(\n context: RuntimeContext,\n options: { add?: boolean; mode?: ImportMode; override?: boolean; verbose?: boolean },\n) {\n const candidates = await scanSkills({\n homeDir: context.homeDir,\n projectDirs: [context.cwd],\n });\n\n context.write(formatScanSummary(candidates, options.verbose));\n\n if (options.add) {\n const result = await importScannedSkills({\n homeDir: context.homeDir,\n candidates,\n mode: options.mode ?? \"cp\",\n override: options.override,\n });\n for (const warning of result.warnings) {\n context.write(`Warning: ${warning}`);\n }\n for (const error of result.errors) {\n context.error(`Error: ${error}`);\n }\n context.write(`Imported ${result.imported.length} skills`);\n if (result.overwritten.length > 0) {\n context.write(`Overwritten ${result.overwritten.length} existing skills: ${result.overwritten.join(\", \")}`);\n }\n if (result.skipped.length > 0) {\n context.write(`Skipped ${result.skipped.length} existing skills (use --override to overwrite): ${result.skipped.join(\", \")}`);\n }\n if (result.missingSources > 0) {\n context.write(`Missing source files: ${result.missingSources}`);\n }\n return { candidates, ...result };\n }\n return candidates;\n}\n","import { scanSkills } from \"../lib/scanner.js\";\nimport { ensureHomeLayout } from \"../lib/skills.js\";\nimport { formatScanSummary } from \"./scan.js\";\nimport type { RuntimeContext } from \"../types.js\";\n\nexport async function runInit(context: RuntimeContext, options: { scan?: boolean; verbose?: boolean }) {\n await ensureHomeLayout(context.homeDir);\n context.write(`Initialized ${context.homeDir}/.aweskill`);\n\n if (options.scan) {\n const candidates = await scanSkills({ homeDir: context.homeDir, projectDirs: [context.cwd] });\n context.write(formatScanSummary(candidates, options.verbose));\n return candidates;\n }\n\n return [];\n}\n","import { listBundles, listBundlesInDirectory } from \"../lib/bundles.js\";\nimport { listSkills } from \"../lib/skills.js\";\nimport { getTemplateBundlesDir } from \"../lib/templates.js\";\nimport type { RuntimeContext } from \"../types.js\";\n\nconst DEFAULT_PREVIEW_COUNT = 5;\n\nexport async function runListSkills(context: RuntimeContext, options: { verbose?: boolean } = {}) {\n const skills = await listSkills(context.homeDir);\n\n if (skills.length === 0) {\n context.write(\"No skills found in central repo.\");\n return skills;\n }\n\n const preview = options.verbose ? skills : skills.slice(0, DEFAULT_PREVIEW_COUNT);\n const lines = [`Skills in central repo: ${skills.length} total`];\n if (!options.verbose && skills.length > preview.length) {\n lines.push(`Showing first ${preview.length} skills (use --verbose to show all)`);\n }\n for (const skill of preview) {\n const marker = skill.hasSKILLMd ? \"✓\" : \"!\";\n lines.push(` ${marker} ${skill.name} ${skill.path}`);\n }\n context.write(lines.join(\"\\n\"));\n return skills;\n}\n\nfunction formatBundleLines(title: string, bundles: { name: string; skills: string[] }[], verbose?: boolean): string[] {\n if (bundles.length === 0) {\n return [title, \"(none)\"];\n }\n\n const preview = verbose ? bundles : bundles.slice(0, DEFAULT_PREVIEW_COUNT);\n const lines = [`${title}: ${bundles.length} total`];\n if (!verbose && bundles.length > preview.length) {\n lines.push(`Showing first ${preview.length} bundles (use --verbose to show all)`);\n }\n for (const bundle of preview) {\n const skillsPreview = verbose ? bundle.skills : bundle.skills.slice(0, DEFAULT_PREVIEW_COUNT);\n const suffix = !verbose && bundle.skills.length > skillsPreview.length\n ? `, ... (+${bundle.skills.length - skillsPreview.length} more)`\n : \"\";\n lines.push(` - ${bundle.name}: ${bundle.skills.length} skills${skillsPreview.length > 0 ? ` -> ${skillsPreview.join(\", \")}${suffix}` : \" -> (empty)\"}`);\n }\n return lines;\n}\n\nexport async function runListBundles(context: RuntimeContext, options: { verbose?: boolean } = {}) {\n const bundles = await listBundles(context.homeDir);\n context.write(formatBundleLines(\"Bundles in central repo\", bundles, options.verbose).join(\"\\n\"));\n return bundles;\n}\n\nexport async function runListTemplateBundles(context: RuntimeContext, options: { verbose?: boolean } = {}) {\n const templateBundlesDir = await getTemplateBundlesDir();\n const bundles = await listBundlesInDirectory(templateBundlesDir);\n context.write(formatBundleLines(\"Bundle templates\", bundles, options.verbose).join(\"\\n\"));\n return bundles;\n}\n","import { cp, mkdir, readlink, unlink } from \"node:fs/promises\";\nimport path from \"node:path\";\n\nimport { detectInstalledAgents, isAgentId, listSupportedAgentIds, resolveAgentSkillsDir } from \"../lib/agents.js\";\nimport { getAweskillPaths, uniqueSorted } from \"../lib/path.js\";\nimport { listManagedSkillNames } from \"../lib/symlink.js\";\nimport type { AgentId, RuntimeContext, Scope } from \"../types.js\";\n\nfunction getProjectDir(context: RuntimeContext, explicitProjectDir?: string): string {\n return explicitProjectDir ?? context.cwd;\n}\n\nasync function resolveAgentsForScope(\n context: RuntimeContext,\n requestedAgents: string[],\n scope: Scope,\n projectDir?: string,\n): Promise<AgentId[]> {\n if (requestedAgents.length === 0 || requestedAgents.includes(\"all\")) {\n const detected = await detectInstalledAgents({\n homeDir: context.homeDir,\n projectDir: scope === \"project\" ? projectDir : undefined,\n });\n return detected.length > 0 ? detected : listSupportedAgentIds();\n }\n\n return uniqueSorted(\n requestedAgents.map((agent) => {\n if (!isAgentId(agent)) {\n throw new Error(`Unsupported agent: ${agent}`);\n }\n return agent;\n }),\n );\n}\n\nexport async function runRecover(\n context: RuntimeContext,\n options: {\n scope: Scope;\n agents: string[];\n projectDir?: string;\n },\n) {\n const projectDir = options.scope === \"project\" ? getProjectDir(context, options.projectDir) : undefined;\n const agents = await resolveAgentsForScope(context, options.agents, options.scope, projectDir);\n const { skillsDir: centralSkillsDir } = getAweskillPaths(context.homeDir);\n const baseDir = options.scope === \"global\" ? context.homeDir : (projectDir ?? context.cwd);\n\n const recovered: string[] = [];\n\n for (const agentId of agents) {\n const agentSkillsDir = resolveAgentSkillsDir(agentId, options.scope, baseDir);\n const managed = await listManagedSkillNames(agentSkillsDir, centralSkillsDir);\n\n for (const [skillName, mode] of managed) {\n if (mode !== \"symlink\") {\n continue;\n }\n\n const targetPath = path.join(agentSkillsDir, skillName);\n const sourcePath = path.join(centralSkillsDir, skillName);\n const currentTarget = await readlink(targetPath);\n const resolvedCurrent = path.resolve(path.dirname(targetPath), currentTarget);\n if (resolvedCurrent !== path.resolve(sourcePath)) {\n continue;\n }\n\n await unlink(targetPath);\n await mkdir(path.dirname(targetPath), { recursive: true });\n await cp(sourcePath, targetPath, { recursive: true });\n recovered.push(`${agentId}:${skillName}`);\n }\n }\n\n const scopeLabel = options.scope === \"global\" ? \"global scope\" : (projectDir ?? context.cwd);\n context.write(`Recovered ${recovered.length} skill projection(s) in ${scopeLabel}${recovered.length > 0 ? `: ${recovered.join(\", \")}` : \"\"}`);\n return { agents, recovered };\n}\n","import { rm } from \"node:fs/promises\";\nimport path from \"node:path\";\n\nimport { listSupportedAgents, resolveAgentSkillsDir } from \"./agents.js\";\nimport { listBundles, writeBundle } from \"./bundles.js\";\nimport { getAweskillPaths, sanitizeName } from \"./path.js\";\nimport { getSkillPath } from \"./skills.js\";\nimport { listManagedSkillNames, removeManagedProjection } from \"./symlink.js\";\n\nexport interface SkillReferences {\n bundles: string[];\n agentProjections: string[];\n}\n\n/**\n * Find all places a skill is referenced:\n * - bundle definitions that list it\n * - active managed projections (symlinks/copies) in agent skill directories\n */\nexport async function findSkillReferences(options: {\n homeDir: string;\n skillName: string;\n projectDir?: string;\n}): Promise<SkillReferences> {\n const normalizedSkill = sanitizeName(options.skillName);\n const { skillsDir } = getAweskillPaths(options.homeDir);\n\n const bundles = (await listBundles(options.homeDir))\n .filter((bundle) => bundle.skills.includes(normalizedSkill))\n .map((bundle) => bundle.name);\n\n const agentProjections: string[] = [];\n const baseDirs: Array<{ scope: \"global\" | \"project\"; dir: string }> = [\n { scope: \"global\", dir: options.homeDir },\n ];\n if (options.projectDir) {\n baseDirs.push({ scope: \"project\", dir: options.projectDir });\n }\n\n for (const { scope, dir } of baseDirs) {\n for (const agent of listSupportedAgents()) {\n const agentSkillsDir = resolveAgentSkillsDir(agent.id, scope, dir);\n const managed = await listManagedSkillNames(agentSkillsDir, skillsDir);\n if (managed.has(normalizedSkill)) {\n agentProjections.push(`${agent.id}(${scope}):${normalizedSkill}`);\n }\n }\n }\n\n return { bundles, agentProjections };\n}\n\n/**\n * Remove the skill from bundles, delete all managed projections pointing to it,\n * then delete the skill from the central repository.\n */\nexport async function removeSkillWithReferences(options: {\n homeDir: string;\n skillName: string;\n projectDir?: string;\n}): Promise<void> {\n const normalizedSkill = sanitizeName(options.skillName);\n const { skillsDir } = getAweskillPaths(options.homeDir);\n\n // Strip from bundle definitions\n const bundles = await listBundles(options.homeDir);\n for (const bundle of bundles) {\n if (!bundle.skills.includes(normalizedSkill)) {\n continue;\n }\n bundle.skills = bundle.skills.filter((skill) => skill !== normalizedSkill);\n await writeBundle(options.homeDir, bundle);\n }\n\n // Remove managed projections across all known agent dirs\n const baseDirs: Array<{ scope: \"global\" | \"project\"; dir: string }> = [\n { scope: \"global\", dir: options.homeDir },\n ];\n if (options.projectDir) {\n baseDirs.push({ scope: \"project\", dir: options.projectDir });\n }\n\n for (const { scope, dir } of baseDirs) {\n for (const agent of listSupportedAgents()) {\n const agentSkillsDir = resolveAgentSkillsDir(agent.id, scope, dir);\n const managed = await listManagedSkillNames(agentSkillsDir, skillsDir);\n if (managed.has(normalizedSkill)) {\n await removeManagedProjection(path.join(agentSkillsDir, normalizedSkill));\n }\n }\n }\n\n // Delete from central repo\n await rm(getSkillPath(options.homeDir, normalizedSkill), { force: true, recursive: true });\n}\n","import { findSkillReferences, removeSkillWithReferences } from \"../lib/references.js\";\nimport type { RuntimeContext } from \"../types.js\";\n\nexport async function runRemove(\n context: RuntimeContext,\n options: {\n skillName: string;\n force?: boolean;\n projectDir?: string;\n },\n) {\n const projectDir = options.projectDir ?? context.cwd;\n const references = await findSkillReferences({\n homeDir: context.homeDir,\n skillName: options.skillName,\n projectDir,\n });\n const referenceCount = references.bundles.length + references.agentProjections.length;\n\n if (referenceCount > 0 && !options.force) {\n throw new Error(\n `Skill ${options.skillName} is still referenced: ${[\n ...references.bundles,\n ...references.agentProjections,\n ].join(\", \")}`,\n );\n }\n\n await removeSkillWithReferences({\n homeDir: context.homeDir,\n skillName: options.skillName,\n projectDir,\n });\n context.write(`Removed ${options.skillName}`);\n return references;\n}\n","import { cp, mkdir, readdir, rm } from \"node:fs/promises\";\nimport path from \"node:path\";\n\nimport { createSkillsBackupArchive, extractSkillsArchive } from \"../lib/backup.js\";\nimport { getAweskillPaths } from \"../lib/path.js\";\nimport { listSkillEntriesInDirectory } from \"../lib/skills.js\";\nimport type { RuntimeContext } from \"../types.js\";\n\nexport async function runRestore(\n context: RuntimeContext,\n options: {\n archivePath: string;\n override?: boolean;\n },\n) {\n const { tempDir, extractedSkillsDir } = await extractSkillsArchive(options.archivePath);\n\n try {\n const extracted = await listSkillEntriesInDirectory(extractedSkillsDir);\n if (extracted.length === 0) {\n throw new Error(`Archive does not contain a skills/ directory: ${options.archivePath}`);\n }\n\n const { skillsDir } = getAweskillPaths(context.homeDir);\n const current = await listSkillEntriesInDirectory(skillsDir);\n const currentNames = new Set(current.map((entry) => entry.name));\n const conflicts = extracted.map((entry) => entry.name).filter((name) => currentNames.has(name));\n\n if (conflicts.length > 0 && !options.override) {\n throw new Error(`Restore would overwrite existing skills: ${conflicts.join(\", \")}. Use --override to replace them.`);\n }\n\n const backupArchivePath = await createSkillsBackupArchive(context.homeDir);\n\n if (options.override) {\n await rm(skillsDir, { recursive: true, force: true });\n await mkdir(path.dirname(skillsDir), { recursive: true });\n await cp(extractedSkillsDir, skillsDir, { recursive: true });\n } else {\n await mkdir(skillsDir, { recursive: true });\n for (const entry of extracted) {\n await cp(entry.path, path.join(skillsDir, entry.name), { recursive: true });\n }\n }\n\n context.write(`Restored ${extracted.length} skills from ${options.archivePath}`);\n context.write(`Backed up current skills to ${backupArchivePath}`);\n return { restored: extracted.map((entry) => entry.name), backupArchivePath };\n } finally {\n await rm(tempDir, { recursive: true, force: true });\n }\n}\n","import { mkdir, readdir, rename, rm } from \"node:fs/promises\";\nimport path from \"node:path\";\n\nimport type { SkillEntry } from \"../types.js\";\nimport { getAweskillPaths } from \"./path.js\";\nimport { listSkills } from \"./skills.js\";\n\ninterface ParsedSkillName {\n baseName: string;\n numericKey?: number[];\n hasNumericSuffix: boolean;\n}\n\nexport interface DuplicateGroup {\n baseName: string;\n kept: SkillEntry;\n removed: SkillEntry[];\n}\n\nconst NUMERIC_SUFFIX_PATTERN = /^(.*?)-(\\d+(?:\\.\\d+)*)$/;\n\nfunction parseSkillName(name: string): ParsedSkillName {\n const match = name.match(NUMERIC_SUFFIX_PATTERN);\n if (!match) {\n return {\n baseName: name,\n hasNumericSuffix: false,\n };\n }\n\n return {\n baseName: match[1],\n hasNumericSuffix: true,\n numericKey: match[2].split(\".\").map((part) => Number.parseInt(part, 10)),\n };\n}\n\nfunction compareNumericKeys(left: number[], right: number[]): number {\n const length = Math.max(left.length, right.length);\n for (let index = 0; index < length; index += 1) {\n const leftValue = left[index] ?? 0;\n const rightValue = right[index] ?? 0;\n if (leftValue !== rightValue) {\n return leftValue - rightValue;\n }\n }\n return 0;\n}\n\nfunction choosePreferredSkill(entries: SkillEntry[]): SkillEntry {\n return [...entries].sort((left, right) => {\n const leftParsed = parseSkillName(left.name);\n const rightParsed = parseSkillName(right.name);\n\n if (leftParsed.hasNumericSuffix && !rightParsed.hasNumericSuffix) {\n return -1;\n }\n if (!leftParsed.hasNumericSuffix && rightParsed.hasNumericSuffix) {\n return 1;\n }\n\n if (leftParsed.numericKey && rightParsed.numericKey) {\n const comparison = compareNumericKeys(rightParsed.numericKey, leftParsed.numericKey);\n if (comparison !== 0) {\n return comparison;\n }\n }\n\n return left.name.localeCompare(right.name);\n })[0]!;\n}\n\nexport async function findDuplicateSkills(homeDir: string): Promise<DuplicateGroup[]> {\n const skills = await listSkills(homeDir);\n const grouped = new Map<string, SkillEntry[]>();\n\n for (const skill of skills) {\n const parsed = parseSkillName(skill.name);\n const bucket = grouped.get(parsed.baseName) ?? [];\n bucket.push(skill);\n grouped.set(parsed.baseName, bucket);\n }\n\n const duplicates: DuplicateGroup[] = [];\n for (const [baseName, entries] of grouped) {\n if (entries.length < 2) {\n continue;\n }\n\n const kept = choosePreferredSkill(entries);\n const removed = entries\n .filter((entry) => entry.path !== kept.path)\n .sort((left, right) => left.name.localeCompare(right.name));\n\n if (removed.length > 0) {\n duplicates.push({ baseName, kept, removed });\n }\n }\n\n return duplicates.sort((left, right) => left.baseName.localeCompare(right.baseName));\n}\n\nexport async function removeDuplicateSkills(\n homeDir: string,\n duplicates: DuplicateGroup[],\n options: { delete?: boolean } = {},\n): Promise<{ moved: string[]; deleted: string[] }> {\n const paths = getAweskillPaths(homeDir);\n await mkdir(paths.dupSkillsDir, { recursive: true });\n\n const moved: string[] = [];\n const deleted: string[] = [];\n\n for (const group of duplicates) {\n for (const skill of group.removed) {\n if (options.delete) {\n await rm(skill.path, { recursive: true, force: true });\n deleted.push(skill.name);\n continue;\n }\n\n const targetPath = await nextAvailableDupPath(paths.dupSkillsDir, skill.name);\n await rename(skill.path, targetPath);\n moved.push(`${skill.name} -> ${targetPath}`);\n }\n }\n\n return { moved, deleted };\n}\n\nasync function nextAvailableDupPath(dupSkillsDir: string, skillName: string): Promise<string> {\n const entries = new Set(await readdir(dupSkillsDir).catch(() => []));\n if (!entries.has(skillName)) {\n return path.join(dupSkillsDir, skillName);\n }\n\n let index = 1;\n while (entries.has(`${skillName}-${index}`)) {\n index += 1;\n }\n return path.join(dupSkillsDir, `${skillName}-${index}`);\n}\n","import { findDuplicateSkills, removeDuplicateSkills } from \"../lib/rmdup.js\";\nimport type { RuntimeContext } from \"../types.js\";\n\nexport async function runRmdup(\n context: RuntimeContext,\n options: { remove?: boolean; delete?: boolean },\n) {\n if (options.delete && !options.remove) {\n throw new Error(\"--delete requires --remove\");\n }\n\n const duplicates = await findDuplicateSkills(context.homeDir);\n\n if (duplicates.length === 0) {\n context.write(\"No duplicate skills found in the central repo.\");\n return { duplicates, moved: [], deleted: [] };\n }\n\n const lines = [\"Duplicate skill groups in central repo:\"];\n for (const group of duplicates) {\n lines.push(` ${group.baseName}: ${group.removed.length + 1} entries`);\n lines.push(` keep: ${group.kept.name} ${group.kept.path}`);\n for (const skill of group.removed) {\n lines.push(` drop: ${skill.name} ${skill.path}`);\n }\n }\n\n let moved: string[] = [];\n let deleted: string[] = [];\n if (options.remove) {\n const result = await removeDuplicateSkills(context.homeDir, duplicates, { delete: options.delete });\n moved = result.moved;\n deleted = result.deleted;\n lines.push(\"\");\n if (options.delete) {\n lines.push(`Deleted ${deleted.length} duplicate skills`);\n } else {\n lines.push(`Moved ${moved.length} duplicate skills to ${context.homeDir}/.aweskill/dup_skills`);\n }\n } else {\n lines.push(\"\");\n lines.push(\"Dry run only. Use --remove to move duplicates into dup_skills, or --remove --delete to delete them.\");\n }\n\n context.write(lines.join(\"\\n\"));\n return { duplicates, moved, deleted };\n}\n","import { access } from \"node:fs/promises\";\nimport path from \"node:path\";\n\nimport { listSupportedAgents, resolveAgentSkillsDir } from \"../lib/agents.js\";\nimport { getAweskillPaths } from \"../lib/path.js\";\nimport { listManagedSkillNames, removeManagedProjection } from \"../lib/symlink.js\";\nimport type { RuntimeContext } from \"../types.js\";\n\nasync function pathExists(targetPath: string): Promise<boolean> {\n try {\n await access(targetPath);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Scan all known agent skill directories and remove any managed projections\n * (symlinks or aweskill-copies) whose source no longer exists in the central repo.\n */\nexport async function runSync(context: RuntimeContext, options: { projectDir?: string }) {\n const { skillsDir } = getAweskillPaths(context.homeDir);\n const baseDirs = new Set<{ scope: \"global\" | \"project\"; dir: string }>();\n\n baseDirs.add({ scope: \"global\", dir: context.homeDir });\n if (options.projectDir) {\n baseDirs.add({ scope: \"project\", dir: options.projectDir });\n }\n if (await pathExists(path.join(context.cwd, \".aweskill.yaml\"))) {\n baseDirs.add({ scope: \"project\", dir: context.cwd });\n }\n\n let removed = 0;\n const warnings: string[] = [];\n\n for (const { scope, dir } of baseDirs) {\n for (const agent of listSupportedAgents()) {\n const skillsDir2 = resolveAgentSkillsDir(agent.id, scope, dir);\n const managed = await listManagedSkillNames(skillsDir2, skillsDir);\n for (const [skillName] of managed) {\n const sourcePath = path.join(skillsDir, skillName);\n if (!(await pathExists(sourcePath))) {\n const wasRemoved = await removeManagedProjection(path.join(skillsDir2, skillName));\n if (wasRemoved) {\n removed += 1;\n warnings.push(`Removed stale projection: ${agent.id}:${skillName} (source missing)`);\n }\n }\n }\n }\n }\n\n context.write(`Sync complete. Removed ${removed} stale projection(s).`);\n if (warnings.length > 0) {\n context.write(warnings.join(\"\\n\"));\n }\n return { removed, warnings };\n}\n","import { realpathSync } from \"node:fs\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\n\nexport function isDirectCliEntry(importMetaUrl: string, argv1?: string): boolean {\n if (!argv1) {\n return false;\n }\n\n try {\n const executedPath = realpathSync(argv1);\n const modulePath = realpathSync(fileURLToPath(importMetaUrl));\n return pathToFileURL(modulePath).href === pathToFileURL(executedPath).href;\n } catch {\n return importMetaUrl === pathToFileURL(argv1).href;\n }\n}\n","import * as p from \"@clack/prompts\";\nimport pc from \"picocolors\";\n\nfunction emitMessage(line: string) {\n const trimmed = line.trim();\n if (!trimmed) {\n return;\n }\n\n if (trimmed.startsWith(\"Warning: \")) {\n p.log.warn(trimmed.slice(\"Warning: \".length));\n return;\n }\n\n if (trimmed.startsWith(\"Error: \")) {\n p.log.error(trimmed.slice(\"Error: \".length));\n return;\n }\n\n if (\n trimmed.startsWith(\"Created \")\n || trimmed.startsWith(\"Backed up \")\n || trimmed.startsWith(\"Imported \")\n || trimmed.startsWith(\"Enabled \")\n || trimmed.startsWith(\"Disabled \")\n || trimmed.startsWith(\"Initialized \")\n || trimmed.startsWith(\"Deleted \")\n || trimmed.startsWith(\"Removed \")\n || trimmed.startsWith(\"Recovered \")\n || trimmed.startsWith(\"Sync applied \")\n ) {\n p.log.success(trimmed);\n return;\n }\n\n if (\n trimmed.startsWith(\"Skills in central repo:\")\n || trimmed === \"Scanned skills:\"\n || trimmed === \"Duplicate skill groups in central repo:\"\n || trimmed === \"Bundles:\"\n || trimmed.startsWith(\"Global skills for \")\n || trimmed.startsWith(\"Project skills for \")\n ) {\n console.log(pc.bold(trimmed));\n return;\n }\n\n if (trimmed.startsWith(\"linked:\") || trimmed.startsWith(\"duplicate:\") || trimmed.startsWith(\"new:\")) {\n console.log(pc.dim(trimmed));\n return;\n }\n\n if (trimmed.startsWith(\"No duplicate skills found\")) {\n console.log(pc.dim(trimmed));\n return;\n }\n\n if (line.startsWith(\" Global scanned skills for \") || line.startsWith(\" Project scanned skills for \")) {\n console.log(pc.dim(line.trim()));\n return;\n }\n\n if (line.startsWith(\" keep: \") || line.startsWith(\" drop: \")) {\n const [label, ...rest] = line.trim().split(\" \");\n const marker = label === \"keep:\" ? pc.green(\"keep:\") : pc.yellow(\"drop:\");\n console.log(` ${marker} ${rest.join(\" \")}`);\n return;\n }\n\n if (line.startsWith(\" ✓ \")) {\n const rest = line.slice(4);\n const firstSpace = rest.indexOf(\" \");\n if (firstSpace === -1) {\n console.log(` ${pc.green(\"✓\")} ${pc.cyan(rest)}`);\n return;\n }\n\n const name = rest.slice(0, firstSpace);\n const location = rest.slice(firstSpace + 1);\n console.log(` ${pc.green(\"✓\")} ${pc.cyan(name)} ${pc.dim(location)}`);\n return;\n }\n\n if (line.startsWith(\" ! \")) {\n const rest = line.slice(4);\n const firstSpace = rest.indexOf(\" \");\n if (firstSpace === -1) {\n console.log(` ${pc.yellow(\"!\")} ${pc.cyan(rest)}`);\n return;\n }\n\n const name = rest.slice(0, firstSpace);\n const location = rest.slice(firstSpace + 1);\n console.log(` ${pc.yellow(\"!\")} ${pc.cyan(name)} ${pc.dim(location)}`);\n return;\n }\n\n if (line.startsWith(\" ✓ \") || line.startsWith(\" ! \") || line.startsWith(\" + \")) {\n const marker = line.slice(4, 5);\n const rest = line.slice(6);\n const firstSpace = rest.indexOf(\" \");\n const name = firstSpace === -1 ? rest : rest.slice(0, firstSpace);\n const location = firstSpace === -1 ? \"\" : rest.slice(firstSpace + 1);\n const coloredMarker = marker === \"✓\" ? pc.green(\"✓\") : marker === \"!\" ? pc.yellow(\"!\") : pc.cyan(\"+\");\n console.log(` ${coloredMarker} ${pc.cyan(name)}${location ? ` ${pc.dim(location)}` : \"\"}`);\n return;\n }\n\n if (\n trimmed.startsWith(\"No skills found \")\n || trimmed === \"No bundles found.\"\n || trimmed.startsWith(\"Showing first \")\n || trimmed.startsWith(\"... and \")\n ) {\n console.log(pc.dim(trimmed));\n return;\n }\n\n p.log.message(trimmed, { symbol: pc.cyan(\"•\") });\n}\n\nexport function commandTitle(title: string): string {\n return pc.bgCyan(pc.black(` ${title} `));\n}\n\nexport function writeCliMessage(message: string) {\n for (const line of message.split(\"\\n\")) {\n emitMessage(line);\n }\n}\n\nexport function writeCliError(message: string) {\n for (const line of message.split(\"\\n\")) {\n if (!line.trim()) {\n continue;\n }\n p.log.error(line.replace(/^Error:\\s*/, \"\"));\n }\n}\n\nexport function introCommand(title: string) {\n p.intro(commandTitle(title));\n}\n\nexport function outroCommand(message = pc.green(\"Done.\")) {\n p.outro(message);\n}\n"],"mappings":";;;AAEA,SAAS,eAAe;AACxB,SAAS,WAAAA,gBAAe;;;ACHxB,SAAS,QAAQ,SAAS,aAAa;AACvC,SAAS,cAAc;AACvB,OAAOC,WAAU;AACjB,SAAS,aAAa;;;ACHtB,SAAS,eAAe;AACxB,OAAO,UAAU;AAIV,SAAS,aAAa,OAAuB;AAClD,SAAO,MACJ,KAAK,EACL,YAAY,EACZ,QAAQ,kBAAkB,GAAG,EAC7B,QAAQ,OAAO,EAAE,EACjB,QAAQ,OAAO,EAAE,EACjB,MAAM,GAAG,EAAE;AAChB;AAcO,SAAS,iBAAiB,SAAgC;AAC/D,QAAM,UAAU,KAAK,KAAK,SAAS,WAAW;AAC9C,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,WAAW,KAAK,KAAK,SAAS,QAAQ;AAAA,IACtC,cAAc,KAAK,KAAK,SAAS,YAAY;AAAA,IAC7C,WAAW,KAAK,KAAK,SAAS,QAAQ;AAAA,IACtC,YAAY,KAAK,KAAK,SAAS,SAAS;AAAA,EAC1C;AACF;AAwBO,SAAS,aAAgB,OAAiB;AAC/C,SAAO,CAAC,GAAG,IAAI,IAAI,KAAK,CAAC,EAAE,KAAK;AAClC;AAEO,SAAS,iBAAiB,OAAyB;AACxD,SAAO,MACJ,MAAM,GAAG,EACT,IAAI,CAAC,UAAU,MAAM,KAAK,CAAC,EAC3B,OAAO,OAAO;AACnB;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AEA,IAAI,iBAAiB,YAAY,KAAK,QAAQ,KAAK,CAAC,CAAC,GAAG;AACtD,OAAK,KAAK;AACZ;","names":["homedir","path","path","access","mkdir","readdir","path","access","mkdir","path","pathExists","access","mkdir","path","pathExists","access","path","mkdir","readdir","access","path","pathExists","access","mkdir","readdir","rm","path","pathExists","access","path","mkdir","readdir","rm","access","lstat","readdir","readlink","path","access","path","pathExists","access","path","lstat","pathExists","readlink","readdir","result","cp","lstat","mkdir","readFile","readdir","readlink","rm","writeFile","path","marker","getProjectDir","resolveAgentsForScope","mkdir","getProjectDir","resolveAgentsForScope","resolveSkillNames","mkdir","DEFAULT_PREVIEW_COUNT","cp","mkdir","readlink","unlink","path","getProjectDir","resolveAgentsForScope","path","readlink","unlink","mkdir","cp","rm","path","path","rm","cp","mkdir","rm","path","rm","mkdir","path","cp","mkdir","readdir","rename","rm","path","mkdir","rm","rename","readdir","path","access","path","pathExists","access","path","fileURLToPath","homedir"]}
package/package.json ADDED
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "aweskill",
3
+ "version": "0.1.5",
4
+ "description": "Local skill orchestration CLI",
5
+ "license": "MPL-2.0",
6
+ "type": "module",
7
+ "main": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "files": [
10
+ "dist",
11
+ "template",
12
+ "README.md",
13
+ "README.zh-CN.md"
14
+ ],
15
+ "bin": {
16
+ "aweskill": "dist/index.js"
17
+ },
18
+ "scripts": {
19
+ "build": "tsup",
20
+ "dev": "tsx src/index.ts",
21
+ "prepare": "npm run build",
22
+ "prepack": "npm run build",
23
+ "test": "vitest run"
24
+ },
25
+ "engines": {
26
+ "node": ">=20"
27
+ },
28
+ "keywords": [
29
+ "cli",
30
+ "skills",
31
+ "agents",
32
+ "claude-code",
33
+ "codex",
34
+ "cursor"
35
+ ],
36
+ "dependencies": {
37
+ "@clack/prompts": "^0.11.0",
38
+ "commander": "^14.0.1",
39
+ "picocolors": "^1.1.1",
40
+ "yaml": "^2.8.1"
41
+ },
42
+ "devDependencies": {
43
+ "@types/node": "^24.7.2",
44
+ "tsup": "^8.5.0",
45
+ "tsx": "^4.20.6",
46
+ "typescript": "^5.9.3",
47
+ "vitest": "^3.2.4"
48
+ },
49
+ "directories": {
50
+ "doc": "docs",
51
+ "test": "tests"
52
+ },
53
+ "repository": {
54
+ "type": "git",
55
+ "url": "git+https://github.com/mugpeng/aweskill.git"
56
+ },
57
+ "author": "",
58
+ "bugs": {
59
+ "url": "https://github.com/mugpeng/aweskill/issues"
60
+ },
61
+ "homepage": "https://github.com/mugpeng/aweskill#readme"
62
+ }
@@ -0,0 +1,144 @@
1
+ name: K-Dense-AI-scientific-skills
2
+ skills:
3
+ - adaptyv
4
+ - aeon
5
+ - alphafold-database
6
+ - anndata
7
+ - arboreto
8
+ - astropy
9
+ - benchling-integration
10
+ - biopython
11
+ - biorxiv-database
12
+ - bioservices
13
+ - brenda-database
14
+ - cellxgene-census
15
+ - chembl-database
16
+ - cirq
17
+ - citation-management
18
+ - clinical-decision-support
19
+ - clinical-reports
20
+ - clinicaltrials-database
21
+ - clinpgx-database
22
+ - clinvar-database
23
+ - cobrapy
24
+ - cosmic-database
25
+ - dask
26
+ - datacommons-client
27
+ - datamol
28
+ - deepchem
29
+ - deeptools
30
+ - denario
31
+ - diffdock
32
+ - dnanexus-integration
33
+ - docx
34
+ - drugbank-database
35
+ - ena-database
36
+ - ensembl-database
37
+ - esm
38
+ - etetoolkit
39
+ - exploratory-data-analysis
40
+ - fda-database
41
+ - flowio
42
+ - fluidsim
43
+ - fred-economic-data
44
+ - gene-database
45
+ - generate-image
46
+ - geniml
47
+ - geo-database
48
+ - geopandas
49
+ - get-available-resources
50
+ - gget
51
+ - gtars
52
+ - gwas-database
53
+ - histolab
54
+ - hmdb-database
55
+ - hypogenic
56
+ - hypothesis-generation
57
+ - imaging-data-commons
58
+ - iso-13485-certification
59
+ - kegg-database
60
+ - labarchive-integration
61
+ - lamindb
62
+ - latchbio-integration
63
+ - latex-posters
64
+ - literature-review
65
+ - market-research-reports
66
+ - markitdown
67
+ - matchms
68
+ - matlab
69
+ - matplotlib
70
+ - medchem
71
+ - metabolomics-workbench-database
72
+ - modal
73
+ - molfeat
74
+ - networkx
75
+ - neurokit2
76
+ - neuropixels-analysis
77
+ - omero-integration
78
+ - openalex-database
79
+ - opentargets-database
80
+ - opentrons-integration
81
+ - paper-2-web
82
+ - pathml
83
+ - pdb-database
84
+ - pdf
85
+ - peer-review
86
+ - pennylane
87
+ - perplexity-search
88
+ - plotly
89
+ - polars
90
+ - pptx
91
+ - pptx-posters
92
+ - protocolsio-integration
93
+ - pubchem-database
94
+ - pubmed-database
95
+ - pufferlib
96
+ - pydeseq2
97
+ - pydicom
98
+ - pyhealth
99
+ - pylabrobot
100
+ - pymatgen
101
+ - pymc
102
+ - pymoo
103
+ - pyopenms
104
+ - pysam
105
+ - pytdc
106
+ - pytorch-lightning
107
+ - qiskit
108
+ - qutip
109
+ - rdkit
110
+ - reactome-database
111
+ - research-grants
112
+ - research-lookup
113
+ - rowan
114
+ - scanpy
115
+ - scholar-evaluation
116
+ - scientific-brainstorming
117
+ - scientific-critical-thinking
118
+ - scientific-schematics
119
+ - scientific-slides
120
+ - scientific-visualization
121
+ - scientific-writing
122
+ - scikit-bio
123
+ - scikit-learn
124
+ - scikit-survival
125
+ - scvi-tools
126
+ - seaborn
127
+ - shap
128
+ - simpy
129
+ - stable-baselines3
130
+ - statistical-analysis
131
+ - statsmodels
132
+ - string-database
133
+ - sympy
134
+ - torchdrug
135
+ - transformers
136
+ - treatment-plans
137
+ - umap-learn
138
+ - uniprot-database
139
+ - uspto-database
140
+ - vaex
141
+ - venue-templates
142
+ - xlsx
143
+ - zarr-python
144
+ - zinc-database
@@ -0,0 +1,16 @@
1
+ name: Superpowers
2
+ skills:
3
+ - brainstorming
4
+ - dispatching-parallel-agents
5
+ - executing-plans
6
+ - finishing-a-development-branch
7
+ - receiving-code-review
8
+ - requesting-code-review
9
+ - subagent-driven-development
10
+ - systematic-debugging
11
+ - test-driven-development
12
+ - using-git-worktrees
13
+ - using-superpowers
14
+ - verification-before-completion
15
+ - writing-plans
16
+ - writing-skills