Inspiration
What it does
How we built it
Challenges we ran into
Accomplishments that we're proud of
What we learned
What's next for Ghost Rider CB
Inspiration
I deliver food at night in Seoul on a motorbike, and I study AI at an open university during the day. On a night shift you learn about black ice, a closed apartment gate or a flooded underpass by hitting it. Rider group chats exist, but typing with gloves on while moving is dangerous and illegal.
Truckers solved this fifty years ago with CB radio: one channel, one button, a voice saying "breaker, breaker" to whoever is nearby. Phones killed CB, then gave riders a screen they cannot look at. I wanted the dead technology back, with two things it never had: a memory and a translator. Many riders are migrants who do not share a language.
What it does
Ghost Rider CB is a phone web app. No sign-up, no email, no phone number. You pick a handle and a language, and you are on Channel 13 — Graveyard Shift.
- Push to talk. One giant button, or the media button on a headset, records a clip of up to 20 seconds and broadcasts it to everyone on the channel. Incoming clips play by themselves, in order, after a squelch. No typing, ever.
- Spirit Box. The server sends each clip to Gemini on Vertex AI. It returns a transcript, the detected language, a translation for every language on the channel, and — only if the rider described one — a structured hazard: type, severity, one-line summary.
- Ghost pins. A hazard becomes a ghost on the map at the sender's location. Ghosts fade as they age and vanish when their lifetime ends: black ice lasts 3 hours, a police checkpoint 45 minutes. The same hazard reported within 150 m merges into the existing ghost instead of stacking. Say "cleared" and it is gone. Ride within 300 m of a serious one and the phone speaks a warning in your language.
Voice always goes first. The clip reaches other riders before any AI work starts, and if the AI fails, the clip is still delivered and the reading says "the spirits are silent."
Clips and transcripts are deleted after 24 hours. Locations are rounded to about 11 m before storage.
How we built it
One FastAPI process with native WebSockets, plain HTML/CSS/JavaScript with no build step, Leaflet for the map, no database. The live demo runs on Google Cloud Run as a single instance. Every sound — squelch, static, roger beep — is synthesized with the Web Audio API.
How Kiro was used (the README holds the full record):
- Kiro CLI, headless. The whole app was implemented with Kiro CLI 3.6 running a custom agent non-interactively, one spec task or one fix per session, eleven sessions in total. Every application commit after the first is prefixed
Kiro:. Kiro IDE, Web, Crew, MCP servers and powers were not used. - Spec first.
requirements.md,design.mdandtasks.mdwere committed before any code. Each session was told only "do task N." When behaviour had to change, the spec changed first: the fixed 8 s AI timeout in Requirement 4.3 became a hedged request (a second identical request after 6 s, 20 s total budget), and only then the code. Unlike free prompting, no session had to be told the hazard list, the pin lifetimes or the no-database rule again. - Steering.
product.md(who the riders are, gloves, night),tech.md(stack, credentials only from environment variables) andstructure.md. The agent loads all three, so task prompts stayed one line long. - Custom agent and agent hooks.
ghost-builderis restricted to file read/write, grep, glob and shell. Two CLI hooks ran in every session:agentSpawnrunsgit status --short;stopruns the test suite, so every session ends with a pass/fail line. - IDE hooks: written, not exercised. Three hooks (secret guard, property tests on logic edits, glove/night legibility check) trigger on file saves in Kiro IDE. The build ran in the CLI, so they never fired. They stay for the next contributor.
- Property-based testing. Hypothesis covers the two pure modules: 4 properties for ghost pins and 4 for the channel hub. The suite is 135 passed, 1 skipped (the skipped test needs live cloud credentials).
- Other tools. The spec, steering files and live measurements were prepared with a separate AI coding assistant (Claude Code), which also launched the Kiro sessions. Application code and tests were written by Kiro. The Dockerfile and the Cloud Run deployment were done by Claude Code.
Challenges we ran into
- The AI failed silently. The first live check scored 2 out of 10 on hand-written radio calls in Korean, English and Vietnamese: the HTTP transport was missing and nothing reported it. Fixing the translation schema and null hazards got 6/10. Making
hazard_typerequired and lowering the thinking level got 10/10. - A hidden one-second stall. Measuring latency exposed an event-loop stall of about 1 s right after each upload, caused by token minting and file writes on the loop. Kiro moved them off the loop and added a regression test.
Accomplishments that we're proud of
- Talk-to-play latency, 20 runs: median 0.92 s and max 0.99 s on local Wi-Fi; median 1.23 s and max 1.43 s through a public tunnel. The AI reading follows 3.6–5.1 s later, without holding up the voice.
- A rider can use every core function without reading the screen: contrast of at least 7:1 and touch targets of at least 64 px are written into the requirements.
- The write-up says what was not used. The IDE hooks did not run, and we say so.
What we learned
- A spec is what makes separate headless sessions agree with each other. Eleven sessions, one source of truth.
- A
stophook that runs the tests changes what "done" means for an agent. - Measure the live model. Our first number was 2/10 and no error told us.
What's next
- Run it with other riders on real shifts. So far it has been tested with two phones and a demo bot of simulated riders, not with a rider community.
- Channels by district, so a warning reaches the people near it.
- Open the repo in Kiro IDE and exercise the three hooks that are waiting there.
- A larger Spirit Box test set, with more languages and noisy road audio.
Links
Built With
- css3
- docker
- fastapi
- gemini
- google-cloud
- google-cloud-run
- html5
- hypothesis
- javascript
- kiro
- kiro-cli
- leaflet.js
- media-session-api
- mediarecorder-api
- openstreetmap
- pwa
- pytest
- python
- service-worker
- uvicorn
- vertex-ai
- web-audio-api
- web-speech-api
- websockets