code-yeongyu/oh-my-openagent / .agents/skills/opencode-qa
opencode-qa
VerifiedQA opencode itself, per case: verify the CLI/terminal (opencode run, db, serve, export), prove a specific plugin hook/action/event fired via the SSE event stream, smoke-test the TUI under tmux, and investigate sessions in opencode's SQLite DB by id, title/name, or message text. Ships tested helper scripts (each with a --self-test) plus per-domain references. Use whenever someone wants to QA, smoke-test, verify, or debug opencode's CLI, HTTP server, plugin hooks/events, or TUI, or to find/inspect opencode sessions in the database. Triggers: opencode qa, qa opencode, test opencode, verify opencode hook, opencode session db, find opencode session by id/name/text, opencode tui test, opencode server health, opencode event stream.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 11.3 KB |
| references/cli-commands.md | markdown | 3.8 KB |
| references/db-investigation.md | markdown | 5.8 KB |
| references/docker-qa.md | markdown | 3.2 KB |
| references/events-hooks.md | markdown | 4.5 KB |
| references/sdk.md | markdown | 4.1 KB |
| references/server-api.md | markdown | 6.5 KB |
| references/testing-harness.md | markdown | 6.2 KB |
| references/tui-tmux.md | markdown | 4.0 KB |
| scripts/db-session-by-id.shexecutable | script | 1.7 KB |
| scripts/db-session-by-name.shexecutable | script | 1.9 KB |
| scripts/db-session-by-text.shexecutable | script | 6.6 KB |
| scripts/export-roundtrip.shexecutable | script | 2.8 KB |
| scripts/lib/common.shexecutable | script | 9.5 KB |
| scripts/lib/fake-openai-branches.mjs | script | 1.2 KB |
| scripts/lib/fake-openai-events.mjs | script | 2.3 KB |
| scripts/lib/fake-openai-server.mjsexecutable | script | 3.7 KB |
| scripts/lsp-e2e.shexecutable | script | 134.1 KB |
| scripts/serve-wake-split-probe.shexecutable | script | 38.2 KB |
| scripts/server-smoke.shexecutable | script | 2.1 KB |
| scripts/sse-hook-probe.shexecutable | script | 4.4 KB |
| scripts/tui-smoke.shexecutable | script | 3.6 KB |
scripts/tui-smoke.sh
View on GitHub#!/usr/bin/env bash
# tui-smoke.sh - launch the opencode TUI under tmux in an ISOLATED sandbox,
# confirm it renders, prove send-keys reaches the composer, then tear down.
#
# This is a feasibility/smoke check, NOT a functional assertion harness. The
# TUI is a 60fps full-screen app; reading its frame is fine for "did it boot
# and accept a keystroke", but brittle for asserting conversation output. For
# real behavior assertions use `opencode run` (Case A) or the server API /
# SSE probe (Case B). See references/tui-tmux.md.
#
# Safety: runs opencode under an isolated XDG sandbox so no session is written
# to the real ~/.local/share/opencode DB; the tmux session is always killed.
#
# Usage:
# tui-smoke.sh # run the smoke test
# tui-smoke.sh --self-test # same
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
. "$SCRIPT_DIR/lib/common.sh"
oqa_tui_smoke() {
oqa_require opencode tmux jq sqlite3 || return 1
local before after realdb ver sess cap found="" i fails=0
# Capture the REAL DB path + count BEFORE isolation. We must read it with
# sqlite3 directly: once oqa_mk_isolated_xdg exports XDG_DATA_HOME, `opencode
# db` would resolve the empty sandbox DB instead of the real one.
realdb="$(oqa_db_path)"
before="$(sqlite3 "$realdb" "SELECT count(*) FROM session" 2>/dev/null)"
ver="$(opencode --version 2>/dev/null | head -1 | tr -d '[:space:]')"
oqa_mk_isolated_xdg
sess="oqa_tui_${$}_${RANDOM}"
OQA_TMUX_SESSIONS+=("$sess")
tmux new-session -d -s "$sess" -x 200 -y 50
# launch the TUI inside the pane, carrying the isolated sandbox env
tmux send-keys -t "$sess" \
"HOME='$HOME' OPENCODE_TEST_HOME='$OPENCODE_TEST_HOME' XDG_DATA_HOME='$XDG_DATA_HOME' XDG_CONFIG_HOME='$XDG_CONFIG_HOME' XDG_CACHE_HOME='$XDG_CACHE_HOME' XDG_STATE_HOME='$XDG_STATE_HOME' OPENCODE_DISABLE_AUTOUPDATE=1 OPENCODE_DISABLE_MODELS_FETCH=1 opencode '$OQA_PROJ'" Enter
# poll for a render marker (version string, composer placeholder, or footer)
for ((i=0; i<50; i++)); do
cap="$(tmux capture-pane -t "$sess" -p 2>/dev/null)"
if printf '%s' "$cap" | grep -Eq "${ver}|Ask anything|ctrl\+p|agents"; then found=1; break; fi
sleep 0.5
done
if [ -n "$found" ]; then
oqa_pass "TUI rendered under tmux (marker found; version ${ver:-?})"
else
oqa_log "FAIL: TUI did not render a known marker in 25s; pane was:"; printf '%s\n' "$cap" | head -8 >&2
fails=$((fails+1))
fi
# prove send-keys reaches the composer: type a sentinel, expect it on screen
if [ -n "$found" ]; then
tmux send-keys -t "$sess" "oqaXYZ"
sleep 1
cap="$(tmux capture-pane -t "$sess" -p 2>/dev/null)"
if printf '%s' "$cap" | grep -q "oqaXYZ"; then
oqa_pass "send-keys reached the TUI composer (sentinel echoed)"
else
oqa_log "WARN: sentinel not visible (TUI may have remapped input); render still proven"
fi
fi
# teardown + verify
tmux kill-session -t "$sess" 2>/dev/null || true
sleep 0.5
if tmux has-session -t "$sess" 2>/dev/null; then
oqa_log "FAIL: tmux session survived teardown"; fails=$((fails+1))
else
oqa_pass "tmux session torn down (has-session false)"
fi
after="$(sqlite3 "$realdb" "SELECT count(*) FROM session" 2>/dev/null)"
if [ "$before" = "$after" ]; then
oqa_pass "real DB untouched (session count $before unchanged)"
else
oqa_log "FAIL: real DB session count changed $before -> $after"; fails=$((fails+1))
fi
[ "$fails" -eq 0 ] && { oqa_pass "tui-smoke"; return 0; }
oqa_log "tui-smoke had $fails failure(s)"; return 1
}
case "${1:-}" in
-h|--help)
sed -n '2,20p' "${BASH_SOURCE[0]}" | sed 's/^# \{0,1\}//'
exit 0 ;;
*) oqa_tui_smoke; exit $? ;;
esac
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |