
Client Methods
Client method surface rules.
Install
npx skills add BuilderIO/agent-native --skill client-methods -g -a claude-code -y- Repository
- BuilderIO/agent-native7.6k
- Category
- Engineering
- Updated
- 3d ago
- License
- MIT
- Context cost
- Lightabout 1,147 tokens
- Runs scripts
- No, instructions only
What it does
Client method surface rules. Use when wiring browser/client code to actions, application state, framework routes, app APIs, uploads, auth, or settings.
Client Methods
Rule
Browser/client code imports named methods, hooks, or client modules instead of hand-writing REST calls to framework or app routes.
Why
Route shapes are transport details. If components and docs call
fetch("/_agent-native/...") or template /api/* routes directly, every caller
has to rediscover auth, base paths, request-source headers, JSON parsing, error
handling, optimistic updates, sync invalidation, and route quirks. A named client
method gives the UI, docs, and future agents one stable contract.
How
-
Look for an existing client API first.
Need Use App action reads/writes useActionQuery/useActionMutationfrom@agent-native/core/client/hooksImperative action calls callActionfrom@agent-native/core/client/hooksBrowser application state readClientAppState,writeClientAppState,setClientAppState,deleteClientAppStatefrom@agent-native/core/client/hooksNavigation/app-state sync useAgentRouteState/useSemanticNavigationStatefrom@agent-native/core/client/navigationAgent chat context Agent chat helpers from @agent-native/core/client/agent-chatAsk the user a multiple-choice question from app code askUserQuestionfrom@agent-native/core/client/agent-chat(renders inline in the agent panel; answer goes to the agent, do not build a custom modal)Live sync useDbSync,useChangeVersion,useChangeVersionsfrom@agent-native/core/client/hooksExtension iframe calls appAction,appFetch,extensionFetchfrom the extension runtime
