Skip to content

fix(skillfrontmatter): handle colons in unquoted description values - #24

Open
travelliu wants to merge 1 commit into
moclawfrom
fix/issue-23-frontmatter-colon
Open

fix(skillfrontmatter): handle colons in unquoted description values#24
travelliu wants to merge 1 commit into
moclawfrom
fix/issue-23-frontmatter-colon

Conversation

@travelliu

Copy link
Copy Markdown
Collaborator

Summary

Fixes #23 — the YAML frontmatter parser now handles colons inside unquoted description values.

Changes

  • Remove unused ParseBody and Build functions
  • Add FrontmatterBody and HasFrontmatter for cleaner separation of concerns
  • Add extractFromRaw fallback when yaml.Unmarshal fails on unquoted colons
  • Update cmd_skill_scan.go to use Parse instead of removed ParseBody
  • Add tests for colon-containing descriptions and new helper functions

Test plan

  • go test ./internal/skillfrontmatter/... passes
  • go test ./cmd/multica/... passes
  • Standard YAML (no colons) still works
  • Quoted descriptions with colons still work
  • Unquoted descriptions with colons now work (fallback)

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the skillfrontmatter package to simplify YAML frontmatter parsing, introducing a fallback parser for unquoted colons and replacing custom parsing logic with strings.Cut. However, the removal of ParseBody introduces a breaking behavioral change by forcing downstream consumers to use the entire file content (including the frontmatter block) as the markdown body. The feedback recommends restoring ParseBody to preserve the original behavior and replacing strings.SplitSeq with strings.Split to maintain backward compatibility with Go versions older than 1.23.

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.

Comment thread server/internal/skillfrontmatter/frontmatter.go
Comment thread server/cmd/multica/cmd_skill_scan.go Outdated
Comment thread server/cmd/multica/cmd_skill_scan.go Outdated
Comment thread server/internal/skillfrontmatter/frontmatter.go Outdated
@travelliu
travelliu force-pushed the fix/issue-23-frontmatter-colon branch from 157c6e8 to 0853701 Compare June 3, 2026 02:18
- 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
@travelliu
travelliu force-pushed the fix/issue-23-frontmatter-colon branch from 0853701 to b77f56d Compare June 3, 2026 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant