-
Notifications
You must be signed in to change notification settings - Fork 545
Description
Bug Description
The install command's isLocalPath() function only recognizes Unix-style paths (/, ./, ../, ~/), causing it to fail on Windows absolute paths. This makes it impossible to install local skills on Windows using absolute paths.
Environment
- OS: Windows (with Git Bash/MSYS2)
- openskills version: 1.5.0
- Node.js version: (tested on v20.x)
Current isLocalPath() Implementation
function isLocalPath(source: string): boolean {
return (
source.startsWith('/') || // Unix absolute
source.startsWith('./') || // Relative
source.startsWith('../') || // Parent relative
source.startsWith('~/') // Home directory
);
}Problem Cases
All of the following Windows paths are incorrectly treated as GitHub repositories:
| Path Format | What Happens | Error |
|---|---|---|
C:/Users/... |
Treated as GitHub repo | Tries to clone https://github.com/C:/Users/... |
/c/Users/... (Git Bash) |
Treated as GitHub repo | Same error |
~/.agent/... |
Auto-converted to C:/Users/... by Git Bash |
Same error |
~\agent\... |
Not recognized as local path | "Invalid source format" |
C:\Users\... |
Not recognized as local path | "Invalid source format" |
Test Results with MSYS_NO_PATHCONV
Setting MSYS_NO_PATHCONV=1 doesn't solve the problem:
# Still fails - path treated as GitHub repo
MSYS_NO_PATHCONV=1 npx openskills install C:/Users/jayvi/.agent/skills/gh-cli
# Fails - /c/ parsed as C:\c\ (extra \c)
MSYS_NO_PATHCONV=1 npx openskills install /c/Users/jayvi/.agent/skills/gh-cliExpected Behavior
All these paths should be correctly recognized as local paths:
# Windows absolute (forward slash)
npx openskills install C:/Users/jayvi/.agent/skills/gh-cli
# Windows absolute (backslash)
npx openskills install C:\Users\jayvi\.agent\skills\gh-cli
# Git Bash style
npx openskills install /c/Users/jayvi/.agent/skills/gh-cli
# Windows home directory
npx openskills install ~\.agent\my-skills\skills\gh-cliProposed Solution
Update isLocalPath() to support Windows path formats:
function isLocalPath(source: string): boolean {
return (
source.startsWith('/') ||
source.startsWith('./') ||
source.startsWith('../') ||
source.startsWith('~/') ||
source.startsWith('~\\') || // Windows home
/^[a-zA-Z]:[/\\]/.test(source) // Windows drive (C:/ or C:\)
);
}And update expandPath() to handle Git Bash /c/Users/ → C:\Users\ mapping and Windows backslashes.
Workaround
Currently, the only reliable way to install local skills on Windows is using relative paths:
cd ~/.agent/my-skills
npx openskills install ./skills/gh-cli --global --universal -yAdditional Context
This affects all Windows users trying to install local skills from absolute paths, making the CLI less intuitive and requiring users to navigate to specific directories first.