{"record":{"id":"a196e70ed211c6f2","repo":"zed-industries/zed","slug":"a-skill-named-name-already-exists-at-pic","errorCode":null,"errorMessage":"A skill named \\\"{name}\\\" already exists at {}. Pick a different name.","messagePattern":"A skill named \\\\\"(.+?)\\\\\" already exists at (.+?)\\. Pick a different name\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/settings_ui/src/pages/skill_creator.rs","lineNumber":1202,"sourceCode":"}\n\n/// Serialize the SKILL.md file to disk at `<skills_dir>/<name>/SKILL.md`.\n///\n/// Refuses to overwrite an existing directory at `<skills_dir>/<name>`. The\n/// caller surfaces the resulting error to the user, who picks a different\n/// name.\nasync fn write_skill_to_disk(\n    fs: &dyn Fs,\n    skills_dir: &std::path::Path,\n    name: &str,\n    description: &str,\n    body: &str,\n    disable_model_invocation: bool,\n) -> Result<PathBuf> {\n    let skill_dir = skills_dir.join(name);\n    match fs.metadata(&skill_dir).await {\n        Ok(Some(metadata)) if metadata.is_dir => {\n            anyhow::bail!(\n                \"A skill named \\\"{name}\\\" already exists at {}. Pick a different name.\",\n                skill_dir.display()\n            );\n        }\n        Ok(Some(_)) => {\n            // Something exists at this path, but it isn't a directory — e.g.\n            // a stray file the user (or another tool) left there. Without\n            // this branch we'd fall through to `create_dir`, which on the\n            // real fs returns a generic \"File exists\" IO error that gives\n            // the user no idea what's wrong or how to recover.\n            anyhow::bail!(\n                \"A file (not a skill directory) already exists at {}. \\\n                 Delete it or pick a different skill name.\",\n                skill_dir.display()\n            );\n        }\n        Ok(None) => {}\n        Err(err) => {","sourceCodeStart":1184,"sourceCodeEnd":1220,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/settings_ui/src/pages/skill_creator.rs#L1184-L1220","documentation":"Raised in write_skill_to_disk when fs.metadata reports an existing directory at <skills_dir>/<name>. Import/save refuses to overwrite an existing skill with the same name; the existing directory path is shown so the user can pick a different name.","triggerScenarios":"Thrown at crates/settings_ui/src/pages/skill_creator.rs:1208 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pick a different skill name in the creator form","Delete or rename the existing skill directory first","Edit the existing skill in place instead of creating a new one"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}