Skip to content

Commit 2944ef6

Browse files
committed
fix: bot review notes (link-local-skills error handling, comments, example readme)
1 parent 1ba6039 commit 2944ef6

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

examples/ensskills-example/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
A minimal Node project for dogfooding the [`ensskills`](../../packages/ensskills) package — the
44
versioned agent skills that teach AI coding agents the ENS Omnigraph.
55

6-
> **Schema version:** This example tracks the NameHash-hosted instances' version (`1.15.2`). If you query a different ENSNode version, you must match its ENSNode version with the same `enskit`/`enssdk` version.
6+
> **Schema version:** This example tracks the NameHash-hosted instances' version (`1.15.2`). If you query a different ENSNode version, install the matching `ensskills` version.
77
88
Refer to the [ensskills integration guide](https://ensnode.io/docs/integrate/integration-options/ensskills) to use `ensskills` in your own project.
99

scripts/link-local-skills.mjs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ mkdirSync(target, { recursive: true });
1313
const isLocalSkill = (name) => !name.startsWith("npm-") && !name.startsWith(".");
1414
const localSkills = readdirSync(source).filter(isLocalSkill);
1515

16-
// drop symlinks into .agents/skills whose canonical skill no longer exists
16+
// drop symlinks in .claude/skills that point into .agents/skills whose canonical skill no longer exists
1717
for (const name of readdirSync(target)) {
1818
if (!isLocalSkill(name)) continue;
1919
const path = join(target, name);
@@ -30,11 +30,16 @@ for (const name of localSkills) {
3030
unlinkSync(path);
3131
} catch {
3232
// missing or not a symlink: a real directory here is a personal skill — leave it
33+
let stat;
3334
try {
34-
if (lstatSync(path).isDirectory()) continue;
35-
// a regular file here would make symlinkSync throw EEXIST — remove it first
36-
unlinkSync(path);
37-
} catch {}
35+
stat = lstatSync(path);
36+
} catch {
37+
stat = null; // nothing here; symlinkSync below will create it
38+
}
39+
if (stat?.isDirectory()) continue;
40+
// a regular file here would make symlinkSync throw EEXIST — remove it first
41+
// (let an unlink failure escape rather than mask it as a downstream EEXIST)
42+
if (stat) unlinkSync(path);
3843
}
3944
symlinkSync(desired, path);
4045
console.log(`linked .claude/skills/${name} -> ${desired}`);

0 commit comments

Comments
 (0)