fix(skillfrontmatter): handle colons in unquoted description values (moclaw-dev) - #25
fix(skillfrontmatter): handle colons in unquoted description values (moclaw-dev)#25travelliu wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the frontmatter parsing logic in server/internal/skillfrontmatter/frontmatter.go to fallback to a raw text extraction method (extractFromRaw) when strict YAML parsing fails, such as when unquoted colons are present in descriptions. It also introduces helper functions HasFrontmatter and FrontmatterBody along with corresponding unit tests. However, a bug was identified in extractFromRaw where nested YAML keys can incorrectly overwrite top-level fields like name or description because lines are trimmed of leading whitespace before parsing. A fix is suggested to skip indented lines.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
- Add FrontmatterBody and HasFrontmatter for cleaner separation of concerns - Add extractFromRaw fallback when yaml.Unmarshal fails on unquoted colons - Skip indented lines in extractFromRaw to avoid nested key misinterpretation - Restore ParseBody so consumers still receive body without frontmatter block - Update cmd_skill_scan.go to use restored ParseBody with TrimSpace - Add tests for colon-containing descriptions and nested key handling Closes #23
1fac1c8 to
9031fa4
Compare
Summary
Fixes #23 on moclaw-dev — the YAML frontmatter parser now handles colons inside unquoted description values.
Changes
FrontmatterBodyandHasFrontmatterfor cleaner separation of concernsextractFromRawfallback whenyaml.Unmarshalfails on unquoted colonsTest plan
go test ./internal/skillfrontmatter/...passes