-
Notifications
You must be signed in to change notification settings - Fork 70
SKILL.md 多行 description 解析失败 #162
Copy link
Copy link
Open
Description
问题描述
Proma 解析 SKILL.md 的 YAML frontmatter 时,对于多行格式的 description 字段无法正确解析,导致技能描述在 UI 中显示为空。
问题原因
查看源码 apps/electron/src/main/lib/agent-workspace-manager.ts 第 467-490 行的 parseSkillFrontmatter 函数:
for (const line of yaml.split('\n')) {
const colonIdx = line.indexOf(':')
if (colonIdx === -1) continue
const key = line.slice(0, colonIdx).trim()
const value = line.slice(colonIdx + 1).trim().replace(/^["']|["']$/g, '')
if (key === 'description' && value) meta.description = value
}解析器按换行分割后逐行处理,多行 description 的格式:
description:
第一行内容
第二行内容第二行(续行)不包含 :,导致 value 被丢弃。
影响范围
使用 YAML block scalar(多行格式)编写 description 的 skill 都受影响,例如 web-access skill。
修复建议
- 短期:在文档中明确说明 description 必须为单行格式
- 长期:使用标准 YAML 解析库(如
js-yaml)替代手动解析
复现步骤
- 创建一个 SKILL.md,description 使用多行格式
- 在 Proma 中查看该 skill,描述显示为空
环境信息
- Proma 版本:latest
- 系统:Windows
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels