fix(claude): discover repo-local .agents/skills in skill discovery #5488
main fromrefs/pull/5488/head·merged by juliusmarminge View on GitHubFixes #5487.
What changed#
discoverClaudeSkills (apps/server/src/provider/Drivers/ClaudeSkills.ts) now scans <cwd>/.agents/skills in addition to <Claude config dir>/skills and <cwd>/.claude/skills. The new root is project-scoped and sits between the existing two, keeping the existing last-write-wins map so collision precedence is user < .agents < .claude — project beats user, and .claude/skills beats .agents/skills on a same-name collision. 5 lines of driver code; the rest is tests and a short doc note in docs/user/providers-claude.md.
Why it should exist#
Claude Code loads repo-local skills from .agents/skills (the Agent Skills cross-tool standard directory) as well as .claude/skills, and the Codex app-server already reports .agents/skills entries to T3. But T3's own Claude filesystem discovery only scanned .claude/skills, so .agents/skills skills could never reach the provider snapshot or the $ picker — even with a correct project cwd.
Scope: deliberately Claude-only#
The same user-visible symptom exists on Codex, but with a different root cause that is already tracked with a fix in flight: Codex discovery is delegated to codex app-server (which does scan .agents/skills), and the failure there is the probe cwd — #3040, fix in #5335. This PR intentionally does not touch that. It is complementary to the cwd work (#5335, #4546): once those land, Claude's .agents/skills would still be missing without this scan root, and with both, repo-local .agents/skills work across providers.
Testing#
$ vp test run src/provider/Drivers/ClaudeSkills.test.ts # apps/server
Test Files 1 passed (1)
Tests 9 passed (9)
Three new cases: .agents/skills-only discovery, three-way name collision (.claude wins), and .agents-vs-user collision (.agents wins). tsgo --noEmit on apps/server passes; vp lint and vp fmt --check on the touched files are clean. No UI change (the picker consumes the snapshot as before), so no screenshots.
Note
Low Risk Small, localized change to skill path scanning and merge order; behavior is covered by new tests and does not touch auth or data handling.
Overview
Claude skill discovery now includes the workspace .agents/skills tree (Agent Skills layout) so repo-local skills show up in the provider snapshot and $ picker, not only .claude/skills.
Scan order is user config skills → .agents/skills → .claude/skills, with later roots winning on same name (user < .agents < .claude). Comments and user docs describe that precedence.
Three tests cover .agents-only discovery and two- and three-way name collisions; no UI changes.
Note
Add <workspace>/.agents/skills to Claude skill discovery with precedence ordering#
discoverClaudeSkillsnow scans three roots in order: user config skills,<cwd>/.agents/skills, then<cwd>/.claude/skills, with later roots winning on name collisions.- Skills are accumulated into a
Mapby name, so.claudeproject skills override.agentsproject skills, which override user skills. - New tests cover discovery from
<workspace>/.agents/skillsand verify all three precedence tiers. - providers-claude.md documents the updated lookup order.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
Approvability#
Verdict: Approved f13664d
This PR adds a new skill discovery path (
.agents/skills) using the same pattern as the existing.claude/skillsdiscovery. The implementation is a 5-line addition to an existing array, with comprehensive tests covering collision scenarios. Low-risk additive change.No code changes detected at
You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).40778e6. Prior analysis still applies.juliusmarminge merged thisad47d23
juliusmarminge closed this
Sign in to join this conversation.
Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
58401630-9ae2-40d4-b891-e5453cf542c4You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
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