Feature/npx distribution#7
Merged
Merged
Conversation
Cursor 文档确认支持项目级 hooks(.cursor/hooks.json),之前 误装到 ~/.cursor/hooks.json(用户级)导致影响所有 cursor 项目。 改为项目级后安装不再输出 ⚠ 警告,行为与 claude/codebuddy/codex 一致。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
之前 npx 安装会把整个 hooks/ 目录直接拷到 .{ide}/hooks/,并对该目录
做 rmrf —— 任何同样写在该位置的别的 skill 包内容都会被清空。同时
claude/codebuddy/codex 的 hook 命令本来就直接指向 skills/ 下的
guardrail 脚本,根本不需要 hooks/ 目录。
主要改动:
1. claude/codebuddy/codex 不再创建 .{ide}/hooks/ 目录,settings.json
里的 hook 命令保持原样指向 skills/,零行为差异。
2. cursor 改为安装到 .cursor/hooks/trtc-agent-skills/ 命名空间子目录,
只复制实际需要的 cursor-adapter.py,不再夹带 hooks-cursor.json /
hooks.json 等 IDE 不消费的文件。
3. cursor-adapter.py 的 PLUGIN_ROOT 改为沿 __file__ 向上查找含 skills/
的目录,对 <plugin>/hooks/cursor-adapter.py(旧)和
<plugin>/hooks/trtc-agent-skills/cursor-adapter.py(新)两种布局
都能正确解析;找不到 skills/ 时回退到旧 .parent 行为,对插件商店
安装路径无副作用。
4. cleanSkills 不再 rmrf 整个 .{ide}/hooks/,只删 trtc-agent-skills/
子目录 + 我们历史发布过的几个文件,避免误删其他 skill。
5. 新增 tests/unit/test_cursor_adapter.py::TestPluginRootResolution,
覆盖两种 hooks 子目录布局,防止后续 PLUGIN_ROOT 解析回归。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
No description provided.