Skip to content

Repository files navigation

Perimeter — Scope Creep Radar & Change Order SaaS

Perimeter is a B2B SaaS application designed for digital agencies and freelance consultants to detect scope creep in incoming client communications before it degrades profit margins.


Key Features (5 Core Modules)

  1. Auth & Client / Project Onboarding:

    • Supabase email/password authentication flow.
    • Client and Project management with contract hourly rates.
  2. SOW Ingestion & Parsing Agent:

    • Upload PDF contracts or paste raw Statement of Work text.
    • Uses Anthropic Claude API (claude-sonnet-4-6) to extract structured deliverables, explicit exclusions, revision caps, and project timelines.
    • Readable, editable card UI allowing PM verification before saving.
  3. Request Logging (Single & Bulk Slack/Email Thread Entry):

    • Paste single client messages or entire multi-line Slack threads.
    • Evaluates each message against the SOW baseline.
  4. Scope Classification Agent (Core AI Engine):

    • Prompts Claude API (claude-sonnet-4-6) with structured SOW, raw contract context, historical project requests, and the new message.
    • Classifies request into in_scope, out_of_scope, or ambiguous with explicit clause citation and labor hour estimates.
  5. Change Order Drafting Agent & Scope Radar Dashboard:

    • Auto-generates polite, professional change-order proposal emails for flagged requests.
    • Includes status workflow tracker (DraftSentApprovedRejected).
    • Recharts Margin Tracker visualizing unbilled labor value and monthly financial risk recovery.

Tech Stack

  • Frontend: Next.js 14 (App Router) + TypeScript + Tailwind CSS
  • Backend: Monolithic Next.js API Routes (app/api/...)
  • Database & Auth: Supabase Postgres + Supabase Auth + Row Level Security (RLS)
  • AI Engine: Anthropic Claude API (claude-sonnet-4-6)
  • Data Visualization: Recharts

Setup & Environment Instructions

1. Environment Variables (.env.local)

Copy .env.local.example to .env.local in the project root:

# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=https://your-supabase-project-id.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key

# Anthropic Claude API Key (uses model claude-sonnet-4-6)
ANTHROPIC_API_KEY=your-anthropic-api-key

2. Database Migration (Supabase Postgres)

Apply the SQL migration file located at supabase/migrations/20260904000000_init.sql in your Supabase SQL Editor to initialize tables and RLS policies:

  • clients
  • projects
  • sows
  • requests
  • change_orders

3. Local Development

Install dependencies and run the Next.js development server:

cmd /c npm install
cmd /c npm run dev

Open http://localhost:3000 in your browser.

Note: If no Supabase keys or Anthropic API keys are provided initially, Perimeter operates out-of-the-box with a built-in state store and mock seed data so you can visually test and demonstrate the full flow immediately!


Anthropic Claude API Prompt IP Design

The AI logic resides in lib/claude.ts and uses claude-sonnet-4-6 across three specialized agents:

  • parseSOWWithClaude: Converts raw contract prose into schema-enforced structured JSON.
  • classifyScopeWithClaude: Employs contextual sandboxing (SOW + past 10 requests + new request) to classify scope risk and estimate labor hours.
  • draftChangeOrderWithClaude: Synthesizes client metadata, out-of-scope reasoning, labor hours, and hourly billing rates into email proposals.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages