Skip to content

Instantly share code, notes, and snippets.

@ManUtopiK
Created March 26, 2026 16:35
Show Gist options
  • Select an option

  • Save ManUtopiK/1d211350e20799a164e8dc9def08bfe2 to your computer and use it in GitHub Desktop.

Select an option

Save ManUtopiK/1d211350e20799a164e8dc9def08bfe2 to your computer and use it in GitHub Desktop.
Install skills from a directory
#!/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