fix: normalize skill file content in extensions to handle BOM and CRLF - #1667
Merged
Merged
Conversation
- Add normalizeSkillFileContent function to skill-load.ts - Update regex to allow frontmatter ending without trailing newline - Add comprehensive tests for CRLF, BOM, and edge cases Fixes #1666
LaZzyMan
requested review from
DennisYu07,
Mingholy,
gwinthis,
pomelo-nwu and
tanzhenxin
as code owners
January 30, 2026 03:45
Contributor
📋 Review SummaryThis PR addresses an important cross-platform compatibility issue where skill files bundled with extensions on Windows would fail to parse due to UTF-8 BOM and CRLF line endings. The solution introduces content normalization and improves the regex pattern to handle various edge cases. The addition of comprehensive tests ensures the fix works correctly across different scenarios. 🔍 General Feedback
🎯 Specific Feedback🟡 High
🟢 Medium
🔵 Low
✅ Highlights
|
Contributor
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
xaelistic
pushed a commit
to xaelistic/qwen-code
that referenced
this pull request
Jun 7, 2026
…ter-extension-skills fix: normalize skill file content in extensions to handle BOM and CRLF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR
Fix YAML formatter error when loading skills bundled with extensions on Windows. The
parseSkillContentfunction inskill-load.tsnow handles UTF-8 BOM and CRLF line endings correctly.Dive Deeper
Root Cause: The
parseSkillContentfunction inskill-load.ts(used for extension skills) had two issues:---, failing when files ended immediately after frontmatterMeanwhile,
skill-manager.ts(used for project/user skills) handled these cases correctly, causing inconsistent behavior.Fix:
normalizeSkillFileContent()to strip BOM and convert CRLF/CR to LF/^---\\n([\\s\\S]*?)\\n---\\n([\\s\\S]*)$/to/^---\\n([\\s\\S]*?)\\n---(?:\\n|$)([\\s\\S]*)$/Reviewer Test Plan
npm run test --workspace=packages/core -- --run src/skills/Testing Matrix
Linked issues / bugs
Fixes #1666