fix: drop the trigger word for an Agent that cannot read the Skill - #2
Merged
Merged
Conversation
The dashboard listed "/bravo (Claude·Gemini)" for a Skill neither Agent could load. Restoring from the trash puts the Skill back without its links — the modal says so — and `unlink` removes one link on purpose. Both left the trigger column advertising a command that does nothing. registry.mjs already had the rule written down, and applied it only to the agent-only case. The `agents` map computed a few lines above is the real answer to "can this Agent reach it": the link exists, or the Agent scans the SSOT natively. Asking that map covers unlink and restore as well, and subsumes the agent-only special case. Found by walking the dashboard by hand: uninstall bravo, restore it from the trash, then read what the table claims against what is on disk. Co-Authored-By: Claude Opus 5 <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.
浏览器端逐个走查写操作时抓到的:面板会显示一个根本用不了的触发词。
复现
bravobravo这一行显示/bravo (Claude·Gemini)但磁盘上
.claude/skills/bravo和.gemini/config/skills/bravo都不存在,registry 自己也如实记着agents = {claude:false, gemini:false, codex:true}。用户照着面板敲/bravo,什么都不会发生。unlink是更常见的触发路径:skillhub unlink charlie claude之后,agents.claude=false但triggers.claude="/charlie"照旧。根因
registry.mjs里 triggers 只按「Agent 是否可见」和 agentOnly 特例过滤,没问「这个 Agent 到底读不读得到」。而那条原则代码注释里已经写了:只是当时只用在了 agentOnly 一个分支上。
改法
改用上面几行刚算好的
agents映射来过滤——它本来就是「链接存在,或该 Agent 原生扫描 SSOT」的答案。这一改同时覆盖 unlink 和回收站恢复,并且把 agentOnly 那个特例吸收掉了(agentOnly 的 skill 本来就只有那一个 agent 为 true)。净效果是删掉一个特例,不是加一个分支。
验证
npm test98/98 通过(含新增的回归断言:抽掉链接后触发词消失、原生 Agent 的触发词保留)charlie/bravo/alpha三种状态下幽灵触发词均为 0🤖 Generated with Claude Code