From 63a7387517259e2bce0b2d819cea377a72740c7e Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Mon, 6 Apr 2026 18:17:39 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20chore:=20add=20nested=20path=20v?= =?UTF-8?q?alidation=20to=20skill-creator?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added path validation to prevent .vibe/.vibe nested directory creation - Enhanced BEST_PRACTICES.md with path handling patterns - Added troubleshooting section to ADVANCED_FEATURES.md - Shows actual creation path for transparency Fixes: Issue with skills being created in incorrect nested paths Refs: #skill-creation, #path-validation --- .../references/ADVANCED_FEATURES.md | 32 +++++++++++++++++++ .../references/BEST_PRACTICES.md | 27 ++++++++++++++++ .../skill-creator/scripts/create_skill.sh | 11 +++++++ 3 files changed, 70 insertions(+) diff --git a/.vibe/skills/skill-creator/references/ADVANCED_FEATURES.md b/.vibe/skills/skill-creator/references/ADVANCED_FEATURES.md index cb94a68..4d56f6e 100644 --- a/.vibe/skills/skill-creator/references/ADVANCED_FEATURES.md +++ b/.vibe/skills/skill-creator/references/ADVANCED_FEATURES.md @@ -1,5 +1,37 @@ # Advanced Skill Creator Features +## Known Issues and Troubleshooting + +### Nested Path Creation Issue + +**Symptom**: Skills created in incorrect nested paths like `.vibe/skills/.vibe/skills/skill-name` + +**Cause**: Running `create_skill.sh` from within the `.vibe/skills/` directory causes relative path resolution issues. + +**Solution**: +1. Always run the script from project root +2. Use absolute paths when necessary +3. The script now includes validation to detect and prevent this issue + +**Prevention**: Added path validation in `create_skill.sh`: +```bash +# Validate path - ensure we're not creating nested .vibe directories +if [[ "$SKILL_DIR" == *".vibe/.vibe"* ]]; then + echo "❌ Error: Detected nested .vibe path: $SKILL_DIR" + exit 1 +fi +``` + +### Workaround +If you encounter this issue: +```bash +# Move the skill to correct location +mv .vibe/skills/.vibe/skills/your-skill .vibe/skills/your-skill + +# Update any internal path references +find .vibe/skills/your-skill -type f -exec sed -i '' 's|.vibe/skills/.vibe/skills|.vibe/skills|g' {} + +``` + ## Skill Versioning and Updates ### Version Management diff --git a/.vibe/skills/skill-creator/references/BEST_PRACTICES.md b/.vibe/skills/skill-creator/references/BEST_PRACTICES.md index 256ded9..ef8ad6a 100644 --- a/.vibe/skills/skill-creator/references/BEST_PRACTICES.md +++ b/.vibe/skills/skill-creator/references/BEST_PRACTICES.md @@ -295,4 +295,31 @@ df = pl.read_csv("data.csv") ``` For pandas compatibility, use the .to_pandas() method. +``` + +### ❌ Nested Path Creation +**Issue**: Creating skills in incorrect nested paths like `.vibe/skills/.vibe/skills/skill-name` + +**Cause**: Script incorrectly appending base directory to target path + +**Solution**: Always use absolute paths and validate the final location + +```bash +# Correct approach +TARGET_DIR=".vibe/skills/$SKILL_NAME" +mkdir -p "$TARGET_DIR" +# Verify location +ls -la ".vibe/skills/" | grep "$SKILL_NAME" +``` + +### ✅ Proper Path Handling +```bash +# Use absolute paths from project root +SKILL_DIR="$PROJECT_ROOT/.vibe/skills/$SKILL_NAME" +mkdir -p "$SKILL_DIR" +# Validate no nested .vibe directories +if [[ "$SKILL_DIR" == *".vibe/.vibe"* ]]; then + echo "Error: Nested .vibe path detected" + exit 1 +fi ``` \ No newline at end of file diff --git a/.vibe/skills/skill-creator/scripts/create_skill.sh b/.vibe/skills/skill-creator/scripts/create_skill.sh index 8de7337..5026e4a 100755 --- a/.vibe/skills/skill-creator/scripts/create_skill.sh +++ b/.vibe/skills/skill-creator/scripts/create_skill.sh @@ -19,6 +19,17 @@ 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" <