From aa30e861707d533f7285acbcc448dd623bfa0bed Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Fri, 10 Oct 2025 20:46:33 -0700 Subject: Update skill-run documentation and examples --- scripts/run | 55 ------------------------------------------------------- scripts/skill-run | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 55 deletions(-) delete mode 100755 scripts/run create mode 100755 scripts/skill-run (limited to 'scripts') diff --git a/scripts/run b/scripts/run deleted file mode 100755 index 2c9651e..0000000 --- a/scripts/run +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env bash -# Generic runner for skill scripts -# Searches personal superpowers first, then core plugin -# -# Usage: scripts/run [args...] -# Example: scripts/run skills/collaboration/remembering-conversations/tool/search-conversations "query" - -set -euo pipefail - -if [[ $# -eq 0 ]]; then - cat <<'EOF' -Usage: scripts/run [args...] - -Runs scripts from skills, checking personal superpowers first, then core. - -Examples: - scripts/run skills/collaboration/remembering-conversations/tool/search-conversations "query" - scripts/run skills/getting-started/list-skills - scripts/run skills/getting-started/skills-search "pattern" - -The script will be found at: - 1. ~/.config/superpowers/ (personal, if exists) - 2. ${CLAUDE_PLUGIN_ROOT}/ (core plugin) -EOF - exit 1 -fi - -# Get the script path to run -SCRIPT_PATH="$1" -shift # Remove script path from args, leaving remaining args - -# Determine directories -PERSONAL_SUPERPOWERS_DIR="${PERSONAL_SUPERPOWERS_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/superpowers}" -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -PLUGIN_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" - -# Try personal superpowers first -PERSONAL_SCRIPT="${PERSONAL_SUPERPOWERS_DIR}/${SCRIPT_PATH}" -if [[ -x "$PERSONAL_SCRIPT" ]]; then - exec "$PERSONAL_SCRIPT" "$@" -fi - -# Fall back to core plugin -CORE_SCRIPT="${PLUGIN_ROOT}/${SCRIPT_PATH}" -if [[ -x "$CORE_SCRIPT" ]]; then - exec "$CORE_SCRIPT" "$@" -fi - -# Not found -echo "Error: Script not found: $SCRIPT_PATH" >&2 -echo "" >&2 -echo "Searched:" >&2 -echo " $PERSONAL_SCRIPT (personal)" >&2 -echo " $CORE_SCRIPT (core)" >&2 -exit 1 diff --git a/scripts/skill-run b/scripts/skill-run new file mode 100755 index 0000000..35319f1 --- /dev/null +++ b/scripts/skill-run @@ -0,0 +1,54 @@ +#!/usr/bin/env bash +# Generic runner for skill scripts +# Searches personal superpowers first, then core plugin +# +# Usage: scripts/skill-run [args...] +# Example: scripts/skill-run skills/collaboration/remembering-conversations/tool/search-conversations "query" + +set -euo pipefail + +if [[ $# -eq 0 ]]; then + cat <<'EOF' +Usage: scripts/skill-run [args...] + +Runs scripts from skills, checking personal superpowers first, then core. + +Examples: + scripts/skill-run skills/collaboration/remembering-conversations/tool/search-conversations "query" + scripts/skill-run skills/collaboration/remembering-conversations/tool/index-conversations --cleanup + +The script will be found at: + 1. ~/.config/superpowers/ (personal, if exists) + 2. ${CLAUDE_PLUGIN_ROOT}/ (core plugin) +EOF + exit 1 +fi + +# Get the script path to run +SCRIPT_PATH="$1" +shift # Remove script path from args, leaving remaining args + +# Determine directories +PERSONAL_SUPERPOWERS_DIR="${PERSONAL_SUPERPOWERS_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/superpowers}" +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +PLUGIN_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" + +# Try personal superpowers first +PERSONAL_SCRIPT="${PERSONAL_SUPERPOWERS_DIR}/${SCRIPT_PATH}" +if [[ -x "$PERSONAL_SCRIPT" ]]; then + exec "$PERSONAL_SCRIPT" "$@" +fi + +# Fall back to core plugin +CORE_SCRIPT="${PLUGIN_ROOT}/${SCRIPT_PATH}" +if [[ -x "$CORE_SCRIPT" ]]; then + exec "$CORE_SCRIPT" "$@" +fi + +# Not found +echo "Error: Script not found: $SCRIPT_PATH" >&2 +echo "" >&2 +echo "Searched:" >&2 +echo " $PERSONAL_SCRIPT (personal)" >&2 +echo " $CORE_SCRIPT (core)" >&2 +exit 1 -- cgit