fix: Claude Code skills discoverable for the composer $ picker #4414
Mergedt3dotgg(GitHub profile, opens in a new tab)merged 5 commits into
main fromrefs/pull/4414/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- apps/server/src/provider/Drivers/ClaudeSkills.ts line 84Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -0,0 +47,21 @@47+ const name = typeof record.name === "string" ? record.name.trim() : "";48+ const description = typeof record.description === "string" ? record.description.trim() : "";49+ return {50+ ...(name ? { name } : {}),51+ ...(description ? { description } : {}),52+ };53+}54+55+/**56+ * Resolve the Claude config directory the CLI would use: the instance's57+ * `homePath` (`CLAUDE_CONFIG_DIR`) when set, otherwise `~/.claude`.58+ */59+const resolveClaudeConfigDirPath = Effect.fn("resolveClaudeConfigDirPath")(function* (60+ config: Pick<ClaudeSettings, "homePath">,61+): Effect.fn.Return<string, never, Path.Path> {62+ const path = yield* Path.Path;63+ const homePath = config.homePath.trim();64+ return homePath.length > 065+ ? path.resolve(expandHomePath(homePath))66+ : path.join(NodeOS.homedir(), ".claude");67+});
t3dotgg(GitHub profile, opens in a new tab) changed the title
- apps/server/src/provider/Drivers/ClaudeSkills.ts lines 27 to 53OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -0,0 +33,21 @@33+ return {};34+ }35+36+ let parsed: unknown;37+ try {38+ parsed = parseYamlDocument(match[1] ?? "");39+ } catch {40+ return {};41+ }42+ if (typeof parsed !== "object" || parsed === null) {43+ return {};44+ }45+46+ const record = parsed as Record<string, unknown>;47+ const name = typeof record.name === "string" ? record.name.trim() : "";48+ const description = typeof record.description === "string" ? record.description.trim() : "";49+ return {50+ ...(name ? { name } : {}),51+ ...(description ? { description } : {}),52+ };53+}
- apps/server/src/provider/Drivers/ClaudeSkills.ts line 75OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -0,0 +55,21 @@55+ };56+}57+58+/**59+ * Resolve the Claude config directory the CLI would use, matching the60+ * precedence the spawned CLI sees: the instance's `homePath` (exported as61+ * `CLAUDE_CONFIG_DIR` by `makeClaudeEnvironment`), then a `CLAUDE_CONFIG_DIR`62+ * already present in the process environment, then `~/.claude`.63+ */64+const resolveClaudeConfigDirPath = Effect.fn("resolveClaudeConfigDirPath")(function* (65+ config: Pick<ClaudeSettings, "homePath">,66+ environment: NodeJS.ProcessEnv,67+): Effect.fn.Return<string, never, Path.Path> {68+ const path = yield* Path.Path;69+ const homePath = config.homePath.trim();70+ if (homePath.length > 0) {71+ return path.resolve(expandHomePath(homePath));72+ }73+ const environmentConfigDir = environment.CLAUDE_CONFIG_DIR?.trim() ?? "";74+ if (environmentConfigDir.length > 0) {75+ return path.resolve(expandHomePath(environmentConfigDir));
- apps/server/src/provider/Drivers/ClaudeSkills.ts lines 78 to 79OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +59,21 @@59+ * Resolve the Claude config directory the CLI would use, matching the60+ * precedence the spawned CLI sees: the instance's `homePath` (exported as61+ * `CLAUDE_CONFIG_DIR` by `makeClaudeEnvironment`), then a `CLAUDE_CONFIG_DIR`62+ * already present in the process environment, then `~/.claude`.63+ */64+const resolveClaudeConfigDirPath = Effect.fn("resolveClaudeConfigDirPath")(function* (65+ config: Pick<ClaudeSettings, "homePath">,66+ environment: NodeJS.ProcessEnv,67+): Effect.fn.Return<string, never, Path.Path> {68+ const path = yield* Path.Path;69+ const homePath = config.homePath.trim();70+ if (homePath.length > 0) {71+ return path.resolve(expandHomePath(homePath));72+ }73+ // No tilde expansion here: the spawned CLI receives this env var verbatim74+ // (env vars are never shell-expanded), so a literal `~` must stay literal75+ // for discovery to scan the same directory the runtime would.76+ const environmentConfigDir = environment.CLAUDE_CONFIG_DIR?.trim() ?? "";77+ if (environmentConfigDir.length > 0) {78+ return path.resolve(environmentConfigDir);79+ }
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.


📝 Walkthrough
Walkthrough#
Claude provider checks now discover skills from user and project filesystem roots, parse their metadata, resolve collisions, and include the results in provider drafts. Filesystem access and the YAML parser dependency are wired into the relevant effects.
Changes#
Claude Skills Provider Flow
apps/server/src/provider/Drivers/ClaudeSkills.ts,apps/server/src/provider/Drivers/ClaudeSkills.test.ts,apps/server/package.jsonapps/server/src/provider/Drivers/ClaudeDriver.tsapps/server/src/provider/Layers/ClaudeProvider.tsEstimated code review effort: 3 (Moderate) | ~20 minutes
Sequence Diagram(s)#
Suggested reviewers:
juliusmarmingePoem
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)#
✅ Passed checks (4 passed)
✨ Finishing Touches
📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment `@coderabbitai help` to get the list of available commands.