2026-03-14 19:16:57 +01:00
|
|
|
#!/bin/bash
|
2026-03-16 00:50:23 +01:00
|
|
|
# install.sh — install the ralph-workplan skill into Claude Code's user commands
|
2026-03-14 19:16:57 +01:00
|
|
|
#
|
|
|
|
|
# Usage:
|
|
|
|
|
# ./install.sh # install
|
|
|
|
|
# ./install.sh --uninstall # remove
|
|
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
|
|
PLUGIN_NAME="ralph-workplan"
|
2026-03-16 00:33:15 +01:00
|
|
|
REPO_DIR="$(cd "$(dirname "$0")" && pwd)"
|
2026-03-16 00:50:23 +01:00
|
|
|
COMMANDS_DIR="${HOME}/.claude/commands"
|
|
|
|
|
SKILL_FILE="${COMMANDS_DIR}/${PLUGIN_NAME}.md"
|
|
|
|
|
SCRIPTS_SRC="${REPO_DIR}/plugin/scripts"
|
2026-03-14 19:16:57 +01:00
|
|
|
|
2026-03-16 00:33:15 +01:00
|
|
|
# ── Uninstall ──────────────────────────────────────────────────────────────────
|
2026-03-14 19:16:57 +01:00
|
|
|
if [[ "${1:-}" == "--uninstall" ]]; then
|
2026-03-16 00:50:23 +01:00
|
|
|
if [[ -f "$SKILL_FILE" ]]; then
|
|
|
|
|
rm -f "$SKILL_FILE"
|
|
|
|
|
echo "Removed: $SKILL_FILE"
|
2026-03-16 00:33:15 +01:00
|
|
|
fi
|
|
|
|
|
echo "✅ Uninstalled: $PLUGIN_NAME"
|
|
|
|
|
echo " Restart Claude Code to apply."
|
2026-03-14 19:16:57 +01:00
|
|
|
exit 0
|
|
|
|
|
fi
|
|
|
|
|
|
2026-03-16 00:33:15 +01:00
|
|
|
# ── Install ────────────────────────────────────────────────────────────────────
|
2026-03-16 00:50:23 +01:00
|
|
|
mkdir -p "$COMMANDS_DIR"
|
2026-03-14 19:16:57 +01:00
|
|
|
|
2026-03-16 00:50:23 +01:00
|
|
|
# Write skill file with absolute script paths (avoids CLAUDE_PLUGIN_ROOT dependency)
|
|
|
|
|
sed "s|\${CLAUDE_PLUGIN_ROOT}/scripts|${SCRIPTS_SRC}|g" \
|
|
|
|
|
"${REPO_DIR}/plugin/ralph-workplan.md" > "$SKILL_FILE"
|
2026-03-14 19:16:57 +01:00
|
|
|
|
2026-03-16 00:50:23 +01:00
|
|
|
chmod +x "${SCRIPTS_SRC}/check-done.sh"
|
|
|
|
|
chmod +x "${SCRIPTS_SRC}/setup.sh"
|
2026-03-16 00:33:15 +01:00
|
|
|
|
|
|
|
|
echo "✅ Installed: $PLUGIN_NAME"
|
2026-03-16 00:50:23 +01:00
|
|
|
echo " Skill: $SKILL_FILE"
|
|
|
|
|
echo " Scripts: ${SCRIPTS_SRC}/"
|
|
|
|
|
echo " Invoke: /ralph-workplan <workplan-file> [--max-iterations N]"
|
2026-03-14 19:16:57 +01:00
|
|
|
echo ""
|
|
|
|
|
echo " Restart Claude Code for the skill to appear."
|