mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-08-04 11:43:57 +08:00
eb356e15bd
* fix(skills): resolve source dir by SKILL.md anchor instead of name resolve_skill_source_dir previously guessed the source dir via root.join(name).is_dir() without verifying SKILL.md, misjudging same-name non-skill dirs (e.g. the ast-grep plugin wrapper dir in ast-grep/agent-skill) and causing install failure #4141. Now anchors on SKILL.md: direct + SKILL.md check -> root manifest explicit skills[] -> fallback by name -> root fallback. Adds 5 layout tests. Closes #4141 * fix(skills): drop speculative manifest resolver path resolve_via_manifest (parsing root .claude-plugin/marketplace.json & plugin.json explicit skills[]) is inert for the actual #4141 case: the real ast-grep/agent-skill marketplace.json declares no skills[] array, so the manifest branch never produces a candidate. The #4141 fix is delivered entirely by resolve_skill_source_dir step 1's SKILL.md anchor plus the pre-existing find_skill_dir_by_name DFS. Keeping the manifest path would pull npx-skills package-parity semantics (pluginRoot / source / remote-object source / skills[] / "./"-validation / ...) into a bug hotfix, with no real manifest proving it is not dead code. Drop it to keep this PR a focused #4141 hotfix. - remove SkillMarketplaceMetadata / SkillManifestPlugin / SkillMarketplaceManifest, resolve_via_manifest, sanitize_manifest_path - narrow resolve_skill_source_dir to 3 steps (direct+SKILL.md -> by-name DFS+SKILL.md -> root+SKILL.md -> None) - replace the two synthetic manifest tests with a negative case: same-name wrapper dir without SKILL.md and no inner skill -> None cargo test --lib resolve_skill_source_dir: 7 passed cargo clippy --lib: clean