#22306: Warn on malformed skill parsing failures in load path
agents
size: M
Cluster:
Skill Improvements and Fixes
## Summary
- Add diagnostics logging for skill load warnings so malformed `SKILL.md` files are no longer silent.
- Keep behavior resilient by continuing to load other valid skills.
- Preserve current fallback path by warning and continuing if local frontmatter parsing fails.
- Add regression coverage in `src/agents/skills/workspace.test.ts` to assert malformed `SKILL.md` emits a warning and valid skills still load.
## Related
- https://github.com/openclaw/openclaw/issues/22134
## Testing
- `pnpm test src/agents/skills/workspace.test.ts`
- `pnpm check` (format passed; `pnpm tsgo` currently reports unrelated pre-existing TS issue in `src/auto-reply/reply/commands-export-session.test.ts:77` and did not proceed to lint)
## Confidence
- 5/5
- Low-risk, narrow patch: no runtime behavior change for valid skills, only additive warning logging and a regression test.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Added diagnostics logging for malformed SKILL.md files during skill loading, ensuring failures are visible while preserving resilient behavior. Also fixed template placeholder formatting in the export-session HTML template that was preventing proper payload replacement.
**Key changes:**
- Added `logSkillLoadDiagnostics` helper to surface skill load warnings/errors from `loadSkillsFromDir` diagnostics
- Enhanced frontmatter parsing error handling with contextual logging
- New regression test verifies malformed skills emit warnings without blocking valid skills
- Fixed template.html placeholder syntax (`{{MARKED_JS}}` instead of malformed `{{ MARKED_JS; }}`)
- Added comprehensive test coverage for export-session functionality
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- The changes are narrow and well-tested: skill loading adds only diagnostic logging without modifying load behavior, regression test validates resilience, and the template fix corrects malformed placeholders. No breaking changes or risky logic modifications.
- No files require special attention
<sub>Last reviewed commit: ddd8a56</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#19664: fix(skills): log skill YAML parsing diagnostics with skill name
by orchidsun · 2026-02-18
86.2%
#5273: fix: skill frontmatter fixes + description improvements (35 skills)
by Terwox · 2026-01-31
80.5%
#8873: fix: document skill loading locations in system prompt
by ytfh44 · 2026-02-04
80.2%
#14023: fix: filter skills watcher to relevant file types to prevent FD exh...
by funmerlin · 2026-02-11
79.8%
#11250: fix: expand skills watcher ignore list and improve session repair l...
by zhangzhefang-github · 2026-02-07
78.9%
#8075: fix(skills): add --ignore-scripts to all package managers
by yubrew · 2026-02-03
78.6%
#10016: fix: prevent FD exhaustion from skill watcher scanning artifact trees
by oldeucryptoboi · 2026-02-06
78.4%
#23754: Skills: enforce capability manifest requirements
by bmendonca3 · 2026-02-22
78.3%
#10705: security: extend skill scanner to detect threats in markdown skill ...
by Alex-Alaniz · 2026-02-06
78.2%
#21839: fix(skills): allowBundled: [] now blocks all bundled skills
by hydro13 · 2026-02-20
78.0%