Skip to main content

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.js per the WebRTC recipe. Use gpt-realtime, a natural voice, and manual turn detection (wire protocol → session.update).
  • Expose startTurn(), endTurn(), interruptResponse() from realtime.js for 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.js tool handler per Adapting → Tool handler — always return current_state.
  • Call refreshContext() after every mutation so future turns see updated state.
  • Build ui.js with all elements from UI requirements.
  • Add API-key entry with sk- validation and localStorage persistence. 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/getUserMedia unsupported-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.