Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(grok): surface Grok skills in the composer $ picker #7587

ClosedmInrOz(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/7587/headopened View on GitHub

Fixes #4109. Related: #4414 (the merged Claude equivalent), #4630 (skill manager), and #5131 / #5503 / #5960 (earlier attempts, see disposition). Decision date: 2026-08-19.

Outcome

The Grok provider snapshot now carries the CLI's skill catalog, so the composer $ picker lists Grok skills on web, desktop, and mobile. The provider check runs grok inspect --json next to the existing grok --version probe and maps the reported skills[] onto ServerProviderSkill.

This PR does not change: slash commands (the / picker), the ACP runtime, the Claude or Codex skill paths, any contract schema, or any client code. The pickers render the new data through the existing provider-agnostic path.

Before and after

Failure mode beforeMechanism after
checkGrokProviderStatus never set skills, so every Grok snapshot defaulted to [] and the $ picker showed "No skills found" even with a full skill directory on disk.The provider check asks the CLI for its resolved catalog and attaches it to the post-version snapshot branches.
The obvious fix, a Claude-style flat disk scan, cannot see plugin skills (three levels deep under ~/.grok/installed-plugins/) and ignores Grok's own ignore/disable config. On the machine that produced this PR, a flat scan misses 44 of 75 installed skills.grok inspect --json returns the catalog Grok itself resolved: user, project, bundled, and plugin skills, each with its SKILL.md path, description, and userInvocable flag.

Decisions taken

  • Ask the CLI, do not scan the disk. House precedent: Claude scans disk only because its handshake omits paths (see the ClaudeSkills.ts module doc); Codex asks the app-server over skills/list. Grok exposes paths through inspect, so asking is the smaller and more correct mechanism.
  • Discovery is best-effort. An older CLI without inspect, a non-zero exit, a 4 s timeout, or malformed JSON yields [] with a debug log. Skill discovery can never degrade the provider probe.
  • userInvocable: false maps to enabled: false, not to omission. The pickers already filter on enabled; the snapshot stays a faithful record of the catalog.
  • Skills attach to the three post-version branches (ACP discovery failed, ACP timeout, ready), matching how much of the probe succeeded. The disabled and not-installed branches stay empty.
  • No shared code moves. No ClaudeSkills.ts extraction, no AcpSessionRuntime change, no new dependency, no driver signature change (ChildProcessSpawner was already in the probe's requirements).

Disposition of the earlier attempts

  • #5131 (ACP availableCommands): right instinct, but it couples OpenCode into the change and patches the shared AcpSessionRuntime. inspect yields the same paths without touching shared code.
  • #5503: maps every advertised slash command to a skill with a synthetic acp:// path, so built-ins like /compact would appear as skills. Wrong data.
  • #5960 (disk scan): asserts four unverified scan roots and misses plugin skills entirely.

Verification

Ran on Linux, Node v26.7.0, pnpm 11.10.0, grok 1.0.5:

  • vp test run src/provider/Drivers/GrokSkills.test.ts — 4 passed (field mapping and sort, disabled skills, invalid entries skipped, malformed output).
  • vp test run src/provider/Layers/GrokProvider.test.ts src/provider/Layers/GrokAdapter.test.ts — 27 passed.
  • tsgo --noEmit in apps/server — no errors in changed files (pre-existing suggestions in unrelated files only).
  • Real-CLI check: grok inspect --json (grok 1.0.5) returned 75 skills in ~60 ms; the fields map one-to-one onto ServerProviderSkill.

Not run: the full monorepo suite (CI owns it) and an in-app screenshot of the populated $ picker (needs a live instance; I can add one on request).

Rollout and rollback

Server-side only, ships with the next build. No schema change, no migration, no durable state. Rollback is the previous build; a snapshot produced by this build renders fine on old clients because the skills field and its wire schema already exist.

Built with Claude Code (Claude Fable 5).

🤖 Generated with Claude Code


Note

Low Risk Server-only, additive probe after existing version check; discovery failures degrade to empty skills without changing probe outcomes.

Overview Grok provider snapshots now include skills from grok inspect --json, so the existing composer $ picker can list Grok skills without client or contract changes.

New GrokSkills module runs a best-effort probe (4s timeout, optional server cwd) after the version check succeeds. JSON is mapped to ServerProviderSkill (scope, path, description; userInvocable: false → enabled: false). Failures return [] and only debug logs—probe status is unchanged.

checkGrokProviderStatus accepts cwd; GrokDriver passes ServerConfig.cwd. Discovered skills are attached on the post-version paths (ACP error, timeout, and ready), not when Grok is disabled or the CLI is missing.

Unit tests cover parsing edge cases and that inspect runs in the configured working directory.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit c4574ba4eeb39de180a9657b641da49375d35134. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Surface Grok skills in the composer $ picker via CLI discovery

  • Adds discoverGrokSkills in GrokSkills.ts, which spawns grok inspect --json with a 4s timeout and returns a best-effort list of skills, returning empty on any failure.
  • Adds parseGrokInspectSkills to map CLI output to ServerProviderSkill objects, filtering out malformed/unnamed entries, disabling non-invocable skills, deduplicating by name, and sorting alphabetically.
  • Extends checkGrokProviderStatus in GrokProvider.ts to accept an optional cwd and populate the provider snapshot with discovered skills across all return paths (success, ACP failure, timeout).
Macroscope summarized c4574ba.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      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 Plus

      Run ID: 73816e2c-615f-4088-b9bf-2f203daee88f

      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

      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.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. Cursor Bugbot has reviewed your changes using high effort 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](https://www.cursor.com/dashboard/bugbot).

      Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 1f28c7963d952204b7cfe760820778e2aa4b5a37. Configure [here](https://www.cursor.com/dashboard/bugbot).
    4. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Not approved

      Macroscope's review found this PR not approvable — This PR introduces a new feature that surfaces Grok skills in the composer $ picker via a new CLI integration (grok inspect --json). New features with user-facing behavior changes and external integrations warrant human review.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. Bugbot's finding is half right; fixed the real half in 363c9472f.

      Fixed: the inspect spawn inherited the server process cwd and ignored ServerConfig.cwd — the directory the merged Claude skill scan already uses (ClaudeDriver.ts reads it and passes it to checkClaudeProviderStatus). The Grok driver now passes the same cwd through checkGrokProviderStatus to the grok inspect --json spawn. A regression test asserts the spawn receives it.

      Not fixed, by design: "the thread workspace" is not knowable here. Provider snapshots are computed per instance, with no thread context — the merged Claude implementation (#4414) has the same property, and the $ picker reads the same per-instance snapshot for every provider. Per-thread skill catalogs would be a snapshot-model change, out of scope for this PR.

    6. Note

      🤖 GPT-5.6 Sol responding on behalf of Theo

      I am closing this because #8358 has landed in main and covers the same Grok skill-discovery behavior. I checked the current implementation and did not find any remaining change from this PR that we still need to merge.

      Thank you for putting this together. The closure is only because the work is now covered elsewhere, not because there was a problem with your contribution.

Sign in to join this conversation.