fix(composer): stop offering skills and commands that cannot run #7673
ClosedBrechard(GitHub profile, opens in a new tab)wants to merge 13 commits into
main fromrefs/pull/7673/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- apps/server/src/provider/Drivers/ClaudeSkills.ts line 135Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -53,6 +60,18 @@5360 kind: "parsed",5461 ...(name ? { name } : {}),5562 ...(description ? { description } : {}),63+ ...(record["disable-model-invocation"] === true ? { userInvocationOnly: true } : {}),5664 };5765 }586667+/**68+ * Settings files Claude Code merges for `skillOverrides`, in increasing69+ * precedence. A skill the user switched off is reported disabled rather than70+ * dropped, so the picker can grey it out instead of silently losing it.71+ */72+function skillOverrideSettingsPaths(73+ path: Path.Path,74+ configDirPath: string,75+ cwd: string | undefined,76+): ReadonlyArray<string> {77+ return [apps/server/src/provider/Drivers/ClaudeSkills.ts line 130OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -58,0 +110,21 @@110+ continue;111+ }112+113+ const parsed = yield* decodeSkillOverrideSettings(contents).pipe(114+ Effect.tapError((cause) =>115+ Effect.logDebug("claude settings file is unreadable; ignoring skillOverrides", {116+ path: settingsPath,117+ cause,118+ }),119+ ),120+ Effect.orElseSucceed(() => undefined),121+ );122+ const overrides = parsed?.skillOverrides;123+ if (!overrides) {124+ continue;125+ }126+127+ for (const [name, value] of Object.entries(overrides)) {128+ // Only "off" is a decision to hide. Unknown values mean a newer Claude129+ // Code grew a mode we do not model yet — leave the skill visible.130+ enabledByName.set(name, value !== "off" && value !== false);docs/user/providers-claude.md lines 56 to 58OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -41,3 +41,18 @@41414242 If the same skill name exists in more than one folder, the later folder wins.434344+A skill you have switched off in Claude Code is left out of both menus.45+46+## Starting A Skill With `$` Or `/`47+48+Typing `$` lists the skills the agent can pick up, and drops the name into your49+message as a mention. Typing `/` at the very start of a message lists slash50+commands and runs the one you choose.51+52+Some skills are marked to run only when you ask for them. Those never appear in53+the `$` menu, because a mention leaves the choice to the agent and the agent54+cannot see them — pick them from the `/` menu instead.55+56+`/` only works at the start of a message. Later in a message it is ordinary57+text, so the menu stops offering commands there.58+
- apps/server/src/provider/Drivers/ClaudeSkills.ts line 130OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -58,0 +110,21 @@110+ continue;111+ }112+113+ const parsed = yield* decodeSkillOverrideSettings(contents).pipe(114+ Effect.tapError((cause) =>115+ Effect.logDebug("claude settings file is unreadable; ignoring skillOverrides", {116+ path: settingsPath,117+ cause,118+ }),119+ ),120+ Effect.orElseSucceed(() => undefined),121+ );122+ const overrides = parsed?.skillOverrides;123+ if (!overrides) {124+ continue;125+ }126+127+ for (const [name, value] of Object.entries(overrides)) {128+ // Only "off" is a decision to hide. Unknown values mean a newer Claude129+ // Code grew a mode we do not model yet — leave the skill visible.130+ enabledByName.set(name, value !== "off" && value !== false);
t3dotgg(GitHub profile, opens in a new tab) added labelsvouch:trusted
t3dotgg(GitHub profile, opens in a new tab) removed labelsvouch:unvouched
- apps/server/src/provider/Drivers/ClaudeSkills.ts line 326Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -139,4 +273,8 @@139273 continue;140274 }141275276+ const override = skillOverrides.get(name);277+ const userInvocationOnly =278+ (frontmatter.kind === "parsed" && frontmatter.userInvocationOnly === true) ||279+ override?.userInvocationOnly === true;142280 skillsByName.set(name, {apps/server/src/provider/Drivers/ClaudeSkills.ts line 334Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -139,11 +273,16 @@139273 continue;140274 }141275276+ const override = skillOverrides.get(name);277+ const userInvocationOnly =278+ (frontmatter.kind === "parsed" && frontmatter.userInvocationOnly === true) ||279+ override?.userInvocationOnly === true;142280 skillsByName.set(name, {143281 name,144282 path: skillPath,145- enabled: true,283+ enabled: override?.enabled ?? true,146284 scope: root.scope,147285 ...(frontmatter.kind === "parsed" && frontmatter.description148286 ? { description: frontmatter.description }149287 : {}),288+ ...(userInvocationOnly ? { userInvocationOnly: true } : {}),
- apps/web/src/components/chat/ChatComposer.tsx lines 1866 to 1866OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1858,4 +1863,4 @@18581863 return;18591864 }18601865 if (item.type === "skill") {1861- const replacement = `$${item.skill.name} `;1866+ const replacement = formatProviderSkillInsertion(item.skill.name, trigger);
- @@ -53,3 +53,4 @@53535454 If the same skill name exists in more than one folder, the later folder wins.555556+A skill you have switched off in Claude Code is left out of both menus.
- apps/web/src/components/chat/ChatComposer.tsx lines 1866 to 1866OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1858,4 +1863,4 @@18581863 return;18591864 }18601865 if (item.type === "skill") {1861- const replacement = `$${item.skill.name} `;1866+ const replacement = formatProviderSkillInsertion(item.skill.name, trigger);
- apps/mobile/src/features/threads/ThreadComposer.tsx line 460OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -432,9 +442,19 @@432442 }433443434- const skillItems = (selectedProviderStatus?.skills ?? [])444+ const providerSkills = selectedProviderStatus?.skills ?? [];445+ // Past the start of the message the pick becomes a `$` mention, so only446+ // skills a mention can reach are worth offering there.447+ const skillItems = (448+ composerTrigger.rangeStart === 0449+ ? providerSkills450+ : providerSkills.filter(isProviderSkillMentionable)451+ )435452 .filter((skill) => matchesSlashSkillQuery(skill, q))436453 .map((skill) => ({437454 id: `skill:${skill.name}`,438455 type: "skill" as const,439456 skill,440- label: `skill:${skill.name}`,457+ label:458+ providerSkillInsertionSigil(composerTrigger) === "/"459+ ? `skill:${skill.name}`460+ : `$${skill.name}`,
- apps/server/src/provider/Drivers/ClaudeSkills.ts lines 322 to 322Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -139,3 +273,4 @@139273 continue;140274 }141275276+ const override = skillOverrides.get(name);apps/server/src/provider/Drivers/ClaudeSkills.ts lines 64 to 64OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -53,3 +61,4 @@5361 kind: "parsed",5462 ...(name ? { name } : {}),5563 ...(description ? { description } : {}),64+ ...(record["disable-model-invocation"] === true ? { userInvocationOnly: true } : {}),
- apps/web/src/components/chat/ComposerCommandMenu.tsx lines 178 to 181OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -172,5 +175,7 @@172175 <span className="min-w-0 max-w-[45%] shrink-0 truncate font-sans text-xs font-medium">173176 {isSlashSkill ? (174177 <>175- <span className="text-secondary-label">/skill:</span>176- {formatProviderSkillDisplayName(isSlashSkill)}178+ <span className="text-secondary-label">179+ {isSlashSkill.insertionSigil === "/" ? "/skill:" : "$"}180+ </span>181+ {formatProviderSkillDisplayName(isSlashSkill.skill)}
- apps/mobile/src/features/threads/ThreadComposer.tsx line 446OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -431,4 +441,6 @@431441 });432442 }433443434- const skillItems = (selectedProviderStatus?.skills ?? [])444+ const providerSkills = (selectedProviderStatus?.skills ?? []).filter(445+ (skill) => skill.enabled,446+ );
- apps/web/src/components/chat/ComposerCommandMenu.tsx lines 179 to 179OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -172,5 +175,5 @@172175 <span className="min-w-0 max-w-[45%] shrink-0 truncate font-sans text-xs font-medium">173176 {isSlashSkill ? (174177 <>175- <span className="text-secondary-label">/skill:</span>176- {formatProviderSkillDisplayName(isSlashSkill)}178+ <span className="text-secondary-label">179+ {isSlashSkill.insertionSigil === "/" ? "/skill:" : "$"}
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.






Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
2b844682-dadc-42ff-b93a-ceb9ece3fc8bYou can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
Comment `@coderabbitai help` to get the list of available commands.