AgentFoundry
Launch an AI-powered micro-business in 30 seconds
Created on 19th May 2026
•
AgentFoundry
Launch an AI-powered micro-business in 30 seconds
The problem AgentFoundry solves
Starting a service business takes weeks: writing a pitch, figuring out pricing, building a checkout, delivering the work. AgentFoundry collapses all of that into one text field.
You describe an idea — "resume optimization service" or "cold email writer" — and AgentFoundry:
- Generates the business — Claude writes the name, tagline, service description, and a specialized AI fulfillment prompt
- Creates a live storefront — instant public page with a working Locus payment checkout
- Fulfills every order automatically — when a customer pays, the AI agent delivers the output in seconds
- Adapts without you — a Lifecycle Intelligence engine watches every order and autonomously adjusts pricing, evolves the AI's prompt through iterative optimization, and regenerates the entire business concept if performance tanks
It's not a template builder. Every business is a live AI agent that self-improves over time — lower success rates trigger price cuts and prompt rewrites; sustained high demand raises prices and refines the agent's behavior. No code, no ops, no manual intervention.
Challenges I ran into
Claude cutting off mid-JSON — The business generator occasionally hit the token limit inside a nested string, producing truncated JSON that failed to parse. We fixed this with a three-layer extraction strategy: direct parse → code fence extraction → brace-boundary regex, plus increasing max_tokens and tightening the prompt to keep the fulfillment prompt concise.
Making the lifecycle engine testable — The adaptation logic touches pricing, prompt evolution (which calls Claude), and business regeneration (which also calls Claude) all in one run. Getting Jest mocks to intercept the right module boundaries required careful ordering — mocking @anthropic-ai/sdk before require('../src/lifecycle') is evaluated, so the Haiku call inside evolvePrompt never fires in tests.
Keeping state sane across the store layer — We needed the same codebase to run with an in-memory store in tests and Postgres in production with zero conditional logic in business code. We solved this with a factory pattern: store.js exports whichever implementation DATABASE_URL points to, and both satisfy the same async interface. TDD drove the Postgres implementation — 15 store tests written before a single SQL line.
Secret scanning blocking the first push — An .env file with a live API key had been committed in the root commit before .gitignore was in place. GitHub rejected the push. We rewrote history with an orphan branch and force-pushed to clear it from all reachable commits.
Technologies used
