Core Concepts
Appgrammar
An appgrammar is a precompiled blueprint — a DAG (directed acyclic graph) of modules and steps that guides an AI agent through building an application. It contains:
- Modules — logical groups of related functionality (e.g. "authentication", "database", "API routes")
- Steps — individual build actions within a module (e.g. "create user model", "add login endpoint")
- System prompt — context and conventions injected at execution start
- Design system — UI framework, colors, typography decisions
Stages and Parallel Groups
During execution, steps are organized into stages. Each stage contains one or more parallel groups:
- Groups within the same stage can run concurrently (no dependencies between them)
- Steps within a group must run sequentially
- The next stage only starts after all groups in the current stage complete
This structure maximizes parallelism while respecting dependency ordering.
Tokens
Execution uses single-use UUID tokens to chain stages. Each call to appgrammar_next consumes one token and returns the next token. This ensures:
- Steps are executed in order
- No step is skipped or repeated
- Execution state is tracked server-side
When appgrammar_start is called, it returns the first step along with all remaining tokens so the agent can plan ahead.
Tool Operations
Beyond creation and execution, appgrammars support 25+ tool operations for composition, transformation, and analysis. These fall into categories:
- Composability — breed, fork, splice, shatter, weave
- Transformation — transmute, distill, amplify, style_transfer
- Algebra — subtract, intersect, difference, fuzz
- Governance — inoculation, phenotyping
- Discovery — search, topological_search
Multi-turn tool operations use a token-based progression system. Call the tool to start, then use appgrammar_tool_submit with the returned token to advance through each step.
Conventions
Teams can define conventions — coding rules that get injected into the execution context when an agent runs a team-owned appgrammar. Conventions are matched by technology tags (e.g. ["typescript", "react"]) and formatted as markdown sections in the system prompt.
Convention packs group related conventions together and can be marked as default for a team.
The 5-Step Creation Pipeline
Every appgrammar is created through a 5-step pipeline:
- Architecture — Extract or generate the module graph, technology choices, and dependency structure
- Design System — Define the visual language: framework, colors, typography, component patterns
- Task DAG — Order the build steps, identify parallel groups, resolve dependencies
- File Registry — List every file to be created with its exports, imports, and role
- Enrichment — Generate compressed specifications for each build step
For existing codebases, the decompiler runs this same pipeline in reverse, analyzing source code to produce an appgrammar.