Skip to content

Add provider CLI commands and skills discovery - #1822

Closed
matheus1lva wants to merge 1 commit into
pingdotgg:mainfrom
matheus1lva:claude/add-slash-commands-peu2F
Closed

matheus1lva wants to merge 1 commit into
pingdotgg:mainfrom
matheus1lva:claude/add-slash-commands-peu2F

Conversation

@matheus1lva

@matheus1lva matheus1lva commented Apr 7, 2026 •

Copy link
Copy Markdown

What Changed

Added filesystem discovery for CLI slash commands and skills from Codex and Claude providers. The implementation includes:

  1. New discovery module (providerCommandsDiscovery.ts): Scans user and project directories for markdown-based commands and skills, extracting metadata from frontmatter or content.

  2. New contracts (providerCommands.ts): Schemas for ProviderCommandEntry, ProviderCommandsListInput/Result, and error types.

  3. RPC integration: Added providers.listCommands endpoint to the WebSocket RPC layer and native API.

  4. Web UI updates:

    • New React Query hook (providerCommandsReactQuery.ts) for fetching discovered commands/skills
    • Extended composer trigger detection to recognize $skill syntax alongside /command
    • Updated ComposerCommandMenu to display CLI commands and skills with appropriate icons
    • Integrated discovered commands/skills into the composer autocomplete menu
  5. Composer 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:

  • Built-in slash commands (/model, /plan, /default) with a bot icon
  • Discovered CLI commands with a terminal icon
  • Discovered CLI skills with a sparkles icon
  • Descriptions extracted from markdown frontmatter or first non-empty line
  • Source badges indicating whether commands are from user or project scope

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • Existing tests pass (added unit tests for trigger detection in 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 .~provider directories (plus Codex prompts) for markdown-defined commands/skills, extracts descriptions, dedupes by name with project overriding user, and exposes results via a new providers.listCommands WebSocket RPC with new providerCommands contract 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 $skill trigger 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

  • Adds a discoverProviderCommands Effect in providerCommandsDiscovery.ts that scans ~/.<provider>/ and <cwd>/.<provider>/ directories for .md command files and skill folders, deduplicating by source priority (project > user > builtin).
  • Wires discovery through a new providers.listCommands RPC (WebSocket method, contracts, server handler, and NativeApi passthrough) so the web layer can fetch results via React Query.
  • Extends detectComposerTrigger so any /<token> opens the slash-command menu (except /model) and $<token> opens a new cli-skill menu; the composer fetches and displays discovered commands and skills accordingly.
  • Behavioral Change: /-prefixed tokens no longer require whitelisting — any unknown slash token now triggers the command menu instead of being ignored.

Macroscope summarized 48f1b58.

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
@matheus1lva matheus1lva closed this Apr 7, 2026
@coderabbitai

coderabbitai Bot commented Apr 7, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d995f487-00a3-45f8-aa6b-7de691af60c3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Apr 7, 2026
@matheus1lva
matheus1lva deleted the claude/add-slash-commands-peu2F branch April 7, 2026 20:24

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 48f1b58. Configure here.

@macroscopeapp

macroscopeapp Bot commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants