fix: remove redundant slash commands and clean up legacy files to fix conflict warnings

This commit is contained in:
Keith Guerin
2026-03-18 09:38:31 -07:00
parent 79cb966967
commit 8ec6430ad6
+8 -10
View File
@@ -1,15 +1,13 @@
#!/bin/bash
# sync-skills.sh - Syncs custom skills from the repo to the user's global ~/.gemini/skills folder.
# It also creates a slash command for each skill to make them easily accessible.
SKILLS_DIR="${HOME}/.gemini/skills"
COMMANDS_DIR="${HOME}/.gemini/commands"
REPO_SKILLS_PATH="packages/core/src/skills/builtin"
mkdir -p "${SKILLS_DIR}"
mkdir -p "${COMMANDS_DIR}"
echo "Syncing skills and commands..."
echo "Syncing skills..."
# List of skills to sync
CUSTOM_SKILLS=("_ux_git-worktree" "_ux_finish-pr" "_ux_designer")
@@ -20,16 +18,16 @@ for SKILL in "${CUSTOM_SKILLS[@]}"; do
cp -r "${REPO_SKILLS_PATH}/${SKILL}" "${SKILLS_DIR}/"
echo "✅ Synced: ${SKILL}"
# Create Slash Command
# Clean up legacy explicit command files if they exist to prevent conflicts.
# Gemini CLI automatically registers a slash command for each skill based on its name.
COMMAND_FILE="${COMMANDS_DIR}/${SKILL}.toml"
cat <<EOF > "${COMMAND_FILE}"
description = "Invoke the ${SKILL} skill"
prompt = "Activate the ${SKILL} skill and follow its instructions to: {{args}}"
EOF
echo "✅ Created Command: /${SKILL}"
if [[ -f "${COMMAND_FILE}" ]]; then
rm -f "${COMMAND_FILE}"
echo "🧹 Cleaned up redundant command file: ${COMMAND_FILE}"
fi
else
echo "❌ Error: Skill ${SKILL} not found in ${REPO_SKILLS_PATH}"
fi
done
echo "Done. Run '/skills reload' and '/commands reload' in your Gemini session to apply changes."
echo "Done. Run '/skills reload' in your Gemini session to apply changes."