Ruler generates backslashes on Windows, breaks Linux CI sync check
We use ruler (intellectronica/ruler) to generate
.github/copilot-instructions.mdfor GitHub Copilot. On my Windows machineyarn ruler:applywritesSource: .ruler\00-project-overview.mdin the frontmatter, but on the Linux CI server it writesSource: .ruler/00-project-overview.md, so the sync check fails with 'Ruler configuration is out of sync!'. Is there a way to make the generated output deterministic across platforms?Originally asked on GitHub: https://github.com/intellectronica/ruler/issues/60
4 answers
Status: fixed — the issue is closed as completed. The maintainer's chosen fix is to always use
/as the path separator when ruler writes theSource:line in frontmatter, so the output is identical on Windows and Linux. The thread does not name a release version, so check the changelog if you are on an old build.What happened: ruler injects a
Source: .ruler/<file>.mdline into the frontmatter of generated files such as.github/copilot-instructions.md. On Windows the path was written with backslashes (Source: .ruler\00-project-overview.md); on Linux CI it was written with forward slashes (Source: .ruler/00-project-overview.md). Any check that runsyarn ruler:applyand diffs the generated file fails with 'Ruler configuration is out of sync!' even though the actual content did not change.The reporter suggested adding an option to omit the Source frontmatter line entirely. A contributor offered to implement that as an option defaulting to false and open a PR. The maintainer said the source mention is documentation-only (not a link) and that the simplest fix is to normalize the separator, then directed a pull request that always uses
/, with tests.Until the fix is in your version, the
ruler:applyworkflow leaves a one-line diff between Windows and Linux. If you cannot upgrade immediately, general advice (not from the thread): normalize backslashes in the generated file before diffing in CI, or exclude theSource:line from the sync check.Did this work for you?What a GitHub user tried on GitHub (Didn't work)
Ran
yarn ruler:applyon Windows and committed the generated.github/copilot-instructions.md; the Linux CI check then fails because theSource:path uses backslashes locally and forward slashes in CI.Source: https://github.com/intellectronica/ruler/issues/60 (opens external site)
Did this work for you?What @FraserKillip tried on GitHub (Outcome unclear)
A contributor suggested removing the Source frontmatter or making it an optional feature defaulting to false, and offered to raise a PR.
Source: https://github.com/intellectronica/ruler/issues/60#issuecomment-3166670442 (opens external site)
Did this work for you?What @intellectronica tried on GitHub (Outcome unclear)
The maintainer decided the output should always use
/as the path separator and asked for the change to be implemented with tests in a PR; the issue was closed as completed.Source: https://github.com/intellectronica/ruler/issues/60#issuecomment-3218999698 (opens external site)
Did this work for you?
Related questions
- Trae AI in ruler: where are project rules and mcp.json stored?
- Does ruler support Amp, and where does it store rules?
- How do I stop ruler apply from creating .bak backup files?
- How can ruler support Roo Code .roorules / .roo/rules/* config files?
- Ruler 0.3.0–0.3.6 writes type:stdio instead of source:custom in .zed/settings.json