{"record":{"id":"fa868aec76605b3a","repo":"zed-industries/zed","slug":"skill-md-must-start-with-yaml-frontmatter","errorCode":null,"errorMessage":"SKILL.md must start with YAML frontmatter (---)","messagePattern":"SKILL\\.md must start with YAML frontmatter \\(---\\)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/agent_skills/agent_skills.rs","lineNumber":347,"sourceCode":"        return Err(\"Skill description cannot be empty\");\n    }\n\n    let mut warnings = Vec::new();\n    if description.len() > MAX_SKILL_DESCRIPTION_LEN {\n        warnings.push(SkillLoadWarning::DescriptionTooLong {\n            actual_len: description.len(),\n            max_len: MAX_SKILL_DESCRIPTION_LEN,\n        });\n    }\n\n    Ok(warnings)\n}\n\nfn extract_frontmatter(content: &str) -> Result<(SkillMetadata, &str)> {\n    let content = content.trim_start();\n\n    if !content.starts_with(\"---\") {\n        anyhow::bail!(\"SKILL.md must start with YAML frontmatter (---)\");\n    }\n\n    // Find every candidate closing `---` line: a line consisting EXACTLY of\n    // `---` (followed by `\\n`, `\\r\\n`, or EOF) at column 0, excluding the\n    // opening line itself. The opener occupies bytes 0..(first line ending),\n    // and our scan starts after each `\\n`, so the opener is naturally skipped.\n    //\n    // For each candidate we record the byte position right after its line\n    // ending; that's both where the YAML stream slice ends and where the body\n    // begins.\n    let bytes = content.as_bytes();\n    let mut candidates: Vec<usize> = Vec::new();\n    for (i, &b) in bytes.iter().enumerate() {\n        if b != b'\\n' {\n            continue;\n        }\n        let line_start = i + 1;\n        if line_start + 3 > bytes.len() {","sourceCodeStart":329,"sourceCodeEnd":365,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/crates/agent_skills/agent_skills.rs#L329-L365","documentation":"Error \"SKILL.md must start with YAML frontmatter (---)\" thrown in zed-industries/zed.","triggerScenarios":"Thrown at crates/agent_skills/agent_skills.rs:347 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"}