refactor(skill): remove snakeyaml dependency with lightweight YAML parser#524
Merged
AlbumenJ merged 3 commits intoagentscope-ai:mainfrom Jan 14, 2026
Conversation
- Add SimpleYamlParser as inner class in MarkdownSkillParser - Support simple key: value format with quoted string handling - Change metadata type from Map<String, Object> to Map<String, String> - Update SkillUtil and FileSystemSkillRepository accordingly - Remove nested YAML structure tests (no longer supported)
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the snakeyaml dependency by implementing a lightweight custom YAML parser (SimpleYamlParser) for parsing frontmatter in markdown skill files. The change simplifies the dependency footprint and restricts YAML support to flat key-value pairs with string values only.
Changes:
- Implemented
SimpleYamlParserinner class with support for simple key-value parsing, quoted strings, escape sequences, and comment handling - Changed metadata type from
Map<String, Object>toMap<String, String>throughout the codebase - Removed snakeyaml dependency from
agentscope-core/pom.xml
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| agentscope-core/pom.xml | Removed snakeyaml dependency |
| agentscope-core/src/main/java/io/agentscope/core/skill/util/MarkdownSkillParser.java | Added SimpleYamlParser inner class with parsing/generation methods; updated ParsedMarkdown to use Map<String, String> |
| agentscope-core/src/main/java/io/agentscope/core/skill/util/SkillUtil.java | Simplified metadata handling due to type change from Map<String, Object> to Map<String, String> |
| agentscope-core/src/main/java/io/agentscope/core/skill/repository/FileSystemSkillRepository.java | Updated metadata map type declaration |
| agentscope-core/src/test/java/io/agentscope/core/skill/util/MarkdownSkillParserTest.java | Removed nested YAML tests; added tests for quoted values, comments, and values with colons; updated test assertions for new type |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
agentscope-core/src/test/java/io/agentscope/core/skill/util/MarkdownSkillParserTest.java
Show resolved
Hide resolved
agentscope-core/src/main/java/io/agentscope/core/skill/util/MarkdownSkillParser.java
Show resolved
Hide resolved
agentscope-core/src/main/java/io/agentscope/core/skill/util/MarkdownSkillParser.java
Show resolved
Hide resolved
agentscope-core/src/main/java/io/agentscope/core/skill/util/MarkdownSkillParser.java
Show resolved
Hide resolved
agentscope-core/src/main/java/io/agentscope/core/skill/util/MarkdownSkillParser.java
Show resolved
Hide resolved
agentscope-core/src/test/java/io/agentscope/core/skill/util/MarkdownSkillParserTest.java
Show resolved
Hide resolved
agentscope-core/src/test/java/io/agentscope/core/skill/util/MarkdownSkillParserTest.java
Show resolved
Hide resolved
agentscope-core/src/test/java/io/agentscope/core/skill/util/MarkdownSkillParserTest.java
Show resolved
Hide resolved
agentscope-core/src/test/java/io/agentscope/core/skill/util/MarkdownSkillParserTest.java
Show resolved
Hide resolved
agentscope-core/src/test/java/io/agentscope/core/skill/util/MarkdownSkillParserTest.java
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
AlbumenJ
approved these changes
Jan 14, 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.
AgentScope-Java Version
1.0.7-SNAPSHOT
Description
Summary
Remove the snakeyaml dependency by implementing a lightweight YAML parser for frontmatter parsing.
Changes
MarkdownSkillParser: Add
SimpleYamlParserinner class supporting:key: valueformat parsing#) skippingType Change:
Map<String, Object>→Map<String, String>for metadataUpdated Files:
MarkdownSkillParser.javaSkillUtil.javaFileSystemSkillRepository.javaMarkdownSkillParserTest.javaRemoved: snakeyaml dependency from
agentscope-core/pom.xmlBreaking Changes
ParsedMarkdown.getMetadata()returnsMap<String, String>instead ofMap<String, Object>Checklist
Please check the following items before code is ready to be reviewed.
mvn spotless:applymvn test)