feat: 为 project 级 skill 添加黄色 [local] 标签区分显示

在斜杠命令列表和 SkillsMenu 中,对 projectSettings/localSettings
来源的 skill 显示黄色 [local] 标签,方便区分项目级和用户级技能。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
claude-code-best
2026-04-06 14:11:01 +08:00
parent ca630488c6
commit dd2bd12626
3 changed files with 37 additions and 2 deletions

View File

@@ -271,6 +271,15 @@ function createCommandSuggestionItem(
const aliasText = matchedAlias ? ` (${matchedAlias})` : ''
const isWorkflow = cmd.type === 'prompt' && cmd.kind === 'workflow'
// Show "local" tag for project-scoped prompt commands
const scopeTag =
cmd.type === 'prompt' &&
!isWorkflow &&
(cmd.source === 'projectSettings' || cmd.source === 'localSettings')
? 'local'
: undefined
const fullDescription =
(isWorkflow ? cmd.description : formatDescriptionWithSource(cmd)) +
(cmd.type === 'prompt' && cmd.argNames?.length
@@ -280,7 +289,7 @@ function createCommandSuggestionItem(
return {
id: getCommandId(cmd),
displayText: `/${commandName}${aliasText}`,
tag: isWorkflow ? 'workflow' : undefined,
tag: isWorkflow ? 'workflow' : scopeTag,
description: fullDescription,
metadata: cmd,
}