feat(claude): discover skills for the $ picker via SDK reloadSkills#4325
feat(claude): discover skills for the $ picker via SDK reloadSkills#4325colonelpanic8 wants to merge 4 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Needs human review This PR introduces a new feature for skill discovery via the Claude SDK's You can customize Macroscope's approvability policy. Learn more. |
5c7932e to
138250a
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 138250a. Configure here.
1339974 to
f44f73b
Compare
The Claude provider snapshot never populated `skills`, so Claude-provider skills were absent from T3 Code's `$` skill picker (only Codex populated them). Probe the SDK's `reloadSkills` control request after initialization and map the returned entries into `ServerProviderSkill`s. The new pure `parseClaudeReloadedSkills` mapper strips the trailing scope suffix reloadSkills appends to descriptions (e.g. " (user)") and maps it to a scope (user; project/local -> project; builtin/bundled/system -> system; others verbatim). Paths are resolved best-effort against the workspace `.claude/skills/<name>` (project) then the config dir `skills/<name>` (user), falling back to a constructed config-dir path since the contract requires a non-empty path; plugin-qualified names skip the filesystem probe. The control request is bounded by its own timeout and failures fall back to an empty list so older CLIs never fail the capability probe. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
f44f73b to
aac809e
Compare
|
Superseded by the maintainer implementation in #4414, which is now merged. Closing this independent implementation in favor of the upstream-selected approach. |

What Changed
reloadSkillscontrol request afterinitializationResult()and maps the returned entries intoServerProviderSkills, populatingskillson the provider snapshot.parseClaudeReloadedSkills(apps/server/src/provider/Layers/ClaudeSkillDiscovery.ts):reloadSkillsappends to descriptions (e.g.(user)) and maps it to a snapshot scope (user;project/local→project;builtin/bundled/system→system);.claude/skills/<name>, then the effective Claude config dir'sskills/<name>, falling back to a constructed config-dir path (the contract requires a non-emptypath); plugin-qualified names skip the filesystem probe;reload_skillsnever fail the capability probe./commands for Claude, matching upstream CLI behavior.Why
Only the Codex provider populated
skills, so the composer's$skill picker was always empty on Claude threads even though the Claude CLI discovers the same~/.claude/skills/.claude/skillsentries (refs #1480, #2736). With this change Claude skills get the same$autocomplete, inline pill rendering, and scope labels (Personal/Project/System) that Codex skills already have.Checklist
vp test run ClaudeSkillDiscovery.test.ts ClaudeCapabilitiesProbe.test.ts ProviderRegistry.test.ts→ 3 files, 53 tests passed (plusClaudeAdapter.test.tsregression guard → 60 passed)tsgo --noEmitinapps/server→ 0 errorsvp linton changed files,vp fmt→ clean🤖 Generated with Claude Code
Note
Medium Risk
Touches provider health probing and filesystem path resolution for user config; skill reload is isolated with timeouts so auth/command discovery should remain stable, but probe timing and path edge cases could affect the picker on some setups.
Overview
Claude skills now populate the provider snapshot so the composer
$picker can list them like Codex already does.After a successful SDK initialization,
probeClaudeCapabilitiesissues a best-effortreloadSkillscall with its own timeout; failures yield an empty skill list but no longer fail the whole probe. Account info and slash commands are unchanged.New
parseClaudeReloadedSkillsmaps SDK entries toServerProviderSkill: strips description scope suffixes (e.g.(user)), resolves paths under workspace.claude/skillsor the effective config dir (withCLAUDE_CONFIG_DIR/HOME/USERPROFILEhandling), and dedupes by name.checkClaudeProviderStatusthreadsskillsinto every built snapshot.Reviewed by Cursor Bugbot for commit aac809e. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Discover Claude skills for the $ picker via SDK
reloadSkillsprobeClaudeCapabilitiesissues areloadSkillsrequest to the Claude SDK subprocess and parses the response intoServerProviderSkillobjects via the newparseClaudeReloadedSkillsutility inClaudeSkillDiscovery.ts.<cwd>/.claude/skills/<name>then<configDir>/skills/<name>; scope is normalized from description suffix tokens or inferred from the resolved path.CLAUDE_CONFIG_DIR(with tilde expansion) or defaults to<home>/.claude, using a newresolveClaudeEnvironmentHomePathhelper that prefersHOMEoverUSERPROFILE.undefined.skillsarray is threaded throughcheckClaudeProviderStatusand included in the provider snapshot (empty when capabilities are absent).Macroscope summarized aac809e.