adding-a-feature
Adding a Feature — The Four-Area Checklist
Rule
Every new feature MUST update all four areas. Skipping any one breaks the agent-native contract — the agent and UI must always be equal partners.
Why
Agent-native apps are defined by parity: everything the UI can do, the agent can do, and vice versa. A feature that only has UI is invisible to the agent. A feature that only has scripts is invisible to the user. A feature without app-state sync means the agent is blind to what the user is doing.
The Checklist
When you add a new feature, work through these four areas in order:
1. UI Component
Build the user-facing interface — a page, component, dialog, or route. Use useActionQuery and useActionMutation from @agent-native/core/client to call actions for data fetching and mutations. Do not create a custom REST endpoint just so React can call action-backed data; the action endpoint already exists.
Auto-refresh on agent writes is non-negotiable — when the agent mutates data, the UI must reflect the change without a manual refresh. There are two paths, and you must pick the right one: