{"record":{"id":"9d17fbe89eedb9db","repo":"zeroclaw-labs/zeroclaw","slug":"skill-name-is-unsafe-as-a-path-component","errorCode":null,"errorMessage":"Skill name '{}' is unsafe as a path component","messagePattern":"Skill name '(.+?)' is unsafe as a path component","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-runtime/src/skillforge/integrate.rs","lineNumber":163,"sourceCode":"        .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\n#[cfg(test)]\nmod tests {\n    use super::*;\n    use crate::skillforge::scout::{ScoutResult, ScoutSource};\n    use std::fs;\n\n    fn sample_candidate() -> ScoutResult {\n        ScoutResult {\n            name: \"test-skill\".into(),\n            url: \"https://github.com/user/test-skill\".into(),","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-runtime/src/skillforge/integrate.rs#L145-L181","documentation":"Error \"Skill name '{}' is unsafe as a path component\" thrown in zeroclaw-labs/zeroclaw.","triggerScenarios":"Thrown at crates/zeroclaw-runtime/src/skillforge/integrate.rs:163 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a skill name that is a safe single path component (no separators, '..', or special characters)."],"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"}