{"slug": "how-i-built-carboncompass-with-google-antigravity-a-personal-sustainability-not", "title": "How I Built CarbonCompass with Google Antigravity — A Personal Sustainability Coach, Not Just a Calculator", "summary": "A developer built CarbonCompass, a personalized sustainability coach, using Google Antigravity's Plan Mode for the PromptWars Virtual Hackathon. The app features a shared calculation engine with sourced emission factors to provide tailored coaching for Indian users like a college student in Chennai and a tech professional in Bengaluru. The developer used Plan Mode to generate an implementation plan before coding, ensuring consistency across the dashboard, simulator, and AI coach.", "body_md": "Most carbon footprint apps do the same thing:\n\nQuiz → \"Your footprint is 120 kg CO₂/week\" → Generic tips → User never returns.\n\nThat's not a coaching experience. That's a guilt trip with no follow-through.\n\nFor PromptWars Virtual — Challenge 3 (Carbon Footprint Awareness & Reduction), I built CarbonCompass with a different premise:\n\nNot just measure. Guide.\n\nLive demo: [https://prompt-wars-virtual-hackathon-8u1kxxwh1-mithunvisveshs-projects.vercel.app/](https://prompt-wars-virtual-hackathon-8u1kxxwh1-mithunvisveshs-projects.vercel.app/)\n\nThe Problem with Existing Carbon Tools\n\nI started by looking at what already exists — Capture, Klima, JouleBug. Each of them calculates a footprint accurately. But they all fail at the same step: the recommendation layer.\n\n\"Install solar panels.\" \"Buy an EV.\" \"Go vegan.\"\n\nThese are structurally correct but useless for a hostel student in Chennai who travels by bus and eats at the mess. They're recommendations designed for a demographic that already has money and flexibility.\n\nCarbonCompass is built around two real Indian users:\n\nAditi — a college student in Chennai. Bus commute, hostel mess food, shared room electricity. Her biggest carbon lever is food waste, not transport.\n\nRohan — a tech professional in Bengaluru. Petrol car + scooter commute, air-conditioned 2BHK, frequent food delivery. His biggest lever is home energy, not diet.\n\nThe same app, two users with different lifestyles receive coaching tailored to their highest-impact opportunities. That's the core product promise.\n\nThe Architectural Decision That Made Everything Work\n\nBefore writing a single line of code, I ran this prompt in Google Antigravity's Plan Mode:\n\nYou are a senior product architect.\n\nBefore coding:\n\nDo not write code yet. Create an Implementation Plan.\n\nThe agent produced a full Implementation Plan artifact — a structured document I could review and annotate before any code was generated. This step saved at least a day of rework.\n\nThe plan's most important output was the shared calculation engine — a single file (carbonCalculator.js) with one function, sourced emission factors, and one contract:\n\njs// All emission factors in one place. Sourced. Commented.\n\nexport const EMISSION_FACTORS = {\n\nelectricity: 0.75, // CEA CO2 Baseline Database, India\n\nlpg_cylinder: 42.0, // Indian household LPG data\n\ntransport: {\n\npetrolCar: 150, // g CO2/km — CarbonCrux India fleet mix\n\nbus: 89, // g CO2/passenger-km — Defra proxy\n\ncycling: 33.0, // Our World in Data\n\n// ...\n\n},\n\ndiet: {\n\nhigh_meat: 7.19, // kg CO2e/day — Scarborough et al. 2014\n\nvegetarian: 3.81,\n\nvegan: 2.89,\n\n},\n\nfoodWaste: 2.5, // kg CO2 per kg wasted — Poore & Nemecek 2018\n\n};\n\nexport function calculateWeeklyFootprint(inputs) {\n\n// One function. Called by Dashboard, Simulator, and AI Coach.\n\n// ...\n\n}\n\nThe formula:\n\nweekly_footprint = transport + energy + diet + waste\n\ntransport = Σ(km/week × g CO2/km) ÷ 1000\n\nenergy = (kWh/week × 0.75) + (LPG cylinders/month ÷ 4.33 × 42)\n\ndiet = daily_kg_CO2e[diet_type] × 7\n\nwaste = food_wasted_kg/week × 2.5\n\nI wrote a verification script (verifyCalculator.js) that checked both personas against hand-calculated expected values. It passed at 100% match. This gave me confidence that the numbers the user sees are real, not made up.\n\nWhy this matters: Any team that writes separate logic for the dashboard, the simulator, and the AI layer will eventually produce contradictory numbers. \"Your footprint is 120 kg\" on the dashboard, \"estimated 108 kg\" in the simulator, and \"your biggest category is transport\" from the AI — when transport isn't actually the biggest. I've seen this fail in demos. The shared engine prevents it entirely.\n\nHow I Used Google Antigravity\n\nI used Plan Mode for every structural task (new pages, new features). The workflow was:\n\nWrite a prompt describing the goal, the stack, and the design tone\n\nLet the agent produce an Implementation Plan artifact — a structured list of what it planned to build and verify\n\nRead it, annotate it with comments if something looked wrong\n\nOnly then approve it and let the agent write code\n\nThe agent opened a real browser, clicked through the flow, took screenshots, and attached them to a final Walkthrough artifact\n\nFor smaller fixes (changing a label, adjusting a color), I used Fast Mode — just execute, no plan needed.\n\nThe most valuable moment was when the dashboard, simulator, and AI coach were each being built. I explicitly included this in every prompt:\n\nIMPORTANT: Do not write a new calculation function.\n\nImport calculateWeeklyFootprint from ../utils/carbonCalculator.js\n\nand call it with these inputs. Never duplicate the formula.\n\nThe agent generally respected this constraint, and I manually reviewed all generated code to ensure the shared calculation engine remained the single source of truth. Having it written in the Implementation Plan artifact — which I'd reviewed and approved — meant there was a shared understanding between me and the agent about the architecture before any code existed.\n\nThe AI Layer — Interpretation, Not Calculation\n\nThe AI Habit Coach uses Gemini 2.0 Flash via a secure serverless proxy (api/gemini.js on Vercel). The API key never touches the client bundle.\n\nThe core design principle: AI interprets user data. AI never calculates footprint.\n\nHere's the relevant part of the system prompt:\n\nYou are CarbonCompass's AI Habit Coach.\n\nYou have been given the user's ALREADY CALCULATED weekly carbon\n\nfootprint breakdown by category.\n\nCRITICAL RULES:\n\nThe Impact Simulator\n\nThe simulator is the moment that makes people lean forward in a demo.\n\nA slider. Real-time update. \"What if I cycled to college twice a week?\" → watch the projected footprint drop from 117 kg to 108 kg, with a -8% badge and \"equivalent to 19 trees planted\" context card.\n\nIt's deterministic — no AI, no API call, no chance of failure. It calls the same calculateWeeklyFootprint() function with modified inputs and renders the delta instantly.\n\nMethodology and Data Honesty\n\nThe app has a dedicated Methodology & Sources page that lists every emission factor, its source, and a honest disclaimer:\n\nDietary data is UK-based (Scarborough et al. 2014) and serves as a comparative proxy for urban Indian dietary habits. It is not exact.\n\nHackathon judges are technical people. They will ask \"where do these numbers come from?\" Having a sourced, transparent methodology page that proactively acknowledges data limitations builds more credibility than overclaiming precision.\n\nWhat I'd Build Next\n\nReplace localStorage with a real backend (Supabase) so progress persists across devices\n\nA shareable \"My Carbon Card\" — one-click export of the dashboard headline to LinkedIn or WhatsApp\n\nIndia-specific dietary lifecycle data to replace the UK proxy\n\nA real behavior-change verification layer (photo proof or location check-in for challenges completed)\n\nTry It\n\nLive app: [https://prompt-wars-virtual-hackathon.vercel.app](https://prompt-wars-virtual-hackathon.vercel.app)\n\nUse the \"Load Aditi\" or \"Load Rohan\" quick-fill buttons on onboarding to explore both personas in under 30 seconds.\n\nBuilt with Google Antigravity · Gemini 2.0 Flash · React 19 · Tailwind CSS · Vite · Vercel\n\nPromptWars Virtual — Challenge 3: Carbon Footprint Awareness & Reduction", "url": "https://wpnews.pro/news/how-i-built-carboncompass-with-google-antigravity-a-personal-sustainability-not", "canonical_source": "https://dev.to/mithunvisvesh_s/how-i-built-carboncompass-with-google-antigravity-a-personal-sustainability-coach-not-just-a-1ic", "published_at": "2026-06-20 18:36:15+00:00", "updated_at": "2026-06-20 19:06:57.735977+00:00", "lang": "en", "topics": ["artificial-intelligence", "developer-tools", "ai-products"], "entities": ["CarbonCompass", "Google Antigravity", "PromptWars Virtual Hackathon", "Aditi", "Rohan", "Capture", "Klima", "JouleBug"], "alternates": {"html": "https://wpnews.pro/news/how-i-built-carboncompass-with-google-antigravity-a-personal-sustainability-not", "markdown": "https://wpnews.pro/news/how-i-built-carboncompass-with-google-antigravity-a-personal-sustainability-not.md", "text": "https://wpnews.pro/news/how-i-built-carboncompass-with-google-antigravity-a-personal-sustainability-not.txt", "jsonld": "https://wpnews.pro/news/how-i-built-carboncompass-with-google-antigravity-a-personal-sustainability-not.jsonld"}}