Skip to content

Comments

feat: add --global/-g flag for installing personal skills#4

Merged
trieloff merged 4 commits intomainfrom
feature/global-skills-flag
Oct 30, 2025
Merged

feat: add --global/-g flag for installing personal skills#4
trieloff merged 4 commits intomainfrom
feature/global-skills-flag

Conversation

@trieloff
Copy link
Owner

Summary

  • Adds --global / -g flag to install skills to ~/.claude/skills for personal skills available across all projects
  • Updates discover-skills script to search both project (.claude/skills) and personal (~/.claude/skills) directories
  • Global installs skip project-specific files (.agents/discover-skills and AGENTS.md)
  • Comprehensive documentation updates with examples and usage guidelines

Rationale

Claude Code supports loading skills from three locations: personal skills (~/.claude/skills), project skills (.claude/skills), and plugin skills. This enhancement enables upskill to install directly to the personal skills directory, making skills available across all projects.

Changes

Core functionality

  • Added --global / -g flag to option parsing
  • Destination directory switches to $HOME/.claude/skills when flag is set
  • Skip project-specific file updates (.agents/discover-skills, AGENTS.md, .gitignore) for global installs

Discovery script enhancement

  • discover-skills now searches both project and personal directories
  • Skills are organized by location with clear labeling
  • Empty directories are silently skipped

Documentation

  • Added "Install skills globally" section with examples
  • Updated options list and discover-skills description
  • Clear explanation of behavior differences for global installs

Test plan

  • Verify --help shows new flag
  • Check documentation is complete and accurate
  • Test upskill -g anthropics/skills --skill pdf installs to ~/.claude/skills
  • Verify .agents/discover-skills script lists both project and personal skills
  • Confirm global installs don't modify project files

🤖 Generated with Claude Code

…e/skills

This change adds support for installing skills globally to ~/.claude/skills,
making them available across all Claude Code projects. Key features:

- New -g/--global flag installs skills to ~/.claude/skills instead of project directory
- discover-skills script now searches both project and personal skills directories
- Global installs skip .agents/discover-skills and AGENTS.md updates (project-specific)
- Updated documentation with examples and usage guidelines

Addresses the need for personal skills that are shared across projects as
documented in Claude Code skills documentation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

Signed-off-by: Lars Trieloff <lars@trieloff.net>
…atibility

The printf command was wrapped in echo with command substitution which could
cause issues. Simplified to direct printf call for more reliable output.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

Signed-off-by: Lars Trieloff <lars@trieloff.net>
Avoids potential issues with command substitution and external commands.
Uses pure bash for better portability and reliability.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

Signed-off-by: Lars Trieloff <lars@trieloff.net>
The -E flag causes ERR traps to be inherited by shell functions and command
substitutions, which can cause unexpected failures in some environments.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

Signed-off-by: Lars Trieloff <lars@trieloff.net>
@trieloff trieloff merged commit e6715b7 into main Oct 30, 2025
1 check passed
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.

2 participants