setup-personal-superpowers.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/usr/bin/env bash
  2. # Setup script for personal superpowers directory
  3. # Creates personal superpowers directory with git repo for personal skills
  4. set -euo pipefail
  5. # Use PERSONAL_SUPERPOWERS_DIR if set, otherwise XDG_CONFIG_HOME/superpowers, otherwise ~/.config/superpowers
  6. SUPERPOWERS_DIR="${PERSONAL_SUPERPOWERS_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/superpowers}"
  7. SKILLS_DIR="${SUPERPOWERS_DIR}/skills"
  8. # Check if already set up
  9. if [[ -d "${SUPERPOWERS_DIR}/.git" ]] && [[ -d "${SKILLS_DIR}" ]]; then
  10. # Already set up, nothing to do
  11. exit 0
  12. fi
  13. # Create directory structure
  14. mkdir -p "${SKILLS_DIR}"
  15. # Create .gitignore
  16. cat > "${SUPERPOWERS_DIR}/.gitignore" <<'EOF'
  17. # Superpowers local data
  18. search-log.jsonl
  19. conversation-index/
  20. conversation-archive/
  21. EOF
  22. # Create README
  23. cat > "${SUPERPOWERS_DIR}/README.md" <<'EOF'
  24. # My Personal Superpowers
  25. Personal skills and techniques for Claude Code.
  26. Learn more about Superpowers: https://github.com/obra/superpowers
  27. EOF
  28. # Initialize git repo if not already initialized
  29. if [[ ! -d "${SUPERPOWERS_DIR}/.git" ]]; then
  30. cd "${SUPERPOWERS_DIR}"
  31. git init -q
  32. git add .gitignore README.md
  33. git commit -q -m "Initial commit: Personal superpowers setup"
  34. fi
  35. # Check for gh and recommend GitHub setup
  36. if command -v gh &> /dev/null; then
  37. echo "github_cli_available=true"
  38. else
  39. echo "github_cli_available=false"
  40. fi
  41. exit 0