Skip to content

[BUG] EEXIST when overwriting an existing skill during installation #73

@Endcat

Description

@Endcat

Bug Description
When attempting to install a skill that is already present in the project, selecting "Yes" to overwrite causes the CLI to crash with an EEXIST error. It seems the internal copy operation cpSync fails because the destination directory already exists and is not being handled correctly during the overwrite process.

Steps to Reproduce

  1. mkdir test-repo && cd test-repo
  2. npx openskills install nextlevelbuilder/ui-ux-pro-max-skill
  3. Run the exact same install command again: npx openskills install nextlevelbuilder/ui-ux-pro-max-skill
  4. When prompted "Skill 'ui-ux-pro-max' already exists. Overwrite?", select y.

Expected Behavior
The existing skill directory should be overwritten or updated with the fresh copy from the repository without crashing.

Actual Behavior
The process crashes immediately after selecting "Yes" with a Node.js EEXIST error.

Environment

  • openskills version: 1.5.0 (via npx openskills --version)
  • Operating System: macOS 26.3
  • Node.js version: v24.13.0
  • AI agent: Claude Code (Targeting .claude/skills)

Installation Context

  • Global install (npm i -g openskills)
  • Local install via npm link
  • Installed skills: (list from openskills list)
  • npx execution (npx openskills ...)

Additional Context
full error log & stack trace:

✔ Skill 'ui-ux-pro-max' already exists. Overwrite? Yes
node:internal/fs/cp/cp-sync:145
    return fsBinding.cpSyncCopyDir(src, dest,
                     ^
Error: EEXIST, File exists '/Users/yuki/workspace/test-repo/.claude/skills/ui-ux-pro-max'
    at copyDir (node:internal/fs/cp/cp-sync:145:22)
    at onDir (node:internal/fs/cp/cp-sync:137:10)
    at getStats (node:internal/fs/cp/cp-sync:68:12)
    at cpSyncFn (node:internal/fs/cp/cp-sync:58:10)
    at cpSync (node:fs:3159:3)
    at installFromRepo (file:///Users/yuki/.npm/_npx/3527d6942a6d9730/node_modules/openskills/dist/cli.js:472:5)
    at async Command.installSkill (file:///Users/yuki/.npm/_npx/3527d6942a6d9730/node_modules/openskills/dist/cli.js:279:7) {
  errno: 17,
  code: 'EEXIST',
  path: '/Users/yuki/workspace/test-repo/.claude/skills/ui-ux-pro-max',
  syscall: 'cp'
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions