anvil · documentation · gallery · llms.txt
Explanation

About one JSON dialect

anvil exists to answer a narrow question: what is the best thing for an agent to produce when asked for an animation? The answer anvil commits to is a single declarative JSON document — the SceneSpec — rather than imperative rendering code.

This matters because the two options have very different failure modes. Code that an agent writes must be bundled, must compile, and can fail in ways that are hard to detect without running it. A JSON document conforming to a published schema can be validated cheaply, diffed, cached, regenerated, and served from anywhere. It is the same artifact whether it is committed to a repo, streamed out of a tool call, or built per-request by a Worker.

There is a deeper reason. A language model is markedly better at emitting a constrained, well-described data structure than at emitting correct, build-ready source in an arbitrary framework. By collapsing “make an animation” down to “fill in this schema,” anvil plays to the model's strengths and removes the build step from the loop entirely.

The cost is expressiveness: you can only animate what the SceneSpec can describe. anvil accepts this trade deliberately. The schema is meant to grow by adding presets and geometry types — widening what is “describable” — rather than by opening an escape hatch into raw code. See the SceneSpec reference for the current surface.