fix: support nested Claude skill directories#2045
fix: support nested Claude skill directories#2045Alexlangl wants to merge 8 commits intofarion1231:mainfrom
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9705c972f8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if !skill.apps.is_enabled_for(app) { | ||
| return None; | ||
| } | ||
| Self::app_relative_skill_path(app, &skill.directory) | ||
| .map(|relative| Self::normalize_skill_path(&relative)) |
There was a problem hiding this comment.
Remove disabled copied skills during app reconciliation
sync_to_app now builds managed_app_paths using only skills currently enabled for the target app, but cleanup later removes non-symlink entries only if their path is in that set. In Copy mode (or Auto fallback when symlink creation fails, common on Windows), a previously managed skill that is now disabled remains a real directory and no longer matches any removal condition, so reconciliation leaves disabled skills in the live app directory.
Useful? React with 👍 / 👎.
| let managed_dirs: HashSet<String> = managed_skills | ||
| .values() | ||
| .map(|s| s.directory.clone()) | ||
| .map(|s| Self::normalize_skill_key(&s.directory)) | ||
| .collect(); |
There was a problem hiding this comment.
Normalize managed-dir lookup inputs consistently
managed_dirs is now stored as normalized lowercase keys, but the non-app scanning branch still checks membership with raw dir_name. For managed skills whose directory casing differs from lowercase (for example MySkill), the cc-switch/agents scan path will miss the match and incorrectly report the skill as unmanaged, which can trigger duplicate import prompts.
Useful? React with 👍 / 👎.
Summary / 概述
主要解决Claude skill子目录问题
有些Claude skill拥有子目录,典型的就是superpowers
CC Switch 之前只能识别顶层目录,导致这类Claude skills 无法被正常发现、导入和统一管理。
Related Issue / 关联 Issue
Fixes #1686
Screenshots / 截图
Checklist / 检查清单
pnpm typecheckpasses / 通过 TypeScript 类型检查pnpm format:checkpasses / 通过代码格式检查cargo clippypasses (if Rust code changed) / 通过 Clippy 检查(如修改了 Rust 代码)