#19664: fix(skills): log skill YAML parsing diagnostics with skill name
agents
size: XS
Cluster:
Skill Improvements and Fixes
## Problem
Previously, when a skill's SKILL.md had YAML parsing errors (e.g., unquoted colons in description), the error was silently ignored and the skill failed to load without any indication of what went wrong.
Example of broken YAML:
```yaml
---
name: my-skill
description: Transcribe podcasts: using tool X
---
```
This causes: `Nested mappings are not allowed in compact mappings`
## Solution
This change logs skill YAML parsing diagnostics with the skill name to help users identify and fix issues:
1. **Logs warnings when YAML parsing fails** in the catch block
2. **Logs diagnostics returned from pi-coding-agent's `loadSkillsFromDir()`** - the underlying library already returns diagnostics, but they were being ignored
3. **Includes the skill name in the warning message** for better debugging
Example warning output:
```
[skills] Skill "my-skill": Nested mappings are not allowed in compact mappings at line 2, column 14:
description: Transcribe podcasts: using tool X
```
## Testing
- Built the project successfully
- Ran unit tests (664 passed, 1 unrelated failure in Slack)
- Tested locally with a skill containing a colon in description - warning now shows skill name
## Related
- CONTRIBUTING.md notes: "Test locally with your OpenClaw instance"
- This is an alternative approach to fixing the root cause in pi-coding-agent
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
This PR adds diagnostic logging for skill YAML parsing failures in `src/agents/skills/workspace.ts`. Previously, YAML parsing errors in skill files were silently swallowed, making it difficult for users to debug why a skill failed to load.
- Logs diagnostics returned by `loadSkillsFromDir()` (from the `pi-coding-agent` library) at both call sites, including the extracted skill name from the file path
- Replaces a silent `catch` block in frontmatter parsing with a `skillsLogger.warn()` call that includes the file path and error message
- Includes a minor formatting cleanup of a long array literal in `buildWorkspaceSkillSnapshot`
<h3>Confidence Score: 4/5</h3>
- This PR is safe to merge — it only adds logging to previously silent error paths with no behavioral changes.
- The changes are straightforward additions of warning-level log messages to existing catch blocks and after library calls. No control flow is altered, no new dependencies are introduced, and the logging uses the established subsystem logger pattern. The only minor concern is the forward-slash-only path splitting for skill name extraction, but this only affects log output cosmetics on Windows, not functionality.
- No files require special attention
<sub>Last reviewed commit: b2286cf</sub>
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#22306: Warn on malformed skill parsing failures in load path
by AIflow-Labs · 2026-02-21
86.2%
#5273: fix: skill frontmatter fixes + description improvements (35 skills)
by Terwox · 2026-01-31
82.8%
#16792: fix(skills): use subsystem logger instead of console.log for debug ...
by Limitless2023 · 2026-02-15
80.9%
#11250: fix: expand skills watcher ignore list and improve session repair l...
by zhangzhefang-github · 2026-02-07
79.8%
#9221: fix(skills): use skillKey for env config lookup in snapshots
by gavinbmoore · 2026-02-05
79.8%
#8873: fix: document skill loading locations in system prompt
by ytfh44 · 2026-02-04
79.2%
#12076: fix(skills): recursive directory filtering to actually exclude venv...
by xiaoyaner0201 · 2026-02-08
79.1%
#15115: fix: pre-load skill docs in cron sessions to prevent hallucinated syn…
by joaolcorreia · 2026-02-13
78.8%
#9925: docs: warn about Python venv placement in skill directories
by kj9kj9qv4m-bit · 2026-02-05
78.7%
#3933: fix(skills): Make skill scripts executable
by jaysonsantos · 2026-01-29
77.9%