{"record":{"id":"c08390995477b67e","repo":"Hmbown/CodeWhale","slug":"skill-md-name-must-be-a-single-path-safe-segment","errorCode":null,"errorMessage":"SKILL.md `name` must be a single path-safe segment (got '{name}')","messagePattern":"SKILL\\.md `name` must be a single path-safe segment \\(got '(.+?)'\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/skills/install.rs","lineNumber":1628,"sourceCode":"            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() {\n                \"name\" if !value.is_empty() => name = Some(value),\n                \"description\" if !value.is_empty() => has_description = true,\n                _ => {}\n            }\n        }\n    }\n\n    let name = name.ok_or(InstallError::MissingFrontmatterField(\"name\"))?;\n    if !has_description {\n        return Err(InstallError::MissingFrontmatterField(\"description\").into());\n    }\n    if validate_skill_name_segment(&name).is_err() {\n        bail!(\"SKILL.md `name` must be a single path-safe segment (got '{name}')\");\n    }\n    Ok(name)\n}\n\nfn reject_unmarked_update(final_path: &Path, name: &str) -> std::result::Result<(), InstallError> {\n    if final_path.join(INSTALLED_FROM_MARKER).exists() {\n        Ok(())\n    } else {\n        Err(InstallError::NotInstalledHere(name.to_string()))\n    }\n}\n\npub(crate) fn source_spec_string(source: &InstallSource) -> String {\n    match source {\n        InstallSource::GitHubRepo(repo) => format!(\"github:{repo}\"),\n        InstallSource::DirectUrl(url) => url.clone(),\n        InstallSource::Registry(name) => name.clone(),\n    }","sourceCodeStart":1610,"sourceCodeEnd":1646,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/skills/install.rs#L1610-L1646","documentation":"After parsing SKILL.md frontmatter, the 'name' field must exist, a 'description' must exist, and the name must pass validate_skill_name_segment (single path-safe segment). This bails when the frontmatter name fails that segment check, keeping the installed directory name safe.","triggerScenarios":"A SKILL.md with name: containing slashes, whitespace, dot segments, or otherwise failing the single path-safe segment rules; or a name present but description missing (different but adjacent failure).","commonSituations":"Frontmatter name copied from a URL path; names with spaces like 'My Cool Skill'; names authored as 'skills/foo'.","solutions":["Edit SKILL.md frontmatter so name is a single path-safe segment, e.g. name: my-skill","Remove whitespace, slashes, and backslashes from the name","Keep 'description:' present and non-empty alongside the valid name"],"exampleFix":"// before\n---\nname: My Cool Skill/sub\ndescription: x\n---\n// after\n---\nname: my-cool-skill\ndescription: x\n---","handlingStrategy":"validation","validationCode":"let name = frontmatter.get(\"name\").ok_or(\"missing name\")?;\nassert!(!name.contains('/') && !name.contains('\\\\') && !name.chars().any(char::is_whitespace)\n    && name != \".\" && name != \"..\" && !name.is_empty(), \"invalid skill name in frontmatter\");\nassert!(frontmatter.contains_key(\"description\"), \"missing description\");","typeGuard":"fn is_valid_frontmatter_name(name: &str) -> bool {\n    !name.is_empty() && name.trim() == name && !name.chars().any(char::is_whitespace)\n        && name != \".\" && name != \"..\" && !name.contains('/') && !name.contains('\\\\')\n}","tryCatchPattern":"match install_skill(pkg) {\n    Err(e) if e.to_string().contains(\"`name`\") => eprintln!(\"fix SKILL.md frontmatter name to a single path-safe segment\"),\n    other => other?,\n}","preventionTips":["Use kebab-case single-segment names in frontmatter","Keep name and intended directory name identical","Lint frontmatter (name + description present, name segment-safe) in CI"],"tags":["skills","frontmatter","validation","naming"],"backgroundTag":"invalid-identifier-format","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}