The best way to control Claude Code, Codex and more from any computer or phone
fix(web): skill labels show the skill's own name (#27741)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
juuulianx committed
Nov 1, 2026 at 03:41 UTC
aa8dbbe54f6e66dcd3b0021ba3bf9b3711378757
2 files changed
+20
-14
packages/shared/src/inlineSkills.test.ts
new
+19
@@ -0,0 +1,19 @@
1
+import { describe, expect, it } from "vite-plus/test";
2
+import { formatProviderSkillDisplayName } from "./inlineSkills.ts";
3
+
4
+describe("formatProviderSkillDisplayName", () => {
5
+ it.each([
6
+ ["mca_lab_status", "mca_lab_status"],
7
+ ["frontend-design:frontend-design", "frontend-design:frontend-design"],
8
+ ["superpowers:brainstorming", "superpowers:brainstorming"],
9
+ ["DesignSync", "DesignSync"],
10
+ ])("shows %s as its skill name when the provider sets no display name", (name, label) => {
11
+ expect(formatProviderSkillDisplayName({ name })).toBe(label);
12
+ });
13
+
14
+ it("prefers the provider display name", () => {
15
+ expect(formatProviderSkillDisplayName({ name: "gh-fix-ci", displayName: " Fix CI " })).toBe(
16
+ "Fix CI",
17
+ );
18
+ });
19
+});
packages/shared/src/inlineSkills.ts
+1
-14
@@ -2,23 +2,10 @@ import type { ServerProviderSkill } from "@t3tools/contracts";
2
3
export type InlineSkill = Pick<ServerProviderSkill, "name" | "displayName">;
4
5
-function titleCaseWords(value: string): string {
6
- const words: string[] = [];
7
- for (const segment of value.split(/[\s:_-]+/)) {
8
- if (segment.length === 0) continue;
9
- words.push(segment.charAt(0).toUpperCase() + segment.slice(1));
10
- }
11
- return words.join(" ");
12
-}
13
-
5
export function formatProviderSkillDisplayName(
6
skill: Pick<ServerProviderSkill, "name" | "displayName">,
7
): string {
17
- const displayName = skill.displayName?.trim();
18
- if (displayName) {
19
- return displayName;
20
- }
21
- return titleCaseWords(skill.name);
8
+ return skill.displayName?.trim() || skill.name;
9
}
10
11
const SKILL_TOKEN_REGEX =