<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Vishal Keerthan</title>
    <description>The latest articles on DEV Community by Vishal Keerthan (@pvishalkeerthan).</description>
    <link>https://dev.to/pvishalkeerthan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3884855%2Fe7fa76a7-b055-4406-be90-1f024f3cc288.png</url>
      <title>DEV Community: Vishal Keerthan</title>
      <link>https://dev.to/pvishalkeerthan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pvishalkeerthan"/>
    <language>en</language>
    <item>
      <title>ClimateOS — I Built a Climate Decision Engine, Not Another Carbon Tracker</title>
      <dc:creator>Vishal Keerthan</dc:creator>
      <pubDate>Sun, 19 Apr 2026 17:43:41 +0000</pubDate>
      <link>https://dev.to/pvishalkeerthan/climateos-i-built-a-climate-decision-engine-not-another-carbon-tracker-42ng</link>
      <guid>https://dev.to/pvishalkeerthan/climateos-i-built-a-climate-decision-engine-not-another-carbon-tracker-42ng</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for &lt;a href="https://dev.to/challenges/weekend-2026-04-16"&gt;Weekend Challenge: Earth Day Edition&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;Climate tools don't have a data problem. They have a decision problem.&lt;/p&gt;

&lt;p&gt;Most products fall into two failure modes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Carbon trackers&lt;/strong&gt; — dashboards that show you what you already did wrong&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Generic AI wrappers&lt;/strong&gt; — "here are 10 tips to reduce your footprint," unranked, with no constraints&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Neither answers the only question that actually matters:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Given my life, my budget, and my time — what should I do next?&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's not an information gap. It's a prioritization gap. So I built a decision engine.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;ClimateOS takes your lifestyle inputs and outputs a ranked, constraint-aware action plan. Not a report. Not suggestions. A plan — with a hierarchy, explicit tradeoffs, and one clear first move.&lt;/p&gt;

&lt;p&gt;Instead of tracking past emissions, it simulates future impact and returns:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A projected score improvement (e.g. 42 → 86)&lt;/li&gt;
&lt;li&gt;A ranked action playbook with reasoning for each action&lt;/li&gt;
&lt;li&gt;One &lt;strong&gt;Hero Action&lt;/strong&gt; — the single highest-ROI change for your specific situation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The framing underneath: climate action is a resource allocation problem. Given limited budget and time, what sequence of changes produces the maximum emission reduction? That's a solvable problem. Most apps just haven't tried to solve it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F864l7ylhi8i6kech2zr3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F864l7ylhi8i6kech2zr3.png" alt="Home Page"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;👉 &lt;strong&gt;Video Walkthrough:&lt;/strong&gt; &lt;a href="https://www.loom.com/share/576c4f7d5f8f417390c28c8786183c01" rel="noopener noreferrer"&gt;https://www.loom.com/share/576c4f7d5f8f417390c28c8786183c01&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;👉 &lt;strong&gt;GitHub:&lt;/strong&gt; &lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/pvishalkeerthan" rel="noopener noreferrer"&gt;
        pvishalkeerthan
      &lt;/a&gt; / &lt;a href="https://github.com/pvishalkeerthan/ClimateOS" rel="noopener noreferrer"&gt;
        ClimateOS
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      ClimateOS is a constraint-aware decision engine that moves beyond simple carbon tracking to provide prioritized, resource-aware action plans.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;ClimateOS — A Decision Engine, Not a Tracker&lt;/h1&gt;
&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;"Climate tools don't have a data problem. They have a decision problem."&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;ClimateOS is a constraint-aware decision engine built to help individuals move from awareness to prioritized action. Instead of just showing you what you already did wrong (tracking), it simulates future impact and returns a ranked, resource-aware action playbook.&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/pvishalkeerthan/ClimateOS/public/banner-1.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fpvishalkeerthan%2FClimateOS%2FHEAD%2Fpublic%2Fbanner-1.png" alt="banner-1"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://github.com/pvishalkeerthan/ClimateOS/public/image.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fpvishalkeerthan%2FClimateOS%2FHEAD%2Fpublic%2Fimage.png" alt="banner-2"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;⚡️ The Core Premise&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;Most climate products fall into two failure modes:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Carbon Trackers:&lt;/strong&gt; Dashboards that emphasize past mistakes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Generic AI Wrappers:&lt;/strong&gt; Unranked tips without context or constraints.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;ClimateOS answers the only question that matters:&lt;/strong&gt; &lt;em&gt;Given my life, my budget, and my time — what should I do next?&lt;/em&gt;&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;🧠 The Hybrid Engine — Core Technical Decision&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;The defining feature of ClimateOS is its &lt;strong&gt;Hybrid Inference Pipeline&lt;/strong&gt;. Pure LLMs are prone to "carbon hallucinations" (inconsistent math), while pure heuristic systems lack contextual reasoning. We split the labor:&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Layer 1: Deterministic Heuristics&lt;/h3&gt;…&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/pvishalkeerthan/ClimateOS" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;





&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;h3&gt;
  
  
  User Journey
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Input&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Eight inputs. Designed to be fast, not exhaustive:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Location&lt;/li&gt;
&lt;li&gt;Daily commute (km)&lt;/li&gt;
&lt;li&gt;Transport type — Car / EV / Public / Bike&lt;/li&gt;
&lt;li&gt;Diet — Veg / Mixed / Non-Veg&lt;/li&gt;
&lt;li&gt;Electricity usage (kWh/month)&lt;/li&gt;
&lt;li&gt;Renewable energy %&lt;/li&gt;
&lt;li&gt;Budget constraint — Low / Medium / High&lt;/li&gt;
&lt;li&gt;Time constraint — Low / Medium / High&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The constraint fields are the part most apps skip. They're also what makes the output usable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Processing Pipeline&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Request hits &lt;code&gt;/api/analyze&lt;/code&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Input validated via Zod schema&lt;/li&gt;
&lt;li&gt;Deterministic emissions model computes baseline (no AI involvement yet)&lt;/li&gt;
&lt;li&gt;Computed data — not raw inputs — passed to Gemini 2.0 Flash&lt;/li&gt;
&lt;li&gt;AI output validated again via Zod before it touches the response&lt;/li&gt;
&lt;li&gt;Ranked plan returned to client&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Results&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Score transition: 42 → 86&lt;/li&gt;
&lt;li&gt;Emissions breakdown by category (transport, diet, electricity)&lt;/li&gt;
&lt;li&gt;Ranked actions with constraint filters applied&lt;/li&gt;
&lt;li&gt;Hero Action called out separately — the one thing to do first&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example Output
&lt;/h3&gt;

&lt;p&gt;For a user with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;25km daily car commute&lt;/li&gt;
&lt;li&gt;mixed diet&lt;/li&gt;
&lt;li&gt;low budget&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;ClimateOS identifies transport as the dominant source and prioritizes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Reduce car usage (Hero Action)&lt;/li&gt;
&lt;li&gt;Shift to public transport (partial)&lt;/li&gt;
&lt;li&gt;Adjust diet (secondary impact)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;High-cost options like EV or solar are rejected due to budget constraints.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Simulation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Sliders for commute, diet, and renewable percentage. Every adjustment recomputes the score client-side, in real-time — no API call, no loading spinner, same heuristic logic as the backend. This turns a one-time report into an exploratory tool.&lt;/p&gt;




&lt;h2&gt;
  
  
  Architecture
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Frontend     →  Next.js 15 (App Router) + React 19
Styling      →  Tailwind CSS + Framer Motion
API Routes   →  /api/analyze, /api/explain
Validation   →  Zod — applied to both input and AI output
AI Layer     →  Google Gemini 2.0 Flash
Identity     →  State-First, Database-Less Identity System (Auth0 + LocalStorage)
Simulation   →  Client-side heuristics via useMemo
Persistence  →  LocalStorage (results + user identity)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;No traditional database. No auth overhead.&lt;/strong&gt; Instead, a &lt;strong&gt;State-First, Database-Less Identity System&lt;/strong&gt;: Auth0 provides a cryptographically-backed user sub that keys into LocalStorage, giving users full persistence and consistent identity across sessions — without cold starts, schema migrations, or a SQL layer.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Hybrid Reasoning Engine — Core Technical Decision
&lt;/h2&gt;

&lt;p&gt;This is the part most "AI climate tools" get wrong.&lt;/p&gt;

&lt;p&gt;Handing raw inputs to an LLM and asking it to produce an action plan gives you inconsistent numbers, confident hallucinations, and no reproducibility. Pure rules-based systems can't reason about tradeoffs. The split between the two is where the real work happened.&lt;/p&gt;

&lt;h3&gt;
  
  
  Layer 1 — Heuristics (Deterministic)
&lt;/h3&gt;

&lt;p&gt;All emissions are computed with fixed factors in &lt;code&gt;lib/heuristics.ts&lt;/code&gt; before Gemini ever sees the data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;transport_emissions&lt;/span&gt;   &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;commute_km&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;transport_factor&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;
&lt;span class="nx"&gt;diet_emissions&lt;/span&gt;        &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;diet_factor&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;
&lt;span class="nx"&gt;electricity_emissions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;kwh&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;0.82&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;renewable_pct&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Reproducibility&lt;/strong&gt; — same inputs always produce the same baseline&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Explainability&lt;/strong&gt; — every number has a traceable source&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hallucination prevention&lt;/strong&gt; — the AI receives computed values, not raw inputs to misinterpret&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The LLM does not touch arithmetic. It receives results.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Layer 2 — Gemini 2.0 Flash (Reasoning Engine)
&lt;/h3&gt;

&lt;p&gt;Gemini operates on the computed emissions data and performs four specific tasks:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Ranking&lt;/strong&gt; — selects top 5 actions by impact-to-effort ratio&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Constraint filtering&lt;/strong&gt; — removes options outside the user's budget or time window&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tradeoff analysis&lt;/strong&gt; — surfaces real downsides (e.g. "switching to EV requires significant upfront cost")&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rejection reasoning&lt;/strong&gt; — explains why alternatives didn't make the list&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Output is strictly typed via a &lt;strong&gt;60+ line &lt;code&gt;AnalyzeOutputSchema&lt;/code&gt; Zod contract&lt;/strong&gt;. If the response breaks schema → fallback to the deterministic engine. Gemini is the reasoning layer, not the source of truth.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffaxtv4pj3lwcpdo14px1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffaxtv4pj3lwcpdo14px1.png" alt="Flow"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Layer 3 — Simulation Engine (Client-Side)
&lt;/h3&gt;

&lt;p&gt;The same heuristic functions from the backend run in the browser. Slider changes trigger &lt;code&gt;useMemo&lt;/code&gt; recalculations — sub-100ms, no network call. The simulation isn't an approximation of the backend — it's the same model.&lt;/p&gt;




&lt;h2&gt;
  
  
  Key Features
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Real-Time Simulator
&lt;/h3&gt;

&lt;p&gt;Requires sharing computation logic across server and client. Most climate tools skip it. The result is a tool people actually explore vs. a report they read once.&lt;/p&gt;

&lt;h3&gt;
  
  
  Decision Engine, Not a Recommendation List
&lt;/h3&gt;

&lt;p&gt;A recommendation list has no hierarchy. This has a Hero Action, ranked supporting actions, and explicitly rejected alternatives with reasoning. Users don't need more options — they need a clear first move.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F82oekimwgle4ouiv103c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F82oekimwgle4ouiv103c.png" alt="Change"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Collective Impact Engine with Elastic Scaling
&lt;/h3&gt;

&lt;p&gt;Individual actions scaled to population level across a dynamic range — from 1,000 to 1,000,000 people. Users can simulate the effect at a community level, a city district, or an entire metropolitan node: &lt;em&gt;"If 500,000 people in your city adopted this plan, it would eliminate X tonnes of annual emissions."&lt;/em&gt; This reframes individual action as system-level impact.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzdunkla5kfwaa83qaatg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzdunkla5kfwaa83qaatg.png" alt="Engine"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Shareable Impact Card
&lt;/h3&gt;

&lt;p&gt;Exportable PNG via &lt;code&gt;html-to-image&lt;/code&gt;. Designed to spread.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhj20h14sr6197u9px7wa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhj20h14sr6197u9px7wa.png" alt="Certificate"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Technical Decisions
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Why hybrid instead of pure AI?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Pure LLM for emissions math = hallucination risk + inconsistent outputs. Pure heuristics = no contextual reasoning. The split gives you deterministic accuracy where you need it and flexible judgment where rules fall short.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Zod on AI output?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;code&gt;JSON.parse()&lt;/code&gt; on raw LLM output without schema validation will fail — malformed keys, missing fields, wrong types. The &lt;code&gt;AnalyzeOutputSchema&lt;/code&gt; Zod contract (60+ lines) enforces a strict interface. If the AI breaks it, the error is caught before it reaches the user.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why client-side simulation?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
API calls add 3–5s of latency. Sliders need sub-100ms feedback. Duplicating the heuristic logic on the frontend is the only clean solution. The tradeoff — keeping two implementations in sync — is worth the UX delta.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why State-First, Database-Less Identity?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
No cold starts, no schema migrations, no auth overhead. Auth0 provides a stable user identifier (&lt;code&gt;sub&lt;/code&gt;) that keys into LocalStorage, giving users long-term persistence and a consistent profile without a traditional database.&lt;/p&gt;




&lt;h2&gt;
  
  
  Challenges
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Gemini Rate Limits (429 errors)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Free-tier quota runs out fast during live demos. Fix: exponential retry on 429s, full deterministic fallback if retries exhaust. The fallback is less rich but the app doesn't break.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LLM Latency (3–5 seconds)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
You can't optimize past the model's inference time. The fix is perceptual — staged loading UI with granular progress feedback makes 4 seconds feel faster than a blank spinner.&lt;/p&gt;




&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Persistent backend (Postgres / Supabase) for action tracking over time&lt;/li&gt;
&lt;li&gt;Geo-specific emission factors via Electricity Maps API&lt;/li&gt;
&lt;li&gt;Habit loop — weekly check-ins tied to your Hero Action&lt;/li&gt;
&lt;li&gt;Live grid carbon intensity via real-time energy APIs&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🏆 Use of Google Gemini
&lt;/h3&gt;

&lt;p&gt;Gemini 2.0 Flash — Google's latest model — is used as a &lt;strong&gt;constrained reasoning engine&lt;/strong&gt;, not a content generator. It receives pre-computed emissions data from &lt;code&gt;lib/heuristics.ts&lt;/code&gt; (not raw inputs) and performs ranking, constraint filtering, tradeoff analysis, and rejection reasoning — all within a strict &lt;strong&gt;60+ line &lt;code&gt;AnalyzeOutputSchema&lt;/code&gt; Zod contract&lt;/strong&gt;. This isn't Gemini generating text. This is Gemini generating &lt;strong&gt;structured reasoning&lt;/strong&gt; that passes a typed schema gate on every single call. If it breaks the schema, a deterministic fallback takes over. Gemini handles judgment, not arithmetic.&lt;/p&gt;

&lt;h3&gt;
  
  
  🏆 Use of Auth0
&lt;/h3&gt;

&lt;p&gt;Auth0 is used to generate a unique &lt;code&gt;sub&lt;/code&gt; (subject identifier) for each user, which acts as a deterministic key for client-side persistence. This &lt;code&gt;sub&lt;/code&gt; is used to scope and store data in LocalStorage (e.g. results, actions, history), enabling user-level isolation and cross-session continuity without a backend database. The design avoids auth and storage overhead while maintaining a consistent identity model, with straightforward extensibility to server-side persistence.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why This Approach Matters
&lt;/h2&gt;

&lt;p&gt;The dominant model for climate software is measurement: track what happened, surface the data, assume awareness drives change.&lt;/p&gt;

&lt;p&gt;ClimateOS operates on a different premise: &lt;strong&gt;people don't lack awareness. They lack prioritized action.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deterministic computation builds trust — users can see exactly where numbers come from&lt;/li&gt;
&lt;li&gt;AI handles the combinatorial judgment problem that rules-based systems can't&lt;/li&gt;
&lt;li&gt;Real-time simulation turns a one-time output into a tool people return to&lt;/li&gt;
&lt;li&gt;Auth0-backed identity enables long-term continuity without database overhead&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;ClimateOS doesn’t measure your footprint better — it forces a decision. Not more data. Not more tips. One decision, made correctly.&lt;/p&gt;
&lt;/blockquote&gt;




</description>
      <category>devchallenge</category>
      <category>weekendchallenge</category>
      <category>earthday</category>
      <category>webdev</category>
    </item>
    <item>
      <title>ClimateOS — I Built a Climate Decision Engine, Not Another Carbon Tracker</title>
      <dc:creator>Vishal Keerthan</dc:creator>
      <pubDate>Sun, 19 Apr 2026 17:43:41 +0000</pubDate>
      <link>https://dev.to/pvishalkeerthan/climateos-i-built-a-climate-decision-engine-not-another-carbon-tracker-4b1d</link>
      <guid>https://dev.to/pvishalkeerthan/climateos-i-built-a-climate-decision-engine-not-another-carbon-tracker-4b1d</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for &lt;a href="https://dev.to/challenges/weekend-2026-04-16"&gt;Weekend Challenge: Earth Day Edition&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;Climate tools don't have a data problem. They have a decision problem.&lt;/p&gt;

&lt;p&gt;Most products fall into two failure modes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Carbon trackers&lt;/strong&gt; — dashboards that show you what you already did wrong&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Generic AI wrappers&lt;/strong&gt; — "here are 10 tips to reduce your footprint," unranked, with no constraints&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Neither answers the only question that actually matters:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Given my life, my budget, and my time — what should I do next?&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's not an information gap. It's a prioritization gap. So I built a decision engine.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;ClimateOS takes your lifestyle inputs and outputs a ranked, constraint-aware action plan. Not a report. Not suggestions. A plan — with a hierarchy, explicit tradeoffs, and one clear first move.&lt;/p&gt;

&lt;p&gt;Instead of tracking past emissions, it simulates future impact and returns:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A projected score improvement (e.g. 42 → 86)&lt;/li&gt;
&lt;li&gt;A ranked action playbook with reasoning for each action&lt;/li&gt;
&lt;li&gt;One &lt;strong&gt;Hero Action&lt;/strong&gt; — the single highest-ROI change for your specific situation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The framing underneath: climate action is a resource allocation problem. Given limited budget and time, what sequence of changes produces the maximum emission reduction? That's a solvable problem. Most apps just haven't tried to solve it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F864l7ylhi8i6kech2zr3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F864l7ylhi8i6kech2zr3.png" alt="Home Page"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;👉 &lt;strong&gt;Video Walkthrough:&lt;/strong&gt; &lt;a href="https://www.loom.com/share/576c4f7d5f8f417390c28c8786183c01" rel="noopener noreferrer"&gt;https://www.loom.com/share/576c4f7d5f8f417390c28c8786183c01&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;👉 &lt;strong&gt;GitHub:&lt;/strong&gt; &lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/pvishalkeerthan" rel="noopener noreferrer"&gt;
        pvishalkeerthan
      &lt;/a&gt; / &lt;a href="https://github.com/pvishalkeerthan/ClimateOS" rel="noopener noreferrer"&gt;
        ClimateOS
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      ClimateOS is a constraint-aware decision engine that moves beyond simple carbon tracking to provide prioritized, resource-aware action plans.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;ClimateOS — A Decision Engine, Not a Tracker&lt;/h1&gt;
&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;"Climate tools don't have a data problem. They have a decision problem."&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;ClimateOS is a constraint-aware decision engine built to help individuals move from awareness to prioritized action. Instead of just showing you what you already did wrong (tracking), it simulates future impact and returns a ranked, resource-aware action playbook.&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/pvishalkeerthan/ClimateOS/public/banner-1.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fpvishalkeerthan%2FClimateOS%2FHEAD%2Fpublic%2Fbanner-1.png" alt="banner-1"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer" href="https://github.com/pvishalkeerthan/ClimateOS/public/image.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fpvishalkeerthan%2FClimateOS%2FHEAD%2Fpublic%2Fimage.png" alt="banner-2"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;⚡️ The Core Premise&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;Most climate products fall into two failure modes:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Carbon Trackers:&lt;/strong&gt; Dashboards that emphasize past mistakes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Generic AI Wrappers:&lt;/strong&gt; Unranked tips without context or constraints.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;ClimateOS answers the only question that matters:&lt;/strong&gt; &lt;em&gt;Given my life, my budget, and my time — what should I do next?&lt;/em&gt;&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;🧠 The Hybrid Engine — Core Technical Decision&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;The defining feature of ClimateOS is its &lt;strong&gt;Hybrid Inference Pipeline&lt;/strong&gt;. Pure LLMs are prone to "carbon hallucinations" (inconsistent math), while pure heuristic systems lack contextual reasoning. We split the labor:&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Layer 1: Deterministic Heuristics&lt;/h3&gt;…&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/pvishalkeerthan/ClimateOS" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;





&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;h3&gt;
  
  
  User Journey
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Input&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Eight inputs. Designed to be fast, not exhaustive:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Location&lt;/li&gt;
&lt;li&gt;Daily commute (km)&lt;/li&gt;
&lt;li&gt;Transport type — Car / EV / Public / Bike&lt;/li&gt;
&lt;li&gt;Diet — Veg / Mixed / Non-Veg&lt;/li&gt;
&lt;li&gt;Electricity usage (kWh/month)&lt;/li&gt;
&lt;li&gt;Renewable energy %&lt;/li&gt;
&lt;li&gt;Budget constraint — Low / Medium / High&lt;/li&gt;
&lt;li&gt;Time constraint — Low / Medium / High&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The constraint fields are the part most apps skip. They're also what makes the output usable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Processing Pipeline&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Request hits &lt;code&gt;/api/analyze&lt;/code&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Input validated via Zod schema&lt;/li&gt;
&lt;li&gt;Deterministic emissions model computes baseline (no AI involvement yet)&lt;/li&gt;
&lt;li&gt;Computed data — not raw inputs — passed to Gemini 2.0 Flash&lt;/li&gt;
&lt;li&gt;AI output validated again via Zod before it touches the response&lt;/li&gt;
&lt;li&gt;Ranked plan returned to client&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Results&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Score transition: 42 → 86&lt;/li&gt;
&lt;li&gt;Emissions breakdown by category (transport, diet, electricity)&lt;/li&gt;
&lt;li&gt;Ranked actions with constraint filters applied&lt;/li&gt;
&lt;li&gt;Hero Action called out separately — the one thing to do first&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example Output
&lt;/h3&gt;

&lt;p&gt;For a user with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;25km daily car commute&lt;/li&gt;
&lt;li&gt;mixed diet&lt;/li&gt;
&lt;li&gt;low budget&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;ClimateOS identifies transport as the dominant source and prioritizes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Reduce car usage (Hero Action)&lt;/li&gt;
&lt;li&gt;Shift to public transport (partial)&lt;/li&gt;
&lt;li&gt;Adjust diet (secondary impact)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;High-cost options like EV or solar are rejected due to budget constraints.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Simulation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Sliders for commute, diet, and renewable percentage. Every adjustment recomputes the score client-side, in real-time — no API call, no loading spinner, same heuristic logic as the backend. This turns a one-time report into an exploratory tool.&lt;/p&gt;




&lt;h2&gt;
  
  
  Architecture
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Frontend     →  Next.js 15 (App Router) + React 19
Styling      →  Tailwind CSS + Framer Motion
API Routes   →  /api/analyze, /api/explain
Validation   →  Zod — applied to both input and AI output
AI Layer     →  Google Gemini 2.0 Flash
Identity     →  State-First, Database-Less Identity System (Auth0 + LocalStorage)
Simulation   →  Client-side heuristics via useMemo
Persistence  →  LocalStorage (results + user identity)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;No traditional database. No auth overhead.&lt;/strong&gt; Instead, a &lt;strong&gt;State-First, Database-Less Identity System&lt;/strong&gt;: Auth0 provides a cryptographically-backed user sub that keys into LocalStorage, giving users full persistence and consistent identity across sessions — without cold starts, schema migrations, or a SQL layer.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Hybrid Reasoning Engine — Core Technical Decision
&lt;/h2&gt;

&lt;p&gt;This is the part most "AI climate tools" get wrong.&lt;/p&gt;

&lt;p&gt;Handing raw inputs to an LLM and asking it to produce an action plan gives you inconsistent numbers, confident hallucinations, and no reproducibility. Pure rules-based systems can't reason about tradeoffs. The split between the two is where the real work happened.&lt;/p&gt;

&lt;h3&gt;
  
  
  Layer 1 — Heuristics (Deterministic)
&lt;/h3&gt;

&lt;p&gt;All emissions are computed with fixed factors in &lt;code&gt;lib/heuristics.ts&lt;/code&gt; before Gemini ever sees the data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;transport_emissions&lt;/span&gt;   &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;commute_km&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;transport_factor&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;
&lt;span class="nx"&gt;diet_emissions&lt;/span&gt;        &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;diet_factor&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;
&lt;span class="nx"&gt;electricity_emissions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;kwh&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;0.82&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;renewable_pct&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Reproducibility&lt;/strong&gt; — same inputs always produce the same baseline&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Explainability&lt;/strong&gt; — every number has a traceable source&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hallucination prevention&lt;/strong&gt; — the AI receives computed values, not raw inputs to misinterpret&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The LLM does not touch arithmetic. It receives results.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Layer 2 — Gemini 2.0 Flash (Reasoning Engine)
&lt;/h3&gt;

&lt;p&gt;Gemini operates on the computed emissions data and performs four specific tasks:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Ranking&lt;/strong&gt; — selects top 5 actions by impact-to-effort ratio&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Constraint filtering&lt;/strong&gt; — removes options outside the user's budget or time window&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tradeoff analysis&lt;/strong&gt; — surfaces real downsides (e.g. "switching to EV requires significant upfront cost")&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rejection reasoning&lt;/strong&gt; — explains why alternatives didn't make the list&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Output is strictly typed via a &lt;strong&gt;60+ line &lt;code&gt;AnalyzeOutputSchema&lt;/code&gt; Zod contract&lt;/strong&gt;. If the response breaks schema → fallback to the deterministic engine. Gemini is the reasoning layer, not the source of truth.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffaxtv4pj3lwcpdo14px1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffaxtv4pj3lwcpdo14px1.png" alt="Flow"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Layer 3 — Simulation Engine (Client-Side)
&lt;/h3&gt;

&lt;p&gt;The same heuristic functions from the backend run in the browser. Slider changes trigger &lt;code&gt;useMemo&lt;/code&gt; recalculations — sub-100ms, no network call. The simulation isn't an approximation of the backend — it's the same model.&lt;/p&gt;




&lt;h2&gt;
  
  
  Key Features
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Real-Time Simulator
&lt;/h3&gt;

&lt;p&gt;Requires sharing computation logic across server and client. Most climate tools skip it. The result is a tool people actually explore vs. a report they read once.&lt;/p&gt;

&lt;h3&gt;
  
  
  Decision Engine, Not a Recommendation List
&lt;/h3&gt;

&lt;p&gt;A recommendation list has no hierarchy. This has a Hero Action, ranked supporting actions, and explicitly rejected alternatives with reasoning. Users don't need more options — they need a clear first move.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F82oekimwgle4ouiv103c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F82oekimwgle4ouiv103c.png" alt="Change"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Collective Impact Engine with Elastic Scaling
&lt;/h3&gt;

&lt;p&gt;Individual actions scaled to population level across a dynamic range — from 1,000 to 1,000,000 people. Users can simulate the effect at a community level, a city district, or an entire metropolitan node: &lt;em&gt;"If 500,000 people in your city adopted this plan, it would eliminate X tonnes of annual emissions."&lt;/em&gt; This reframes individual action as system-level impact.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzdunkla5kfwaa83qaatg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzdunkla5kfwaa83qaatg.png" alt="Engine"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Shareable Impact Card
&lt;/h3&gt;

&lt;p&gt;Exportable PNG via &lt;code&gt;html-to-image&lt;/code&gt;. Designed to spread.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhj20h14sr6197u9px7wa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhj20h14sr6197u9px7wa.png" alt="Certificate"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Technical Decisions
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Why hybrid instead of pure AI?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Pure LLM for emissions math = hallucination risk + inconsistent outputs. Pure heuristics = no contextual reasoning. The split gives you deterministic accuracy where you need it and flexible judgment where rules fall short.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Zod on AI output?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;code&gt;JSON.parse()&lt;/code&gt; on raw LLM output without schema validation will fail — malformed keys, missing fields, wrong types. The &lt;code&gt;AnalyzeOutputSchema&lt;/code&gt; Zod contract (60+ lines) enforces a strict interface. If the AI breaks it, the error is caught before it reaches the user.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why client-side simulation?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
API calls add 3–5s of latency. Sliders need sub-100ms feedback. Duplicating the heuristic logic on the frontend is the only clean solution. The tradeoff — keeping two implementations in sync — is worth the UX delta.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why State-First, Database-Less Identity?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
No cold starts, no schema migrations, no auth overhead. Auth0 provides a stable user identifier (&lt;code&gt;sub&lt;/code&gt;) that keys into LocalStorage, giving users long-term persistence and a consistent profile without a traditional database.&lt;/p&gt;




&lt;h2&gt;
  
  
  Challenges
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Gemini Rate Limits (429 errors)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Free-tier quota runs out fast during live demos. Fix: exponential retry on 429s, full deterministic fallback if retries exhaust. The fallback is less rich but the app doesn't break.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LLM Latency (3–5 seconds)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
You can't optimize past the model's inference time. The fix is perceptual — staged loading UI with granular progress feedback makes 4 seconds feel faster than a blank spinner.&lt;/p&gt;




&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Persistent backend (Postgres / Supabase) for action tracking over time&lt;/li&gt;
&lt;li&gt;Geo-specific emission factors via Electricity Maps API&lt;/li&gt;
&lt;li&gt;Habit loop — weekly check-ins tied to your Hero Action&lt;/li&gt;
&lt;li&gt;Live grid carbon intensity via real-time energy APIs&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🏆 Use of Google Gemini
&lt;/h3&gt;

&lt;p&gt;Gemini 2.0 Flash — Google's latest model — is used as a &lt;strong&gt;constrained reasoning engine&lt;/strong&gt;, not a content generator. It receives pre-computed emissions data from &lt;code&gt;lib/heuristics.ts&lt;/code&gt; (not raw inputs) and performs ranking, constraint filtering, tradeoff analysis, and rejection reasoning — all within a strict &lt;strong&gt;60+ line &lt;code&gt;AnalyzeOutputSchema&lt;/code&gt; Zod contract&lt;/strong&gt;. This isn't Gemini generating text. This is Gemini generating &lt;strong&gt;structured reasoning&lt;/strong&gt; that passes a typed schema gate on every single call. If it breaks the schema, a deterministic fallback takes over. Gemini handles judgment, not arithmetic.&lt;/p&gt;

&lt;h3&gt;
  
  
  🏆 Use of Auth0
&lt;/h3&gt;

&lt;p&gt;Auth0 is used to generate a unique &lt;code&gt;sub&lt;/code&gt; (subject identifier) for each user, which acts as a deterministic key for client-side persistence. This &lt;code&gt;sub&lt;/code&gt; is used to scope and store data in LocalStorage (e.g. results, actions, history), enabling user-level isolation and cross-session continuity without a backend database. The design avoids auth and storage overhead while maintaining a consistent identity model, with straightforward extensibility to server-side persistence.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why This Approach Matters
&lt;/h2&gt;

&lt;p&gt;The dominant model for climate software is measurement: track what happened, surface the data, assume awareness drives change.&lt;/p&gt;

&lt;p&gt;ClimateOS operates on a different premise: &lt;strong&gt;people don't lack awareness. They lack prioritized action.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deterministic computation builds trust — users can see exactly where numbers come from&lt;/li&gt;
&lt;li&gt;AI handles the combinatorial judgment problem that rules-based systems can't&lt;/li&gt;
&lt;li&gt;Real-time simulation turns a one-time output into a tool people return to&lt;/li&gt;
&lt;li&gt;Auth0-backed identity enables long-term continuity without database overhead&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;ClimateOS doesn’t measure your footprint better — it forces a decision. Not more data. Not more tips. One decision, made correctly.&lt;/p&gt;
&lt;/blockquote&gt;




</description>
      <category>devchallenge</category>
      <category>weekendchallenge</category>
      <category>earthday</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
