Implementation checklist for an AI coder
Hand this list to the coder alongside a description of the target domain.
- Define the domain data model (single shape per entity, stable id).
- Build
storage.js:readState()+ one mutation per action. - Build tool schemas (Adapting → Tool schemas) — flat schema, ≤ 8 tools.
- Write session instructions (Adapting → Session instructions) with tone + matching rules + state placeholder.
- Build
realtime.jsper the WebRTC recipe. Usegpt-realtime, a natural voice, and manual turn detection (wire protocol → session.update). - Expose
startTurn(),endTurn(),interruptResponse()fromrealtime.jsfor Push-to-Talk wiring. - Implement the three-button session model per Session lifecycle → the three buttons: Start Session, Push to Talk (hold or Space), End Session.
- Implement the 3-minute inactivity auto-close per Session lifecycle → Inactivity timeout.
- Build
app.jstool handler per Adapting → Tool handler — always returncurrent_state. - Call
refreshContext()after every mutation so future turns see updated state. - Build
ui.jswith all elements from UI requirements. - Add API-key entry with
sk-validation andlocalStoragepersistence. Add reset-key link. - Decide whether to include MCP support. If yes, follow Wiring MCP tools.
- Include the
<audio id="assistant-audio">element in the HTML. - Handle mic permission denial + WebRTC/
getUserMediaunsupported-browser paths. - Handle 401 / 403 / 429 / network errors and surface them in the log without breaking the session lifecycle.
- Verify state persists across a page reload.
- Document the browser support caveat + security stance in the README.