Human apps.Zero walls.Write your application contract once. Humans use it through browsers. AI agents operate it through tools. The agent evolves with every run.
This single defineAPI() definition automatically creates: HTTP JSON API (Hono), MCP Tools (Claude Desktop), A2A Skills (Google Agent-to-Agent), OpenAPI 3.1 Spec.
import { defineAPI } from "@zauso-ai/capstan-core";
import { z } from "zod";
// One contract — humans use it via HTTP, agents via MCP/A2A
export const GET = defineAPI({
input: z.object({
status: z.enum(["open", "closed"]).optional(),
}),
output: z.object({
tickets: z.array(z.object({
id: z.string(),
title: z.string(),
status: z.string(),
})),
}),
description: "List support tickets",
capability: "read",
resource: "ticket",
async handler({ input }) {
return { tickets: await db.tickets.list(input) };
},
});agents/triage.tsimport { createSmartAgent } from "@zauso-ai/capstan-ai";
import { defineSkill } from "@zauso-ai/capstan-ai";
// Smart agent with 12 production features
const agent = createSmartAgent({
model: "claude-sonnet-4-20250514",
tools: [listTickets, assignTicket, resolveTicket],
skills: [triageSkill],
maxTurns: 20,
timeout: { total: 120_000, perTool: 30_000 },
budget: { maxTokens: 100_000 },
compression: { strategy: "sliding-window" },
});
// Skills give agents strategic guidance
const triageSkill = defineSkill({
name: "triage",
when: "ticket needs priority assessment",
strategy: "Check severity, customer tier, SLA deadline",
});defineAPI() serves HTTP for humans AND MCP/A2A tools for agents. Same contract, zero glue.
createSmartAgent() with 12 production features: compression, fallback, validation, timeouts, watchdog, budgets.
defineSkill() gives agents high-level strategies. Not just tools — strategic guidance for complex problems.
Agents learn from every run. Experience → Strategy → Skill. Gets smarter over time.
React SSR, file routing, Drizzle ORM, selective hydration. Everything you need for human-facing apps.
JWT, OAuth, DPoP, SPIFFE/mTLS, rate limiting, CSRF. Human AND agent auth built in.
capstan verify --json. 8-step verification cascade. AI agents self-correct.
HTTP, MCP, A2A, OpenAPI from one definition. Agents discover your app automatically.
| Feature | Next.js | LangChain | Capstan |
|---|---|---|---|
| Wall between web & agent | 🧱 | 🧱 | + |
| Multi-protocol (HTTP + MCP + A2A) | – | – | + |
| Smart agent runtime | – | + | + |
| Skill layer + evolution | – | – | + |
| React SSR | + | – | + |
| File-based routing | + | – | + |
| Built-in auth (JWT + OAuth + API keys) | – | – | + |
| Built-in database layer | – | – | + |
| AI TDD verifier | – | – | + |
| OpenAPI auto-generation | – | – | + |
| Long-term memory | – | ~ | + |
| Policy engine + approval workflow | – | – | + |
+ built-in ~ partial – not available 🧱 total wall | Full comparison
bunx create-capstan-app my-agentimport { createSmartAgent } from "@zauso-ai/capstan-ai";
const agent = createSmartAgent({
model: "claude-sonnet-4-20250514",
tools: [listTickets, assignTicket],
skills: [triageSkill],
});bunx capstan dev
# MCP server auto-available for Claude Desktopbunx create-capstan-app my-appcd my-app && bunx capstan devYour app is live with all agent endpoints ready:
# Agent manifest
curl http://localhost:3000/.well-known/capstan.json
# OpenAPI spec
curl http://localhost:3000/openapi.json
# MCP server (for Claude Desktop / Cursor)
bunx capstan mcp@zauso-ai/capstan-ai provides the full smart agent runtime. createSmartAgent() for production agents, defineSkill() for strategic guidance, and self-evolution that learns from every run.
import { createSmartAgent, defineSkill } from "@zauso-ai/capstan-ai";
// Production-ready agent with 12 built-in features
const agent = createSmartAgent({
model: "claude-sonnet-4-20250514",
tools: [searchDocs, createTicket, sendEmail],
skills: [customerSupport, escalation],
maxTurns: 30,
timeout: { total: 120_000, perTool: 30_000 },
budget: { maxTokens: 200_000 },
compression: { strategy: "sliding-window" },
fallback: { model: "claude-haiku-4" },
validation: { validateToolArgs: true },
watchdog: { maxConsecutiveErrors: 3 },
});
// Skills evolve from experience
const customerSupport = defineSkill({
name: "customer-support",
when: "user has a support question",
strategy: "Search docs first, then check ticket history, escalate if unresolved",
});
// Agent learns and improves over time
// Experience -> Strategy -> Skill -> EvolutionInstall Capstan, create your first project, and understand the project structure.
Learn about defineAPI, the CapabilityRegistry, middleware, and the multi-protocol architecture.
Define models with typed fields, set up relations, and use auto-generated CRUD operations.
Complete reference for all framework functions, types, and configuration options.