{"record":{"id":"fcdeb105de80ebaf","repo":"zeroclaw-labs/zeroclaw","slug":"skill-name-is-empty-or-only-dots-after-sanitizatio","errorCode":null,"errorMessage":"Skill name is empty or only dots after sanitization","messagePattern":"Skill name is empty or only dots after sanitization","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-runtime/src/skillforge/integrate.rs","lineNumber":153,"sourceCode":"}\n\n/// Escape special characters for TOML basic string values.\nfn escape_toml(s: &str) -> String {\n    s.replace('\\\\', \"\\\\\\\\\")\n        .replace('\"', \"\\\\\\\"\")\n        .replace('\\n', \"\\\\n\")\n        .replace('\\r', \"\\\\r\")\n        .replace('\\t', \"\\\\t\")\n        .replace('\\u{08}', \"\\\\b\")\n        .replace('\\u{0C}', \"\\\\f\")\n}\n\n/// Sanitize a string for use as a single path component.\n/// Rejects empty names, \"..\", and names containing path separators or NUL.\nfn sanitize_path_component(name: &str) -> Result<String> {\n    let trimmed = name.trim().trim_matches('.');\n    if trimmed.is_empty() {\n        bail!(\"Skill name is empty or only dots after sanitization\");\n    }\n    let sanitized: String = trimmed\n        .chars()\n        .map(|c| match c {\n            '/' | '\\\\' | '\\0' => '_',\n            _ => c,\n        })\n        .collect();\n    if sanitized == \"..\" || sanitized.contains('/') || sanitized.contains('\\\\') {\n        bail!(\"Skill name '{}' is unsafe as a path component\", name);\n    }\n    Ok(sanitized)\n}\n\n// ---------------------------------------------------------------------------\n// Tests\n// ---------------------------------------------------------------------------\n","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-runtime/src/skillforge/integrate.rs#L135-L171","documentation":"Error \"Skill name is empty or only dots after sanitization\" thrown in zeroclaw-labs/zeroclaw.","triggerScenarios":"Thrown at crates/zeroclaw-runtime/src/skillforge/integrate.rs:153 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Give the skill a name containing at least one non-dot character."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}