fix(plugin): cross-platform python launcher + absolute script paths#12
Merged
Conversation
Windows hosts (e.g. CodeBuddy on Windows) ship `python` / `py`, not
`python3` — hooks failed to load and `python3 scripts/xxx.py` samples
in SKILL/references were resolved against the skill directory, producing
paths like `skills/specode/scripts/spec_vault.py` that don't exist.
Changes:
- scripts/run.sh + run.cmd: probe python3 → python → py -3, exec args
- hooks/hooks.json: route every entry through run.sh + quote ${ROOT}
- spec_guard.py / task_swarm.py: emit launcher-form commands with
${CLAUDE_PLUGIN_ROOT}-prefixed script paths
- SKILL.md + references/{commands,workflow,obsidian,iteration,prompts}.md
+ commands/task-swarm.md: replace `python3 scripts/...` with
`sh ${CLAUDE_PLUGIN_ROOT}/scripts/run.sh ${CLAUDE_PLUGIN_ROOT}/scripts/...`
PRonto 评审PR: #12 fix(plugin): cross-platform python launcher + absolute script paths 概览通过引入 launcher 脚本和绝对路径,提升了跨平台兼容性,改动清晰合理。 问题清单
建议改进
PRonto via deepseek-chat |
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.
Summary
修复跨平台安装后插件无法在 Windows 上加载和运行的问题。
python3,Windows 上没有该命令,hook 加载即报错。python3 scripts/xxx.py(无${CLAUDE_PLUGIN_ROOT}),模型在 skill 目录上下文解析时拼成不存在的skills/specode/scripts/...。Changes
plugins/specode/scripts/run.sh+run.cmdpython launcher:依次探测python3 → python → py -3,找到任一即 exec 转发参数。hooks/hooks.json:6 个入口改走 launcher,并给${CLAUDE_PLUGIN_ROOT}加引号防空格断词。spec_guard.py+task_swarm.py:内部 emit 给模型执行的命令字符串(6 处)统一为 launcher +${CLAUDE_PLUGIN_ROOT}绝对路径。SKILL.md+references/{commands,workflow,obsidian,iteration,prompts}.md+commands/task-swarm.md里所有python3 scripts/...改为sh ${CLAUDE_PLUGIN_ROOT}/scripts/run.sh ${CLAUDE_PLUGIN_ROOT}/scripts/...。Test plan
/bin/sh跑 launcher 兼容python3仅有python的环境 → launcher 命中 fallbackinit后 emit 的next命令字符串eval可直接执行pytest plugins/specode/tests135/135 passed