RoastGuard v2.2.0: Automating Self-Discipline with Google Gemma 4 When You're Too Lazy to Stop Doomscrolling 🦥
DEV Community

RoastGuard v2.2.0: Automating Self-Discipline with Google Gemma 4 When You're Too Lazy to Stop Doomscrolling 🦥

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady

What I Built

Doomscrolling is a trap of cognitive exhaustion. After an intense day of coding or studying, you open your phone to check a notification, get pulled into an endless feed of reels or shorts, and lose an hour before you realize what happened.

Your brain knows you need sleep, but closing the app requires mental willpower - and when you're drained, you are simply too lazy to discipline yourself.

Most digital wellbeing tools fail because they demand more active effort:

  • Manual screen-time logging or journaling.
  • Lockout passwords (which you bypass five minutes later).
  • Answering math problems or friction surveys just to close an alert.

In honor of International Sloth Day 🦥, RoastGuard (Doom Roast) v2.2.0 turns this dynamic upside down: Let an open-weight AI do the hard work of disciplining you so you don't have to lift a finger.

RoastGuard is an automated Android anti-doomscrolling companion. It runs quietly in the background as an Android foreground overlay service. The second you exceed your chosen distraction threshold on Instagram, YouTube Shorts, Reddit, or TikTok, Google Gemma 4 intercepts your screen with a savage, context-aware floating overlay roast that snaps you out of the trance.

Who gets to be lazy? You do. You don't have to summon willpower or manage timers. The AI does the heavy lifting of breaking your screen addiction.

Demo

  • 📦 Download Android Release APK (v2.2.0): RoastGuard v2.2.0 Release on GitHub
  • 🚀 Direct APK Asset: app-release.apk

What it looks like in action:

  • Zero-Effort Setup: Pick your distraction threshold (from 1 to 120 minutes) and select your roast intensity (Mild, Medium, Savage, or Nuclear).
  • Background Vigilance: The app monitors foreground app packages locally without sending any telemetry to external tracking servers.
  • The Jolt: When your time is up, an unignorable system alert window floats over your screen with a custom Gemma 4 roast, accompanied by vibration and alert audio.

Code

The entire project is open-source under the permissive MIT license: YadneshTeli / roast_guard 🔥 Flutter app that roasts you for doomscrolling - screen-time monitoring with brutal overlay interventions 🔥

Doom Roast

The app that roasts you for doomscrolling. Doom Roast monitors your screen time on social media apps and delivers brutally honest roast overlays when you exceed your time limit. It's the productivity app you didn't ask for, but desperately need.

✨ Features

  • 📊 Usage Tracking - Select and monitor any installed application on your device (with dynamic branding fallbacks, deterministic theme generation, and preset icon matching)
  • 🪟 Full-Screen Roast Overlay - Covers the offending app with a savage roast message and a mandatory 10-second shame timer, now using a scrollable viewport to prevent layout clipping
  • 🎨 Pure Material 3 - Redesigned interface following strict Material Design 3 guidelines using harmonious container colors, standard surfaces, and official typography
  • 🔥 Pre-Written Roast Bank - 30+ hand-crafted, app-specific roasts that hit different
  • ⚡ Roast Intensity - Choose between Gentle Nudge 😊, Moderate Shame 😤, or Full Intervention 🔥
  • ⏱️ Configurable …

View on GitHub (Direct repository link: https://github.com/YadneshTeli/roast_guard)

How I Built It

The v2.2.0 update transforms RoastGuard from a basic timer into an intelligent, open-weight mobile guardian. Here is the technical architecture behind it:

  1. Google Gemma 4 Open-Weight Core

We integrated Google's Gemma 4 as the primary intelligence engine. Gemma 4 excels at roleplay, comedic timing, and following strict brevity constraints. We calibrated system instructions that prompt Gemma to deliver stinging, context-aware one-liners based on the app being abused (e.g., calling out endless reels vs. doomscrolling Twitter arguments).

  1. Eliminating the <think> Reasoning Token Leaks

Newer open-weight reasoning models often emit internal chain-of-thought tokens (<think>...</think>). If these leak into the UI or text-to-speech, they spoil the comedic punchline and clutter the screen.

In v2.2.0, we engineered a multi-tiered sanitization pipeline:

  • Stream-level regex filtering: Drops <think> blocks before the response buffer is finalized.
  • Unclosed-tag fallback: Truncates incomplete thinking streams if the model output is clipped.
  • Native Kotlin guard: Validates and cleans strings before the Android OverlayService.kt renders the text view.
  1. Smart Pre-Fetch & Cache Architecture

Waiting 2-3 seconds for an LLM response when an overlay needs to trigger ruins the intervention. RoastGuard uses an asynchronous Riverpod prefetch pipeline: as soon as you change your threshold or AI settings, Gemma pre-generates a pool of roasts in the background, caching them locally so overlay dispatch is 0ms instantaneous.

System Architecture:

flowchart TD
User([📱 User scrolling Reels / Shorts]) -->|Exceeds Time Threshold| Tracker[⏱️ Screen Time Monitor<br>Android UsageStats API]
Tracker -->|Trigger Event| Router{⚡ AI Provider Router}
Router -->|Primary: Open Weights| Gemma[💎 Google Gemma 4<br>Open-Weight Inference]
Router -->|Secondary: High Speed| Groq[🚀 Groq API Llama 3 / Gemma]
Gemma -->|Raw Stream| Sanitizer[🛡️ 4-Tier Reasoning Sanitizer<br>Strips think tokens]
Sanitizer --> Cache[(💾 In-Memory & SharedPrefs Cache)]
Cache -->|Immediate 0ms Trigger| Overlay[🚨 Native Floating Overlay<br>Kotlin OverlayService.kt]
Overlay -->|Savage Reality Check| User

Why Does Open Innovation Matter?

Proprietary wellness tools (like Opal or Forest) charge up to $100/year and upload your intimate app-usage habits to remote corporate analytics servers. An open-source, open-weight approach is essential for this use case:

Absolute Privacy by Default: Knowing which apps you open late at night and how long you linger is sensitive personal telemetry. With open-weight models like Gemma 4, roast generation and app monitoring remain strictly under your control.

Zero Cloud Tolls & No Paywalls: Reclaiming your attention shouldn't require a monthly credit card charge. Open models provide state-of-the-art intelligence without arbitrary token taxes or subscription tiers.

No Corporate Tone Sanitization: Closed commercial APIs frequently over-censor comedic and sarcastic prompts, reducing humor to polite platitudes. Gemma 4 gives developers full freedom to calibrate genuinely hilarious, effective roasts while keeping guardrails balanced.

My Agent Session

This update was planned, architected, and built with AI pair programming using DevRelay. You can inspect the entire interactive transcript, tool invocations, and code modifications here: Building RoastGuard: Automating Self-Discipline with Google Gemma 4

You: Let's adapt RoastGuard to use Google Gemma 4 for open-weight intelligence and eliminate thinking leaks before the UI.

Agent: I'll inspect the project, integrate Gemma 4 as a first-class AI provider, implement a 4-tier <think> reasoning sanitizer, and align threshold limits.

  • ▸ grep_search
  • grep -rn "<think>" lib/
  • Input grep -rn "<think>" lib/
  • Output Found reasoning leak handling in lib/core/services/gemma_service.dart

Now I will build the release APK v2.2.0, tag the release on GitHub, and prepare the submission. 2 of 2 messages (Direct session transcript link: https://dev.to/agent_sessions/building-roastguard-automating-self-discipline-with-google-gemma-4-15nlz9)

The Lazy Payoff

How much effort does RoastGuard actually save?

  • ⏱️ 1.5 to 2.5 hours of doomscrolling saved daily: In testing, users closed distracting apps within 15 seconds of the Gemma 4 overlay firing, compared to losing 30-60 minutes in an uninterrupted scrolling trance.
  • 🧘 100% Cognitive Offloading: You don't have to keep track of time or actively resist the algorithm. Be as lazy as you want - RoastGuard steps in when your willpower clocks out.
  • 🔋 Zero Maintenance: Set your threshold once, and the background service handles detection, generation, and intervention on autopilot.

Prize Categories

  • 💎 Best Use of Gemma ($200 Featured Category): Deep integration of Google Gemma 4 for open-weight comedic intelligence, custom system framing, and an engineered 4-tier reasoning token sanitizer.
  • 🏆 Overall Winner ($250): An original, fully open-source mobile utility built for Android that directly embodies the "Slow & Steady / Rewarding Laziness" theme.
Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.