Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
Consolidate demo docs and add comprehensive demo tapes
Maximilian Roos29374489796f
diff --git a/.gitignore b/.gitignoreindex a6e9b478a..b724353d2 100644--- a/.gitignore+++ b/.gitignore@@ -1,5 +1,5 @@/target-docs/demos/*/out/+docs/demos/out/docs/static/assets/# Lychee link checker cache@@ -10,5 +10,4 @@ test-concurrent.sh*.snap.new*.snap.pendinglogo-variant-*.png-docs/demos/wt-select/vhs-keystrokes/test-results/diff --git a/dev/publish-assets b/dev/publish-assetsindex f54bd6f78..4b09f6120 100755--- a/dev/publish-assets+++ b/dev/publish-assets@@ -5,17 +5,7 @@ set -euo pipefailSCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"REPO_ROOT="$(dirname "$SCRIPT_DIR")"ASSETS_REPO="$REPO_ROOT/../worktrunk-assets"--# Demo sources: name|source_path-# Both light and dark variants for theme switching-DEMOS=(- "wt-core.gif|$REPO_ROOT/docs/demos/wt-core/out/wt-core.gif"- "wt-core-dark.gif|$REPO_ROOT/docs/demos/wt-core/out/wt-core-dark.gif"- "wt-merge.gif|$REPO_ROOT/docs/demos/wt-merge/out/wt-merge.gif"- "wt-merge-dark.gif|$REPO_ROOT/docs/demos/wt-merge/out/wt-merge-dark.gif"- "wt-select.gif|$REPO_ROOT/docs/demos/wt-select/out/wt-select.gif"- "wt-select-dark.gif|$REPO_ROOT/docs/demos/wt-select/out/wt-select-dark.gif"-)+DEMOS_DIR="$REPO_ROOT/docs/demos/out"# Clone assets repo if neededif [[ ! -d "$ASSETS_REPO/.git" ]]; then@@ -37,24 +27,20 @@ if ! git pull --ff-only; thenexit 1fi-# Copy available assets+# Copy all GIFs from demos/outecho "Copying assets..."copied=()-for entry in "${DEMOS[@]}"; do- name="${entry%%|*}"- src="${entry#*|}"- if [[ -f "$src" ]]; then- cp "$src" "$ASSETS_REPO/demos/"- copied+=("$name")- echo " $name"- fi+for src in "$DEMOS_DIR"/*.gif; do+ [[ -f "$src" ]] || continue+ name="$(basename "$src")"+ cp "$src" "$ASSETS_REPO/demos/"+ copied+=("$name")+ echo " $name"doneif [[ ${#copied[@]} -eq 0 ]]; thenecho "No demo GIFs found. Build them first:"- echo " ./docs/demos/wt-core/build"- echo " ./docs/demos/wt-merge/build"- echo " ./docs/demos/wt-select/build"+ echo " ./docs/demos/build docs"exit 1fidiff --git a/docs/CLAUDE.md b/docs/CLAUDE.mdindex 5bf41a7c9..5d102c31c 100644--- a/docs/CLAUDE.md+++ b/docs/CLAUDE.md@@ -266,60 +266,18 @@ Demo GIFs (~2MB each) are stored in a separate `worktrunk-assets` repo to avoid**To regenerate demos** (required after CLI output changes):-1. Build the vhs-keystrokes binary if missing (one-time setup, see below)-2. Run the demo build scripts:- ```bash- ./docs/demos/docs/build # Doc site demos (SIZE_DOCS: 1600x900, FontSize 24)- ./docs/demos/twitter/build # Twitter demos (SIZE_TWITTER: 1200x700, FontSize 26)- ```-3. Publish: `./dev/publish-assets`--Deploy runs `fetch-assets` before building.--### Demo directory structure--```-docs/demos/- tapes/ # All VHS tape files (templated, shared by both builds)- docs/build # Doc site build script (generates light + dark)- twitter/build # Twitter build script (generates light only)- shared/ # Python library, themes, fixtures- vhs-keystrokes/ # Custom VHS binary (gitignored, built on demand)-```--Tape files use template variables (`{{FONTSIZE}}`, `{{WIDTH}}`, `{{HEIGHT}}`) so the same tape produces different sizes for docs vs Twitter.--### vhs-keystrokes setup (REQUIRED for wt-select demos)--The `wt-select` demos require a custom VHS fork with keystroke overlay. **Claude must build this binary before regenerating demos.**--Check if the binary exists:-```bash-ls docs/demos/vhs-keystrokes/vhs-keystrokes+./docs/demos/build docs # Doc site demos (light + dark)+./docs/demos/build twitter # Twitter demos (light only)+./dev/publish-assets # Publish to assets repo```-If missing, **build it** (requires Go):--```bash-cd docs/demos-git clone -b keypress-overlay https://github.com/max-sixty/vhs.git vhs-keystrokes-cd vhs-keystrokes && go build -o vhs-keystrokes .-```+Deploy runs `fetch-assets` before building.-The binary is gitignored. Build scripts skip wt-select GIF recording if missing—**always build vhs-keystrokes first** when regenerating demos.+For detailed demo development guidelines (timing, debugging, environment setup), see `docs/demos/CLAUDE.md`.### Light/dark theme variants-The docs build generates both light and dark GIF variants:-- `wt-core.gif` / `wt-core-dark.gif`-- `wt-merge.gif` / `wt-merge-dark.gif`-- `wt-select.gif` / `wt-select-dark.gif`--Twitter build generates light only (Twitter doesn't support theme-switching media queries).--Theme definitions are in `docs/demos/shared/themes.py`, matching the CSS variables in `_variables.html`.-In markdown, use `<picture>` with media queries:```html<figure class="demo">diff --git a/docs/demos/CLAUDE.md b/docs/demos/CLAUDE.mdnew file mode 100644index 000000000..49897b361--- /dev/null+++ b/docs/demos/CLAUDE.md@@ -0,0 +1,142 @@+# Demo Development++## Directory structure++```+docs/demos/+ build # Unified build script+ tapes/ # All VHS tape files (templated)+ out/ # Output GIFs (gitignored)+ shared/ # Python library, themes, fixtures+ vhs-keystrokes/ # Custom VHS binary (gitignored, built on demand)+```++Tape files use template variables (`{{FONTSIZE}}`, `{{WIDTH}}`, `{{HEIGHT}}`) so the same tape produces different sizes for docs vs Twitter.++## Regenerating demos++```bash+./docs/demos/build docs # Doc site demos (1600x900, light + dark)+./docs/demos/build twitter # Twitter demos (1200x700, light only)+```++Regenerate a single demo:++```bash+./docs/demos/build twitter --only wt-switch+./docs/demos/build docs --only wt-merge+```++**Available demos:**++| Target | Demos |+|--------|-------|+| docs | wt-core, wt-merge, wt-select |+| twitter | wt-switch, wt-statusline, wt-list, wt-list-remove, wt-hooks, wt-commit, wt-merge, wt-select-short, wt-core, wt-zellij, wt-zellij-omnibus |++## vhs-keystrokes setup (REQUIRED for wt-select demos)++The `wt-select` demos require a custom VHS fork with keystroke overlay. **Claude must build this binary before regenerating demos.**++Check if the binary exists:++```bash+ls docs/demos/vhs-keystrokes/vhs-keystrokes+```++If missing, **build it** (requires Go):++```bash+cd docs/demos+git clone -b keypress-overlay https://github.com/max-sixty/vhs.git vhs-keystrokes+cd vhs-keystrokes && go build -o vhs-keystrokes .+```++The binary is gitignored. Build scripts skip wt-select GIF recording if missing—**always build vhs-keystrokes first** when regenerating demos.++## Light/dark theme variants++The docs build generates both light and dark GIF variants:+- `wt-core.gif` / `wt-core-dark.gif`+- `wt-merge.gif` / `wt-merge-dark.gif`+- `wt-select.gif` / `wt-select-dark.gif`++Twitter build generates light only (Twitter doesn't support theme-switching media queries).++Theme definitions are in `docs/demos/shared/themes.py`, matching the CSS variables in `_variables.html`.++## Debugging a demo environment++Use `--shell` to spawn an interactive fish shell with the demo environment:++```bash+./docs/demos/build twitter --only wt-switch --shell+```++This builds the demo and drops you into a fish shell with `HOME`, `PATH`, starship, and wt shell integration all configured. You're already in the demo repo and ready to test:++```fish+# Now you can manually test:+claude # See what happens on first launch+wt switch --create foo # Create a worktree+wt switch --execute claude --create bar # Test the demo command+```++## Timing guidelines++Demo GIFs should feel natural—not rushed, but not lingering. The goal is to let viewers read and understand each step before moving on.++| Context | Duration | Rationale |+|---------|----------|-----------|+| Simple output (one-liner) | 1.5s | Just enough to scan a short result |+| List/table output | 2–2.5s | Tables need more time to scan visually |+| Multi-line text (config, log) | 3s | Dense text requires reading time |+| Long operations (merge, hooks) | Match actual | Use real duration; don't artificially shorten |+| LLM operations | 4s | Show thinking + generated output |+| Transitions (cd, switch) | 1–1.5s | Brief pause after context change |+| Quick sequences (keystrokes) | 0.1–0.5s | Related actions feel like one gesture |+| End hold (before exit) | 2–4s | Let final state sink in |+| Pre-enter pause | 1s | For commands where output clears visible area: TUI takeover (`claude`) or heavy output (`wt merge`). |+| Claude UI startup | 6s | Big visual change; wait for UI to render and settle |++**Principles:**++1. **Focus on output, not typing.** TypingSpeed is fast (28ms). Time is for reading results.+2. **Match reality for slow operations.** If `wt merge` takes 8s, sleep 8s. Don't fake speed.+3. **Group related actions.** Multiple keystrokes (↓↓) can be rapid; pause after the group.+4. **End with breathing room.** Viewers need a moment to absorb the final state.+5. **Twitter context.** These are viewed on phones in noisy feeds—slightly longer is better than too fast.+6. **Type what users would type.** If a flag is needed for technical reasons (e.g., `--color=always` for VHS), handle it in the background setup (env var, git config) so the demo shows the natural command. Never show flags users wouldn't normally type.++## Key files in the demo environment++After spawning the shell, these files control Claude Code behavior:++- `$HOME/.claude.json` - Claude Code global config (onboarding flags, marketplace settings)+- `$HOME/.claude/settings.json` - Claude Code settings (statusLine config)+- `$HOME/.config/worktrunk/config.toml` - Worktrunk user config (approved commands)+- `$HOME/w/acme/.config/wt.toml` - Project hooks config++Key fields in `.claude.json` for suppressing notifications:+- `officialMarketplaceAutoInstalled: true` - should suppress marketplace auto-install+- `numStartups: 100` - makes Claude think it's been run many times+- `hasCompletedOnboarding: true` - skips onboarding++## Extracting frames from a GIF for inspection++```bash+mkdir -p /tmp/frames+magick docs/demos/out/wt-switch.gif -coalesce /tmp/frames/frame_%03d.png++# View a specific frame+open /tmp/frames/frame_200.png+```++## Cleaning up stale demo processes++**NEVER run `pkill -f zellij`** — this kills the user's own Zellij session, not just demo processes.++If stale Zellij processes from previous demo runs are causing issues, either:+- Let them die on their own (they'll timeout)+- Target only demo processes: `pkill -f "zellij.*wt-demos"`+- Remove the demo directory and rebuild: `rm -rf /private/tmp/wt-demos`diff --git a/docs/demos/build b/docs/demos/buildnew file mode 100755index 000000000..fad1b891e--- /dev/null+++ b/docs/demos/build@@ -0,0 +1,1086 @@+#!/usr/bin/env python3+"""Unified build script for demo GIFs.++Usage:+ ./build docs # Build doc site demos (light + dark, 1600x900)+ ./build twitter # Build Twitter demos (light only, 1200x700)+ ./build docs --only wt-merge # Build specific demo for docs+ ./build twitter --only wt-zellij --shell # Debug shell for Twitter demo+"""++import argparse+import json+import os+import shutil+import subprocess+import sys+from pathlib import Path++# Add docs/demos/ to path for shared library+SCRIPT_DIR = Path(__file__).parent+sys.path.insert(0, str(SCRIPT_DIR))++from shared import (+ DemoEnv, DemoSize, git, prepare_demo_repo,+ check_dependencies, setup_demo_output, record_all_themes,+ SIZE_DOCS, SIZE_TWITTER,+)++REPO_ROOT = SCRIPT_DIR.parent.parent+OUT_DIR = SCRIPT_DIR / "out"+TAPES_DIR = SCRIPT_DIR / "tapes"++# Sizes+SIZE_ZELLIJ = DemoSize(width=1200, height=700, fontsize=16)++# User's real Zellij plugins directory+REAL_ZELLIJ_PLUGINS = Path.home() / ".config" / "zellij" / "plugins"++# Custom VHS binary with keystroke overlay+VHS_KEYSTROKES = os.environ.get(+ "VHS_KEYSTROKES",+ str(SCRIPT_DIR / "vhs-keystrokes" / "vhs-keystrokes")+)+++# =============================================================================+# Setup Functions+# =============================================================================+# TODO: If setup functions grow complex, consider pushing target-specific+# configuration down to the recording function or a separate config file.++def prepare_docs_core(env: DemoEnv):+ """Set up repo for docs wt-core demo with hooks, mocks, and billing branch."""+ hooks_config = '''[post-start]+deps = "npm install"+build = "npm run build"+dev = "npm run dev"+db = "docker compose up -d postgres"++[pre-remove]+cleanup = "flyctl scale count 0"+'''+ prepare_demo_repo(env, REPO_ROOT, hooks_config=hooks_config)++ # Mock CLIs for hooks+ bin_dir = env.home / "bin"++ npm_mock = bin_dir / "npm"+ npm_mock.write_text("""#!/bin/bash+if [[ "$1" == "install" ]]; then+ echo "added 847 packages in 3.2s"+elif [[ "$1" == "run" && "$2" == "build" ]]; then+ echo "vite v5.4.2 building for production..."+ echo "✓ 142 modules transformed"+ echo "dist/index.js 45.2 kB │ gzip: 14.8 kB"+elif [[ "$1" == "run" && "$2" == "dev" ]]; then+ echo ""+ echo " VITE v5.4.2 ready in 342 ms"+ echo ""+ echo " ➜ Local: http://localhost:3000/"+fi+""")+ npm_mock.chmod(0o755)++ docker_mock = bin_dir / "docker"+ docker_mock.write_text("""#!/bin/bash+if [[ "$1" == "compose" && "$2" == "up" ]]; then+ echo "[+] Running 1/1"+ echo " ✔ Container postgres Started"+fi+""")+ docker_mock.chmod(0o755)++ flyctl_mock = bin_dir / "flyctl"+ flyctl_mock.write_text("""#!/bin/bash+if [[ "$1" == "scale" && "$2" == "count" && "$3" == "0" ]]; then+ echo "Scaling app to 0 machines"+fi+""")+ flyctl_mock.chmod(0o755)++ # User config with approved commands+ config_dir = env.home / ".config" / "worktrunk"+ project_id = str(env.bare_remote).removesuffix(".git")+ (config_dir / "config.toml").write_text(f'''[projects."{project_id}"]+approved-commands = ["npm install", "npm run build", "npm run dev", "docker compose up -d postgres", "flyctl scale count 0"]+''')++ # Add billing branch (at same commit as main = merged)+ branch = "billing"+ path = env.work_base / f"acme.{branch}"+ git(["-C", str(env.repo), "worktree", "add", "-q", "-b", branch, str(path), "main"])+ git(["-C", str(path), "push", "-u", "origin", branch, "-q"])+++def prepare_docs_merge(env: DemoEnv):+ """Set up repo for docs wt-merge demo with LLM mock."""+ prepare_demo_repo(env, REPO_ROOT)++ # User config with llm commit generation+ config_dir = env.home / ".config" / "worktrunk"+ project_id = str(env.bare_remote).removesuffix(".git")+ (config_dir / "config.toml").write_text(f'''[commit-generation]+command = "llm"+args = ["-m", "claude-haiku-4.5"]++[projects."{project_id}"]+approved-commands = ["cargo nextest run"]+''')++ # Add uncommitted changes to hooks branch for commit demo+ hooks_path = env.work_base / "acme.hooks"+ if hooks_path.exists():+ new_file = hooks_path / "src" / "validation.rs"+ new_file.write_text('''//! Input validation utilities.++/// Validates that a number is positive.+pub fn is_positive(n: i32) -> bool {+ n > 0+}++/// Validates that a string is not empty.+pub fn is_non_empty(s: &str) -> bool {+ !s.trim().is_empty()+}++#[cfg(test)]+mod tests {+ use super::*;++ #[test]+ fn test_is_positive() {+ assert!(is_positive(1));+ assert!(!is_positive(0));+ assert!(!is_positive(-1));+ }+}+''')+ git(["-C", str(hooks_path), "add", "src/validation.rs"])++ # Mock llm CLI+ bin_dir = env.home / "bin"+ bin_dir.mkdir(exist_ok=True)+ llm_mock = bin_dir / "llm"+ llm_mock.write_text("""#!/bin/bash+sleep 0.5+echo "feat(validation): add input validation utilities"+echo ""+echo "Add validation module with is_positive and is_non_empty helpers"+echo "for validating user input. Includes comprehensive test coverage."+""")+ llm_mock.chmod(0o755)+++def prepare_docs_select(env: DemoEnv):+ """Set up repo for docs wt-select demo (standard setup)."""+ prepare_demo_repo(env, REPO_ROOT)+++def prepare_twitter_core(env: DemoEnv):+ """Standard setup with hooks config for most Twitter demos."""+ hooks_config = '''[post-start]+dev = "npm run dev"++[pre-remove]+cleanup = "flyctl scale count 0"+'''+ prepare_demo_repo(env, REPO_ROOT, hooks_config=hooks_config)++ # Mock CLIs for hooks+ bin_dir = env.home / "bin"++ npm_mock = bin_dir / "npm"+ npm_mock.write_text("""#!/bin/bash+if [[ "$1" == "run" && "$2" == "dev" ]]; then+ echo ""+ echo " VITE v5.4.2 ready in 342 ms"+ echo ""+ echo " ➜ Local: http://localhost:3000/"+ echo " ➜ Network: http://192.168.1.42:3000/"+fi+""")+ npm_mock.chmod(0o755)++ flyctl_mock = bin_dir / "flyctl"+ flyctl_mock.write_text("""#!/bin/bash+if [[ "$1" == "scale" ]]; then+ echo "Scaling app to 0 machines"+fi+""")+ flyctl_mock.chmod(0o755)++ # User config with approved commands+ config_dir = env.home / ".config" / "worktrunk"+ project_id = str(env.bare_remote).removesuffix(".git")+ (config_dir / "config.toml").write_text(f'''[projects."{project_id}"]+approved-commands = ["npm run dev", "flyctl scale count 0"]+''')++ # Add billing branch (at same commit as main = merged)+ branch = "billing"+ path = env.work_base / f"acme.{branch}"+ git(["-C", str(env.repo), "worktree", "add", "-q", "-b", branch, str(path), "main"])+ git(["-C", str(path), "push", "-u", "origin", branch, "-q"])+++def prepare_twitter_switch(env: DemoEnv):+ """Simplified setup for wt-switch demo - launches real Claude Code UI."""+ simple_config = '''[post-start]+deps = "npm install"+'''+ prepare_demo_repo(env, REPO_ROOT, hooks_config=simple_config)++ bin_dir = env.home / "bin"++ # npm mock+ npm_mock = bin_dir / "npm"+ npm_mock.write_text("""#!/bin/bash+if [[ "$1" == "install" ]]; then+ echo "added 847 packages in 3.2s"+fi+""")+ npm_mock.chmod(0o755)++ # User config with approved command+ config_dir = env.home / ".config" / "worktrunk"+ project_id = str(env.bare_remote).removesuffix(".git")+ (config_dir / "config.toml").write_text(f'''[projects."{project_id}"]+approved-commands = ["npm install"]+''')++ # Configure Claude Code to skip all first-run dialogs+ main_repo_path = str(env.repo)+ alpha_worktree_path = str(env.work_base / "acme.alpha")+ dashboard_worktree_path = str(env.work_base / "acme.dashboard")+ api_key_suffix = os.environ.get("ANTHROPIC_API_KEY", "")[-20:] if os.environ.get("ANTHROPIC_API_KEY") else ""++ claude_json = env.home / ".claude.json"+ claude_json.write_text(f'''{{+ "numStartups": 100,+ "installMethod": "global",+ "theme": "light",+ "firstStartTime": "2025-01-01T00:00:00.000Z",+ "hasCompletedOnboarding": true,+ "hasCompletedClaudeInChromeOnboarding": true,+ "claudeInChromeDefaultEnabled": false,+ "sonnet45MigrationComplete": true,+ "opus45MigrationComplete": true,+ "thinkingMigrationComplete": true,+ "hasShownOpus45Notice": {{}},+ "lastReleaseNotesSeen": "99.0.0",+ "lastOnboardingVersion": "99.0.0",+ "oauthAccount": {{+ "displayName": "Demo User",+ "emailAddress": "[email protected]"+ }},+ "customApiKeyResponses": {{+ "approved": ["{api_key_suffix}"],+ "rejected": []+ }},+ "officialMarketplaceAutoInstalled": true,+ "tipsHistory": {{+ "new-user-warmup": 100,+ "terminal-setup": 100,+ "theme-command": 100+ }},+ "projects": {{+ "{main_repo_path}": {{+ "allowedTools": [],+ "hasTrustDialogAccepted": true+ }},+ "{alpha_worktree_path}": {{+ "allowedTools": [],+ "hasTrustDialogAccepted": true+ }},+ "{dashboard_worktree_path}": {{+ "allowedTools": [],+ "hasTrustDialogAccepted": true+ }}+ }}+}}''')++ # Claude settings.json+ claude_dir = env.home / ".claude"+ claude_dir.mkdir(exist_ok=True)+ settings_json = claude_dir / "settings.json"+ settings_json.write_text('''{+ "permissions": {+ "allow": [],+ "deny": [],+ "ask": []+ },+ "model": "claude-opus-4-5-20251101",+ "statusLine": {+ "type": "command",+ "command": "wt list statusline --claude-code"+ }+}''')+++def prepare_twitter_commit(env: DemoEnv):+ """Set up repo for wt-commit demo with LLM mock."""+ prepare_demo_repo(env, REPO_ROOT)++ # User config with llm commit generation+ config_dir = env.home / ".config" / "worktrunk"+ project_id = str(env.bare_remote).removesuffix(".git")+ (config_dir / "config.toml").write_text(f'''[commit-generation]+command = "llm"+args = ["-m", "claude-haiku-4.5"]++[projects."{project_id}"]+approved-commands = ["cargo nextest run"]+''')++ # Add uncommitted changes to hooks branch for commit demo+ hooks_path = env.work_base / "acme.hooks"+ if hooks_path.exists():+ new_file = hooks_path / "src" / "validation.rs"+ new_file.write_text('''//! Input validation utilities.++/// Validates that a number is positive.+pub fn is_positive(n: i32) -> bool {+ n > 0+}++/// Validates that a string is not empty.+pub fn is_non_empty(s: &str) -> bool {+ !s.trim().is_empty()+}++#[cfg(test)]+mod tests {+ use super::*;++ #[test]+ fn test_is_positive() {+ assert!(is_positive(1));+ assert!(!is_positive(0));+ assert!(!is_positive(-1));+ }+}+''')+ git(["-C", str(hooks_path), "add", "src/validation.rs"])++ # Mock llm CLI+ bin_dir = env.home / "bin"+ bin_dir.mkdir(exist_ok=True)+ llm_mock = bin_dir / "llm"+ llm_mock.write_text("""#!/bin/bash+sleep 0.5+echo "feat(validation): add input validation utilities"+echo ""+echo "Add validation module with is_positive and is_non_empty helpers"+echo "for validating user input. Includes comprehensive test coverage."+""")+ llm_mock.chmod(0o755)+++def prepare_twitter_merge(env: DemoEnv):+ """Set up repo for wt-merge demo with pre-commit hook."""+ prepare_demo_repo(env, REPO_ROOT)++ # User config with approved commands+ config_dir = env.home / ".config" / "worktrunk"+ project_id = str(env.bare_remote).removesuffix(".git")+ (config_dir / "config.toml").write_text(f'''[projects."{project_id}"]+approved-commands = ["cargo nextest run"]+''')+++def prepare_twitter_select(env: DemoEnv):+ """Set up repo for wt-select-short demo (standard setup)."""+ prepare_demo_repo(env, REPO_ROOT)+++def prepare_twitter_hooks(env: DemoEnv):+ """Setup for wt-hooks demo - more hooks to showcase the feature."""+ hooks_config = '''[post-start]+deps = "npm install"+dev = "npm run dev"++[pre-remove]+cleanup = "flyctl scale count 0"+'''+ prepare_demo_repo(env, REPO_ROOT, hooks_config=hooks_config)++ # Mock CLIs for hooks+ bin_dir = env.home / "bin"++ npm_mock = bin_dir / "npm"+ npm_mock.write_text("""#!/bin/bash+if [[ "$1" == "install" ]]; then+ echo "added 847 packages in 3.2s"+elif [[ "$1" == "run" && "$2" == "dev" ]]; then+ echo ""+ echo " VITE v5.4.2 ready in 342 ms"+ echo ""+ echo " ➜ Local: http://localhost:3000/"+ echo " ➜ Network: http://192.168.1.42:3000/"+fi+""")+ npm_mock.chmod(0o755)++ flyctl_mock = bin_dir / "flyctl"+ flyctl_mock.write_text("""#!/bin/bash+if [[ "$1" == "scale" ]]; then+ echo "Scaling app to 0 machines"+fi+""")+ flyctl_mock.chmod(0o755)++ # User config with approved commands+ config_dir = env.home / ".config" / "worktrunk"+ project_id = str(env.bare_remote).removesuffix(".git")+ (config_dir / "config.toml").write_text(f'''[projects."{project_id}"]+approved-commands = ["npm install", "npm run dev", "flyctl scale count 0"]+''')++ # Add billing branch (at same commit as main = merged)+ branch = "billing"+ path = env.work_base / f"acme.{branch}"+ git(["-C", str(env.repo), "worktree", "add", "-q", "-b", branch, str(path), "main"])+ git(["-C", str(path), "push", "-u", "origin", branch, "-q"])+++def prepare_twitter_zellij(env: DemoEnv):+ """Setup for wt-zellij demo - multiple Claude Code instances in Zellij tabs."""+ # No hooks for this demo - keep it simple+ prepare_demo_repo(env, REPO_ROOT, hooks_config='')++ bin_dir = env.home / "bin"+ bin_dir.mkdir(exist_ok=True)++ # User config - no approved commands needed (no hooks)+ config_dir = env.home / ".config" / "worktrunk"+ config_dir.mkdir(parents=True, exist_ok=True)++ # Fish config - define wsl abbreviation so it works in all Zellij tabs+ fish_config_dir = env.home / ".config" / "fish"+ fish_config_dir.mkdir(parents=True, exist_ok=True)+ fish_config = fish_config_dir / "config.fish"+ fish_config.write_text('''# Demo fish config+set -U fish_greeting ""+# wsl abbreviation: switch to worktree and launch Claude (no --create, worktrees pre-created)+abbr --add wsl 'wt switch --execute=claude'+starship init fish | source+wt config shell init fish | source++# Auto-rename Zellij tabs based on git branch (for demo)+function __zellij_tab_rename --on-variable PWD+ if set -q ZELLIJ+ # Get git branch name, fallback to directory basename+ set -l branch (git rev-parse --abbrev-ref HEAD 2>/dev/null)+ if test -n "$branch"+ zellij action rename-tab $branch+ end+ end+end+''')++ # Zellij config directory+ zellij_config_dir = env.home / ".config" / "zellij"+ zellij_config_dir.mkdir(parents=True, exist_ok=True)+ zellij_plugins_dir = zellij_config_dir / "plugins"+ zellij_plugins_dir.mkdir(exist_ok=True)++ # Copy Zellij plugins from real HOME+ if REAL_ZELLIJ_PLUGINS.exists():+ for plugin in REAL_ZELLIJ_PLUGINS.glob("*.wasm"):+ shutil.copy(plugin, zellij_plugins_dir / plugin.name)++ # Minimal Zellij config that loads the plugins+ zellij_config = zellij_config_dir / "config.kdl"+ zellij_config.write_text(f'''// Demo Zellij config+default_shell "fish"+pane_frames false+show_startup_tips false+show_release_notes false+theme "warm-gold"++// Warm gold theme to match the demo aesthetic+// In light themes: black = light bg (tab bar), white = dark text+themes {{+ warm-gold {{+ fg "#1f2328"+ bg "#FFFDF8"+ black "#f5f0e8"+ red "#d73a49"+ green "#22863a"+ yellow "#d29922"+ blue "#0969da"+ magenta "#8250df"+ cyan "#1b7c83"+ white "#57534e"+ orange "#d97706"+ }}+}}++load_plugins {{+ "file:{zellij_plugins_dir}/zellij-tab-name.wasm"+}}++keybinds clear-defaults=true {{+ normal {{+ bind "Ctrl Space" {{ SwitchToMode "tmux"; }}+ }}+ tmux {{+ bind "p" {{ SwitchToMode "pane"; }}+ bind "t" {{ SwitchToMode "tab"; }}+ bind "q" {{ Quit; }}+ }}+ tab {{+ bind "n" {{ NewTab; SwitchToMode "Normal"; }}+ bind "h" "Left" {{ GoToPreviousTab; SwitchToMode "Normal"; }}+ bind "l" "Right" {{ GoToNextTab; SwitchToMode "Normal"; }}+ bind "1" {{ GoToTab 1; SwitchToMode "Normal"; }}+ bind "2" {{ GoToTab 2; SwitchToMode "Normal"; }}+ bind "3" {{ GoToTab 3; SwitchToMode "Normal"; }}+ bind "4" {{ GoToTab 4; SwitchToMode "Normal"; }}+ }}+ shared_except "locked" {{+ bind "Ctrl t" {{ NewTab; }}+ bind "Ctrl n" {{ NewPane; }}+ }}+ shared_except "normal" {{+ bind "Ctrl Space" "Ctrl c" {{ SwitchToMode "normal"; }}+ bind "Esc" {{ SwitchToMode "normal"; }}+ }}+}}+''')++ # Configure Claude Code to skip all first-run dialogs+ main_repo_path = str(env.repo)+ api_key_suffix = os.environ.get("ANTHROPIC_API_KEY", "")[-20:] if os.environ.get("ANTHROPIC_API_KEY") else ""++ # Pre-approve all the worktree paths we'll create+ worktree_branches = ["api", "billing", "auth", "metrics"]+ projects_config = {+ main_repo_path: {"allowedTools": [], "hasTrustDialogAccepted": True}+ }+ for branch in worktree_branches:+ path = str(env.work_base / f"acme.{branch}")+ projects_config[path] = {"allowedTools": [], "hasTrustDialogAccepted": True}++ projects_json = json.dumps(projects_config, indent=4)++ claude_json = env.home / ".claude.json"+ claude_json.write_text(f'''{{+ "numStartups": 100,+ "installMethod": "global",+ "theme": "light",+ "firstStartTime": "2025-01-01T00:00:00.000Z",+ "hasCompletedOnboarding": true,+ "hasCompletedClaudeInChromeOnboarding": true,+ "claudeInChromeDefaultEnabled": false,+ "sonnet45MigrationComplete": true,+ "opus45MigrationComplete": true,+ "thinkingMigrationComplete": true,+ "hasShownOpus45Notice": {{}},+ "lastReleaseNotesSeen": "99.0.0",+ "lastOnboardingVersion": "99.0.0",+ "oauthAccount": {{+ "displayName": "Demo User",+ "emailAddress": "[email protected]"+ }},+ "customApiKeyResponses": {{+ "approved": ["{api_key_suffix}"],+ "rejected": []+ }},+ "officialMarketplaceAutoInstalled": true,+ "tipsHistory": {{+ "new-user-warmup": 100,+ "terminal-setup": 100,+ "theme-command": 100+ }},+ "projects": {projects_json}+}}''')++ # Claude settings.json - pre-approve common tools to avoid permission prompts+ claude_dir = env.home / ".claude"+ claude_dir.mkdir(exist_ok=True)+ settings_json = claude_dir / "settings.json"+ settings_json.write_text('''{+ "permissions": {+ "allow": [+ "Bash",+ "Read",+ "Write",+ "Edit",+ "Glob",+ "Grep",+ "Task",+ "TodoWrite"+ ],+ "deny": [],+ "ask": []+ },+ "model": "claude-opus-4-5-20251101",+ "statusLine": {+ "type": "command",+ "command": "wt list statusline --claude-code"+ }+}''')++ # Pre-create ALL worktrees before recording to avoid race conditions with Claude+ demo_env = {**os.environ, "HOME": str(env.home)}+ for branch in worktree_branches:+ subprocess.run(+ ["wt", "switch", "--create", branch],+ cwd=str(env.repo),+ env=demo_env,+ capture_output=True+ )++ # Add uncommitted changes to api worktree for git diff demo+ api_worktree = env.work_base / "acme.api"+ api_lib = api_worktree / "src" / "lib.rs"+ if api_lib.exists():+ content = api_lib.read_text()+ new_content = content.replace(+ 'pub fn add(',+ '// TODO: Add input validation\npub fn add('+ )+ new_content += '''+pub fn validate_input(n: i32) -> bool {+ n >= 0 && n < 1000+}+'''+ api_lib.write_text(new_content)+++def prepare_twitter_zellij_omnibus(env: DemoEnv):+ """Setup for wt-zellij-omnibus demo - comprehensive showcase."""+ # Hooks config with post-start, pre-merge, and URL template+ hooks_config = '''[post-start]+dev = "npm run dev -- --port {{ branch | hash_port }} &"++[pre-merge]+test = "cargo nextest run"++[list]+url = "http://localhost:{{ branch | hash_port }}"+'''+ prepare_demo_repo(env, REPO_ROOT, hooks_config=hooks_config)++ # Enable git colors for non-TTY environments (VHS)+ git(["-C", str(env.repo), "config", "color.ui", "always"])++ bin_dir = env.home / "bin"+ bin_dir.mkdir(exist_ok=True)++ # npm mock for post-start hooks+ npm_mock = bin_dir / "npm"+ npm_mock.write_text("""#!/bin/bash+if [[ "$1" == "run" && "$2" == "dev" ]]; then+ echo ""+ echo " VITE v5.4.2 ready in 342 ms"+ echo ""+ echo " ➜ Local: http://localhost:$4/"+ echo " ➜ Network: http://192.168.1.42:$4/"+fi+""")+ npm_mock.chmod(0o755)++ # LLM mock for wt step commit+ llm_mock = bin_dir / "llm"+ llm_mock.write_text("""#!/bin/bash+sleep 0.5+echo "feat: add user settings module"+echo ""+echo "Add placeholder module for user profile settings."+""")+ llm_mock.chmod(0o755)++ # cargo mock for pre-merge hook (nextest run)+ cargo_mock = bin_dir / "cargo"+ cargo_mock.write_text(r"""#!/bin/bash+if [[ "$1" == "nextest" && "$2" == "run" ]]; then+ sleep 0.3+ echo " Finished \`test\` profile [unoptimized + debuginfo] target(s) in 0.02s"+ echo " Starting 2 tests across 1 binary"+ echo " PASS [ 0.001s] acme::tests::test_add"+ echo " PASS [ 0.001s] acme::tests::test_add_zeros"+ echo "------------"+ echo " Summary [ 0.002s] 2 tests run: 2 passed, 0 skipped"+fi+""")+ cargo_mock.chmod(0o755)++ # User config with LLM commit generation and approved commands+ config_dir = env.home / ".config" / "worktrunk"+ config_dir.mkdir(parents=True, exist_ok=True)++ project_id = str(env.bare_remote).removesuffix(".git")+ (config_dir / "config.toml").write_text(f'''[commit-generation]+command = "llm"+args = ["-m", "claude-haiku-4.5"]++[projects."{project_id}"]+approved-commands = ["npm run dev -- --port {{{{ branch | hash_port }}}} &", "cargo nextest run"]+''')++ # Fish config - define wsl abbreviation so it works in all Zellij tabs+ fish_config_dir = env.home / ".config" / "fish"+ fish_config_dir.mkdir(parents=True, exist_ok=True)+ fish_config = fish_config_dir / "config.fish"+ fish_config.write_text('''# Demo fish config+set -U fish_greeting ""+# wsl abbreviation: switch --create with Claude execute+abbr --add wsl 'wt switch --execute=claude --create'+starship init fish | source+wt config shell init fish | source++# Auto-rename Zellij tabs based on git branch (for demo)+function __zellij_tab_rename --on-variable PWD+ if set -q ZELLIJ+ # Get git branch name, fallback to directory basename+ set -l branch (git rev-parse --abbrev-ref HEAD 2>/dev/null)+ if test -n "$branch"+ zellij action rename-tab $branch+ end+ end+end+''')++ # Zellij config directory+ zellij_config_dir = env.home / ".config" / "zellij"+ zellij_config_dir.mkdir(parents=True, exist_ok=True)+ zellij_plugins_dir = zellij_config_dir / "plugins"+ zellij_plugins_dir.mkdir(exist_ok=True)++ # Copy Zellij plugins from real HOME+ if REAL_ZELLIJ_PLUGINS.exists():+ for plugin in REAL_ZELLIJ_PLUGINS.glob("*.wasm"):+ shutil.copy(plugin, zellij_plugins_dir / plugin.name)++ # Minimal Zellij config that loads the plugins+ zellij_config = zellij_config_dir / "config.kdl"+ zellij_config.write_text(f'''// Demo Zellij config+default_shell "fish"+default_cwd "{env.repo}"+pane_frames false+show_startup_tips false+show_release_notes false+theme "warm-gold"++// Warm gold theme to match the demo aesthetic+themes {{+ warm-gold {{+ fg "#1f2328"+ bg "#FFFDF8"+ black "#f5f0e8"+ red "#d73a49"+ green "#22863a"+ yellow "#d29922"+ blue "#0969da"+ magenta "#8250df"+ cyan "#1b7c83"+ white "#57534e"+ orange "#d97706"+ }}+}}++load_plugins {{+ "file:{zellij_plugins_dir}/zellij-tab-name.wasm"+}}++keybinds clear-defaults=true {{+ normal {{+ bind "Ctrl Space" {{ SwitchToMode "tmux"; }}+ }}+ tmux {{+ bind "p" {{ SwitchToMode "pane"; }}+ bind "t" {{ SwitchToMode "tab"; }}+ bind "q" {{ Quit; }}+ }}+ tab {{+ bind "n" {{ NewTab; SwitchToMode "Normal"; }}+ bind "h" "Left" {{ GoToPreviousTab; SwitchToMode "Normal"; }}+ bind "l" "Right" {{ GoToNextTab; SwitchToMode "Normal"; }}+ bind "1" {{ GoToTab 1; SwitchToMode "Normal"; }}+ bind "2" {{ GoToTab 2; SwitchToMode "Normal"; }}+ bind "3" {{ GoToTab 3; SwitchToMode "Normal"; }}+ bind "4" {{ GoToTab 4; SwitchToMode "Normal"; }}+ }}+ shared_except "locked" {{+ bind "Ctrl t" {{ NewTab; }}+ bind "Ctrl n" {{ NewPane; }}+ }}+ shared_except "normal" {{+ bind "Ctrl Space" "Ctrl c" {{ SwitchToMode "normal"; }}+ bind "Esc" {{ SwitchToMode "normal"; }}+ }}+}}+''')++ # Configure Claude Code to skip all first-run dialogs+ main_repo_path = str(env.repo)+ api_key_suffix = os.environ.get("ANTHROPIC_API_KEY", "")[-20:] if os.environ.get("ANTHROPIC_API_KEY") else ""++ # Pre-approve all the worktree paths we'll create (including 'feature' created during demo)+ worktree_branches = ["api", "auth", "billing", "feature"]+ projects_config = {+ main_repo_path: {"allowedTools": [], "hasTrustDialogAccepted": True}+ }+ for branch in worktree_branches:+ path = str(env.work_base / f"acme.{branch}")+ projects_config[path] = {"allowedTools": [], "hasTrustDialogAccepted": True}++ projects_json = json.dumps(projects_config, indent=4)++ claude_json = env.home / ".claude.json"+ claude_json.write_text(f'''{{+ "numStartups": 100,+ "installMethod": "global",+ "theme": "light",+ "firstStartTime": "2025-01-01T00:00:00.000Z",+ "hasCompletedOnboarding": true,+ "hasCompletedClaudeInChromeOnboarding": true,+ "claudeInChromeDefaultEnabled": false,+ "sonnet45MigrationComplete": true,+ "opus45MigrationComplete": true,+ "thinkingMigrationComplete": true,+ "hasShownOpus45Notice": {{}},+ "lastReleaseNotesSeen": "99.0.0",+ "lastOnboardingVersion": "99.0.0",+ "oauthAccount": {{+ "displayName": "Demo User",+ "emailAddress": "[email protected]"+ }},+ "customApiKeyResponses": {{+ "approved": ["{api_key_suffix}"],+ "rejected": []+ }},+ "officialMarketplaceAutoInstalled": true,+ "tipsHistory": {{+ "new-user-warmup": 100,+ "terminal-setup": 100,+ "theme-command": 100+ }},+ "projects": {projects_json}+}}''')++ # Claude settings.json - pre-approve common tools to avoid permission prompts+ claude_dir = env.home / ".claude"+ claude_dir.mkdir(exist_ok=True)+ settings_json = claude_dir / "settings.json"+ settings_json.write_text('''{+ "permissions": {+ "allow": [+ "Bash",+ "Read",+ "Write",+ "Edit",+ "Glob",+ "Grep",+ "Task",+ "TodoWrite"+ ],+ "deny": [],+ "ask": []+ },+ "model": "claude-opus-4-5-20251101",+ "statusLine": {+ "type": "command",+ "command": "wt list statusline --claude-code"+ },+ "enableLspRecommendations": false+}''')++ # Pre-create worktrees (api and auth only - billing created during demo)+ demo_env = {+ **os.environ,+ "HOME": str(env.home),+ "PATH": f"{REPO_ROOT}/target/debug:{env.home}/bin:{os.environ.get('PATH', '')}"+ }++ def run_wt(args, cwd):+ """Run wt command with error checking."""+ result = subprocess.run(+ ["wt"] + args,+ cwd=str(cwd),+ env=demo_env,+ capture_output=True,+ text=True+ )+ if result.returncode != 0:+ raise RuntimeError(f"wt {' '.join(args)} failed: {result.stderr}")+ return result++ # api branch: feature branch (Claude will work on it and we'll merge at end)+ run_wt(["switch", "--create", "api"], env.repo)+ api_worktree = env.work_base / "acme.api"+ git(["-C", str(api_worktree), "push", "-u", "origin", "api", "-q"])++ # auth branch: clean feature branch (will be removed with wt remove)+ run_wt(["switch", "--create", "auth"], env.repo)+ auth_worktree = env.work_base / "acme.auth"+ git(["-C", str(auth_worktree), "push", "-u", "origin", "auth", "-q"])++ # billing branch: NOT pre-created - demo shows wsl abbreviation creating it++ # Return to main worktree for the demo to start+ run_wt(["switch", "main"], api_worktree)+++# =============================================================================+# Demo Registrations+# =============================================================================++# Format: (tape_file, output_name, setup_func, vhs_type, size_override)+# size_override is optional - if None, uses target default++DOCS_DEMOS = [+ ("wt-core.tape", "wt-core", prepare_docs_core, "vhs", None),+ ("wt-merge.tape", "wt-merge", prepare_docs_merge, "vhs", None),+ ("wt-select.tape", "wt-select", prepare_docs_select, "vhs-keystrokes", None),+]++TWITTER_DEMOS = [+ ("wt-switch.tape", "wt-switch", prepare_twitter_switch, "vhs", None),+ ("wt-statusline.tape", "wt-statusline", prepare_twitter_switch, "vhs", None),+ ("wt-list.tape", "wt-list", prepare_twitter_core, "vhs", None),+ ("wt-list-remove.tape", "wt-list-remove", prepare_twitter_core, "vhs", None),+ ("wt-hooks.tape", "wt-hooks", prepare_twitter_hooks, "vhs", None),+ ("wt-commit.tape", "wt-commit", prepare_twitter_commit, "vhs", None),+ ("wt-merge.tape", "wt-merge", prepare_twitter_merge, "vhs", None),+ ("wt-select-short.tape", "wt-select-short", prepare_twitter_select, "vhs-keystrokes", None),+ ("wt-core.tape", "wt-core", prepare_twitter_core, "vhs", None),+ ("wt-zellij.tape", "wt-zellij", prepare_twitter_zellij, "vhs", SIZE_ZELLIJ),+ ("wt-zellij-omnibus.tape", "wt-zellij-omnibus", prepare_twitter_zellij_omnibus, "vhs", SIZE_ZELLIJ),+]++TARGETS = {+ "docs": {+ "demos": DOCS_DEMOS,+ "default_size": SIZE_DOCS,+ "themes": ["light", "dark"],+ },+ "twitter": {+ "demos": TWITTER_DEMOS,+ "default_size": SIZE_TWITTER,+ "themes": ["light"],+ },+}+++# =============================================================================+# Main+# =============================================================================++def spawn_debug_shell(env: DemoEnv, starship_config: Path):+ """Spawn an interactive fish shell with the demo environment set up."""+ shell_env = os.environ.copy()+ shell_env.update({+ "HOME": str(env.home),+ "XDG_CONFIG_HOME": str(env.home / ".config"),+ "STARSHIP_CONFIG": str(starship_config),+ "PATH": f"{REPO_ROOT / 'target' / 'debug'}:{env.home / 'bin'}:{os.environ.get('PATH', '')}",+ # Keep real rustup/cargo for any rust tools+ "RUSTUP_HOME": str(Path.home() / ".rustup"),+ "CARGO_HOME": str(Path.home() / ".cargo"),+ })++ print(f"\nSpawning fish shell in demo environment...")+ print(f" HOME={env.home}")+ print(f" Demo repo: {env.repo}\n")++ init_cmd = "starship init fish | source; wt config shell init fish | source"+ subprocess.run(["fish", "-C", init_cmd], env=shell_env, cwd=str(env.repo))+++def main():+ parser = argparse.ArgumentParser(+ description="Build demo GIFs for worktrunk",+ formatter_class=argparse.RawDescriptionHelpFormatter,+ epilog="""+Examples:+ ./build docs Build all doc site demos (light + dark)+ ./build twitter Build all Twitter demos (light only)+ ./build docs --only wt-merge Build specific demo for docs+ ./build twitter --only wt-zellij --shell Debug shell for demo+"""+ )+ parser.add_argument("target", choices=["docs", "twitter"],+ help="Target to build demos for")+ parser.add_argument("--only", help="Only record specific demo (e.g., wt-switch)")+ parser.add_argument("--shell", action="store_true",+ help="Build demo and spawn interactive shell for debugging (requires --only)")+ args = parser.parse_args()++ if args.shell and not args.only:+ print("--shell requires --only to specify which demo to debug")+ return++ # Check dependencies+ deps = ["wt", "vhs", "starship"]+ if args.target == "twitter":+ deps.append("zellij")+ check_dependencies(deps)++ starship_config = setup_demo_output(OUT_DIR)++ target_config = TARGETS[args.target]+ demos = target_config["demos"]+ default_size = target_config["default_size"]+ themes = target_config["themes"]++ # Filter demos if --only specified+ if args.only:+ demos = [(t, n, s, v, sz) for t, n, s, v, sz in demos if n == args.only]+ if not demos:+ all_names = [n for _, n, _, _, _ in target_config["demos"]]+ print(f"Unknown demo: {args.only}")+ print(f"Available for {args.target}: {', '.join(all_names)}")+ return++ # Check vhs-keystrokes availability+ vhs_keystrokes_available = Path(VHS_KEYSTROKES).exists()+ if not vhs_keystrokes_available:+ print(f"Note: vhs-keystrokes not found at {VHS_KEYSTROKES}")+ print("wt-select demos will be skipped. See docs/demos/CLAUDE.md")++ # Record each demo+ for tape_file, output_name, setup_func, vhs_type, size_override in demos:+ tape_path = TAPES_DIR / tape_file+ if not tape_path.exists():+ print(f"Skipping {output_name}: {tape_file} not found")+ continue++ # Check if this demo needs vhs-keystrokes+ if vhs_type == "vhs-keystrokes" and not vhs_keystrokes_available:+ print(f"Skipping {output_name}: requires vhs-keystrokes")+ continue++ vhs_binary = VHS_KEYSTROKES if vhs_type == "vhs-keystrokes" else "vhs"+ demo_size = size_override or default_size++ # Build output GIF paths based on themes+ output_gifs = {"light": OUT_DIR / f"{output_name}.gif"}+ if "dark" in themes:+ output_gifs["dark"] = OUT_DIR / f"{output_name}-dark.gif"++ print(f"\n{'='*60}")+ print(f"Recording {output_name} ({args.target})...")+ print(f"{'='*60}")++ # Create fresh environment for each demo+ # Use /private/tmp for Zellij demos to isolate Claude instances+ demo_out_dir = Path("/private/tmp/wt-demos") if output_name.startswith("wt-zellij") else OUT_DIR+ setup_demo_output(demo_out_dir)+ env = DemoEnv(name=output_name, out_dir=demo_out_dir, repo_name="acme")+ setup_func(env)++ print(f"Demo repo: {env.repo}")++ if args.shell:+ spawn_debug_shell(env, starship_config)+ return # Only debug one demo at a time++ record_all_themes(env, tape_path, output_gifs, REPO_ROOT, vhs_binary=vhs_binary, size=demo_size)+++if __name__ == "__main__":+ main()diff --git a/docs/demos/docs/build b/docs/demos/docs/builddeleted file mode 100755index ae17481bf..000000000--- a/docs/demos/docs/build+++ /dev/null@@ -1,235 +0,0 @@-#!/usr/bin/env python3-"""Build script for documentation site demo GIFs.--Records demos used on the main doc site:-- wt-core: Full workflow (list, switch, config, create, list --full, remove)-- wt-merge: Full merge workflow with LLM commit generation-- wt-select: Interactive worktree selector with preview panels-"""--import os-import shutil-import sys-from pathlib import Path--# Add docs/demos/ to path for shared library-SCRIPT_DIR = Path(__file__).parent-DEMOS_DIR = SCRIPT_DIR.parent-sys.path.insert(0, str(DEMOS_DIR))--from shared import (- DemoEnv, git, prepare_demo_repo,- check_dependencies, setup_demo_output, record_all_themes,- SIZE_DOCS,-)--REPO_ROOT = DEMOS_DIR.parent.parent-OUT_DIR = SCRIPT_DIR / "out"-TAPES_DIR = DEMOS_DIR / "tapes"--# All tapes to record: (tape_file, output_base_name, setup_func, vhs_binary)-# Tapes are in ../tapes/ (shared with twitter build)-DEMOS = [- ("wt-core.tape", "wt-core", "core", "vhs"),- ("wt-merge.tape", "wt-merge", "merge", "vhs"),- ("wt-select.tape", "wt-select", "select", "vhs-keystrokes"),-]--# Custom VHS binary with keystroke overlay (for wt-select)-VHS_KEYSTROKES = os.environ.get(- "VHS_KEYSTROKES",- str(DEMOS_DIR / "vhs-keystrokes" / "vhs-keystrokes")-)---def prepare_core(env: DemoEnv):- """Set up repo for wt-core demo with hooks, mocks, and billing branch."""- hooks_config = '''[post-start]-deps = "npm install"-build = "npm run build"-dev = "npm run dev"-db = "docker compose up -d postgres"--[pre-remove]-cleanup = "flyctl scale count 0"-'''- prepare_demo_repo(env, REPO_ROOT, hooks_config=hooks_config)-- # Mock CLIs for hooks- bin_dir = env.home / "bin"-- npm_mock = bin_dir / "npm"- npm_mock.write_text("""#!/bin/bash-if [[ "$1" == "install" ]]; then- echo "added 847 packages in 3.2s"-elif [[ "$1" == "run" && "$2" == "build" ]]; then- echo "vite v5.4.2 building for production..."- echo "✓ 142 modules transformed"- echo "dist/index.js 45.2 kB │ gzip: 14.8 kB"-elif [[ "$1" == "run" && "$2" == "dev" ]]; then- echo ""- echo " VITE v5.4.2 ready in 342 ms"- echo ""- echo " ➜ Local: http://localhost:3000/"-fi-""")- npm_mock.chmod(0o755)-- docker_mock = bin_dir / "docker"- docker_mock.write_text("""#!/bin/bash-if [[ "$1" == "compose" && "$2" == "up" ]]; then- echo "[+] Running 1/1"- echo " ✔ Container postgres Started"-fi-""")- docker_mock.chmod(0o755)-- flyctl_mock = bin_dir / "flyctl"- flyctl_mock.write_text("""#!/bin/bash-if [[ "$1" == "scale" && "$2" == "count" && "$3" == "0" ]]; then- echo "Scaling app to 0 machines"-fi-""")- flyctl_mock.chmod(0o755)-- # User config with approved commands- config_dir = env.home / ".config" / "worktrunk"- project_id = str(env.bare_remote).removesuffix(".git")- (config_dir / "config.toml").write_text(f'''[projects."{project_id}"]-approved-commands = ["npm install", "npm run build", "npm run dev", "docker compose up -d postgres", "flyctl scale count 0"]-''')-- # Add billing branch (at same commit as main = merged)- branch = "billing"- path = env.work_base / f"acme.{branch}"- git(["-C", str(env.repo), "worktree", "add", "-q", "-b", branch, str(path), "main"])- git(["-C", str(path), "push", "-u", "origin", branch, "-q"])---def prepare_merge(env: DemoEnv):- """Set up repo for wt-merge demo with LLM mock."""- prepare_demo_repo(env, REPO_ROOT)-- # User config with llm commit generation- config_dir = env.home / ".config" / "worktrunk"- project_id = str(env.bare_remote).removesuffix(".git")- (config_dir / "config.toml").write_text(f'''[commit-generation]-command = "llm"-args = ["-m", "claude-haiku-4.5"]--[projects."{project_id}"]-approved-commands = ["cargo nextest run"]-''')-- # Add uncommitted changes to hooks branch for commit demo- hooks_path = env.work_base / "acme.hooks"- if hooks_path.exists():- new_file = hooks_path / "src" / "validation.rs"- new_file.write_text('''//! Input validation utilities.--/// Validates that a number is positive.-pub fn is_positive(n: i32) -> bool {- n > 0-}--/// Validates that a string is not empty.-pub fn is_non_empty(s: &str) -> bool {- !s.trim().is_empty()-}--#[cfg(test)]-mod tests {- use super::*;-- #[test]- fn test_is_positive() {- assert!(is_positive(1));- assert!(!is_positive(0));- assert!(!is_positive(-1));- }-}-''')- git(["-C", str(hooks_path), "add", "src/validation.rs"])-- # Mock llm CLI- bin_dir = env.home / "bin"- bin_dir.mkdir(exist_ok=True)- llm_mock = bin_dir / "llm"- llm_mock.write_text("""#!/bin/bash-sleep 0.5-echo "feat(validation): add input validation utilities"-echo ""-echo "Add validation module with is_positive and is_non_empty helpers"-echo "for validating user input. Includes comprehensive test coverage."-""")- llm_mock.chmod(0o755)---def prepare_select(env: DemoEnv):- """Set up repo for wt-select demo (standard setup)."""- prepare_demo_repo(env, REPO_ROOT)---SETUP_FUNCS = {- "core": prepare_core,- "merge": prepare_merge,- "select": prepare_select,-}---def main():- import argparse- parser = argparse.ArgumentParser()- parser.add_argument("--only", help="Only record specific demo (e.g., wt-select)")- args = parser.parse_args()-- check_dependencies(["wt", "vhs", "starship"])- setup_demo_output(OUT_DIR)-- # Filter demos if --only specified- demos_to_record = DEMOS- if args.only:- demos_to_record = [(t, n, s, v) for t, n, s, v in DEMOS if n == args.only]- if not demos_to_record:- print(f"Unknown demo: {args.only}")- print(f"Available: {', '.join(n for _, n, _, _ in DEMOS)}")- return-- # Check vhs-keystrokes availability for wt-select- vhs_keystrokes_available = Path(VHS_KEYSTROKES).exists()- if not vhs_keystrokes_available:- print(f"Note: vhs-keystrokes not found at {VHS_KEYSTROKES}")- print("wt-select demo will be skipped. See docs/demos/vhs-keystrokes/README.md")-- # Record each demo- for tape_file, output_name, setup_key, vhs_type in demos_to_record:- tape_path = TAPES_DIR / tape_file- if not tape_path.exists():- print(f"Skipping {output_name}: {tape_file} not found")- continue-- # Check if this demo needs vhs-keystrokes- if vhs_type == "vhs-keystrokes" and not vhs_keystrokes_available:- print(f"Skipping {output_name}: requires vhs-keystrokes")- continue-- vhs_binary = VHS_KEYSTROKES if vhs_type == "vhs-keystrokes" else "vhs"-- output_gifs = {- "light": OUT_DIR / f"{output_name}.gif",- "dark": OUT_DIR / f"{output_name}-dark.gif",- }- print(f"\n{'='*60}")- print(f"Recording {output_name}...")- print(f"{'='*60}")-- # Create fresh environment for each demo- env = DemoEnv(name=output_name, out_dir=OUT_DIR, repo_name="acme")- SETUP_FUNCS[setup_key](env)-- print(f"Demo repo: {env.repo}")- record_all_themes(env, tape_path, output_gifs, REPO_ROOT, vhs_binary=vhs_binary, size=SIZE_DOCS)---if __name__ == "__main__":- main()diff --git a/docs/demos/review.html b/docs/demos/review.htmldeleted file mode 100644index 9762578e4..000000000--- a/docs/demos/review.html+++ /dev/null@@ -1,245 +0,0 @@-<!DOCTYPE html>-<html lang="en">-<head>- <meta charset="UTF-8">- <meta name="viewport" content="width=device-width, initial-scale=1.0">- <title>Worktrunk Twitter Demo Review</title>- <style>- * { box-sizing: border-box; }- body {- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;- background: #1a1a1a;- color: #e0e0e0;- margin: 0;- padding: 20px;- }- h1 {- text-align: center;- margin-bottom: 10px;- }- .subtitle {- text-align: center;- color: #888;- margin-bottom: 30px;- }- .controls {- text-align: center;- margin-bottom: 20px;- }- .controls button {- background: #333;- color: #e0e0e0;- border: 1px solid #555;- padding: 8px 16px;- margin: 0 5px;- cursor: pointer;- border-radius: 4px;- }- .controls button:hover {- background: #444;- }- .controls button.active {- background: #0066cc;- border-color: #0066cc;- }- .grid {- display: grid;- grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));- gap: 20px;- max-width: 1600px;- margin: 0 auto;- }- .demo {- background: #252525;- border-radius: 8px;- overflow: hidden;- }- .demo-header {- padding: 12px 16px;- background: #333;- display: flex;- justify-content: space-between;- align-items: center;- }- .demo-title {- font-weight: 600;- font-size: 14px;- }- .demo-tweet {- font-size: 12px;- color: #888;- }- .demo-content {- padding: 10px;- min-height: 300px;- display: flex;- align-items: center;- justify-content: center;- }- .demo-content img {- max-width: 100%;- height: auto;- border-radius: 4px;- }- .demo-content.missing {- color: #666;- font-style: italic;- }- .demo-footer {- padding: 8px 16px;- background: #2a2a2a;- font-size: 12px;- color: #888;- }- .status {- display: inline-block;- padding: 2px 8px;- border-radius: 3px;- font-size: 11px;- margin-left: 8px;- }- .status.exists { background: #1a4d1a; color: #4ade80; }- .status.new { background: #4d3d1a; color: #fbbf24; }- .status.missing { background: #4d1a1a; color: #f87171; }- .refresh-note {- text-align: center;- color: #666;- font-size: 12px;- margin-top: 20px;- }- </style>-</head>-<body>- <h1>Worktrunk Twitter Demos</h1>- <p class="subtitle">Review page for Twitter thread launch demos</p>-- <div class="controls">- <button class="active" onclick="setTheme('light')">Light Theme</button>- <button onclick="setTheme('dark')">Dark Theme</button>- <button onclick="refreshAll()">Refresh All</button>- </div>-- <div class="grid" id="demos"></div>-- <p class="refresh-note">Images auto-refresh every 30 seconds. Click "Refresh All" to force refresh.</p>-- <script>- const demos = [- {- id: 'wt-demo',- title: 'wt-core.gif',- tweet: 'Tweet 1: Intro',- source: 'wt-core',- file: '../static/assets/wt-core',- status: 'exists'- },- {- id: 'wt-switch',- title: 'wt-switch.gif',- tweet: 'Tweet 3: Switch',- source: 'wt-core',- file: '../static/assets/wt-switch',- status: 'new'- },- {- id: 'wt-list-remove',- title: 'wt-list-remove.gif',- tweet: 'Tweet 4: List & Remove',- source: 'wt-core',- file: '../static/assets/wt-list-remove',- status: 'new'- },- {- id: 'wt-hooks',- title: 'wt-hooks.gif',- tweet: 'Tweet 5: Hooks',- source: 'wt-core',- file: '../static/assets/wt-hooks',- status: 'new'- },- {- id: 'wt-list',- title: 'wt-list.gif',- tweet: 'Tweet 6: List Progressive',- source: 'wt-core',- file: '../static/assets/wt-list',- status: 'new'- },- {- id: 'wt-select',- title: 'wt-select-short.gif',- tweet: 'Tweet 8: Select',- source: 'wt-select',- file: '../static/assets/wt-select-short',- status: 'new'- },- {- id: 'wt-commit',- title: 'wt-commit.gif',- tweet: 'Tweet 9: Commit',- source: 'wt-merge',- file: '../static/assets/wt-commit',- status: 'new'- },- {- id: 'wt-merge',- title: 'wt-merge.gif',- tweet: 'Tweet 10: Merge',- source: 'wt-merge',- file: '../static/assets/wt-merge',- status: 'exists'- },- ];-- let currentTheme = 'light';-- function getGifPath(demo) {- const suffix = currentTheme === 'dark' ? '-dark' : '';- return `${demo.file}${suffix}.gif`;- }-- function renderDemos() {- const container = document.getElementById('demos');- const timestamp = Date.now();-- container.innerHTML = demos.map(demo => `- <div class="demo" id="demo-${demo.id}">- <div class="demo-header">- <span>- <span class="demo-title">${demo.title}</span>- <span class="status ${demo.status}">${demo.status}</span>- </span>- <span class="demo-tweet">${demo.tweet}</span>- </div>- <div class="demo-content" id="content-${demo.id}">- <img src="${getGifPath(demo)}?t=${timestamp}"- alt="${demo.title}"- onerror="this.parentElement.innerHTML='<span class=missing>Not yet created</span>'" />- </div>- <div class="demo-footer">- Source: ${demo.source} • ${demo.file}.gif- </div>- </div>- `).join('');- }-- function setTheme(theme) {- currentTheme = theme;- document.querySelectorAll('.controls button').forEach(btn => {- btn.classList.toggle('active', btn.textContent.toLowerCase().includes(theme));- });- renderDemos();- }-- function refreshAll() {- renderDemos();- }-- // Initial render- renderDemos();-- // Auto-refresh every 30 seconds- setInterval(refreshAll, 30000);- </script>-</body>-</html>diff --git a/docs/demos/tapes/wt-commit.tape b/docs/demos/tapes/wt-commit.tapenew file mode 100644index 000000000..98a3a4589--- /dev/null+++ b/docs/demos/tapes/wt-commit.tape@@ -0,0 +1,67 @@+Output "{{OUTPUT_GIF}}"++Require wt+Require git++Set Shell "fish"+Set FontSize {{FONTSIZE}}+Set FontFamily "Geist Mono, Berkeley Mono, Fira Code, JetBrains Mono, Menlo, Apple Color Emoji"+Set Width {{WIDTH}}+Set Height {{HEIGHT}}+Set Theme {{THEME}}+Set Padding 18+Set LineHeight 1.12+Set TypingSpeed 28ms+Set CursorBlink false+Set Framerate 30++Env DEMO_REPO "{{DEMO_REPO}}"+Env RUSTUP_HOME "{{REAL_HOME}}/.rustup"+Env CARGO_HOME "{{REAL_HOME}}/.cargo"+Env HOME "{{DEMO_HOME}}"+Env XDG_CONFIG_HOME "{{DEMO_HOME}}/.config"+Env STARSHIP_CONFIG "{{STARSHIP_CONFIG}}"+Env GIT_TERMINAL_PROMPT "0"++Hide+Type "set -g fish_autosuggestion_enabled 0"+Enter+Type "set -gx LANG en_US.UTF-8; set -gx LC_ALL en_US.UTF-8"+Enter+Type "set -gx PATH {{TARGET_DEBUG}} $HOME/bin $PATH"+Enter+Type "starship init fish | source"+Enter+Type "wt config shell init fish | source"+Enter+Type "cd $DEMO_REPO"+Enter+Type "clear"+Enter+Sleep 500ms+Show+Sleep 500ms++# Switch to branch with uncommitted changes+Type "wt switch hooks"+Enter+Sleep 1s++# Show staged changes+Type "git diff --staged --stat"+Enter+Sleep 2s++# Use wt step commit to generate message via LLM+Type "wt step commit"+Enter+Sleep 4s++# Show the result+Type "git log -1"+Enter+Sleep 3s++Type "exit"+Enter+Sleep 500msdiff --git a/docs/demos/tapes/wt-hooks.tape b/docs/demos/tapes/wt-hooks.tapenew file mode 100644index 000000000..211a1a594--- /dev/null+++ b/docs/demos/tapes/wt-hooks.tape@@ -0,0 +1,62 @@+Output "{{OUTPUT_GIF}}"++Require wt+Require git++Set Shell "fish"+Set FontSize {{FONTSIZE}}+Set FontFamily "Geist Mono, Berkeley Mono, Fira Code, JetBrains Mono, Menlo, Apple Color Emoji"+Set Width {{WIDTH}}+Set Height {{HEIGHT}}+Set Theme {{THEME}}+Set Padding 18+Set LineHeight 1.12+Set TypingSpeed 28ms+Set CursorBlink false+Set Framerate 30++Env DEMO_REPO "{{DEMO_REPO}}"+Env RUSTUP_HOME "{{REAL_HOME}}/.rustup"+Env CARGO_HOME "{{REAL_HOME}}/.cargo"+Env HOME "{{DEMO_HOME}}"+Env XDG_CONFIG_HOME "{{DEMO_HOME}}/.config"+Env STARSHIP_CONFIG "{{STARSHIP_CONFIG}}"+Env GIT_TERMINAL_PROMPT "0"++Hide+Type "set -g fish_autosuggestion_enabled 0"+Enter+Type "set -gx LANG en_US.UTF-8; set -gx LC_ALL en_US.UTF-8"+Enter+Type "set -gx PATH {{TARGET_DEBUG}} $HOME/bin $PATH"+Enter+Type "starship init fish | source"+Enter+Type "wt config shell init fish | source"+Enter+Type "cd $DEMO_REPO"+Enter+Type "clear"+Enter+Sleep 500ms+Show+Sleep 500ms++# Show the hooks config (3 hooks: post-start deps+dev, pre-remove cleanup)+Type "cat .config/wt.toml"+Enter+Sleep 3s++# Create a new worktree - shows post-start hook running+Type "wt switch --create feature"+Enter+Sleep 3s++# Remove a merged worktree+Type "wt remove billing"+Enter+Sleep 2s++Type "exit"+Enter+Sleep 500msdiff --git a/docs/demos/tapes/wt-list-remove.tape b/docs/demos/tapes/wt-list-remove.tapenew file mode 100644index 000000000..7e5f1c4b1--- /dev/null+++ b/docs/demos/tapes/wt-list-remove.tape@@ -0,0 +1,57 @@+Output "{{OUTPUT_GIF}}"++Require wt+Require git++Set Shell "fish"+Set FontSize {{FONTSIZE}}+Set FontFamily "Geist Mono, Berkeley Mono, Fira Code, JetBrains Mono, Menlo, Apple Color Emoji"+Set Width {{WIDTH}}+Set Height {{HEIGHT}}+Set Theme {{THEME}}+Set Padding 18+Set LineHeight 1.12+Set TypingSpeed 28ms+Set CursorBlink false+Set Framerate 30++Env DEMO_REPO "{{DEMO_REPO}}"+Env RUSTUP_HOME "{{REAL_HOME}}/.rustup"+Env CARGO_HOME "{{REAL_HOME}}/.cargo"+Env HOME "{{DEMO_HOME}}"+Env XDG_CONFIG_HOME "{{DEMO_HOME}}/.config"+Env STARSHIP_CONFIG "{{STARSHIP_CONFIG}}"+Env GIT_TERMINAL_PROMPT "0"++Hide+Type "set -g fish_autosuggestion_enabled 0"+Enter+Type "set -gx LANG en_US.UTF-8; set -gx LC_ALL en_US.UTF-8"+Enter+Type "set -gx PATH {{TARGET_DEBUG}} $HOME/bin $PATH"+Enter+Type "starship init fish | source"+Enter+Type "wt config shell init fish | source"+Enter+Type "cd $DEMO_REPO"+Enter+Type "clear"+Enter+Sleep 500ms+Show+Sleep 500ms++# Show worktrees+Type "wt list"+Enter+Sleep 2s++# Remove a merged worktree - clean and simple+Type "wt remove billing"+Enter+Sleep 2s++Type "exit"+Enter+Sleep 500msdiff --git a/docs/demos/tapes/wt-list.tape b/docs/demos/tapes/wt-list.tapenew file mode 100644index 000000000..23c96b3f6--- /dev/null+++ b/docs/demos/tapes/wt-list.tape@@ -0,0 +1,62 @@+Output "{{OUTPUT_GIF}}"++Require wt+Require git++Set Shell "fish"+Set FontSize {{FONTSIZE}}+Set FontFamily "Geist Mono, Berkeley Mono, Fira Code, JetBrains Mono, Menlo, Apple Color Emoji"+Set Width {{WIDTH}}+Set Height {{HEIGHT}}+Set Theme {{THEME}}+Set Padding 18+Set LineHeight 1.12+Set TypingSpeed 28ms+Set CursorBlink false+Set Framerate 30++Env DEMO_REPO "{{DEMO_REPO}}"+Env RUSTUP_HOME "{{REAL_HOME}}/.rustup"+Env CARGO_HOME "{{REAL_HOME}}/.cargo"+Env HOME "{{DEMO_HOME}}"+Env XDG_CONFIG_HOME "{{DEMO_HOME}}/.config"+Env STARSHIP_CONFIG "{{STARSHIP_CONFIG}}"+Env GIT_TERMINAL_PROMPT "0"++Hide+Type "set -g fish_autosuggestion_enabled 0"+Enter+Type "set -gx LANG en_US.UTF-8; set -gx LC_ALL en_US.UTF-8"+Enter+Type "set -gx PATH {{TARGET_DEBUG}} $HOME/bin $PATH"+Enter+Type "starship init fish | source"+Enter+Type "wt config shell init fish | source"+Enter+Type "cd $DEMO_REPO"+Enter+Type "clear"+Enter+Sleep 500ms+Show+Sleep 500ms++# Basic list - progressive rendering+Type "wt list"+Enter+Sleep 2.5s++# Full view with CI and diff stats+Type "wt list --full"+Enter+Sleep 2.5s++# Show all branches including remote-only+Type "wt list --branches"+Enter+Sleep 2.5s++Type "exit"+Enter+Sleep 500msdiff --git a/docs/demos/tapes/wt-select-short.tape b/docs/demos/tapes/wt-select-short.tapenew file mode 100644index 000000000..c8b1e4fc1--- /dev/null+++ b/docs/demos/tapes/wt-select-short.tape@@ -0,0 +1,73 @@+Output "{{OUTPUT_GIF}}"++Require wt+Require git++Set Shell "fish"+Set FontSize {{FONTSIZE}}+Set FontFamily "Geist Mono, Berkeley Mono, Fira Code, JetBrains Mono, Menlo, Apple Color Emoji"+Set Width {{WIDTH}}+Set Height {{HEIGHT}}+Set Theme {{THEME}}+Set Padding 18+Set LineHeight 1.12+Set TypingSpeed 28ms+Set CursorBlink false+Set Framerate 30++Env DEMO_REPO "{{DEMO_REPO}}"+Env RUSTUP_HOME "{{REAL_HOME}}/.rustup"+Env CARGO_HOME "{{REAL_HOME}}/.cargo"+Env HOME "{{DEMO_HOME}}"+Env XDG_CONFIG_HOME "{{DEMO_HOME}}/.config"+Env STARSHIP_CONFIG "{{STARSHIP_CONFIG}}"+Env GIT_TERMINAL_PROMPT "0"++Hide+Type "set -g fish_autosuggestion_enabled 0"+Enter+Type "set -gx LANG en_US.UTF-8; set -gx LC_ALL en_US.UTF-8"+Enter+Type "set -gx PATH {{TARGET_DEBUG}} $HOME/bin $PATH"+Enter+Type "starship init fish | source"+Enter+Type "wt config shell init fish | source"+Enter+Type "cd $DEMO_REPO"+Enter+Type "clear"+Enter+Sleep 500ms+Show+Set KeyStrokes Show+Sleep 500ms++# Launch wt select+Type "wt select"+Enter+Sleep 1.5s++# Quick browse - second down comes fast+Down+Sleep 0.1s+Down+Sleep 0.8s++# Scroll the diff panel with Ctrl+D+Ctrl+d+Sleep 0.5s+Ctrl+d+Sleep 3s++# Filter to find alpha branch+Type "alp"+Sleep 1s++# Select it+Enter+Sleep 1.5s++Type "exit"+Enter+Sleep 500msdiff --git a/docs/demos/tapes/wt-statusline.tape b/docs/demos/tapes/wt-statusline.tapenew file mode 100644index 000000000..99c27ce2b--- /dev/null+++ b/docs/demos/tapes/wt-statusline.tape@@ -0,0 +1,68 @@+Output "{{OUTPUT_GIF}}"++Require wt+Require git++Set Shell "fish"+Set FontSize {{FONTSIZE}}+Set FontFamily "Geist Mono, Berkeley Mono, Fira Code, JetBrains Mono, Menlo, Apple Color Emoji"+Set Width {{WIDTH}}+Set Height {{HEIGHT}}+Set Theme {{THEME}}+Set Padding 18+Set LineHeight 1.12+Set TypingSpeed 28ms+Set CursorBlink false+Set Framerate 30++Env DEMO_REPO "{{DEMO_REPO}}"+Env RUSTUP_HOME "{{REAL_HOME}}/.rustup"+Env CARGO_HOME "{{REAL_HOME}}/.cargo"+Env HOME "{{DEMO_HOME}}"+Env XDG_CONFIG_HOME "{{DEMO_HOME}}/.config"+Env STARSHIP_CONFIG "{{STARSHIP_CONFIG}}"+Env GIT_TERMINAL_PROMPT "0"+Env ANTHROPIC_API_KEY "{{ANTHROPIC_API_KEY}}"++Hide+Type "set -g fish_autosuggestion_enabled 0"+Enter+Type "set -gx LANG en_US.UTF-8; set -gx LC_ALL en_US.UTF-8"+Enter+Type "set -gx PATH {{TARGET_DEBUG}} $HOME/bin $PATH"+Enter+Type "starship init fish | source"+Enter+Type "wt config shell init fish | source"+Enter+Type "cd $DEMO_REPO"+Enter+# Pre-install marketplace plugin before recording+Type "claude plugin marketplace add anthropics/claude-plugins-official"+Enter+Sleep 5s+Type "clear"+Enter+Sleep 500ms+Show+Sleep 500ms++# Show what the statusline command outputs+Type "wt list statusline"+Enter+Sleep 2s++# Switch to an existing worktree+Type "wt switch alpha"+Enter+Sleep 1.5s++# Show statusline again (now in alpha worktree)+Type "wt list statusline"+Enter+Sleep 2s++# Open Claude Code to show statusline integration+Type "claude"+Enter+Sleep 4sdiff --git a/docs/demos/tapes/wt-switch.tape b/docs/demos/tapes/wt-switch.tapenew file mode 100644index 000000000..b10869fe7--- /dev/null+++ b/docs/demos/tapes/wt-switch.tape@@ -0,0 +1,64 @@+Output "{{OUTPUT_GIF}}"++Require wt+Require git++Set Shell "fish"+Set FontSize {{FONTSIZE}}+Set FontFamily "Geist Mono, Berkeley Mono, Fira Code, JetBrains Mono, Menlo, Apple Color Emoji"+Set Width {{WIDTH}}+Set Height {{HEIGHT}}+Set Theme {{THEME}}+Set Padding 18+Set LineHeight 1.12+Set TypingSpeed 28ms+Set CursorBlink false+Set Framerate 30++Env DEMO_REPO "{{DEMO_REPO}}"+Env RUSTUP_HOME "{{REAL_HOME}}/.rustup"+Env CARGO_HOME "{{REAL_HOME}}/.cargo"+Env HOME "{{DEMO_HOME}}"+Env XDG_CONFIG_HOME "{{DEMO_HOME}}/.config"+Env STARSHIP_CONFIG "{{STARSHIP_CONFIG}}"+Env GIT_TERMINAL_PROMPT "0"+Env ANTHROPIC_API_KEY "{{ANTHROPIC_API_KEY}}"++Hide+Type "set -g fish_autosuggestion_enabled 0"+Enter+Type "set -gx LANG en_US.UTF-8; set -gx LC_ALL en_US.UTF-8"+Enter+Type "set -gx PATH {{TARGET_DEBUG}} $HOME/bin $PATH"+Enter+Type "starship init fish | source"+Enter+Type "wt config shell init fish | source"+Enter+Type "cd $DEMO_REPO"+Enter+# Pre-install marketplace plugin before recording+Type "claude plugin marketplace add anthropics/claude-plugins-official"+Enter+Sleep 5s+Type "clear"+Enter+Sleep 500ms+Show+Sleep 500ms++# Switch to existing worktree+Type "wt switch alpha"+Enter+Sleep 1.5s++# Create new worktree (runs post-start hooks)+Type "wt switch --create api"+Enter+Sleep 1.5s++# Create with specific command execution - launch Claude Code UI+Type "wt switch --execute claude --create dashboard"+Sleep 1s+Enter+Sleep 6sdiff --git a/docs/demos/tapes/wt-zellij-omnibus.tape b/docs/demos/tapes/wt-zellij-omnibus.tapenew file mode 100644index 000000000..240e87bcb--- /dev/null+++ b/docs/demos/tapes/wt-zellij-omnibus.tape@@ -0,0 +1,215 @@+Output "{{OUTPUT_GIF}}"++# OMNIBUS DEMO: Comprehensive worktrunk showcase+#+# Design principles:+# 1. Simple features before complex ones+# - list, switch, select (navigation) → create, commit, merge (workflows)+# 2. Logical story arc+# - Overview → work on branches → create feature → complete it → cleanup+# 3. Merge comes AFTER making changes (not on pre-existing uncommitted changes)+# 4. Each Zellij tab shows a distinct workflow+#+# Tab structure:+# TAB 1: wt list → wt switch api → claude (simple task)+# TAB 2: [NEW TAB] wsl abbreviation (wt switch -x claude --create) → claude+# TAB 3: [NEW TAB] wt switch --create → wt step commit → git push+# TAB 4: [NEW TAB] wt switch auth → wt list → wt remove → wt list --full+# Then back to TAB 1: [NEW PANE] git diff → wt merge (on Claude's completed work)+#+# Features demonstrated:+# - wt list / wt list --full (URLs, CI status, diff stats)+# - wt switch (simple navigation)+# - wsl abbreviation (wt switch --execute=claude --create)+# - wt switch --create (with post-start hooks)+# - wt step commit (LLM commit message, standalone)+# - wt merge (on uncommitted work - commits, rebases, merges, cleans up)+# - wt remove (cleanup)+# - Multi-agent Claude Code in parallel tabs++Require wt+Require git+Require zellij++Set Shell "fish"+Set FontSize {{FONTSIZE}}+Set FontFamily "Geist Mono, Berkeley Mono, Fira Code, JetBrains Mono, Menlo, Apple Color Emoji"+Set Width {{WIDTH}}+Set Height {{HEIGHT}}+Set Theme {{THEME}}+Set Padding 18+Set LineHeight 1.12+Set TypingSpeed 28ms+Set CursorBlink false+Set Framerate 30++Env DEMO_REPO "{{DEMO_REPO}}"+Env RUSTUP_HOME "{{REAL_HOME}}/.rustup"+Env CARGO_HOME "{{REAL_HOME}}/.cargo"+Env HOME "{{DEMO_HOME}}"+Env XDG_CONFIG_HOME "{{DEMO_HOME}}/.config"+Env STARSHIP_CONFIG "{{STARSHIP_CONFIG}}"+Env GIT_TERMINAL_PROMPT "0"+Env ANTHROPIC_API_KEY "{{ANTHROPIC_API_KEY}}"++Hide+Type "set -g fish_autosuggestion_enabled 0"+Enter+Type "set -gx LANG en_US.UTF-8; set -gx LC_ALL en_US.UTF-8"+Enter+Type "set -gx PATH {{TARGET_DEBUG}} $HOME/bin $PATH"+Enter+Type "starship init fish | source"+Enter+Type "wt config shell init fish | source"+Enter+# Pre-install marketplace plugin before recording+Type "claude plugin marketplace add anthropics/claude-plugins-official"+Enter+Sleep 5s+Type "cd $DEMO_REPO"+Enter+# Start Zellij before showing+Type "zellij"+Enter+Sleep 4s+# Dismiss plugin permission dialog (zellij-tab-name asks for permissions on first run)+Type "y"+Sleep 1s+Show+Sleep 500ms++# ==== TAB 1: Overview and simple navigation ====+# Start with wt list to see all worktrees+Type "wt list"+Enter+Sleep 3s++# Simple switch - navigate to existing worktree+Type "wt switch api"+Enter+Sleep 1.5s++# Launch Claude agent on api (simple task that completes during demo)+# Note: lib.rs has an add() function, so this will definitely produce changes+Type "claude 'Add a test for the add function'"+Enter+Sleep 5.5s++# ==== TAB 2: wsl abbreviation (creates billing, launches Claude) ====+# [NEW TAB] - Ctrl+t creates new Zellij tab (starts in demo repo via default_cwd)+Ctrl+t+Sleep 2s++# wsl abbreviation expands to: wt switch --execute=claude --create+# Type "ws" then "l" to trigger expansion, then add branch name and instructions+Type "ws"+Type "l"+Sleep 200ms+Type " billing -- 'Format billing amounts with currency symbols'"+Sleep 500ms+Enter+Sleep 6s++# ==== TAB 3: Create, commit, push workflow ====+# This tab shows wt step commit as a standalone feature+# [NEW TAB]+Ctrl+t+Sleep 2s++# wt switch --create - shows post-start hooks running+Type "wt switch --create feature"+Enter+Sleep 4.5s++# Make a change+Type "echo '// User settings module' >> src/lib.rs"+Enter+Sleep 800ms++# wt step commit - LLM generates commit message (standalone feature)+Type "wt step commit"+Enter+Sleep 4s++# Push to origin (feature branch is now ready)+Type "git push -u origin feature"+Enter+Sleep 2s++# ==== TAB 4: Navigation, list, and cleanup ====+# [NEW TAB]+Ctrl+t+Sleep 2s++# wt switch - navigate to auth worktree+Type "wt switch auth"+Enter+Sleep 1.5s++# wt list - see current state (before removal)+Type "wt list"+Enter+Sleep 2.5s++# wt remove - delete current worktree (we're in auth)+Type "wt remove"+Enter+Sleep 3s++# wt list --full - shows what changed+Type "wt list --full"+Enter+Sleep 3.5s++# ==== Back to TAB 1: Merge Claude's completed work ====+# Agent finished - open new pane to show changes and merge+Ctrl+Space+Sleep 200ms+Type "t1"+Sleep 2s++# Open new pane for git diff and merge (like original zellij demo)+Ctrl+n+Sleep 600ms++# Show what Claude changed+Type "git diff"+Enter+Sleep 3s++# wt merge - handles uncommitted changes, rebases, merges, cleans up+# Pre-merge hook runs tests, then commit, rebase, merge, cleanup+# (heavy output command - pre-enter pause)+Sleep 1s+Type "wt merge"+Enter+Sleep 11s++# ==== Cycle through all tabs to show parallel work ====+# TAB 2: billing agent working+Ctrl+Space+Sleep 200ms+Type "t2"+Sleep 1.5s++# TAB 3: feature branch (already pushed)+Ctrl+Space+Sleep 200ms+Type "t3"+Sleep 1.5s++# TAB 4: show final state with wt list --full+Ctrl+Space+Sleep 200ms+Type "t4"+Sleep 1s++# Show comprehensive list of all worktrees+Type "wt list --full"+Enter+Sleep 3s++# Done!+Type "done!"+Sleep 1.5sdiff --git a/docs/demos/tapes/wt-zellij.tape b/docs/demos/tapes/wt-zellij.tapenew file mode 100644index 000000000..cbe785a0b--- /dev/null+++ b/docs/demos/tapes/wt-zellij.tape@@ -0,0 +1,145 @@+Output "{{OUTPUT_GIF}}"++Require wt+Require git+Require zellij++Set Shell "fish"+Set FontSize {{FONTSIZE}}+Set FontFamily "Geist Mono, Berkeley Mono, Fira Code, JetBrains Mono, Menlo, Apple Color Emoji"+Set Width {{WIDTH}}+Set Height {{HEIGHT}}+Set Theme {{THEME}}+Set Padding 18+Set LineHeight 1.12+Set TypingSpeed 28ms+Set CursorBlink false+Set Framerate 30++Env DEMO_REPO "{{DEMO_REPO}}"+Env RUSTUP_HOME "{{REAL_HOME}}/.rustup"+Env CARGO_HOME "{{REAL_HOME}}/.cargo"+Env HOME "{{DEMO_HOME}}"+Env XDG_CONFIG_HOME "{{DEMO_HOME}}/.config"+Env STARSHIP_CONFIG "{{STARSHIP_CONFIG}}"+Env GIT_TERMINAL_PROMPT "0"+Env ANTHROPIC_API_KEY "{{ANTHROPIC_API_KEY}}"++Hide+Type "set -g fish_autosuggestion_enabled 0"+Enter+Type "set -gx LANG en_US.UTF-8; set -gx LC_ALL en_US.UTF-8"+Enter+Type "set -gx PATH {{TARGET_DEBUG}} $HOME/bin $PATH"+Enter+Type "starship init fish | source"+Enter+Type "wt config shell init fish | source"+Enter+# Pre-install marketplace plugin before recording+Type "claude plugin marketplace add anthropics/claude-plugins-official"+Enter+Sleep 5s+Type "cd $DEMO_REPO"+Enter+# Start Zellij before showing+Type "zellij"+Enter+Sleep 4s+# Dismiss plugin permission dialog (zellij-tab-name asks for permissions on first run)+Type "y"+Sleep 1s+Show+Sleep 500ms++# Tab 1: API worktree (pre-created with uncommitted changes)+# Switch to existing worktree - no --create needed+Type "wt switch api --execute=claude -- 'Add input validation to API endpoints'"+Sleep 500ms+Enter+Sleep 6s++# New tab+Ctrl+t+Sleep 1s++# Tab 2: Billing bugfix+Type "ws"+Type "l"+Sleep 200ms+Type " billing -- 'Fix UTC timezone handling in billing reports'"+Sleep 500ms+Enter+Sleep 6s++# New tab+Ctrl+t+Sleep 1s++# Tab 3: Auth feature+Type "ws"+Type "l"+Sleep 200ms+Type " auth -- 'Implement OAuth2 authentication flow'"+Sleep 500ms+Enter+Sleep 6s++# New tab+Ctrl+t+Sleep 1s++# Tab 4: Metrics feature+Type "ws"+Type "l"+Sleep 200ms+Type " metrics -- 'Add request latency metrics and dashboards'"+Sleep 500ms+Enter+Sleep 6s++# Let agents work for a moment+Sleep 3s++# Cycle through tabs to show all agents working+# Ctrl+Space enters tmux mode, 't' enters tab mode, number selects tab+Ctrl+Space+Sleep 200ms+Type "t1"+Sleep 1.2s++# On api tab, open a pane and show git diff (pre-seeded changes)+Ctrl+n+Sleep 600ms+Type "git diff --color=always"+Enter+Sleep 2.5s++Ctrl+Space+Sleep 200ms+Type "t2"+Sleep 1.2s++Ctrl+Space+Sleep 200ms+Type "t3"+Sleep 1.2s++Ctrl+Space+Sleep 200ms+Type "t4"+Sleep 1.2s++# Back to api tab to show git diff pane one more time+Ctrl+Space+Sleep 200ms+Type "t1"++# Final hold on the git diff view+Sleep 3s++# Quit Zellij to avoid accumulating running sessions+Ctrl+Space+Sleep 200ms+Type "q"+Sleep 500msdiff --git a/docs/static/demos/twitter/thread-preview.html b/docs/static/demos/twitter/thread-preview.htmlnew file mode 100644index 000000000..b204f9ee3--- /dev/null+++ b/docs/static/demos/twitter/thread-preview.html@@ -0,0 +1,237 @@+<!DOCTYPE html>+<html lang="en">+<head>+ <meta charset="UTF-8">+ <meta name="viewport" content="width=device-width, initial-scale=1.0">+ <title>Twitter Thread Preview</title>+ <style>+ * { box-sizing: border-box; margin: 0; padding: 0; }+ body { font-family: system-ui, -apple-system, sans-serif; background: #fafafa; color: #1a1a1a; line-height: 1.5; }+ body.dark { background: #1a1a1a; color: #e0e0e0; }++ .header { position: sticky; top: 0; background: #fff; border-bottom: 1px solid #e5e5e5; padding: 12px 20px; display: flex; align-items: center; gap: 12px; z-index: 10; }+ body.dark .header { background: #252525; border-color: #333; }+ .header h1 { font-size: 16px; font-weight: 600; margin-right: auto; }++ button { background: #fff; border: 1px solid #ddd; padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; }+ button:hover { background: #f5f5f5; }+ button.active { background: #0066cc; color: #fff; border-color: #0066cc; }+ body.dark button { background: #333; border-color: #555; color: #e0e0e0; }+ body.dark button:hover { background: #444; }+ body.dark button.active { background: #0066cc; border-color: #0066cc; }++ /* Thread view */+ .thread-view { max-width: 700px; margin: 0 auto; padding: 20px; }+ .tweet { background: #fff; border: 1px solid #e5e5e5; border-radius: 12px; padding: 16px; margin-bottom: 16px; }+ body.dark .tweet { background: #252525; border-color: #333; }+ .tweet-num { font-size: 12px; color: #666; margin-bottom: 8px; }+ body.dark .tweet-num { color: #888; }+ .tweet-num .chars { color: #999; margin-left: 8px; }+ .tweet-text { font-size: 15px; white-space: pre-wrap; margin-bottom: 12px; }+ .tweet-text code { background: #f0f0f0; padding: 1px 5px; border-radius: 3px; font-family: 'SF Mono', Menlo, monospace; font-size: 13px; }+ body.dark .tweet-text code { background: #333; }+ .tweet-text a { color: #1d9bf0; }+ .gif-container { border-radius: 8px; overflow: hidden; border: 1px solid #e5e5e5; }+ body.dark .gif-container { border-color: #333; }+ .gif-container img { display: block; width: 100%; }+ .gif-label { font-size: 11px; color: #888; margin-top: 6px; font-style: italic; }++ /* Grid view */+ .grid-view { display: none; padding: 20px; }+ .grid-view.visible { display: block; }+ .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(500px, 1fr)); gap: 20px; max-width: 1600px; margin: 0 auto; }+ .demo { background: #fff; border: 1px solid #e5e5e5; border-radius: 8px; overflow: hidden; }+ body.dark .demo { background: #252525; border-color: #333; }+ .demo-header { padding: 12px 16px; background: #f8f8f8; display: flex; justify-content: space-between; align-items: center; }+ body.dark .demo-header { background: #333; }+ .demo-title { font-weight: 600; font-size: 14px; }+ .demo-tweet { font-size: 12px; color: #888; }+ .demo-content { padding: 10px; min-height: 300px; display: flex; align-items: center; justify-content: center; }+ .demo-content img { max-width: 100%; height: auto; border-radius: 4px; }+ .demo-content.missing { color: #666; font-style: italic; }+ .demo-footer { padding: 8px 16px; background: #fafafa; font-size: 12px; color: #888; }+ body.dark .demo-footer { background: #2a2a2a; }+ .status { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 11px; margin-left: 8px; }+ .status.exists { background: #d1fae5; color: #065f46; }+ .status.new { background: #fef3c7; color: #92400e; }+ .status.missing { background: #fee2e2; color: #991b1b; }+ body.dark .status.exists { background: #1a4d1a; color: #4ade80; }+ body.dark .status.new { background: #4d3d1a; color: #fbbf24; }+ body.dark .status.missing { background: #4d1a1a; color: #f87171; }++ .error { color: #c00; padding: 20px; text-align: center; }+ .loading { color: #666; padding: 40px; text-align: center; }+ .refresh-note { text-align: center; color: #888; font-size: 12px; margin-top: 20px; }+ </style>+</head>+<body>+ <div class="header">+ <h1>Worktrunk Launch Thread</h1>+ <button id="btn-thread" class="active" onclick="setView('thread')">Thread</button>+ <button id="btn-grid" onclick="setView('grid')">Grid</button>+ <button id="btn-light" class="active" onclick="setTheme('light')">Light</button>+ <button id="btn-dark" onclick="setTheme('dark')">Dark</button>+ <button onclick="reload()">Reload</button>+ </div>++ <div class="thread-view" id="thread"><div class="loading">Loading...</div></div>+ <div class="grid-view" id="grid-view"></div>++ <script>+ // Demo metadata for grid view+ const demos = [+ { id: 'wt-core', title: 'wt-core.gif', tweet: 'Tweet 1: Intro', status: 'exists' },+ { id: 'wt-switch', title: 'wt-switch.gif', tweet: 'Tweet 3: Switch', status: 'new' },+ { id: 'wt-list-remove', title: 'wt-list-remove.gif', tweet: 'Tweet 4: List & Remove', status: 'new' },+ { id: 'wt-hooks', title: 'wt-hooks.gif', tweet: 'Tweet 5: Hooks', status: 'new' },+ { id: 'wt-list', title: 'wt-list.gif', tweet: 'Tweet 6: List Progressive', status: 'new' },+ { id: 'wt-select-short', title: 'wt-select-short.gif', tweet: 'Tweet 8: Select', status: 'new' },+ { id: 'wt-commit', title: 'wt-commit.gif', tweet: 'Tweet 9: Commit', status: 'new' },+ { id: 'wt-merge', title: 'wt-merge.gif', tweet: 'Tweet 10: Merge', status: 'exists' },+ { id: 'wt-zellij', title: 'wt-zellij.gif', tweet: 'Tweet 11: Zellij', status: 'new' },+ { id: 'wt-zellij-omnibus', title: 'wt-zellij-omnibus.gif', tweet: 'Omnibus (Zellij + list + select + merge)', status: 'new' },+ ];++ // GIF name mapping (markdown uses different names than files)+ const gifMap = {+ 'wt-demo': 'wt-core',+ 'wt-select': 'wt-select-short'+ };++ let currentTheme = 'light';+ let currentView = 'thread';++ function getGifPath(name) {+ const suffix = currentTheme === 'dark' ? '-dark' : '';+ return `/assets/${name}${suffix}.gif`;+ }++ function parseMarkdown(md) {+ const tweets = [];+ const parts = md.split(/\*\*(\d+)\/\*\*\s*\((\d+)\s*chars\)/);++ for (let i = 1; i < parts.length; i += 3) {+ const num = parseInt(parts[i]);+ const chars = parseInt(parts[i + 1]);+ let content = parts[i + 2] || '';+ content = content.split(/<!--\s*=====/)[0].trim();++ let gif = null, caption = null;+ const gifMatch = content.match(/\[([^\]]+\.gif)(?:\s*—\s*([^\]]+))?\]/);+ if (gifMatch) {+ let gifName = gifMatch[1].replace('.gif', '');+ gif = gifMap[gifName] || gifName;+ caption = gifMatch[2] || null;+ content = content.replace(gifMatch[0], '').trim();+ }++ const screenshotMatch = content.match(/\[screenshot[^\]]*\]/i);+ if (screenshotMatch) {+ if (content.includes('statusline')) {+ gif = 'wt-statusline';+ caption = 'Claude Code with worktrunk statusline';+ }+ content = content.replace(screenshotMatch[0], '').trim();+ }++ content = content+ .replace(/`([^`]+)`/g, '<code>$1</code>')+ .replace(/(https:\/\/[^\s]+)/g, '<a href="$1">$1</a>');++ tweets.push({ num, chars, text: content, gif, caption });+ }+ return tweets;+ }++ async function loadThread() {+ try {+ const resp = await fetch('/demos/twitter/thread.md?t=' + Date.now());+ if (!resp.ok) throw new Error('Failed to load thread.md');+ return parseMarkdown(await resp.text());+ } catch (e) {+ console.error(e);+ return null;+ }+ }++ function renderTweets(tweets) {+ const t = Date.now();+ const total = tweets.length;+ return tweets.map(tw => {+ let media = '';+ if (tw.gif) {+ media = `+ <div class="gif-container">+ <img src="${getGifPath(tw.gif)}?t=${t}" onerror="this.outerHTML='<div class=error>Missing: ${tw.gif}.gif</div>'" />+ </div>+ ${tw.caption ? `<div class="gif-label">${tw.caption}</div>` : ''}+ `;+ }+ return `+ <div class="tweet">+ <div class="tweet-num">${tw.num}/${total} <span class="chars">${tw.chars} chars</span></div>+ <div class="tweet-text">${tw.text}</div>+ ${media}+ </div>+ `;+ }).join('');+ }++ function renderGrid() {+ const t = Date.now();+ return `+ <div class="grid">+ ${demos.map(demo => `+ <div class="demo">+ <div class="demo-header">+ <span>+ <span class="demo-title">${demo.title}</span>+ <span class="status ${demo.status}">${demo.status}</span>+ </span>+ <span class="demo-tweet">${demo.tweet}</span>+ </div>+ <div class="demo-content">+ <img src="${getGifPath(demo.id)}?t=${t}" alt="${demo.title}"+ onerror="this.parentElement.innerHTML='<span class=missing>Not yet created</span>'" />+ </div>+ <div class="demo-footer">${demo.id}.gif</div>+ </div>+ `).join('')}+ </div>+ <p class="refresh-note">Click Reload to refresh images</p>+ `;+ }++ async function render() {+ if (currentView === 'thread') {+ const tweets = await loadThread();+ document.getElementById('thread').innerHTML = tweets+ ? renderTweets(tweets)+ : '<div class="error">Failed to load thread.md</div>';+ } else {+ document.getElementById('grid-view').innerHTML = renderGrid();+ }+ }++ function setView(view) {+ currentView = view;+ document.getElementById('btn-thread').classList.toggle('active', view === 'thread');+ document.getElementById('btn-grid').classList.toggle('active', view === 'grid');+ document.querySelector('.thread-view').style.display = view === 'thread' ? 'block' : 'none';+ document.querySelector('.grid-view').classList.toggle('visible', view === 'grid');+ render();+ }++ function setTheme(theme) {+ currentTheme = theme;+ document.body.classList.toggle('dark', theme === 'dark');+ document.getElementById('btn-light').classList.toggle('active', theme === 'light');+ document.getElementById('btn-dark').classList.toggle('active', theme === 'dark');+ render();+ }++ function reload() { render(); }+ render();+ </script>+</body>+</html>diff --git a/docs/static/demos/twitter/thread.md b/docs/static/demos/twitter/thread.mdnew file mode 100644index 000000000..6782301d8--- /dev/null+++ b/docs/static/demos/twitter/thread.md@@ -0,0 +1,160 @@+# Twitter Thread: Worktrunk Launch++<!--+STRUCTURE:+1. Intro - hook with announcement (link-free for max reach)+2. Context - Claude Code instances, why isolation matters+3. Git worktree UX problem+4. What Worktrunk is + GitHub link+5. Core command - wt switch+6. Other core commands - list, remove+7-12. Features - hooks, list + CI status, select, LLM commits, wt merge, status line+13. CTA - install, docs, feedback, star+14. Thanks to Claude Code team + RT request++DESIGN DECISIONS:+- Lead with "models improved → running more agents → worktrees → UX terrible → built this"+- 🧵 signals it's a thread+- Tweet 1 is link-free (hook needs max reach)+- GitHub link in tweet 4 (what Worktrunk is); GitHub star in tweet 13 (CTA)+- Tweet 2 explains isolation need; tweet 3 shows UX pain; tweet 4 introduces Worktrunk; tweet 5 shows wt switch+- Tweet 14 thanks team + RT request+- Core commands split across two tweets for focused demos+- Features are snappy, one per tweet, with media where applicable+- Monospace: Twitter doesn't support it; use screenshots or plain text (GIF shows commands)+- Social proof (PRQL, xarray, insta) cut for now to keep focus on the tool+-->++---++<!-- ============ PHASE 1: INTRO ============ -->+<!-- Goal: Hook, announce, explain what it is, set up the thread -->++<!-- TODO: Wordsmith tweets 1-2. Current version is functional but doesn't sing.+ Attempted combining them but lost clarity. Key requirements:+ - Tweet 1 must say what Worktrunk is (git worktree manager)+ - Need to convey the AI agent use case without being abstract+ - Lead with concrete pain, not marketing speak+ - Avoid slop: "fills the gap", "painful UX", "actually usable" -->++**1/** (190 chars)+Announcing Worktrunk! A git worktree manager, designed for running AI agents in parallel.++A few points on why I'm so excited about the project, and why I hope it becomes broadly adopted 🧵++[wt-demo.gif]++<!-- TODO: Consider a Zellij demo showing 4-5 tabs, each named by branch (via zellij-tab-name plugin),+ each with Claude Code in left pane + diff in right pane. Would powerfully show parallel agents. -->++<!-- ============ PHASE 2: CONTEXT ============ -->+<!-- Goal: Why isolation matters, then prove the UX problem -->++**2/** (202 chars)+As models have improved this year, I've been running more & more Claude Code instances in parallel.++Each needs its own isolated working directory, otherwise they get confused by each other's changes.++**3/** (222 chars)+Git worktrees solve this, but the UX is terrible!++To create & navigate to a new worktree:++git worktree add -b feat ../repo.feat && cd ../repo.feat++...even for a simple command, we need to type the name three times.++<!-- ============ PHASE 3: CORE COMMANDS ============ -->+<!-- Goal: Contrast with solution, then introduce core commands -->++**4/** (167 chars)+Worktrunk is a CLI, written in Rust, which makes git worktrees as easy as branches.++https://github.com/max-sixty/worktrunk++**5/** (99 chars)+In contrast to the git command, the Worktrunk command to create a new worktree is short (& aliasable):++wt switch --create api++[wt-switch.gif — creating and switching between worktrees]++**6/** (105 chars)+Worktrunk's other core commands:++wt list: see all worktrees with status+wt remove: delete a worktree++[wt-list-remove.gif — list then remove]++<!-- ============ PHASE 4: FEATURES ============ -->+<!-- Goal: List additional capabilities, one per tweet, snappy -->++**7/** (228 chars)+Beyond the core commands, features that make worktrees simpler:++Post-start hooks run after creating a worktree: install deps, copy caches, start dev servers, set up the environment. There's a hook for every stage of the worktree lifecycle.++[wt-hooks.gif — switch --create showing multiple post-start hooks running]++<!-- TODO: Consider cutting or merging tweets 8-9. Reviewers noted:+ - "50ms" is too technical / doesn't connect to AI workflows+ - Fuzzy picker isn't differentiated (every CLI has one)+ - Thread may be too long; these are weak candidates for cutting -->++**8/** (235 chars)+wt list renders in ~50ms, then fills in details (CI status, diff stats) as they become available. Can also list branches with wt list --branches.++wt list --full: CI status as clickable dots. Green/blue/red. Clicking opens the PR.++[wt-list.gif — showing progressive rendering]++**9/** (45 chars)+wt select: fuzzy picker across all branches.++[wt-select.gif]++**10/** (99 chars)+When running wt step commit or wt merge, worktrunk can have an LLM write the commit message, with a customizable template.++[wt-commit.gif — git diff then wt step commit]++**11/** (78 chars)+wt merge: squash, rebase, merge, remove worktree, delete branch, in one command.++[wt-merge.gif]++**12/** (83 chars)+@claudeai status line integration. See branch, diff stats, CI status at a glance.++[screenshot of Claude Code with worktrunk statusline]++<!-- ============ PHASE 5: CTA ============ -->+<!-- Goal: Install instructions, docs, invite feedback, star -->++**13/** (167 chars)+To install:++brew install max-sixty/worktrunk/wt+wt config shell install++Feedback welcome. Open an issue or reply here.++⭐ https://github.com/max-sixty/worktrunk++**14/** (230 chars)+Big thanks to @AnthropicAI and the @claudeai team, including @bcherny @\_catwu @alexalbert\_\_, for building Claude Code. Worktrunk wouldn't exist without it 🙏++If this was useful, the first tweet helps spread the word.++[TODO: paste link to tweet 1]++---++## Notes++- **Monospace in tweets**: Twitter doesn't support code formatting. Options:+ - Unicode monospace via [YayText](https://yaytext.com/monospace/): 𝚠𝚝 𝚜𝚠𝚒𝚝𝚌𝚑 -𝚌 𝚏𝚎𝚊𝚝+ - Screenshots+ - Plain text (the GIF shows commands anyway)+- **Social proof**: Cut for now, could add back in a later tweet