{"record":{"id":"dff63d2f0b9d6589","repo":"Tencent/WeKnora","slug":"failed-to-parse-yaml-frontmatter-w","errorCode":null,"errorMessage":"failed to parse YAML frontmatter: %w","messagePattern":"failed to parse YAML frontmatter: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/agent/skills/skill.go","lineNumber":209,"sourceCode":"\t\t\tfrontmatterLines = append(frontmatterLines, line)\n\t\t} else if frontmatterEnded {\n\t\t\tbodyLines = append(bodyLines, line)\n\t\t}\n\t}\n\n\tif err := scanner.Err(); err != nil {\n\t\treturn nil, fmt.Errorf(\"error reading SKILL.md: %w\", err)\n\t}\n\n\tif !frontmatterEnded {\n\t\treturn nil, errors.New(\"SKILL.md frontmatter is not properly closed with ---\")\n\t}\n\n\t// Parse YAML frontmatter\n\tfrontmatter := strings.Join(frontmatterLines, \"\\n\")\n\trepaired, err := UnmarshalSkillFrontmatter(frontmatter, skill)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to parse YAML frontmatter: %w\", err)\n\t}\n\tskill.FrontmatterRepaired = repaired\n\tif err := skill.applyInstallName(); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Set body instructions\n\tskill.Instructions = strings.TrimSpace(strings.Join(bodyLines, \"\\n\"))\n\tskill.Loaded = true\n\n\t// Validate\n\tif err := skill.Validate(); err != nil {\n\t\treturn nil, fmt.Errorf(\"skill validation failed: %w\", err)\n\t}\n\n\treturn skill, nil\n}\n","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/agent/skills/skill.go#L191-L227","documentation":"Parse wrapper in ParseSkillFile: UnmarshalSkillFrontmatter failed to decode the joined YAML frontmatter into the Skill, even after the repair pass. The YAML is malformed (bad indentation, unquoted colons, wrong types) or the repair heuristics could not normalize keys nested under `name`.","triggerScenarios":"Thrown at internal/agent/skills/skill.go:209 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the YAML frontmatter: correct indentation, quote values containing colons","Ensure required keys (name, description) are top-level, not nested under `name:`","Inspect the wrapped YAML library error for the exact line/column"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}