#!/bin/bash # compress-skills.sh # Compresses each skill folder into a separate .zip file inside dist/ set -e DIST_DIR="dist" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" echo "==> Creating $DIST_DIR directory..." mkdir -p "$SCRIPT_DIR/$DIST_DIR" # Iterate over all folders (excluding system and dist folders) for skill_dir in "$SCRIPT_DIR"/*/; do folder_name="$(basename "$skill_dir")" # Skip excluded folders if [[ "$folder_name" == "$DIST_DIR" || "$folder_name" == ".git" || "$folder_name" == ".claude" ]]; then continue fi # Check that SKILL.md exists (valid skill folder) if [[ ! -f "$skill_dir/SKILL.md" ]]; then echo " [SKIP] $folder_name — no SKILL.md found" continue fi zip_file="$SCRIPT_DIR/$DIST_DIR/${folder_name}.zip" echo " [ZIP] $folder_name → $DIST_DIR/${folder_name}.zip" # Create zip from repo root to preserve correct path structure (cd "$SCRIPT_DIR" && zip -r "$zip_file" "$folder_name" -x "*.DS_Store" -x "*__pycache__*" -x "*.pyc") done echo "" echo "==> Done. Files generated in $DIST_DIR/:" ls -lh "$SCRIPT_DIR/$DIST_DIR/"