Open source · MIT license

Spec-driven code generation with multi-agent orchestration

Write a markdown spec. Run forge build. Specialized agents collaborate through structured API contracts, run in parallel, and self-correct when the reviewer finds issues.

8
Specialized agents
8
Project templates
5+
LLM providers
my-app — forge build
$ forge build

Phase 1: Planning
  5 tasks planned
    task_01  Set up project structure
    task_02  User authentication API
    task_03  Dashboard + data endpoints
    task_04  React frontend with auth flow
    task_05  GitHub Actions + Dockerfile

Phase 1b: Project Manager
    task_01  Set up project structure        → coder
    task_02  User authentication API         → backend
    task_03  Dashboard + data endpoints      → backend
    task_04  React frontend with auth flow   → frontend
    task_05  GitHub Actions + Dockerfile     → ci

Phase 2: Building
  Parallel scheduler: 5 tasks across {coder, backend, ci, frontend}

  [1/5] Set up project structure
        + requirements.txt
        + main.py
  [2/5] User authentication API               
        + src/auth.py                         [5/5] GitHub Actions
        + src/routes/auth.py                        + .github/workflows/ci.yml
        3 API contracts registered                  + Dockerfile
  [3/5] Dashboard + data endpoints
        + src/routes/dashboard.py
        + src/services/data.py
        2 API contracts registered
  [4/5] React frontend with auth flow
        Contracts: GET /auth/me, POST /auth/login, GET /dashboard, ...
        + frontend/src/pages/Login.jsx
        + frontend/src/pages/Dashboard.jsx

Phase 3: Review
  Contract validation: 1 issue
    POST /auth/login has no auth configured
  Reworking src/auth.py → backend
        ~ src/auth.py (fixed by backend)
  Review passed.

Build complete. 11 files written. Contracts saved.

How it works

Three steps to a working codebase

No prompt engineering. No copy-pasting. Describe what you want and run one command.

01

Install and scaffold

Install Forge, pick a template, and get a project directory with a pre-configured .forge/ folder.

02

Write a spec

Edit .forge/spec.md in plain English. Describe what the app does, its features, stack preferences, and non-goals.

03

Build

Run forge build. The pipeline plans, assigns agents, writes files, and runs a review pass with auto-fix.

.forge/spec.md
# Project: Task Tracker ## What A web app for managing personal tasks with user accounts. ## Features - Email + password login (JWT) - Create, complete, and delete tasks - Tasks belong to the logged-in user - Dashboard: pending vs completed ## Stack React + Vite, FastAPI, SQLite ## Non-goals No team features. No due dates. No notifications.
Non-goals prevent scope creep. Forge follows your constraints exactly — list what you don't want to keep the output focused.
$ forge build # classic pipeline $ forge build --adk # 7-agent parallel mode $ forge dev # run locally

Agent pipeline

Agents collaborate, not just execute

Agents share structured API contracts and full code through a thread-safe artifact bus. The reviewer sends fixes back to the specialist that wrote the file.

1Planner spec → task list + tech decisions
2Project Manager assigns agents, writes per-task prompts
3
Backend + CI + Deployparallel
Backend API routes, DB models → publishes contracts
CI   GitHub Actions, Dockerfile
Deploy  Railway / Render / Vercel configs
4Frontend reads contracts → generates matching UI
5Security reads all code from bus, audits OWASP
6Reviewer contract validation, cross-file review
7Rework fixes route back to original agentnew
ArtifactBus + ContractRegistry — agents publish typed artifacts (code, decisions, contracts) to a shared thread-safe store. The frontend gets exact endpoint shapes. Security reads real code, not filenames. Contracts persist across incremental builds.
Agentic Firewall — every write is validated before touching disk. Agents cannot write outside the project root, touch .env, or embed eval(). All decisions are logged.
AgentResponsibility
project-managernew Takes the planner's task list and writes a precise, self-contained prompt for each agent — with stack context, files to generate, and API contracts.
planner Reads spec and rules, decides tech stack, breaks the project into 3–8 ordered tasks. Avoids ORMs and TypeScript unless explicitly requested.
backend Generates FastAPI routes, SQLite models (raw SQL), Pydantic schemas, service layer. Publishes structured API contracts (endpoints, schemas, auth) to the ContractRegistry.
frontend Reads structured contracts from the registry + backend code from the ArtifactBus. Generates React + Vite pages that match backend endpoints exactly.
security Reads all code from the ArtifactBus (not just filenames). Audits against OWASP Top 10, checks auth coverage via contracts. Patches files in place.
ci Generates GitHub Actions workflows, Dockerfile, and docker-compose based on the project's stack.
deploy Generates Railway, Render, Vercel, or Fly.io configuration from stack decisions.
reviewer Reads all code from the bus. Runs automated contract validation (frontend vs backend). Routes fixes back to the original specialist agent — not a generic coder. One retry per file.

Templates

Start from a blueprint

Each template ships with a pre-filled spec, build rules, and a firewall policy for its stack.

web-appReact + Vite, FastAPI, SQLite, Tailwind
api-onlyFastAPI, Pydantic, SQLite — no frontend
ai-appReact + FastAPI with OpenAI or Anthropic
chrome-extChrome Manifest V3, vanilla JS or React
cli-toolPython CLI, Click or Typer, Rich output
data-vizStreamlit or React with Plotly / Recharts
slack-botPython, slack-bolt, FastAPI handler
discord-botPython, discord.py, slash commands
$ forge new my-app -t web-app $ forge templates # list all templates

Features

Built for iteration

Forge treats building software as a process, not a single LLM call.

Structured API contracts

Backend publishes machine-readable endpoint schemas. Frontend consumes them. No more POST /api/users vs POST /users mismatches. Contracts persist to .forge/contracts.json across builds.

Parallel execution

Independent agents (backend, CI, deploy) run concurrently via a dependency-aware scheduler. Both classic and ADK modes.

Self-correcting review

Reviewer finds a bug in your backend? The fix goes to the backend agent — not a generic coder. One retry per file, tracked for observability.

Any LLM provider

Anthropic, OpenAI, Together, Groq, or local Ollama. Set an env var, switch with --provider.

Incremental features

Add to an existing project. Contracts from previous builds are loaded so new code knows what endpoints exist.

$ forge build --feature "add JWT refresh tokens"

Resumable + distributed

State saved after every task. forge agents start exposes each agent as an HTTP A2A server on ports 8101–8108.


Get started in under a minute

Core install needs only pyyaml. LLM providers and ADK mode are optional extras.

$ pip install forge-ai # classic mode $ pip install "forge-ai[adk]" # + 7-agent parallel mode $ export ANTHROPIC_API_KEY=sk-ant-... # or OPENAI_API_KEY, TOGETHER_API_KEY, GROQ_API_KEY $ forge new my-app -t web-app $ cd my-app $ $EDITOR .forge/spec.md $ forge build $ forge dev