Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(providers): discover workspace skills everywhere #9180

Mergedmaria-rcksmerged 1 commit intomain fromrefs/pull/9180/headmerged by maria-rcks View on GitHub

maria-rckscommented

PR #8778 added cwd-aware skill discovery for Codex and OpenCode, and current main now covers Claude. This closes the remaining gaps: Cursor discovers project skills and translates selected $skill mentions to native /skill invocations, Grok probes its catalog in the project cwd, and mobile requests and resolves workspace snapshots.

beforeafter
Cursor project skill missing beforeCursor project skill discovered after

Verified with 71 focused provider/client/mobile tests, targeted lint and formatting, and server/mobile typechecks.

Built with gpt-5.6-sol through the Codex harness.


Note

Medium Risk Adds filesystem scans and CLI probes on provider refresh plus prompt rewriting in Cursor ACP; probe failures can block workspace snapshot caching until retry succeeds.

Overview Closes workspace-aware skill gaps for Cursor and Grok and wires mobile/web composers to cwd-specific catalogs instead of machine-level provider skills.

Server: Cursor gets filesystem discovery of SKILL.md under standard skill roots (with scan budgets and frontmatter parsing), exposed via snapshotForCwd and used at send time to rewrite composer $skill mentions into Cursor’s /skill form. Grok’s grok inspect --json probe now fails explicitly on spawn/timeout/exit/decode errors so workspace snapshots are not cached as empty; machine-level Grok status still falls back to an empty list.

Clients: useComposerCommandMenu (and web ChatComposer) resolve skills with resolveProviderSkillsForCwd, export skills to editors, and call refreshProviders for the active cwd when no matching workspace snapshot exists, with a 10s retry cooldown. Thread detail passes thread cwd into the composer and feed skill lists.

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

Note

Add workspace-aware skill discovery for Cursor and Grok providers

  • Mobile composers (NewTaskDraftScreen.tsx, ThreadComposer.tsx, ThreadDetailScreen.tsx) now source skills from the useComposerCommandMenu hook, which resolves provider skills against the active thread cwd and requests a provider refresh when no matching workspace snapshot exists.
  • CursorDriver and GrokDriver gain workspace-specific snapshot functions that run skill discovery in the requested cwd when the instance is enabled; disabled instances reuse the machine snapshot.
  • CursorSkills.ts adds recursive SKILL.md scanning with depth, entry, and byte budgets, frontmatter metadata parsing, project-over-user dedup across four root conventions, and typed CursorSkillsProbeError for incomplete scans.
  • CursorAdapter now caches per-session discovered skill names and rewrites known dollar-prefixed mentions into Cursor slash invocations before sending to ACP.
  • GrokSkills.ts changes discovery to a typed effect that fails explicitly on spawn, timeout, non-zero-exit, and decode errors; GrokProvider recovers these at the machine status boundary.
  • Behavioral Change: discoverGrokSkills now fails instead of returning an empty list on probe errors; callers that expected empty-list fallbacks are updated but out-of-tree consumers may break. Strict probeCursorSkills fails when scan budgets are exhausted.
Macroscope summarized ee69cf3.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. apps/server/src/provider/Drivers/CursorSkills.ts line 21OutdatedResolvedby maria-rcks
    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Not approved

      Macroscope's review found this PR not approvable — This change adds workspace skill discovery, provider-specific CLI/filesystem probing, and Cursor prompt rewriting across server, mobile, and web paths. Its broad new runtime behavior and multi-layer integration exceed the low-risk, self-contained change criteria.

      Not approved because:

      • Monthly spending limit reached (workspace setting). Approvability relies on correctness review in order to determine eligibility
      Review your spending limits in [Billing settings](https://app.macroscope.com/pingdotgg/settings/billing). You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. apps/server/src/provider/Layers/CursorAdapter.ts line 996OutdatedResolvedby maria-rcks
    5. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium Layers/ProviderRegistry.ts:113

      hasFreshWorkspaceSnapshot considers a snapshot with a future checkedAt fresh, so a backward wall-clock adjustment suppresses workspace probing until the clock advances past that timestamp plus 60 seconds. This can leave the catalog's skills stale; require the timestamp to be no later than nowMs before applying the TTL.

          onSome: (checkedAt) => nowMs >= DateTime.toEpochMillis(checkedAt) && nowMs - DateTime.toEpochMillis(checkedAt) < WORKSPACE_SNAPSHOT_TTL_MS,
      🤖 Copy this AI Prompt to have your agent fix this:
      In file @apps/server/src/provider/Layers/ProviderRegistry.ts around line 113:
      
      `hasFreshWorkspaceSnapshot` considers a snapshot with a future `checkedAt` fresh, so a backward wall-clock adjustment suppresses workspace probing until the clock advances past that timestamp plus 60 seconds. This can leave the catalog's skills stale; require the timestamp to be no later than `nowMs` before applying the TTL.
    6. Note

      Written by gpt-5.6-sol on behalf of Maria

      addressed in a4760d44f. a workspace timestamp is fresh only when it is no later than the current clock and remains inside the 60-second ttl. the existing ttl test now covers a backward clock adjustment.

    7. apps/server/src/provider/Drivers/ClaudeSkills.ts line 384OutdatedResolvedby maria-rcks
    8. Thank you @maria-rcks! I have been waiting for this for ages, hopefully this can get it asap!

    9. Thanks a ton for this @maria-rcks. This was a constant paper cut for me!

    10. apps/web/src/components/chat/ChatComposer.tsx line 1184OutdatedResolvedby maria-rcks
    11. apps/server/src/provider/Drivers/CursorSkills.ts line 170OutdatedResolvedby maria-rcks
    12. apps/server/src/provider/Drivers/CursorSkills.ts line 216OutdatedResolvedby maria-rcks
    13. 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). Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit ee69cf347ff6f71d69aaa106d0a4b2d1b33a2353. Configure [here](https://www.cursor.com/dashboard/bugbot).
    14. maria-rcks merged this15fea6c

    15. maria-rcks closed this

Sign in to join this conversation.