#!/usr/bin/env bash # Auto-generated by release workflow — extension-restructure set -e REPO="/home/alee/Sources/relicario" RELAY_DIR="$REPO/tools/relay" COORD="$REPO/docs/superpowers/coordination" RELEASE="extension-restructure" SESSION="$RELEASE" # ── 1. Relay ───────────────────────────────────────────────────────────── if curl -sf http://127.0.0.1:7331/sse --max-time 2 > /dev/null 2>&1; then echo "[relay] already running on :7331" else echo "[relay] starting..." cd "$RELAY_DIR" nohup npx tsx server.ts > /tmp/relay-extension-restructure.log 2>&1 & for i in $(seq 1 10); do sleep 1 if curl -sf http://127.0.0.1:7331/sse --max-time 1 > /dev/null 2>&1; then echo "[relay] ready on :7331" break fi if [ "$i" -eq 10 ]; then echo "[relay] ERROR: failed to start — check /tmp/relay-extension-restructure.log" exit 1 fi done fi # ── 2. tmux session ────────────────────────────────────────────────────── if tmux has-session -t "$SESSION" 2>/dev/null; then echo "[tmux] session '$SESSION' already exists — attaching" exec tmux attach-session -t "$SESSION" fi echo "[tmux] creating session '$SESSION'..." tmux new-session -d -s "$SESSION" -n "PM" tmux send-keys -t "$SESSION:PM" "claude" Enter tmux new-window -t "$SESSION" -n "Dev-A" tmux send-keys -t "$SESSION:Dev-A" "claude" Enter tmux new-window -t "$SESSION" -n "Dev-B" tmux send-keys -t "$SESSION:Dev-B" "claude" Enter tmux select-window -t "$SESSION:PM" echo "" echo "╔══════════════════════════════════════════════════════════════════╗" echo "║ extension-restructure — prompt cheatsheet ║" echo "╠══════════════════════════════════════════════════════════════════╣" echo "║ PM window → paste $COORD/$RELEASE-pm-prompt.md ║" echo "║ Dev-A window → paste $COORD/$RELEASE-dev-a-prompt.md ║" echo "║ Dev-B window → paste $COORD/$RELEASE-dev-b-prompt.md ║" echo "╚══════════════════════════════════════════════════════════════════╝" echo "" echo "[tmux] attaching — use Ctrl-b n / Ctrl-b p to switch windows" exec tmux attach-session -t "$SESSION"