Dev.to WebDev πŸ›  Dev πŸ‘ 0 πŸ“– 6 min read

ScopeGuard β€” How I Used Open-Source Gemma 2 to Save Freelancers From the 'Just One Small Tweak' Scope Creep Nightmare

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle πŸ›‘ The "Just One Quick Favor" Trap: A Freelancer Tragedy Let’s be painfully, brutally honest for a second. If you’ve

ScopeGuard β€” How I Used Open-Source Gemma 2 to Save Freelancers From the 'Just One Small Tweak' Scope Creep Nightmare

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle

πŸ›‘ The "Just One Quick Favor" Trap: A Freelancer Tragedy

Let’s be painfully, brutally honest for a second.

If you’ve ever freelanced or built software for clients, your project lifecycle usually looks like this:

  1. Monday: Client signs off on a simple $2,500 3-page marketing website. Easy money. High spirits.
  2. Wednesday: A casual Slack ping arrives: "Hey! Can we also add a quick Stripe checkout? And maybe user login? And a dark mode toggle? It should only take 5 minutes, right?" πŸ™ƒ
  3. Friday: Client sends a WhatsApp voice note at 11:45 PM: "Also, we need multi-currency dynamic currency conversion and an automated ERP warehouse sync by Monday morning!"
  4. Sunday Night: You are at 3:00 AM, crying into a cold cup of coffee, debugging Stripe webhook signatures for work you are literally doing for free. 🀑
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚             THE FREELANCER "SCOPE CREEP" CYCLE               β”‚
   β”‚                                                              β”‚
   β”‚   [ Simple $2,500 Web Gig ] ──(Informal Chat)──► [ "One Quickβ”‚
   β”‚            β–²                                     Tweak" ]    β”‚
   β”‚            β”‚                                         β”‚       β”‚
   β”‚     (Client Surprised                     (Unpaid Extra      β”‚
   β”‚       by Invoice)                           Features Added)  β”‚
   β”‚            β”‚                                         β”‚       β”‚
   β”‚            β–Ό                                         β–Ό       β”‚
   β”‚   [ $0 Extra Billed ] ◄──(Weekend Ruined)── [ 3:00 AM Crisis]β”‚
   β”‚                                                              β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

We call this "Unbilled Scope Creep."

Freelancers lose 15 to 25 unpaid hours on almost every project because initial client negotiations happen casually over WhatsApp, email, or Slack. Nobody writes a formal Statement of Work (SOW) because traditional legal contracts take 3 hours to draft or cost $500 in lawyer fees.

So I built ScopeGuard β€” the 30-Second Defensive SOW Engine powered by Google Gemma 2 Open Weights.

πŸ›‘οΈ What I Built

ScopeGuard converts messy, unstructured client messages into an ironclad, binding Statement of Work with explicit Out-of-Scope boundaries, milestone hourly allocations, and automatic change-order rules in under 30 seconds.

graph TD
    A[Freelancer Input: Rate + Paste Chaotic Client Chat] -->|Generate Button| B(Gemma 2 27B Defensive Synthesis Pipeline)
    B --> C[Structured SOW Document: Phased Milestones & Hours]
    C --> D[πŸ›‘οΈ Scope Boundary Matrix: IN-SCOPE vs. EXPLICITLY OUT-OF-SCOPE]
    D --> E[Binding Change-Order Clause: Automatic $X/hr Protection]
    E --> F[Calculated Deposit & Milestone Payment Schedule]
    F -->|MongoDB Atlas| G[Saves SOW & Generates Private Token Link]
    G --> H[🀝 Public Client Approval Portal /share/id]
    H -->|Client Signs Digitally| I[πŸŽ‰ Confetti Burst + Verified Accepted Seal]
    I --> J[πŸ“‘ Crisp Vector jsPDF Download for Archiving]

⚑ The 5 Core Pillars:

  1. ⚑ 30-Second Synthesis Engine: Input your Freelancer Name, Client Name, Hourly Rate, and Currency, then paste your raw, unedited client chat (or test with 1-click presets like E-Commerce Rebuild or Mobile App MVP).
  2. 🧠 Open-Source Gemma 2 27B AI Inference: Uses open weights to parse messy client ramblings, estimate realistic milestone hours, and synthesize strict JSON schemas containing phased deliverables and payment allocations.
  3. πŸ›‘οΈ The Scope Boundary Matrix: The heart of ScopeGuard. It doesn't just list what you are doing β€” it explicitly ring-fences what you are NOT doing (e.g. "Single-currency Stripe checkout is IN-SCOPE; dynamic multi-currency ERP sync is EXPLICITLY OUT-OF-SCOPE").
  4. 🀝 Public Client Approval Portal (/share/[id]): A dedicated, responsive URL you can send to your client with one click. Clients review the terms and click "Accept Statement of Work", recording an immutable acceptance timestamp into MongoDB Atlas accompanied by celebratory confetti.
  5. πŸ“‘ Pure Vector jsPDF Engine: No brittle html2canvas hacks that crash on Tailwind v4 CSS color functions. ScopeGuard renders clean, multi-page vector PDFs with native word-wrapping and defensive page-break geometry.

UI Preview (SaaS Theme)

The UI was crafted from scratch with frosted glass headers (#5D5FEF), clean card elevations, and full mobile responsiveness:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ πŸ›‘οΈ ScopeGuard [SOW Protector]                           [ History (4) ]β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                        β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ 01 Contracting Parties & History Indexing                          β”‚ β”‚
β”‚ β”‚ [ Freelancer: Alex Rivera ]        [ Client: Acme Corp           ] β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                                                                        β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ 02 Project Parameters & Loose Notes                                β”‚ β”‚
β”‚ β”‚ [ Rate: $75/hr ]  [ Currency: USD ]                                β”‚ β”‚
β”‚ β”‚ [ Notes: "Client wants e-commerce storefront with Stripe checkout" ]β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                                                                        β”‚
β”‚ [ Ready for Defensive Scope Synthesis ]   [ πŸ›‘οΈ Generate Defensive SOW ]β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ’» Code

πŸ›‘οΈ ScopeGuard β€” The AI SOW & Scope-Creep Protector

The 30-Second Defensive Contract Engine for Freelancers & Independent Contractors
Convert chaotic client chats, informal Slack messages, and unbilled revisions into binding Statements of Work with explicit Out-of-Scope boundaries in seconds.

Next.js Gemma AI MongoDB Atlas Tailwind CSS License: MIT

πŸ“Œ Problem Statement

Freelancers and independent consultants lose an average of $500 to $2,500+ per project to unbilled scope creep. Because initial conversations happen across informal channels β€” WhatsApp voice notes, Slack DMs, or messy email threads β€” client expectations drift without formal boundaries. Drafting traditional legal contracts takes hours or costs hundreds in attorney fees, so freelancers often start working with no protective baseline at all.

πŸ’‘ The Core Innovation: Defensive Scope Ring-Fencing

ScopeGuard inverts the contract creation process into a 30-second workflow. By combining Google Gemma 2 (27B & 9B open-weight models) with a defensive prompt synthesis pipeline, ScopeGuard parses unstructured client requests and automatically generates:

  1. Phased Milestone…

🧠 How I Built It

sequenceDiagram
    autonumber
    actor Dev as πŸ’Ό Freelancer
    participant UI as πŸ–₯️ Next.js Generator
    participant API as ⚑ /api/proposals/generate
    participant AI as 🧠 Gemma 2 27B (OpenRouter)
    participant DB as πŸƒ MongoDB Atlas
    actor Client as πŸ‘” Client

    Dev->>UI: Inputs $75/hr & pastes messy client requirements
    UI->>API: POST /api/proposals/generate
    API->>AI: Prompt: Extract deliverables, hours & defensive OUT-OF-SCOPE items
    AI-->>API: JSON { milestones, inScope, outOfScope, policy, paymentSchedule }
    API->>DB: Insert SOW proposal (status: "draft")
    API-->>UI: Return proposal ID
    UI->>Dev: Redirects to /sow/[id] with interactive tabs
    Dev->>Client: Shares public link /share/[id]
    Client->>UI: Reviews scope boundaries & clicks "Accept Statement of Work"
    UI->>DB: PATCH status: "accepted" with acceptedAt timestamp
    UI-->>Client: πŸŽ‰ Confetti burst & [OFFICIALLY SIGNED] seal
    Dev->>UI: One-click export to pure vector PDF
  1. Google Gemma 2 27B (google/gemma-2-27b-it): Gemma was specifically chosen because of its exceptional reasoning density and adherence to complex JSON schemas. Instead of writing vague descriptions, Gemma accurately dissects technical requirements, calculates proportional milestone budgets, and proactively spots dangerous scope creep before it happens.
  2. MongoDB Atlas Database: Stores proposal documents, deliverables, financial milestones, and digital acceptance signatures. Queries are indexed across freelancerName and clientName to give contractors a private SOW Vault (/history).
  3. Pure Vector PDF Engine (lib/pdf-export.ts): Rather than relying on html2canvas (which crashes when parsing modern Tailwind CSS v4 color functions like lab() and oklch()), I engineered a pure vector jsPDF engine. It computes block heights dynamically and keeps headings and signature blocks attached across pages.
  4. Next.js 16 App Router & Tailwind CSS v4: Built with serverless API routes, optimized responsive grid layouts, and custom media-print rules that guarantee flawless multi-page printing.

🌍 Why Does Open Innovation Matter?

Why build this with open-weight models like Gemma 2 instead of proprietary closed-source APIs?

  1. πŸ’Έ Sustainable Micro-SaaS Unit Economics: Closed-source models (like GPT-4o) charge heavy token fees for large context prompts, destroying the profit margins of a low-cost side hustle. Open-weight Gemma models (via OpenRouter or local Ollama instances) cost fractions of a cent per proposal, making a $9/month subscription model immediately profitable.
  2. πŸ”’ Client Confidentiality & Trade Secrets: Freelancers routinely negotiate under strict Non-Disclosure Agreements (NDAs). Open-weights ensure that proprietary client ideas, trade secrets, and budget data are never fed into closed corporate training datasets.
  3. ⚑ Predictable, Schema-Strict JSON Output: Contractual generation requires strict structural reliability. Open-weight Gemma models adhere rigorously to JSON output specifications without conversational filler or hallucinated Markdown tags.

πŸ’° Commercial Viability & First User Feedback

The prompt asks: "Build something someone would actually pay for. Bonus points if you land your first user."

The Pricing Model:

  • Free Tier: 3 Defensive SOW generations per month.
  • Pro Freelancer ($9/month): Unlimited SOWs, custom brand watermarks, client digital signing portal, and vector PDF exports.
  • The ROI: If a freelancer saves just one hour of unbilled scope creep ($75/hr), ScopeGuard pays for itself 8x over in its very first month.

Real User Testimonial:

"I tested ScopeGuard on a real frontend contract pitch for an e-commerce client who kept asking for 'quick extra animations'. In 30 seconds, ScopeGuard generated an explicit OUT-OF-SCOPE box that stated custom 3D three.js renders would require a separate change order at $75/hr. The client signed off immediately without arguing, saving me an estimated 8 hours of unbilled work. I would easily pay $15/month for this."

β€” Akshat Jain., Freelance Next.js Developer

🎯 Wrap-Up

Next time a client messages you saying: "Hey, can we just quickly add one tiny little feature before launch?"...

Don't panic. Don't work for free on Sunday night.

Run it through ScopeGuard, send them the link, and protect your craft! πŸ›‘οΈ

πŸ“° Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.