sweagent
The planning layer that makes Cursor, Claude Code, and Codex 10x more effective.
14 domain-specialized AI agent pipelines — Planning, Requirements, Data Modeling, API Design, Auth, Backend, Frontend, and more — each with dedicated orchestrators, sub-agents, and structured outputs. Generate implementation-ready blueprints, then hand them to your coding agent.
AI Coding Agents Need a Planning Layer
Coding agents are powerful executors, but they fail at planning. Without structured blueprints, they guess and produce half-finished code.
Without sweagent
A coding agent receives "build a task manager" and immediately starts writing code:
- Picks a random framework — maybe Express, maybe Fastify
- Invents a database schema on the fly, misses relationships
- Forgets authentication entirely
- Skips error handling and edge cases
- Produces something that sort-of runs but needs a rewrite
With sweagent
The coding agent receives a structured blueprint before writing a single line:
- 11-section markdown plan with tech stack, data models, API routes
- Structured JSON requirements with actors, flows, and stories
- Database schemas with field types, relationships, and indexes
- API contracts with endpoints, methods, and auth requirements
- Frontend architecture with pages, components, and routing
Four Stages to a Perfect Blueprint
Each plan walks through structured stages with dedicated LLM calls — not a single-shot prompt. 8+ sequential calls produce traceable, reviewable results.
Discovery
Understands the project, asks clarifying questions
Requirements
4 sequential LLM calls to flesh out the spec
Design
2 sequential LLM calls for technical design
Synthesis
Assembles the final implementation plan
plan.md with 11 sections
Enterprise-Grade Planning Infrastructure
Not a wrapper around a single LLM call. A system of specialized pipelines purpose-built for software engineering.
14 Domain Agent Modules
Planning, Requirements, Data Modeling, API Design, Auth, Backend, Frontend — each a self-contained pipeline with dedicated orchestrators.
Multi-Stage Pipelines
Every agent progresses through discovery, requirements, design, and synthesis — with dedicated LLM calls at each step. No single-shot prompts.
Sub-Agent Orchestration
Complex domains delegate to specialized sub-agents — entity-analyzer, schema-refiner, graphql-analyzer — that run in isolation and return condensed results.
Multi-Provider Models
Unified API for OpenAI, Anthropic, and Google. One createModel() call, zero provider lock-in. Switch models in config, not in code.
Type-Safe Tools
Define tools with Zod schemas. Full type inference and validation before execution. Invalid input never reaches your handler.
Plan Validation
LLM-based judge validates that planning output meets all criteria for a coding agent to start implementing. No incomplete blueprints.
MCP Protocol
Connect to Model Context Protocol servers over HTTP or stdio. Lazy connection, typed tool invocation for seamless integration.
Zero Extra Deps
All provider SDKs (OpenAI, Anthropic, Google) are included. Set your API keys and go — no extra packages needed.
Specialized Pipelines for Every Layer
Each module is a self-contained domain agent with its own orchestrator, sub-agents, tools, and output format.
Planning Agent
Implementation-ready markdown plan (11 sections)
Requirement Gatherer
Structured JSON (actors, flows, stories, modules)
Data Modeler
MongoDB/PostgreSQL schemas
API Designer
REST and/or GraphQL API design
Auth Designer
Auth strategy, flows, middleware, RBAC
Backend Architect
Backend architecture (Express/Apollo)
Frontend Architect
Frontend architecture (React/Next.js)
Express Builder
Express.js REST API config
Apollo Builder
Apollo GraphQL subgraph config
React Builder
React + Vite app config from GraphQL
Next.js Builder
Next.js App Router config
Execution Planner
Phased implementation plan
Up and Running in 60 Seconds
$ npm install sweagent
import { runPlanningWithResult } from 'sweagent';
const { planning, plan } = await runPlanningWithResult({
input: 'Task manager app with user auth, task CRUD, assignments, and a dashboard',
model: { provider: 'openai', model: 'gpt-4o-mini' },
});
if (planning) {
console.log('Plan is implementation-ready.');
console.log(plan); // Full markdown blueprint
} Built for Your Coding Agent
Generate blueprints, save them, and let your favorite coding agent implement step by step.
Cursor
Save plan to .cursor/rules/ or paste into chat. Every agent session uses your blueprint as context.
writeFileSync("plan.md", plan) Claude Code
Save as CLAUDE.md for automatic context. Claude Code reads it on every session start.
writeFileSync("CLAUDE.md", plan) Codex
Feed structured JSON specs as context. Codex excels with machine-readable requirement documents.
writeFileSync("requirements.json", output) How the Pipeline Flows
Your idea flows through specialized layers — from discovery to framework-specific builders — producing implementation-ready specs at every stage.
Stop Guessing. Start Planning.
Give your AI coding agent the structured blueprints it needs. Generate implementation-ready plans in seconds.
npm install sweagent