DEV Community

Rohan kr. pandey
Rohan kr. pandey

Posted on

Rubber Duck Gate: a git hook that makes you explain yourself to a duck before you force-push

This is a submission for the Presage SmartSpectra SDK Challenge

What I Built

Developers have always explained bugs to rubber ducks. Rubber Duck Gate makes the duck the last reviewer before a risky push.

Run git push --force origin main and the push stops. A window opens and a duck asks you, out loud please:

  • What does this change do?
  • What could it break?
  • How would you undo it?

It takes 15 seconds of real talking to fill the ring. Stop talking and the duck frowns at you. Finish and it quacks ("I understood none of that. Approved."), and git carries on.

The part I like most: the duck never hears you. It knows you are talking from your face, through the camera. The app never touches the microphone.

Saying a change out loud is a cheap way to catch a bad one, and a force-push is exactly when people skip that step. Normal pushes to feature branches are not interrupted at all.

Demo

Watch the demo video

The video shows a real force-push in a throwaway repository, stopped by the live camera session. It has no sound because the app never records any. Waiting while nothing happens is sped up, and the video labels those parts.

Code

GitHub logo RohanPandeydev / rubber-duck-gate

A git hook that blocks risky pushes until you explain your change out loud to a rubber duck. Camera only, no microphone. Built with the Presage SmartSpectra SDK.

Rubber Duck Gate

Developers explain bugs to rubber ducks. This duck is the reviewer.

Run git push --force origin main and the push stops. A window opens and a duck asks you to explain your change out loud: what it does, what it could break, how you would undo it. It takes 15 seconds of real talking to fill the ring. Stop talking and the duck looks unimpressed. Finish and it quacks, and the push goes through.

The duck never hears you. It knows you are talking from your face, using the camera and the Presage SmartSpectra SDK The app never uses the microphone.

Built for the DEV Presage SmartSpectra SDK Challenge.

The duck's screens: consent, listening, unimpressed and approved

These screenshots use the app's simulated signal, as the badge in each one says.

What it stops

Action Stopped?
Force-push (history rewrite) to any branch Yes
Any push to main, master, production or prod Yes
…

Setup instructions are in the README. You need a free SmartSpectra API key. There is no login, and npm start opens the duck without a real push. I have only run it on an Apple Silicon Mac.

How It Responds to Human Signals

The app uses the SmartSpectra Node.js and Electron SDK and requests the face metrics. Two live signals drive it:

  • face.talking is the gate. src/talk-meter.js adds up talking time from the live samples and bridges the short gaps between words. The ring fills as you speak and stops when you stop. After 4 seconds of silence, the duck frowns and nudges you ("Still here. Still a duck.").
  • face.expression gives the duck something to say when an expression score is confident: a smile gets "Why are you smiling? What did you do?" It is a joke, not a reading of your mood.

The SDK's validation messages (no face, too dark, too close) become plain instructions on screen.

The integration is small: new SmartSpectraSDK({ apiKey, requestedMetrics: [...faceMetrics], enableTelemetry: false }), then a metrics listener decodes each packet and feeds the talk meter.

I started with slow breathing as the signal and dropped it. On my own test runs the waveform was too noisy for a yes or no decision, with a large swing while it settled. So I tested face.talking on its own before building on it. In that test, an 8.7 second silence never once read as talking, and both spoken stretches registered clearly.

Prize Categories

Most Creative or Delightful Use. Camera-based vitals usually lead to dashboards. This uses a human signal to get a rubber duck to judge your force-push, and it turns "knows you're talking, can't hear a word" into the joke and the privacy feature at once.

Best Thoughtful Real-World Use. The need is the moment before a destructive git action, for any developer who has regretted one. It only appears for risky pushes, it can always be skipped, and the camera is only on for the seconds it needs.

Consent and Data Handling

  • Camera consent: the camera stays off until you press "Turn on camera and start". It turns off when you finish, cancel, skip or hit an error, and after 3 minutes at most.
  • Microphone: never used. The app requests video only and denies other permissions.
  • Storage and retention: the app stores no video, face data or history, and has no server, analytics or AI service of its own. There is nothing to delete. An optional developer setting, DUCK_DEBUG=1, writes the talking flag to a log file you choose, and it is off by default.
  • Sharing: the SDK processes video on the device and contacts Presage to validate the API key and usage, and may fetch device keys and models. See Presage's telemetry and privacy documentation.
  • SDK telemetry: switched off with enableTelemetry: false.
  • Optional AI services: none. The SDK's LLM Insights feature is not used.
  • API key: kept in a local .env file that git ignores.
  • Control: "Skip the duck, continue anyway" is always on screen, and git push --no-verify works as usual.
  • Not a measurement of you: no diagnosis, health, stress or emotion claims. It should not be used to monitor anyone who has not agreed to it.

Top comments (0)