From b2b1e429dce9fea0a6ddb6b7cebb3ea7bdffd419 Mon Sep 17 00:00:00 2001 From: Hibryda Date: Tue, 24 Mar 2026 12:19:04 +0100 Subject: [PATCH] =?UTF-8?q?chore:=20add=20rule=2056=20=E2=80=94=20Electrob?= =?UTF-8?q?un=20launch=20sequence=20(PTY=20+=20Vite=20before=20app)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .claude/rules/56-electrobun-launch.md | 43 +++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .claude/rules/56-electrobun-launch.md diff --git a/.claude/rules/56-electrobun-launch.md b/.claude/rules/56-electrobun-launch.md new file mode 100644 index 0000000..997a4d7 --- /dev/null +++ b/.claude/rules/56-electrobun-launch.md @@ -0,0 +1,43 @@ +# Electrobun Launch Sequence (MANDATORY) + +Before launching the Electrobun app, ALWAYS start dependencies in this exact order: + +## Steps + +1. **Start Rust PTY daemon** (if not already running): + ```bash + /home/hibryda/code/ai/agent-orchestrator/agor-pty/target/release/agor-ptyd &>/dev/null & + ``` + +2. **Start Vite dev server** on port 9760: + ```bash + cd /home/hibryda/code/ai/agent-orchestrator/ui-electrobun && npx vite dev --port 9760 --host localhost &>/dev/null & + ``` + +3. **Wait 3-4 seconds** for Vite to be ready. + +4. **Launch Electrobun**: + ```bash + cd /home/hibryda/code/ai/agent-orchestrator/ui-electrobun && npx electrobun dev + ``` + +## What Happens If You Skip Steps + +- **No PTY daemon**: App crashes with `Connection timeout (5s). Is agor-ptyd running?` — Bun process dies silently. +- **No Vite**: WebView loads a blank page (no frontend bundle served). +- **No wait**: Electrobun opens before Vite is ready — blank page or partial load. + +## Kill Sequence (Rule 55) + +Always kill previous instances before launching new ones: +```bash +pkill -f "electrobun|vite.*9760|agor-ptyd|WebKit|AgentOrch|launcher" 2>/dev/null +fuser -k 9760/tcp 2>/dev/null +``` + +## Rules + +- NEVER launch Electrobun without the PTY daemon running. +- NEVER launch Electrobun without Vite running on port 9760. +- ALWAYS kill previous instances first (Rule 55). +- Check `pgrep -f agor-ptyd` before launching to verify daemon is alive.