Repository navigation
Description
Describe the bug
Skill frontmatter parsing does not handle YAML block scalars correctly. A multiline description: | is normalized to the literal string | in Skill metadata, and a colon in the description can create a spurious nested field such as description.Triggers.
This affects the descriptions returned by Skill list and metadata-detail APIs after creation/upload.
Expected behavior
The description contains the complete parsed text, with YAML literal/folded line-break semantics. Description text such as Triggers: ... remains part of the description and does not become a frontmatter key.
Actually behavior
The returned metadata can contain:
{
"description": "|",
"frontMatter": {
"name": "alibabacloud-rds-copilot",
"description": "|",
"version": "0.0.1",
"description.Triggers": "RDS Copilot, SQL optimization"
}
}How to Reproduce
- Upload a Skill ZIP, or create a Skill draft, with this
SKILL.md:
---
version: 0.0.1
name: alibabacloud-rds-copilot
description: |
Alibaba Cloud RDS Copilot intelligent operations assistant skill.
Calls RdsAi OpenAPI through Alibaba Cloud CLI.
Triggers: RDS Copilot, SQL optimization
---
Use RDS Copilot to diagnose database issues.- Query
GET /v3/admin/ai/skills/listandGET /v3/admin/ai/skills?skillName=alibabacloud-rds-copilot. - Inspect
descriptionandfrontMatter.
Desktop (please complete the following information):
- Version: development code,
3.3.0-RC. - Module:
ai(Skill upload, draft normalization, metadata). - Local regression test environment: macOS ARM64, JDK 17.
- SDK: not required; this is a server-side path.
Additional context
There are two hand-written parsers: SkillZipParser.parseYamlFrontMatter joins indented lines and interprets colons as nested keys, while SkillRequestUtil.parseFrontmatterField reads only the field's first line. The normalization path therefore overwrites the description with |.
Focused tests reproduce the failure for literal and folded scalars, chomping indicators, paragraphs, indented text, and creation/upload followed by list/detail reads. The intended fix is to use the existing SnakeYAML dependency for block scalars and share the parsed result during normalization, while retaining the current representation of other frontmatter fields.
Already persisted incorrect metadata requires a content update or re-upload to refresh; querying metadata alone does not reparse stored packages.
Activity
[ISSUE alibaba#15946] Preserve empty Skill resources and multiline de…