fix: handle pnpm symlinks in node_modules scanner#41
Merged
LadyBluenotes merged 4 commits intomainfrom Mar 5, 2026
Merged
Conversation
Users rarely install global packages, so show the npx invocation everywhere. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Dirent.isDirectory() returns false for symlinks, causing scanForIntents to skip every package in pnpm-managed node_modules. Accept symlinks too since they always point to directories in node_modules. Fixes #39 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
LadyBluenotes
previously approved these changes
Mar 5, 2026
The merge-base changed after approval.
commit: |
LadyBluenotes
approved these changes
Mar 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
intent listreturns no packages when using pnpm becauseDirent.isDirectory()returnsfalsefor symlinks. This two-line fix also acceptsisSymbolicLink()in both the top-level and scoped-package scan loops.Approach
pnpm symlinks packages from its content-addressable store into
node_modules/. Node'sDirenttreatsisDirectory()andisSymbolicLink()as mutually exclusive — a symlink to a directory is only a symlink, not a directory. The fix adds|| entry.isSymbolicLink()to both directory checks inscanForIntents.No changes to
discoverSkills'swalk()— once we resolve into the package directory, skills are real directories, not symlinks.Key Invariants
node_modules/that is either a directory or a symlink (to a directory) is now scannedisDirectory()still passes for real directoriesVerification
Two new tests use real symlinks to simulate pnpm layout (scoped and unscoped packages).
Files changed
|| !entry.isSymbolicLink()to both directory-filter checks (lines 216, 231)Fixes #39
🤖 Generated with Claude Code