Repository navigation
Description
Skill directories installed as symlinks into a discovery root (e.g. ~/.agents/skills/) are silently skipped: they never appear in the session catalog, SkillSearch does not see them, and no rejection or diagnostic is recorded anywhere.
Reproduction
-
Keep skills in a central repo and link them into the user discovery root, a common dotfiles pattern:
ln -s ~/workspace/dev/skills/skills/wrap-up ~/.agents/skills/wrap-up
-
Start a session. The skill is absent from the prompt catalog, and
SkillSearchreports a lowertotalEligiblewith no trace of the skipped entries.
Observed on current main: of 19 entries in ~/.agents/skills/, the 10 symlinked ones were all invisible; the 9 real directories scanned normally.
Root cause
scanSkillDir in packages/runtime/src/skills-discovery.ts:
entries = await readdir(dir, { withFileTypes: true });
// ...
for (const dirEntry of entries) {
if (!dirEntry.isDirectory()) continue;Dirent.isDirectory() reflects the entry itself and is false for a symlink, so every symlinked skill directory hits continue before any path handling — silently: not in rejected, not in diagnostics, not in discoveryDiagnostics.
Notably, the containment machinery already supports this safely: readContainedRegularFile realpaths the skill directory and rejects targets outside the containment root, so a symlink pointing inside the root (the dotfiles case) is a safe, checkable shape. And the policy asymmetry is visible in docs/skill-catalog-policy.md: a symlinked discovery root produces a bounded blocked_path diagnostic, while a symlinked entry produces nothing at all.
Expected behavior
- A symlinked skill directory whose target resolves to a directory inside the containment root is scanned like a real directory (resolve via
stat/realpath, let the existing containment check govern). - A symlink whose target escapes the containment root, or that dangles, produces a bounded
SkillDiscoveryDiagnostic(e.g.blocked_path) and appears in the Desktop inventory — per the documented contract, an unusable discovery entry "must not be collapsed into an indistinguishable empty catalog."
Acceptance hints
- Regression test: symlinked skill dir inside the containment root scans; symlink escaping the root is rejected with a diagnostic; dangling symlink is diagnosed, not silent.
- The fix should stay inside
scanSkillDir;readContainedRegularFileneeds no change.
Diagnosis verified against main source with an AI agent (Maka); the repro above is its exact finding.
Activity
Sun-GLiang commentedon Aug 28, 2026
take