Skip to content

fix(skills): discover ~/.claude/skills, .claude/skills and ~/.stepcode/skills - #212

Open
Uking-xxx wants to merge 1 commit into
mainfrom
fix/claude-skills-discovery
Open

Uking-xxx wants to merge 1 commit into
mainfrom
fix/claude-skills-discovery

Conversation

@Uking-xxx

Copy link
Copy Markdown
Collaborator

Fixes #205

Problem

Step never scanned Claude Code's skill directories, so skills users already keep in ~/.claude/skills (often symlinked from ~/.agents/skills) or in a project's .claude/skills were invisible until someone pointed the model at them by hand. ~/.stepcode/skills was not auto-discovered either; only ~/.stepcode/agent/skills was.

Changes

Skill discovery (core/package-manager.ts)

  • User level: ~/.claude/skills and ~/.stepcode/skills are now loaded alongside ~/.stepcode/agent/skills and ~/.agents/skills, without needing project trust.
  • Project level: .claude/skills is scanned from cwd up to the git root, the same way .agents/skills is, once the project is trusted.
  • .claude and .agents follow the same scan rules. ~/.stepcode/skills follows the same rules as ~/.stepcode/agent/skills.
  • When cwd is $HOME, ~/.stepcode/skills and ~/.claude/skills load once, as user skills, and are not read again as project skills.
  • A skill that ~/.claude/skills symlinks into ~/.agents/skills loads once.
  • Load order is ~/.stepcode/agent/skills → ~/.stepcode/skills → ~/.agents/skills → ~/.claude/skills. When two skills share a name, the first one loaded wins.

Project trust (core/trust-manager.ts)

  • A project's .claude/skills triggers the trust prompt, just as .agents/skills does.
  • ~/.claude/skills and ~/.stepcode/skills count as the user's own resources, so starting in $HOME does not ask for trust.

Docs: skill locations and the trust notes are updated in docs/skills.md, sdk.md, security.md, settings.md, usage.md, extensions.md and README.md.

Behavior change

When cwd is $HOME, ~/.stepcode/skills used to be read as project skills and needed project trust. It is now a user skill directory and always loads. The existing test should resolve symlinked user and project resources once now expects the skill's scope to be user.

Tests

  • New cases cover user and project .claude/skills, the symlink dedupe, ~/.<configDir>/skills discovery with a single load when cwd is $HOME, and trust detection.
  • The new discovery and trust cases fail without the source change and pass with it.
  • packages/coding-agent: 3736 passed, 51 skipped.
  • apps/cli: 631 passed.
  • pnpm run check passes.

…e/skills

Skills authored for Claude Code live in ~/.claude/skills and project
.claude/skills, which step never scanned, so users had to point the
model at them by hand. Discover both alongside .agents/skills: the user
directory always, project directories from cwd up to the git root once
the project is trusted. A .claude/skills entry symlinked into
~/.agents/skills is loaded once.

Also auto-discover ~/.stepcode/skills as user skills next to
~/.stepcode/agent/skills. When cwd is $HOME that directory is the user's
own, so it is not read again as project skills and does not trigger the
project trust prompt.

Fixes #205
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

建议支持读取 .claude 下的 skills(~/.claude/skills)

1 participant