{"record":{"id":"88a7e1cd8ba79efd","repo":"zed-industries/zed","slug":"could-not-parse-yaml-frontmatter","errorCode":null,"errorMessage":"could not parse YAML frontmatter","messagePattern":"could not parse YAML frontmatter","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/agent_skills/agent_skills.rs","lineNumber":412,"sourceCode":"    // terminator and ask `serde_yaml_ng` to parse it as a YAML stream. If the\n    // first document deserializes into `SkillMetadata`, that candidate is the\n    // real closer. Otherwise an earlier candidate may have cut the YAML in the\n    // middle of a scalar / quoted string; try the next one.\n    let mut last_error: Option<anyhow::Error> = None;\n    for end in candidates {\n        let prefix = &content[..end];\n        let mut docs = serde_yaml_ng::Deserializer::from_str(prefix);\n        let Some(first_doc) = docs.next() else {\n            continue;\n        };\n        match SkillMetadata::deserialize(first_doc) {\n            Ok(metadata) => return Ok((metadata, &content[end..])),\n            Err(e) => last_error = Some(anyhow::Error::new(e)),\n        }\n    }\n\n    Err(last_error\n        .unwrap_or_else(|| anyhow::anyhow!(\"could not parse YAML frontmatter\"))\n        .context(\"Invalid YAML frontmatter\"))\n}\n\n/// Maximum length for a valid skill name. Mirrors the upper bound enforced\n/// by [`validate_name`].\npub const MAX_SKILL_NAME_LEN: usize = 64;\n\n/// Maximum recommended length (in Unicode scalar values) for a skill description. The\n/// create-skill UI enforces this as a hard limit, while the loader emits a\n/// warning and still loads longer descriptions.\npub const MAX_SKILL_DESCRIPTION_LEN: usize = 1024;\n\n/// Convert an arbitrary human-readable string into a valid skill name, or\n/// return `None` if no valid name can be produced (e.g. the input contains\n/// no ASCII alphanumeric characters at all).\n///\n/// The transformation:\n///","sourceCodeStart":394,"sourceCodeEnd":430,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/agent_skills/agent_skills.rs#L394-L430","documentation":"In extract_frontmatter, none of the candidate `---` closers produced a SkillMetadata-deserializable YAML document; the last serde_yaml_ng error is retained, meaning the SKILL.md frontmatter is malformed.","triggerScenarios":"Thrown at crates/agent_skills/agent_skills.rs:411 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the SKILL.md frontmatter delimiters: ensure the opening --- line is followed by valid YAML and a matching closing ---","Escape or quote YAML special characters in frontmatter values","Avoid quoted strings or block scalars in frontmatter that contain early --- terminator candidates"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}