You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 25, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 25, 2026. It is now read-only.
scan-path-standards.py aborts the whole scan on a non-UTF-8 file #159
scan-path-standards.py aborts the whole scan when any .md or .json file under the skill is not valid UTF-8, so a skill that ships a deliberately undecodable test fixture cannot be path-scanned at all.
File ".../scan-path-standards.py", line 135, in scan_file
content = filepath.read_text(encoding='utf-8')
...
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
The exit code is 1 and stdout is empty.
Where
skills/bmad-workflow-builder/scripts/scan-path-standards.py: scan_file() calls filepath.read_text(encoding='utf-8') (line 135) with no guard, for every file scan_skill() collects with rglob('*.md') and rglob('*.json').
skills/bmad-agent-builder/scripts/scan-path-standards.py is the same.
Why it matters
The Analyze pre-pass (references/scan-orchestration.md) runs this scanner and hands its JSON to the lenses. When the scanner crashes, that JSON is empty or missing. A run that redirects stdout to a file is left with a zero-byte file, which is easy to read as a clean scan. Skills with tests often keep a non-UTF-8 fixture on purpose, for example a UTF-16 file a test asserts is reported as unreadable, so the crash can't be fixed in the skill.
Suggested fix
In scan_file(), catch UnicodeDecodeError (and OSError) around the read, then either:
record the file as skipped in the output, for example in files_skipped with the reason; or
emit one low-severity finding,
and go on to the next file. That way one undecodable file never discards the rest of the scan. Skipping tests/, fixtures/ and dot-directories by default would also cut a lot of noise from skills that ship tests.
Activity