{"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":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/agent_skills/agent_skills.rs","lineNumber":411,"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 bytes) 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.\n///\n/// Byte-based rather than char-based because that's what `.len()` returns\n/// and what every caller currently measures; the UI also surfaces this\n/// limit as a byte count so the editor's counter matches the validator.\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","sourceCodeStart":393,"sourceCodeEnd":429,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/crates/agent_skills/agent_skills.rs#L393-L429","documentation":"Error \"could not parse YAML frontmatter\" thrown in zed-industries/zed.","triggerScenarios":"Thrown at crates/agent_skills/agent_skills.rs:411 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}