THE MANUAL
How Chirai Works
Chirai transforms a plain English prompt into a fully deployed production app by running it through 11 sequential AI-powered stages. Each stage has a specific job — from understanding your intent to validating TypeScript before deploy.
The pipeline never skips stages. Every app — from a one-page landing to a Tier 5 enterprise platform — goes through all 11 stages. Simpler apps simply pass through them faster.
The 11 Stages
chirai-analyzer extracts app features, integration needs, and platform targets from your prompt.
chirai-classifier scores complexity from 1 to 5, and routes each task to the appropriate model in the multi-model router.
chirai-architect generates the full IR (Intermediate Representation) — screens, data models, API endpoints, auth surfaces.
chirai-designer creates a design brief: typography system, brand colors, animation personality, icon library.
chirai-builder runs layered generation across 11 phase groups — design system, screens, stores, API routes, config files.
chirai-hardener applies 14 deterministic zero-cost fix patterns to every file: deprecated imports, wrong patterns, broken auth surfaces.
chirai-inspector runs 40+ structural checks and auto-repairs failing files with AI assistance.
chirai-auditor reads every generated file semantically and flags runtime-level logic errors for surgical repair.
chirai-validator runs a TypeScript dry-run. Errors are repaired in a compile → repair loop before any build is attempted.
chirai-crawler boots your app locally and crawls every registered route. A single 404 blocks deployment.
chirai-deployer pushes to Vercel with your Supabase project auto-provisioned.
Writing Good Prompts
Chirai works best with specific, feature-rich prompts. The more you describe, the better chirai-architect can plan the right screens and data models.
Good: "Build a SaaS project management app with kanban boards, sprint planning, team roles (admin, member, viewer), time tracking, and a Slack notification integration."
Too vague: "Build a project app."
You don't need to name files or technical details. Just describe what the app does and who uses it. Chirai handles architecture, tech stack, and implementation.
Mention the platform early: "Build an iOS app for..." triggers the mobile pipeline when available.
Complexity Tiers
Tier 1: Landing pages, single-feature tools. 10–20 files. $0.30–$0.70. Tier 2: Simple dashboards, habit trackers, basic CRUD apps. 25–40 files. $0.80–$1.50. Tier 3: Standard SaaS apps with auth, data, multiple screens. 40–60 files. $1.50–$2.20. Tier 4: Complex platforms with roles, multi-tenancy, advanced features. 60–80 files. $2.20–$3.50. Tier 5: Enterprise apps, multiplayer games, real-time systems. 80+ files. $3.50–$6.00+.
Chirai detects tier automatically from your prompt. You can also specify a tier cap if you want to control cost.
API Reference
Start a build: POST /api/build Body: { prompt, platform, authProvider, jobId, userApiKeys? }
Stream build events (SSE): GET /api/build/:jobId/stream Events: log, stage, phase, complete, error
Get build status: GET /api/build/:jobId
Get file tree: GET /api/build/:jobId/files
Get a file: GET /api/build/:jobId/file?path=src/app/page.tsx
Get page recommendations: GET /api/build/:jobId/recommendations
Add a recommended page: POST /api/build/:jobId/add-page Body: { recommendationId, payuTransactionId }
Frontend chat: POST /api/build/:jobId/chat Body: { message, scope: "frontend" }
Initiate deploy (PayU): POST /api/build/:jobId/deploy
Initiate download (PayU): POST /api/build/:jobId/download