AI code generation
AI code generation is producing working code from a natural-language description — a function, a component, a module, or an entire application. It spans everything from a chat request for one function to an app builder scaffolding a full project from a spec.
Quality tracks specification quality more than it tracks model quality. The same model produces very different results from "build a login page" and from a description that names the auth method, the validation rules, the error states, and where the session lives.
The recurring mistake is judging generated code by whether it runs. Running is the low bar; the questions worth asking are whether it handles failure, whether it matches the patterns around it, and whether the access control is real.
What this means in practice
For anything larger than a function, state the constraints that are invisible in code: framework versions, patterns your team requires, and what must not change. Generation fills gaps with plausible defaults, and defaults are where the surprises live.
Prompts for the tools this applies to
Related terms
- AI code completion
AI code completion predicts and suggests the code you are about to write, usually as inline grey text you accept with Tab.
- Text to app
Text to app describes tools that generate a working application from a written description — pages, data model, and often auth and deployment — without you writing the scaffolding.
- Design to code
Design to code is generating working interface code from a visual input or a description of one — a screenshot, a Figma file, or written art direction.
- Spec-driven development
Spec-driven development means writing a precise specification before generating any code, then using that spec as the prompt.