一键导入
build-and-run-temp-howcode
// Use when Igor asks to build this branch/current repo and run a disposable build version
// Use when Igor asks to build this branch/current repo and run a disposable build version
Use when weird app/UI behavior needs live reproduction and tracing, including flicker, stale state, remounts, focus/scroll jumps, action glitches, or ordering flashes
TypeScript/JavaScript codebase hardening: maintainability, code quality, architecture cleanup, repo scoring, agent-friendly structure, godfiles, godfunctions, feature folders, DRY, type safety, traversability, feedback loops, worktrees, subagents, swarm refactors.
Runs this repo's GitHub issue and PR workflow with gh. Use when the user mentions issue numbers, PR links, or the project board, asks to pick a manageable issue, wants an issue rewritten into a proper issue, wants backlog triage or relabeling, or wants a PR opened, updated, or reviewed. Do not use for local-only git work with no GitHub issue or project flow.
Build or modify Howcode native extensions that work in both desktop composer/runtime-host and Pi TUI takeover. Use when adding another Howcode-only agent tool, dual-surface extension, native extension setting, per-session extension snapshot, or composer-adjacent tool UI. Do not use for ordinary installable Pi extensions or UI-only composer cards.
How to add short-lived static fixtures for hard-to-reproduce UI states while tuning layout
Use when Igor says a worktree seems complete and wants a branch/worktree summary saved for later review and merging
| name | Build and run temp Howcode |
| description | Use when Igor asks to build this branch/current repo and run a disposable build version |
Use this when Igor asks to build the current branch/current repo and run a disposable Howcode app from /home/igorw/Work/howcode-temp.
Trigger phrases include:
/home/igorw/Work/howcode-temp/howcode-fixed./home/igorw/Work/howcode-temp/howcode-fixed.pid/home/igorw/Work/howcode-temp/howcode-fixed.log/home/igorw/Work/howcode-temp.bun run build.setsid ... &, write a runner pid/log, then poll the log/pid from the agent.mise which node@24:
HOWCODE_NODE_24_PATH=/home/igorw/.local/share/mise/installs/node/24.15.0/bin/nodeHOWCODE_NODE_25_PATH=/home/igorw/.local/share/mise/installs/node/25.9.0/bin/nodeHOWCODE_NODE_26_PATH=/home/igorw/.local/share/mise/installs/node/26.1.0/bin/nodebun run ai:check before this workflow or rely on commit hooks if the change was just committed.set -euo pipefail
repo=/home/igorw/Work/howcode
temp_root=/home/igorw/Work/howcode-temp
app_name=howcode-fixed
src="$repo/artifacts/electron/linux-unpacked"
dest="$temp_root/$app_name"
pid_file="$temp_root/$app_name.pid"
log_file="$temp_root/$app_name.log"
runner_pid_file="$temp_root/$app_name.runner.pid"
runner_log_file="$temp_root/$app_name.runner.log"
cat > "$temp_root/run-$app_name.sh" <<'RUNNER'
#!/usr/bin/env bash
set -euo pipefail
repo=/home/igorw/Work/howcode
temp_root=/home/igorw/Work/howcode-temp
app_name=howcode-fixed
src="$repo/artifacts/electron/linux-unpacked"
dest="$temp_root/$app_name"
pid_file="$temp_root/$app_name.pid"
log_file="$temp_root/$app_name.log"
export HOWCODE_NODE_24_PATH=/home/igorw/.local/share/mise/installs/node/24.15.0/bin/node
export HOWCODE_NODE_25_PATH=/home/igorw/.local/share/mise/installs/node/25.9.0/bin/node
export HOWCODE_NODE_26_PATH=/home/igorw/.local/share/mise/installs/node/26.1.0/bin/node
cd "$repo"
# Stop prior temp launch, if still running.
if [ -f "$pid_file" ]; then
old_pid=$(cat "$pid_file")
if [ -n "$old_pid" ] && kill -0 "$old_pid" 2>/dev/null; then
kill "$old_pid" 2>/dev/null || true
fi
fi
# Build current checkout.
bun run build
# Overwrite the single temp copy; do not accumulate versions.
mkdir -p "$temp_root"
rm -rf "$dest"
cp -a "$src" "$dest"
# Replace the launch log for this run.
: > "$log_file"
# Launch fully detached from the agent shell/session and record pid.
setsid -f "$dest/howcode" >"$log_file" 2>&1
sleep 1
pid=$(pgrep -f "^$dest/howcode" | head -n1 || true)
if [ -z "$pid" ]; then
echo "Launch did not stay up; log follows:" >&2
tail -80 "$log_file" >&2 || true
exit 1
fi
echo "$pid" > "$pid_file"
echo "Launched $dest/howcode pid=$pid"
ps -p "$pid" -o pid,ppid,sid,cmd --no-headers || true
echo "Log: $log_file"
tail -80 "$log_file" || true
RUNNER
chmod +x "$temp_root/run-$app_name.sh"
# Run the whole build+copy+launch workflow detached from the agent/tmux terminal.
: > "$runner_log_file"
setsid -f "$temp_root/run-$app_name.sh" >"$runner_log_file" 2>&1
sleep 1
runner_pid=$(pgrep -f "^bash $temp_root/run-$app_name.sh" | head -n1 || true)
if [ -n "$runner_pid" ]; then
echo "$runner_pid" > "$runner_pid_file"
echo "Detached temp build runner pid=$runner_pid"
else
echo "Detached runner finished quickly; check log: $runner_log_file"
fi
tail -80 "$runner_log_file" || true
Poll until done:
tail -120 /home/igorw/Work/howcode-temp/howcode-fixed.runner.log
runner_pid=$(cat /home/igorw/Work/howcode-temp/howcode-fixed.runner.pid 2>/dev/null || true)
if [ -n "$runner_pid" ] && kill -0 "$runner_pid" 2>/dev/null; then
echo "Still building/running: $runner_pid"
else
echo "Runner finished"
tail -120 /home/igorw/Work/howcode-temp/howcode-fixed.runner.log
fi
Check the temp launch log first:
tail -200 /home/igorw/Work/howcode-temp/howcode-fixed.log
Then check coredumps/journal for the recorded pid:
pid=$(cat /home/igorw/Work/howcode-temp/howcode-fixed.pid)
coredumpctl info "$pid" --no-pager || true
journalctl --user --since '20 minutes ago' --no-pager | rg -i 'howcode|electron|gpu|renderer|crash|segfault|oom|killed' || true
If Chromium reports GPU process isn't usable, try a diagnostic relaunch with GPU disabled:
/home/igorw/Work/howcode-temp/howcode-fixed/howcode --disable-gpu