{"record":{"id":"0cb555c10b585e57","repo":"zed-industries/zed","slug":"invalid-yaml-frontmatter","errorCode":null,"errorMessage":"Invalid YAML frontmatter","messagePattern":"Invalid YAML frontmatter","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/agent_skills/agent_skills.rs","lineNumber":413,"sourceCode":"    // 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///\n/// 1. Replaces each `&` with the word `and` (with separators on either","sourceCodeStart":395,"sourceCodeEnd":431,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/agent_skills/agent_skills.rs#L395-L431","documentation":"None of the candidate frontmatter delimiters produced a prefix that deserializes into SkillMetadata, so the skill file's YAML frontmatter is invalid or the closer heuristic cut the YAML mid-scalar. The last deserialization error is reported.","triggerScenarios":"Thrown at crates/agent_skills/agent_skills.rs:412 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the skill's frontmatter so it is valid YAML with the required metadata fields","Ensure the closing --- delimiter is present and not embedded inside a quoted scalar"],"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-14T05:17:10.506Z"}