Skip to content

fix: Claude Code skills discoverable for the composer $ picker#4414

Merged
t3dotgg merged 5 commits into
mainfrom
claude-skill-discovery
Jul 24, 2026
Merged

fix: Claude Code skills discoverable for the composer $ picker#4414
t3dotgg merged 5 commits into
mainfrom
claude-skill-discovery

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Jul 24, 2026

Copy link
Copy Markdown
Member

Problem

The composer's $ skill selector only worked for Codex. The Codex driver populates the provider snapshot's skills array via the app-server's skills/list RPC, but the Claude provider never set skills at all, so buildServerProvider defaulted it to [] and the composer always showed "No skills found. Try / to browse provider commands."

Fix

Add filesystem skill discovery to the Claude provider, mirroring what the Codex app-server does for Codex:

  • ClaudeSkills.ts (new): scans <config dir>/skills (user scope — CLAUDE_CONFIG_DIR when the instance sets homePath, else ~/.claude) and <cwd>/.claude/skills (project scope) for <skill-dir>/SKILL.md, parses YAML frontmatter for name/description, and maps entries into ServerProviderSkill[]. Project skills win name collisions (Claude Code's most-specific-wins resolution). Discovery is best-effort: unreadable roots, stray files, and malformed frontmatter are skipped rather than failing the snapshot; a frontmatter-less skill falls back to its directory name.
  • ClaudeProvider.ts: checkClaudeProviderStatus now accepts the workspace cwd, runs discovery, and attaches skills to the ready/unverified-auth snapshots.
  • ClaudeDriver.ts: passes ServerConfig.cwd and provides FileSystem to the status check.

The Agent SDK init handshake surfaces skills only as slash commands without filesystem paths, so scanning the same directories Claude Code loads from is the practical way to get paths + scopes for the picker.

No client changes needed — the web/mobile composers already render whatever selectedProviderStatus.skills contains.

Testing

  • New ClaudeSkills.test.ts covering user+project discovery, collision precedence, malformed-frontmatter/stray-file tolerance, and missing roots (4 tests).
  • Existing ProviderRegistry / Claude probe suites pass (48 tests).
  • typecheck, lint, fmt clean.

🤖 Generated with Claude Code


Note

Low Risk
Read-only local filesystem discovery during provider status checks; failures are swallowed so snapshots stay available.

Overview
Claude provider snapshots now include filesystem-discovered skills so the composer $ picker can list them (previously only Codex populated skills).

Adds discoverClaudeSkills, which scans user <configDir>/skills and project <cwd>/.claude/skills for SKILL.md files, parses YAML frontmatter via the new yaml dependency, and returns ServerProviderSkill entries with scope and paths. Config dir resolution matches the spawned CLI (homePathCLAUDE_CONFIG_DIR~/.claude, with relative env paths resolved against workspace cwd). Project skills override user skills on name collisions; bad roots, missing files, and invalid frontmatter are skipped without failing the status check.

checkClaudeProviderStatus takes workspace cwd, runs discovery, and passes skills into buildServerProvider for both ready and auth-unknown paths. ClaudeDriver supplies FileSystem and passes cwd into the status check.

Reviewed by Cursor Bugbot for commit 7be852b. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Make Claude Code skills discoverable via the composer $ picker

  • Adds discoverClaudeSkills in ClaudeSkills.ts to enumerate skills from two roots: <configDir>/skills (user scope) and <cwd>/.claude/skills (project scope), parsing YAML frontmatter from each SKILL.md file.
  • Config directory resolves with this precedence: config.homePath, then CLAUDE_CONFIG_DIR env var (resolved relative to workspace cwd), then ~/.claude.
  • Project-scope skills take precedence over user-scope skills on name collisions; entries with missing frontmatter fall back to the directory name.
  • checkClaudeProviderStatus in ClaudeProvider.ts now accepts an optional cwd and requires FileSystem, returning discovered skills in the ServerProviderDraft.

Macroscope summarized 7be852b.

Summary by CodeRabbit

  • New Features

    • Claude Code skills are now automatically discovered and shown in the $ picker.
    • Skills can be loaded from both user-level and project-level locations.
    • Skill names and descriptions are read from SKILL.md metadata.
    • Project-level skills take precedence when names overlap.
  • Bug Fixes

    • Missing, unreadable, or malformed skill files no longer interrupt Claude provider status checks.
    • Skills are safely ignored when configured skill directories do not exist.

The $ skill selector only ever worked for Codex because the Codex
app-server is the sole source that populated the provider snapshot's
skills array; the Claude provider always shipped an empty list, so the
composer showed "No skills found".

Scan the Claude config dir (CLAUDE_CONFIG_DIR or ~/.claude) and the
workspace .claude/skills for SKILL.md entries, parse their YAML
frontmatter for name/description, and surface them as
ServerProviderSkill entries on the Claude provider snapshot. Project
skills win name collisions, matching Claude Code's most-specific-wins
resolution, and discovery is best-effort so malformed skills never
degrade the snapshot.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Claude provider checks now discover skills from user and project filesystem roots, parse their metadata, resolve collisions, and include the results in provider drafts. Filesystem access and the YAML parser dependency are wired into the relevant effects.

Changes

Claude Skills Provider Flow

Layer / File(s) Summary
Skill discovery and validation
apps/server/src/provider/Drivers/ClaudeSkills.ts, apps/server/src/provider/Drivers/ClaudeSkills.test.ts, apps/server/package.json
Adds filesystem-based Claude skill discovery with YAML frontmatter parsing, project-over-user precedence, fallback metadata, sorting, failure tolerance, and coverage for these cases.
Filesystem access for Claude checks
apps/server/src/provider/Drivers/ClaudeDriver.ts
Provides the filesystem service to Claude capability-check effects.
Provider draft integration
apps/server/src/provider/Layers/ClaudeProvider.ts
Accepts an optional working directory, discovers skills during status checks, and includes them in provider drafts for both capability outcomes.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant checkClaudeProviderStatus
  participant discoverClaudeSkills
  participant FileSystem
  participant ServerProviderDraft
  checkClaudeProviderStatus->>discoverClaudeSkills: pass claudeSettings and cwd
  discoverClaudeSkills->>FileSystem: read skill roots and SKILL.md files
  FileSystem-->>discoverClaudeSkills: skill metadata
  discoverClaudeSkills-->>checkClaudeProviderStatus: sorted skills
  checkClaudeProviderStatus->>ServerProviderDraft: include skills in provider draft
Loading

Suggested reviewers: juliusmarminge

Poem

A rabbit hops through folders bright,
Finds skills tucked in YAML light.
Project carrots win the race,
Drafts now hold each skill in place.
Thump, thump—Claude is set just right!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. 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 summarizes the main change: Claude Code skills are now discoverable in the composer picker.
Description check ✅ Passed The description covers the problem, fix, and testing, but it does not follow the template headings or include a completed checklist.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude-skill-discovery

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

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Jul 24, 2026
Comment thread apps/server/src/provider/Drivers/ClaudeSkills.ts
@macroscopeapp

macroscopeapp Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces new functionality (skill discovery for the composer picker) rather than a simple fix. While well-tested and self-contained, new user-facing capabilities that change what users see in the UI warrant human review.

You can customize Macroscope's approvability policy. Learn more.

Skill discovery now matches the config-dir precedence the spawned CLI
sees: instance homePath (which makeClaudeEnvironment exports as
CLAUDE_CONFIG_DIR), then a CLAUDE_CONFIG_DIR already present in the
process environment, then ~/.claude. Previously an exported
CLAUDE_CONFIG_DIR was ignored, so the $ picker could list skills from a
different directory than the Claude runtime would load.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@t3dotgg t3dotgg changed the title Discover Claude Code skills for the composer $ picker fix: Claude Code skills discoverable for the composer $ picker Jul 24, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/server/src/provider/Drivers/ClaudeSkills.ts`:
- Around line 27-53: The parseSkillFrontmatter flow must distinguish absent
frontmatter from malformed YAML: return an explicit parse-validity state,
preserve valid metadata, and have the discovery logic skip malformed entries
before applying the directory-name fallback. Update
apps/server/src/provider/Drivers/ClaudeSkills.ts lines 27-53 and 104-105
accordingly; update apps/server/src/provider/Drivers/ClaudeSkills.test.ts lines
96-119 so only the skill without frontmatter is discovered.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 7a51c3b6-70f9-4d4d-bce6-032b4b4a23a3

📥 Commits

Reviewing files that changed from the base of the PR and between 2f41c07 and bc25d30.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (5)
  • apps/server/package.json
  • apps/server/src/provider/Drivers/ClaudeDriver.ts
  • apps/server/src/provider/Drivers/ClaudeSkills.test.ts
  • apps/server/src/provider/Drivers/ClaudeSkills.ts
  • apps/server/src/provider/Layers/ClaudeProvider.ts

Comment thread apps/server/src/provider/Drivers/ClaudeSkills.ts Outdated
A SKILL.md whose frontmatter fails to parse won't load in Claude Code,
so surfacing it in the picker under its directory name advertised a
skill the runtime can't run. Distinguish missing frontmatter (directory
name fallback still applies) from malformed frontmatter (entry skipped).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@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 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.

Reviewed by Cursor Bugbot for commit 4e605f8. Configure here.

Comment thread apps/server/src/provider/Drivers/ClaudeSkills.ts Outdated
Env vars reach the spawned CLI unexpanded, so a literal `~` in
CLAUDE_CONFIG_DIR stays literal for the runtime. Expanding it during
skill discovery scanned a different directory than the CLI would use;
resolve the value verbatim instead for parity.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment thread apps/server/src/provider/Drivers/ClaudeSkills.ts Outdated
The spawned CLI resolves a relative CLAUDE_CONFIG_DIR against its own
cwd (the workspace), while discovery resolved it against the server
process's cwd — scanning a different skills directory. Resolve against
the workspace cwd for parity.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@colonelpanic8

Copy link
Copy Markdown

yes! please merge!

@t3dotgg
t3dotgg merged commit 6b9a598 into main Jul 24, 2026
16 checks passed
@t3dotgg
t3dotgg deleted the claude-skill-discovery branch July 24, 2026 01:39
jetblk added a commit to jetblk/t3code that referenced this pull request Jul 24, 2026
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:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants