refactor skills loader markdown metadata parsing#1354
Merged
yinwm merged 1 commit intosipeed:mainfrom Mar 11, 2026
Merged
Conversation
96a1363 to
236209a
Compare
yinwm
approved these changes
Mar 11, 2026
Collaborator
yinwm
left a comment
There was a problem hiding this comment.
LGTM! This is a solid refactor that improves metadata parsing robustness:
- Standard yaml.v3 parser replaces ad-hoc YAML parsing
- Markdown AST parsing is more accurate than regex
- Backward compatibility preserved (JSON → YAML → Markdown → fallback)
- Good test coverage for new functionality
Minor suggestion for follow-up: update the stale comments in parseSimpleYAML and add cross-platform newline tests.
fishtrees
pushed a commit
to fishtrees/picoclaw
that referenced
this pull request
Mar 12, 2026
dj-oyu
pushed a commit
to dj-oyu/picoclaw
that referenced
this pull request
Mar 14, 2026
dj-oyu
pushed a commit
to dj-oyu/picoclaw
that referenced
this pull request
Mar 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
This PR is primarily intended to fix the startup failure where
picoclawreportsinvalid skill from workspacewhile loading workspace skills.To address that, it refactors
pkg/skills/loader.gometadata extraction forSKILL.mdfiles:gomarkdownAST and extract metadata from first H1 + first paragraph.splitFrontmatter) and reuse body/frontmatter slices instead of scanning twice.yaml.v3for robust multiline/structured frontmatter support.🗣️ Type of Change
🤖 AI Code Generation
🔗 Related Issue
N/A
📚 Technical Context (Skip for Docs)
github.com/gomarkdown/markdown. Based on local darwin/arm64 builds, binary size changed from20,815,442bytes to21,240,146bytes, i.e.+424,704bytes (+2.04%).🧪 Test Environment
📸 Evidence (Optional)
Click to view Logs/Screenshots
go test ./pkg/skills -run "TestGetSkillMetadata|Test(ExtractFrontmatter|StripFrontmatter|ListSkills|SkillRoots)" -count=1Binary size check:
-rwxr-xr-x ... 20815442 ... picoclaw-darwin-arm64-rwxr-xr-x ... 21240146 ... picoclaw-darwin-arm64☑️ Checklist