Skills, verification, and correction
Before you start: the basics and host actions.
An agent needs to know which components exist and how to use them. It also needs feedback when a document is wrong. Relo includes authoring skills, document validation, and interaction verification. The assistant example adds a local correction step for common generation errors.
These tools support both writing Relo with a coding agent and generating responses inside an app. The setup differs: your coding agent reads the source and runs checks during development; the assistant backend verifies each generated response automatically.
Skills provide working patterns
The assistant skills cover:
| Skill | Guidance |
|---|---|
ui-authoring | Mobile layout, themes, labels, props, bindings, writable state, and interaction traces |
mini-apps | Persistent lists, controlled edits, complete service results, and reusable list components |
maps | The example host's map registration, catalog places, selection events, and assertions |
For example, the layout guidance tells an agent to keep response cards content-sized, let long labels wrap, and avoid nested cards that consume the available width. The mini-app skill shows how to update a list from a service result instead of trying to mutate a read-only loop item.
The assistant includes all three skills in its initial instructions. It also reads component signatures and valid style presets from the actual XML. A coding agent can read these files from the repository; no editor-wide installation happens automatically.
Check structure and behavior
| Tool | Input and result |
|---|---|
relo validate | Accepts a complete document and reports parser and preparation errors |
relo verify | Accepts a document, interaction steps, and mocks; reports assertions, controls, and action calls |
verify_ui | Assistant development tool: accepts source and data_json, assembles the subtree, and checks it |
verify_behavior | Assistant development tool: also accepts steps_json and mocks_json to check interactions |
read_skill | Assistant development tool: reads an included skill by name |
The matching Rust server SDK archive contains bin/relo. To validate a complete document, run the extracted executable. This path assumes you placed it at the assistant example’s default location:
artifacts/rust/server/relo validate path/to/document.json
The three assistant development tools are defined in backend/app/assistant/graph.py. They are tool definitions you can integrate, not globally installed commands. The example's generation loop already has the skills and performs verification automatically, so it doesn't ask the model to call those tools for each response.
Portable validation can defer host-specific registrations and custom native decoding. Also prepare the document in the app that will render it.
Make an invalid XML edit to see a diagnostic. The editor keeps the last valid preview visible. It validates edits but does not run the assistant's automatic correction pipeline.
Test what the user can do
A behavior trace targets a control by its accessible label, performs an interaction, and checks the result. For a task-list checkbox, that means checking that the service was called and the completion count changed.
Mocks supply service results without making live mutations. They must match the action's actual result shape. The verifier can check visible text, controls, emitted events, and action payloads, and can inject service failures.
The task-list tutorial includes a complete runnable check. Change its expected summary to see the verifier reject an incorrect result.
Fix common mistakes without another model call
The assistant's correction pipeline handles recognized mistakes before asking the model to try again. For example, it can escape an ampersand in an XML attribute, convert an unambiguous value reference into an explicit binding, or put a complete mock result inside the required result envelope.
After a correction, the backend reruns the parser, state checks, and original behavior assertions. It records which rules ran and retains the authored source. It does not fill in missing business values or remove a failed assertion.
If the candidate still fails, the model receives the diagnostic and can return a correction. The example allows up to three model repair attempts within its overall call budget. A failed generation leaves earlier conversation cards available.
Reduce avoidable round trips
The example keeps three jobs out of the model's response loop where possible:
- Reading known guidance: skills are already in the initial instructions.
- Checking a final candidate: the backend invokes verification itself.
- Fixing recognized syntax errors: local rules run before another model request.
Independent information lookups can also run in one batch. Together, these choices reduce the number of requests needed to produce a working response. They do not remove the need for the model to fix an unsupported expression or rethink a broken interaction.
Verification covers the supplied steps. Check native layout, focus, larger text, and other interaction paths with application tests. The assistant implementation guide describes the evaluation tools and recorded measurements.