skilld 0.13.1 → 0.13.3

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.
package/dist/cli.mjs CHANGED
@@ -1546,7 +1546,7 @@ async function enhanceSkillWithLLM(opts) {
1546
1546
  } : features;
1547
1547
  const llmLog = p.taskLog({ title: `Agent exploring ${packageName}` });
1548
1548
  const docFiles = listReferenceFiles(skillDir);
1549
- const { optimized, wasOptimized, usage, cost, warnings, debugLogsDir } = await optimizeDocs({
1549
+ const { optimized, wasOptimized, usage, cost, warnings, error, debugLogsDir } = await optimizeDocs({
1550
1550
  packageName,
1551
1551
  skillDir,
1552
1552
  model,
@@ -1575,6 +1575,7 @@ async function enhanceSkillWithLLM(opts) {
1575
1575
  const costSuffix = costParts.length > 0 ? ` (${costParts.join(", ")})` : "";
1576
1576
  llmLog.success(`Generated best practices${costSuffix}`);
1577
1577
  if (debugLogsDir) p.log.info(`Debug logs: ${debugLogsDir}`);
1578
+ if (error) p.log.warn(`\x1B[33mPartial failure: ${error}\x1B[0m`);
1578
1579
  if (warnings?.length) for (const w of warnings) p.log.warn(`\x1B[33m${w}\x1B[0m`);
1579
1580
  const skillMd = generateSkillMd({
1580
1581
  name: packageName,
@@ -1599,7 +1600,7 @@ async function enhanceSkillWithLLM(opts) {
1599
1600
  eject
1600
1601
  });
1601
1602
  writeFileSync(join(skillDir, "SKILL.md"), skillMd);
1602
- } else llmLog.error("LLM optimization failed");
1603
+ } else llmLog.error(`LLM optimization failed${error ? `: ${error}` : ""}`);
1603
1604
  }
1604
1605
  const TELEMETRY_URL = "https://add-skill.vercel.sh/t";
1605
1606
  const SKILLS_VERSION = "1.3.9";
@@ -1635,7 +1636,15 @@ async function syncGitSkills(opts) {
1635
1636
  }
1636
1637
  spin.stop(`Found ${skills.length} skill(s) in ${label}`);
1637
1638
  let selected = skills;
1638
- if (source.skillPath) selected = skills;
1639
+ if (opts.skillFilter?.length) {
1640
+ const filterSet = new Set(opts.skillFilter.map((s) => s.toLowerCase()));
1641
+ selected = skills.filter((s) => filterSet.has(s.name.toLowerCase()));
1642
+ if (selected.length === 0) {
1643
+ p.log.warn(`No skills matched: ${opts.skillFilter.join(", ")}`);
1644
+ p.log.message(`Available: ${skills.map((s) => s.name).join(", ")}`);
1645
+ return;
1646
+ }
1647
+ } else if (source.skillPath) selected = skills;
1639
1648
  else if (skills.length > 1 && !yes) {
1640
1649
  const choices = await p.multiselect({
1641
1650
  message: `Select skills to install from ${label}`,
@@ -1644,11 +1653,12 @@ async function syncGitSkills(opts) {
1644
1653
  value: s.name,
1645
1654
  hint: s.description || s.path
1646
1655
  })),
1647
- initialValues: skills.map((s) => s.name)
1656
+ initialValues: []
1648
1657
  });
1649
1658
  if (p.isCancel(choices)) return;
1650
1659
  const selectedNames = new Set(choices);
1651
1660
  selected = skills.filter((s) => selectedNames.has(s.name));
1661
+ if (selected.length === 0) return;
1652
1662
  }
1653
1663
  mkdirSync(baseDir, { recursive: true });
1654
1664
  for (const skill of selected) {
@@ -2547,6 +2557,12 @@ const addCommandDef = defineCommand({
2547
2557
  description: "Package(s) to sync (space or comma-separated, e.g., vue nuxt pinia)",
2548
2558
  required: true
2549
2559
  },
2560
+ skill: {
2561
+ type: "string",
2562
+ alias: "s",
2563
+ description: "Select specific skills from a git repo (comma-separated)",
2564
+ valueHint: "name"
2565
+ },
2550
2566
  ...sharedArgs
2551
2567
  },
2552
2568
  async run({ args }) {
@@ -2565,15 +2581,19 @@ const addCommandDef = defineCommand({
2565
2581
  if (git) gitSources.push(git);
2566
2582
  else npmTokens.push(input);
2567
2583
  }
2568
- if (gitSources.length > 0) for (const source of gitSources) await syncGitSkills({
2569
- source,
2570
- global: args.global,
2571
- agent,
2572
- yes: args.yes,
2573
- model: args.model,
2574
- force: args.force,
2575
- debug: args.debug
2576
- });
2584
+ if (gitSources.length > 0) for (const source of gitSources) {
2585
+ const skillFilter = args.skill ? args.skill.split(/[,\s]+/).map((s) => s.trim()).filter(Boolean) : void 0;
2586
+ await syncGitSkills({
2587
+ source,
2588
+ global: args.global,
2589
+ agent,
2590
+ yes: args.yes,
2591
+ model: args.model,
2592
+ force: args.force,
2593
+ debug: args.debug,
2594
+ skillFilter
2595
+ });
2596
+ }
2577
2597
  if (npmTokens.length > 0) {
2578
2598
  const packages = [...new Set(npmTokens.flatMap((s) => s.split(/[,\s]+/)).map((s) => s.trim()).filter(Boolean))];
2579
2599
  const state = await getProjectState(cwd);