Summary
On Windows, a skill can disappear from openclaw skills list if SKILL.md starts with a UTF-8 BOM (EF BB BF).
This happens when the file is edited with PowerShell / .NET WriteAllText using the default UTF-8 encoding behaviour. The parser in extractFrontmatterBlock fails silently because it checks whether the content starts with ---, but the BOM comes first.
Reproduction
- Install a skill on Windows.
- Edit
SKILL.md using PowerShell WriteAllText without explicitly using new UTF8Encoding($false).
- This writes the file with a UTF-8 BOM.
- Run
openclaw skills list.
Actual behaviour
The skill disappears from openclaw skills list.
Expected behaviour
The skill should still be discovered even if SKILL.md begins with a UTF-8 BOM.
Root cause
extractFrontmatterBlock in frontmatter-CAnFi2D6.js checks whether the file content starts with ---.
When the file starts with a BOM, the first character is \uFEFF, so the frontmatter check fails.
Proposed fix
Strip a leading BOM before checking for frontmatter:
content = content.replace(/^\uFEFF/, '')
Then proceed with the existing content.startsWith('---') logic.
Why this matters
This is an easy Windows footgun because PowerShell / .NET file-writing paths commonly produce BOM-prefixed UTF-8 unless explicitly configured otherwise. The current failure mode is silent, which makes the bug hard to diagnose.
Summary
On Windows, a skill can disappear from
openclaw skills listifSKILL.mdstarts with a UTF-8 BOM (EF BB BF).This happens when the file is edited with PowerShell / .NET
WriteAllTextusing the default UTF-8 encoding behaviour. The parser inextractFrontmatterBlockfails silently because it checks whether the content starts with---, but the BOM comes first.Reproduction
SKILL.mdusing PowerShellWriteAllTextwithout explicitly usingnew UTF8Encoding($false).openclaw skills list.Actual behaviour
The skill disappears from
openclaw skills list.Expected behaviour
The skill should still be discovered even if
SKILL.mdbegins with a UTF-8 BOM.Root cause
extractFrontmatterBlockinfrontmatter-CAnFi2D6.jschecks whether the file content starts with---.When the file starts with a BOM, the first character is
\uFEFF, so the frontmatter check fails.Proposed fix
Strip a leading BOM before checking for frontmatter:
Then proceed with the existing
content.startsWith('---')logic.Why this matters
This is an easy Windows footgun because PowerShell / .NET file-writing paths commonly produce BOM-prefixed UTF-8 unless explicitly configured otherwise. The current failure mode is silent, which makes the bug hard to diagnose.