Summary
ruler apply on Windows can fail during native skills propagation with:
[ruler] EPERM: operation not permitted, rename '...\\skills.tmp-<timestamp>' -> '...\\skills'
This reproduces on @intellectronica/[email protected], which is also the latest npm version at the time of testing.
Reproduction
Project root contained a .ruler/skills directory and native agent folders including .claude.
Command:
Observed failure:
[ruler] Nested mode is experimental and may change in future releases.
[ruler] Skills are configured, but the following agents do not support native skills and will be skipped: Warp
[ruler] Skills support is experimental and behavior may change in future releases.
[ruler] EPERM: operation not permitted, rename 'C:\Users\...\Atlas\\.claude\\skills.tmp-1775568298919' -> 'C:\Users\...\Atlas\\.claude\\skills'
Isolation
ruler apply --skills false completes successfully, so the failure is isolated to the native skills propagation step.
The installed CLI implementation uses a direct fs.rename(tempDir, targetDir) after copying .ruler/skills to a temporary directory. On Windows this can lose a race with Defender or another filesystem lock and return EPERM.
Root cause
In the current release, skills propagation uses a direct rename with no retry and no fallback copy path.
Affected implementation area:
dist/core/SkillsProcessor.js
propagateSkillsForClaude
propagateSkillsForCodex
propagateSkillsForOpenCode
- equivalent functions for other native-skills targets
Workarounds verified locally
ruler apply --skills false succeeds.
- A local patch that wraps the final replace step with:
- retry on
EPERM, EBUSY, and ENOTEMPTY
- fallback to copy-and-remove when rename still fails
After that local patch, plain ruler apply succeeded.
Suggested fix
In SkillsProcessor, replace the direct fs.rename(tempDir, targetDir) with a helper that:
- retries transient Windows rename errors
- falls back to copy-and-remove if the rename keeps failing
- keeps temp-directory cleanup in the existing error path
That should preserve the current behavior on normal filesystems while making skills propagation reliable on Windows.
Summary
ruler applyon Windows can fail during native skills propagation with:This reproduces on
@intellectronica/[email protected], which is also the latest npm version at the time of testing.Reproduction
Project root contained a
.ruler/skillsdirectory and native agent folders including.claude.Command:
Observed failure:
Isolation
ruler apply --skills falsecompletes successfully, so the failure is isolated to the native skills propagation step.The installed CLI implementation uses a direct
fs.rename(tempDir, targetDir)after copying.ruler/skillsto a temporary directory. On Windows this can lose a race with Defender or another filesystem lock and returnEPERM.Root cause
In the current release, skills propagation uses a direct rename with no retry and no fallback copy path.
Affected implementation area:
dist/core/SkillsProcessor.jspropagateSkillsForClaudepropagateSkillsForCodexpropagateSkillsForOpenCodeWorkarounds verified locally
ruler apply --skills falsesucceeds.EPERM,EBUSY, andENOTEMPTYAfter that local patch, plain
ruler applysucceeded.Suggested fix
In
SkillsProcessor, replace the directfs.rename(tempDir, targetDir)with a helper that:That should preserve the current behavior on normal filesystems while making skills propagation reliable on Windows.