Documentation

How StackAgent AI Works

What StackAgent AI is

StackAgent AI is an autonomous backend refactoring engine. It connects to your GitHub repositories and cloud providers, analyzes your backend architecture, and generates structured migration plans executed as a series of pull requests. Think of it as a senior backend engineer that works through a systematic checklist — but never pushes directly to main.

What it supports today (demo)

The current demo showcases a full Supabase → DigitalOcean migration template that covers:

Data Access Layer extraction
API Gateway scaffolding
RPC proxy and JWT claims plumbing
Storage migration (Supabase Storage → DO Spaces)
Edge Functions conversion (Deno → Node.js)
Database RLS → Stored Procedure hardening

How phases work

Each migration is broken into sequential phases, each producing its own pull request:

PR1
DAL Extraction
Extract all platform-specific calls into a typed Data Access Layer
PR2
Gateway Scaffold
Create an API gateway layer with routes mirroring your current endpoints
PR3
RPC Proxy + Claims
Wire up database RPC calls and JWT authorization middleware
PR4
Storage Migration
Replace storage provider calls with the target platform equivalent
PR5
Edge Functions
Convert serverless functions between runtimes
PR5-H
DB Wrapper RPCs
Harden authorization with stored procedures replacing RLS policies

What "PR-based automation" means

Unlike tools that modify your codebase directly, StackAgent AI operates exclusively through pull requests. Each phase generates a branch, commits the changes, and opens a PR on your repository. You review the diff, run your CI pipeline, request changes if needed, and merge only when you're satisfied. This means StackAgent never has write access to your main branch — it proposes, you decide.

Roadmap

In Progress
  • OAuth integrations (GitHub, DigitalOcean)
  • Real PR generation
Next
  • Ephemeral worker environments
  • Claude API integration for code generation
Planned
  • AWS migration templates
  • Firebase migration templates
  • Custom template builder
  • Team collaboration features