Skip to content

Commit 4dac629

Browse files
fix(provider-fx): keep skills whose names differ only in case
fx resolves `$review` and `$Review` to the skill with that exact name (checked live on 0.0.13), so only an exact repeat of a name is dropped from the list. The shared composer menu still shows one row per name regardless of case; the docs say to type the exact name for the other. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent be77348 commit 4dac629

3 files changed

Lines changed: 10 additions & 11 deletions

File tree

‎docs/user/providers-fx.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fx also has an **Effort** control. A new thread starts at Medium.
2525

2626
T3 Code does not show fx's backend selector. To use Codex, Grok, or Vercel AI Gateway, run `fx provider` on the environment's machine.
2727

28-
Type `$` in the composer to list the skills fx finds in its skill folders, in the order fx's own skill menu shows them. When two different skills share a name, the menu lists the one fx loads for that name: the first copy in fx's folder order, starting with the workspace.
28+
Type `$` in the composer to list the skills fx finds in its skill folders, in the order fx's own skill menu shows them. When two different skills share a name, the menu lists the one fx loads for that name: the first copy in fx's folder order, starting with the workspace. The menu shows one skill per name regardless of case; to run a skill whose name differs only in case, such as `Review` next to `review`, type its exact name.
2929

3030
## Permission modes
3131

‎packages/provider-fx/src/server/skills.test.ts‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ describe("discoverFxSkills", () => {
5656
}).pipe(Effect.provide(NodeServices.layer), Effect.scoped),
5757
);
5858

59-
// For `$review` with two skills of that name (ignoring case), fx's model
60-
// picks the first in scan order, so only that one is offered. fx skips a
61-
// SKILL.md whose frontmatter has no name or never closes, and a symlinked
62-
// folder in its managed ~/.fx/skills.
59+
// For `$review` with two skills of exactly that name, fx's model loads the
60+
// first in scan order, so only that one is offered; `Review` is a separate
61+
// skill `$Review` loads. fx skips a SKILL.md whose frontmatter has no name
62+
// or never closes, and a symlinked folder in its managed ~/.fx/skills.
6363
it.effect("offers the skill fx loads for each name", () =>
6464
Effect.gen(function* () {
6565
const fileSystem = yield* FileSystem.FileSystem;
@@ -148,8 +148,6 @@ describe("discoverFxSkills", () => {
148148

149149
const skills = yield* discoverFxSkills({ cwd: workspace, environment: { HOME: home } });
150150

151-
// fx scans the workspace before HOME, so the workspace `review` wins
152-
// over ~/.claude's `Review`.
153151
assert.deepEqual(
154152
skills.map((skill) => [skill.name, skill.path]),
155153
[
@@ -159,6 +157,7 @@ describe("discoverFxSkills", () => {
159157
["plain", path.join(home, ".fx/skills/plain/SKILL.md")],
160158
["replacement", path.join(home, ".fx/skills/replacement/SKILL.md")],
161159
["review", path.join(workspace, ".fx/skills/review/SKILL.md")],
160+
["Review", path.join(home, ".claude/skills/review/SKILL.md")],
162161
],
163162
);
164163
}).pipe(Effect.provide(NodeServices.layer), Effect.scoped),

‎packages/provider-fx/src/server/skills.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,16 +361,16 @@ export const discoverFxSkills = Effect.fn("discoverFxSkills")(function* (input:
361361
const cwd = yield* realPath(input.cwd);
362362
const path = yield* Path.Path;
363363
const seenFolders = new Set<string>();
364-
// fx matches `$name` ignoring ASCII case only.
364+
// `$review` and `$Review` each load the skill whose name matches the typed
365+
// case, so only an exact repeat of a name is dropped.
365366
const seenNames = new Set<string>();
366367
const found: Array<{ readonly skill: ServerProviderSkill; readonly rank: number }> = [];
367368
for (const root of skillRoots(path, cwd, home)) {
368369
for (const { skill, folder } of yield* discoverSkillsInRoot(root)) {
369370
if (seenFolders.has(folder)) continue;
370371
seenFolders.add(folder);
371-
const nameKey = skill.name.replace(/[A-Z]/g, (letter) => letter.toLowerCase());
372-
if (seenNames.has(nameKey)) continue;
373-
seenNames.add(nameKey);
372+
if (seenNames.has(skill.name)) continue;
373+
seenNames.add(skill.name);
374374
found.push({ skill, rank: root.rank });
375375
}
376376
}

0 commit comments

Comments
 (0)