Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix: the $ skill picker now lists the active project's skills #6450

ClosedBrechard(GitHub profile, opens in a new tab)wants to merge 5 commits intomain fromrefs/pull/6450/headopened View on GitHub

Fixes #6449

The problem

Skills were discovered once from ServerConfig.cwd — the server's single startup directory — so the $ picker showed whatever repo the server happened to launch next to. With more than one project open that meant another project's skills, or none at all, and a project skill never won a name collision against a same-named user skill.

Discovery was also silent about failures, which made a wrongly-scoped path look identical to "this project has no skills".

The fix

Add a workspace-scoped server.listWorkspaceSkills RPC that carries the workspace in the request.

ProviderRegistry depends only on ServerConfig and ProviderInstanceRegistry, so it cannot resolve which project a client is looking at. The clients already compute that path — the thread's worktree, else the project root — so they send it:

  • Claude rescans <cwd>/.claude/skills alongside the user config dir, keeping the existing project-over-user precedence.
  • Codex asks its app-server skills/list for that cwd.
  • Drivers with no skill surface resolve to an empty list.

Both answers go through a 30s cache keyed by (instanceId, cwd), so opening the picker does not respawn a Codex app-server on every keystroke.

On the client, the query lives in ChatComposer and is keyed on the instance the composer actually has selected, which can differ from the thread's provider. ChatView keeps its own query for transcript $skill highlighting, keyed on the thread's provider — the right key for already-sent messages.

"No skills here" vs "could not look"

Discovery distinguishes the two, because collapsing them breaks the fallback below. listWorkspaceSkills returns ReadonlyArray<ServerProviderSkill> | undefined:

  • A list — including an empty one — is an answer. An empty list legitimately means the workspace has no skills, and the picker shows its empty state.
  • undefined means discovery could not run: a Codex spawn failure, an unauthenticated CLI, a timeout, or a driver defect. The result key is then omitted from the response and the client keeps the snapshot.

Unknowns are never cached: an undefined invalidates its own cache entry, so the next picker open retries rather than serving the failure for the full TTL.

Claude keeps returning a list. It has no all-or-nothing failure mode — a missing <cwd>/.claude/skills is the normal state for most projects, and the snapshot it would fall back to comes from the same scan function with a different cwd, so reporting unknown there would resurrect another directory's skills rather than protect anything.

Compatibility

Purely additive. ServerProvider.skills is unchanged and remains the fallback while the query is in flight, when discovery could not run, and on a server that predates the method — so the picker never shows less than it did before, and never flickers empty. No new union literals, no removed or altered fields, no migration.

Failure handling

Discovery stays best-effort but no longer silent: an unreadable skill root, an unreadable SKILL.md, and malformed frontmatter now log instead of vanishing into an empty picker.

Testing

Covers workspace-scoped discovery, project-over-user precedence on a name collision, an unreadable workspace degrading to user-scope skills rather than erroring, the cache's per-(instance, cwd) keying, and the empty-vs-unknown distinction end to end — a failed lookup reporting unknown rather than empty, the cache retrying afterwards, the registry merging only the instances that answered, and the client falling back to the snapshot on an absent list while still rendering the empty state for a genuine one.

Verified manually in a dev build; before/after screenshots are in a comment below.

🤖 Generated with Claude Code


Note

Medium Risk Touches provider drivers, registry merging, and WS RPC with nuanced empty-vs-unknown semantics; failures are designed to fall back to snapshots without blanking the picker.

Overview Fixes the $ skill picker showing skills from the wrong directory by introducing server.listWorkspaceSkills, with clients sending the thread worktree or project root as cwd plus an optional provider instanceId.

Server: Claude rescans user + <cwd>/.claude/skills; Codex calls skills/list through a shared app-server helper. Results are merged in ProviderRegistry.listWorkspaceSkills (targeted instance vs all instances, first name wins). A 30s per-cwd cache avoids repeated Codex spawns; undefined means discovery failed and is not cached so clients can retry and keep snapshot fallback.

Clients (web + mobile): useWorkspaceSkills drives the composer and thread flows; resolveComposerSkills prefers workspace answers over ServerProvider.skills, while resolveTranscriptProviderInstanceId keeps transcript $skill highlighting on the thread's provider, not the composer's next-turn pick.

Observability: Claude skill discovery logs unreadable roots/SKILL.md at debug and skips malformed frontmatter with a warning.

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

Note

Fix the $ skill picker to list skills for the active project's workspace

  • Adds a useWorkspaceSkills hook (web and mobile) that fetches workspace-specific skills via a new server.listWorkspaceSkills WebSocket RPC, with a 30-second client-side cache.
  • Implements listWorkspaceSkills on the server by spawning the provider's app-server (Claude via file discovery, Codex via codex app-server) and aggregating results across instances.
  • Adds resolveComposerSkills to merge workspace-discovered skills with provider snapshot skills, giving workspace skills precedence; used in the composer and timeline.
  • The $ skill picker in the composer and the skill highlights in the chat timeline now reflect the active project's workspace directory rather than the provider's globally advertised skills.
  • Behavioral Change: users switching providers mid-thread will no longer see skill highlights update in the transcript; highlights are now anchored to the instance that sent the messages.
Macroscope summarized 43d06a0.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. 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: 678b6c82-147d-4d6f-8d7e-b2f1e1da41d4

      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.
    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Needs human review

      This PR introduces a new feature for workspace-scoped skill discovery, adding a new RPC endpoint, caching infrastructure, driver modifications, and UI changes across ~960 lines. Despite the 'fix' label, this is substantial new capability that changes how the skill picker operates at runtime.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. Before / after

      Captured with the t3code repo itself opened as the project, so the picker's project scope is this repository's own .claude/skills (ios-debugger-agent, ios-simulator-browser, ship, test-t3-app, test-t3-mobile).

      Before — only the user's global skills are listed, all Personal. None of the project's five skills appear:

      before

      After — the project's skills appear, labelled Project, merged with the global Personal ones:

      after

      After, filtered — typing $test surfaces the project-scoped entries:

      after filtered

      Name-collision precedence (a project skill overriding a same-named user skill) is not visible here, because this repository's skill names do not collide with the global ones on the capture machine. That path is covered by unit tests instead.

    5. 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 f6633c1272f06740158453fd584fb2bf4313e68e. Configure [here](https://www.cursor.com/dashboard/bugbot).
    6. Note

      🤖 GPT-5.6 Sol responding on behalf of Theo

      Closing this PR after an automated pass over open pull requests. Duplicates trusted project-skills work in #7909 and #5335.

Sign in to join this conversation.