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/db-session-by-name.sh
View on GitHub#!/usr/bin/env bash
# db-session-by-name.sh - find opencode sessions whose TITLE matches a substring.
# Read-only against the LIVE opencode DB. Title search is cheap (the session
# table is small; ~21k rows scan in milliseconds), so no bounding is needed.
#
# Usage:
# db-session-by-name.sh "auth refactor" # newest 20 matches
# db-session-by-name.sh "auth refactor" 50 # newest 50 matches
# db-session-by-name.sh --self-test
#
# Output: JSON array of {id, title, created, updated} ordered newest first.
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
. "$SCRIPT_DIR/lib/common.sh"
oqa_session_by_name() {
local needle limit esc
needle="$1"
limit="${2:-20}"
case "$limit" in (*[!0-9]*|"") limit=20 ;; esac
esc="$(oqa_sql_escape "$needle")"
oqa_db_query "SELECT
id, title,
datetime(time_created/1000,'unixepoch') AS created,
datetime(time_updated/1000,'unixepoch') AS updated
FROM session
WHERE title LIKE '%$esc%'
ORDER BY time_created DESC
LIMIT $limit"
}
oqa_self_test() {
oqa_require opencode jq || return 1
# Derive a guaranteed-present needle: the first 5 chars of a real title.
local needle out n
needle="$(oqa_db_query "SELECT substr(title,1,5) AS t FROM session WHERE length(title)>=5 ORDER BY time_created DESC LIMIT 1" | jq -r '.[0].t // empty')"
if [ -z "$needle" ]; then
oqa_log "FAIL: could not derive a title needle"; return 1
fi
out="$(oqa_session_by_name "$needle" 5)"
n="$(printf '%s' "$out" | jq 'length')"
if [ "${n:-0}" -ge 1 ]; then
oqa_pass "db-session-by-name found $n row(s) for needle '$needle'"
return 0
fi
oqa_log "FAIL: expected >=1 row for needle '$needle', got '$n'"; return 1
}
case "${1:-}" in
--self-test) oqa_self_test; exit $? ;;
-h|--help|"")
sed -n '2,14p' "${BASH_SOURCE[0]}" | sed 's/^# \{0,1\}//'
[ -z "${1:-}" ] && exit 2 || exit 0 ;;
*)
oqa_require opencode jq || exit 1
oqa_session_by_name "$1" "${2:-20}" ;;
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: 319k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 319k | 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: 196k | Updated | Claude CodeCodex | Verified | Install |