From 04508801ef8f046ade7b98dc0faa31a344512e61 Mon Sep 17 00:00:00 2001 From: Jason Date: Tue, 14 Apr 2026 15:56:31 +0800 Subject: [PATCH] fix: handle root-level skill repos during installation When a repo itself is a single skill (SKILL.md at repo root), the discovery phase sets directory to the repo name, but after ZIP extraction (which strips the root folder), no matching subdirectory exists. Add a fallback to check if SKILL.md exists directly in the extracted temp directory before reporting SKILL_DIR_NOT_FOUND. Fixes installation of repos like zlbigger/Google-SEOs.skill. --- src-tauri/src/services/skill.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src-tauri/src/services/skill.rs b/src-tauri/src/services/skill.rs index f94dd8391..2acbdfae9 100644 --- a/src-tauri/src/services/skill.rs +++ b/src-tauri/src/services/skill.rs @@ -680,6 +680,13 @@ impl SkillService { found.display() ); source = found; + } else if temp_dir.join("SKILL.md").exists() { + // 根级 Skill:仓库本身就是 skill,SKILL.md 直接在解压根目录 + log::info!( + "Skill directory '{}' not found, but SKILL.md exists at root, using temp_dir", + target_name, + ); + source = temp_dir.clone(); } else { let _ = fs::remove_dir_all(&temp_dir); return Err(anyhow!(format_skill_error(