{"record":{"id":"43af76432550e519","repo":"Hmbown/CodeWhale","slug":"skill-md-is-missing-the-leading-frontmatter","errorCode":null,"errorMessage":"SKILL.md is missing the leading '---' frontmatter fence","messagePattern":"SKILL\\.md is missing the leading '---' frontmatter fence","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/skills/install.rs","lineNumber":1594,"sourceCode":"        return std::borrow::Cow::Borrowed(path);\n    }\n    let with_slash = format!(\"{prefix}/\");\n    if let Some(rest) = path.strip_prefix(&with_slash) {\n        std::borrow::Cow::Owned(rest.to_string())\n    } else if path == prefix {\n        std::borrow::Cow::Borrowed(\"\")\n    } else {\n        std::borrow::Cow::Borrowed(path)\n    }\n}\n\n/// Extract `name:` and ensure `description:` exist in the SKILL.md frontmatter.\n/// Also verifies the leading `---` fence so we reject malformed files early.\nfn parse_frontmatter_name(bytes: &[u8]) -> Result<String> {\n    let content = std::str::from_utf8(bytes).context(\"SKILL.md is not valid UTF-8\")?;\n    let trimmed = content.trim_start();\n    if !trimmed.starts_with(\"---\") {\n        bail!(\"SKILL.md is missing the leading '---' frontmatter fence\");\n    }\n    let after_open = &trimmed[3..];\n    let close = after_open.find(\"---\").ok_or_else(|| {\n        anyhow::anyhow!(\"SKILL.md is missing the closing '---' frontmatter fence\")\n    })?;\n    let frontmatter = &after_open[..close];\n\n    let mut name: Option<String> = None;\n    let mut has_description = false;\n    for raw in frontmatter.lines() {\n        let line = raw.trim();\n        if line.is_empty() || line.starts_with('#') {\n            continue;\n        }\n        if let Some((key, value)) = line.split_once(':') {\n            let key = key.trim().to_ascii_lowercase();\n            let value = value.trim().to_string();\n            match key.as_str() {","sourceCodeStart":1576,"sourceCodeEnd":1612,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/skills/install.rs#L1576-L1612","documentation":"parse_frontmatter_name validates that a candidate SKILL.md begins with a '---' frontmatter fence and rejects it here otherwise. The input at fault is the downloaded/copied SKILL.md file: it lacks the leading YAML frontmatter delimiter, so no name/description can be parsed; the check exists to fail early on malformed skill packages before any files are written.","triggerScenarios":"Thrown at crates/tui/src/skills/install.rs:1594 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add a leading '---' fence line at the very start of SKILL.md with a name: and description: block","Re-download the skill package; the file may have been truncated or corrupted","If authoring a skill, follow the SKILL.md frontmatter format (leading '---', name, description, closing '---')"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}