Problem
OpenSpec validation fails on Windows with the confusing error "Change must have a Why section" even when the ## Why section exists in the file. This is caused by Windows CRLF line endings (\r\n) breaking the Markdown parser.
Environment
- OS: Windows 11
- OpenSpec Version: v0.3.0
- Node.js: 20.19.0
- Editor: Cursor (any Windows editor that creates CRLF files)
Steps to Reproduce
- Install OpenSpec on Windows:
npm install -g @fission-ai/openspec@latest
- Initialize project:
openspec init (select Cursor)
- Create proposal:
/openspec-proposal Test proposal
- Run validation:
openspec validate test-proposal
- Result: Error: "Change must have a Why section" (even though section exists)
Root Cause Analysis
Windows editors create files with CRLF line endings (0D 0A in hex), but OpenSpec's Node.js parser expects Unix LF line endings (0A only).
Evidence:
Format-Hex proposal.md | Select-Object -First 1
Shows: 23 23 20 57 68 79 0D 0A (## Why with CRLF)
Should be: 23 23 20 57 68 79 0A 0A (## Why with LF)
Current Workaround
For Windows Users:
Fix existing OpenSpec files
Get-ChildItem "openspec/" -Recurse -Filter "*.md" | ForEach-Object {
$content = Get-Content $_.FullName -Raw
if ($content -match "rn") {
$content = $content -replace "rn", "`n"
[System.IO.File]::WriteAllText($_.FullName, $content, [System.Text.UTF8Encoding]::new($false))
Write-Host "Fixed: $($_.Name)"
}
}
Configure editor for future files
Cursor: File → Preferences → VS Code Settings → "files.eol" → "\n"
Problem
OpenSpec validation fails on Windows with the confusing error "Change must have a Why section" even when the
## Whysection exists in the file. This is caused by Windows CRLF line endings (\r\n) breaking the Markdown parser.Environment
Steps to Reproduce
npm install -g @fission-ai/openspec@latestopenspec init(select Cursor)/openspec-proposal Test proposalopenspec validate test-proposalRoot Cause Analysis
Windows editors create files with CRLF line endings (
0D 0Ain hex), but OpenSpec's Node.js parser expects Unix LF line endings (0Aonly).Evidence:
Current Workaround
For Windows Users:
Fix existing OpenSpec files
Configure editor for future files
Cursor: File → Preferences → VS Code Settings → "files.eol" → "\n"