#!/bin/bash # Create a new skill scaffold set -e if [ $# -eq 0 ]; then echo "Usage: $0 " echo "Example: $0 bdd-testing" exit 1 fi SKILL_NAME=$1 SKILL_DIR=".vibe/skills/${SKILL_NAME}" # Convert underscores to hyphens for the skill name SKILL_NAME_HYPHENATED=$(echo "$SKILL_NAME" | tr '_' '-') # Create skill directory mkdir -p "$SKILL_DIR" # Validate path - ensure we're not creating nested .vibe directories if [[ "$SKILL_DIR" == *".vibe/.vibe"* ]]; then echo "❌ Error: Detected nested .vibe path: $SKILL_DIR" echo "This usually happens when running the script from within .vibe/skills/" echo "Please run from project root or use absolute paths" exit 1 fi # Show the actual path being created echo "✓ Creating skill in: $(pwd)/$SKILL_DIR" # Create SKILL.md with basic template cat > "$SKILL_DIR/SKILL.md" < "$SKILL_DIR/scripts/example.sh" < "$SKILL_DIR/references/REFERENCE.md" <