2004/realtime-voice-preview/SKILL.md
One-click Starchild Live Preview: an OpenAI Realtime API voice interface connected to a Starchild Agent through ask_starchild. Supports a temporary-first work-thread selector and resumable background jobs with polling, cancellation and reconnect recovery. Use for "voice preview", "realtime voice", "语音测试", "talk to my agent", "实时语音", "voice thread", or "Starchild Live".
npx skillsauth add starchild-ai-agent/community-skills @2004/realtime-voice-previewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Creates Starchild Live, the user's realtime voice proxy. It listens, responds, and
acts as one natural assistant while using the user's Starchild context, files, memory,
tools, and work threads as internal capabilities. OpenAI Realtime handles the live voice
experience; ask_starchild remains an implementation detail, not something narrated to
the user.
The skill bundles the complete project under template/. Its setup script creates or
updates the user's own copy at output/projects/realtime-voice-preview/; it does not rely
on this agent's pre-existing project. This integration uses OpenAI Realtime, not Grok.
OPENAI_REALTIME_API_KEY securely configured, with Realtime model access and billing.STARCHILD_RUNTIME_URL (default http://127.0.0.1:8000).First check whether OPENAI_REALTIME_API_KEY is already configured. If it is missing,
call request_env_input for exactly that variable; never request or accept it in chat.
The secure prompt's visible guidance must tell the user to:
Stop and wait after requesting the key. Do not tell the user to edit .env manually.
python3 skills/realtime-voice-preview/scripts/setup.py
This copies the bundled template to output/projects/realtime-voice-preview/, preserves
any existing .env, checks runtime health and runs the 59 parser + 16 background tests.
Use --target PATH for another destination and --force to refresh bundled non-secret
files.
Serve with the Preview tool using these exact values:
title: OpenAI Realtime Voice Demo (keep constant; it determines Preview ID)dir: output/projects/realtime-voice-preview/srccommand: python3 server.pyport: 8765Then verify GET http://127.0.0.1:8765/health returns healthy. Tell the user to open the
Preview in a separate, preferably full-screen browser tab, grant microphone permission,
and test there rather than inside the embedded Preview iframe. Microphone permission is
more reliable in a top-level tab.
Agent Settings exposes one selector. Preserve this ordering:
temporary — Temporary — do not enter an existing thread. This is the default.persistent — dedicated voice-only context.thread:<id> — recent normal work threads, newest first.The browser sends the selected route only when saving /bridge_config. The server
maps it to the internal isolated | persistent | selected config. It must ignore any
per-call thread_id sent to /agent_bridge.
Temporary uses is_temporary=True, so it does not read or write an existing work
thread. A selected work-thread ID must be validated against /bridge_threads. Build
that catalog from the authenticated Thread Service (/api/clawd/threads), not runtime
/sessions: the Thread Service supplies user-facing titles. Render title first with
message count/activity as optional context; keep the thread ID only as the internal
option value. Filter temporary/voice/transport threads and cap the result set.
ask_starchild execution modesThe Realtime tool accepts question and optional execution_mode:
| Mode | Behavior |
|---|---|
| wait | Waits within a short safe budget; if unfinished, automatically returns HTTP 202 with a resumable run_id before the Preview gateway timeout |
| background | Immediately returns HTTP 202 with accepted run_id |
| auto | Conservative local selection; short ordinary questions try the bounded wait path, explicit background/continue or long task-like prompts use background |
For HTTP 202 the client must:
function_call_output acknowledging accepted run_id;localStorage;GET /agent_jobs?run_id=... about every two seconds;POST /agent_jobs/cancel;GET /agent_jobs;Never send a second function-call output for a background completion. Completion is a
new conversation message, not another output for the original call_id.
Verbatim relay. ask_starchild.question must carry the user's spoken words as
transcribed — the Realtime model must not paraphrase, summarize, translate, expand, or
guess intent. Realtime owns speech and turn-taking only; understanding belongs to the
Agent. If a request is genuinely ambiguous, the model asks the user out loud to clarify
rather than inventing a filled-in question. The tool description and system instructions
both enforce this so semantic drift never reaches the Agent.
Temporary rolling context. Temporary mode has no persisted thread history, so
elliptical follow-ups ("可以去做了吗", "那第二个呢") cannot be resolved server-side.
The browser keeps a rolling transcript (last ~12 turns) and sends it as the optional
context array with each /agent_bridge call. The server injects it — only when
is_temporary is true — as a compact [Recent voice conversation] block (capped to the
last 6 turns / 1200 chars) ahead of the verbatim spoken request. Selected/persistent
threads already have real history, so context is deliberately skipped there to avoid
duplication. context flows through both the synchronous and background-job paths.
Cancellation is cooperative. cancel_requested is active, not terminal; only report
cancelled after the worker observes the flag. The server retains sanitized job state
with TTL/cap bounds, allows one active job per effective thread, and reuses a recent
identical job's run_id.
python3 -m py_compile output/projects/realtime-voice-preview/src/server.py
node output/projects/realtime-voice-preview/src/test_function_calls.js
python3 output/projects/realtime-voice-preview/src/test_background_jobs.py
Expected: 59 function-call tests and 16 background-job tests pass. Also verify Preview health and the live HTML title after restarting the service.
Preview ID stability (do not skip). The Preview tool derives the preview ID from the
title slug. Keep the serve title constant across every restart so the URL never
changes — product/brand renames belong in the HTML <title> and on-page copy only, never
in the serve title. Update code by re-serving the same title on the same port; never
stop-and-recreate under a new title, which silently mints a new ID and breaks the user's
saved URL.
POST /session, GET /tokenPOST /agent_bridgeGET /agent_jobs, GET /agent_jobs?run_id=...POST /agent_jobs/cancelGET|POST /bridge_configGET /bridge_threads?agent_id=...GET /healthask_starchild is the only capability gateway; Realtime must not invent Agent data.[Starchild Live Voice Agent] source marker and label the spoken request; this must be visible in selected work-thread history./agent_bridge past the Preview gateway window. Use a shorter synchronous budget and promote unfinished wait calls to the existing background-job lifecycle.Unexpected token '<'.community-publish skill.Always instruct the user to test in a separate, full-screen browser tab, never inside the embedded Preview iframe:
getUserMedia). Browsers restrict or
deny this inside embedded/sandboxed iframes, so the embedded Preview panel may silently
fail to capture audio even when the page loads fine.title) means the user grants it once; a renamed title mints a new ID and re-prompts.Include this guidance every time you hand the Preview URL to a user.
| Symptom | Check |
|---|---|
| No sound / connection fails | OpenAI billing, Realtime model access, mic permission |
| Agent bridge fails | Runtime /health and STARCHILD_RUNTIME_URL |
| Unexpected token '<' after ~30 seconds | Preview gateway returned HTML while a synchronous request was still running; ensure bounded wait auto-promotes to a run_id and the client validates response content before JSON parsing |
| Query interrupted | Duplicate tabs/calls; serialization and result cache must remain enabled |
| Work thread rejected | Refresh /bridge_threads, choose a recent thread, or use Temporary |
| Job result not spoken after reconnect | Confirm it remains pending locally, data channel is open, and delivered set does not already contain the run ID |
| Cancel stays cancel_requested | Worker/runtime cancellation is cooperative; wait for verified terminal state |
tools
TQX (tqx.trade) HK/US stock quant workflow via tqx-cli: cross-sectional factor analysis, event-driven strategy backtests on the panda_backtest engine, and agent-driven automated paper trading. Use when the user wants to run factor IC/IR analysis, backtest a Python trading strategy on Hong Kong or US stocks, or set up agent-automated trading (e.g. "backtest a moving-average strategy on AAPL", "analyze a momentum factor on HK stocks", "let the agent trade my paper account").
tools
中学物理实验教学参赛方案套件。包含四个完整实验(单摆测g、声悬浮测声速、向心力定量演示仪、电磁阻尼定量研究),每套含固件源码、3D打印图纸、教学PPT、教学文稿、采购清单、调试手册、视频分镜脚本、模拟器。Use when a teacher/student needs a complete, classroom-ready physics experiment package for competition or teaching.
development
End-to-end blog management for AI agents. Write, import, build, preview, and publish articles using the blog template. Covers draft workflow, article import, SEO, OG images, and deployment.
development
ESP8266/ESP32 + 磁簧开关/霍尔传感器 单摆测重力加速度实验套件。 硬件搭建→固件烧录→数据采集→Web仪表盘→g值计算→教学文档,一站式完成。 Use when the user wants to build a pendulum g-measurement experiment, measure gravity with a micro-controller, or needs a complete physics experiment package with hardware + firmware + dashboard + teaching materials.