diff --git a/scripts/sync-skills.sh b/scripts/sync-skills.sh index 3fb8f6ec12..c0f1d09616 100755 --- a/scripts/sync-skills.sh +++ b/scripts/sync-skills.sh @@ -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 < "${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."