@safeskill/cli 0.2.2 → 0.2.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.
Files changed (2) hide show
  1. package/dist/cli.mjs +21 -3
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -935,6 +935,8 @@ async function parseSkillMd(skillMdPath, options) {
935
935
  ...metaData
936
936
  };
937
937
  } catch (metaError) {}
938
+ if (!skillData.name && options?.fallbackName) skillData.name = options.fallbackName;
939
+ if (!skillData.description && options?.fallbackDescription) skillData.description = options.fallbackDescription;
938
940
  if (!skillData.name || !skillData.description) return null;
939
941
  if (typeof skillData.name !== "string" || typeof skillData.description !== "string") return null;
940
942
  if (skillData.metadata?.internal === true && !shouldInstallInternalSkills() && !options?.includeInternal) return null;
@@ -944,7 +946,8 @@ async function parseSkillMd(skillMdPath, options) {
944
946
  path: dirname(skillMdPath),
945
947
  rawContent: content,
946
948
  metadata: skillData.metadata,
947
- slug: skillData.slug
949
+ slug: skillData.slug || options?.fallbackSlug,
950
+ installName: options?.fallbackInstallName
948
951
  };
949
952
  } catch {
950
953
  return null;
@@ -2312,7 +2315,7 @@ function createEmptyLocalLock() {
2312
2315
  skills: {}
2313
2316
  };
2314
2317
  }
2315
- var version$1 = "0.2.2";
2318
+ var version$1 = "0.2.3";
2316
2319
  const isCancelled$1 = (value) => typeof value === "symbol";
2317
2320
  async function isSourcePrivate(source) {
2318
2321
  const ownerRepo = parseOwnerRepo(source);
@@ -2827,10 +2830,24 @@ async function runAdd(args, options = {}) {
2827
2830
  }
2828
2831
  const includeInternal = !!(options.skill && options.skill.length > 0);
2829
2832
  spinner.start("Discovering skills...");
2830
- const skills = await discoverSkills(skillsDir, parsed.subpath, {
2833
+ let skills = await discoverSkills(skillsDir, parsed.subpath, {
2831
2834
  includeInternal,
2832
2835
  fullDepth: options.fullDepth
2833
2836
  });
2837
+ let usedHubMetadataFallback = false;
2838
+ if (skills.length === 0 && parsed.type === "hub" && !parsed.subpath && hubResolved?.skill) {
2839
+ const fallbackSkill = await parseSkillMd(join(skillsDir, "SKILL.md"), {
2840
+ includeInternal,
2841
+ fallbackName: hubResolved.skill.display_name || hubResolved.skill.name,
2842
+ fallbackDescription: hubResolved.skill.summary || hubResolved.skill.name,
2843
+ fallbackSlug: hubResolved.skill.name,
2844
+ fallbackInstallName: hubResolved.skill.name
2845
+ });
2846
+ if (fallbackSkill) {
2847
+ skills = [fallbackSkill];
2848
+ usedHubMetadataFallback = true;
2849
+ }
2850
+ }
2834
2851
  if (skills.length === 0) {
2835
2852
  spinner.stop(import_picocolors.default.red("No skills found"));
2836
2853
  Se(import_picocolors.default.red("No valid skills found. Skills require a SKILL.md with name and description."));
@@ -2838,6 +2855,7 @@ async function runAdd(args, options = {}) {
2838
2855
  process.exit(1);
2839
2856
  }
2840
2857
  spinner.stop(`Found ${import_picocolors.default.green(skills.length)} skill${skills.length > 1 ? "s" : ""}`);
2858
+ if (usedHubMetadataFallback) M.warn("Warning: this hub artifact is missing SKILL.md frontmatter. Some agents may not recognize this skill until name and description are added to SKILL.md.");
2841
2859
  if (options.list) {
2842
2860
  console.log();
2843
2861
  M.step(import_picocolors.default.bold("Available Skills"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@safeskill/cli",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "SafeSkill CLI, for safe your skills",
5
5
  "type": "module",
6
6
  "bin": {