Skip to content

fix(cli): Rank skills last in root slash completion - #9943

Draft
ChivuAndrei2003 wants to merge 4 commits into
QwenLM:mainfrom
ChivuAndrei2003:fix/hide-skills-from-slash-menu
Draft

fix(cli): Rank skills last in root slash completion#9943
ChivuAndrei2003 wants to merge 4 commits into
QwenLM:mainfrom
ChivuAndrei2003:fix/hide-skills-from-slash-menu

Conversation

@ChivuAndrei2003

@ChivuAndrei2003 ChivuAndrei2003 commented Aug 24, 2026

Copy link
Copy Markdown

What this PR does

This change keeps Skill commands in slash completion while making the terminal UI's empty / browse list easier to scan. Built-in and custom commands are shown before Skills in that root list. Once the user types a query such as /rev, Skills participate in fuzzy matching and recent-command ranking as before. Mid-input completion, stacked-Skill completion, direct /<skill-name> invocation, model invocation, and the Web Shell's existing categorized completion remain unchanged.

Why it's needed

Workspaces with many installed Skills can make the empty / menu difficult to scan because Skills compete with regular commands for the first visible rows. Ranking Skills after other commands only while browsing the empty root list reduces that clutter without removing discovery or fast fuzzy access to frequently used Skills.

Reviewer Test Plan

How to verify

Start the terminal UI and type /. Confirm that built-in and custom commands appear first and that Skills remain available later in the list. Type /rev and confirm that a matching review Skill appears. Confirm that a second Skill is suggested after a stacked Skill such as /review /sto, and that a model-invocable Skill is suggested in text such as please /sto. In Web Shell, confirm that the existing categorized / list and fuzzy Skill search still work.

Automated verification completed locally on Node.js 22.16.0:

  • Full repository build passed.
  • CLI slash-completion and command-completion suites: 77 passed.
  • Web Shell slash-completion suite: 25 passed.
  • CLI and Web Shell typechecks passed.
  • CLI and Web Shell lint passed.
  • Prettier formatting and git diff --check passed.
  • A previous full npm run preflight run on this PR completed formatting, lint, build, typecheck, and all workspace test runs. Core passed 21,325 tests and Web Shell passed 4,228 tests. The CLI run had 2 failures out of 23,768 tests in unrelated AuthDialog.test.tsx interaction tests; one reproduced on the merge base. The final fast-path bundle check was not reached because that test phase exited non-zero.

Evidence (Before & After)

Before, Skills participated in the same root browse ranking as all other commands, so a recently used Skill could compete for the first visible rows. The original behavior also provided fuzzy Skill search:

Before: review Skill is available through fuzzy slash completion

After, Skills remain in the empty / list but are placed after regular commands

image

Fuzzy Skill search remains available after the change:

Screenshot 2026-08-24 at 21 33 42

The dedicated /skills panel also remains available:

Skills remain available in the Skills panel

Tested on

OS Status
🍏 macOS
🪟 Windows ⚠️
🐧 Linux ⚠️

Environment (optional)

macOS, Node.js 22.16.0, focused Vitest suites for the CLI and Web Shell, package lint and typechecks, and a full repository build.

Risk & Scope

  • Main risk or tradeoff: browsing users must move farther down the empty / list to see individual Skills, while typed fuzzy search remains unchanged.
  • Not validated / out of scope: Windows and Linux manual testing. Web Shell production behavior is intentionally unchanged.
  • Breaking changes / migration notes: none. Direct Skill invocation, model invocation, fuzzy search, mid-input completion, and stacked-Skill completion remain supported.

Linked Issues

Fixes #9942

中文说明

此 PR 的作用

此更改保留斜杠补全中的 Skill 命令,同时让终端 UI 中空的 / 浏览列表更易查看。在根列表中,内置命令和自定义命令会显示在 Skills 之前。当用户输入 /rev 等查询时,Skills 仍会像以前一样参与模糊匹配和最近使用排序。输入中间补全、堆叠 Skill 补全、直接 /<skill-name> 调用、模型调用以及 Web Shell 现有的分类补全行为均保持不变。

为什么需要此更改

安装大量 Skills 后,空的 / 菜单会因 Skills 与普通命令争夺首屏位置而难以浏览。仅在浏览空根列表时把 Skills 排在其他命令之后,可以减少拥挤,同时保留发现能力和常用 Skill 的快速模糊搜索。

Reviewer Test Plan

验证方法

启动终端 UI 并输入 /,确认内置命令和自定义命令先显示,而 Skills 仍可在列表后部找到。输入 /rev,确认匹配的 review Skill 会出现。确认在 /review /sto 等堆叠 Skill 后仍会建议第二个 Skill,并且在 please /sto 等文本中仍会建议可由模型调用的 Skill。在 Web Shell 中确认现有的分类 / 列表和 Skill 模糊搜索仍然有效。

已在 Node.js 22.16.0 上完成以下本地验证:

  • 完整仓库构建通过。
  • CLI 斜杠补全和命令补全测试:77 个通过。
  • Web Shell 斜杠补全测试:25 个通过。
  • CLI 和 Web Shell 类型检查通过。
  • CLI 和 Web Shell lint 通过。
  • Prettier 格式化和 git diff --check 通过。
  • 此 PR 之前的一次完整 npm run preflight 已执行格式化、lint、构建、类型检查和所有 workspace 测试。Core 的 21,325 个测试全部通过,Web Shell 的 4,228 个测试全部通过。CLI 的 23,768 个测试中有 2 个失败,均位于与本更改无关的 AuthDialog.test.tsx 交互测试中;其中一个也能在 merge base 上复现。由于该测试阶段以非零状态退出,最终的 fast-path bundle 检查没有运行。

证据(更改前后)

更改前,Skills 与所有其他命令共享根浏览排序,因此最近使用的 Skill 可能占据首屏位置。原有的 Skill 模糊搜索行为如第一张图所示。

更改后,Skills 仍位于空的 / 列表中,但排在普通命令之后;第二张图显示 Skills 在 105 项列表的后部开始出现。第三张图确认输入 /rev 后仍会建议 review Skill。专用的 /skills 面板也继续可用。

测试平台

操作系统 状态
🍏 macOS
🪟 Windows ⚠️
🐧 Linux ⚠️

环境(可选)

macOS、Node.js 22.16.0、CLI 和 Web Shell 的针对性 Vitest 测试、package lint 和类型检查,以及完整仓库构建。

风险与范围

  • 主要风险或权衡:浏览用户需要在空的 / 列表中向下移动更远才能看到单个 Skill,但输入后的模糊搜索保持不变。
  • 未验证或不在范围内:Windows 和 Linux 手动测试。Web Shell 的生产行为有意保持不变。
  • 破坏性更改或迁移说明:无。直接调用、模型调用、模糊搜索、输入中间补全和堆叠 Skill 补全均继续受支持。

关联 Issue

Fixes #9942

@github-actions github-actions Bot added the review/self-reported The linked issue was opened by the PR author (self-reported) label Aug 24, 2026
@ChivuAndrei2003
ChivuAndrei2003 marked this pull request as ready for review August 24, 2026 14:52
Copilot AI lite review requested due to automatic review settings August 24, 2026 14:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@qwen-code-ci-bot

qwen-code-ci-bot commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Qwen Triage finishedview run. See the stage comments in this thread for the result.

Qwen Triage 已完成 —— 查看运行。结果见本线程中的各阶段评论。

@qwen-code-ci-bot qwen-code-ci-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR — and for pairing it with before/after screenshots and tests. The template is complete, and the underlying problem is real: the / menu gets crowded when many skills are installed, and #9942 documents it well.

This is a product-direction block, not a code-quality one — the diff is small and focused (completion filtering in the TUI and Web Shell, plus docs):

  • #9942 carries the need-discussion label, and your own issue text says "I would like maintainer feedback before opening a pull request." The PR arrived ~11 minutes after the issue, and no maintainer has replied in that thread yet.
  • The triage on #9942 already suggested two smaller alternatives — an opt-out setting consistent with the existing skills.disabled surface, or grouping/pinning skills after built-in commands in the TUI browse list — and asked to hold for maintainer input on "default-hide vs opt-in setting" before opening the PR.
  • Web Shell recently moved in the opposite direction: #4792 (merged June 2026) organized top-level completion into custom / skill / system category sections with configurable ordering. Hiding skills by default would partly undo that design.
  • Hiding also removes fuzzy completion and recently-used ranking for skill names — typing /rev would no longer surface a review skill, forcing full names to be typed unaided.
  • Direction signal: the reference product keeps skills in the slash-command namespace (claude-code 2.1.233 fixed bundled skill aliases like /checkup and /review reporting "Unknown command").

@ChivuAndrei2003 please hold this until a maintainer weighs in on #9942: default-hide vs opt-in setting. If the decision is default-hide, this PR is well placed to proceed to code review; if it's the setting route, the completion-layer filtering here is still a useful starting point.

@yiliang114 needs a maintainer call on #9942 before this can proceed to merge review: hide skills from top-level / completion by default, opt-in setting, or group them below built-in commands?

中文说明

感谢提交 PR——也感谢你同时提供了前后截图与测试。模板完整,问题本身真实存在:安装大量 skills 时 / 菜单会变得拥挤,#9942 已充分说明。

这是产品方向上的阻断,不是代码质量问题——diff 小而聚焦(TUI 与 Web Shell 的补全层过滤,外加文档):

  • #9942 带有 need-discussion 标签,且你在 issue 中写明"希望先得到维护者反馈再开 PR"。PR 在 issue 提出约 11 分钟后就提交了,而该 issue 下尚无维护者回复。
  • #9942 的 triage 已给出两个更小的替代方案——与现有 skills.disabled 一致的配置项开关,或在 TUI 浏览列表中把技能分组/排在内置命令之后——并请你在开 PR 前等待维护者对"默认隐藏还是配置项"的意见。
  • Web Shell 最近走的是相反方向:#4792(2026 年 6 月合入)把顶层补全整理为可配置顺序的 custom / skill / system 分类。默认隐藏技能会部分推翻该设计。
  • 隐藏还会让技能名失去模糊补全和最近使用排序——输入 /rev 将不再提示 review 技能,用户需完整输入名称。
  • 方向参考:参考产品将技能保留在斜杠命令命名空间中(claude-code 2.1.233 修复了 /checkup/review 等内置技能别名被报 "Unknown command" 的问题)。

@ChivuAndrei2003 请先等待维护者在 #9942 中对"默认隐藏还是配置项"给出结论。若结论是默认隐藏,本 PR 可直接进入代码审查;若选择配置项路线,这里的补全层过滤仍是可用的起点。

@yiliang114 此 PR 进入合并审查前,需要维护者先在 #9942 上定方向:默认从顶层 / 补全隐藏技能、做成配置项、还是排在内置命令之后分组展示?

Qwen Code · qwen3.8-max

@qwen-code-ci-bot qwen-code-ci-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partially reviewed — gaps disclosed.

1 Suggestion-level finding(s) this review confirmed are already reported on this PR and are not repeated:

  • R1-3 default-hide adopted without the maintainer decision #9942 requires — already reported (review 5009301936 by @qwen-code-ci-bot)

Not reviewed: build-and-test — tmux-testing was skipped in CI and its suite did not run locally.

Not reviewed: reverse audit — stopped before round 1 by the review time budget.

Test Plan (not a blocker): tests: 73 passed — this review observed 23737, 4228, 601 passed; tests: 24 passed — this review observed 23737, 4228, 601 passed.

中文说明

仅完成部分审查,审查缺口已披露。

本轮确认的 1 条建议级发现已在 PR 上报告过,不再重复发布(列表见上方英文部分)。

未审查:build-and-test — tmux-testing was skipped in CI and its suite did not run locally。

未审查:反向审计——评审时间预算不足,未能开始第 1 轮。

Test Plan(非阻断):tests: 73 passed — this review observed 23737, 4228, 601 passed; tests: 24 passed — this review observed 23737, 4228, 601 passed

— qwen3.8-max via Qwen Code /review (v0.22.0)

Comment thread packages/cli/src/ui/hooks/useSlashCompletion.ts Outdated
Comment thread packages/cli/src/ui/hooks/useSlashCompletion.ts Outdated
Comment thread packages/web-shell/client/completions/slashCompletion.ts Outdated
Comment thread packages/web-shell/client/completions/slashCompletion.ts Outdated
Comment thread packages/cli/src/ui/hooks/useSlashCompletion.test.ts Outdated
Comment thread packages/web-shell/client/completions/slashCompletion.test.ts Outdated
Comment thread packages/web-shell/client/utils/commandDisplay.ts Outdated
@ChivuAndrei2003 ChivuAndrei2003 changed the title fix(cli): Hide skills from top-level slash completion fix(cli): Rank skills last in root slash completion Aug 24, 2026
@ChivuAndrei2003
ChivuAndrei2003 marked this pull request as draft August 24, 2026 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review/self-reported The linked issue was opened by the PR author (self-reported)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hide skill commands from top-level slash completion

3 participants