fix(install): 检测落空时不再静默兜底安装到 .claude (#33)#43
Open
jnMetaCode wants to merge 1 commit into
Open
Conversation
零参数 npx superpowers-zh 自动检测不到任何工具目录时,原本会静默兜底 安装到 .claude/skills/。但 Antigravity / Trae 等工具不一定在项目里留下 检测目录(如 .antigravity/),这些工具的用户因此被误装成默认目标,且因 文件实际落在 .claude/ 而非预期目录,卸载时显示成功但文件依旧存在。 改为:检测落空时明确报错并列出 --tool 用法后退出,不做任何安装。 带 .claude/ 目录的项目仍会被自动检测命中,裸命令安装行为不变。 修复 #33。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
解决的问题
修复 #33 —— 在 Antigravity 中安装时被误装成默认工具的文件、且卸载后文件残留。
根因
零参数
npx superpowers-zh会自动检测项目里的工具目录。检测不到任何工具时,原本会静默兜底安装到.claude/skills/(bin/superpowers-zh.js的install())。但 Antigravity / Trae 等工具不一定会在项目里留下检测目录(如
.antigravity/),所以这些工具的用户跑零参数安装时必然落入兜底分支,被装成默认目标的文件——这正是 #33 报告的「装的不是适配本工具的文件」。同时,因为文件实际落在
.claude/而非用户预期的目录,用户去预期目录找不到、卸载也对不上,表现为「卸载显示成功但文件还在」。改动
检测落空时不再静默兜底安装,改为明确报错并列出
--tool用法后退出,不做任何安装:.claude/的真实 Claude Code 项目仍会被自动检测命中,裸命令安装行为不变(README 承诺不破)。npx superpowers-zh --tool antigravity等。验证
.claude/skills/--tool用法,不装任何东西 ✅.claude/的项目零参数--tool antigravity三个场景均在本地实测通过。
showHelp文案原本就是「检测不到时用 --tool」,与新行为一致,无需改。Closes #33