SlothForge is a living software factory that converts product ideas into deployed MVPs. It combines LLM-powered requirement extraction, automated ticket generation, intelligent build orchestration, and continuous drift detection to maintain alignment between specifications and implementation.
SlothForge automates the entire software development lifecycle:
- BRD Extraction: Chat with an LLM to extract structured Business Requirements Documents from product ideas
- Ticket Generation: Automatically generate epic/story hierarchies with acceptance criteria and dependency graphs
- Build Orchestration: Execute tickets in topological order, generating code that satisfies acceptance criteria
- Drift Detection: Compare PR implementations against acceptance criteria to detect gaps and bugs
- CI Integration: Trace test failures back to originating tickets and create bug tickets automatically
SlothForge is built as a monorepo with the following structure:
slothforge-mvp/
βββ apps/
β βββ web/ # Next.js 14 frontend (port 3000)
β βββ api/ # Fastify backend (port 3001)
βββ packages/
β βββ db/ # Prisma schema + generated client
β βββ shared/ # TypeScript types + Zod schemas
βββ docker-compose.yml # PostgreSQL + Redis services
βββ turbo.json # Build pipeline configuration
βββ pnpm-workspace.yaml # Workspace definitions
| Layer | Technology | Purpose |
|---|---|---|
| Package Manager | pnpm | Fast, disk-efficient, first-class monorepo support |
| Monorepo Tool | Turborepo | Parallel task execution, build caching |
| Backend Runtime | Node.js 20+ + TypeScript | Async-first, rich LLM SDK ecosystem |
| API Framework | Fastify | Low overhead, built-in schema validation |
| ORM | Prisma | Type-safe DB access, migrations, JSONB support |
| Database | PostgreSQL 16 | JSONB for flexible metadata, strong transactions |
| Cache/Queue | Redis 7 | Async build jobs, prevents blocking API responses |
| Frontend | Next.js 14 App Router | SSE support, React Server Components |
| UI Library | Tailwind CSS + shadcn/ui | Fast, consistent, composable components |
| LLM SDK | Vercel AI SDK | Unified API across providers, structured output |
| LLM Provider | Google Gemini | Generous free tier, large context windows |
| Schema Validation | Zod | Runtime + compile-time safety for LLM outputs |
| Ticket Provider | Linear | Clean GraphQL API, free tier, webhooks |
| VCS Provider | GitHub | REST API + webhooks, widest adoption |
| Local Tunneling | ngrok | Expose local API for webhook testing |
Before setting up SlothForge, ensure you have the following installed:
- Node.js 20+: Download from nodejs.org
- pnpm 9+: Install with
npm install -g pnpm - Docker: Download from docker.com
- ngrok: Download from ngrok.com (for webhook testing)
Follow these steps to run SlothForge locally:
git clone <repository-url>
cd slothforge-mvpcp .env.example .envEdit .env and fill in your API keys (see Environment Configuration below).
Start PostgreSQL and Redis:
docker compose up -dVerify services are running:
docker compose psYou should see both slothforge-postgres and slothforge-redis with status "Up".
Install all workspace dependencies:
pnpm installApply Prisma migrations to create database tables:
pnpm db:migrateStart both frontend and backend in parallel:
pnpm devThis will start:
- Frontend: http://localhost:3000
- Backend API: http://localhost:3001
Verify the API is running:
curl http://localhost:3001/health
# Should return: {"status":"ok"}To receive webhooks from GitHub and Linear during local development, you need to expose your local API using ngrok.
Download and install ngrok from ngrok.com/download.
In a new terminal window, run:
ngrok http 3001You should see output like:
Forwarding https://abc123.ngrok.io -> http://localhost:3001
Copy the HTTPS forwarding URL (e.g., https://abc123.ngrok.io).
Add the ngrok URL to your .env file:
NGROK_URL=https://abc123.ngrok.ioNote: The ngrok URL changes every time you restart ngrok (unless you have a paid plan). You'll need to update webhooks whenever the URL changes.
SlothForge receives webhooks from GitHub (for CI events) and Linear (for ticket updates).
- Go to your GitHub repository
- Navigate to Settings > Webhooks > Add webhook
- Set Payload URL to:
https://your-ngrok-url.ngrok.io/webhooks/github - Set Content type to:
application/json - Select Let me select individual events:
- β Pull requests
- β Pull request reviews
- β Workflow runs
- β Push
- Click Add webhook
- Go to your Linear workspace
- Navigate to Settings > API > Webhooks
- Click New webhook
- Set URL to:
https://your-ngrok-url.ngrok.io/webhooks/linear - Select events:
- β Issue created
- β Issue updated
- β Issue deleted
- Click Create webhook
slothforge-mvp/
βββ apps/
β βββ api/ # Fastify backend
β β βββ src/
β β β βββ server.ts # Main server entry point
β β β βββ lib/
β β β β βββ prisma.ts # Prisma client singleton
β β β β βββ redis.ts # Redis client singleton
β β β βββ services/
β β β β βββ llm/
β β β β βββ providers.ts # LLM model configurations
β β β βββ adapters/
β β β βββ ticket/
β β β β βββ LinearAdapter.ts
β β β βββ vcs/
β β β βββ GitHubAdapter.ts
β β βββ package.json
β β
β βββ web/ # Next.js frontend
β βββ src/
β β βββ app/
β β βββ layout.tsx # Root layout
β β βββ page.tsx # Landing page
β β βββ globals.css # Global styles
β βββ package.json
β
βββ packages/
β βββ db/ # Database layer
β β βββ prisma/
β β β βββ schema.prisma # Database schema
β β βββ index.ts # Prisma client export
β β βββ package.json
β β
β βββ shared/ # Shared types and schemas
β βββ src/
β β βββ types/ # TypeScript interfaces
β β βββ schemas/ # Zod validation schemas
β β βββ index.ts # Package exports
β βββ package.json
β
βββ docker-compose.yml # Local infrastructure
βββ turbo.json # Turborepo configuration
βββ pnpm-workspace.yaml # Workspace definitions
βββ .env.example # Environment template
SlothForge uses PostgreSQL with 10 core tables:
- Project: Core entity representing a SlothForge project
- BRD: Business Requirements Document with structured fields
- Ticket: Work items (epics and stories) with acceptance criteria
- TicketEdge: Dependency relationships between tickets
- DriftResult: Output of drift detection runs
- DriftFeedback: User feedback on drift detection accuracy
- CIEvent: CI pipeline events from webhooks
- ProcessedEvent: Idempotency table for webhook deduplication
- ReviewQueue: Human review queue for LLM failures
View the full schema in packages/db/prisma/schema.prisma.
Run these commands from the repository root:
| Command | Description |
|---|---|
pnpm dev |
Start all applications in development mode (parallel) |
pnpm build |
Build all applications for production |
pnpm lint |
Run linters across all workspaces |
pnpm test |
Run tests across all workspaces |
pnpm db:migrate |
Run Prisma migrations on the database |
Run these commands with pnpm --filter <workspace>:
pnpm --filter @slothforge/api dev # Start API in watch mode
pnpm --filter @slothforge/api build # Build API for production
pnpm --filter @slothforge/api test # Run API tests
pnpm --filter @slothforge/api test:watch # Run API tests in watch modepnpm --filter @slothforge/web dev # Start Next.js dev server
pnpm --filter @slothforge/web build # Build Next.js for production
pnpm --filter @slothforge/web start # Start production serverpnpm --filter @slothforge/db migrate:dev # Run migrations (dev)
pnpm --filter @slothforge/db migrate:deploy # Run migrations (prod)
pnpm --filter @slothforge/db studio # Open Prisma Studio
pnpm --filter @slothforge/db generate # Generate Prisma client
pnpm --filter @slothforge/db test # Run database testspnpm --filter @slothforge/shared test # Run shared package tests
pnpm --filter @slothforge/shared lint # Lint shared packageSlothForge requires several environment variables for external service integrations. Copy .env.example to .env and fill in the following:
| Variable | Default | Description |
|---|---|---|
NODE_ENV |
development |
Node environment (development, production, test) |
PORT |
3001 |
API server port |
| Variable | Required | Description |
|---|---|---|
DATABASE_URL |
β | PostgreSQL connection string |
REDIS_URL |
β | Redis connection string |
Local Development Values:
DATABASE_URL=postgresql://slothforge:slothforge_local@localhost:5432/slothforge
REDIS_URL=redis://localhost:6379| Variable | Required | Description | How to Obtain |
|---|---|---|---|
GOOGLE_GENERATIVE_AI_API_KEY |
β | Google Gemini API key | 1. Visit aistudio.google.com/app/apikey 2. Sign in with Google 3. Click "Create API Key" 4. Copy the generated key |
| Variable | Required | Description | How to Obtain |
|---|---|---|---|
LINEAR_API_KEY |
β | Linear API key for ticket management | 1. Visit linear.app/settings/api 2. Navigate to "Personal API keys" 3. Click "Create key" 4. Copy the generated key |
GITHUB_TOKEN |
β | GitHub Personal Access Token | 1. Visit github.com/settings/tokens 2. Click "Generate new token (classic)" 3. Select scopes: repo (all), admin:repo_hook (all)4. Click "Generate token" 5. Copy the token (save it securely!) |
NGROK_URL |
β | ngrok HTTPS URL for webhooks | 1. Install ngrok 2. Run ngrok http 30013. Copy the HTTPS forwarding URL |
-
Start Infrastructure:
docker compose up -d
-
Start ngrok (in a separate terminal):
ngrok http 3001
-
Update NGROK_URL in
.envwith the new URL -
Start Development Servers:
pnpm dev
-
Open Prisma Studio (optional, in a separate terminal):
pnpm --filter @slothforge/db studio
- Edit
packages/db/prisma/schema.prisma - Create a migration:
pnpm db:migrate
- Prisma will prompt you to name the migration
- The migration is automatically applied to your local database
Add dependencies to specific workspaces:
# Add to API
pnpm --filter @slothforge/api add <package-name>
# Add to Web
pnpm --filter @slothforge/web add <package-name>
# Add to Shared
pnpm --filter @slothforge/shared add <package-name>
# Add dev dependency
pnpm --filter @slothforge/api add -D <package-name># Run all tests
pnpm test
# Run tests for specific workspace
pnpm --filter @slothforge/api test
# Run tests in watch mode
pnpm --filter @slothforge/api test:watchIf you see "Port 3000 (or 3001) is already in use":
# Find and kill the process using the port
lsof -ti:3000 | xargs kill -9
lsof -ti:3001 | xargs kill -9If Docker services fail to start:
# Stop all services
docker compose down
# Remove volumes (WARNING: deletes all data)
docker compose down -v
# Start fresh
docker compose up -dIf the API cannot connect to PostgreSQL:
- Verify Docker services are running:
docker compose ps - Check DATABASE_URL in
.envmatches docker-compose.yml - Ensure migrations have been run:
pnpm db:migrate
If you see "Cannot find module '@prisma/client'":
# Regenerate Prisma client
pnpm --filter @slothforge/db generateIf you see import errors between workspaces:
# Rebuild all workspaces
pnpm buildIf webhooks stop working after restarting ngrok:
- Copy the new ngrok HTTPS URL
- Update
NGROK_URLin.env - Update webhook URLs in GitHub and Linear settings
- Restart the API:
pnpm --filter @slothforge/api dev
[Add your license here]
[Add contributing guidelines here]