Skip to main content

Creating Appgrammars

Every appgrammar is built through a 5-step pipeline that progressively refines a text description into a complete, executable blueprint. This guide covers how the pipeline works and how to use it via MCP.

Starting Creation

Call appgrammar_create with your description and optional configuration:

{
"description": "A project management app with kanban boards and real-time updates",
"language": "typescript",
"framework": "next.js",
"database": "postgresql",
"mode": "production"
}

All parameters except description are optional. The response includes an appgrammar_id, a token, and the first step's prompt to run on your LLM.

The 5 Steps

Step 1: Architecture

Extracts or generates the module graph. The output defines every module (authentication, database, API routes, UI components), their dependencies, and the technology stack. This is the skeleton of the entire plan.

Step 2: Design System

Defines the visual language: CSS framework, color palette, typography, spacing, and component patterns.

Step 3: Task DAG

Orders build steps into a directed acyclic graph with parallel groups. Tasks within a group run sequentially; groups within the same stage run concurrently.

Step 4: File Registry

Lists every file with its path, exports, imports, module membership, and role. This becomes the reg field in every execution step.

Step 5: Enrichment

Generates compressed specifications for each step: function signatures, data structures, API contracts, and validation rules. These become the desc field agents read during execution.

Submitting Step Results

After running each prompt on your LLM, submit the structured output via appgrammar_create_submit:

{
"appgrammar_id": "uuid-from-create",
"token": "token-from-previous-response",
"result": { "...structured JSON output from LLM..." }
}

The server validates the result against the expected schema. Three possible outcomes:

  • Next step -- returns the next prompt and token. Continue the pipeline.
  • Validation error -- returns error details, a retry_token, and retries_remaining. Fix the output and resubmit.
  • Complete -- returns status: "ready" with step count and preview. The appgrammar is ready for execution via appgrammar_start.

Configuration Options

ParameterValuesDefault
languagetypescript, pythontypescript
modeprototype, productionprototype
databasesqlite, postgresql, mysql, mongodbinferred
deploymentdocker-compose, kubernetes, serverless, railwayinferred
execution_modefast, economicfast

prototype mode produces fewer steps. production mode adds comprehensive testing, error handling, logging, and CI/CD configuration. In the web UI, the Dashboard creation form walks you through the same pipeline with live SSE progress.