fix(cursor): cursor skills discovery
What Changed
Cursor skills now show up in the $ picker, scoped to the project or worktree where the thread actually runs.
- Server: a new
CursorSkillsscanner reads.cursor/skillsand.agents/skillsat user and project scope for a given working directory, applying Cursor's precedence and naming rules (directory name wins over frontmattername,.cursorbeats.agents, and project beats user). Discovery is bounded and best-effort, rejects roots and symlinks that escape their canonical boundaries, reads at most 64 KiB of metadata perSKILL.md, and never sends skill bodies over the wire. - Contracts / RPC:
providers.skillInventorytakes a thread or project id—never a raw path—andServerProvideroptionally advertisesskillInventoryMode: "project"; absence means snapshot mode.ProviderSkillInventoryresolves the id to a cwd with the same helper provider sessions use, so a worktree thread lists that worktree's skills. - Clients: web and mobile composer and message surfaces request thread-scoped inventories for durable threads and project-scoped inventories for local drafts, only for project-mode providers. Codex, Claude, and other snapshot-mode providers retain the existing zero-round-trip path.
- Docs: a skill-inventory section in
docs/internals/providers.mddocuments inventory modes, cwd resolution, typed request failures, best-effort discovery, canonical containment, and traversal budgets.
Why
This addresses the Cursor portion of pingdotgg/t3code#2736, which reports that Cursor and OpenCode skills exist on disk but remain absent from T3 Code's provider inventory. OpenCode discovery remains outside this PR's scope.
The $ picker rendered ServerProvider.skills, an environment-wide snapshot computed once from wherever the server started. That is wrong for every project but one, and empty for Cursor: its ACP surface only exposes slash-command metadata mixed with built-ins, with no paths and no scope, so there was nothing reliable to snapshot.
Cursor's inventory depends on the directory where the agent will run, so the lookup must be per thread or project rather than per environment. Passing an id instead of a path, together with canonical containment of skill roots and symlinks, keeps the picker from becoming a filesystem probe.
UI Changes
The $ picker with Cursor selected: empty before, populated with the project's skills after.
Before
After
https://github.com/user-attachments/assets/7b6a84f1-9546-44d0-b485-a6efbe32ba3d
Checklist
- [ ] This PR is small (is not, sorry about that)
- [x] This PR is focused
- [x] I explained what changed and why
- [x] I included before/after screenshots for any UI changes
- [x] I included a video for animation/interaction changes
[!NOTE] Medium Risk Introduces a new read-scoped RPC that performs filesystem discovery on the server; scope is id-based and traversal is bounded, but worktree/cwd resolution bugs could show the wrong skill set for a thread.
Overview Cursor’s
$picker now loads skills from the workspace the agent will actually use, instead of the empty or environment-wideServerProvider.skillssnapshot.On the server, Cursor gets a
skillInventorycapability backed bydiscoverCursorSkills, which scans the eight user/project roots (.claude,.codex,.agents,.cursor), merges by Cursor’s precedence rules, and returns bounded metadata only. Providers that expose this capability publishskillInventoryMode: "project"on snapshots. A newproviders.skillInventoryRPC accepts a thread or project id (not a path), resolves cwd viagetThreadWorkspaceContextByIdand the same worktree logic as provider sessions, then lists skills or falls back to snapshot skills for other drivers.Web and mobile share
useProviderSkills/ client-runtime helpers: project-mode providers fetch inventory once per environment+scope+instance; snapshot providers keep zero extra round trips. Composers, timelines, and message rendering consume the resolved list rather thanselectedProviderStatus?.skills.Reviewed by Cursor Bugbot for commit 66a1ecd799b77f994cc40ba3ce794b0eccb88f7b. Bugbot is set up for automated code reviews on this repo. Configure here.
[!NOTE]
Add Cursor skill discovery and per-scope provider skill inventory RPC
- Adds
discoverCursorSkillsin CursorSkills.ts to scan eight filesystem roots (user and project, across.claude,.codex,.agents,.cursor) in precedence order, merging results by skill name with bounded traversal and cycle detection.- Introduces
ProviderSkillInventoryas an optionalProviderInstancecapability; providers implementing it exposeskillInventory.list(cwd)and haveskillInventoryMode: "project"added to their snapshots bybuildSnapshotSource.- Adds a
providers.skillInventoryWebSocket RPC (withAuthOrchestrationReadScope) backed byresolveProviderSkillInventory, which resolves project or thread scope to a concrete working directory viagetThreadWorkspaceContextByIdbefore calling the provider capability.- Adds
useProviderSkillshooks on web and mobile that transparently select between snapshot skills and server-fetched inventories based onskillInventoryMode.- Behavioral Change:
ChatComposerandThreadComposernow require callers to pass provider skills explicitly;ChatComposergains a requiredactiveProjectIdprop.Macroscope summarized 66a1ecd.
📝 Walkthrough
Walkthrough
Provider skill handling now supports project- and thread-scoped inventories. The change adds contracts, Cursor discovery, workspace resolution, RPC access, cached client state, and web/mobile integration.
Changes
Provider skill inventory
| Layer / File(s) | Summary |
|---|---|
Inventory contracts and shared state packages/contracts/src/server.ts, packages/contracts/src/rpc.ts, packages/client-runtime/src/state/providerSkillInventory.ts, packages/client-runtime/src/state/server.ts |
Defines inventory modes, scopes, results, typed failures, provider capabilities, target resolution, skill selection, and cached RPC queries. |
Workspace context and inventory resolution apps/server/src/orchestration/Services/ProjectionSnapshotQuery.ts, apps/server/src/orchestration/Layers/ProjectionSnapshotQuery.ts, apps/server/src/provider/ProviderSkillInventory.ts, apps/server/src/.../*test.ts |
Resolves project and thread workspaces, including archived threads and deleted projects, then maps inventory failures to typed errors. |
Cursor skill discovery apps/server/src/provider/Drivers/CursorSkills.ts, apps/server/src/provider/Drivers/CursorDriver.ts, apps/server/src/provider/Layers/ProviderRegistry.ts, apps/server/src/provider/Drivers/CursorSkills.test.ts |
Discovers Cursor skills across user and project roots with metadata parsing, precedence, symlink containment, traversal limits, and deterministic sorting. |
Inventory RPC integration apps/server/src/ws.ts, apps/server/src/auth/RpcAuthorization.ts, apps/server/src/server.test.ts |
Adds the authorized providersSkillInventory RPC and supplies provider-instance and workspace-query services. |
Web and mobile skill consumption apps/web/src/components/..., apps/web/src/state/queries.ts, apps/web/src/composer-logic.ts, apps/mobile/src/features/threads/..., apps/mobile/src/state/queries.ts |
Uses resolved skills in timelines, command menus, and editors. Composer loading now reflects pending skill inventory requests. |
Estimated code review effort: 5 (Critical) | ~120 minutes
Merge Risk: 🔵 Low · up to 43055
The PR adds project- and thread-scoped filesystem skill discovery, but the mobile picker can appear empty during its initial inventory load, and the new authenticated lookup does not clearly define resource ownership or revocation for retained worktrees. The change is mergeable with explicit owner awareness and follow-up on these bounded issues.
Sequence Diagram(s)
sequenceDiagram
participant ChatComposer
participant useProviderSkills
participant providersSkillInventory
participant resolveProviderSkillInventory
ChatComposer->>useProviderSkills: Request skills for active scope
useProviderSkills->>providersSkillInventory: Send scope and instanceId
providersSkillInventory->>resolveProviderSkillInventory: Resolve workspace and inventory
resolveProviderSkillInventory-->>providersSkillInventory: Return skills
providersSkillInventory-->>useProviderSkills: Return skill result
useProviderSkills-->>ChatComposer: Provide selected skills
Suggested reviewers: juliusmarminge, t3dotgg
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | ⚠️ Warning | Docstring coverage is 47.37% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 19 functions across 35 files. (2 skipped: 2 unsupported.) | Write docstrings for the functions missing them to satisfy the coverage threshold. |
✅ Passed checks (4 passed)
| Check name | Status | Explanation |
|---|---|---|
| Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Title check | ✅ Passed | The title clearly identifies the primary change: Cursor skill discovery. |
| Description check | ✅ Passed | The description explains the changes and rationale, documents UI impact, and includes the required checklist and visual evidence. |
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
- [ ] Create stacked PR
- [ ] Commit on current branch
🧪 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.
Comment @coderabbitai help to get the list of available commands.
Approvability
Verdict: Not approved
Macroscope's review found this PR not approvable — This PR introduces a new feature for Cursor skills discovery, adding ~2600 lines including a new RPC endpoint, filesystem scanning logic, new contracts, and client-side query hooks. New features with significant user-facing behavior changes warrant human review.
You can add or adjust custom eligibility rules. Learn more.
This would help a lot — Cursor provider currently shows no skills in the picker. Hoping this can land.
@t3dotgg @juliusmarminge Can we please get this out, Not using t3code because of this at the moment
@coderabbitai full review
Full review finished.✅ Action performed
[!NOTE] 🤖 GPT-5.6 Sol responding on behalf of Theo
Closing this PR after an automated pass over open pull requests. Empty-description Cursor skill proposal changes 39 files. Smaller alternative: #7764.