Skip to content

pronghorn-red/pronghorn-docs

Repository files navigation

Pronghorn

AI-Powered Software Development Platform

Transform unstructured requirements into production-ready code with autonomous multi-agent AI teams. From idea to deployment with complete traceability.

License: MIT Built with Lovable Powered by Supabase

🚀 Live Demo: https://pronghorn.red | 📚 Full Docs: /docs


What is Pronghorn?

Pronghorn is an open-source AI-powered development platform built by the Government of Alberta that orchestrates specialized AI agents to design, code, and deploy software applications autonomously.

Key Innovation: Multi-agent teams work collaboratively on a shared "blackboard" architecture, iteratively refining designs and code through multiple review epochs—mimicking how human development teams collaborate.

Idea → AI Requirements Decomposition → Visual Architecture Design →
Multi-Agent Code Generation → Automated Testing → One-Click Deployment

Quick Stats

Metric Value
Codebase ~50,000 lines TypeScript/TSX
UI Components 200+ React components (48 shadcn/ui primitives)
Backend Functions 53 Supabase Edge Functions (Deno)
Database Tables 30+ with Row-Level Security
AI Providers Claude, Gemini, Grok, OpenAI
Agent Types 30+ specialized AI agents

Core Features

🎯 AI Requirements Decomposition

Transform natural language into structured hierarchies:

User Input: "Build a task management app with user auth and real-time collaboration"

AI Output:
├─ EPIC: Task Management System
│  ├─ FEATURE: User Authentication
│  │  ├─ STORY: Email/password login
│  │  │  └─ AC: Password must be 8+ characters with special chars
│  │  └─ STORY: OAuth integration (Google, Microsoft)
│  ├─ FEATURE: Real-time Collaboration
│  │  ├─ STORY: Live task updates via WebSocket
│  │  └─ STORY: Conflict resolution for concurrent edits
│  └─ FEATURE: Task CRUD Operations
│     ├─ STORY: Create/edit tasks with markdown support
│     └─ STORY: Drag-and-drop prioritization

Providers: Gemini 2.5 Flash (primary), Claude Opus 4.5 (complex), Grok Beta (fallback)

Example Usage:

// Client-side: Trigger decomposition
const { data } = await supabase.functions.invoke('decompose-requirements', {
  body: {
    projectId: 'abc-123',
    shareToken: 'token-xyz',
    input: 'Build a task management app...',
    model: 'gemini-2.5-flash'
  }
});

// Returns hierarchical structure automatically linked to standards

🎨 Visual Architecture Canvas

Interactive ReactFlow-based canvas with 44 node types and 11-level flow hierarchy:

Level 1: EXTERNAL_SYSTEM
  ↓
Level 2: WEB_UI, MOBILE_APP, API_GATEWAY
  ↓
Level 3: WEB_PAGE, API_ROUTER, AUTH_SERVICE
  ↓
...
  ↓
Level 11: COLUMN (database column definitions)

Connection Validation: Automatic enforcement of architectural rules (e.g., WEB_PAGE can only connect to WEB_COMPONENT or API_ROUTE).

Example Canvas Operations:

// Add node with auto-positioning based on flow level
const newNode = {
  type: 'WEB_PAGE',
  position: { x: getXPosition(3), y: 100 }, // Level 3
  data: {
    label: 'Dashboard',
    description: 'Main user dashboard with analytics widgets',
    projectId: 'abc-123'
  }
};

// Connection validation
const isValid = isValidConnection(
  sourceNode.type, // WEB_PAGE
  targetNode.type  // WEB_COMPONENT
); // Returns true

Real-time Collaboration: Multiple users see live updates via WebSocket subscriptions.


🤖 Multi-Agent AI Teams

10 Specialized Agents work collaboratively:

Agent Role Example Output
Architect System design Component diagrams, API contracts, database schemas
Developer Code implementation React components, API routes, business logic
DBA Database design Normalized schemas, indexes, RLS policies
QA Testing & validation Unit tests, integration tests, E2E scenarios
Security Vulnerability review OWASP Top 10 checks, auth audits, input validation
DevOps Infrastructure Docker configs, CI/CD pipelines, deployment scripts
Technical Writer Documentation API docs, README files, inline comments
UX Designer User experience Wireframes, interaction patterns, accessibility
Performance Optimization Caching strategies, query optimization, lazy loading
Accessibility WCAG compliance ARIA labels, keyboard navigation, screen reader support

Blackboard Architecture: Agents read/write to shared canvas, iterating over multiple epochs with critic feedback loops.

Example Workflow:

// 1. Architect generates initial design
await supabase.functions.invoke('ai-architect', {
  body: {
    projectId: 'abc-123',
    requirements: requirementsTree,
    standards: complianceLibrary
  }
});

// 2. Critic reviews and provides feedback
await supabase.functions.invoke('ai-architect-critic', {
  body: {
    projectId: 'abc-123',
    canvasSnapshot: currentCanvas
  }
});

// 3. Multi-agent refinement (3 epochs by default)
await supabase.functions.invoke('orchestrate-agents', {
  body: {
    projectId: 'abc-123',
    epochs: 3,
    agents: ['architect', 'dba', 'security']
  }
});

💻 Autonomous Coding Agent

Full Git workflow with real-time progress monitoring:

Capabilities:

  • ✅ Read/create/edit/delete/rename files
  • ✅ Stage changes → Commit → Push to GitHub
  • ✅ Pause/resume/abort operations
  • ✅ Multi-file refactoring
  • ✅ Dependency installation

Example: Add New Feature

// User prompt in UI: "Add dark mode toggle to settings page"

// Agent executes:
1. Read current settings.tsx
2. Create ThemeToggle.tsx component
3. Edit settings.tsx to import and use ThemeToggle
4. Update global.css with dark mode variables
5. Stage all changes
6. Commit: "feat: add dark mode toggle to settings"
7. Push to GitHub

// Real-time progress shown:
// ⏳ Reading settings.tsx (850 lines)
// ✅ Created ThemeToggle.tsx (120 lines)
// ⏳ Editing settings.tsx...
// ✅ Staged 3 files
// ✅ Committed abc123def
// ✅ Pushed to origin/main

API Pattern:

const response = await supabase.functions.invoke('coding-agent-orchestrator', {
  body: {
    projectId: 'abc-123',
    shareToken: 'token-xyz',
    userMessage: 'Add dark mode toggle to settings page',
    repositoryId: 'repo-456',
    model: 'claude-opus-4-5' // Long-context model
  }
});

// Returns streaming JSON chunks:
// {"type": "progress", "message": "Reading settings.tsx..."}
// {"type": "file_created", "path": "src/components/ThemeToggle.tsx"}
// {"type": "complete", "filesChanged": 3, "commitHash": "abc123def"}

🗄️ Full Database Lifecycle

Provision, Import, Query, Migrate—all from the UI:

1. One-Click PostgreSQL Provisioning

// Create database on Render.com
const { data } = await supabase.functions.invoke('render-database', {
  body: {
    projectId: 'abc-123',
    databaseName: 'myapp-prod',
    plan: 'starter' // Free tier
  }
});

// Returns connection string + status tracking
// Status: pending → creating → available (auto-polling)

2. AI-Powered Data Import

6-Step Wizard: Upload → Preview → AI Schema Inference → Review SQL → Execute → Verify

Example: Import Excel File

Step 1: Upload "sales_data.xlsx" (3 sheets)
Step 2: Preview shows 1,500 rows × 12 columns
Step 3: AI infers schema:
  - order_id: BIGINT PRIMARY KEY
  - customer_email: TEXT
  - order_total: NUMERIC(10,2)
  - created_at: TIMESTAMP
  - metadata: JSONB
Step 4: Review SQL:
  CREATE TABLE sales_data (...);
  CREATE INDEX idx_customer ON sales_data(customer_email);
  INSERT INTO sales_data VALUES ... (batched in 100-row chunks)
Step 5: Execute with progress bar (batch 15/15 complete)
Step 6: Verify 1,500 rows inserted successfully

Supported Formats: Excel (.xlsx, .xls), CSV, JSON (auto-normalized)

3. Monaco-Powered SQL Editor

Features: Syntax highlighting, autocomplete, query history, destructive query warnings

-- Example: Complex JOIN with CTE
WITH recent_orders AS (
  SELECT customer_id, COUNT(*) as order_count
  FROM orders
  WHERE created_at > NOW() - INTERVAL '30 days'
  GROUP BY customer_id
)
SELECT
  c.email,
  c.name,
  COALESCE(ro.order_count, 0) as recent_orders
FROM customers c
LEFT JOIN recent_orders ro ON c.id = ro.customer_id
ORDER BY recent_orders DESC
LIMIT 100;

-- Export results as JSON/CSV/SQL INSERT

Saved Queries: Store frequently used queries per database with keyboard shortcuts (Cmd+Enter to execute).


⚡ Token-Based Collaboration

No login required for project access—share URLs with role-based permissions:

Role Permissions Example URL
Owner Full access (manage tokens, delete project) Authenticated user only
Editor Create/update operations /project/abc-123/canvas/t/editor-token-xyz
Viewer Read-only access /project/abc-123/canvas/t/viewer-token-def

Security Model: Row-Level Security (RLS) validates tokens server-side for every operation.

Example: Generate Share Link

// Create editor token
const { data: token } = await supabase.rpc('create_project_token', {
  p_project_id: 'abc-123',
  p_role: 'editor',
  p_label: 'Frontend Team',
  p_expires_at: '2026-12-31T23:59:59Z' // Optional
});

// Share URL
const shareUrl = `https://pronghorn.red/project/abc-123/canvas/t/${token.token}`;

// Recipients can access immediately—no signup required

Real-time Sync: All token users see live updates via WebSocket subscriptions (RLS-protected).


Technology Stack

Frontend (React + Vite)

Library Purpose Key Features
React 18.3 UI framework Concurrent rendering, Suspense
TypeScript 5.8 Type safety Strict mode, path aliases
Vite 5.4 Build tool <100ms HMR, 800KB initial bundle
Tailwind CSS Styling HSL-based design tokens, dark mode
shadcn/ui Component library 48 accessible components
React Query Server state Auto-caching, optimistic updates
React Hook Form Form state Zod validation, field arrays
Monaco Editor Code editor VS Code engine, 2MB lazy-loaded
ReactFlow Visual canvas 44 node types, auto-layout

Backend (Supabase)

Service Technology Purpose
Database PostgreSQL 15 Primary data store (30+ tables)
Auth JWT + RLS Email/password, Google/Azure SSO
Edge Functions Deno 1.37 53 serverless functions
Realtime WebSocket Live collaboration, presence
Storage S3-compatible Artifacts, images, exports

AI Providers

Provider Models Use Case
Google Gemini 2.5 Flash, 2.5 Pro Requirements decomposition (fast)
Anthropic Claude Opus 4.5, Sonnet 4.5 Complex coding tasks (long context)
xAI Grok 4.1 Fast Reasoning Architecture generation
OpenAI GPT-4, GPT-4 Turbo Fallback provider

Quick Start

Prerequisites

  • Node.js 18+ and npm 9+
  • Git for version control
  • VS Code (recommended)

1. Clone & Install

git clone https://github.com/pronghorn-red/pronghorn.git
cd pronghorn
npm install

2. Run Development Server

npm run dev

App runs at http://localhost:8080

No .env required—Supabase config is embedded in the client for public access.

3. Create Your First Project

Option A: Use Production Instance (recommended for quick start)

# Already configured—just sign up at https://pronghorn.red

Option B: Local Supabase (for backend development)

# Install Supabase CLI
npm install -g supabase

# Start local stack (Docker required)
supabase start

# Update src/integrations/supabase/client.ts with local URL
# SUPABASE_URL: http://localhost:54321
# SUPABASE_ANON_KEY: (printed in terminal)

4. Configure AI Providers (Optional)

To use AI features locally, set environment secrets in Supabase Dashboard:

Secret Get API Key From
GEMINI_API_KEY Google AI Studio
ANTHROPIC_API_KEY Anthropic Console
GROK_API_KEY xAI Console
GITHUB_PAT GitHub Settings
RENDER_API_KEY Render Dashboard

Usage Examples

Example 1: Build a Blog with AI

// 1. Create project via UI or API
const { data: project } = await supabase.rpc('create_project_with_token', {
  p_name: 'My Blog',
  p_description: 'Personal blog with markdown support',
  p_user_id: user.id
});

// 2. Decompose requirements with AI
await supabase.functions.invoke('decompose-requirements', {
  body: {
    projectId: project.id,
    input: `
      Build a blog with:
      - Markdown editor with preview
      - Tag-based filtering
      - RSS feed generation
      - SEO optimization
      - Dark mode support
    `,
    model: 'gemini-2.5-flash'
  }
});

// 3. Generate architecture with multi-agent team
await supabase.functions.invoke('orchestrate-agents', {
  body: {
    projectId: project.id,
    epochs: 3,
    agents: ['architect', 'developer', 'dba', 'security']
  }
});

// 4. Autonomous code generation
await supabase.functions.invoke('coding-agent-orchestrator', {
  body: {
    projectId: project.id,
    userMessage: 'Implement the blog according to the canvas design',
    repositoryId: project.repository_id,
    model: 'claude-opus-4-5'
  }
});

// 5. Deploy to Render.com
await supabase.functions.invoke('render-service', {
  body: {
    projectId: project.id,
    environment: 'production',
    serviceType: 'web'
  }
});

Result: Fully functional blog application deployed to https://my-blog.onrender.com in ~15 minutes.


Example 2: Import Sales Data & Generate Reports

// 1. Provision database
const { data: db } = await supabase.functions.invoke('render-database', {
  body: {
    projectId: 'abc-123',
    databaseName: 'sales-analytics',
    plan: 'starter'
  }
});

// 2. Import Excel file via wizard UI
// - Upload "Q4_2025_Sales.xlsx"
// - AI infers schema with proper types
// - Creates indexes on date/customer columns
// - Inserts 50,000 rows in batched transactions

// 3. Run analytical queries
const { data: topCustomers } = await supabase.rpc('execute_sql_with_token', {
  p_database_id: db.id,
  p_token: shareToken,
  p_query: `
    SELECT
      customer_name,
      SUM(order_total) as total_revenue,
      COUNT(*) as order_count
    FROM sales_data
    WHERE order_date >= '2025-10-01'
    GROUP BY customer_name
    ORDER BY total_revenue DESC
    LIMIT 20;
  `
});

// 4. Export results as CSV/JSON

Example 3: Real-time Collaboration

// User A: Create canvas node
await supabase.rpc('insert_canvas_node_with_token', {
  p_project_id: 'abc-123',
  p_token: editorToken,
  p_type: 'WEB_PAGE',
  p_label: 'Dashboard',
  p_position: { x: 200, y: 100 }
});

// User B: Receives real-time update via WebSocket
// (Subscribed to canvas:abc-123 channel)
const subscription = supabase
  .channel(`canvas:abc-123`)
  .on('postgres_changes', {
    event: 'INSERT',
    schema: 'public',
    table: 'canvas_nodes',
    filter: `project_id=eq.abc-123`
  }, (payload) => {
    console.log('New node added:', payload.new);
    // UI updates automatically
  })
  .subscribe();

// User C (viewer token): Can see updates but cannot edit
// RLS policies enforce read-only access

Project Structure

pronghorn/
├── src/
│   ├── components/
│   │   ├── ui/                     # 48 shadcn/ui primitives
│   │   ├── layout/                 # Navigation, sidebar, header
│   │   ├── canvas/                 # ReactFlow architecture designer
│   │   │   ├── CanvasNode.tsx      # Custom node renderer
│   │   │   ├── CanvasPalette.tsx   # 44 node types selector
│   │   │   └── AgentFlow.tsx       # Multi-agent orchestration UI
│   │   ├── build/                  # Coding agent interface
│   │   │   ├── UnifiedAgentInterface.tsx
│   │   │   ├── AgentProgressMonitor.tsx
│   │   │   └── StagingPanel.tsx
│   │   ├── deploy/                 # Database management
│   │   │   ├── DatabaseExplorer.tsx
│   │   │   ├── DatabaseImportWizard.tsx
│   │   │   ├── SqlQueryEditor.tsx
│   │   │   └── import/             # Multi-step wizard
│   │   ├── requirements/           # Hierarchical requirements tree
│   │   ├── repository/             # File tree, code editor, Git
│   │   ├── standards/              # Compliance library UI
│   │   └── dashboard/              # Project cards, creation
│   │
│   ├── pages/
│   │   ├── Landing.tsx             # Marketing page
│   │   ├── Dashboard.tsx           # Project list
│   │   ├── Auth.tsx                # Login/signup/SSO
│   │   └── project/                # 13 project-specific pages
│   │       ├── Canvas.tsx
│   │       ├── Build.tsx
│   │       ├── Repository.tsx
│   │       ├── Deploy.tsx
│   │       └── ...
│   │
│   ├── hooks/
│   │   ├── useShareToken.ts        # Token extraction & caching
│   │   ├── useRealtimeCanvas.ts    # WebSocket subscriptions
│   │   ├── useRealtimeRequirements.ts
│   │   └── ...
│   │
│   ├── lib/
│   │   ├── connectionLogic.ts      # Canvas edge validation
│   │   ├── tokenCache.ts           # Sync token storage
│   │   └── utils.ts                # cn() and helpers
│   │
│   └── integrations/supabase/
│       ├── client.ts               # Singleton client
│       └── types.ts                # Generated DB types
│
├── supabase/
│   ├── functions/                  # 53 Edge Functions
│   │   ├── create-project/
│   │   ├── coding-agent-orchestrator/
│   │   ├── orchestrate-agents/
│   │   ├── decompose-requirements/
│   │   ├── chat-stream-gemini/
│   │   ├── manage-database/
│   │   └── ...
│   └── config.toml
│
├── public/
│   └── data/
│       ├── agents.json             # Multi-agent definitions
│       ├── buildAgents.json        # Coding agent config
│       ├── connectionLogic.json    # Canvas flow rules
│       └── graphicStyles.json
│
├── docs/                           # 11 technical documentation files
│   ├── DOCS-00-MasterIndex.md
│   ├── DOCS-01-Configuration.md
│   ├── DOCS-02-PublicAssets.md
│   ├── DOCS-03-SupabaseBackend.md
│   ├── DOCS-04-UIComponents.md
│   ├── DOCS-05-FeatureComponents-Part1.md
│   ├── DOCS-06-FeatureComponents-Part2.md
│   ├── DOCS-08-PagesRoutingUtils.md
│   ├── DOCS-09-Architecture.md
│   ├── DOCS-10-DataFlow.md
│   └── DOCS-11-QuickStart.md
│
└── README.md

Architecture Overview

High-Level System Diagram

┌─────────────────────────────────────────────────────────────────┐
│                         Client Layer                             │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐          │
│  │  Web Browser │  │  PWA (iOS)   │  │ PWA (Android)│          │
│  └──────┬───────┘  └──────┬───────┘  └──────┬───────┘          │
│         └──────────────────┴──────────────────┘                  │
│                            │                                     │
└────────────────────────────┼─────────────────────────────────────┘
                             ▼
┌─────────────────────────────────────────────────────────────────┐
│                    Frontend (React + Vite)                       │
│  ┌─────────────────────────────────────────────────────────┐   │
│  │  React Router (43 routes)                                │   │
│  │  ├─ Public: /landing, /auth, /terms, /privacy           │   │
│  │  └─ Authenticated: /dashboard, /project/:id/*            │   │
│  └─────────────────────────────────────────────────────────┘   │
│                                                                  │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐          │
│  │ shadcn/ui    │  │ ReactFlow    │  │ Monaco       │          │
│  │ 48 Components│  │ Canvas       │  │ Code Editor  │          │
│  └──────────────┘  └──────────────┘  └──────────────┘          │
│                                                                  │
│  ┌─────────────────────────────────────────────────────────┐   │
│  │  React Query (Server State + Caching)                    │   │
│  └─────────────────────────────────────────────────────────┘   │
└────────────────────────────┬─────────────────────────────────────┘
                             ▼
┌─────────────────────────────────────────────────────────────────┐
│                    Supabase Backend                              │
│  ┌─────────────────────────────────────────────────────────┐   │
│  │  Authentication (JWT + RLS)                              │   │
│  │  ├─ Email/Password                                       │   │
│  │  ├─ Google OAuth                                         │   │
│  │  ├─ Microsoft Azure OAuth                                │   │
│  │  └─ Token-based (Anonymous)                              │   │
│  └─────────────────────────────────────────────────────────┘   │
│                                                                  │
│  ┌─────────────────────────────────────────────────────────┐   │
│  │  PostgreSQL 15 (30+ tables, RLS policies)               │   │
│  │  ├─ projects, requirements, canvas_nodes                │   │
│  │  ├─ project_tokens (RBAC)                                │   │
│  │  ├─ repositories, staging_files                          │   │
│  │  └─ project_databases, migrations                        │   │
│  └─────────────────────────────────────────────────────────┘   │
│                                                                  │
│  ┌─────────────────────────────────────────────────────────┐   │
│  │  Edge Functions (Deno - 53 functions)                    │   │
│  │  ├─ AI: orchestrate-agents, coding-agent                │   │
│  │  ├─ Chat: chat-stream-{gemini,anthropic,xai}            │   │
│  │  ├─ Git: sync-repo-{push,pull}, clone-public-repo       │   │
│  │  └─ Deploy: render-service, render-database             │   │
│  └─────────────────────────────────────────────────────────┘   │
│                                                                  │
│  ┌─────────────────────────────────────────────────────────┐   │
│  │  Realtime (WebSocket)                                    │   │
│  │  ├─ postgres_changes (RLS-protected)                     │   │
│  │  └─ Broadcast channels (public refresh signals)         │   │
│  └─────────────────────────────────────────────────────────┘   │
└────────────────────────────┬─────────────────────────────────────┘
                             ▼
┌─────────────────────────────────────────────────────────────────┐
│                      External Services                           │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐          │
│  │ Google       │  │ Anthropic    │  │ xAI Grok     │          │
│  │ Gemini API   │  │ Claude API   │  │ API          │          │
│  └──────────────┘  └──────────────┘  └──────────────┘          │
│                                                                  │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐          │
│  │ GitHub API   │  │ Render.com   │  │ Lovable      │          │
│  │ (Repos/Push) │  │ (Deploy/DB)  │  │ (Hosting)    │          │
│  └──────────────┘  └──────────────┘  └──────────────┘          │
└─────────────────────────────────────────────────────────────────┘

Multi-Agent Workflow

User Input (Natural Language)
        ↓
┌───────────────────────┐
│ Requirements          │
│ Decomposition Agent   │
│ (Gemini 2.5 Flash)    │
└───────┬───────────────┘
        ↓
EPIC → FEATURE → STORY → AC (stored in DB)
        ↓
┌───────────────────────┐
│ Architect Agent       │ ──┐
│ (Grok 4.1 Fast)       │   │
└───────┬───────────────┘   │
        ↓                   │
Canvas with Nodes/Edges     │  Blackboard
        ↓                   │  Architecture
┌───────────────────────┐   │  (Shared State)
│ Critic Agent          │ ──┤
│ Reviews & Suggests    │   │
└───────┬───────────────┘   │
        ↓                   │
Refined Canvas (Epoch 1)    │
        ↓                   │
┌───────────────────────┐   │
│ Multi-Agent Team      │ ──┘
│ - DBA                 │
│ - Security            │
│ - Performance         │
└───────┬───────────────┘
        ↓
Final Architecture (Epoch 3)
        ↓
┌───────────────────────┐
│ Coding Agent          │
│ (Claude Opus 4.5)     │
│ - Generates code      │
│ - Runs tests          │
│ - Commits to Git      │
└───────┬───────────────┘
        ↓
Production-Ready Code

Security Model

Row-Level Security (RLS)

Every table has RLS policies enforcing token validation:

-- Example: canvas_nodes table policy
CREATE POLICY "Allow access with valid token" ON canvas_nodes
FOR ALL
USING (
  project_id IN (
    SELECT id FROM projects
    WHERE created_by = auth.uid()
  )
  OR
  project_id IN (
    SELECT project_id FROM project_tokens
    WHERE token = current_setting('app.share_token', true)::UUID
      AND (expires_at IS NULL OR expires_at > NOW())
  )
);

Token Setting: Client calls set_share_token(token) RPC before any operation.

SECURITY DEFINER Pattern

All RPC functions bypass RLS with explicit validation:

CREATE FUNCTION insert_requirement_with_token(
  p_project_id UUID,
  p_token UUID,
  p_title TEXT
) RETURNS requirements
LANGUAGE plpgsql
SECURITY DEFINER
SET search_path TO 'public'
AS $$
BEGIN
  -- Validate access and get role
  PERFORM require_role(p_project_id, p_token, 'editor');

  -- Perform operation (RLS bypassed)
  INSERT INTO requirements (project_id, title)
  VALUES (p_project_id, p_title)
  RETURNING * INTO result;

  RETURN result;
END;
$$;

Benefits:

  • ✅ Centralized authorization logic
  • ✅ Consistent error handling
  • ✅ Audit trail for token usage
  • ✅ Role-based permissions (owner/editor/viewer)

Deployment

Frontend (Lovable)

Production: https://pronghorn.red

Automatic deployment on Git push—no manual steps required.

Backend (Supabase)

Edge Functions: Auto-deploy from /supabase/functions/ folder.

# Deploy all functions
supabase functions deploy

# Deploy specific function
supabase functions deploy coding-agent-orchestrator

Application Deployments (Render.com)

Create web services directly from the UI:

// Provision web service
await supabase.functions.invoke('render-service', {
  body: {
    projectId: 'abc-123',
    serviceName: 'my-app',
    environment: 'production',
    serviceType: 'web',
    buildCommand: 'npm run build',
    startCommand: 'npm start'
  }
});

// Auto-configured URLs:
// dev-my-app.onrender.com
// uat-my-app.onrender.com
// prod-my-app.onrender.com

Documentation

Full Technical Docs

Browse /docs for comprehensive documentation:

Document Focus
DOCS-00 Master index with role-based navigation
DOCS-01 Build config, dependencies, environment vars
DOCS-02 Agent definitions, JSON schemas
DOCS-03 Edge functions, database, RLS
DOCS-04 shadcn/ui components, theme system
DOCS-05 Canvas, agents, chat, database explorer
DOCS-06 Deploy, requirements, repository, standards
DOCS-08 Pages, routing, utilities, styling
DOCS-09 System architecture with Mermaid diagrams
DOCS-10 Data flows, real-time sync patterns
DOCS-11 Developer onboarding guide

Quick Navigation by Role

Frontend Developer: DOCS-04DOCS-05DOCS-06

Backend Developer: DOCS-03DOCS-10

AI/ML Engineer: DOCS-02DOCS-03DOCS-09

DevOps Engineer: DOCS-01DOCS-11

New Contributor: DOCS-11DOCS-09


Roadmap

Current Status: Alpha v0.0.0

Feature Status
Multi-agent architecture design ✅ Complete
Autonomous coding agent ✅ Complete
Database lifecycle management ✅ Complete
Token-based collaboration ✅ Complete
Real-time WebSocket sync ✅ Complete
Render.com deployments ✅ Complete

Upcoming Features

Quarter Feature
Q1 2026 Testing agent (automated unit/integration tests)
Q1 2026 CI/CD pipeline generation (GitHub Actions)
Q2 2026 Multi-language support (Python, Go, Java)
Q2 2026 Advanced security scans (SAST/DAST)
Q3 2026 Self-hosted option (Docker Compose)
Q3 2026 Marketplace for custom agents

Contributing

Pronghorn is open source under the MIT License. Contributions are welcome!

How to Contribute

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'feat: add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow existing code style (ESLint + Prettier)
  • Write TypeScript with strict mode
  • Add tests for new features
  • Update documentation for API changes
  • Use conventional commits (feat, fix, docs, refactor)

Areas Needing Help

  • 🧪 Testing: Increase test coverage (currently ~40%)
  • 📖 Documentation: Video tutorials, interactive examples
  • 🌐 Internationalization: Multi-language UI support
  • 🎨 Design: Figma components, design system docs
  • 🐛 Bug Reports: File issues with reproduction steps

Support & Community

Get Help

Channel Purpose
GitHub Issues Bug reports, feature requests
GitHub Discussions Q&A, architecture discussions
Documentation Full technical docs
Email ti.deputyminister@gov.ab.ca

Reporting Bugs

Include:

  1. Environment: OS, Node version, browser
  2. Steps to reproduce: Detailed workflow
  3. Expected behavior: What should happen
  4. Actual behavior: What actually happened
  5. Screenshots/logs: If applicable

Security Vulnerabilities

Do NOT open public issues for security vulnerabilities.

Email: ti.deputyminister@gov.ab.ca with subject "SECURITY: [description]"


Legal & Compliance

Alpha Testing Notice

This software is in Alpha testing by the Government of Alberta. Features may change or be removed without notice.

Disclaimer

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE GOVERNMENT OF ALBERTA, ITS MINISTERS, OFFICERS, EMPLOYEES, OR AGENTS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY ARISING FROM THE SOFTWARE.

Third-Party Services

Pronghorn integrates with:

Full Legal Docs: Terms of Use | Privacy Policy


License

MIT License - See LICENSE for full text.

Copyright (c) 2025 Government of Alberta, Ministry of Technology and Innovation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software...

Acknowledgments

Built by: Government of Alberta, Ministry of Technology and Innovation

Powered by:

Special Thanks:

  • All open-source contributors
  • Alpha testers providing feedback
  • Government of Alberta for supporting open-source innovation

Transform Ideas into Production Code with AI
Try Pronghorn Live · Read the Docs · Report Bug

Built with ❤️ by the Government of Alberta

About

Auto-generated documentation of Pronghorn features

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published