From dd2bd12626207a170883cb7594ef1e475505e7ad Mon Sep 17 00:00:00 2001 From: claude-code-best Date: Mon, 6 Apr 2026 14:11:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=B8=BA=20project=20=E7=BA=A7=20skill?= =?UTF-8?q?=20=E6=B7=BB=E5=8A=A0=E9=BB=84=E8=89=B2=20[local]=20=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E5=8C=BA=E5=88=86=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在斜杠命令列表和 SkillsMenu 中,对 projectSettings/localSettings 来源的 skill 显示黄色 [local] 标签,方便区分项目级和用户级技能。 Co-Authored-By: Claude Opus 4.6 --- .../PromptInputFooterSuggestions.tsx | 6 ++++- src/components/skills/SkillsMenu.tsx | 22 +++++++++++++++++++ src/utils/suggestions/commandSuggestions.ts | 11 +++++++++- 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/src/components/PromptInput/PromptInputFooterSuggestions.tsx b/src/components/PromptInput/PromptInputFooterSuggestions.tsx index 0728e5255..7a5d70260 100644 --- a/src/components/PromptInput/PromptInputFooterSuggestions.tsx +++ b/src/components/PromptInput/PromptInputFooterSuggestions.tsx @@ -163,7 +163,11 @@ const SuggestionItemRow = memo(function SuggestionItemRow({ {paddedDisplayText} - {tagText ? {tagText} : null} + {tagText ? ( + + {tagText} + + ) : null} { + switch (source) { + case 'projectSettings': + case 'localSettings': + return { label: 'local', color: 'yellow' } + case 'userSettings': + return { label: 'global', color: 'cyan' } + case 'policySettings': + return { label: 'managed', color: 'magenta' } + default: + return undefined + } + } + const renderSkill = (skill: SkillCommand) => { const estimatedTokens = estimateSkillFrontmatterTokens(skill) const tokenDisplay = `~${formatTokens(estimatedTokens)}` @@ -146,10 +162,14 @@ export function SkillsMenu({ onExit, commands }: Props): React.ReactNode { skill.source === 'plugin' ? skill.pluginInfo?.pluginManifest.name : undefined + const scopeTag = getScopeTag(skill.source as SkillSource) return ( {getCommandName(skill)} + {scopeTag && ( + [{scopeTag.label}] + )} {pluginName ? ` · ${pluginName}` : ''} · {tokenDisplay} description tokens @@ -187,7 +207,9 @@ export function SkillsMenu({ onExit, commands }: Props): React.ReactNode { > {renderSkillGroup('projectSettings')} + {renderSkillGroup('localSettings')} {renderSkillGroup('userSettings')} + {renderSkillGroup('flagSettings')} {renderSkillGroup('policySettings')} {renderSkillGroup('plugin')} {renderSkillGroup('mcp')} diff --git a/src/utils/suggestions/commandSuggestions.ts b/src/utils/suggestions/commandSuggestions.ts index 4a90db550..293f63998 100644 --- a/src/utils/suggestions/commandSuggestions.ts +++ b/src/utils/suggestions/commandSuggestions.ts @@ -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, }