Add provider CLI commands and skills discovery - #1822
matheus1lva wants to merge 1 commit into
Conversation
The composer slash menu was hard-coded to /model, /plan, and /default. Add a provider command discovery layer that scans the user/project .codex and .claude directories for custom commands (and prompts on Codex) plus skills, then surface those in the existing autocomplete menu. Typing "/" still includes the built-in commands but now also lists any commands shipped by the active CLI; typing "$" triggers a new menu populated with the active provider's discovered skills. - contracts: add ProviderCommandsList* schemas + RPC + IPC entry - server: discoverProviderCommands scans well-known directories with project entries shadowing user entries, wired through ws.ts - web: providerCommandsReactQuery hook + new cli-command/cli-skill item types in ComposerCommandMenu, with ChatView fetching and rendering them - composer-logic: detect "$" triggers and accept arbitrary "/word" tokens so CLI commands surface alongside built-ins
|
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 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 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes 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 48f1b58. Configure here.
| setComposerHighlightedItemId(null); | ||
| } | ||
| return; | ||
| } |
There was a problem hiding this comment.
Loading state ignores provider commands fetch status
Low Severity
isComposerMenuLoading only considers the "path" trigger kind, completely ignoring the fetching state of providerCommandsQuery. When a $skill trigger is activated for the first time (no cached data), the menu displays "No matching skill." instead of "Searching..." while the query is in-flight. This is especially noticeable for the cli-skill trigger since it has no built-in fallback items to fill the menu during loading.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 48f1b58. Configure here.
ApprovabilityVerdict: Needs human review This PR introduces a new feature for discovering and autocompleting provider CLI commands and skills from the filesystem. It adds new server-side discovery logic, API contracts, and UI integrations across multiple packages - the scope of new capabilities warrants human review. You can customize Macroscope's approvability policy. Learn more. |


What Changed
Added filesystem discovery for CLI slash commands and skills from Codex and Claude providers. The implementation includes:
New discovery module (
providerCommandsDiscovery.ts): Scans user and project directories for markdown-based commands and skills, extracting metadata from frontmatter or content.New contracts (
providerCommands.ts): Schemas forProviderCommandEntry,ProviderCommandsListInput/Result, and error types.RPC integration: Added
providers.listCommandsendpoint to the WebSocket RPC layer and native API.Web UI updates:
providerCommandsReactQuery.ts) for fetching discovered commands/skills$skillsyntax alongside/commandComposerCommandMenuto display CLI commands and skills with appropriate iconsComposer logic: Extended to detect and handle both
/command(CLI commands) and$skill(CLI skills) triggers, with proper filtering and insertion.Why
This enables the web composer to surface CLI commands and skills that users have defined locally (in
~/.codex/commands,~/.claude/commands, etc.) or at the project level (./.codex/commands,./.claude/commands, etc.), providing a seamless autocomplete experience similar to the native CLI tools. Project-scoped commands take precedence over user-scoped ones with the same name.UI Changes
The composer now shows:
/model,/plan,/default) with a bot iconChecklist
composer-logic.test.ts)https://claude.ai/code/session_018bAJtpkRpiSfFmnmdASfvV
Note
Medium Risk
Adds a new filesystem-scanning RPC that reads user/project directories and wires results into the chat composer autocomplete; risk is moderate due to new IO paths and query-triggered UI behavior, but scope is contained and errors are wrapped.
Overview
Adds end-to-end discovery and autocomplete for provider CLI commands and skills.
The server now scans user and project
.~providerdirectories (plus Codexprompts) for markdown-defined commands/skills, extracts descriptions, dedupes by name with project overriding user, and exposes results via a newproviders.listCommandsWebSocket RPC with newproviderCommandscontract schemas.The web app queries this RPC (React Query) and extends the composer to suggest and insert discovered
/${command}items alongside built-ins, and adds$skilltrigger detection and menu rendering (new item types, icons, filtering, and insertion behavior), with updated unit tests for trigger parsing.Reviewed by Cursor Bugbot for commit 48f1b58. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add provider CLI commands and skills discovery to the composer menu
discoverProviderCommandsEffect in providerCommandsDiscovery.ts that scans~/.<provider>/and<cwd>/.<provider>/directories for.mdcommand files and skill folders, deduplicating by source priority (project > user > builtin).providers.listCommandsRPC (WebSocket method, contracts, server handler, andNativeApipassthrough) so the web layer can fetch results via React Query.detectComposerTriggerso any/<token>opens the slash-command menu (except/model) and$<token>opens a newcli-skillmenu; the composer fetches and displays discovered commands and skills accordingly./-prefixed tokens no longer require whitelisting — any unknown slash token now triggers the command menu instead of being ignored.Macroscope summarized 48f1b58.