Inspiration

I kept seeing classmates, and myself, paste an error into an AI chatbot, copy the fix, and learn nothing. A week later the same bug came back. Rubber duck debugging works: you explain your code to a duck and hear yourself say the bug out loud. But a real duck can't ask "what is i on the last loop?" So I built one that can, and that refuses to just tell you.

What it does

Paste Python or JavaScript, say what it should do, and talk to Quack by typing or by voice. Quack only asks Socratic questions until you find the bug yourself.

  • Run code in the browser: the output appears in the chat, and Quack asks you to interpret it.
  • Hint ladder: a nudge, then the concept, then the highlighted line, then why it's wrong. Never the fix.
  • Leak guard: every reply is checked so the answer can't slip out, even if you beg.
  • Bug journal: each solved bug is classified with a one-line lesson, and the journal shows your patterns over time.
  • Voice mode: talk to the duck, and it squeaks back.

How we built it

  • Next.js 16, TypeScript, Tailwind v4 and shadcn/ui, deployed on Vercel.
  • Gemini 3.6 Flash plays Quack and returns structured JSON checked with zod. Gemini 3.5 Flash-Lite judges leaks and classifies bugs.
  • Monaco Editor highlights the buggy line.
  • Pyodide and JavaScript run in sandboxed Web Workers with stdin and a 5-second loop guard.
  • An animated SVG duck (Framer Motion) with six moods, Recharts and localStorage for the journal, and the Web Speech API for voice.
  • Vitest and Playwright for tests, a red-team script, and automated screenshots and video.
  • A demo mode that works without an API key.

Challenges we ran into

  • Keeping the answer from leaking. Told never to give the fix, the model still wrote things like "try i < scores.length". I added three layers of defense: replies may only quote the learner's code verbatim (Smith–Waterman alignment catches near-copies that are "fixed"), an AI judge checks every reply, and a safe fallback question replaces any reply that fails. Tuning out false positives took 22 test replies.
  • Streaming vs. guarding. You can't stream a reply you haven't checked yet. Instead I stream progress messages and send the reply only after it passes.
  • Pyodide in a worker. The bundler turned the module worker into a classic worker, which Pyodide won't load in. I serve it as a plain ES module instead.
  • Scope. I cut a planned hardware ESP32 duck to make the software solid.

Accomplishments that we're proud of

  • A tutor that is truly Socratic: it asks and never tells.
  • A leak guard that catches "fixed" lines even when they aren't formatted as code.
  • Everything except the AI calls runs in the browser: code execution, stats and storage.
  • Lighthouse accessibility score of 100, plus dark mode, a mobile layout and reduced-motion support.

What we learned

  • Prompting alone doesn't keep an AI from giving away the answer. Code checks, a judge and a fallback together do.
  • Small UX touches, like confirming before each hint and celebrating a fix, change how being stuck feels.
  • Browsers can now run Python, listen and speak without a server.
  • Cutting a feature made the rest of the product better.

Built With

  • ai
  • education
  • framer-motion
  • gemini
  • hackathon
  • monaco-editor
  • nextjs
  • pyodide
  • rubber-duck-debugging
  • socratic-learning
  • tailwindcss
  • typescript
Share this project:

Updates

Submission history