Fix quick_validate UTF-8 decoding crash on Windows

read_text() uses the locale default encoding, which is cp1252 on Windows;
reading a UTF-8 SKILL.md (e.g. the claude-api skill, which contains emoji)
raised UnicodeDecodeError and crashed the validator. Read explicitly as
UTF-8, per the spec.
This commit is contained in:
Swastik Bhat 2026-08-15 13:14:16 -04:00
parent f6656c1256
commit 53f2d1d479
1 changed files with 3 additions and 1 deletions

View File

@ -19,7 +19,9 @@ def validate_skill(skill_path):
return False, "SKILL.md not found"
# Read and validate frontmatter
content = skill_md.read_text()
# Explicit UTF-8: read_text() uses the locale default encoding, which is
# cp1252 on Windows and crashes on UTF-8 SKILL.md files (e.g. emoji).
content = skill_md.read_text(encoding='utf-8')
if not content.startswith('---'):
return False, "No YAML frontmatter found"