Skip to content

Use directory copy instead of symlinks for skills on Windows#535

Open
svarlamov wants to merge 2 commits intomainfrom
devin/1771275494-windows-skills-copy-instead-of-symlinks
Open

Use directory copy instead of symlinks for skills on Windows#535
svarlamov wants to merge 2 commits intomainfrom
devin/1771275494-windows-skills-copy-instead-of-symlinks

Conversation

@svarlamov
Copy link
Member

@svarlamov svarlamov commented Feb 16, 2026

Use directory copy instead of symlinks for skills on Windows

Summary

Resolves #533. On Windows, creating symlinks requires Administrator privileges for legacy reasons. This PR updates the skills installer to copy skill directories on Windows instead of creating symlinks, removing the admin requirement. Unix behavior (symlinks) is unchanged.

Changes in src/mdm/skills_installer.rs:

  • create_skills_symlinklink_skill_dir: uses #[cfg(unix)] symlink / #[cfg(windows)] recursive copy
  • New copy_dir_recursive (Windows-only): recursively copies a skill directory and its contents
  • remove_skills_symlinkremove_skill_link: now removes both symlinks (existing Unix installs) and copied directories (Windows), so uninstall works correctly on both platforms

Updates since last revision

Added unit tests covering the skills installation and linking logic (11 new tests total):

  • link_skill_dir: content accessibility, replacing existing directories/files, parent directory creation, symlink verification on Unix
  • remove_skill_link: directory removal, symlink removal, no-op on nonexistent paths
  • test_install_and_uninstall_skills_lifecycle: full install → re-install → uninstall → noop-uninstall lifecycle

Note: These tests exercise the Unix (symlink) code path. The Windows copy_dir_recursive path is verified by compilation only — it cannot be exercised in the Linux/macOS test runners.

Review & Testing Checklist for Human

  • Verify on a real Windows machine: the #[cfg(windows)] code paths (copy_dir_recursive, the copy branch in link_skill_dir) cannot be tested on Linux CI. Run git-ai install-hooks on Windows without admin privileges and confirm skills appear correctly in ~/.agents/skills/ and ~/.claude/skills/
  • Verify uninstall on Windows: run uninstall and confirm copied skill directories are cleaned up
  • Review remove_skill_link safety: the new logic calls remove_dir_all on non-symlink directories at the skill link paths — confirm this is acceptable given the paths are always ~/.agents/skills/{skill-name} or ~/.claude/skills/{skill-name}

Notes

On Windows, creating symlinks requires Administrator privileges.
Update the skills installer to copy skill directories on Windows
instead of using symlinks, while keeping symlinks on Unix.

The uninstall logic is also updated to handle both symlinks (for
existing Unix installs) and copied directories (for Windows).

Closes #533

Co-Authored-By: Sasha Varlamov <sasha@sashavarlamov.com>
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@git-ai-cloud-dev
Copy link

No AI authorship found for these commits. Please install git-ai to start tracking AI generated code in your commits.

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@svarlamov
Copy link
Member Author

Are there unit tests covering the skill installation? If not, can you add some to verify functionality and prevent regresions?

@devin-ai-integration
Copy link
Contributor

The existing tests only check that embedded skills are loaded and the skills dir path is correct. I'll add tests covering the actual install/uninstall logic including the linking and cleanup behavior.

Co-Authored-By: Sasha Varlamov <sasha@sashavarlamov.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update install/mdm logic to copy skills on WIndows instead of using symlinks to avoid admin requirement

2 participants