Inspiration
Some people keep only one reliable movement: a blink, a finger twitch, a press on a switch. This happens with ALS, locked-in syndrome, brainstem stroke, high spinal-cord injury and cerebral palsy. Dedicated communication devices cost thousands of dollars. Single-switch scanning keyboards manage a few words a minute.
Morse code is a dead technology. Maritime Morse ended in 1999, and the FCC dropped the Morse exam for amateur radio in 2007. Yet it is still the most efficient alphabet ever designed for one switch. In 2024, Google's SpeakFaster study (Nature Communications) showed that a language model can expand heavily abbreviated text, such as word initials, using the conversation around it. That saved 57% of motor actions for eye-gaze users with ALS. Nobody had put the two together in a free app for single-switch users. So we resurrected Morse and gave it that brain.
What it does
Dit is a free browser app. The speaker keys Morse with their one movement, and Dit says the sentence out loud.
- Type initials, say a sentence. Keying
i w t g ogives "I want to go outside." with two alternatives. Spelled out, that sentence costs 36 presses before you can speak it. With Dit it takes 17, including the speak code. - Any one movement. Space, Enter, a USB or Bluetooth switch, a tap anywhere on the panel, or an opt-in webcam blink detected on the device with MediaPipe. Camera frames never leave the device.
- It learns your rhythm. The timing engine starts slow, at 6 words per minute, and adapts to how fast the speaker actually keys.
- Everything works with the one input. Morse command codes speak, pick the next suggestion, delete a letter, or set off an SOS alarm (
...---...) that shows a full-screen "I need help" card. A legend stays on screen. - It uses the conversation. The partner can type their line, or turn on Listen to transcribe what they say. Suggestions then fit what was just asked.
- It keeps working offline. With no network or API key, an on-device expander answers from a built-in phrase bank and a word-frequency list. The screen always says whether "AI" or "On-device" answered.
- Built for the person in the next chair. The sentence being typed and the last thing said are shown in large, high-contrast type you can read across a bed. The view can flip 180° for a partner sitting opposite.
- Setup takes under a minute. Pick your input, make 5 practice presses to set your speed, and learn the codes.
No accounts, no analytics, no server storage. History stays in the browser.
How we built it
Next.js 16 (App Router), TypeScript strict, Tailwind v4 and Bun, deployed on Vercel. The Morse engine is a pure, deterministic TypeScript module with an injectable clock. Expansion goes through POST /api/expand, which accepts any OpenAI-compatible endpoint. In production that is DeepSeek V4.1 Flash on Fireworks with reasoning switched off, for answers in about 1 to 2 seconds. The route validates input with Zod, checks the origin, rate-limits per IP and times out after 4 s. It also rejects any suggestion that doesn't match the typed initials word for word. Listen uses the browser's speech recognition and falls back to Groq Whisper when the browser has no speech backend.
How Kiro was used
Kiro built Dit spec-first. Everything is in .kiro/ in the repo.
- Specs: five of them, built in order and each with EARS requirements, a design and a task list:
morse-engine,input-sources,expansion,conversation-uiandonboarding-and-safety. Each design lists numbered correctness properties, and deviations found while building are written back into its "Implementation notes". - Steering:
product,techandstructureare always included.morse-engineandaccessibilityare included only when a matching file is open, so the agent sees the timing rules while it edits the engine and the contrast and one-input rules while it edits the UI. - Seven hooks:
- an accessibility review on every UI save;
- a privacy review on any network, storage or camera code;
- engine property tests on every engine save;
- typecheck and lint on save;
- the full suite after each task;
- a README sync when a task list changes;
- a PreToolUse guard that blocks any agent write that looks like an API key.
- Custom agent:
dit-buildertakes one spec task at a time. Its shell is limited to Bun, Vitest, tsc, ESLint and read-only git. It cannot touch.env, steering, hooks or the brief. - MCP: Context7 for current library docs and next-devtools for Next.js runtime diagnostics.
- Property-based testing: every correctness property in the designs has its own fast-check test, 116 in all. They check, for example:
- encoding any text and decoding it gives the text back;
- decoding survives ±30% timing jitter;
- the adaptive speed converges on the user's speed;
- no command code collides with a letter;
- while the alarm is on, no press leaks through.
The suite has 1,451 tests in total.
Kiro wrote the specs, the steering, the hooks and the whole build, then a final design-polish pass. It ran out of hackathon credits at the end. The last fixes were made with other coding agents against the same specs and hooks: tuning when typed letters count as initials, a practice-panel layout fix for short screens, and the Groq transcription fallback.
Challenges we ran into
- Deciding when letters are initials. Is
mbhinitials ("My back hurts") or a word in progress? The classifier went through many rounds against real caregiver phrases. Short care words like "ouch", "pee" and "meds" had to stay words, whileiwtgohad to stay initials. - Timing for real bodies. People with motor impairment don't press evenly. Property tests with random jitter kept the decoder honest.
- Speech in every browser. Some Chromium browsers have no speech recognition backend, and Fireworks retired audio inference mid-year. Listen now records audio, detects pauses on the device, and falls back to Whisper on Groq.
Accomplishments that we're proud of
- A whole sentence from five letters, spoken aloud, with one movement.
- It works fully offline and never stores anything on a server.
- 116 property-based tests that check the engine's guarantees, not just a handful of examples.
What we learned
Writing the requirements as properties paid off. A property-based test catches a timing bug that example tests never do. Steering that loads only for matching files kept the agent focused on the right rules at the right time.
What's next for Dit
Testing with real switch users and speech therapists. Blink testing on more webcams. More languages. A personal phrase bank that learns from what the speaker says most.
Built With
- bun
- deepseek
- fast-check
- fireworks-ai
- groq
- kiro
- mediapipe
- next.js
- react
- tailwindcss
- typescript
- vercel
- vitest
- web-speech-api
- whisper