← ClaudeAtlas

tmux-ui-tripwirelisted

Write or debug tmux-driven end-to-end TUI tests ("tripwires") for the ainb terminal app. Use when the user asks to "write a tmux test", "add a tripwire", "verify the TUI in tmux", "test feature X by pressing key Y", "validate plugin Z renders", or when editing any file under `crates/ainb-core/tests/tripwire_*.rs`. Codifies the silent traps we hit during Phase 7 plugin testing — macOS AMFI SIGKILL of staged binaries (exit 137, no stderr), first-run wizard intercepting keystrokes, EnvFilter crate-name drift hiding logs, and substring-OR assertions that pass while the feature is broken. Use proactively before writing any new `tripwire_*.rs` test, and reference whenever an existing tripwire fails for non-obvious reasons.
stevengonsalvez/agents-in-a-box · ★ 14 · Web & Frontend · score 71
Install: claude install-skill stevengonsalvez/agents-in-a-box
# tmux-ui-tripwire ## Overview Tripwire tests drive the real `ainb` TUI binary in a detached `tmux` session, send keystrokes, capture the pane, and assert on rendered output. They are the ONLY tests that catch user-visible regressions the unit tests miss (e.g. plugin pipeline broken but `cargo test` green). ## When to use this skill - Writing a new `tripwire_*.rs` test - An existing tripwire fails and the cause isn't obvious from `cargo test` output - Tightening a tripwire whose assertions look weak (substring-OR on chrome strings) - Diagnosing why a plugin "spawns but doesn't render" ## Quick start — minimal viable tripwire ```rust // crates/ainb-core/tests/tripwire_<feature>.rs use std::path::PathBuf; use std::process::Command; use std::time::{Duration, Instant}; // 1. Skip gracefully if env can't support the test. fn tmux_available() -> bool { /* see references/helpers.md */ } fn ainb_bin() -> PathBuf { PathBuf::from(env!("CARGO_BIN_EXE_ainb")) } #[test] fn feature_renders_after_pressing_x() { if !tmux_available() { eprintln!("SKIP: tmux"); return; } // 2. Isolated HOME — seed onboarding.toml to skip wizard. let home = tempfile::tempdir().unwrap(); seed_isolated_home(home.path()); // 3. Launch ainb tui in detached tmux session. let session = format!("tripwire-{}", std::process::id()); Command::new("tmux").args(["new-session","-d","-s",&session,"-x","180","-y","50"]).status().unwrap(); let cmd = format!("HOME={} AINB_DISABLE_PLUGINS=