For agents
The language was measured against real agent sessions. These habits keep both tokens and round trips low.
The cheapest loop
- Kit first, once per file. Colors, type presets and every repeated shape as parts. Later calls send only nodes.
- Build whole screens in one call. A list of nodes builds several top-level layers at once.
- Read the reply, not a screenshot. Warnings and
expectmisses name the layer and the fix. Ask for--previewwhen you need to see the result, not after every call. - **Read back with
source, change with--sync.** Never rebuild from scratch to change a value.
Budget
| Task | Typical cost |
|---|---|
| A kit for an app | 600 to 1,000 tokens, once |
| A phone screen using the kit | 600 to 1,000 tokens |
Reading a screen back (source) | 1,500 to 2,000 tokens |
| A component set with states and behavior | 800 to 1,500 tokens |
When something goes wrong
| Reply says | Do |
|---|---|
INPUT_IGNORED with a suggestion | fix the key it names |
"x" is not a key, a kit preset or part, or a component | check facet kit and facet components |
NOT_APPLIED: width "fill" needs an auto-layout parent | put the layer in a row or column, or give a number |
LAYOUT_OVERFLOW | let the frame hug, make it larger, or say "overflow": "hidden" if the clipping is meant |
EXPECT_FAILED | change the layout until the expectation holds |
Outcome unknown after a long build | the host may still be working: wait, then find before retrying |
Machine-readable documentation
- llms.txt lists every page with a one-line summary.
- llms-full.txt is all of it in one file, examples included.
facet guideprints the whole reference;facet guide referenceprints it as JSON.
MCP
facet mcp serves the same tools over MCP on stdio, acting on the design in front in Facet (and opening Facet if it is not running); facet --doc f.facet mcp serves one file instead. Connect your AI sets it up in each app.