strip UTF-8 BOM when reading SKILL.md in quick_validate (#93811)

The previous `read_text(encoding="utf-8")` call left the UTF-8 byte
order mark (EF BB BF, three bytes) in the content string if the file
was saved by a tool that emits a BOM. The first line check
(`lines[0].strip() != "---"`) then saw "\ufeff---" and rejected the
file as "Invalid frontmatter format", even though the document was
otherwise valid frontmatter.

Co-authored-by: Zo Bot <github-automation@zo.computer>
This commit is contained in:
Hrachya Shaginyan 2026-06-17 03:28:43 +02:00 committed by GitHub
parent e896ca9634
commit 6567f99625
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -73,7 +73,7 @@ def validate_skill(skill_path):
return False, "SKILL.md not found"
try:
content = skill_md.read_text(encoding="utf-8")
content = skill_md.read_text(encoding="utf-8-sig")
except OSError as e:
return False, f"Could not read SKILL.md: {e}"