Hmbown/CodeWhale · error
SKILL.md `name` must be a single path-safe segment
Error message
SKILL.md `name` must be a single path-safe segment (got '{name}') What it means
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.
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
Example fix
// before --- name: My Cool Skill/sub description: x --- // after --- name: my-cool-skill description: x ---
Defensive patterns
Strategy: validation
Validate before calling
let name = frontmatter.get("name").ok_or("missing name")?;
assert!(!name.contains('/') && !name.contains('\\') && !name.chars().any(char::is_whitespace)
&& name != "." && name != ".." && !name.is_empty(), "invalid skill name in frontmatter");
assert!(frontmatter.contains_key("description"), "missing description"); Type guard
fn is_valid_frontmatter_name(name: &str) -> bool {
!name.is_empty() && name.trim() == name && !name.chars().any(char::is_whitespace)
&& name != "." && name != ".." && !name.contains('/') && !name.contains('\\')
} Try / catch
match install_skill(pkg) {
Err(e) if e.to_string().contains("`name`") => eprintln!("fix SKILL.md frontmatter name to a single path-safe segment"),
other => other?,
} Prevention
- 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
When it happens
Trigger: 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).
Common situations: Frontmatter name copied from a URL path; names with spaces like 'My Cool Skill'; names authored as 'skills/foo'.
Understand the failure class
Background: "invalid id" errors: invalid identifier format — why libraries reject IDs before lookup, and how to fix them — this error's family across 37 libraries.
Related errors
- SKILL.md is missing the closing '---' frontmatter fence
- SKILL.md is missing the leading '---' frontmatter fence
- disabled_tools must use Codewhale catalog identifiers
- import source must be a compatible external skill
- install source must not be empty
AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22).
Data as JSON: /api/errors/c08390995477b67e.
Report an issue: GitHub.
Appendix: source
Thrown at crates/tui/src/skills/install.rs:1628
continue;
}
if let Some((key, value)) = line.split_once(':') {
let key = key.trim().to_ascii_lowercase();
let value = value.trim().to_string();
match key.as_str() {
"name" if !value.is_empty() => name = Some(value),
"description" if !value.is_empty() => has_description = true,
_ => {}
}
}
}
let name = name.ok_or(InstallError::MissingFrontmatterField("name"))?;
if !has_description {
return Err(InstallError::MissingFrontmatterField("description").into());
}
if validate_skill_name_segment(&name).is_err() {
bail!("SKILL.md `name` must be a single path-safe segment (got '{name}')");
}
Ok(name)
}
fn reject_unmarked_update(final_path: &Path, name: &str) -> std::result::Result<(), InstallError> {
if final_path.join(INSTALLED_FROM_MARKER).exists() {
Ok(())
} else {
Err(InstallError::NotInstalledHere(name.to_string()))
}
}
pub(crate) fn source_spec_string(source: &InstallSource) -> String {
match source {
InstallSource::GitHubRepo(repo) => format!("github:{repo}"),
InstallSource::DirectUrl(url) => url.clone(),
InstallSource::Registry(name) => name.clone(),
}View on GitHub (pinned to 73e0f67d83)