π€ Clera and AIΒΆ
AI assistants can build Clera apps extremely well, but only if they understand Cleraβs model correctly. Without guidance, most AI tools default to React or Vue patterns that do not work in Clera.
This section provides:
A mental model overview for AI users
A master build prompt you can copy into any AI tool
Rules that keep AI-generated code idiomatic
Component and scaffolding prompts for common tasks
π€ Why AI and Clera work well togetherΒΆ
Cleraβs model is simple enough that a well-prompted AI can generate correct, working apps on the first try:
HTML structure is explicit:
<app>,<page>,<form action="...">JavaScript is plain global functions with no classes, hooks, or imports
HTML wires to JavaScript by name matching on the
actionattribute, with nothing to configurecontextis passed automatically to every action function, with no dependency injection needed
A correctly prompted AI understands these rules and produces clean Clera code. An incorrectly prompted AI produces React components inside Clera pages, which does not work.
π€ How to use these docs with AIΒΆ
The most effective approach:
Copy the master prompt from 02 Build Prompt into your AI toolβs system prompt or at the start of your conversation
Describe what you want to build
The AI generates correct Clera HTML and JavaScript
For component generation or app scaffolding, use the specific prompts in Component generation prompt and Full app scaffolding prompt.