Created
March 26, 2026 16:35
-
-
Save ManUtopiK/1d211350e20799a164e8dc9def08bfe2 to your computer and use it in GitHub Desktop.
Install skills from a directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Install Agent Skills | |
| # This script installs custom skills for AI coding agents using the Vercel skills CLI | |
| set -e | |
| # Default agents to install for | |
| AGENTS=("codex" "claude-code" "pi" "opencode") | |
| SCOPE="${1:-global}" | |
| echo "π― Installing Agent Skills" | |
| echo " Agents: ${AGENTS[*]}" | |
| echo " Scope: $SCOPE" | |
| echo "" | |
| # Determine scope flag | |
| SCOPE_FLAG="" | |
| if [ "$SCOPE" = "global" ]; then | |
| SCOPE_FLAG="--global" | |
| fi | |
| # Check if npx is available | |
| if ! command -v npx &> /dev/null; then | |
| echo "β Error: npx is not installed. Please install Node.js first." | |
| exit 1 | |
| fi | |
| # Build agent flags | |
| AGENT_FLAGS="" | |
| for agent in "${AGENTS[@]}"; do | |
| AGENT_FLAGS="$AGENT_FLAGS -a $agent" | |
| done | |
| # Install skills from local dotfiles/skills directory (if it exists and has skills) | |
| if [ -d "skills" ] && [ "$(ls -A skills 2>/dev/null)" ]; then | |
| echo "π¦ Installing skills from dotfiles/skills directory..." | |
| npx skills add ./skills --skill '*' $AGENT_FLAGS $SCOPE_FLAG -y | |
| echo "" | |
| fi | |
| # Install specific skills from external repositories | |
| echo "π¦ Installing skills from external repositories..." | |
| # List of external skills to install (GitHub paths) | |
| EXTERNAL_SKILLS=( | |
| "https://github.com/anthropics/skills/tree/main/skills/skill-creator" | |
| "https://github.com/nicobailon/surf-cli/tree/main/skills/surf" | |
| "https://github.com/elithrar/dotfiles/tree/main/.config/opencode/skill/web-perf" | |
| ) | |
| for skill in "${EXTERNAL_SKILLS[@]}"; do | |
| echo " Installing from: $skill" | |
| npx skills add "$skill" $AGENT_FLAGS $SCOPE_FLAG -y | |
| done | |
| echo "" | |
| echo "β Skills installed successfully!" | |
| echo "" | |
| echo "π Installation locations:" | |
| if [ "$SCOPE" = "global" ]; then | |
| echo " ~/.pi/agent/skills/ (for claude-code, pi)" | |
| echo " ~/.codex/skills/ (for codex)" | |
| echo " ~/.opencode/skills/ (for opencode)" | |
| else | |
| echo " ./.pi/agent/skills/ (for claude-code, pi)" | |
| echo " ./.codex/skills/ (for codex)" | |
| echo " ./.opencode/skills/ (for opencode)" | |
| fi | |
| echo "" | |
| echo "π‘ Manage your skills:" | |
| echo " - List installed: npx skills list" | |
| echo " - Update skills: npx skills update" | |
| echo " - Remove skills: npx skills remove <skill-name>" | |
| echo "" | |
| echo "π§ To install with different scope:" | |
| echo " $0 global # Install globally (default)" | |
| echo " $0 project # Install to current project" | |
| echo "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment