Inspiration

AI coding agents let developers ship faster than ever, but orchestrating parallel prompts, reviewing rapid diffs, and context-switching across agent threads triggers cognitive burnout just as fast.

Back in 2018, I built a final-year web application (binaural-beats-web), researched brainwave entrainment frequencies, and drew a yellow mask mascot—inspired by Giorgio Regni's open-source Android app (Binaural Beats Therapy, GPLv3) and 1990s deterministic audio tools like SBaGen and Gnaural. Over time, that project sat unused while modern wellness apps moved behind paywalls and compressed audio streams. For Kiroween 2026 (Resurrection), I brought that 2018 work back to life as Zonked: a free, private, humanitarian acoustic recovery sanctuary and Kiro Crew companion.

What it does

Zonked pairs a Kiro Crew multi-agent burnout monitor with a zero-latency, offline-first Progressive Web App (PWA) powered by a no_std Rust-to-WebAssembly (WASM) audio engine running inside a Web Audio AudioWorklet.

  • No-Brainer, Zero-Jargon Onboarding: First-time users who have never heard of binaural beats pick how they feel (Calm my mind, Steady focus, Fall asleep, Reset after AI/coding work) and get at least 5 ranked, deterministic recommendations with plain-English explanations from a 232-template catalog across 8 categories (ADHD control, focus, sleep, meditation, healing, lucid dreams, vibes, and work recovery).
  • Expressive, Zero-Download Synthesis: Synthesizes true phase-locked binaural beats ($f_L = f_c - \Delta f/2$, $f_R = f_c + \Delta f/2$), monaural beats, raised-cosine isochronic pulses, and four noise beds (white, pink, brown, and violet) alongside musical, breathing layers—lo-fi chord progressions with tape wobble, soft piano voices, and organic chimes—with zero downloaded audio files.
  • Kiro Crew Burnout Companion: Opt-in local Kiro Crew agents (burnout-sentinel, acoustic-sequencer, dsp-verifier) evaluate coding session intensity and push smooth recovery transitions (minimum 30-second ramp) to the live player.
  • Built for Real Life: Includes countdown, sleep fade-out, and Pomodoro timers, Wake Lock / background playback support, Bluetooth & headphone MediaSession controls, full keyboard shortcuts, a 3D interactive resurrection of the 2018 yellow mask mascot, and local-only saved mixes/milestones with zero tracking.

How we built it

  • Kiro & Kiro Crew (.kiro/): Used spec-driven development (.kiro/specs/), always-on steering rules (.kiro/steering/), automated hooks (.kiro/hooks/), and parallel specialized Kiro Crew agents to build, audit, and harden every layer.
  • Rust no_std WASM DSP Core (crates/dsp-core): A 38.6 KB WebAssembly module with zero runtime imports, 64-bit fixed-point phase accumulators (u64), per-sample smoothing, and hard hearing-safety bounds (carrier 20–1500 Hz, beat 0.5–40 Hz, gain <= 0.85, brickwall limiter at 0.95).
  • Minimalist, Sharp-Edged PWA (web/): Built with React, TypeScript, and Vite with code-split lazy chunks (104.96 KB gzip first load), prompt-style Service Worker updates (never interrupting active audio), and strict CSP, COOP, COEP, and CORP headers.

Challenges we ran into

  • Making Synthesized Sound Feel Alive Without Audio Files: Early pure-tone builds sounded clinical and monotonous. Adding musical lo-fi progressions, soft piano voices, violet noise, stereo width, and slow level breathing (lifting 1-minute dynamic swing from 0.14 dB to 4.46 dB) while staying no_std and zero-allocation inside AudioWorklet took careful DSP tuning and headroom limiting.
  • Keeping Standalone Loads Quiet: Browser consoles log refused localhost requests when a local bridge isn't running. Making the Kiro Crew bridge cleanly opt-in (via an in-app switch or ?crew=1) eliminated all console noise on standalone loads.
  • Strict Privacy & Licensing Hygiene: Separating our MIT-licensed codebase from third-party GPLv3 reference material (legacy/), rewriting near-copied template wording, and hardening our automated privacy scanner.

Accomplishments that we're proud of

  • Full Verification Harness (verify:all): 17 automated stages passing cleanly—59 Rust tests (clippy clean), 331 web tests (91.2% line coverage), 50 crew-bridge tests, 73/73 Playwright E2E checks, security audit, and privacy scan across 289 files.
  • Tiny, Offline-First Footprint: 38.6 KB WASM DSP engine and 104.96 KB gzipped first load with zero external audio downloads and verified offline PWA reload.
  • Humanitarian & Free Forever: Research-backed frequency guidance (with honest "may support" evidence labels), strict hearing protection, and 100% local privacy with zero paywalls.

What we learned

  • Deterministic scoring + plain-English UX makes specialized audio tools immediately usable for people who have never heard of binaural beats.
  • Enforcing architectural boundaries early with Kiro specs, steering files, and automated hooks prevents audio-thread regressions and keeps multi-agent builds cohesive.

What's next for Zonked

  • Adding custom layer syntax directly into the .sbg script editor.
  • Expanding cross-browser manual audio testing across Firefox, Safari, and mobile screen readers.
  • Growing community-contributed, open-source .sbg recovery packs for developers, students, and neurodivergent focus workflows.

Built With

Share this project:

Updates

Submission history