{"record":{"id":"e8add794ee7fb651","repo":"zed-industries/zed","slug":"failed-to-read-skill-file","errorCode":null,"errorMessage":"Failed to read skill file {}: {}","messagePattern":"Failed to read skill file (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/agent_ui/src/mention_set.rs","lineNumber":510,"sourceCode":"        })\n    }\n\n    fn confirm_mention_for_skill(\n        &self,\n        skill_file_path: PathBuf,\n        cx: &mut Context<Self>,\n    ) -> Task<Result<Mention>> {\n        // Built-in skills have synthetic paths that don't exist on disk;\n        // serve their content directly from the compiled-in data.\n        if let Some(content) = agent_skills::builtin_skill_content(&skill_file_path) {\n            return Task::ready(Ok(Mention::Text {\n                content: content.to_string(),\n                tracked_buffers: Vec::new(),\n            }));\n        }\n        cx.background_spawn(async move {\n            let content = std::fs::read_to_string(&skill_file_path).map_err(|e| {\n                anyhow!(\n                    \"Failed to read skill file {}: {}\",\n                    skill_file_path.display(),\n                    e\n                )\n            })?;\n            Ok(Mention::Text {\n                content,\n                tracked_buffers: Vec::new(),\n            })\n        })\n    }\n\n    pub fn confirm_mention_for_selection(\n        &mut self,\n        source_range: Range<text::Anchor>,\n        selections: Vec<(Entity<Buffer>, Range<text::Anchor>, Range<usize>)>,\n        editor: Entity<Editor>,\n        workspace: WeakEntity<Workspace>,","sourceCodeStart":492,"sourceCodeEnd":528,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/crates/agent_ui/src/mention_set.rs#L492-L528","documentation":"Confirming a skill @-mention first tries agent_skills::builtin_skill_content for built-in skills (synthetic paths, compiled into the binary); everything else is read from disk with std::fs::read_to_string. This error wraps that IO failure: the skill file was listed but could not be read at confirmation time.","triggerScenarios":"Mentioning a user or project skill whose file was deleted, renamed, or moved after the skill list was populated; an unreadable file (permissions or ownership); a path on an unmounted removable drive or network share; a stale skill index after relocating the project directory.","commonSituations":"Editing ~/.config/zed/skills or .zed/skills while the skill picker is open; dotfile sync tools replacing skill files; running as a different user; skill directories on external media; a custom skill whose name collides with a built-in but only exists on disk.","solutions":["Check that the skill file still exists at the path printed in the error (list the directory).","Restore read permission (chmod u+r) or ownership of the file.","Trigger a skills re-scan (reopen the panel or restart Zed) so the stale entry disappears.","If the skill is built-in, use its canonical name so the compiled-in content path is taken instead of the filesystem."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// before confirming a skill mention, probe the file on a background thread\nlet exists = smol::unblock({\n    let path = skill_file_path.clone();\n    move || std::fs::metadata(&path).map(|m| m.is_file()).unwrap_or(false)\n})\n.await;\nif !exists {\n    // drop the candidate from the picker instead of confirming\n}","typeGuard":null,"tryCatchPattern":"match std::fs::read_to_string(&skill_file_path) {\n    Ok(content) => content,\n    Err(e) if e.kind() == std::io::ErrorKind::NotFound => {\n        remove_skill_from_list(&skill_file_path); // stale entry\n        continue;\n    }\n    Err(e) => return Err(e.into()), // PermissionDenied etc: surface to user\n}","preventionTips":["Watch the skills directory and re-scan on change instead of caching paths.","Filter skill candidates by existence before showing them in the picker.","Distinguish NotFound (drop the entry) from PermissionDenied (warn) when handling read failures."],"tags":["zed","skills","filesystem","io","mentions"],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}