#!/bin/sh # Poetic Touch installer: download, verify the checksum, unpack into ~/.claude/skills, run the self-test. # curl -fsSL https://poetic.phibel.app/install.sh | sh # Read it first if you like — it is short. Needs python3 (for unpacking and the self-test). set -eu VERSION="${POETIC_TOUCH_VERSION:-1.0.0}" BASE="${POETIC_TOUCH_URL:-https://poetic.phibel.app}" DEST="${CLAUDE_SKILLS_DIR:-$HOME/.claude/skills}" ZIP="poetic-touch-v$VERSION.zip" TMP="$(mktemp -d)" trap 'rm -rf "$TMP"' EXIT command -v python3 >/dev/null || { echo "poetic-touch: python3 is needed" >&2; exit 2; } echo "Downloading $ZIP from $BASE ..." curl -fsSL "$BASE/$ZIP" -o "$TMP/$ZIP" curl -fsSL "$BASE/$ZIP.sha256" -o "$TMP/$ZIP.sha256" python3 - "$TMP/$ZIP" "$TMP/$ZIP.sha256" "$DEST" <<'PY' import hashlib, sys, zipfile, shutil from pathlib import Path zp, sp, dest = Path(sys.argv[1]), Path(sys.argv[2]), Path(sys.argv[3]) want = sp.read_text().split()[0] got = hashlib.sha256(zp.read_bytes()).hexdigest() if got != want: sys.exit(f"poetic-touch: checksum mismatch ({got[:12]} != {want[:12]}), nothing installed") with zipfile.ZipFile(zp) as z: for n in z.namelist(): if n.startswith("/") or ".." in Path(n).parts or not n.startswith("poetic-touch/"): sys.exit(f"poetic-touch: unexpected path in zip: {n}") target = dest / "poetic-touch" # The old version is kept once outside the skills folder, so Claude never sees two copies. prev = Path.home() / ".poetic-touch" / "previous-skill" if prev.exists(): shutil.rmtree(prev) if target.exists(): prev.parent.mkdir(parents=True, exist_ok=True) shutil.move(str(target), str(prev)) dest.mkdir(parents=True, exist_ok=True) z.extractall(dest) print(f"checksum ok, unpacked to {target}") PY if python3 "$DEST/poetic-touch/scripts/selftest.py" > "$TMP/selftest.log" 2>&1; then tail -1 "$TMP/selftest.log" else cat "$TMP/selftest.log"; echo "poetic-touch: self-test FAILED — please open an issue on GitHub" >&2; exit 1 fi echo echo "Installed. In Claude Code say: \"configure poetic touch\" to mix your style," echo "or just ask for a text \"with a poetic touch\"."