add-skill 1.0.25 → 1.0.26

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/index.js +16 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -173,6 +173,7 @@ async function parseSkillMd(skillMdPath) {
173
173
  name: data.name,
174
174
  description: data.description,
175
175
  path: dirname(skillMdPath),
176
+ rawContent: content,
176
177
  metadata: data.metadata
177
178
  };
178
179
  } catch {
@@ -1055,9 +1056,10 @@ registerProvider(huggingFaceProvider);
1055
1056
  import { readFile as readFile2, writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
1056
1057
  import { join as join5, dirname as dirname2 } from "path";
1057
1058
  import { homedir as homedir3 } from "os";
1059
+ import { createHash } from "crypto";
1058
1060
  var AGENTS_DIR2 = ".agents";
1059
1061
  var LOCK_FILE = ".skill-lock.json";
1060
- var CURRENT_VERSION = 1;
1062
+ var CURRENT_VERSION = 2;
1061
1063
  function getSkillLockPath() {
1062
1064
  return join5(homedir3(), AGENTS_DIR2, LOCK_FILE);
1063
1065
  }
@@ -1069,6 +1071,9 @@ async function readSkillLock() {
1069
1071
  if (typeof parsed.version !== "number" || !parsed.skills) {
1070
1072
  return createEmptyLockFile();
1071
1073
  }
1074
+ if (parsed.version < CURRENT_VERSION) {
1075
+ return createEmptyLockFile();
1076
+ }
1072
1077
  return parsed;
1073
1078
  } catch (error) {
1074
1079
  return createEmptyLockFile();
@@ -1080,6 +1085,9 @@ async function writeSkillLock(lock) {
1080
1085
  const content = JSON.stringify(lock, null, 2);
1081
1086
  await writeFile2(lockPath, content, "utf-8");
1082
1087
  }
1088
+ function computeContentHash(content) {
1089
+ return createHash("sha256").update(content, "utf-8").digest("hex");
1090
+ }
1083
1091
  async function addSkillToLock(skillName, entry) {
1084
1092
  const lock = await readSkillLock();
1085
1093
  const now = (/* @__PURE__ */ new Date()).toISOString();
@@ -1101,7 +1109,7 @@ function createEmptyLockFile() {
1101
1109
  // package.json
1102
1110
  var package_default = {
1103
1111
  name: "add-skill",
1104
- version: "1.0.25",
1112
+ version: "1.0.26",
1105
1113
  description: "Install agent skills onto coding agents (OpenCode, Claude Code, Codex, Cursor)",
1106
1114
  type: "module",
1107
1115
  bin: {
@@ -1459,7 +1467,8 @@ async function handleRemoteSkill(source, url, options, spinner2) {
1459
1467
  await addSkillToLock(remoteSkill.installName, {
1460
1468
  source: remoteSkill.sourceIdentifier,
1461
1469
  sourceType: remoteSkill.providerId,
1462
- sourceUrl: url
1470
+ sourceUrl: url,
1471
+ contentHash: computeContentHash(remoteSkill.content)
1463
1472
  });
1464
1473
  } catch {
1465
1474
  }
@@ -1716,7 +1725,8 @@ async function handleDirectUrlSkillLegacy(source, url, options, spinner2) {
1716
1725
  await addSkillToLock(mintlifySkill.mintlifySite, {
1717
1726
  source: `mintlify/${mintlifySkill.mintlifySite}`,
1718
1727
  sourceType: "mintlify",
1719
- sourceUrl: url
1728
+ sourceUrl: url,
1729
+ contentHash: computeContentHash(mintlifySkill.content)
1720
1730
  });
1721
1731
  } catch {
1722
1732
  }
@@ -2092,7 +2102,8 @@ async function main(source, options) {
2092
2102
  source: normalizedSource,
2093
2103
  sourceType: parsed.type,
2094
2104
  sourceUrl: parsed.url,
2095
- skillPath: skillFiles[skill.name]
2105
+ skillPath: skillFiles[skill.name],
2106
+ contentHash: skill.rawContent ? computeContentHash(skill.rawContent) : ""
2096
2107
  });
2097
2108
  } catch {
2098
2109
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "add-skill",
3
- "version": "1.0.25",
3
+ "version": "1.0.26",
4
4
  "description": "Install agent skills onto coding agents (OpenCode, Claude Code, Codex, Cursor)",
5
5
  "type": "module",
6
6
  "bin": {