Skip to content

fix: support nested Claude skill directories#2045

Closed
Alexlangl wants to merge 8 commits intofarion1231:mainfrom
Alexlangl:fix/claude-skill-subdir-mapping-1686
Closed

fix: support nested Claude skill directories#2045
Alexlangl wants to merge 8 commits intofarion1231:mainfrom
Alexlangl:fix/claude-skill-subdir-mapping-1686

Conversation

@Alexlangl
Copy link
Copy Markdown
Contributor

@Alexlangl Alexlangl commented Apr 13, 2026

Summary / 概述

主要解决Claude skill子目录问题
有些Claude skill拥有子目录,典型的就是superpowers
CC Switch 之前只能识别顶层目录,导致这类Claude skills 无法被正常发现、导入和统一管理。

Related Issue / 关联 Issue

Fixes #1686

Screenshots / 截图

Before / 修改前 After / 修改后

Checklist / 检查清单

  • pnpm typecheck passes / 通过 TypeScript 类型检查
  • pnpm format:check passes / 通过代码格式检查
  • cargo clippy passes (if Rust code changed) / 通过 Clippy 检查(如修改了 Rust 代码)
  • Updated i18n files if user-facing text changed / 如修改了用户可见文本,已更新国际化文件

@Alexlangl Alexlangl changed the title Fix/claude skill subdir mapping 1686 fix: support nested Claude skill directories Apr 13, 2026
@yovinchen
Copy link
Copy Markdown
Collaborator

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src-tauri/src/services/skill.rs Outdated
Comment on lines +1830 to +1834
if !skill.apps.is_enabled_for(app) {
return None;
}
Self::app_relative_skill_path(app, &skill.directory)
.map(|relative| Self::normalize_skill_path(&relative))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已处理

Comment on lines 1411 to 1414
let managed_dirs: HashSet<String> = managed_skills
.values()
.map(|s| s.directory.clone())
.map(|s| Self::normalize_skill_key(&s.directory))
.collect();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已处理

@Alexlangl Alexlangl closed this Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

希望skill的管理增加子目录映射

2 participants