Skills

Client Methods

Client method surface rules.

Install

npx skills add BuilderIO/agent-native --skill client-methods -g -a claude-code -y
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

  1. Look for an existing client API first.

    NeedUse
    App action reads/writesuseActionQuery / useActionMutation from @agent-native/core/client/hooks
    Imperative action callscallAction from @agent-native/core/client/hooks
    Browser application statereadClientAppState, writeClientAppState, setClientAppState, deleteClientAppState from @agent-native/core/client/hooks
    Navigation/app-state syncuseAgentRouteState / useSemanticNavigationState from @agent-native/core/client/navigation
    Agent chat contextAgent chat helpers from @agent-native/core/client/agent-chat
    Ask the user a multiple-choice question from app codeaskUserQuestion from @agent-native/core/client/agent-chat (renders inline in the agent panel; answer goes to the agent, do not build a custom modal)
    Live syncuseDbSync, useChangeVersion, useChangeVersions from @agent-native/core/client/hooks
    Extension iframe callsappAction, appFetch, extensionFetch from the extension runtime
Read the whole SKILL.md on GitHub

More in Engineering